rx-player 3.26.1 → 3.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/checks.yml +99 -0
- package/.github/workflows/sonarcloud_analysis.yml +20 -0
- package/CHANGELOG.md +99 -71
- package/README.md +19 -18
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/clear_element_src.js +8 -6
- package/dist/_esm5.processed/compat/eme/close_session.js +1 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +1 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +3 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +6 -4
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +1 -2
- package/dist/_esm5.processed/compat/eme/generate_key_request.js +1 -2
- package/dist/_esm5.processed/compat/eme/load_session.js +2 -3
- package/dist/_esm5.processed/compat/event_listeners.d.ts +3 -2
- package/dist/_esm5.processed/compat/event_listeners.js +8 -14
- package/dist/_esm5.processed/compat/make_vtt_cue.js +1 -1
- package/dist/_esm5.processed/compat/on_height_width_change.js +1 -2
- package/dist/_esm5.processed/compat/set_element_src.js +1 -1
- package/dist/_esm5.processed/compat/when_loaded_metadata.js +1 -2
- package/dist/_esm5.processed/compat/when_media_source_open.js +1 -2
- package/dist/_esm5.processed/config.d.ts +3 -8
- package/dist/_esm5.processed/config.js +4 -9
- package/dist/_esm5.processed/core/abr/abr_manager.d.ts +11 -10
- package/dist/_esm5.processed/core/abr/abr_manager.js +47 -8
- package/dist/_esm5.processed/core/abr/bandwidth_estimator.js +1 -1
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.d.ts +2 -2
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.js +3 -3
- package/dist/_esm5.processed/core/abr/get_buffer_levels.js +3 -0
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.d.ts +3 -3
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.js +3 -3
- package/dist/_esm5.processed/core/abr/guess_based_chooser.d.ts +95 -0
- package/dist/_esm5.processed/core/abr/guess_based_chooser.js +242 -0
- package/dist/_esm5.processed/core/abr/index.d.ts +3 -3
- package/dist/_esm5.processed/core/abr/last_estimate_storage.d.ts +61 -0
- package/dist/_esm5.processed/core/abr/last_estimate_storage.js +37 -0
- package/dist/_esm5.processed/core/abr/network_analyzer.d.ts +25 -7
- package/dist/_esm5.processed/core/abr/network_analyzer.js +68 -31
- package/dist/_esm5.processed/core/abr/pending_requests_store.d.ts +56 -28
- package/dist/_esm5.processed/core/abr/pending_requests_store.js +9 -7
- package/dist/_esm5.processed/core/abr/representation_estimator.d.ts +34 -51
- package/dist/_esm5.processed/core/abr/representation_estimator.js +111 -52
- package/dist/_esm5.processed/core/abr/representation_score_calculator.d.ts +5 -8
- package/dist/_esm5.processed/core/abr/representation_score_calculator.js +20 -23
- package/dist/_esm5.processed/core/abr/{ewma.d.ts → utils/ewma.d.ts} +0 -0
- package/dist/_esm5.processed/core/abr/{ewma.js → utils/ewma.js} +0 -0
- package/dist/_esm5.processed/core/abr/{filter_by_bitrate.d.ts → utils/filter_by_bitrate.d.ts} +1 -1
- package/dist/_esm5.processed/core/abr/{filter_by_bitrate.js → utils/filter_by_bitrate.js} +1 -1
- package/dist/_esm5.processed/core/abr/{filter_by_width.d.ts → utils/filter_by_width.d.ts} +1 -1
- package/dist/_esm5.processed/core/abr/{filter_by_width.js → utils/filter_by_width.js} +2 -2
- package/dist/_esm5.processed/core/abr/{select_optimal_representation.d.ts → utils/select_optimal_representation.d.ts} +1 -1
- package/dist/_esm5.processed/core/abr/{select_optimal_representation.js → utils/select_optimal_representation.js} +1 -1
- package/dist/_esm5.processed/core/api/emit_seek_events.d.ts +4 -4
- package/dist/_esm5.processed/core/api/emit_seek_events.js +12 -10
- package/dist/_esm5.processed/core/api/index.d.ts +3 -1
- package/dist/_esm5.processed/core/api/index.js +2 -0
- package/dist/_esm5.processed/core/api/option_utils.js +4 -4
- package/dist/_esm5.processed/core/api/playback_observer.d.ts +280 -0
- package/dist/_esm5.processed/core/api/playback_observer.js +461 -0
- package/dist/_esm5.processed/core/api/public_api.d.ts +8 -7
- package/dist/_esm5.processed/core/api/public_api.js +98 -94
- package/dist/_esm5.processed/core/api/track_choice_manager.js +3 -3
- package/dist/_esm5.processed/core/eme/__tests__/__global__/utils.js +1 -0
- package/dist/_esm5.processed/core/eme/attach_media_keys.js +1 -2
- package/dist/_esm5.processed/core/eme/check_key_statuses.js +4 -5
- package/dist/_esm5.processed/core/eme/clean_old_loaded_sessions.js +1 -2
- package/dist/_esm5.processed/core/eme/clear_eme_session.js +6 -2
- package/dist/_esm5.processed/core/eme/create_session.js +1 -2
- package/dist/_esm5.processed/core/eme/dispose_media_keys.js +2 -3
- package/dist/_esm5.processed/core/eme/eme_manager.js +4 -5
- package/dist/_esm5.processed/core/eme/find_key_system.js +4 -5
- package/dist/_esm5.processed/core/eme/get_media_keys.js +2 -3
- package/dist/_esm5.processed/core/eme/get_session.js +1 -2
- package/dist/_esm5.processed/core/eme/init_media_keys.js +5 -5
- package/dist/_esm5.processed/core/eme/session_events_listener.js +6 -7
- package/dist/_esm5.processed/core/eme/set_server_certificate.js +8 -3
- package/dist/_esm5.processed/core/eme/types.d.ts +12 -4
- package/dist/_esm5.processed/core/eme/utils/close_session.js +2 -3
- package/dist/_esm5.processed/core/eme/utils/is_session_usable.js +1 -1
- package/dist/_esm5.processed/core/eme/utils/loaded_sessions_store.js +3 -4
- package/dist/_esm5.processed/core/eme/utils/persistent_sessions_store.js +3 -3
- package/dist/_esm5.processed/core/fetchers/index.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +2 -2
- package/dist/_esm5.processed/core/fetchers/segment/index.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.d.ts +12 -29
- package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.js +3 -7
- package/dist/_esm5.processed/core/fetchers/segment/prioritizer.d.ts +53 -53
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +42 -11
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +118 -46
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +21 -20
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +9 -8
- package/dist/_esm5.processed/core/init/create_eme_manager.js +1 -2
- package/dist/_esm5.processed/core/init/create_media_source.js +3 -4
- package/dist/_esm5.processed/core/init/create_stream_playback_observer.d.ts +39 -0
- package/dist/_esm5.processed/core/init/create_stream_playback_observer.js +50 -0
- package/dist/_esm5.processed/core/init/duration_updater.js +16 -7
- package/dist/_esm5.processed/core/init/emit_loaded_event.d.ts +4 -3
- package/dist/_esm5.processed/core/init/emit_loaded_event.js +8 -8
- package/dist/_esm5.processed/core/init/end_of_stream.js +1 -2
- package/dist/_esm5.processed/core/init/get_initial_time.js +2 -3
- package/dist/_esm5.processed/core/init/initial_seek_and_play.d.ts +32 -31
- package/dist/_esm5.processed/core/init/initial_seek_and_play.js +25 -32
- package/dist/_esm5.processed/core/init/initialize_directfile.d.ts +6 -5
- package/dist/_esm5.processed/core/init/initialize_directfile.js +16 -12
- package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +10 -10
- package/dist/_esm5.processed/core/init/initialize_media_source.js +18 -12
- package/dist/_esm5.processed/core/init/load_on_media_source.d.ts +8 -11
- package/dist/_esm5.processed/core/init/load_on_media_source.js +16 -19
- package/dist/_esm5.processed/core/init/manifest_update_scheduler.js +8 -7
- package/dist/_esm5.processed/core/init/stall_avoider.d.ts +4 -6
- package/dist/_esm5.processed/core/init/stall_avoider.js +56 -42
- package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.d.ts +2 -2
- package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.js +20 -15
- package/dist/_esm5.processed/core/init/throw_on_media_error.js +1 -2
- package/dist/_esm5.processed/core/init/types.d.ts +0 -20
- package/dist/_esm5.processed/core/init/update_playback_rate.d.ts +5 -4
- package/dist/_esm5.processed/core/init/update_playback_rate.js +10 -11
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.d.ts +4 -4
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +12 -7
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +8 -7
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +9 -10
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +4 -4
- package/dist/_esm5.processed/core/segment_buffers/implementations/utils/manual_time_ranges.js +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/buffered_history.js +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +1 -12
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +10 -10
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +1 -1
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +15 -13
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +36 -23
- package/dist/_esm5.processed/core/stream/adaptation/create_representation_estimator.d.ts +9 -17
- package/dist/_esm5.processed/core/stream/adaptation/create_representation_estimator.js +11 -20
- package/dist/_esm5.processed/core/stream/adaptation/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/active_period_emitter.js +5 -6
- package/dist/_esm5.processed/core/stream/orchestrator/are_streams_complete.js +1 -2
- package/dist/_esm5.processed/core/stream/orchestrator/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +10 -8
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +22 -21
- package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.d.ts +6 -4
- package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.js +11 -10
- package/dist/_esm5.processed/core/stream/period/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +23 -7
- package/dist/_esm5.processed/core/stream/period/period_stream.js +38 -24
- package/dist/_esm5.processed/core/stream/reload_after_switch.d.ts +5 -4
- package/dist/_esm5.processed/core/stream/reload_after_switch.js +8 -7
- package/dist/_esm5.processed/core/stream/representation/append_segment_to_buffer.d.ts +4 -2
- package/dist/_esm5.processed/core/stream/representation/append_segment_to_buffer.js +10 -8
- package/dist/_esm5.processed/core/stream/representation/downloading_queue.d.ts +9 -9
- package/dist/_esm5.processed/core/stream/representation/downloading_queue.js +10 -12
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.d.ts +1 -3
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +6 -8
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.d.ts +3 -7
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.js +7 -8
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.js +1 -1
- package/dist/_esm5.processed/core/stream/representation/get_segment_priority.d.ts +6 -9
- package/dist/_esm5.processed/core/stream/representation/get_segment_priority.js +7 -8
- package/dist/_esm5.processed/core/stream/representation/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/push_init_segment.d.ts +4 -2
- package/dist/_esm5.processed/core/stream/representation/push_init_segment.js +3 -5
- package/dist/_esm5.processed/core/stream/representation/push_media_segment.d.ts +6 -4
- package/dist/_esm5.processed/core/stream/representation/push_media_segment.js +3 -5
- package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +9 -12
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +30 -21
- package/dist/_esm5.processed/errors/error_message.js +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/create_request.d.ts +5 -3
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/create_request.js +21 -8
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/get_initialized_source_buffer.js +2 -3
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_segments.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_segments.js +4 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/push_data.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +17 -6
- package/dist/_esm5.processed/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +1 -2
- package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -1
- package/dist/_esm5.processed/features/initialize_features.js +47 -44
- package/dist/_esm5.processed/index.js +2 -2
- package/dist/_esm5.processed/manifest/index.d.ts +2 -2
- package/dist/_esm5.processed/manifest/index.js +2 -2
- package/dist/_esm5.processed/manifest/representation.js +1 -1
- package/dist/_esm5.processed/manifest/representation_index/static.js +1 -0
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +24 -3
- package/dist/_esm5.processed/manifest/update_period_in_place.js +1 -1
- package/dist/_esm5.processed/manifest/{are_same_content.d.ts → utils.d.ts} +9 -7
- package/dist/_esm5.processed/manifest/{are_same_content.js → utils.js} +18 -1
- package/dist/_esm5.processed/minimal.js +2 -2
- package/dist/_esm5.processed/parsers/containers/isobmff/get_box.d.ts +18 -9
- package/dist/_esm5.processed/parsers/containers/isobmff/get_box.js +32 -9
- package/dist/_esm5.processed/parsers/containers/isobmff/read.d.ts +18 -5
- package/dist/_esm5.processed/parsers/containers/isobmff/read.js +28 -6
- package/dist/_esm5.processed/parsers/containers/isobmff/utils.js +52 -47
- package/dist/_esm5.processed/parsers/images/bif.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_http_utc-timing_url.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.js +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +1 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +7 -9
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +4 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +11 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.js +10 -9
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +6 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +5 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.js +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +3 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +19 -18
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +14 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +7 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +3 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +5 -10
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +3 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +17 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.d.ts +7 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.js +22 -21
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +10 -0
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.js +9 -9
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +24 -0
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.js +7 -5
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +12 -9
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +5 -2
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +8 -0
- package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +11 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +7 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +11 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.js +7 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +5 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +5 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +13 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +23 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.js +5 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/XLink.js +6 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/root.js +6 -0
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +4 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/get_codecs.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +3 -1
- package/dist/_esm5.processed/parsers/manifest/utils/check_manifest_ids.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +11 -3
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.js +5 -5
- package/dist/_esm5.processed/parsers/manifest/utils/is_segment_still_available.js +3 -6
- package/dist/_esm5.processed/parsers/texttracks/sami/html.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/sami/native.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_font_size.js +13 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/generate_css_test_outline.js +4 -4
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_default_style_elements.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_style_attribute.js +5 -5
- package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +89 -20
- package/dist/_esm5.processed/transports/dash/segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/local/segment_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +1 -1
- package/dist/_esm5.processed/transports/smooth/extract_timings_infos.js +1 -1
- package/dist/_esm5.processed/transports/smooth/pipelines.js +2 -2
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +3 -3
- package/dist/_esm5.processed/transports/types.d.ts +29 -15
- package/dist/_esm5.processed/transports/utils/byte_range.js +2 -2
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -1
- package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.js +6 -1
- package/dist/_esm5.processed/transports/utils/parse_text_track.js +6 -4
- package/dist/_esm5.processed/utils/assert.js +3 -3
- package/dist/_esm5.processed/utils/concat_map_latest.js +1 -2
- package/dist/_esm5.processed/utils/defer_subscriptions.js +1 -2
- package/dist/_esm5.processed/utils/filter_map.js +1 -2
- package/dist/_esm5.processed/utils/reference.d.ts +108 -0
- package/dist/_esm5.processed/utils/reference.js +137 -0
- package/dist/_esm5.processed/utils/request/fetch.d.ts +1 -1
- package/dist/_esm5.processed/utils/request/fetch.js +3 -3
- package/dist/_esm5.processed/utils/request/xhr.d.ts +1 -1
- package/dist/_esm5.processed/utils/request/xhr.js +1 -1
- package/dist/_esm5.processed/utils/rx-retry_with_backoff.js +1 -2
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.d.ts +1 -15
- package/dist/rx-player.js +3666 -2470
- package/dist/rx-player.min.d.ts +1 -15
- package/dist/rx-player.min.js +1 -1
- package/jest.config.js +28 -1
- package/package.json +43 -43
- package/scripts/build/constants.d.ts +50 -0
- package/scripts/build/generate_build.js +1 -189
- package/scripts/doc-generator/construct_table_of_contents.js +31 -24
- package/scripts/doc-generator/convert_MD_to_HMTL.js +4 -8
- package/scripts/doc-generator/create_documentation.js +331 -0
- package/scripts/doc-generator/create_documentation_page.js +209 -0
- package/scripts/doc-generator/create_page.js +117 -35
- package/scripts/doc-generator/generate_header_html.js +148 -0
- package/scripts/doc-generator/generate_page_html.js +116 -0
- package/scripts/doc-generator/generate_page_list_html.js +93 -0
- package/scripts/doc-generator/generate_sidebar_html.js +88 -0
- package/scripts/doc-generator/get_search_data_for_content.js +137 -0
- package/scripts/doc-generator/index.js +14 -15
- package/scripts/doc-generator/parse_doc_configs.js +327 -0
- package/scripts/doc-generator/scripts/lunr.js +10 -0
- package/scripts/doc-generator/scripts/script.js +451 -0
- package/scripts/doc-generator/styles/style.css +712 -144
- package/scripts/doc-generator/utils.js +85 -0
- package/scripts/fast_demo_build.js +143 -0
- package/scripts/generate_documentation_list.js +6 -2
- package/scripts/generate_full_demo.js +26 -49
- package/scripts/start_demo_web_server.js +14 -4
- package/scripts/update-version +1 -1
- package/sonar-project.properties +2 -1
- package/src/compat/__tests__/add_text_track.test.ts +1 -0
- package/src/compat/__tests__/clear_element_src.test.ts +55 -28
- package/src/compat/__tests__/set_element_src.test.ts +2 -2
- package/src/compat/__tests__/when_loaded_metadata.test.ts +4 -5
- package/src/compat/__tests__/when_media_source_open.test.ts +4 -5
- package/src/compat/clear_element_src.ts +8 -6
- package/src/compat/eme/close_session.ts +3 -5
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +1 -1
- package/src/compat/eme/custom_media_keys/index.ts +6 -6
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +6 -3
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +1 -1
- package/src/compat/eme/generate_key_request.ts +1 -1
- package/src/compat/eme/load_session.ts +4 -6
- package/src/compat/event_listeners.ts +12 -21
- package/src/compat/on_height_width_change.ts +3 -5
- package/src/compat/set_element_src.ts +1 -1
- package/src/compat/when_loaded_metadata.ts +1 -1
- package/src/compat/when_media_source_open.ts +1 -1
- package/src/config.ts +4 -9
- package/src/core/abr/README.md +7 -7
- package/src/core/abr/abr_manager.ts +62 -21
- package/src/core/abr/bandwidth_estimator.ts +1 -1
- package/src/core/abr/buffer_based_chooser.ts +8 -6
- package/src/core/abr/get_buffer_levels.ts +3 -0
- package/src/core/abr/get_estimate_from_buffer_levels.ts +4 -4
- package/src/core/abr/guess_based_chooser.ts +308 -0
- package/src/core/abr/index.ts +7 -3
- package/src/core/abr/last_estimate_storage.ts +79 -0
- package/src/core/abr/network_analyzer.ts +74 -31
- package/src/core/abr/pending_requests_store.ts +76 -42
- package/src/core/abr/representation_estimator.ts +200 -125
- package/src/core/abr/representation_score_calculator.ts +33 -26
- package/src/core/abr/{__tests__ → utils/__tests__}/ewma.test.ts +0 -0
- package/src/core/abr/{__tests__ → utils/__tests__}/filter_by_bitrate.test.ts +1 -1
- package/src/core/abr/{__tests__ → utils/__tests__}/filter_by_width.test.ts +1 -1
- package/src/core/abr/{__tests__ → utils/__tests__}/select_optimal_representation.test.ts +1 -1
- package/src/core/abr/{ewma.ts → utils/ewma.ts} +0 -0
- package/src/core/abr/{filter_by_bitrate.ts → utils/filter_by_bitrate.ts} +2 -2
- package/src/core/abr/{filter_by_width.ts → utils/filter_by_width.ts} +3 -3
- package/src/core/abr/{select_optimal_representation.ts → utils/select_optimal_representation.ts} +2 -2
- package/src/core/api/README.md +4 -3
- package/src/core/api/__tests__/option_utils.test.ts +1 -0
- package/src/core/api/emit_seek_events.ts +21 -20
- package/src/core/api/index.ts +6 -2
- package/src/core/api/playback_observer.ts +768 -0
- package/src/core/api/public_api.ts +111 -111
- package/src/core/api/track_choice_manager.ts +6 -3
- package/src/core/eme/__tests__/__global__/get_license.test.ts +5 -3
- package/src/core/eme/__tests__/__global__/init_data.test.ts +11 -12
- package/src/core/eme/__tests__/__global__/media_key_system_access.test.ts +2 -1
- package/src/core/eme/__tests__/__global__/media_keys.test.ts +5 -8
- package/src/core/eme/__tests__/__global__/server_certificate.test.ts +8 -6
- package/src/core/eme/__tests__/__global__/utils.ts +1 -0
- package/src/core/eme/__tests__/init_media_keys.test.ts +6 -65
- package/src/core/eme/attach_media_keys.ts +2 -1
- package/src/core/eme/check_key_statuses.ts +10 -8
- package/src/core/eme/clean_old_loaded_sessions.ts +2 -4
- package/src/core/eme/clear_eme_session.ts +6 -1
- package/src/core/eme/create_session.ts +3 -5
- package/src/core/eme/dispose_media_keys.ts +2 -2
- package/src/core/eme/eme_manager.ts +10 -12
- package/src/core/eme/find_key_system.ts +3 -5
- package/src/core/eme/get_media_keys.ts +4 -6
- package/src/core/eme/get_session.ts +2 -4
- package/src/core/eme/init_media_keys.ts +9 -9
- package/src/core/eme/session_events_listener.ts +14 -15
- package/src/core/eme/set_server_certificate.ts +9 -5
- package/src/core/eme/types.ts +15 -4
- package/src/core/eme/utils/close_session.ts +7 -7
- package/src/core/eme/utils/is_session_usable.ts +1 -1
- package/src/core/eme/utils/loaded_sessions_store.ts +2 -2
- package/src/core/eme/utils/persistent_sessions_store.ts +2 -2
- package/src/core/fetchers/index.ts +2 -2
- package/src/core/fetchers/manifest/manifest_fetcher.ts +1 -1
- package/src/core/fetchers/segment/__tests__/prioritizer.test.ts +3 -4
- package/src/core/fetchers/segment/index.ts +2 -2
- package/src/core/fetchers/segment/prioritized_segment_fetcher.ts +37 -45
- package/src/core/fetchers/segment/prioritizer.ts +82 -82
- package/src/core/fetchers/segment/segment_fetcher.ts +178 -80
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +23 -31
- package/src/core/init/create_eme_manager.ts +1 -1
- package/src/core/init/create_media_source.ts +5 -7
- package/src/core/init/create_stream_playback_observer.ts +88 -0
- package/src/core/init/duration_updater.ts +20 -17
- package/src/core/init/emit_loaded_event.ts +11 -15
- package/src/core/init/end_of_stream.ts +2 -4
- package/src/core/init/get_initial_time.ts +0 -1
- package/src/core/init/initial_seek_and_play.ts +67 -51
- package/src/core/init/initialize_directfile.ts +26 -35
- package/src/core/init/initialize_media_source.ts +28 -28
- package/src/core/init/load_on_media_source.ts +51 -58
- package/src/core/init/manifest_update_scheduler.ts +11 -12
- package/src/core/init/stall_avoider.ts +64 -47
- package/src/core/init/stream_events_emitter/stream_events_emitter.ts +24 -21
- package/src/core/init/throw_on_media_error.ts +1 -1
- package/src/core/init/types.ts +0 -24
- package/src/core/init/update_playback_rate.ts +15 -16
- package/src/core/segment_buffers/README.md +3 -3
- package/src/core/segment_buffers/garbage_collector.ts +15 -11
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +10 -7
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +14 -16
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +1 -1
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +4 -4
- package/src/core/segment_buffers/implementations/utils/manual_time_ranges.ts +2 -2
- package/src/core/segment_buffers/inventory/buffered_history.ts +2 -2
- package/src/core/segment_buffers/inventory/segment_inventory.ts +1 -13
- package/src/core/stream/adaptation/adaptation_stream.ts +78 -56
- package/src/core/stream/adaptation/create_representation_estimator.ts +19 -45
- package/src/core/stream/adaptation/index.ts +2 -2
- package/src/core/stream/index.ts +2 -2
- package/src/core/stream/orchestrator/active_period_emitter.ts +6 -8
- package/src/core/stream/orchestrator/are_streams_complete.ts +2 -4
- package/src/core/stream/orchestrator/index.ts +2 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +58 -49
- package/src/core/stream/period/create_empty_adaptation_stream.ts +14 -10
- package/src/core/stream/period/index.ts +2 -2
- package/src/core/stream/period/period_stream.ts +118 -75
- package/src/core/stream/reload_after_switch.ts +13 -10
- package/src/core/stream/representation/append_segment_to_buffer.ts +20 -16
- package/src/core/stream/representation/downloading_queue.ts +21 -24
- package/src/core/stream/representation/force_garbage_collection.ts +16 -23
- package/src/core/stream/representation/get_buffer_status.ts +9 -11
- package/src/core/stream/representation/get_needed_segments.ts +1 -1
- package/src/core/stream/representation/get_segment_priority.ts +8 -10
- package/src/core/stream/representation/index.ts +2 -2
- package/src/core/stream/representation/push_init_segment.ts +19 -16
- package/src/core/stream/representation/push_media_segment.ts +21 -17
- package/src/core/stream/representation/representation_stream.ts +50 -47
- package/src/experimental/features/__tests__/dash_wasm.test.ts +1 -0
- package/src/experimental/tools/VideoThumbnailLoader/create_request.ts +32 -17
- package/src/experimental/tools/VideoThumbnailLoader/get_initialized_source_buffer.ts +6 -9
- package/src/experimental/tools/VideoThumbnailLoader/load_segments.ts +12 -6
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +4 -2
- package/src/experimental/tools/VideoThumbnailLoader/push_data.ts +2 -2
- package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +21 -12
- package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +1 -1
- package/src/experimental/tools/createMetaplaylist/index.ts +1 -1
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +4 -2
- package/src/features/__tests__/initialize_features.test.ts +191 -101
- package/src/features/initialize_features.ts +40 -37
- package/src/features/list/__tests__/bif_parser.test.ts +1 -0
- package/src/features/list/__tests__/dash.test.ts +1 -0
- package/src/features/list/__tests__/directfile.test.ts +1 -0
- package/src/features/list/__tests__/eme.test.ts +1 -0
- package/src/features/list/__tests__/html_sami_parser.test.ts +1 -0
- package/src/features/list/__tests__/html_srt_parser.test.ts +1 -0
- package/src/features/list/__tests__/html_text_buffer.test.ts +1 -0
- package/src/features/list/__tests__/html_ttml_parser.test.ts +1 -0
- package/src/features/list/__tests__/html_vtt_parser.test.ts +1 -0
- package/src/features/list/__tests__/image_buffer.test.ts +1 -0
- package/src/features/list/__tests__/native_sami_parser.test.ts +1 -0
- package/src/features/list/__tests__/native_srt_parser.test.ts +1 -0
- package/src/features/list/__tests__/native_text_buffer.test.ts +1 -0
- package/src/features/list/__tests__/native_ttml_parser.test.ts +1 -0
- package/src/features/list/__tests__/native_vtt_parser.test.ts +1 -0
- package/src/features/list/__tests__/smooth.test.ts +1 -0
- package/src/index.ts +2 -2
- package/src/manifest/__tests__/manifest.test.ts +1 -0
- package/src/manifest/index.ts +7 -1
- package/src/manifest/representation_index/__tests__/static.test.ts +1 -0
- package/src/manifest/representation_index/static.ts +1 -0
- package/src/manifest/representation_index/types.ts +25 -3
- package/src/manifest/{are_same_content.ts → utils.ts} +26 -9
- package/src/minimal.ts +3 -2
- package/src/parsers/containers/isobmff/get_box.ts +35 -8
- package/src/parsers/containers/isobmff/read.ts +32 -5
- package/src/parsers/containers/isobmff/utils.ts +52 -47
- package/src/parsers/manifest/dash/common/__tests__/flatten_overlapping_period.test.ts +4 -4
- package/src/parsers/manifest/dash/common/flatten_overlapping_periods.ts +4 -2
- package/src/parsers/manifest/dash/common/get_clock_offset.ts +3 -3
- package/src/parsers/manifest/dash/common/get_http_utc-timing_url.ts +15 -6
- package/src/parsers/manifest/dash/common/indexes/base.ts +5 -3
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +1 -0
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +9 -9
- package/src/parsers/manifest/dash/common/indexes/list.ts +6 -3
- package/src/parsers/manifest/dash/common/indexes/template.ts +13 -6
- package/src/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.ts +10 -9
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +13 -5
- package/src/parsers/manifest/dash/common/indexes/tokens.ts +4 -4
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
- package/src/parsers/manifest/dash/common/parse_mpd.ts +21 -13
- package/src/parsers/manifest/dash/common/parse_periods.ts +7 -8
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +12 -12
- package/src/parsers/manifest/dash/common/parse_representations.ts +23 -4
- package/src/parsers/manifest/dash/common/resolve_base_urls.ts +33 -24
- package/src/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.ts +12 -0
- package/src/parsers/manifest/dash/js-parser/node_parsers/BaseURL.ts +13 -9
- package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +28 -0
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.ts +8 -5
- package/src/parsers/manifest/dash/js-parser/node_parsers/utils.ts +3 -0
- package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +5 -2
- package/src/parsers/manifest/dash/node_parser_types.ts +8 -0
- package/src/parsers/manifest/dash/parsers_types.ts +8 -2
- package/src/parsers/manifest/dash/wasm-parser/rs/lib.rs +1 -8
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +26 -5
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/mod.rs +75 -521
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +7 -4
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +13 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +8 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +6 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +6 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +14 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +26 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.ts +6 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/XLink.ts +7 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +7 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +1 -1
- package/src/parsers/manifest/local/representation_index.ts +2 -0
- package/src/parsers/manifest/smooth/create_parser.ts +1 -1
- package/src/parsers/manifest/smooth/representation_index.ts +3 -1
- package/src/parsers/manifest/utils/clear_timeline_from_position.ts +1 -1
- package/src/parsers/manifest/utils/index_helpers.ts +21 -11
- package/src/parsers/manifest/utils/is_segment_still_available.ts +4 -6
- package/src/parsers/texttracks/sami/html.ts +1 -1
- package/src/parsers/texttracks/sami/native.ts +1 -1
- package/src/parsers/texttracks/ttml/html/apply_font_size.ts +11 -1
- package/src/transports/dash/image_pipelines.ts +4 -4
- package/src/transports/dash/init_segment_loader.ts +1 -1
- package/src/transports/dash/manifest_parser.ts +99 -25
- package/src/transports/dash/segment_loader.ts +1 -1
- package/src/transports/dash/segment_parser.ts +4 -4
- package/src/transports/dash/text_parser.ts +8 -8
- package/src/transports/local/segment_loader.ts +2 -2
- package/src/transports/local/segment_parser.ts +4 -4
- package/src/transports/local/text_parser.ts +8 -8
- package/src/transports/metaplaylist/pipelines.ts +11 -11
- package/src/transports/smooth/extract_timings_infos.ts +1 -1
- package/src/transports/smooth/pipelines.ts +8 -8
- package/src/transports/smooth/segment_loader.ts +3 -3
- package/src/transports/types.ts +31 -17
- package/src/transports/utils/call_custom_manifest_loader.ts +1 -1
- package/src/transports/utils/get_isobmff_timing_infos.ts +6 -1
- package/src/transports/utils/parse_text_track.ts +4 -2
- package/src/typings/globals.d.ts +57 -40
- package/src/utils/__tests__/concat_map_latest.test.ts +7 -9
- package/src/utils/__tests__/defer_subscriptions.test.ts +4 -4
- package/src/utils/__tests__/event_emitter.test.ts +1 -1
- package/src/utils/__tests__/initialization_segment_cache.test.ts +7 -0
- package/src/utils/assert.ts +1 -1
- package/src/utils/concat_map_latest.ts +2 -4
- package/src/utils/defer_subscriptions.ts +1 -1
- package/src/utils/filter_map.ts +2 -4
- package/src/utils/reference.ts +234 -0
- package/src/utils/request/fetch.ts +3 -3
- package/src/utils/request/xhr.ts +2 -2
- package/src/utils/rx-retry_with_backoff.ts +2 -4
- package/tsconfig.json +4 -1
- package/tsconfig.modules.json +8 -3
- package/dist/_esm5.processed/core/abr/create_filters.d.ts +0 -27
- package/dist/_esm5.processed/core/abr/create_filters.js +0 -56
- package/dist/_esm5.processed/core/api/clock.d.ts +0 -157
- package/dist/_esm5.processed/core/api/clock.js +0 -363
- package/dist/_esm5.processed/core/init/create_stream_clock.d.ts +0 -34
- package/dist/_esm5.processed/core/init/create_stream_clock.js +0 -55
- package/dist/_esm5.processed/parsers/manifest/dash/common/extract_minimum_availability_time_offset.d.ts +0 -31
- package/dist/_esm5.processed/parsers/manifest/dash/common/extract_minimum_availability_time_offset.js +0 -37
- package/scripts/doc-generator/construct_html.js +0 -135
- package/scripts/doc-generator/construct_page_list.js +0 -120
- package/scripts/doc-generator/create_for_dir.js +0 -151
- package/scripts/doc-generator/get_files_to_convert.js +0 -71
- package/scripts/doc-generator/mkdir_parent.js +0 -21
- package/scripts/doc-generator/read_title_from_md.js +0 -22
- package/scripts/doc-generator/remove_toc_from_md.js +0 -20
- package/src/core/abr/create_filters.ts +0 -59
- package/src/core/api/clock.ts +0 -573
- package/src/core/init/create_stream_clock.ts +0 -93
- package/src/parsers/manifest/dash/common/extract_minimum_availability_time_offset.ts +0 -41
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={7757:function(e,t,n){e.exports=n(5666)},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,{kD:function(){return u},fq:function(){return o},YM:function(){return s},vU:function(){return l},G6:function(){return f},SB:function(){return p},op:function(){return d},yS:function(){return c}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),d=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),c=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),p=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(3666);function a(e){if(i.vU){for(var t=e.textTracks,n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return L},Y:function(){return $}});var r,i=n(3610),a=n(2817),o=n(9917),s=n(3714),u=n(811),l=n(8117),d=n(3666),c=n(2203),f=n(5059),p=n(3144),v=n(9589),h=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 v.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,p.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),m=n(4578),g=n(6716),y=n(3071),_=n(3505),b=n(1959),T=n(8719);if(!c.Z){var E=window.MSMediaKeys;void 0!==E&&void 0!==E.prototype&&"function"==typeof E.isTypeSupported&&"function"==typeof E.prototype.createSession&&(r=E)}var S,w=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new g.x,n.closed=new v.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new v.Z((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,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,y.T)(T.GJ(n._ss),T.GV(n._ss),T.Xe(n._ss)).pipe((0,_.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new v.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.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}(b.Z),k=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new w(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!c.Z){var A=window.MozMediaKeys;void 0!==A&&void 0!==A.prototype&&"function"==typeof A.isTypeSupported&&"function"==typeof A.prototype.createSession&&(S=A)}var I=n(9689),x=n(3635);function Z(e){return"function"==typeof e.webkitGenerateKeyRequest}var M=function(e){function t(t,n){var r;return(r=e.call(this)||this)._closeSession$=new g.x,r._vid=t,r._key=n,r.sessionId="",r.closed=new v.Z((function(e){r._closeSession$.subscribe(e)})),r.keyStatuses=new Map,r.expiration=NaN,(0,y.T)(T.GJ(t),T.GV(t),T.Xe(t)).pipe((0,_.R)(r._closeSession$)).subscribe((function(e){return r.trigger(e.type,e)})),r.update=function(e){return new v.Z((function(t,n){try{if(r._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,x.uR)(i)),o=(0,I.K)(a.keys[0].k),s=(0,I.K)(a.keys[0].kid);t(r._vid.webkitAddKey(r._key,o,s,""))}else t(r._vid.webkitAddKey(r._key,e,null,""))}catch(e){n(e)}}))},r}(0,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new v.Z((function(t){e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},t}(b.Z),R=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!Z(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var C=n(6968);var P=n(158);function N(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var D=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._closeSession$=new g.x,i._videoElement=t,i._keyType=n,i.closed=new v.Z((function(e){i._closeSession$.subscribe(e)})),i.keyStatuses=new Map,i.expiration=NaN,i.update=function(e){return new v.Z((function(t,n){if(void 0===i._nativeSession||void 0===i._nativeSession.update||"function"!=typeof i._nativeSession.update)return n("Unavailable WebKit key session.");try{var r;r=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),t(i._nativeSession.update(r))}catch(e){n(e)}}))},i}(0,m.Z)(t,e);var n=t.prototype;return n.listenEvent=function(e){var t=this;(0,y.T)(T.GJ(e),T.GV(e),T.Xe(e)).pipe((0,_.R)(this._closeSession$)).subscribe((function(e){t.trigger(e.type,e)}))},n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,C.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,x.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,x.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,C.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,C.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 v.Z((function(t,n){e._closeSession$.next(),e._closeSession$.complete(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.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}(b.Z),O=function(){function e(e){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new P.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return N(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 D(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,v.Z.resolve()},e}();var L=null,B=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(c.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,f.Z)())L=function(e,t){return(0,l.Z)(navigator.requestMediaKeySystemAccess(e,t))};else{var U,F;if(Z(HTMLVideoElement.prototype)){var z={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 R(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof R))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};U=z.isTypeSupported,F=z.createCustomMediaKeys,B=z.setMediaKeys}else if(void 0!==P.t){var K=function(){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:P.t.isTypeSupported,createCustomMediaKeys:function(e){return new O(e)},setMediaKeys:function(e,t){if(null===t)return N(e,t);if(!(t instanceof O))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();U=K.isTypeSupported,F=K.createCustomMediaKeys,B=K.setMediaKeys}else if(d.fq&&void 0!==r){var V={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new k(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof k))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};U=V.isTypeSupported,F=V.createCustomMediaKeys,B=V.setMediaKeys}else if(void 0!==S){var G={isTypeSupported:function(e,t){if(void 0===S)throw new Error("No MozMediaKeys API.");return void 0!==t?S.isTypeSupported(e,t):S.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===S)throw new Error("No MozMediaKeys API.");return new S(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};U=G.isTypeSupported,F=G.createCustomMediaKeys,B=G.setMediaKeys}else{var H=window.MediaKeys,W=function(){if(void 0===H)throw new s.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===H.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.")}};U=function(e){return W(),(0,u.Z)("function"==typeof H.isTypeSupported),H.isTypeSupported(e)},F=function(e){return W(),new H(e)}}L=function(e,t){if(!U(e))return(0,i._)((function(){return new Error("Unsupported key type")}));for(var n=0;n<t.length;n++){var r=t[n],o=r.videoCapabilities,s=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={videoCapabilities:o,audioCapabilities:s,initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]},f=F(e);return(0,a.of)(new h(e,f,c))}}return(0,i._)((function(){return new Error("Unsupported configuration")}))}}function $(e,t){return(0,o.P)((function(){return(0,l.Z)(B(e,t))}))}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},8719:function(e,t,n){"use strict";n.d(t,{zh:function(){return F},_K:function(){return V},Oh:function(){return re},C1:function(){return j},Q1:function(){return Y},GV:function(){return ae},Xe:function(){return oe},GJ:function(){return ie},eX:function(){return se},K4:function(){return H},yj:function(){return K},Qt:function(){return q},gg:function(){return ne},ik:function(){return $},d5:function(){return W},UG:function(){return J},ep:function(){return ee},ym:function(){return Q},UA:function(){return X},_E:function(){return te},$x:function(){return G}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(2401),s=n(3071),u=n(9917),l=n(2817),d=n(2334),c=n(6697),f=n(7991),p=n(6362),v=n(4727),h=n(533),m=n(3833),g=n(3994);function y(e,t){return t?function(n){return(0,p.z)(t.pipe((0,v.q)(1),(0,h.l)()),n.pipe(y(e)))}:(0,g.z)((function(t,n){return e(t,n).pipe((0,v.q)(1),(0,m.h)(t))}))}var _=n(6625);function b(e,t){void 0===t&&(t=f.z);var n=(0,_.H)(e,t);return y((function(){return n}))}var T=n(6798),E=n(2566),S=n(1973),w={leading:!0,trailing:!1};function k(e,t,n){void 0===t&&(t=f.z),void 0===n&&(n=w);var r,i,a,o,s,u=(0,_.H)(e,t);return r=function(){return u},o=(a=void 0===(i=n)?w:i).leading,s=a.trailing,(0,T.e)((function(e,t){var n=!1,i=null,a=null,u=!1,l=function(){null==a||a.unsubscribe(),a=null,s&&(f(),u&&t.complete())},d=function(){a=null,u&&t.complete()},c=function(e){return a=(0,S.Xf)(r(e)).subscribe(new E.Q(t,l,d))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!u&&c(e)}};e.subscribe(new E.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(o?f():c(e))}),(function(){u=!0,(!(s&&n&&a)||a.closed)&&t.complete()})))}))}var A=n(9127),I=n(8430),x=n(3741),Z=n(4978),M=n(944),R=n(6923),C=n(2203),P=n(5059),N=["","webkit","moz","ms"],D=M.Z.INACTIVITY_DELAY,O=C.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function L(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 B(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?N:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=L(e,r)),(0,R.Z)(n)?(0,o.R)(e,n):a):s.T.apply(void 0,r.map((function(t){return(0,o.R)(e,t)})))}}function U(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,u.P)((function(){var e=document[n];return(0,o.R)(document,r).pipe((0,A.U)((function(){return!document[n]})),(0,I.O)(!e),(0,x.x)())}))}function F(){return U().pipe((0,Z.w)((function(e){return e?(0,l.of)(e):(0,l.of)(e).pipe(b(D))})))}function z(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function K(e){return(0,u.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,o.R)(t,"webkitpresentationmodechanged").pipe((0,A.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,I.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,s.T)((0,o.R)(t,"enterpictureinpicture").pipe((0,A.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,o.R)(t,"leavepictureinpicture").pipe((0,m.h)({isEnabled:!1,pipWindow:null}))).pipe((0,I.O)(r))}))}function V(e){return(0,d.a)([U(),e]).pipe((0,Z.w)((function(e){var t=e[0];return e[1].isEnabled||t?(0,l.of)(!0):(0,l.of)(!1).pipe(b(D))})),(0,x.x)())}function G(e,t){return(0,d.a)([t,(0,c.F)(2e4).pipe((0,I.O)(null)),(0,o.R)(window,"resize").pipe(k(500),(0,I.O)(null))]).pipe((0,Z.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=z(e,r);return(0,o.R)(r,"resize").pipe((0,I.O)(i*O),(0,A.U)((function(){return z(e,r)*O})))}return(0,l.of)(1/0)}return(0,l.of)(e.clientWidth*O)})),(0,x.x)())}var H=B(["loadedmetadata"]),W=B(["seeking"]),$=B(["seeked"]),j=B(["ended"]),Y=(B(["timeupdate"]),B(["fullscreenchange","FullscreenChange"],N.concat("MS"))),q=function(e){return(0,s.T)(B(["play"])(e),B(["pause"])(e))},X=function(e){return(0,s.T)(B(["addtrack"])(e),B(["removetrack"])(e))},Q=B(["sourceopen","webkitsourceopen"]),J=B(["sourceclose","webkitsourceclose"]),ee=B(["sourceended","webkitsourceended"]),te=B(["update"]),ne=B(["onremovesourcebuffer"]),re=B((0,P.Z)()?["needkey"]:["encrypted","needkey"]),ie=B(["keymessage","message"]),ae=B(["keyadded","ready"]),oe=B(["keyerror","error"]),se=B(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return r.G6&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},944:function(e,t){"use strict";t.Z={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,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:2,after:2.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}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4578),i=n(1959),a=n(7829);function o(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 s(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var d={language:o.language,id:l,normalized:(0,a.ZP)(o.language),audioDescription:!1,representations:[]};n.push({track:d,nativeTrack:o})}return n}function u(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var d={language:o.language,id:l,normalized:(0,a.ZP)(o.language),closedCaption:"captions"===o.kind};n.push({track:d,nativeTrack:o})}return n}function l(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var d=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?s(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?l(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?u(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 i.enabled=!0,void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){c(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){p(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e].nativeTrack;if(t===this._audioTrackLockedOn)return void(t.enabled=!0)}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,a.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var o=this._audioTracks[i];if(o.track.normalized===r&&o.track.audioDescription===n.audioDescription)return void(o.nativeTrack.enabled=!0)}}},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 f(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else c(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 c(this._textTracks);for(var r=(0,a.ZP)(n.language),i=0;i<this._textTracks.length;i++){var o=this._textTracks[i];if(o.track.normalized===r&&o.track.closedCaption===n.closedCaption)return f(this._textTracks,o.nativeTrack),void("showing"!==o.nativeTrack.mode&&(o.nativeTrack.mode="showing"))}}c(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=s(e._nativeAudioTracks);if(o(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=s(e._nativeAudioTracks);if(o(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=u(e._nativeTextTracks);if(o(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=u(e._nativeTextTracks);if(o(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=l(e._nativeVideoTracks);if(o(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=l(e._nativeVideoTracks);if(o(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)})},t}(i.Z);function c(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function f(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}}},8281:function(e,t,n){"use strict";n.d(t,{ZP:function(){return et}});var r=n(2817),i=n(6362),a=n(3071),o=n(3610),s=n(3),u=n(1545),l=n(3994),d=n(8515),c=n(4975),f=n(4727),p=n(2006),v=n(9127),h=n(9878),m=n(533),g=n(8719),y=n(3887),_=n(6490),b=n(4791),T=n(6968),E=n(3635),S=(0,T.pX)((0,E.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,b.Z)(t.data,r.data))return!0}return!1}function k(e){var t=e.initData,n=e.initDataType;return null==t?(y.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,T.pX)(e,n+4)!==S)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,T.pX)(new Uint8Array(e),n);if(n+r>e.length)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,_.Y)(i,8),data:i};w(t,a)?y.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var A=n(9917),I=n(2297),x=n(8117);function Z(e,t,n){return(0,A.P)((function(){var r;y.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){y.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,T.pX)(e,i+4)!==S)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,T.pX)(new Uint8Array(e),i);if(i+a>e.length)throw y.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,I.Xj)(o),u=null===s?void 0:o[s[1]];y.Z.info("Compat: CENC PSSH found with version",u),void 0===u?y.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,T.zo)(n,o):1===u?(y.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):y.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,T.zo)(r,o);i+=a}if(i!==e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,T.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return(0,x.Z)(e.generateRequest(i,r)).pipe((0,h.K)((function(t){if(""!==i||!(t instanceof TypeError))throw t;return y.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),(0,x.Z)(e.generateRequest("cenc",r))})))}))}var M=n(944),R=n(5157),C=n(7714),P=n(8418),N=n(2793),D=n(1946);var O=n(3833),L=n(8430);var B=n(4181),U=n(6625),F=n(5561);function z(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an empty keyStatuses",e),!1):(0,C.Z)(n,"expired")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,C.Z)(n,"internal-error")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(y.Z.debug("EME: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function K(e,t,n){return(0,A.P)((function(){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?V(i,t):null===a?(y.Z.warn("EME: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),V(i,t)):function(e,t,n){return(0,A.P)((function(){y.Z.info("EME: Creating persistent MediaKeySession");var i=e.createSession(n,"persistent-license"),a=t.getAndReuse(n);if(null===a)return(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}});var o=function(){return y.Z.info("EME: Removing previous persistent session."),null!==t.get(n)&&t.delete(n),e.closeSession(n).pipe((0,v.U)((function(){return{type:"created-session",value:{mediaKeySession:e.createSession(n,"persistent-license"),sessionType:"persistent-license"}}})))};return function(e,t){return(0,A.P)((function(){return y.Z.info("Compat/EME: Load persisted session",t),(0,F.Z)((function(){return(0,x.Z)(e.load(t))}),void 0)})).pipe((0,l.z)((function(t){return!t||e.keyStatuses.size>0?(0,r.of)(t):(0,B.S)((0,U.H)(100),(0,g.eX)(e)).pipe((0,f.q)(1),(0,O.h)(t))})))}(i,a.sessionId).pipe((0,l.z)((function(e){return e?e&&z(i)?(t.add(n,i),y.Z.info("EME: Succeeded to load persistent session."),(0,r.of)({type:"loaded-persistent-session",value:{mediaKeySession:i,sessionType:"persistent-license"}})):(y.Z.warn("EME: Previous persistent session not usable anymore."),o()):(y.Z.warn("EME: No data stored for the loaded session"),t.delete(n),(0,r.of)({type:"created-session",value:{mediaKeySession:i,sessionType:"persistent-license"}}))})),(0,h.K)((function(e){return y.Z.warn("EME: Unable to load persistent session: "+(e instanceof Error?e.toString():"Unknown Error")),o()})))}))}(i,a,t)}))}function V(e,t){return(0,A.P)((function(){y.Z.info("EME: Creating a new temporary session");var n=e.createSession(t,"temporary");return(0,r.of)({type:"created-session",value:{mediaKeySession:n,sessionType:"temporary"}})}))}function G(e,t,n,o){return(0,A.P)((function(){var s=null,d=t.loadedSessionsStore,c=t.persistentSessionsStore,f=d.getAndReuse(e);if(null!==f){if(z(s=f.mediaKeySession))return y.Z.info("EME: Reuse loaded session",s.sessionId),(0,r.of)({type:"loaded-open-session",value:{mediaKeySession:s,sessionType:f.sessionType,initializationData:e}});null!==c&&c.delete(e)}return(null!=s?d.closeSession(e):(0,r.of)(null)).pipe((0,l.z)((function(){return(0,i.z)(function(e,t){if(t<0||t>=e.getLength())return u.E;for(var n=[],r=e.getAll().slice(),i=r.length-t,o=0;o<i;o++){var s=r[o],l=e.closeSession(s.initializationData).pipe((0,O.h)({type:"cleaned-old-session",value:s}),(0,L.O)({type:"cleaning-old-session",value:s}));n.push(l)}return a.T.apply(void 0,n)}(d,o),K(t,e,n).pipe((0,v.U)((function(t){return{type:t.type,value:{mediaKeySession:t.value.mediaKeySession,sessionType:t.value.sessionType,initializationData:e}}}))))})))}))}var H=n(6139),W=n(6033);var $=n(9252);var j=n(3666);var Y=n(9592),q=M.Z.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,X=M.Z.EME_KEY_SYSTEMS;function Q(e,t,n){var r=t.getConfiguration();if(j.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 J(e,t){return(0,A.P)((function(){y.Z.info("EME: Searching for compatible MediaKeySystemAccess");var n=W.Z.getState(e);if(null!=n){var i=Q(t,n.mediaKeySystemAccess,n.keySystemOptions);if(null!==i)return y.Z.info("EME: Found cached compatible keySystem",i),(0,r.of)({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:i.keySystemAccess,options:i.keySystemOptions}})}var a=t.reduce((function(e,t){var n,r=X[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=0,n=Object.keys(X);t<n.length;t++){var r=n[t];if((0,C.Z)(X[r],e))return r}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return function e(t){if(t>=a.length){var n=new R.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");return(0,o._)((function(){return n}))}if(null==H.N){var r=Error("requestMediaKeySystemAccess is not implemented in your browser.");return(0,o._)((function(){return r}))}var i=a[t],s=i.keyName,u=i.keyType,l=i.keySystemOptions,d=function(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?q:[],o=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?q:[];return 0===a.length&&a.push(void 0),0===o.length&&o.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,Y.Z)(a,(function(e){return[{contentType:'video/mp4;codecs="avc1.4d401e"',robustness:e},{contentType:'video/mp4;codecs="avc1.42e01e"',robustness:e},{contentType:'video/webm;codecs="vp8"',robustness:e}]})),audioCapabilities:(0,Y.Z)(o,(function(e){return[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:e},{contentType:"audio/webm;codecs=opus",robustness:e}]})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}(s,l);return y.Z.debug("EME: Request keysystem access "+u+","+(t+1)+" of "+a.length,d),(0,H.N)(u,d).pipe((0,v.U)((function(e){return y.Z.info("EME: Found compatible keysystem",u,d),{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:e}}})),(0,h.K)((function(){return y.Z.debug("EME: Rejected access to keysystem",u,d),e(t+1)})))}(0)}))}var ee=n(2870),te=new WeakMap,ne=function(e){te.set(e,null)},re=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ee.Z)(n);te.set(e,{hash:r,serverCertificate:n})},ie=function(e){var t=te.get(e);return void 0!==t&&(null!==t||void 0)},ae=function(e,t){var n=te.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ee.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};var oe=M.Z.EME_SESSION_CLOSING_MAX_RETRY,se=M.Z.EME_SESSION_CLOSING_INITIAL_DELAY,ue=M.Z.EME_SESSION_CLOSING_MAX_DELAY;function le(e){return function n(i){return y.Z.debug("EME: Trying to close a MediaKeySession",e,i),function(e){return(0,B.S)((0,x.Z)(e.close()),(0,U.H)(1e3).pipe((0,l.z)((function(){return(0,x.Z)(e.update(new Uint8Array(1))).pipe((0,v.U)((function(){throw new Error("Compat: Couldn't know if session is closed")})),(0,h.K)((function(t){if(t instanceof Error&&"The session is already closed."===t.message)return(0,r.of)(null);var n=(0,x.Z)(e.closed);return(0,B.S)(n,(0,U.H)(1e3).pipe((0,v.U)((function(){throw new Error("Compat: Couldn't know if session is closed")}))))})))}))))}(e).pipe((0,p.b)((function(){y.Z.debug("EME: Succeeded to close MediaKeySession")})),(0,h.K)((function(r){if(!(r instanceof Error)||"InvalidStateError"!==r.name||""!==e.sessionId)return t(r);var a=i+1;if(a>oe)return t(r);var o=Math.min(Math.pow(2,i)*se,ue);return y.Z.warn("EME: attempt to close a mediaKeySession failed, scheduling retry...",o),(0,B.S)([(0,U.H)(o),(0,g.eX)(e),(0,g.GJ)(e)]).pipe((0,f.q)(1),(0,l.z)((function(){return n(a)})))})))}(0);function t(e){return y.Z.error("EME: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),(0,r.of)(null)}}var de=n(9689),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}();function fe(e,t){var n,r;return null!==(r=null!==(n=pe(e,t))&&void 0!==n?n:pe(t,e))&&void 0!==r&&r}function pe(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?ce.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?ce.decode(a.data):a.data.initData;if(!(0,b.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?ce.decode(u.data):u.data.initData,c=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?ce.decode(l.data):l.data.initData;if(!(0,b.Z)(d,c))return!1;break}}if(r===t.length)return null}return!0}}return null}var ve=function(){function e(){this._storage=[]}var t=e.prototype;return t.getAll=function(){return this._storage.map((function(e){return e.payload}))},t.getLength=function(){return this._storage.length},t.isEmpty=function(){return 0===this._storage.length},t.get=function(e){var t=this._findIndex(e);return t>=0?this._storage[t].payload:void 0},t.getAndReuse=function(e){var t=this._findIndex(e);if(-1!==t){var n=this._storage.splice(t,1)[0];return this._storage.push(n),n.payload}},t.store=function(e,t){var n=this._findIndex(e);n>=0&&this._storage.splice(n,1);var r=this._formatValuesForStore(e.values);this._storage.push({type:e.type,values:r,payload:t})},t.storeIfNone=function(e,t){if(this._findIndex(e)>=0)return!1;var n=this._formatValuesForStore(e.values);return this._storage.push({type:e.type,values:n,payload:t}),!0},t.remove=function(e){var t=this._findIndex(e);if(-1!==t)return this._storage.splice(t,1)[0].payload},t._findIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=this._storage.length-1;n>=0;n--){var r=this._storage[n];if(r.type===e.type&&fe(r.values,t))return n}return-1},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ee.Z)(n)}}))},e}(),he=function(){function e(e){this._mediaKeys=e,this._storage=new ve}var t=e.prototype;return t.get=function(e){var t=this._storage.get(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.getAndReuse=function(e){var t=this._storage.getAndReuse(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.reuse=function(e){return void 0!==this._storage.getAndReuse(e)},t.createSession=function(e,t){var n=this;if(void 0!==this._storage.get(e))throw new R.Z("MULTIPLE_SESSIONS_SAME_INIT_DATA","This initialization data was already stored.");var r=this._mediaKeys.createSession(t),i={mediaKeySession:r,sessionType:t,initializationData:e};return(0,D.Z)(r.closed)||r.closed.then((function(){var t=n._storage.get(e);void 0!==t&&t.mediaKeySession===r&&n._storage.remove(e)})).catch((function(e){y.Z.warn("EME-LSS: MediaKeySession.closed rejected: "+e)})),y.Z.debug("EME-LSS: Add MediaKeySession",i),this._storage.store(e,i),r},t.closeSession=function(e){var t=this;return(0,A.P)((function(){var n=t._storage.remove(e);return void 0===n?(y.Z.warn("EME-LSS: No MediaKeySession found with the given initData and initDataType"),u.E):le(n.mediaKeySession)}))},t.getLength=function(){return this._storage.getLength()},t.getAll=function(){return this._storage.getAll()},t.closeAllSessions=function(){var e=this;return(0,A.P)((function(){var t=e._storage.getAll().map((function(e){return le(e.mediaKeySession)}));return y.Z.debug("EME-LSS: Closing all current MediaKeySessions",t.length),e._storage=new ve,(0,i.z)(a.T.apply(void 0,t).pipe((0,m.l)()),(0,r.of)(null))}))},e}(),me=n(811),ge=n(6923);var ye=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}(),_e=function(){function e(e){!function(e){(0,me.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{this._entries=this._storage.load(),Array.isArray(this._entries)||(this._entries=[])}catch(e){y.Z.warn("EME-PSS: Could not get entries from license storage",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){if(!(0,D.Z)(t)&&(0,ge.Z)(t.sessionId)){var n=t.sessionId,r=this.get(e);null!==r&&r.sessionId===n||(null!==r&&this.delete(e),y.Z.info("EME-PSS: Add new session",n,t),this._entries.push({version:3,sessionId:n,values:this._formatValuesForStore(e.values),initDataType:e.type}),this._save())}else y.Z.warn("EME-PSS: Invalid Persisten Session given.")},t.delete=function(e){var t=this._getIndex(e);if(-1!==t){var n=this._entries[t];y.Z.warn("EME-PSS: Delete session from store",n),this._entries.splice(t,1),this._save()}else y.Z.warn("EME-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){y.Z.info("EME-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(y.Z.warn("EME-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){for(var t=this._formatValuesForStore(e.values),n=T.zo.apply(void 0,e.values.map((function(e){return e.data}))),r=(0,ee.Z)(n),i=0;i<this._entries.length;i++){var a=this._entries[i];if(a.initDataType===e.type)switch(a.version){case 3:if(fe(t,a.values))return i;break;case 2:if(a.initDataHash===r)try{var o="string"==typeof a.initData?ye.decode(a.initData):a.initData.initData;if((0,b.Z)(o,n))return i}catch(e){y.Z.warn("EME-PSS: Could not decode initialization data.",e)}break;case 1:if(a.initDataHash===r){if(void 0===a.initData.length)return i;if((0,b.Z)(a.initData,n))return i}break;default:if(a.initData===r)return i}}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){y.Z.warn("EME-PSS: Could not save licenses in localStorage")}},t._formatValuesForStore=function(e){return e.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:new ye(n),hash:(0,ee.Z)(n)}}))},e}();function be(e,t){return J(e,t).pipe((0,l.z)((function(t){var n=t.value,i=n.options,a=n.mediaKeySystemAccess,o=W.Z.getState(e),s=function(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new R.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return y.Z.debug("EME: Set the given license storage"),new _e(t)}(i);if(null!==o&&"reuse-media-key-system-access"===t.type){var u=o.mediaKeys,l=o.loadedSessionsStore;if(!1===ie(u)||!(0,D.Z)(i.serverCertificate)&&ae(u,i.serverCertificate))return(0,r.of)({mediaKeys:u,mediaKeySystemAccess:a,stores:{loadedSessionsStore:l,persistentSessionsStore:s},options:i})}return function(e){return y.Z.info("EME: Calling createMediaKeys on the MediaKeySystemAccess"),(0,F.Z)((function(){return(0,x.Z)(e.createMediaKeys())}),void 0).pipe((0,h.K)((function(e){var t=e instanceof Error?e.message:"Unknown error when creating MediaKeys.";throw new R.Z("CREATE_MEDIA_KEYS_ERROR",t)})))}(a).pipe((0,v.U)((function(e){y.Z.info("EME: MediaKeys created with success",e);var t=new he(e);return{mediaKeys:e,mediaKeySystemAccess:a,stores:{loadedSessionsStore:t,persistentSessionsStore:s},options:i}})))})))}function Te(e,t){return be(e,t).pipe((0,l.z)((function(t){var n,i,a=t.mediaKeys,o=t.mediaKeySystemAccess,u=t.stores,d=t.options;((0,D.Z)(d.licenseStorage)||!0===d.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,$.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,$.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,$.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0);var c=new s.t(1),v=null!==e.mediaKeys&&void 0!==e.mediaKeys&&a!==e.mediaKeys,h=(0,r.of)(null);return v&&(y.Z.debug("EME: Disabling old MediaKeys"),h=function(e){return(0,A.P)((function(){return W.Z.setState(e,null),(0,H.Y)(e,null)}))}(e)),h.pipe((0,l.z)((function(){return y.Z.debug("EME: Attaching current MediaKeys"),c.pipe((0,l.z)((function(){var t={loadedSessionsStore:u.loadedSessionsStore,mediaKeySystemAccess:o,mediaKeys:a,keySystemOptions:d};return function(e,t){var n=t.keySystemOptions,i=t.loadedSessionsStore,a=t.mediaKeySystemAccess,o=t.mediaKeys;return(0,A.P)((function(){var t=W.Z.getState(e);return(null!==t&&t.loadedSessionsStore!==i?t.loadedSessionsStore.closeAllSessions():(0,r.of)(null)).pipe((0,l.z)((function(){return W.Z.setState(e,{keySystemOptions:n,mediaKeySystemAccess:a,mediaKeys:o,loadedSessionsStore:i}),e.mediaKeys===o?(0,r.of)(null):(y.Z.info("EME: Attaching MediaKeys to the media element"),(0,H.Y)(e,o).pipe((0,p.b)((function(){y.Z.info("EME: MediaKeys attached with success")}))))})))}))}(e,t)})),(0,f.q)(1),(0,O.h)({type:"attached-media-keys",value:{mediaKeySystemAccess:o,mediaKeys:a,stores:u,options:d}}),(0,L.O)({type:"created-media-keys",value:{mediaKeySystemAccess:o,initializationDataSystemId:n,mediaKeys:a,stores:u,options:d,attachMediaKeys$:c}}))})))})))}var Ee=n(7326),Se=n(4578),we=n(2146),ke=n(6716),Ae=n(278),Ie=n(7991),xe=n(1454),Ze=n(6798),Me=n(1973),Re=n(1819),Ce=n(7853),Pe=n(2566),Ne=(0,Re.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function De(e){throw new Ne(e)}var Oe=n(8474);var Le=n(3505),Be=n(2572);var Ue="expired",Fe="internal-error",ze="output-restricted";function Ke(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],d=function(e,t){return-1!==e.indexOf("playready")&&(j.YM||j.kD)?(0,E.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case Ue:var c=new R.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired");if(!1!==u)throw c;r.push({type:"warning",value:c}),a.push(d);break;case Fe:var f=new R.Z("KEY_STATUS_CHANGE_ERROR","An invalid key status has been encountered: "+l);if(!0!==s.keyInternalError)throw f;r.push({type:"warning",value:f}),i.push(d);break;case ze:var p=new R.Z("KEY_STATUS_CHANGE_ERROR","An invalid key status has been encountered: "+l);if(!0!==s.keyOutputRestricted)throw p;r.push({type:"warning",value:p}),i.push(d);break;default:a.push(d)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var Ve=g.Xe,Ge=g.GJ,He=g.eX,We=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ee.Z)(r),t.prototype),r.sessionError=n,r}return(0,Se.Z)(t,e),t}((0,we.Z)(Error));function $e(e,t,n,i){y.Z.info("EME: Binding session events",e);var o,s,d=new ke.x,c=t.getLicenseConfig,f=void 0===c?{}:c,m=Ve(e).pipe((0,v.U)((function(e){throw new R.Z("KEY_ERROR",e.type)}))),g=He(e).pipe((0,l.z)((function(r){return function(e,t,n,r){y.Z.info("EME: keystatuseschange event received",e,r);var i=(0,A.P)((function(){return(0,F.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?u.E:(0,x.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,v.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=new R.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,D.Z)(e)&&(0,ge.Z)(e.message)&&(t.message=e.message),t})));return(0,a.T)(je(e,t,n),i)}(e,t,n,r)}))),_=Ge(e).pipe((0,l.z)((function(n){var r=new Uint8Array(n.message),a=(0,ge.Z)(n.messageType)?n.messageType:"license-request";y.Z.info("EME: Received message event, type "+a,e,n);var o,s,u,c,p,m,g,_,b=(0,A.P)((function(){var e=t.getLicense(r,a),n=(0,D.Z)(f.timeout)?1e4:f.timeout;return(0,x.Z)(e).pipe(n>=0?function(e,t){var n=(0,xe.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?De:a,s=n.scheduler,u=void 0===s?null!=t?t:Ie.z:s,l=n.meta,d=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ze.e)((function(e,t){var n,a,s=null,l=0,c=function(e){a=(0,Ce.A)(t,u,(function(){n.unsubscribe(),(0,Me.Xf)(o({meta:d,lastValue:s,seen:l})).subscribe(t)}),e)};n=e.subscribe(new Pe.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&c(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),c(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ae.y)})),T=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ne||(0,D.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:Ye(t)})}}}(d,f.retry);return(o=b,s=T,u=s.baseDelay,c=s.maxDelay,p=s.totalRetry,m=s.shouldRetry,g=s.onRetry,_=0,o.pipe((0,h.K)((function(e,t){if(!(0,D.Z)(m)&&!m(e)||_++>=p)throw e;"function"==typeof g&&g(e,_);var n=Math.min(u*Math.pow(2,_-1),c),r=(0,Be.Z)(n);return(0,U.H)(r).pipe((0,l.z)((function(){return t})))})))).pipe((0,v.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=Ye(e);if(!(0,D.Z)(e)&&!0===e.fallbackOnLastTry)throw y.Z.warn("EME: Last `getLicense` attempt failed. Blacklisting the current session."),new We(t);throw t})),(0,L.O)({type:"session-message",value:{messageType:a,initializationData:i}}))}))),b=(0,a.T)(_,g).pipe((o=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return function(e,t,n){return(0,D.Z)(t)?(y.Z.info("EME: No message given, skipping session.update"),(0,r.of)({type:"no-update",value:{initializationData:n}})):(y.Z.info("EME: Updating MediaKeySession with message"),(0,x.Z)(e.update(t)).pipe((0,h.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new R.Z("KEY_UPDATE_ERROR",t)})),(0,p.b)((function(){y.Z.info("EME: MediaKeySession update succeeded.")})),(0,O.h)({type:"session-updated",value:{session:e,license:t,initializationData:n}})))}(e,t.value.license,i);default:return(0,r.of)(t)}},(0,Oe.m)(s)?(0,l.z)(o,s,1):(0,l.z)(o,1))),T=(0,a.T)(je(e,t,n),b,m,d);return(0,D.Z)(e.closed)?T:T.pipe((0,Le.R)((0,x.Z)(e.closed)))}function je(e,t,n){return(0,A.P)((function(){if(0===e.keyStatuses.size)return u.E;var a=Ke(e,t,n),o=a.warnings,s=a.blacklistedKeyIDs,l=a.whitelistedKeyIds,d=o.length>0?r.of.apply(void 0,o):u.E,c=(0,r.of)({type:"keys-update",value:{whitelistedKeyIds:l,blacklistedKeyIDs:s}});return(0,i.z)(d,c)}))}function Ye(e){if(e instanceof Ne)return new R.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new R.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,D.Z)(e)&&(0,ge.Z)(e.message)&&(t.message=e.message),t}function qe(e,t){return(0,A.P)((function(){return"function"!=typeof e.setServerCertificate?(y.Z.warn("EME: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),u.E):!0===ie(e)?(y.Z.info("EME: The MediaKeys already has a server certificate, skipping..."),u.E):(y.Z.info("EME: Setting server certificate on the MediaKeys"),ne(e),function(e,t){return(0,A.P)((function(){return(0,F.Z)((function(){return(0,x.Z)(e.setServerCertificate(t))}),void 0).pipe((0,h.K)((function(e){y.Z.warn("EME: mediaKeys.setServerCertificate returned an error",e);var t=e instanceof Error?e.toString():"`setServerCertificate` error";throw new R.Z("LICENSE_SERVER_CERTIFICATE_ERROR",t)})))}))}(e,t).pipe((0,p.b)((function(){re(e,t)})),(0,m.l)(),(0,h.K)((function(e){return(0,r.of)({type:"warning",value:e})}))))}))}var Xe=M.Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,Qe=M.Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,Je=g.Oh;var et=function(e,t,n){y.Z.debug("EME: Starting EMEManager logic.");var g=new ve,_=new ve,E=Te(e,t).pipe((0,l.z)((function(e){if("attached-media-keys"!==e.type)return(0,r.of)(e);var t=e.value,n=t.mediaKeys,a=t.options.serverCertificate;return(0,D.Z)(a)?(0,r.of)(e):(0,i.z)(qe(n,a),(0,r.of)(e))})),(0,d.d)()),S=E.pipe((0,c.h)((function(e){return"attached-media-keys"===e.type})),(0,f.q)(1)),w=Je(e).pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from media element.",e)})),(0,N.Z)((function(e){return k(e)}),null),(0,d.d)({refCount:!0})),A=n.pipe((0,p.b)((function(e){y.Z.debug("EME: Encrypted event received from Player",e)}))),I=(0,a.T)(A,w).pipe((0,l.z)((function(e){return S.pipe((0,v.U)((function(t){return[e,t]})))})),(0,l.z)((function(e){var t=e[0],n=e[1],i=n.value,d=i.mediaKeySystemAccess,c=i.stores,f=i.options,p=_.get(t);if(void 0!==p){if(void 0===t.type){y.Z.error("EME: The current session has already been blacklisted but the current content is not known. Throwing.");var E=p.sessionError;return E.fatal=!0,(0,o._)((function(){return E}))}return y.Z.warn("EME: The current session has already been blacklisted. Blacklisting content."),(0,r.of)({type:"blacklist-protection-data",value:t})}var S,w=new s.t(1);if("content"===f.singleLicensePer&&!g.isEmpty()){var k=t.keyIds;if(void 0===k)return y.Z.warn("EME: Initialization data linked to unknown key id, we'll not able to fallback from it."),(0,r.of)({type:"init-data-ignored",value:{initializationData:t}});var A=g.getAll()[0];return A.lastKeyUpdate$.pipe((0,l.z)((function(e){return k.every((function(t){for(var n=0;n<e.whitelistedKeyIds.length;n++)if((0,b.Z)(e.whitelistedKeyIds[n],t))return!0}))?(n.value.stores.loadedSessionsStore.reuse(A.initializationData),(0,r.of)({type:"init-data-ignored",value:{initializationData:t}})):(0,r.of)({type:"keys-update",value:{blacklistedKeyIDs:k,whitelistedKeyIds:[]}})})))}if(!g.storeIfNone(t,{initializationData:t,lastKeyUpdate$:w}))return y.Z.debug("EME: Init data already received. Skipping it."),(0,r.of)({type:"init-data-ignored",value:{initializationData:t}});!0!==f.persistentLicense?S="temporary":!function(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,C.Z)(t,"persistent-license")}(d)?(y.Z.warn('EME: Cannot create "persistent-license" session: not supported'),S="temporary"):S="persistent-license";var I="number"==typeof f.maxSessionCacheSize?f.maxSessionCacheSize:Xe;return G(t,c,S,I).pipe((0,l.z)((function(e){switch(e.type){case"cleaning-old-session":return g.remove(e.value.initializationData),u.E;case"cleaned-old-session":return u.E;case"created-session":case"loaded-open-session":case"loaded-persistent-session":break;default:(0,P.Z)(e)}var n=e.value,i=n.mediaKeySession,o=n.sessionType,s=!1,l=T.zo.apply(void 0,t.values.map((function(e){return e.data}))),p="created-session"!==e.type?u.E:Z(i,t.type,l).pipe((0,h.K)((function(e){throw new R.Z("KEY_GENERATE_REQUEST_ERROR",e instanceof Error?e.toString():"Unknown error")})),(0,m.l)());return(0,a.T)($e(i,f,d.keySystem,t),p).pipe((0,v.U)((function(e){if("keys-update"!==e.type)return e;var n=t.keyIds;if(void 0!==n&&"init-data"!==f.singleLicensePer){var r,a=n.filter((function(t){return!e.value.whitelistedKeyIds.some((function(e){return(0,b.Z)(e,t)}))&&!e.value.blacklistedKeyIDs.some((function(e){return(0,b.Z)(e,t)}))}));if(a.length>0)(r=e.value.blacklistedKeyIDs).push.apply(r,a)}if(w.next(e.value),0===e.value.whitelistedKeyIds.length&&0===e.value.blacklistedKeyIDs.length||"temporary"===o||null===c.persistentSessionsStore||s)return e;var u=c.persistentSessionsStore;return function(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;y.Z.info("EME: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}(u,Qe-1),u.add(t,i),s=!0,e})),(0,h.K)((function(e){if(!(e instanceof We))throw e;_.store(t,e);var n=e.sessionError;if(void 0===t.type)throw y.Z.error("EME: Current session blacklisted and content not known. Throwing."),n.fatal=!0,n;return y.Z.warn("EME: Current session blacklisted. Blacklisting content."),(0,r.of)({type:"warning",value:n},{type:"blacklist-protection-data",value:t})})))})))})));return(0,a.T)(E,w.pipe((0,v.U)((function(e){return{type:"encrypted-event-received",value:e}}))),I)}},6033: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)}}},4507:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(3071),i=n(2817),a=n(9127),o=n(6139);var s=n(8719),u=n(5157),l=n(7874),d=n(3887),c=s.Oh;function f(e,t,n){var s=(0,r.T)(c(e),n);return null==l.Z.emeManager?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),(0,i.of)({type:"eme-disabled"})):0===t.length?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),(0,i.of)({type:"eme-disabled"})):"function"!=typeof o.N?(0,r.T)(s.pipe((0,a.U)((function(){throw d.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),(0,i.of)({type:"eme-disabled"})):(d.Z.debug("Init: Creating EMEManager"),l.Z.emeManager(e,t,n))}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(2817),i=n(6362),a=n(4975),o=n(4727),s=n(3833),u=n(9878),l=n(2006),d=n(8515),c=n(3994),f=n(8430),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(8719);var y=n(1669),_=n(3714),b=n(3887),T=n(8343);function E(e){return e.pipe((0,a.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,o.q)(1),(0,s.h)(void 0))}function S(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,s.h)("autoplay"),(0,u.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,r.of)("autoplay-blocked");throw e})))}function w(e){var t=e.clock$,n=e.mediaElement,a=e.startTime,s=e.mustAutoPlay,u=e.setCurrentTime,p=function(e){return e.readyState>=m.c.HAVE_METADATA?(0,r.of)(null):(0,g.K4)(e).pipe((0,o.q)(1))}(n).pipe((0,o.q)(1),(0,l.b)((function(){b.Z.info("Init: Set initial time",a);var e="function"==typeof a?a():a;u(e)})),(0,d.d)({refCount:!0})),v=p.pipe((0,c.z)((function(){if(!(0,y.Z)()||n.duration>0)return E(t);var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return E(t).pipe((0,f.O)(T.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,r.of)(e):(b.Z.info("Init: Can begin to play content"),s?S(n).pipe((0,c.z)((function(e){if("autoplay"===e)return(0,r.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,i.z)((0,r.of)(T.Z.warning(t)),(0,r.of)({type:"autoplay-blocked"}))}))):(n.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),(0,r.of)({type:"skipped"})))})),(0,d.d)({refCount:!0}));return{seek$:p,play$:v}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(1545),i=n(2817),a=n(3071),o=n(3994),s=n(5583),u=n(533),l=n(4975),d=n(4727),c=n(8902),f=n(4978),p=n(1480),v=n(3887),h=n(5767);var m=n(4437),g=n(4507),y=n(5039),_=n(7920),b=n(467),T=n(2447),E=n(2983);function S(e){var t=e.autoPlay,n=e.clock$,S=e.keySystems,w=e.mediaElement,k=e.speed$,A=e.setCurrentTime,I=e.startAt,x=e.url;if((0,h.Z)(w),null==x)throw new Error("No URL for a DirectFile content");var Z=function(e,t){return new p.y((function(n){return v.Z.info("Setting URL to Element",t,e),e.src=t,n.next(void 0),function(){(0,h.Z)(e)}}))}(w,x);v.Z.debug("Init: Calculating initial time");var M=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return v.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(w,I)};v.Z.debug("Init: Initial time calculated:",M);var R=(0,_.Z)({clock$:n,mediaElement:w,startTime:M,mustAutoPlay:t,setCurrentTime:A,isDirectfile:!0}),C=R.seek$,P=R.play$,N=Z.pipe((0,o.z)((function(){return(0,g.Z)(w,S,r.E)})),(0,m.Z)(),(0,s.B)()),D=(0,T.Z)(w),O=(0,E.Z)(w,k,n).pipe((0,u.l)()),L=(0,b.Z)(n,w,null,r.E,r.E,A),B=N.pipe((0,l.h)((function(e){return"created-media-keys"===e.type?(e.value.attachMediaKeys$.next(),!0):"eme-disabled"===e.type||"attached-media-keys"===e.type})),(0,d.q)(1),(0,c.j)(P),(0,f.w)((function(e){return"warning"===e.type?(0,i.of)(e):(0,y.Z)(n,w,null,!0)}))),U=C.pipe((0,u.l)());return(0,a.T)(B,U,N,D,O,L)}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(3071),i=n(3428),a=n(3074),o=n(2006),s=n(533),u=n(9127),l=n(3666).yS,d=n(944),c=n(3714),f=n(3887),p=n(2829),v=n(8567),h=d.Z.BUFFER_DISCONTINUITY_THRESHOLD,m=d.Z.FORCE_DISCONTINUITY_SEEK_DELAY,g=d.Z.FREEZING_STALLED_DELAY,y=d.Z.UNFREEZING_SEEK_DELAY,_=d.Z.UNFREEZING_DELTA_POSITION,b=1/60;function T(e,t,n,d,c,T){var w,k=d.pipe((0,i.M)(e),(0,a.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return E(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return E(t)&&e.splice(a,0,t),e;E(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),A=null,I=null,x=c.pipe((0,i.M)(e),(0,o.b)((function(e){var t,n=e[0],r=e[1];if(r.rebuffering&&!r.paused&&("audio"===n.bufferType||"video"===n.bufferType)){var i=r.position,a=null!==(t=r.rebuffering.position)&&void 0!==t?t:i,o=n.period.start;i<o&&Math.abs(a-o)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),T(o+.001))}})),(0,s.l)()),Z=e.pipe((0,i.M)(k),(0,u.U)((function(e){var r=e[0],i=e[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing;if(null!==d){var c=performance.now();if(c-(null===w?d.timestamp:w.attemptTimestamp)>y&&(f.Z.warn("Init: trying to seek to un-freeze player"),T(r.getCurrentTime()+_),w={attemptTimestamp:c}),c-d.timestamp>g)return{type:"stalled",value:"freezing"}}else w=null;if(null===u)return 1===s?{type:"stalled",value:"freezing"}:{type:"unstalled",value:null};if(r.seeking)A=r.position;else if(null!==A){var E=performance.now();if(null===I&&(I=E),l&&r.position<A&&E-I<m)return{type:"stalled",value:u.reason};A=null}if(I=null,null===n)return{type:"stalled",value:u.reason};var k=u.position;if(null!==k){var x=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,d=u.start,c=u.end;if(n>=(null!=d?d:l)-b)if(null===c){var p=t.getPeriodAfter(a);null!==p?o=p.start+b:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<c+b&&(o=c+b);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,n,k);if(null!==x){var Z=x+.001;if(!(Z<=t.currentTime))return f.Z.warn("SA: skippable discontinuity found in the stream",o,Z),T(Z),v.Z.warning(S(k,Z));f.Z.info("Init: position to seek already reached, no seeking",t.currentTime,Z)}}var M=null!=k?k:o,R=(0,p.XS)(a,M);if(R<h){var C=M+R+b;if(t.currentTime<C)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",M,C,h),T(C),v.Z.warning(S(M,C))}for(var P=n.periods.length-2;P>=0;P--){var N=n.periods[P];if(void 0!==N.end&&N.end<=M){if(n.periods[P+1].start>M&&n.periods[P+1].start>t.currentTime){var D=n.periods[P+1];return T(D.start),v.Z.warning(S(M,D.start))}break}}return{type:"stalled",value:u.reason}})));return(0,r.T)(x,Z)}function E(e){return null!==e.discontinuity}function S(e,t){return new c.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(3994),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(9917),i=n(2817),a=n(9127),o=n(8430),s=n(3741),u=n(4978),l=n(2006),d=n(3887);function c(e,t,n){return n.pipe((0,a.U)((function(e){return null!==e.rebuffering})),(0,o.O)(!1),(0,s.x)()).pipe((0,u.w)((function(n){return n?(0,r.P)((function(){return d.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,i.of)(0)})):t.pipe((0,l.b)((function(t){d.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,d=u.end,c=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/c,h=d/c,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(4578),i=n(3071),a=n(6697),o=n(6362),s=n(2817),u=n(6716),l=n(9917),d=n(8430),c=n(8550),f=n(3833),p=n(3505),v=n(8719),h=n(1480),m=n(9127),g=n(3741),y=n(3887),_=n(2203).Z?void 0:window.ResizeObserver;var b=n(944),T=n(9612),E=n(4309),S=n(7874);function w(e,t){return Math.abs(e-t)<=.2}function k(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function A(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function I(e,t,n){var r=Math.max(e.start,t),i=k(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=A(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var x=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=A(a.cues,n),a.start=n;else{var o=I(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=k(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||w(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=A(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(w(t,s.start)){if(w(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=A(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(w(n,s.start))return s.start=n,void r.splice(o,0,i);if(w(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=A(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(w(s.end,n))return s.cues=k(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=I(s,t,n),l=u[0],d=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,d)}for(s.cues=k(s.cues,t),s.end=t,s=r[o+1];void 0!==s&&n>s.end;)r.splice(o,1),s=r[o];return void a(o)}}r.push(i)},e}();function Z(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 p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*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 M=v.C1,R=v.ik,C=v.d5,P=b.Z.MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,N=b.Z.TEXT_TRACK_SIZE_CHECKS_INTERVAL;function D(e,t){try{e.removeChild(t)}catch(e){y.Z.warn("HTSB: Can't remove text track: not in the element.")}}function O(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 L=function(e){function t(t,n){var r;return y.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new E.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new u.x,r._destroy$=new u.x,r._buffer=new x,r._currentCues=[],function(e){var t=C(e),n=R(e),r=M(e),u=(0,i.T)(n,r),l=(0,a.F)(P).pipe((0,d.O)(null));return u.pipe((0,d.O)(null),(0,c.c)((0,o.z)(l.pipe((0,f.h)(!0),(0,p.R)(t)),(0,s.of)(!1))))}(r._videoElement).pipe((0,p.R)(r._destroy$)).subscribe((function(e){if(e){var t=Math.max(r._videoElement.currentTime+P/1e3/2,0),n=r._buffer.get(t);0===n.length?r._disableCurrentCues():r._displayCues(n)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,l.P)((function(){return t.pushChunkSync(e),(0,s.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,l.P)((function(){return n.removeBufferSync(e,t),(0,s.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,l.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,s.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){y.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;y.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,d=o.end,c=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){y.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=S.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");y.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return y.Z.debug("HTTB: Parsed successfully!",a),a}(f,c,i,p);if(0!==v&&h!==1/0){for(var g=0;g<m.length&&m[g].end<=v;)g++;for(m.splice(0,g),g=0;g<m.length&&m[g].start<v;)m[g].start=v,g++;for(g=m.length-1;g>=0&&m[g].start>=h;)g--;for(m.splice(g,m.length),g=m.length-1;g>=0&&m[g].end>h;)m[g].end=h,g--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");y.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==d)u=Math.min(h,d);else{if(m.length<=0)return void y.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");y.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?y.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){y.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._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)D(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._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)D(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=O(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var o=this._currentCues.filter((function(e){return null!==e.resolution}));o.length>0&&function(e,t){return(0,l.P)((function(){if(void 0!==_){var n=-1,r=-1;return new h.y((function(t){var i=new _((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else y.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,d.O)(null),(0,m.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,g.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))}(this._textTrackElement,N).pipe((0,p.R)(this._clearSizeUpdates$),(0,p.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<o.length;r++){var i=o[r];Z(t,n,i.resolution,i.element)}}))}},t}(T.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.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){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),d=n(4309),c=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new d.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,d=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=d[0])&&void 0!==n?n:0,_=null!==(r=d[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=c.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.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){s.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){s.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 a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return S},f:function(){return T}});var r=n(944),i=n(3887),a=n(5952),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.Z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&this._history.splice(r),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history.splice(a)}},e}();function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=r.Z.BUFFERED_HISTORY_RETENTION_TIME,p=r.Z.BUFFERED_HISTORY_MAXIMUM_ENTRIES,v=r.Z.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,h=r.Z.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE,m=r.Z.MINIMUM_SEGMENT_SIZE;function g(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t;return Math.abs(t-e.bufferedStart)<=v&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(h,n/3))}function y(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,r=n-t;return Math.abs(n-e.bufferedEnd)<=v&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-r)<=Math.min(h,r/3)}function _(e,t,n,r){void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",r,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&g(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",r,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=v)?(i.Z.debug("SI: buffered start is end of previous segment",r,t,e.start,n.end),e.bufferedStart=n.end,g(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=v?(i.Z.debug("SI: found true buffered start",r,t,e.start),e.bufferedStart=t,g(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",r,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",r,e.bufferedStart,t),e.bufferedStart=t)}function b(e,t,n){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<=v&&y(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<=v?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,y(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 T,E=function(){function e(){this._inventory=[],this._bufferedHistory=new l(f,p)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,r=t[0],a=null==r?void 0:r.infos.adaptation.type,s=e.length,u=0;u<s;u++){if(void 0===r)return;var l=e.start(u),d=e.end(u);if(d-l<m)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",a,l,d);else{for(var c=n;void 0!==r&&(0,o.Z)(r.bufferedEnd,r.end)-l<m;)r=t[++n];var f=null,p=n-c;if(p>0){var v=t[c+p-1];f={end:(0,o.Z)(v.bufferedEnd,v.end),precizeEnd:v.precizeEnd},i.Z.debug("SI: "+p+" segments GCed.",a),t.splice(c,p),n=c}if(void 0===r)return;if(d-(0,o.Z)(r.bufferedStart,r.start)>=m){if(_(r,l,f,a),n===t.length-1)return void b(r,d,a);r=t[++n];for(var h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end),y=u<s-1?e.start(u+1):void 0;void 0!==r&&d-h>=m&&(void 0===y||d-h>=g-y);){var T=t[n-1];void 0===T.bufferedEnd&&(T.bufferedEnd=r.precizeStart?r.start:T.end,i.Z.debug("SI: calculating buffered end of contiguous segment",a,T.bufferedEnd,T.end)),r.bufferedStart=T.bufferedEnd,void 0!==(r=t[++n])&&(h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end))}}var E=t[n-1];void 0!==E&&b(E,d,a)}}null!=r&&(i.Z.debug("SI: last segments have been GCed",a,n,t.length),t.splice(n,t.length-n)),void 0!==a&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+a+" 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,p=n[c],v=void 0;if(void 0===p)v=o(l.infos),n[c]=((d={})[f]=v,d);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.start,s=e.end;if(!a.isInit){var u=n.type;if(o>=s)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",u,o,s);else{for(var l=this._inventory,d={partiallyPushed:!0,splitted:!1,start:o,end:s,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},c=l.length-1;c>=0;c--){var f=l[c];if(f.start<=o){if(f.end<=o){for(i.Z.debug("SI: Pushing segment strictly after previous one.",u,o,f.end),this._inventory.splice(c+1,0,d),c+=2;c<l.length&&l[c].start<d.end;){if(l[c].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}if(f.start===o){if(f.end<=s){for(i.Z.debug("SI: Segment pushed replace another one",u,o,s,f.end),this._inventory.splice(c,1,d),c+=1;c<l.length&&l[c].start<d.end;){if(l[c].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",u,o,s,f.end),l.splice(c,0,d),f.start=d.end,f.bufferedStart=void 0,void(f.precizeStart=f.precizeStart&&d.precizeEnd)}if(f.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",u,o,s,f.start,f.end),this._inventory.splice(c+1,0,d),f.end=d.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,c+=2;c<l.length&&l[c].start<d.end;){if(l[c].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[c].start),l[c].start=d.end,l[c].bufferedStart=void 0,void(l[c].precizeStart=l[c].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[c].start,l[c].end),l.splice(c,1)}return}i.Z.debug("SI: Segment pushed is contained in a previous one",u,o,s,f.start,f.end);var p={partiallyPushed:f.partiallyPushed,splitted:!0,start:d.end,end:f.end,precizeStart:f.precizeStart&&f.precizeEnd&&d.precizeEnd,precizeEnd:f.precizeEnd,bufferedStart:void 0,bufferedEnd:f.end,infos:f.infos};return f.end=d.start,f.splitted=!0,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&d.precizeStart,l.splice(c+1,0,d),void l.splice(c+2,0,p)}}var v=this._inventory[0];if(void 0===v)return i.Z.debug("SI: first segment pushed",u,o,s),void this._inventory.push(d);if(!(v.start>=s)){if(v.end<=s){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",u,o,s,v.start,v.end),this._inventory.splice(0,1,d);l.length>1&&l[1].start<d.end;){if(l[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,d.end,l[1].start),l[1].start=d.end,l[1].bufferedStart=void 0,void(l[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[1].start,l[1].end),l.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",u,o,s,v.start,v.end),v.start=s,v.bufferedStart=void 0,v.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",u,o,s,v.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.Z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e),r[0].splitted=!0));var u=o;for(o+=1;o<n.length&&(0,a.Z)(n[o].infos,e);)o++;var l=o-1,c=l-u,f=n[l].end,p=n[l].bufferedEnd;c>0&&(this._inventory.splice(u+1,c),o-=c),this._inventory[u].partiallyPushed=!1,this._inventory[u].end=f,this._inventory[u].bufferedEnd=p,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var v,h=d(r);!(v=h()).done;){var m=v.value;void 0!==m.bufferedStart&&void 0!==m.bufferedEnd?this._bufferedHistory.addBufferedSegment(m.infos,m.bufferedStart,m.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",m)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),S=function(){function e(){this._segmentInventory=new E}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(T||(T={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t){"use strict";var n={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e){return{type:"encryption-data-encountered",value:e}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=n},3801: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){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))},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){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{ZB:function(){return r},br:function(){return i},SM:function(){return a}});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}})},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,s.xhr=o,s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,emeManager:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return c},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791),d=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],d=void 0;for(d=0;d<a.length;d++)if(s.systemId===a[d].systemId){if((0,l.Z)(s.data,a[d].data))break;u.Z.warn("Manifest: different init data for the same system ID")}d===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),c=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.isTrickModeTrack=t.isTrickModeTrack,this.type=t.type,void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,c=[],f=!1,p=0;p<l.length;p++){var v=new d(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(c.push(v),!f&&v.isSupported&&(f=!0))}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},5952:function(e,t,n){"use strict";function r(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}n.d(t,{Z:function(){return r}})},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(4791),s=n(3274),u=n(1959),l=n(908),d=n(8806),c=n(8999),f=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 c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,f.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,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}))},e}(),v=n(3887),h=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){v.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){v.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var m=n(5138);function g(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),o=function(e){var t=i[e],o=(0,s.Z)(a,(function(e){return e.id===t.id}));if(void 0===o)v.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=o.representations,d=function(e){var t=u[e],i=(0,s.Z)(l,(function(e){return e.id===t.id}));void 0===i?v.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},c=0;c<u.length;c++)d(c)},u=0;u<i.length;u++)o(u)}var y=(0,l.Z)(),_=(0,l.Z)();function b(e,t){for(var n=[],r=0;r<e.periods.length;r++)for(var i=e.periods[r],a=i.getAdaptations(),o=0;o<a.length;o++)for(var s=a[o],u=s.representations,l=0;l<u.length;l++){var d=u[l],c=t(d);c!==d.decipherable&&(n.push({manifest:e,period:i,adaptation:s,representation:d}),d.decipherable=c)}return n}var T=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=_(),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){return(0,s.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},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.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateDeciperabilitiesBasedOnKeyIds=function(e){var t=e.whitelistedKeyIds,n=e.blacklistedKeyIDs,r=b(this,(function(e){if(!1===e.decipherable||void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],s=0;s<n.length;s++)if((0,o.Z)(n[s],a.keyId))return!1;for(var u=0;u<t.length;u++)if((0,o.Z)(t[u],a.keyId))return!0}return e.decipherable}));r.length>0&&this.trigger("decipherabilityUpdate",r)},n.addUndecipherableProtectionData=function(e){var t=b(this,(function(t){var n,r;if(!1===t.decipherable)return!1;for(var i=null!==(r=null===(n=t.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(t){if((void 0===e.type||i[t].type===e.type)&&e.values.every((function(e){return i[t].values.some((function(t){return(void 0===e.systemId||t.systemId===e.systemId)&&(0,o.Z)(t.data,e.data)}))})))return{v:!1}},s=0;s<i.length;s++){var u=a(s);if("object"==typeof u)return u.v}return t.decipherable}));t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,d.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,d.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,d.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-"+y(),o="gen-image-rep-"+y(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new h({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.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,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+y(),s="gen-text-rep-"+y(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new h({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){g(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)v.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var d=t.slice(n,t.length);d.length>0&&e.push.apply(e,d)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");g(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,d=o;d<e.length;d++)if(u.id===e[d].id){l=d;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),g(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(u.Z)},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,{iz:function(){return o},t_:function(){return a},Qy:function(){return s},Xj:function(){return l},nR:function(){return u}});var r=n(3887),i=n(6968);function a(e,t){var n=s(e,t);return null!==n?e.subarray(n[1],n[2]):null}function o(e,t){var n=s(e,t);return null!==n?e.subarray(n[0],n[2]):null}function s(e,t){for(var n,r,a=e.length,o=0,s=0;o+8<=a;){if(r=o,s=(0,i.pX)(e,r),r+=4,n=(0,i.pX)(e,r),r+=4,0===s)s=a-o;else if(1===s){if(r+8>a)return null;s=(0,i.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 u(e,t,n,r,a){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,i.pX)(e,l),l+=4;var d=(0,i.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,i.pV)(e,l),l+=8}if(1970628964===d&&l+16<=s&&(0,i.pX)(e,l)===t&&(0,i.pX)(e,l+4)===n&&(0,i.pX)(e,l+8)===r&&(0,i.pX)(e,l+12)===a)return l+=16,e.subarray(l,u+o)}}function l(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,a=(0,i.pX)(e,n);n+=4;var o=(0,i.pX)(e,n);if(n+=4,0===a)a=t;else if(1===a){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;a=(0,i.pV)(e,n),n+=8}if(a<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,a]}},6807:function(e,t,n){"use strict";n.d(t,{XA:function(){return i},Le:function(){return a},fs:function(){return o},E3:function(){return s}});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.t_)(e,1835295092)}function o(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 s(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){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),d=u(l,s[1]-s[0]);void 0!==d&&a.push({systemId:d,data:l}),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,{LD:function(){return f},Qx:function(){return d},MM:function(){return c},Wf:function(){return l},J6:function(){return p},s9:function(){return v}});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=(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 p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>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+v-1]}),l+=h,r+=v}return c}function d(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 c(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1953658222);if(null!==n){var r=0,a=n[r];if(r+=1,!(a>1)){var o=(0,i.QI)(n,r);r+=3;var l=(256&o)>0,d=0;if(l||void 0!==(d=function(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)}}(t))){var c=(1&o)>0,f=(4&o)>0,p=(512&o)>0,v=(1024&o)>0,h=(2048&o)>0,m=(0,i.pX)(n,r);r+=4,c&&(r+=4),f&&(r+=4);for(var g=m,y=0;g-- >0;)l?(y+=(0,i.pX)(n,r),r+=4):y+=d,p&&(r+=4),v&&(r+=4),h&&(r+=4);return y}}}}}function f(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 p(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 v(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,p=c.string;d=f;var v=(0,a.DM)(o,d),h=v.end,m=v.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 T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(d,s)};t.push(T)}}if(0!==t.length)return t}},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 p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(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 T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:d,imageCount:c,timescale:1e3,format:p,width:v,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=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=(0,s.k6)(u,void 0!==e.initialization?e.initialization.media:void 0,l,d),h=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:v,range:h},mediaURLs:(0,s.k6)(u,e.media,l,d),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,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._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),d=(0,r.gT)(t+n,e),c=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:void 0,m=[],g=c.length,y=c.length>0&&null!=c[0].duration?c[0].duration:0,_=0;_<g;_++){var b=c[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,c[_+1],o),k=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),A=E+k*T;A<d&&k<=w;){var I=null!=h?h+k:void 0,x=null===p?null:p.map((0,i.QB)(A,I)),Z=A-e.indexTimeOffset,M={id:String(A),time:Z/f,end:(Z+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:x,number:I,timestampOffset:-e.indexTimeOffset/f,privateInfos:{isEMSGWhitelisted:a}};m.push(M),A=E+ ++k*T}if(A>=d)return m;null!=h&&(h+=w+1)}return m}},4784:function(e,t,n){"use strict";n.d(t,{k6:function(){return o},QB:function(){return u}});var r=n(6923),i=n(9829);function a(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 o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(|\%0(\d+)d)\$/g,a(void 0===n?0:n))}function u(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 a(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 a(e)(t,n,r)}))}}},148:function(e,t,n){"use strict";n.d(t,{Z:function(){return je}});var r=n(8418),i=n(1946),a=n(944),o=n(3887),s=n(3274),u=n(9829);function l(e){return 0===e.length?0:e.reduce((function(e,t){var n;return Math.min(null!==(n=t.attributes.availabilityTimeOffset)&&void 0!==n?n:0,e)}),1/0)}function d(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function f(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;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 previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function p(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function v(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=p(r);if(void 0===u)return;a=u}if(void 0!==i){var l=p(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}}}var h=n(9592),m=n(908),g=n(1679),y=n(3635);var _=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),b=n(7714),T=n(6923),E=n(8999);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return w(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 w(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 w(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=S(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=S(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,d=S(E.r);!(u=d()).done;){var c=e[u.value];if(void 0!==c)for(var f,p=S(c);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},A=["subtitle","caption"];function I(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,b.Z)(E.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)(A,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 p=i(c,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var x=n(8026);var Z=n(7403),M=n(3911),R=n(1915),C=n(4784),P=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,d=u-r*l,c=e.list.map((function(e){return{mediaURLs:(0,C.k6)(i,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:c,timescale:l,duration:e.duration,indexTimeOffset:d,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(i,e.initialization.media,a,o),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,R.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,M.PZ)(s,t,a),l=u[0],d=u[1],c=Math.min(i.length-1,Math.floor(d/r)),f=[],p=Math.floor(l/r);p<=c;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),N=n(9362),D=n(8232),O=n(1091),L=n(5505),B=n(6394),U=a.Z.DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR;function F(e,t,n){return t+U*e>=n}function z(e,t,n,r){var i=e.start,a=e.duration,s=e.repeatCount;return null==i&&(null==t?i=r:null!=t.duration&&(i=t.start+t.duration*(t.repeatCount+1))),null!=a&&!isNaN(a)||null==n||null==n.start||isNaN(n.start)||null==i||isNaN(i)||(a=n.start-i),null==i||isNaN(i)||null==a||isNaN(a)||null!=s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:i,duration:a,repeatCount:void 0===s?0:s}}function K(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e,t){for(var n=[],r=0;r<e.length;r++)n.push(K(e[r]));for(var i=[],a=0;a<n.length;a++){var o=z(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!=o&&i.push(o)}return i}function G(e,t,n){var r,i=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 p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-d;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(v+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===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,d=t.length-a+s-1;if(d>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e,n);var c=t.slice(a);if(u>0){var f=c[0];f.start+=f.duration*u,c[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e,n);var p=c[c.length-1],v=K(e[d]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),V(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=d+1;y<e.length;y++)g.push(K(e[y]));for(var _=0;_<g.length;_++){var b=z(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return c.concat(m)}var H=a.Z.MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY,W=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.manifestBoundsCalculator,s=n.isDynamic,u=n.representationBaseURLs,l=n.representationId,d=n.representationBitrate,c=n.periodStart,f=n.periodEnd,p=n.isEMSGWhitelisted,v=null!==(r=t.timescale)&&void 0!==r?r:1,h=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-c*v;this._manifestBoundsCalculator=o,this._isEMSGWhitelisted=p,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=s,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null,this._index={indexRange:t.indexRange,indexTimeOffset:h,initialization:null==t.initialization?void 0:{mediaURLs:(0,C.k6)(u,t.initialization.media,l,d),range:t.initialization.range},mediaURLs:(0,C.k6)(u,t.media,l,d),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:v},this._scaledPeriodStart=(0,M.gT)(c,this._index),this._scaledPeriodEnd=null==f?void 0:(0,M.gT)(f,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,M.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,M.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,M._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof N.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},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},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._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate},t.isFinished=function(){if(!this._isDynamic)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,M.jH)(t,null,this._scaledPeriodEnd);return F(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,M.gT)(e,this._index);(0,D.Z)(this._index.timeline,t)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,M.jH)(e[e.length-1],null,t)},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,t=this._parseTimeline();return this._parseTimeline=null,null===this._unsafelyBaseOnPreviousIndex||t.length<H?V(t,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(e=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=e):e=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,G(t,e,this._scaledPeriodStart))},e}(),$=a.Z.MINIMUM_SEGMENT_SIZE,j=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,d=t.representationId,c=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=i,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var v=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,h=v-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:h,initialization:null==e.initialization?void 0:{mediaURLs:(0,C.k6)(l,e.initialization.media,d,c),range:e.initialization.range},mediaURLs:(0,C.k6)(l,e.media,d,c),presentationTimeOffset:v,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,d=(e+t)*a-s,c=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==c||null==f)return[];var p=Math.max(c,l),v=Math.min(f,d);if(v+r<=p)return[];for(var h=[],m=null==i?1:i,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,C.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&F(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var a=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+a-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var o=(i-this._periodStart)*r;if(o<0)return null;var s=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+a)*r,u=Math.floor((o+s)/n);return u<=0?null:(u-1)*n}var l=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(l/n)-1,c=d*n;return l-c>$*r||0===d?c:(d-1)*n},e}();function Y(e,t){var n=[];if(0===t.length)return e;if(0===e.length){for(var r=0;r<t.length;r++)(0,b.Z)(n,t[r].value)||n.push(t[r].value);return n}for(var i=0;i<e.length;i++)for(var a=e[i],o=0;o<t.length;o++){var s=(0,u.Z)(a,t[o].value);(0,b.Z)(n,s)||n.push(s)}return n}function q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function J(e,t,n){for(var r,i,a,u=[],d=function(){for(var e=a.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");u.some((function(e){return e.id===d}));)d+="-dup";var c=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,f=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),p=function(e,t){var n,r,i,a=Y(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,d=t.isDynamic,c=t.end,f=t.start,p=t.receivedTime,v=t.timeShiftBufferDepth,h=t.unsafelyBaseOnPreviousRepresentation,m=t.inbandEventStreams,g={aggressiveMode:o,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:h,isEMSGWhitelisted:function(e){return void 0!==m&&m.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},manifestBoundsCalculator:u,isDynamic:d,periodEnd:c,periodStart:f,receivedTime:p,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:v};if(void 0!==e.children.segmentBase){var y=e.children.segmentBase;g.availabilityTimeOffset=t.availabilityTimeOffset+l(e.children.baseURLs)+(null!==(n=y.availabilityTimeOffset)&&void 0!==n?n:0),i=new Z.Z(y,g)}else if(void 0!==e.children.segmentList){var _=e.children.segmentList;i=new P(_,g)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var b=t.parentSegmentTemplates.slice(),T=e.children.segmentTemplate;void 0!==T&&b.push(T);var E=x.Z.apply(void 0,[{}].concat(b));g.availabilityTimeOffset=t.availabilityTimeOffset+l(e.children.baseURLs)+(null!==(r=E.availabilityTimeOffset)&&void 0!==r?r:0),i=W.isTimelineIndexArgument(E)?new W(E,g):new j(E,g)}else{var S=t.adaptation.children;if(void 0!==S.segmentBase){var w=S.segmentBase;i=new Z.Z(w,g)}else if(void 0!==S.segmentList){var k=S.segmentList;i=new P(k,g)}else i=new j({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},g)}return i}(e,(0,x.Z)({},n,{unsafelyBaseOnPreviousRepresentation:c,adaptation:t,inbandEventStreams:f})),v=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),v=0):v=e.attributes.bitrate;var h={bitrate:v,index:p,id:d},m=void 0;if(null!=e.attributes.codecs?m=e.attributes.codecs:null!=t.attributes.codecs&&(m=t.attributes.codecs),null!=m&&(m="mp4a.40.02"===m?"mp4a.40.2":m,h.codecs=m),null!=e.attributes.frameRate?h.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(h.frameRate=t.attributes.frameRate),null!=e.attributes.height?h.height=e.attributes.height:null!=t.attributes.height&&(h.height=t.attributes.height),null!=e.attributes.mimeType?h.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(h.mimeType=t.attributes.mimeType),null!=e.attributes.width?h.width=e.attributes.width:null!=t.attributes.width&&(h.width=t.attributes.width),null!=t.children.contentProtections){var g=t.children.contentProtections.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&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r,i=[],a=q(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(g.initData).length>0||g.keyIds.length>0)&&(h.contentProtections=g)}h.hdrInfo=Q({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:m}),u.push(h)},c=q(e);!(a=c()).done;)d();return u}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(null==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){return null!=e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function ie(e){return null!=e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ae(e,t){if((0,T.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,T.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,T.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,T.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,T.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,T.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function 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="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 ue(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 ue(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 ue(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 le=(0,m.Z)();function de(e,t){var n,r,i,a,u=[],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.timeShiftBufferDepth,p=new _({isDynamic:c,timeShiftBufferDepth:f});c||null==t.duration||p.setLastPosition(t.duration);for(var v=function(v){var m=e[v],_=t.xlinkInfos.get(m),E=Y(t.baseURLs,m.children.baseURLs),S=d[v],w=S.periodStart,A=S.periodDuration,x=S.periodEnd,Z=void 0;for(null==m.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),Z="gen-dash-period-"+le()):Z=m.attributes.id;u.some((function(e){return e.id===Z}));)Z+="-dup";var M=void 0!==_?_.receivedTime:t.receivedTime,R=l(m.children.baseURLs)+t.availabilityTimeOffset,C=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(Z))&&void 0!==r?r:null,P={aggressiveMode:t.aggressiveMode,availabilityTimeOffset:R,baseURLs:E,manifestBoundsCalculator:p,end:x,isDynamic:c,manifestProfiles:t.manifestProfiles,receivedTime:M,segmentTemplate:m.children.segmentTemplate,start:w,timeShiftBufferDepth:f,unsafelyBaseOnPreviousPeriod:C},N=function(e,t){var n,r,i,a,u,d={},c=[],f={},p=[],v={};e.sort((function(e,t){var n,r,i=null!==(n=e.attributes.selectionPriority)&&void 0!==n?n:1;return(null!==(r=t.attributes.selectionPriority)&&void 0!==r?r:1)-i}));for(var h,m=ee(e);!(h=m()).done;){var g=h.value,y=g.children,_=y.essentialProperties,E=y.roles,S=Array.isArray(E)&&E.some((function(e){return"main"===e.value}))&&E.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),w=g.children.representations,A=l(g.children.baseURLs)+t.availabilityTimeOffset,x=g.attributes.mimeType,Z=g.attributes.codecs,M=I(w,(0,T.Z)(x)?x:null,(0,T.Z)(Z)?Z:null,null!=y.roles?y.roles:null);if(void 0!==M){var R=g.attributes.id,C=void 0,P=oe(g),N=[];void 0!==t.segmentTemplate&&N.push(t.segmentTemplate),void 0!==g.children.segmentTemplate&&N.push(g.children.segmentTemplate);var D={aggressiveMode:t.aggressiveMode,availabilityTimeOffset:A,baseURLs:Y(t.baseURLs,y.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:N,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},O=Array.isArray(_)?(0,s.Z)(_,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,L=null===(n=null==O?void 0:O.value)||void 0===n?void 0:n.split(" "),B=void 0!==L;if("video"===M&&S&&void 0!==d.video&&d.video.length>0&&void 0!==v.video&&!B){var U,F=d.video[v.video];D.unsafelyBaseOnPreviousAdaptation=null!==(i=null===(r=t.unsafelyBaseOnPreviousPeriod)||void 0===r?void 0:r.getAdaptation(F.id))&&void 0!==i?i:null;var z=J(w,g,D);(U=F.representations).push.apply(U,z),C=F.id}else{var K=y.accessibilities,V=void 0;void 0!==E&&E.some((function(e){return"dub"===e.value}))&&(V=!0);var G=void 0;"text"!==M?G=!1:void 0!==K&&(G=K.some(re));var H=void 0;"audio"!==M?H=!1:void 0!==K&&(H=K.some(ne));var W=void 0;"video"!==M?W=!1:void 0!==K&&(W=K.some(ie));for(var $=ae(g,{isAudioDescription:H,isClosedCaption:G,isSignInterpreted:W,isTrickModeTrack:B,type:M});(0,b.Z)(p,$);)$+="-dup";C=$,p.push($),D.unsafelyBaseOnPreviousAdaptation=null!==(u=null===(a=t.unsafelyBaseOnPreviousPeriod)||void 0===a?void 0:a.getAdaptation($))&&void 0!==u?u:null;var j={id:$,representations:J(w,g,D),type:M,isTrickModeTrack:B};null!=g.attributes.language&&(j.language=g.attributes.language),null!=G&&(j.closedCaption=G),null!=H&&(j.audioDescription=H),!0===V&&(j.isDub=!0),!0===W&&(j.isSignInterpreted=!0);var q=d[M];if(void 0!==L)c.push({adaptation:j,trickModeAttachedAdaptationIds:L});else if(void 0===q)d[M]=[j],S&&(v[M]=0);else{for(var X,Q=null,te=function(){var e=X.value,t=f[e];if(null!=t&&t.newID!==C&&(0,b.Z)(t.adaptationSetSwitchingIDs,R)){var n,r=(0,s.Z)(q,(function(t){return t.id===e}));null!=r&&r.audioDescription===j.audioDescription&&r.closedCaption===j.closedCaption&&r.language===j.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',R,e),(n=r.representations).push.apply(n,j.representations),Q=r)}},se=ee(P);!(X=se()).done;)te();if(S){var ue=v[M],le=void 0===ue?0:ue+1;if(null===Q)q.splice(le,0,j),v[M]=le;else{var de=q.indexOf(Q);de<0?(q.splice(le,0,j),v[M]=le):(void 0===ue||de>ue)&&(q.splice(de,1),q.splice(le,0,Q),v[M]=le)}}else null===Q&&q.push(j)}}null!=R&&null==f[R]&&(f[R]={newID:C,adaptationSetSwitchingIDs:P})}}return k(d,c),d}(m.children.adaptations,P),D=(null!==(i=t.xmlNamespaces)&&void 0!==i?i:[]).concat(null!==(a=m.attributes.namespaces)&&void 0!==a?a:[]),O=function(e,t,n){for(var r,i,a,o=[],s=se(e);!(a=s()).done;)for(var u,l=a.value,d=l.attributes,c=d.schemeIdUri,f=void 0===c?"":c,p=d.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=se(l.children.events);!(u=m()).done;){var g=u.value;if(void 0!==g.eventStreamData){var _=(null!==(i=g.presentationTime)&&void 0!==i?i:0)/v+t,b=void 0===g.duration?void 0:_+g.duration/v,T=void 0;if(g.eventStreamData instanceof Element)T=g.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,y.uR)(new Uint8Array(g.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:g.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(m.children.eventStreams,w,D),L={id:Z,start:w,end:x,duration:A,adaptations:N,streamEvents:O};if(u.unshift(L),!p.lastPositionIsKnown()){var B=function(e){for(var t,n=null,r=!0,i=(0,g.Z)(e).filter((function(e){return null!=e})),a=se((0,h.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=se(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(N);if(c)if("number"==typeof B){var U=performance.now()/1e3;p.setLastPosition(B,U)}else{var F=ce(t,w);if(void 0!==F){var z=F[0],K=F[1];p.setLastPosition(z,K)}}else"number"==typeof B&&p.setLastPosition(B)}},m=e.length-1;m>=0;m--)v(m);if(t.isDynamic&&!p.lastPositionIsKnown()){var E=ce(t,0);if(void 0!==E){var S=E[0],w=E[1];p.setLastPosition(S,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];null==i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",i,r),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(u)}function ce(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function fe(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 ve=a.Z.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;var he=function e(t,n,r,i,a){void 0===a&&(a=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?d(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&&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 n.externalClockOffset=d(i),e(t,n,r,!0)}}}}}for(var b=[],T=0;T<c.periods.length;T++){var E=c.periods[T].attributes,S=E.xlinkHref,w=E.xlinkActuate;null!=S&&"onLoad"===w&&b.push({index:T,ressource:S})}return 0===b.length?function(e,t,n,r){var i,a,s,d,c,p,h=e.children,m=e.attributes,g="dynamic"===m.type,y=Y(void 0===t.url?[]:[(0,u.f)(t.url)],h.baseURLs),_=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),b=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,S=l(h.baseURLs),w={aggressiveMode:t.aggressiveMode,availabilityStartTime:_,availabilityTimeOffset:S,baseURLs:y,clockOffset:T,duration:m.duration,isDynamic:g,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:b,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},k=de(h.periods,w),A=m.duration,I=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(d=0===m.minimumUpdatePeriod?ve:m.minimumUpdatePeriod);var x=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[v(e),f(e)]}(k),Z=x[0],M=x[1],R=performance.now();if(g){var C;if(c=Z,I=null!=b?b:null,void 0!==M)C=M;else{var P=null!=_?_:0,N=t.externalClockOffset;if(void 0===N)o.Z.warn("DASH Parser: use system clock to define maximum position"),C=Date.now()/1e3-P;else C=(performance.now()+N)/1e3-P}p={isLinear:!0,value:C,time:R},null!==I&&void 0!==c&&C-c>I&&(I=C-c)}else{c=void 0!==Z?Z:void 0!==(null===(i=k[0])||void 0===i?void 0:i.start)?k[0].start:0;var D=null!=A?A:1/0;if(void 0!==k[k.length-1]){var O=k[k.length-1],L=null!==(a=O.end)&&void 0!==a?a:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L<D&&(D=L)}void 0!==M&&M<D&&(D=M),p={isLinear:!1,value:D,time:R}}var B=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(s=k[k.length-1])||void 0===s?void 0:s.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:_,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:B,periods:k,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:c,timeshiftDepth:I,maximumTimeData:p},lifetime:d,uris:null==t.url?h.locations:[t.url].concat(h.locations)},warnings:n}}}(t,n,r,a):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(o){if(o.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var s=o.length-1;s>=0;s--){var u,l=b[s].index,d=o[s],f=d.parsed,p=d.warnings,v=d.receivedTime,h=d.sendingTime,m=d.url;p.length>0&&r.push.apply(r,p);for(var g,y=fe(f);!(g=y()).done;){var _=g.value;a.set(_,{receivedTime:v,sendingTime:h,url:m})}(u=c.periods).splice.apply(u,[l,1].concat(f))}return e(t,n,r,i,a)}}}},me=n(7326),ge=n(4578),ye=n(2146),_e=n(9689),be=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Te=/([0-9]+)-([0-9]+)/;function Ee(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ce("`"+t+'` property is not a boolean value but "'+e+'"')]}function Se(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){var n=parseFloat(e);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function ke(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ae(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ce("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function Ie(e,t){if(!(0,T.Z)(e))return[0,new Ce("`"+t+"` property is empty")];var n=be.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,T.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,T.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,T.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,T.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,T.Z)(n[10])?n[10]:"0")+parseFloat((0,T.Z)(n[12])?n[12]:"0"),null]}function xe(e,t){var n=Te.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ze(e,t){try{return[(0,_e.K)(e),null]}catch(n){return[null,new Ce("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Me(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 Re(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ce=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,me.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ge.Z)(t,e),t}((0,ye.Z)(Error));function Pe(e){var t={},n=e.textContent,r=[],i=Re(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":"INF"===o.value?t.availabilityTimeOffset=1/0:i(o.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"})}}return[{value:n,attributes:t},r]}function Ne(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}function De(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ze(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,y.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Re(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:xe,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Le(e){for(var t={},n=[],r=Re(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:Se,dashName:"timescale"});break;case"presentationTimeOffset":r(c.value,{asKey:"presentationTimeOffset",parser:we,dashName:"presentationTimeOffset"});break;case"indexRange":r(c.value,{asKey:"indexRange",parser:xe,dashName:"indexRange"});break;case"indexRangeExact":r(c.value,{asKey:"indexRangeExact",parser:Ee,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(c.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(c.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"duration":r(c.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"startNumber":r(c.value,{asKey:"startNumber",parser:Se,dashName:"startNumber"})}}return[t,n]}function Be(e){for(var t={},n=[],r=Re(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:xe,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:xe,dashName:"mediaRange"})}}return[t,n]}function Ue(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=Be(s),l=u[0],d=u[1];i.push(l),r=r.concat(d)}}return[(0,x.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 ze(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,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=Re(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":"INF"===d.value&&(s.availabilityTimeOffset=1/0),u(d.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"media":s.media=d.value;break;case"bitstreamSwitching":u(d.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"})}}return[s,i]}function Ke(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];switch(i.nodeName){case"BaseURL":var a=Pe(i),o=a[0],s=a[1];void 0!==o&&t.baseURLs.push(o),n=n.concat(s);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Me(i));break;case"SegmentBase":var u=Le(i),l=u[0],d=u[1];t.segmentBase=l,d.length>0&&(n=n.concat(d));break;case"SegmentList":var c=Ue(i),f=c[0],p=c[1];n=n.concat(p),t.segmentList=f;break;case"SegmentTemplate":var v=ze(i),h=v[0],m=v[1];n=n.concat(m),t.segmentTemplate=h}}return[t,n]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Re(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:Se,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:Se,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"})}}return void 0===t.bitrate&&n.push(new Ce("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ve(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=[Me(a)]:t.accessibilities.push(Me(a));break;case"BaseURL":var o=Pe(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Ne(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Me(a)]:t.essentialProperties.push(Me(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Me(a));break;case"Representation":var l=Ke(a),d=l[0],c=l[1];t.representations.push(d),c.length>0&&(r=r.concat(c));break;case"Role":null==t.roles?t.roles=[Me(a)]:t.roles.push(Me(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Me(a)]:t.supplementalProperties.push(Me(a));break;case"SegmentBase":var f=Le(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Ue(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=ze(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=De(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),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=Re(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:Se,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:Se,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Se,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Se,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Se,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Se,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Se,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:Se,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:ke,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:ke,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"})}}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=Re(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:Se,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=He(s),l=u[0],d=u[1];t.children.events.push(l),d.length>0&&(n=n.concat(d))}}return[t,n]}function He(e){for(var t={eventStreamData:e},n=[],r=Re(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:Se,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function We(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Pe(s),l=u[0],d=u[1];void 0!==l&&n.push(l),i=i.concat(d);break;case"AdaptationSet":var c=Ve(s),f=c[0],p=c[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=Ge(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=ze(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=Re(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:Ie,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:Ie,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function $e(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Pe(s),l=u[0],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=We(s),f=c[0],p=c[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=Me(s);i.push(v)}}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=Re(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Ae,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ae,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ae,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:Ie,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:Ie,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:Ie,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:Ie,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:Ie,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:Ie,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:Ie,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var je=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=$e(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,d="<root>"+o+"</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,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=We(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}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(;e.length>0;){var n=e[0];if(n.start>=t)return;if(n.repeatCount<=0)e.shift();else{var r=e[1];if(null!=r&&r.start<=t)e.shift();else{if(n.duration<=0)return;for(var i=n.start+n.duration,a=1;i<t&&a<=n.repeatCount;)i+=n.duration,a++;if(!(a>n.repeatCount)){var o=n.repeatCount-a;return n.start=i,void(n.repeatCount=o)}e.shift()}}}}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";function r(e,t,n){var r,i=e.repeatCount;return i>=0?i:(r=null!=t?t.start:null!=n?n:Number.MAX_VALUE,Math.ceil((r-e.start)/e.duration)-1)}function i(e,t,n){var i=e.start,a=e.duration;return a<=0?i:i+(r(e,t,n)+1)*a}function a(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function o(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function s(e,t,n){return[e*n,(e+t)*n]}function u(e,t,n){var r=e.timeline,s=a(t,e);if(s<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,s);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 s>=i(l,d,n)&&s<c?o(c,e):null}n.d(t,{KF:function(){return r},jH:function(){return i},gT:function(){return a},zG:function(){return o},PZ:function(){return s},_j:function(){return u}})},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return a.duration/n===e.duration&&(null==a.range?null==e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1]);if(a.repeatCount>=0&&null!=a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){var n=e.length;if(0!==e.length){if(0!==t.length){var 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)return void e.splice.apply(e,[u,n-u].concat(t));if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),void e.splice.apply(e,[u,n-u].concat(t));if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),void e.splice.apply(e,[u+1,n-(u+1)].concat(t));if(d.start+d.duration*(d.repeatCount+1)<=o)return void e.splice.apply(e,[u+1,n-(u+1)].concat(t));var c=(o-d.start)/d.duration-1;if(c%1==0&&d.duration===t[0].duration){var f=t[0].repeatCount<0?-1:t[0].repeatCount+c+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,void(e[u].repeatCount=f)}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(c),void e.splice.apply(e,[u+1,n-(u+1)].concat(t))}}var p=e[e.length-1],v=t[t.length-1];if(void 0!==p.repeatCount&&p.repeatCount<0)return p.start>v.start?void i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),void e.splice.apply(e,[0,n].concat(t)));p.start+p.duration*(p.repeatCount+1)>=v.start+v.duration*(v.repeatCount+1)?i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)))}}else e.splice.apply(e,[0,n].concat(t))}},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,p=/<sync[ >]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.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=p.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),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if(" "===d)v[v.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 p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=d.split(a),m=0;m<h.length;m++){0!==m&&p.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(t)})),p.appendChild(y)}f.appendChild(p),c.appendChild(f),v.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,p=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.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=p.exec(e),f=v.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),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,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(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 p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}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=[],p=0;p<c.length;p++){var v=(0,a.Z)(c[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).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}}},4123: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)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var d=t[l];if(void 0!==d){var c=function(){var e=void 0,t=void 0;if(d.nodeType===Node.ELEMENT_NODE)for(var l=d,c=0;c<=l.attributes.length-1;c++){var f=l.attributes[c],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(c,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof c)return c.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);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(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.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=v.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=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.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 T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.fontSize=r[1]+r[2]:"c"===r[2]?(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1])):p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2]))}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var 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 x=t.visibility;(0,l.Z)(x)&&(e.style.visibility=x),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.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])):p.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])):p.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=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var d=v.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])):p.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=v.eT.exec(r[0]),a=v.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])):p.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])):p.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";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,c.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}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=[],c=0;c<s.length;c++){var p=s[c];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,d.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,d.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var d=n.cellResolution,c=(0,s.Z)(t,n);return{start:c.start+u,end:c.end+u,element:E(t,r,i,a,o,{cellResolution:d,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},d={left:"line-left",center:"center",right:"line-right"};function c(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,c=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,c),v=p.start,h=p.end,m=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 l=u.trim();u=l=l.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("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var c=l[a];e.lineAlign=void 0===c?"":c}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=c(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var d=n(5138),c=n(7714);var 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 p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=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),p=parseInt(c[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):d={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:d,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,d.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,c.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=0;I<=g.length-1;I++){var x=g[I];if(x instanceof Element){var Z=x.getAttribute("xml:id");null!==Z&&function(){var e=(0,l.b)(x),t=x.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var M=(0,l.U)(f,null!==h?[h]:[],b,A),R="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var N=(0,u.Z)(P,"div"),D=(0,a.Z)({},M,(0,l.U)(f,[P].concat(N),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:R,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:D,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{YU:function(){return f},Dq:function(){return c},GK:function(){return p},ev:function(){return v},eT:function(){return d},_0:function(){return l},KO:function(){return i},gu:function(){return r},wf:function(){return a},jb:function(){return o},te:function(){return u},Du:function(){return s}});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])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},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=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function 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 p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}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,p,v,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: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.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={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.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[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var c=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);c.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);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 v.value+=y,p.setAttributeNode(v),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){p.appendChild(e)})),u.appendChild(c),c.appendChild(p),{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),p=0;p<c.length;p++){var v=(0,o.Z)(c[p],t);if(null!=v){var h=A(v,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,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[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,{yE:function(){return i},tq:function(){return o},JF:function(){return a},$4:function(){return s}});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}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return ie}});var r=n(7874),i=n(8791),a=n(8555),o=n.n(a),s=n(4597),u=n(5278);function l(e,t,n,r){return t.segment.isInit||null===e?o().resolve({resultType:"segment-created",resultData:null}):(0,s.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}function d(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,u.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var c=n(3887),f=n(1989),p=n(8026),v=n(3635);function h(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,u,l,d,h){var m,g=a.responseData,y=u.externalClockOffset,_=null!==(m=a.url)&&void 0!==m?m:u.originalUrl,b=null!=i?i:y,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:u.unsafeMode?u.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return c.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var S=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,v.tG)(e).buffer;if(e instanceof Document)return(0,v.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(g);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}(S)?"initialized"===E.wasm.status?(c.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T))):(c.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?(c.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(c.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T)))}))):(c.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,v.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")}(g);return k(E.js(e,T))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&l(t.value.warnings),d.isCancelled?o().reject(d.cancellationError):{manifest:new f.ZP(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return h((function(){return"string"===n.format?(0,s.ZP)({url:e,responseType:"text",cancelSignal:d}):(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:d})}))}));return o().all(r).then((function(e){if("string"===n.format){var t=e.map((function(e){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,p.Z)(e,{responseData:e.responseData})}));return k(n.continue(t))}var r=e.map((function(e){if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,p.Z)(e,{responseData:e.responseData})}));return k(n.continue(r))}))}}}var m=n(7839),g=n(5861),y=n(7757),_=n.n(y),b=n(944),T=n(9105),E=n(5992),S=n(1946),w=b.Z.DEFAULT_REQUEST_TIMEOUT,k="function"==typeof Headers?Headers:null,A="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,S.Z)(A)&&!(0,S.Z)(k)}var x=n(8806),Z=n(281);function M(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var R=n(288),C=n(4460);function P(e){return function(t,n,r,i){return new Promise((function(a,o){var s=new R.ZP,u=r.register((function(e){s.cancel(),o(e)}));function l(e){if((e instanceof Array||e instanceof Uint8Array)&&"mp4"===M(n.adaptation.type,n.representation))try{(0,C.Z)(new Uint8Array(e),n.segment.isInit)}catch(e){u(),s.cancel(),o(e)}}e(t,n,s.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){l(e),s.isUsed||i.onNewChunk(e)}})).then((function(e){s.isUsed||(u(),"segment-loaded"===e.resultType&&l(e.resultData.responseData),a(e))}),(function(e){R.ZP.isCancellationError(e)||(u(),o(e))}))}))}}var N=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,s.ZP)({url:e,headers:{Range:(0,Z.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,s.ZP)({url:e,headers:{Range:(0,Z.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,s.ZP)({url:e,headers:{Range:(0,Z.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,s.ZP)({url:e,headers:{Range:(0,Z.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return o().all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,N.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,duration:o-a,sendingTime:a,receivedTime:o}}}))}var O=n(8766);function L(e,t,n,r){var i=t.segment,a=void 0!==i.range?{Range:(0,Z.Z)(i.range)}:void 0,o=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(k))t=e.headers;else{t=new k;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}c.Z.debug("Fetch: Called with URL",e.url);var a=null,o=!1,s=performance.now(),u=(0,S.Z)(A)?null:new A;function l(){(0,S.Z)(u)?c.Z.warn("Fetch: AbortController API not available."):u.abort()}var d=(0,S.Z)(e.timeout)?w:e.timeout,f=window.setTimeout((function(){o=!0,l()}),d),p=e.cancelSignal.register((function(e){a=e,l()}));return fetch(e.url,{headers:t,method:"GET",signal:(0,S.Z)(u)?void 0:u.signal}).then((function(t){if((0,S.Z)(f)||clearTimeout(f),t.status>=300)throw c.Z.warn("Fetch: Request HTTP Error",t),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),a=0;return o();function o(){return u.apply(this,arguments)}function u(){return(u=(0,g.Z)(_().mark((function n(){var u,l,d,c,f;return _().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((u=n.sent).done||(0,S.Z)(u.value)){n.next=11;break}return a+=u.value.byteLength,l=performance.now(),d={url:t.url,currentTime:l,duration:l-s,sendingTime:s,chunkSize:u.value.byteLength,chunk:u.value.buffer,size:a,totalSize:r},e.onData(d),n.abrupt("return",o());case 11:if(!u.done){n.next=16;break}return p(),c=performance.now(),f=c-s,n.abrupt("return",{duration:f,receivedTime:c,sendingTime:s,size:a,status:t.status,url:t.url});case 16:return n.abrupt("return",o());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==a)throw a;if(p(),o)throw c.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw c.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:a,onData:function(e){var t=new Uint8Array(e.chunk),i=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,N.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,N.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==o?(0,N.zo)(o,t):t),a=i[0];o=i[1];for(var s=0;s<a.length;s++)if(n.onNewChunk(a[s]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function B(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=M(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(I())return L(e,t,r,i);(0,x.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 o=t.segment;return(0,s.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,Z.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var U=n(6490),F=n(4644),z=408125543,K=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=$(n,o);if(null==s)return null;var u=s.value,l=o+s.length,d=j(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 p=0;p<t.length;p++){if(u===t[p])return V(e,t.slice(p+1,t.length),n,[c,f])}o=f}return null}function G(e,t){var n=V(2807729,[z,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/Y(e,n[0],r)}function H(e,t){var n=V(17545,[z,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function W(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function $(e,t){var n=W(e,t);if(null==n)return c.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return c.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 j(e,t){var n=W(e,t);if(null==n)return c.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return c.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 Y(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 q=n(7403);function X(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(t)return{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 Q(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;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh: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,v.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function J(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,s=n.segment,l=n.manifest,d=e.data,c=e.isChunked,f=[i.start,i.end];if(null===d)return s.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=d instanceof Uint8Array?d:new Uint8Array(d),v=M(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,U.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!s.isInit){var y=h?X(p,c,s,r):null,_=(0,u.Z)(s.timestampOffset,0);if(h){var b=(0,F.s9)(p);if(void 0!==b){var T=Q(b.filter((function(e){return void 0!==s.privateInfos&&void 0!==s.privateInfos.isEMSGWhitelisted&&s.privateInfos.isEMSGWhitelisted(e)})),l.publishTime);if(void 0!==T){var E=T.needsManifestRefresh;return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:T.inbandEvents,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var w=s.indexRange,k=null;if("webm"===v)k=function(e,t){var n=V(z,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=G(e,r);if(null==a)return null;var o=H(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var d=V(187,[],e,[l,s[1]]);if(null==d)break;var c=V(179,[],e,[d[0],d[1]]);if(null==c)return null;var f=Y(e,c[0],c[1]-c[0]),p=V(241,[183],e,[d[0],d[1]]);if(null==p)return null;var v=Y(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),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(h&&(k=(0,F.Wf)(p,Array.isArray(w)?w[0]:0),!0===t&&null!==k&&k.length>0)){var A=k[k.length-1];Array.isArray(A.range)&&(A.range[1]=1/0)}o.index instanceof q.Z&&null!==k&&k.length>0&&o.index.initializeIndex(k);var I=h?(0,F.LD)(p):"webm"===v?G(p,0):void 0;return{segmentType:"init",initializationData:p,protectionDataUpdate:m,initTimescale:(0,S.Z)(I)?void 0:I}}}var ee=n(6807);function te(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):c.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:r||(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);return{data:function(e){var t=(0,ee.Le)(e);return null===t?"":(0,v.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function ne(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?c.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,i=a.time+a.duration),{data:t,type: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),language:o.language,start:r,end:i})}function re(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,l=n.segment,d=e.data,c=e.isChunked;if(null===d)return l.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:null!==(i=l.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=M(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,l=s.isInit,d=s.indexRange,c="string"==typeof e?(0,v.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 p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var h=(0,F.LD)(c);return o.index instanceof q.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:h}}var m=X(c,t,s,r);return{segmentType:"media",chunkData:te(n,c,m,t),chunkInfos:m,chunkOffset:(0,u.Z)(s.timestampOffset,0),protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(d,c,n,r,t):function(e,t,n){var r,i=n.period,a=n.segment,o=a.timestampOffset,s=void 0===o?0:o;if(a.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var u=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,v.uR)(u)}else r=e;return{segmentType:"media",chunkData:ne(n,r,t),chunkInfos:null,chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}(d,c,n)}}var ie=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=h(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:P(r);function r(e,r,i,a){if(null==e)return o().resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return B(e,r,t,a,i);var s={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(o,u){var l=!1,d=n(s,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new m.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(c),o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,duration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(c),B(e,r,t,a,i).then(o,u))}});function c(e){l||(l=!0,"function"==typeof d&&d(),u(e))}i.register(c)}))}}(e),u=J(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:u},video:{loadSegment:a,parseSegment:u},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:P(n);function n(e,n,r,i){var a=n.adaptation,u=n.representation,l=n.segment,d=l.range;if(null===e)return o().resolve({resultType:"segment-created",resultData:null});if(l.isInit)return D(e,l,r,i);var c=M(a.type,u),f="mp4"===c||void 0===c;if(t&&f){if(I())return L(e,n,i,r);(0,x.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 f?(0,s.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(d)?{Range:(0,Z.Z)(d)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,s.ZP)({url:e,responseType:"text",headers:Array.isArray(d)?{Range:(0,Z.Z)(d)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:re(e)},image:{loadSegment:l,parseSegment:d}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var r=n(8555),i=n.n(r),a=n(7874),o=n(3887),s=n(1989),u=n(6807),l=n(8999),d=n(7714),c=n(811),f=n(6968),p=n(6923),v=n(8026),h=n(9829),m=n(3635),g=n(5278),y=n(2689),_={};function b(e){if(null!=_[e])return _[e];var t=(0,m.tG)(e);return _[e]=t,t}function T(e,t){var n=t.length+8;return n<=y.s?(0,f.zo)((0,f.kh)(n),b(e),t):(0,f.zo)((0,f.kh)(1),b(e),(0,f.el)(n+8),t)}function E(e,t){return T(e,f.zo.apply(void 0,t))}function S(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){o.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,S(e),t.push(i)}else t.push(r);var a=n.adaptations,s=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,d.Z)(s,n)){o.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),s.push(r)}else s.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){o.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),i.push(r)}else i.push(n)}))}))}))}))}var w=n(9689);function k(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,f.zo)([8,1,18,16],e)}]}function A(e,t){if(void 0===t&&(t=k),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,w.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,f.qb)(e,8),n=(0,m.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,m.wO)((0,w.K)(i));return(0,m.ci)(a).toLowerCase()}(r),a=(0,m.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),x=n(8232),Z=n(3911),M=n(1091),R=n(5505);function C(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,Z.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function P(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function D(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 O=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,Z.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},mediaURLs:null,time:0,end:0,duration:0,timescale:1}},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,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=D(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=d?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[P(l,E)],privateInfos:{smoothMediaSegment:{time:E,duration:m}}};c.push(w),b=g+ ++_*m}if(b>=a)return c;null!=n&&(n+=y+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.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,Z.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.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,Z._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.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],s=n[n.length-1],u=(0,Z.jH)(s,null);if(!((0,Z.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var d=t[l],c=(0,Z.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!==s.duration)return;var f=u-d.start;if(0===f)return o.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,v=d.repeatCount-p;if(v<0)return;s.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,R.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)C(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,x.Z)(e.timeline,r)}}},e}();function L(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var B={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"};var F=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=L(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,L(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"),s=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 o.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,p.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!==s?parseInt(s,10):s,codecPrivateData:u,codecs:h,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 m=r("CodecPrivateData"),y=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==y&&void 0===U[y]||void 0===m)return o.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,p.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==y?U[y]:y,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?U[k]:k,codecPrivateData:(0,g.Z)(w,"")};default:return o.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function s(t){var r=t.root,i=t.timescale,s=t.rootURL,u=t.protections,g=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),E=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(l.r,S)||o.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),I=r.getAttribute("Url"),x=null===I?"":I;var Z,M=L(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=M.qualityLevels,C=M.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,p.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:E};(0,c.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var N=w+((0,p.Z)(A)?"_"+A:""),D=R.map((function(t){var n,r,i,a,o=(0,h.Z)(s,x),l={timeline:P.timeline,timescale:P.timescale,media:(n=o,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,p.Z)(t.mimeType)?t.mimeType:B[w],c=t.codecs,b=N+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(null!=c?c+"-":"")+String(t.bitrate),E=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){E.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new O(l,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:g}),I=(0,v.Z)({},t,{index:A,mimeType:d,codecs:c,id:b});if(E.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return T("pssh",(0,f.zo)([n,0,0,0],(0,m.nr)(e),(0,f.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var M=[{type:"cenc",values:Z}];I.contentProtections={keyIds:E,initData:M}}else I.contentProtections={keyIds:E,initData:[]}}return I}));if("ADVT"===k)return null;var U={id:N,type:w,representations:D,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(U.closedCaption=!0),U}return function(n,r,a){var o=(0,h.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),d=u.getAttribute("MinorVersion");if(null===l||null===d||!/^[2]-[0-2]$/.test(l+"-"+d))throw new Error("Version should be 2.0, 2.1 or 2.2");var c,f,v=u.getAttribute("Timescale"),m=(0,p.Z)(v)?isNaN(+v)?1e7:+v:1e7,g=L(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(A(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(c=u.getAttribute("IsLive"))?c:"string"==typeof c&&"TRUE"===c.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/m)}var E,w,k,I,x,Z,M=_.reduce((function(e,t){var n=s({root:t,rootURL:o,timescale:m,protections:y,isLive:b,timeShiftBufferDepth:f,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}),{}),R=null,C=void 0!==M.video?M.video[0]:void 0,P=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],D=[];if(void 0!==C){var O=C.representations[0];if(void 0!==O){var B=O.index.getFirstPosition(),U=O.index.getLastPosition();null!=B&&N.push(B),null!=U&&D.push(U)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),K=F.index.getLastPosition();null!=z&&N.push(z),null!=K&&D.push(K)}}N.length>0&&(x=Math.max.apply(Math,N)),D.length>0&&(Z=Math.min.apply(Math,D))}var V=u.getAttribute("Duration"),G=null!=V&&0!=+V?+V/m:void 0;b?(E=e.suggestedPresentationDelay,w=t,k=null!=x?x:w,I={isLinear:!0,value:null!=Z?Z:Date.now()/1e3-w,time:performance.now()},R=null!=f?f:null):(k=null!=x?x:0,I={isLinear:!1,value:void 0!==Z?Z:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:I.value,$={availabilityStartTime:void 0===w?0:w,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:R,maximumTimeData:I},periods:[{adaptations:M,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return S($),$}},z=n(4597),K=n(8806),V=n(4460),G=n(8791),H=n(4644),W=n(2297);function $(e,t,n,r,i){var a,s,l,d=[];if(i){var c=(0,u.XA)(e);null!==c?(l=function(e){var t=(0,W.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,f.pV)(t,16*a+5),o=(0,f.pV)(t,16*a+5+8)):(s=(0,f.pX)(t,8*a+5),o=(0,f.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(c),s=function(e){var t=(0,W.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,f.pV)(t,12),time:(0,f.pV)(t,4)}}(c)):o.Z.warn("smooth: could not find traf atom")}if(void 0!==l)for(var p=0;p<l.length;p++)d.push({time:l[p].time,duration:l[p].duration,timescale:n});if(void 0!==s)return{nextSegments:d,chunkInfos:{time:s.time/n,duration:s.duration/n},scaledSegmentTime:s.time};if(t)return{nextSegments:d,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,H.MM)(e),g=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!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var j=n(3666);function Y(e,t){return T("schm",(0,f.zo)(4,(0,m.tG)(e),(0,f.kh)(t)))}function q(e){return T("frma",(0,m.tG)(e))}function X(e){var t=[7,[e.length]];return T("stsd",f.zo.apply(void 0,t.concat(e)))}function Q(e,t,n){return T("tenc",(0,f.zo)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(T("senc",i),function(e){if(0===e.length)return T("saiz",new Uint8Array(0));var t=(0,f.pX)(e,0),n=(0,f.pX)(e,4),r=new Uint8Array(n+9);r.set((0,f.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,f.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return T("saiz",r)}(i),function(e,t,n,r){return T("saio",(0,f.zo)(4,[0,0,0,1],(0,f.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),E("traf",a)}function ee(e,t){var n=(0,W.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,W.iz)(r,1835427940),a=(0,W.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,W.Qy)(a,1952868452),s=(0,W.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 T("tfdt",(0,f.zo)([1,0,0,0],(0,f.el)(e)))}(t),c=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,H.J6)(n)}(l,s[1]-s[0]),p=J(u,d,c,i,(0,W.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=E("moof",[i,p]),h=(0,W.Qy)(v,1836019558),m=(0,W.Qy)(p,1953653094),g=(0,W.Qy)(c,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+d.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,S=(0,W.Qy)(e,1835295092);if(null===S)throw new Error("Smooth: Invalid ISOBMFF given");if(!j.YM&&(0===b||b<=-8)){var w=S[1];return v.set((0,f.kh)(w),y),e.set(v,n[0]),b<=-8&&e.set(T("free",new Uint8Array(-b-8)),v.length),e}var k=S[1]+b;v.set((0,f.kh)(k),y);var A=new Uint8Array(e.length+b),I=e.subarray(0,n[0]),x=e.subarray(n[2],e.length);return A.set(I,0),A.set(v,I.length),A.set(x,I.length+v.length),A}var te=n(7839),ne=n(281);function re(e,t,n,r,i,a){var o,s,u,l=E("stbl",[n,T("stts",new Uint8Array(8)),T("stsc",new Uint8Array(8)),T("stsz",new Uint8Array(12)),T("stco",new Uint8Array(8))]),d=E("dinf",[function(e){return T("dref",(0,f.zo)(7,[1],e))}(T("url ",new Uint8Array([0,0,0,1])))]),c=E("minf",[r,d,l]),p=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 T("hdlr",(0,f.zo)(8,(0,m.tG)(t),12,(0,m.tG)(n),1))}(t),v=E("mdia",[function(e){return T("mdhd",(0,f.zo)(12,(0,f.kh)(e),8))}(e),p,c]),h=E("trak",[function(e,t,n){return T("tkhd",(0,f.zo)((0,f.kh)(7),8,(0,f.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,f.XT)(e),2,(0,f.XT)(t),2))}(i,a,1),v]),g=E("mvex",[(o=1,T("trex",(0,f.zo)(4,(0,f.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return E("moov",[e,t,n])}(function(e,t){return T("mvhd",(0,f.zo)(12,(0,f.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,f.XT)(t+1)))}(e,1),g,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],T("ftyp",f.zo.apply(void 0,[(0,m.tG)(s),[0,0,0,1]].concat(u.map(m.tG)))));return(0,f.zo)(_,y)}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,p,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return T("avcC",(0,f.zo)([1,i,a,o,252|r,225],(0,f.XT)(e.length),e,[1],(0,f.XT)(t.length),t))}((0,m.nr)(l),(0,m.nr)(d),a);if(void 0===s){c=X([function(e,t,n,r,i,a,o){return T("avc1",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=E("schi",[Q(1,8,s)]),g=Y("cenc",65536);c=X([function(e,t,n,r,i,a,o,s){return T("encv",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,E("sinf",[q("avc1"),g,h]))])}return re(e,"video",c,((p=new Uint8Array(12))[3]=1,T("vmhd",p)),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 T("esds",(0,f.zo)(4,[3,25],(0,f.XT)(e),[0,4,17,64,21],11,[5,2],(0,m.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,m.ci)((0,f.XT)(l))):a);return re(e,"audio",function(){if(void 0===o)return X([function(e,t,n,r,i,a){return T("mp4a",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a))}(1,t,n,r,i,d)]);var e=E("schi",[Q(1,8,o)]),a=Y("cenc",65536),s=E("sinf",[q("mp4a"),a,e]);return X([function(e,t,n,r,i,a,o){return T("enca",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a,o))}(1,t,n,r,i,d,s)])}(),T("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,p.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,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,ne.Z)(o)}),(0,z.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,V.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var fe=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,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,p=s.privateInfos.smoothInitSegment,v=p.codecPrivateData,h=p.timescale,m=p.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===v)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,v,g.keyId);break;case"audio":var T=p.channels,E=void 0===T?0:T,S=p.bitsPerSample,w=void 0===S?0:S,k=p.packetSize,A=void 0===k?0:k,I=p.samplingRate;f=oe(h,E,w,A,void 0===I?0:I,v,g.keyId);break;default:0,f=new Uint8Array(0)}return i().resolve({resultType:"segment-created",resultData:f})}if(null===e)return i().resolve({resultType:"segment-created",resultData:null});var x={adaptation:d,manifest:u,period:l,representation:c,segment:s,transport:"smooth",url:e};return"function"!=typeof n?ce(e,r,o,a,t):new Promise((function(i,s){var u=!1,l=n(x,{reject:function(e){var t,n,r;if(!u&&!a.isCancelled){u=!0,a.deregister(d);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=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);s(l)}},resolve:function(e){if(!u&&!a.isCancelled){u=!0,a.deregister(d),de(r.representation)&&!0===t||i({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,duration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,V.Z)(n,r.segment.isInit),i({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,duration:e.duration}})}},fallback:function(){u||a.isCancelled||(u=!0,a.deregister(d),ce(e,r,o,a,t).then(i,s))},progress:function(e){u||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function d(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}a.register(d)}))}},pe=/\.wsx?(\?token=\S+)?/;function ve(e,t,n){var r;o.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var s=i[a];s.index instanceof O&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?s.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):o.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var he=function(e){var t=F(e),n=fe(e),r={customManifestLoader:e.manifestLoader},l={loadSegment:function(e,t,r,i){return n(e,t,r,i)},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,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var d=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit)return{segmentType:"init",initializationData:u,initTimescale:null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale,protectionDataUpdate:!1};var c=void 0!==n?$(d,l,n,a,s.isLive):null;if(null===c||null===c.chunkInfos||void 0===c.scaledSegmentTime)throw new Error("Smooth Segment without time information");var f=c.nextSegments,p=c.chunkInfos,v=ee(d,c.scaledSegmentTime);return f.length>0&&ve(o,f,a),{segmentType:"media",chunkData:v,chunkInfos:p,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return i().resolve(void 0);var n;pe.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,z.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=i().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,K.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)(r,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,u=n.responseData,l="string"==typeof u?(new DOMParser).parseFromString(u,"text/xml"):u,d=t(l,a,o);return{manifest:new s.ZP(d,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:l,video:l,text:{loadSegment:function(t,n,r,a){var o=n.segment,s=n.representation;return o.isInit||null===t?i().resolve({resultType:"segment-created",resultData:null}):de(s)?(0,z.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,V.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,z.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:a.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a=t.manifest,s=t.adaptation,l=t.representation,d=t.segment,c=s.language,f=de(l),p=l.mimeType,v=void 0===p?"":p,h=l.codec,g=void 0===h?"":h,y=e.data,_=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var b,T,E,S,w=null;if(f){var k;k="string"==typeof y?(0,m.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y);var A=void 0!==n?$(k,_,n,d,a.isLive):null;i=null==A?void 0:A.nextSegments,null===(w=null!==(r=null==A?void 0:A.chunkInfos)&&void 0!==r?r:null)?_?o.Z.warn("Smooth: Unavailable time data for current text track."):(b=d.time,T=d.end):(b=w.time,T=void 0!==w.duration?w.time+w.duration:d.end);var I=g.toLowerCase();if("application/ttml+xml+mp4"===v||"stpp"===I||"stpp.ttml.im1t"===I)S="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+v);S="vtt"}var x=(0,u.Le)(k);E=null===x?"":(0,m.uR)(x)}else{var Z;if(b=d.time,T=d.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);Z=(0,m.uR)(M)}else Z=y;switch(v){case"application/x-sami":case"application/smil":S="sami";break;case"application/ttml+xml":S="ttml";break;case"text/vtt":S="vtt"}if(void 0===S){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+v);S="srt"}E=Z}return null!==w&&Array.isArray(i)&&i.length>0&&ve(s,i,d),{segmentType:"media",chunkData:{type:S,data:E,start:b,end:T,language:c},chunkInfos:w,chunkOffset:null!=b?b:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,r){return t.segment.isInit||null===e?i().resolve({resultType:"segment-created",resultData:null}):(0,z.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===a.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:a.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},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 u}});var r=n(8418),i=n(4597),a=n(8555),o=n.n(a),s=n(7839);function u(e,t){var n=e.customManifestLoader,a=function(e){return function(t,n){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",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?a:function(e,t){return function(n,r){return new(o())((function(i,a){var o=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(d);var o=e,l=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",c=new s.Z(l,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(i=null==o?void 0:o.isOfflineError)&&void 0!==i&&i,null==o?void 0:o.xhr);a(c)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(d);var t=void 0!==e.receivingTime?e.receivingTime-o:void 0,n=void 0!==e.sendingTime?e.sendingTime-o:void 0;i({responseData:e.data,size:e.size,duration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(d),t(n,r).then(i,a))}});function d(e){u||(u=!0,"function"==typeof l&&l(),a(e))}r.register(d)}))}}(n,a)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return a},u:function(){return o}});var r=n(3801),i=n(1946);function a(e,t){if(!e)throw new r.Z(void 0===t?"invalid assertion":t)}function o(e,t,n){for(var r in void 0===n&&(n="object"),a(!(0,i.Z)(e),n+" should be an object"),t)t.hasOwnProperty(r)&&a(typeof e[r]===t[r],n+" should have property "+r+" as a "+t[r])}},8418:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3801);function i(e){throw new r.Z("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 p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{zo:function(){return r},zK:function(){return i},QI:function(){return a},pX:function(){return o},pV:function(){return s},qb:function(){return c},dN:function(){return f},XT:function(){return u},kh:function(){return l},el:function(){return d},O_:function(){return p},_f:function(){return v}})},8117:function(e,t,n){"use strict";var r=n(8555),i=n.n(r),a=n(1480),o=n(1973),s=n(2817),u=n(1946);t.Z=function(e){return e instanceof a.y?e:e instanceof i()||e instanceof Promise||!(0,u.Z)(e)&&"function"==typeof e.then?(0,o.Dp)(e):(0,s.of)(e)}},4437:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},d=function(e){u(e)},c={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=c.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=c.delegate;return((null==t?void 0:t.clearImmediate)||d)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=c.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(c.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(6798);function h(){return function(e){return e.pipe((t=p,void 0===n&&(n=0),(0,v.e)((function(e,r){r.add(t.schedule((function(){return e.subscribe(r)}),n))}))));var t,n}}},1959:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},R:function(){return s}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return 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]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{JN:function(){return d},uH:function(){return b},F_:function(){return p},L7:function(){return m},XS:function(){return f},DD:function(){return h},rx:function(){return c},at:function(){return v},kR:function(){return g},Ti:function(){return s},A1:function(){return o},tn:function(){return _}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function d(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function c(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function 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 v(e,t){var n=c(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=c(e,t);return null!==n?t-n.start:0}function m(e,t){var n=c(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),d=l(n,o);if(s||d)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,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}},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(944),i=n(9105),a=n(6923),o=n(1946),s=r.Z.DEFAULT_REQUEST_TIMEOUT;var u=function(e){var t={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?s:e.timeout};return new Promise((function(n,r){var s=e.onProgress,u=e.cancelSignal,l=t.url,d=t.headers,c=t.responseType,f=t.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=c,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(d)){var v=d;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,d=p.status,c=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;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,o.Z)(t))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));n({status:d,url:f,responseType:c,sendingTime:m,receivedTime:s,duration:s-m,size:u,responseData:t})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return c},TZ:function(){return s},wV:function(){return u},wO:function(){return v},DM:function(){return h}});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){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var d=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(d),u=!0,s+=2}u||(t+=n[s])}}for(var c=new Uint8Array(t.length),f=0;f<t.length;f++)c[f]=255&t.charCodeAt(f);return c}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){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=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}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+d(u,4):"%"+d(u,2)}}return decodeURIComponent(n)}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 p(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 v(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))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(){var e,t=(e=s.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this.isUsed=!1,this._trigger=n,this.signal=new l(r)}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new d;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof d},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),d=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}()},8555:function(e,t,n){"use strict";var r,i="pending",a="settled",o="fulfilled",s="rejected",u=function(){},l=void 0!==n.g&&void 0!==n.g.process&&"function"==typeof n.g.process.emit,d="undefined"==typeof setImmediate?setTimeout:setImmediate,c=[];function f(){for(var e=0;e<c.length;e++)c[e][0](c[e][1]);c=[],r=!1}function p(e,t){c.push([e,t]),r||(r=!0,d(f,0))}function v(e){var t=e.owner,n=t._state,r=t._data,i=e[n],a=e.then;if("function"==typeof i){n=o;try{r=i(r)}catch(e){y(a,e)}}h(a,r)||(n===o&&m(a,r),n===s&&y(a,r))}function h(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"==typeof t)){var r=t.then;if("function"==typeof r)return r.call(t,(function(r){n||(n=!0,t===r?g(e,r):m(e,r))}),(function(t){n||(n=!0,y(e,t))})),!0}}catch(t){return n||y(e,t),!0}return!1}function m(e,t){e!==t&&h(e,t)||g(e,t)}function g(e,t){e._state===i&&(e._state=a,e._data=t,p(b,e))}function y(e,t){e._state===i&&(e._state=a,e._data=t,p(T,e))}function _(e){e._then=e._then.forEach(v)}function b(e){e._state=o,_(e)}function T(e){e._state=s,_(e),!e._handled&&l&&n.g.process.emit("unhandledRejection",e._data,e)}function E(e){n.g.process.emit("rejectionHandled",e)}function S(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof S==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){y(t,e)}try{e((function(e){m(t,e)}),n)}catch(e){n(e)}}(e,this)}S.prototype={constructor:S,_state:i,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(u),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===s&&l&&p(E,this)),this._state===o||this._state===s?p(v,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},S.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new S((function(t,n){var r=[],i=0;function a(e){return i++,function(n){r[e]=n,--i||t(r)}}for(var o,s=0;s<e.length;s++)(o=e[s])&&"function"==typeof o.then?o.then(a(s),n):r[s]=o;i||t(r)}))},S.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new S((function(t,n){for(var r,i=0;i<e.length;i++)(r=e[i])&&"function"==typeof r.then?r.then(t,n):t(r)}))},S.resolve=function(e){return e&&"object"==typeof e&&e.constructor===S?e:new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},e.exports=S},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new x(r||[]);return a._invoke=function(e,t,n){var r=c;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return M()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===c)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=d(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(Z([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=d(e[i],e,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(c).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=d(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function Z(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:M}}function M(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=Z,x.prototype={constructor:x,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(I),!e)for(var n in this)"t"===n.charAt(0)&&r.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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},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),I(n),h}},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;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return c}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),d=n(8846),c=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,d.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new d(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new d(e,t)},t}(i.y),d=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=d("C",void 0,void 0);function d(e,t,n){return{kind:e,value:t,error:n}}var c=n(8380),f=n(8846),p=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return d("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(d("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),v=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&c.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),c=l.next();!c.done;c=l.next()){c.value.remove(this)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{d(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)d(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function d(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return h}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(1973),d=n(278),c=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566);function h(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.Dp)([],n);var v=new r.y(m(o,n,s?function(e){return p(s,e)}:d.y));return i?v.pipe((0,c.Z)(i)):v}function m(e,t,n){return void 0===n&&(n=d.y),function(r){g(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){g(t,(function(){var u=(0,l.Dp)(e[i],t),d=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,d||(d=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},d=0;d<i;d++)u(d)}),r)}}function g(e,t,n){e?n.add(e.schedule(t)):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2677),a=n(2457);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,i.h)(e,(0,a.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(1973);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},1973:function(e,t,n){"use strict";n.d(t,{Dp:function(){return E},OO:function(){return w},Xf:function(){return S}});var r=n(5987),i=n(5685),a=n(8474);function o(e){return(0,a.m)(null==e?void 0:e.then)}var s=n(6766),u=n(1480),l=n(5720);var d=n(3217);var c="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator",f=n(7853);function p(e,t){if(!e)throw new Error("Iterable cannot be null");return new u.y((function(n){var r=new l.w0;return r.add(t.schedule((function(){var i=e[Symbol.asyncIterator]();r.add(t.schedule((function(){var e=this;i.next().then((function(t){t.done?n.complete():(n.next(t.value),e.schedule())}))})))}))),r}))}function v(e){return(0,a.m)(e[s.L])}function h(e){return(0,a.m)(null==e?void 0:e[c])}function m(e){return Symbol.asyncIterator&&(0,a.m)(null==e?void 0:e[Symbol.asyncIterator])}function g(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function y(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function _(e){return(0,a.m)(null==e?void 0:e.getReader)}function b(e,t){if(null!=e){if(v(e))return function(e,t){return new u.y((function(n){var r=new l.w0;return r.add(t.schedule((function(){var i=e[s.L]();r.add(i.subscribe({next:function(e){r.add(t.schedule((function(){return n.next(e)})))},error:function(e){r.add(t.schedule((function(){return n.error(e)})))},complete:function(){r.add(t.schedule((function(){return n.complete()})))}}))}))),r}))}(e,t);if((0,i.z)(e))return(0,d.r)(e,t);if(o(e))return function(e,t){return new u.y((function(n){return t.schedule((function(){return e.then((function(e){n.add(t.schedule((function(){n.next(e),n.add(t.schedule((function(){return n.complete()})))})))}),(function(e){n.add(t.schedule((function(){return n.error(e)})))}))}))}))}(e,t);if(m(e))return p(e,t);if(h(e))return function(e,t){return new u.y((function(n){var r;return n.add(t.schedule((function(){r=e[c](),(0,f.A)(n,t,(function(){var e=r.next(),t=e.value;e.done?n.complete():(n.next(t),this.schedule())}))}))),function(){return(0,a.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(_(e))return function(e,t){return p(y(e),t)}(e,t)}throw g(e)}var T=n(5);function E(e,t){return t?b(e,t):S(e)}function S(e){if(e instanceof u.y)return e;if(null!=e){if(v(e))return l=e,new u.y((function(e){var t=l[s.L]();if((0,a.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return w(e);if(o(e))return n=e,new u.y((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,T.h)}));if(m(e))return k(e);if(h(e))return t=e,new u.y((function(e){var n,i;try{for(var a=(0,r.XA)(t),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}e.complete()}));if(_(e))return k(y(e))}var t,n,l;throw g(e)}function w(e){return new u.y((function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()}))}function k(e){return new u.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},2677:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3217),i=n(1973);function a(e,t){return t?(0,r.r)(e,t):(0,i.OO)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(1480),a=n(3994),o=n(5685),s=n(8474),u=n(3211),l=n(2677),d=["addListener","removeListener"],c=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,s.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,u.Z)(h));var m=(0,r.CR)(function(e){return(0,s.m)(e.addEventListener)&&(0,s.m)(e.removeEventListener)}(e)?c.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,s.m)(e.addListener)&&(0,s.m)(e.removeListener)}(e)?d.map(v(e,t)):function(e){return(0,s.m)(e.on)&&(0,s.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,o.z)(e))return(0,a.z)((function(e){return p(e,t,n)}))((0,l.h)(e));if(!g)throw new TypeError("Invalid event target");return new i.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(2677),a=n(1973),o=n(1545),s=n(2457);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,s.yG)(e),u=(0,s._6)(e,1/0),l=e;return l.length?1===l.length?(0,a.Xf)(l[0]):(0,r.J)(u)((0,i.h)(l,n)):o.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return o}});var r=n(2677),i=n(3217),a=n(2457);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,a.yG)(e);return n?(0,i.r)(e,n):(0,r.h)(e)}},4181:function(e,t,n){"use strict";n.d(t,{S:function(){return u}});var r=n(1480),i=n(1973),a=Array.isArray;function o(e){return 1===e.length&&a(e[0])?e[0]:e}var s=n(2566);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o(e)).length?(0,i.Xf)(e[0]):new r.y(l(e))}function l(e){return function(t){for(var n=[],r=function(r){n.push((0,i.Xf)(e[r]).subscribe(new s.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},a=0;n&&!t.closed&&a<e.length;a++)r(a)}}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(1973),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},3833:function(e,t,n){"use strict";n.d(t,{h:function(){return i}});var r=n(9127);function i(e){return(0,r.U)((function(){return e}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(3994),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},9007:function(e,t,n){"use strict";n.d(t,{p:function(){return a}});var r=n(1973),i=n(2566);function a(e,t,n,a,o,s,u,l){var d=[],c=0,f=0,p=!1,v=function(){!p||d.length||c||t.complete()},h=function(e){return c<a?m(e):d.push(e)},m=function(e){s&&t.next(e),c++;var l=!1;(0,r.Xf)(n(e,f++)).subscribe(new i.Q(t,(function(e){null==o||o(e),s?h(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{c--;for(var e=function(){var e=d.shift();u?t.add(u.schedule((function(){return m(e)}))):m(e)};d.length&&c<a;)e();v()}catch(e){t.error(e)}})))};return e.subscribe(new i.Q(t,h,(function(){p=!0,v()}))),function(){null==l||l()}}},3994:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var r=n(9127),i=n(1973),a=n(6798),o=n(9007),s=n(8474);function u(e,t,n){return void 0===n&&(n=1/0),(0,s.m)(t)?u((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return(0,o.p)(t,r,e,n)})))}},8902:function(e,t,n){"use strict";n.d(t,{j:function(){return a}});var r=n(3994),i=n(8474);function a(e,t,n){return void 0===n&&(n=1/0),(0,i.m)(t)?(0,r.z)((function(){return e}),t,n):("number"==typeof t&&(n=t),(0,r.z)((function(){return e}),n))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,d=0;o.subscribe(new i.Q(s,(function(t){var n=d++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(1973),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,c=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=d(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=d(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=d(m,c),y.complete()}}),(0,i.Dp)(e).subscribe(t))}))(e)}}function d(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},8430:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(1973),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,d=s++;(0,r.Xf)(e(n,d)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,d,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},8550:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(4978),i=n(8474);function a(e,t){return(0,i.m)(t)?(0,r.w)((function(){return e}),t):(0,r.w)((function(){return e}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(1973),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return d}});var r=n(5987),i=n(6798),a=n(2566),o=n(1973),s=n(278),u=n(2967),l=n(2457);function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,d=new Array(l),c=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){d[t]=e,f||c[t]||(c[t]=!0,(f=c.every(s.y))&&(c=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(d));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},3217:function(e,t,n){"use strict";n.d(t,{r:function(){return i}});var r=n(1480);function i(e,t){return new r.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=!!e&&e||new Error(e)}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{z:function(){return i},P:function(){return a}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{jO:function(){return o},yG:function(){return s},_6:function(){return u}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},7853:function(e,t,n){"use strict";function r(e,t,n,r){void 0===r&&(r=0);var i=t.schedule((function(){try{n.call(this)}catch(t){e.error(t)}}),r);return e.add(i),i}n.d(t,{A:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{x:function(){return a},O:function(){return o}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},5987:function(e,t,n){"use strict";n.d(t,{ZT:function(){return i},mG:function(){return a},Jh:function(){return o},XA:function(){return s},CR:function(){return u},ev:function(){return l},qq:function(){return d},FC:function(){return c},KL:function(){return f}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function d(e){return this instanceof d?(this.v=e,this):new d(e)}function c(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof d?Promise.resolve(n.value.v).then(u,l):c(a[0][2],n)}catch(e){c(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct: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}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return wi}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(5987),s=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return(0,o.ZT)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.x),u=n(2817),l=n(1480),d=n(9917),c={connector:function(){return new i.x},resetOnDisconnect:!0};function f(e,t){void 0===t&&(t=c);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new l.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,d.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var p=n(2334),v=n(6362),h=n(3071),m=n(1545),g=n(3505),y=n(9127),_=n(3741),b=n(3994),T=n(8515),E=n(4975),S=n(5583),w=n(8430),k=n(4727),A=n(3833),I=n(6798),x=n(2566);var Z=n(8550),M=n(8902),R=n(8719);function C(){if(P()){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 P(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var N=n(3666),D=n(3887);function O(){if(!N.vU)return!0;var e=function(){if(!N.vU)return D.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 L=n(944),B=n(3714),U=n(5157),F=n(5992),z=n(9362),K=n(5389);function V(e){return(e instanceof U.Z||e instanceof B.Z||e instanceof K.Z||e instanceof z.Z)&&Object.keys(F.ZB).indexOf(e.type)>=0}function G(e,t){var n=t.defaultCode,r=t.defaultReason;if(V(e))return e;var i=e instanceof Error?e.toString():r;return new K.Z(n,i)}var H=n(7874),W=n(1989),$=n(4791),j=n(1959),Y=n(1946),q=n(8026),X=n(9589),Q=n(2829),J=n(8806),ee=n(8894),te=n(6139),ne=n(6033);function re(e){return(0,d.P)((function(){var t=ne.Z.getState(e);if(null===t)return(0,u.of)(null);D.Z.info("EME: Disposing of the current MediaKeys");var n=t.loadedSessionsStore;return ne.Z.clearState(e),n.closeAllSessions().pipe((0,M.j)((0,te.Y)(e,null)))}))}function ie(e){var t=ne.Z.getState(e);return null==t?null:t.keySystemOptions.type}var ae=n(533);function oe(e){return(0,d.P)((function(){if(D.Z.info("EME: Clearing-up EME session."),N.fq)return D.Z.info("EME: disposing current MediaKeys."),re(e).pipe((0,ae.l)());var t=ne.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(D.Z.info("EME: closing all current sessions."),t.loadedSessionsStore.closeAllSessions().pipe((0,ae.l)())):(D.Z.info("EME: Nothing to clear. Returning right away. No state =",null===t),m.E)}))}var se=n(5861),ue=n(7757),le=n.n(ue),de=n(8555),ce=n.n(de),fe=n(811),pe=n(288),ve=n(9105);function he(e){return e instanceof ve.Z?new z.Z("PIPELINE_LOAD_ERROR",e):G(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var me=n(7839);function ge(e,t){return new(ce())((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}var ye=n(2572);function _e(e){return e instanceof ve.Z?e.type===F.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===F.br.TIMEOUT||e.type===F.br.ERROR_EVENT:e instanceof me.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):V(e)&&"INTEGRITY_ERROR"===e.code}function be(e){return e instanceof ve.Z?e.type===F.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof me.Z&&e.isOfflineError}function Te(e){return be(e)?2:1}function Ee(e,t,n,r){if(r.isCancelled)return ce().reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,d=0,c=e.slice();return 0===c.length?(D.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),ce().reject(new Error("No URL to request"))):f(c[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,se.Z)(le().mark((function e(n,p){var v,h,m,g,y,_,b,T;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!pe.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(_e(e.t0)){e.next=20;break}if(!(c.length<=1)){e.next=14;break}throw e.t0;case 14:if(c.splice(p,1),h=p>=c.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(c[h],h));case 20:if(m=Te(e.t0),g=2===m?s:o,m!==d&&(l=0,d=m),!(p<c.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(c[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,ye.Z)(_),T=c[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,ge(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function Se(e,t,n){return Ee([null],e,t,n)}function we(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 Ae=L.Z.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,Ie=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,xe=L.Z.INITIAL_BACKOFF_DELAY_BASE,Ze=L.Z.MAX_BACKOFF_DELAY_BASE;var Me=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new l.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new pe.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:he(e)})}));return(void 0===a.resolveManifestUrl?d(o):(r=o,i=a.resolveManifestUrl,(0,fe.Z)(void 0!==i),Se((function(){return i(r,u.signal)}),l,u.signal)).then(d)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(he(e)))})),function(){s||u.cancel()};function d(e){var t=a.loadManifest;return Se((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,duration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new l.y((function(r){var i,a=performance.now(),o=new pe.ZP,s=e.sendingTime,u=e.receivedTime,l=n._getBackoffSetting((function(e){r.next({type:"warning",value:he(e)})})),d={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,d,p,o.signal,(function(e){return f.apply(this,arguments)}));(i=c)instanceof ce()||i instanceof Promise?c.then((function(e){return v(e.manifest)})).catch((function(e){o.isUsed||h(e,!0)})):v(c.manifest)}catch(e){if(o.isUsed)return;h(e,!0)}return function(){o.cancel()};function f(){return(f=(0,se.Z)(le().mark((function e(t){var n;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Se(t,l,o.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),he(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function p(e){for(var t,n=we(e);!(t=n()).done;){var r=t.value;if(o.isUsed)return;h(r,!1)}}function v(e){p(e.contentWarnings);var t=performance.now()-a;D.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:s,receivedTime:u,parsingTime:t}),r.complete()}function h(e,t){var n=G(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=this._settings,n=t.lowLatencyMode,r=t.maxRetryRegular,i=t.maxRetryOffline;return{onRetry:e,baseDelay:n?xe.LOW_LATENCY:xe.REGULAR,maxDelay:n?Ze.LOW_LATENCY:Ze.REGULAR,maxRetryRegular:null!=r?r:Ae,maxRetryOffline:null!=i?i:Ie}},e}();var Re=n(5138),Ce=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("FP Error: 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){var n=this,r=new l.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Re.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Re.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void D.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Re.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Re.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)D.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;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._startWaitingQueueTask(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._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Re.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?D.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,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})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Re.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,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._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Pe=n(7714),Ne=n(908),De=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}(),Oe=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,Le=L.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Be=L.Z.INITIAL_BACKOFF_DELAY_BASE,Ue=L.Z.MAX_BACKOFF_DELAY_BASE,Fe=(0,Ne.Z)();var ze=L.Z.MIN_CANCELABLE_PRIORITY,Ke=L.Z.MAX_HIGH_PRIORITY_LEVEL,Ve=function(){function e(e,t){this._transport=e,this._prioritizer=new Ce({prioritySteps:{high:Ke,low:ze}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode;return{maxRetryRegular:"image"===e?0:null!=n?n:Oe,maxRetryOffline:null!=r?r:Le,baseDelay:i?Be.LOW_LATENCY:Be.REGULAR,maxDelay:i?Ue.LOW_LATENCY:Ue.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Pe.Z)(["audio","video"],e)?new De:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment;return new l.y((function(s){var u,l=void 0!==i?i.get(e):null;if(null!==l)return s.next({type:"chunk",parse:v(l,!1)}),s.next({type:"chunk-complete"}),void s.complete();var d=Fe();n.next({type:"requestBegin",value:{duration:t.duration,time:t.time,requestTimestamp:performance.now(),id:d}});var c=new pe.ZP,f=!1,p={onProgress:function(e){void 0!==e.totalSize&&e.size<e.totalSize&&n.next({type:"progress",value:{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:d}})},onNewChunk:function(e){s.next({type:"chunk",parse:v(e,!0)})}};return Ee(null!==(u=t.mediaURLs)&&void 0!==u?u:[null],(function(t,n){return a(t,e,n,p)}),(0,q.Z)({onRetry:function(e){s.next({type:"warning",value:he(e)})}},r),c.signal).then((function(t){if("segment-loaded"===t.resultType){var r=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),s.next({type:"chunk",parse:v(r,!1)})}else"segment-created"===t.resultType&&s.next({type:"chunk",parse:v(t.resultData,!1)});f=!0,s.next({type:"chunk-complete"}),"segment-loaded"!==t.resultType&&"chunk-complete"!==t.resultType||void 0===t.resultData.size||void 0===t.resultData.duration||n.next({type:"metrics",value:{size:t.resultData.size,duration:t.resultData.duration,content:e}}),c.isUsed||n.next({type:"requestEnd",value:{id:d}}),s.complete()})).catch((function(e){f=!0,s.error(he(e))})),function(){f||(c.cancel(),n.next({type:"requestEnd",value:{id:d}}))};function v(t,n){return function(r){var i={data:t,isChunked:n};try{return o(i,e,r)}catch(e){throw G(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,y.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):D.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Ge=n(9007);var He=n(1973);function We(e,t){return t?function(n){return n.pipe(We((function(n,r){return(0,He.Xf)(e(n,r)).pipe((0,y.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,I.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new x.Q(n,(function(t){i||(i=new x.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,He.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var $e=n(2006);function je(e){return(0,I.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var Ye=n(4978);var qe=n(4437),Xe=n(2793),Qe=n(5278),Je=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}(),et=L.Z.ABR_MINIMUM_TOTAL_BYTES,tt=L.Z.ABR_MINIMUM_CHUNK_SIZE,nt=L.Z.ABR_FAST_EMA,rt=L.Z.ABR_SLOW_EMA,it=function(){function e(){this._fastEWMA=new Je(nt),this._slowEWMA=new Je(rt),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<tt)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){if(!(this._bytesSampled<et))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){this._fastEWMA=new Je(nt),this._slowEWMA=new Je(rt),this._bytesSampled=0},e}();var at=n(3428);function ot(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(t,a){return function(t){if(0===t)return 0;var a=Math.min(Math.max(1,t),e.length-1);return i*(r+(e[a]*n[a-1]-e[a-1]*n[a])/(e[a]-e[a-1]))+4}(a)}))}function st(e,t){var n=ot(t);return D.Z.debug("ABR: Steps for buffer based chooser.",n.map((function(e,n){return{bufferLevel:e,bitrate:t[n]}}))),e.pipe((0,y.U)((function(e){return function(e,t,n){var r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return t[0];var s,u=(0,Re.Z)(t,(function(e){return e===i}));if(u<0||t.length!==n.length)return D.Z.error("ABR: Current Bitrate not found in the calculated levels"),t[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=n[u],d=function(){for(var e=u+1;e<n.length;e++)if(n[e]>l)return e}();if(null!=d&&r>=n[d])return t[d]}if((null==s||s<1.15)&&r<n[u]){for(var c=u-1;c>=0;c--)if(t[c]<i)return t[c];return i}return i}(e,t,n)})))}var ut=n(3274);var lt=L.Z.ABR_REGULAR_FACTOR,dt=L.Z.ABR_STARVATION_DURATION_DELTA,ct=L.Z.ABR_STARVATION_FACTOR,ft=L.Z.ABR_STARVATION_GAP,pt=L.Z.OUT_OF_STARVATION_GAP;function vt(e){if(!(e.progress.length<5)){for(var t=new Je(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 ht(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}function mt(e,t,n,r){var i=t.bufferGap,a=t.speed,o=t.position,s=isFinite(i)?i:0,u=function(e,t){var n=(0,Re.Z)(e,(function(e){return!(e.duration<=0)&&e.time+e.duration>t&&t-e.time>-1.2}));if(n<0)return[];for(var r=e[n],i=r.time,a=[r],o=n+1;o<e.length&&e[o].time===i;o++)a.push(e[o]);return a}(e,o+s);if(1===u.length){var l=u[0],d=l.duration,c=performance.now(),f=l.progress.length>0?l.progress[l.progress.length-1]:void 0,p=vt(l);if(void 0!==f&&void 0!==p){var v=ht(f,p);if((c-f.timestamp)/1e3<=v)if(v-s/a>2e3)return p}var h=(c-l.requestTimestamp)/1e3;if(null!=n&&!(h<=(1.5*d+2)/a)){var m=d/h,g=n.bitrate*Math.min(.7,m);return void 0===r||g<r?g:void 0}}}var gt=function(){function e(e,t){this._initialBitrate=e,this._inStarvationMode=!1,this._config=t?{starvationGap:ft.LOW_LATENCY,outOfStarvationGap:pt.LOW_LATENCY,starvationBitrateFactor:ct.LOW_LATENCY,regularBitrateFactor:lt.LOW_LATENCY}:{starvationGap:ft.DEFAULT,outOfStarvationGap:pt.DEFAULT,starvationBitrateFactor:ct.DEFAULT,regularBitrateFactor:lt.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,d=e.duration,c=isFinite(u)?u:0;return isNaN(d)||c+l<d-dt?!this._inStarvationMode&&c<=s.starvationGap?(D.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&c>=s.outOfStarvationGap&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(D.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=mt(r,e,n,i))&&(D.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t){var n=isFinite(e.bufferGap)?e.bufferGap:0,r=e.position+n,i=(0,ut.Z)(t,(function(e){return e.duration>0&&e.time+e.duration>r}));if(void 0===i)return!0;var a=performance.now(),o=i.progress.length>0?i.progress[i.progress.length-1]:void 0,s=vt(i);if(void 0===o||void 0===s)return!0;var u=ht(o,s);return(a-o.timestamp)/1e3>1.2*u||u-n/e.speed>-1.5}(r,n))},e}(),yt=n(1679),_t=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.time,r=e.duration,i=e.requestTimestamp;this._currentRequests[t]={time:n,duration:r,requestTimestamp:i,progress:[]}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):D.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&D.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,yt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.time-t.time}))},e}(),bt=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._getEWMA(e);null!=a?(r=a,a.addSample(t,i)):((r=new Je(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(D.Z.debug("ABR: New last stable representation",e),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){var t=this._getEWMA(e);if(null!=t)return t.getEstimate()},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},t._getEWMA=function(e){return null!=this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id?this._currentRepresentationData.ewma:null},e}();function Tt(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Re.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Et(e,t){var n=e;return null!=t.bitrate&&(n=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,Re.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,Qe.Z)(e.width,0)-(0,Qe.Z)(t.width,0)})),r=(0,ut.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}))}(n,t.width)),n}function St(e){var t=e.bandwidthEstimator,n=e.clock$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,s=e.minAutoBitrate$,l=e.maxAutoBitrate$,c=e.representations,f=e.streamEvents$,v=new bt,m=new gt(null==i?0:i,a),g=new _t;var _=f.pipe((0,E.h)((function(e){return"metrics"===e.type})),(0,$e.b)((function(e){return function(e){var n=e.duration,r=e.size,i=e.content;t.addSample(n,r);var a=n/1e3,o=i.segment.duration,s=i.representation;v.addSample(s,a,o)}(e.value)})),(0,ae.l)()),b=f.pipe((0,$e.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,ae.l)()),T=f.pipe((0,E.h)((function(e){return"representationChange"===e.type})),(0,y.U)((function(e){return e.value.representation})),(0,w.O)(null)),S=(0,d.P)((function(){if(0===c.length)throw new Error("ABRManager: no representation choice given");return 1===c.length?(0,u.of)({bitrate:void 0,representation:c[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,Ye.w)((function(e){if(e>=0){var i=Tt(c,e,0,1/0);return(0,u.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var a,o=!0,d=st(f.pipe((0,E.h)((function(e){return"added-segment"===e.type})),(0,at.M)(n),(0,y.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,Q.L7)(a,i),s=t.content.representation,u=v.getEstimate(s);return{bufferGap:o,currentBitrate:s.bitrate,currentScore:u,speed:r}}))),c.map((function(e){return e.bitrate}))).pipe((0,w.O)(void 0));return(0,p.a)([n,s,l,r,d]).pipe((0,at.M)(T),(0,y.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],d=e[1],f=Et(c,u),p=g.getRequests(),h=m.getBandwidthEstimate(r,t,d,p,a),y=h.bandwidthEstimate,_=h.bitrateChosen;a=y;var b=v.getLastStableRepresentation(),T=null==b?void 0:b.bitrate/(r.speed>0?r.speed:1),E=r.bufferGap;!o&&E<=5?o=!0:o&&isFinite(E)&&E>10&&(o=!1);var S=Tt(f,_,i,s);if(o)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",S),{bitrate:y,representation:S,urgent:m.isUrgent(S.bitrate,d,p,r),manual:!1,knownStableBitrate:T};if(null==l||S.bitrate>=l)return D.Z.debug("ABR: Choosing representation with bandwidth estimation.",S),{bitrate:y,representation:S,urgent:m.isUrgent(S.bitrate,d,p,r),manual:!1,knownStableBitrate:T};var w=Tt(f,l,i,s);return l<=s&&D.Z.debug("ABR: Choosing representation with buffer based bitrate ceiling.",w),{bitrate:y,representation:w,urgent:m.isUrgent(l,d,p,r),manual:!1,knownStableBitrate:T}})))})))}));return(0,h.T)(_,b,S)}var wt=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,s,l=this._getBandwidthEstimator(e),d=(0,Qe.Z)(this._manualBitrates[e],(0,u.of)(-1)),c=(0,Qe.Z)(this._minAutoBitrates[e],(0,u.of)(0)),f=(0,Qe.Z)(this._maxAutoBitrates[e],(0,u.of)(1/0)),v=(0,Qe.Z)(this._initialBitrates[e],0);return St({bandwidthEstimator:l,streamEvents$:r,clock$:n,filters$:(i=this._throttlers.limitWidth[e],a=this._throttlers.throttleBitrate[e],o=this._throttlers.throttle[e],s=[],null!=i&&s.push(i.pipe((0,y.U)((function(e){return{width:e}})))),null!=o&&s.push(o.pipe((0,y.U)((function(e){return{bitrate:e}})))),null!=a&&s.push(a.pipe((0,y.U)((function(e){return{bitrate:e}})))),s.length>0?(0,p.a)(s).pipe((0,y.U)((function(e){return q.Z.apply(void 0,[{}].concat(e))}))):(0,u.of)({})),initialBitrate:v,manualBitrate$:d,minAutoBitrate$:c,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){D.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new it;return this._bandwidthEstimators[e]=n,n}return t},e}(),kt=n(4507),At=n(5767),It=n(3774),xt=n(6923),Zt=R.ym;function Mt(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&&(D.Z.info("Init: Removing SourceBuffer from mediaSource",o),o.abort()),t.removeSourceBuffer(o)}catch(e){D.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&D.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,At.Z)(e),null!==n)try{D.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){D.Z.warn("Init: Error while revoking the media source URL",e)}}function Rt(e){return function(e){return new l.y((function(t){if(null==It.J)throw new B.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,xt.Z)(e.src)?e.src:null;Mt(e,null,n),D.Z.info("Init: Creating MediaSource");var r=new It.J,i=URL.createObjectURL(r);return D.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){Mt(e,r,i)}}))}(e).pipe((0,b.z)((function(e){return Zt(e).pipe((0,k.q)(1),(0,A.h)(e))})))}var Ct=n(8343),Pt=L.Z.DEFAULT_LIVE_GAP;var Nt=n(3610),Dt=n(6697),Ot=n(2401);var Lt=n(8418),Bt=n(6968),Ut=n(2870),Ft=n(9612),zt=L.Z.SOURCE_BUFFER_FLUSHING_INTERVAL;var Kt=function(e){function n(t,n,r){var a;a=e.call(this)||this;var o=r.addSourceBuffer(n);return a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=o,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n,(0,Dt.F)(zt).pipe((0,$e.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"error").pipe((0,$e.b)((function(e){return a._onPendingTaskError(e)})),(0,g.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"updateend").pipe((0,$e.b)((function(){return a._flush()})),(0,g.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return D.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,e),this._addToQueue({type:Ft.f.Push,value:e})},r.removeBuffer=function(e,t){return D.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Ft.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return D.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,e.segment),this._addToQueue({type:Ft.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Ft.f.Push:case Ft.f.Remove:case Ft.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){D.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new l.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,q.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Ft.f.Push||0===e.data.length){switch(e.type){case Ft.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Ft.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case Ft.f.Remove:this.synchronizeInventory();break;default:(0,Lt.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Ft.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,q.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,q.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Ft.f.EndOfSegment:return D.Z.debug("AVSB: Acknowledging complete segment",this._pendingTask.value),void this._flush();case Ft.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();this._sourceBuffer.appendBuffer(o);break;case Ft.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;D.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Lt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(D.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return D.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:D.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;D.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Bt._f)(s);this._lastInitSegment={data:u,hash:(0,Ut.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Bt._f)(e);if((0,Ut.Z)(n)===this._lastInitSegment.hash&&(0,$.Z)(t,n))return!0}return!1},n}(Ft.C),Vt=["audio","video","text","image"];function Gt(e){return"audio"===e||"video"===e}var Ht=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Gt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==H.Z.nativeTextTracksBuffer&&null==H.Z.htmlTextTracksBuffer||e.push("text"),null!=H.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(){var e=this;return this._areNativeBuffersUsable()?(0,u.of)(void 0):new l.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},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 D.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(Gt(e)){if(null!=i)return i instanceof Kt&&i.codec!==t?D.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):D.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;D.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Kt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return D.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(D.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==H.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new H.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==H.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new H.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==H.Z.imageBuffer)throw new Error("Image buffer feature not activated");return D.Z.info("SB: Creating a new image SegmentBuffer"),r=new H.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw D.Z.error("SB: Unknown buffer type:",e),new B.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?(D.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):D.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Vt.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}(),Wt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,ut.Z)(this._array,e)},t.has=function(e){return(0,Pe.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}(),$t=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}(),jt=n(9834);function Yt(e){var t=e.segmentBuffer,n=e.clock$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,p.a)([n,r,i]).pipe((0,b.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return m.E;var i=[],a=(0,Q.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,He.Dp)(i.map((function(t){return D.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,jt.u)(),(0,ae.l)())}(t,n,r,i)})))}var qt=n(8567),Xt=n(9878);function Qt(e,t,n,r){return n.pipe((0,y.U)((function(n){var i,a=n.getCurrentTime()+r,o=Math.min(Math.max(e.start,a),null!==(i=e.end)&&void 0!==i?i:1/0);return qt.Z.waitingMediaSourceReload(t,e,o,!n.isPaused)})))}var Jt=n(7473),en=n.n(Jt);var tn=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue$=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,d.P)((function(){var t=e._downloadQueue$.pipe((0,E.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,Ye.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():m.E}))),n=e._downloadQueue$.pipe((0,E.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,Ye.w)((function(t){return null===t.initSegment?m.E:e._requestInitSegment(t.initSegment)})));return(0,h.T)(n,t)})).pipe((0,S.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue$.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,u.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,q.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,b.z)((function(n){switch(n.type){case"warning":return(0,u.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return D.Z.info("Stream: segment request interrupted temporarly.",r),m.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue$.getValue().segmentQueue;return 0===i.length?(0,u.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,k.q)(1),(0,y.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,fe.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,q.Z)({},t,{type:"parsed-media",segment:r})})),je((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,Lt.Z)(n)}})))};return(0,d.P)((function(){return n(t)})).pipe(je((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,m.E;var n=e.segment,r=e.priority,i=(0,q.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,b.z)((function(e){switch(e.type){case"warning":return(0,u.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return D.Z.info("Stream: init segment request interrupted temporarly.",n),m.E;case"chunk":var r=e.parse(void 0);return(0,fe.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,v.z)((0,u.of)((0,q.Z)({},r,{type:"parsed-init",segment:n})),(0,d.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),m.E})));case"chunk-complete":return(0,u.of)({type:"end-of-segment",value:{segment:n}});case"ended":return m.E;default:(0,Lt.Z)(e)}}))).pipe(je((function(){t._initSegmentRequest=null})))},e}();function nn(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var d=i[u];if(void 0!==d.bufferedStart&&d.bufferedStart>t.start&&(null===n||d.infos.segment.end<=n))return D.Z.debug("RS: current discontinuity encountered",o.type,d.bufferedStart),{start:void 0,end:d.bufferedStart};var c=function(e,t,n){if(n<=0)return D.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!==c&&(null===n||i[c].infos.segment.end<=n)){var f=i[c-1].bufferedEnd,p=i[c].bufferedStart;return D.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var v=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!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return D.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}var rn=n(5952),an=L.Z.CONTENT_REPLACEMENT_PADDING,on=L.Z.BITRATE_REBUFFERING_RATIO,sn=L.Z.MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT,un=L.Z.MINIMUM_SEGMENT_SIZE,ln=Math.min(1/60,un);function dn(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=n.representation.index.getSegments(o.start,o.end-o.start),l=t.filter((function(e){return!fn(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){if(void 0===e.bufferedStart)return D.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>sn)return D.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;D.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){if(void 0===e.bufferedEnd)return D.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>sn)return D.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;D.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0}));return u.filter((function(e){var t=(0,q.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,rn.Z)(t,e)})))return!1;var a=e.duration,o=e.time,u=e.end;if(e.isInit)return!0;if(a<un)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-ln>o)&&(!(a.end+ln<u)&&!fn(e,t,r,i))})))return!1;for(var d=0;d<l.length;d++){var c=l[d];if(c.infos.period.id===n.period.id){var f=c.infos.segment;if(o-f.time>-ln&&f.end-u>-ln)return!1}}for(var p=0;p<l.length;p++){var v=l[p];if(v.end>o)return v.start>o+ln||cn(l,p).end<u-ln}return!0}))}function cn(e,t){for(var n=t+1;n<e.length-1&&e[n-1].end+ln>e[n].start;)n++;return e[--n]}function fn(e,t,n,r){return e.period.id===t.period.id&&(!(e.segment.time<n+an)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate;if(void 0===n){var i=r*on;return t.bitrate>i}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}var pn=L.Z.SEGMENT_PRIORITIES_STEPS;function vn(e,t){for(var n=e-(t.position+t.wantedTimeOffset),r=0;r<pn.length;r++)if(n<pn[r])return r;return pn.length}var hn=L.Z.MINIMUM_SEGMENT_SIZE;function mn(e,t,n,r,i){var a,o=e.period,s=e.representation;i.synchronizeInventory();var u,l,d=t.position+t.wantedTimeOffset,c=d+r,f={start:Math.max(d,o.start),end:Math.min(c,null!==(a=o.end)&&void 0!==a?a:1/0)},p=s.index.shouldRefresh(d,c),v=i.getPendingOperations().filter((function(e){return e.type===Ft.f.EndOfSegment})).map((function(e){return e.value})),h=function(e,t){for(var n=Math.max(1/60,hn),r=e.start+n,i=e.end-n,a=[],o=t.length-1;o>=0;o--){var s=t[o],u=s.infos.representation;if(!s.partiallyPushed&&!1!==u.decipherable&&u.isSupported){var l=s.infos.segment,d=l.time/l.timescale;((null==l.duration?s.end:d+l.duration/l.timescale)>r&&d<i||s.end>r&&s.start<i)&&a.unshift(s)}}return a}({start:Math.max(f.start-.5,0),end:f.end+.5},i.getInventory()),m=i.getSegmentHistory.bind(i),g=dn({content:e,bufferedSegments:h,currentPlaybackTime:t.getCurrentTime(),fastSwitchThreshold:n,getBufferedHistory:m,neededRange:f,segmentsBeingPushed:v}).map((function(e){return{priority:vn(e.time,t),segment:e}})),y=s.index.getLastPosition();if(!s.index.isInitialized()||void 0===o.end||g.length>0)u=!1;else if(void 0===y)u=f.end>=o.end&&s.index.isFinished();else if(null===y)u=s.index.isFinished();else{var _=void 0!==o.end?Math.min(o.end,y):y;u=f.end>=_&&s.index.isFinished()}if(s.index.isInitialized()&&(s.index.areSegmentsChronologicallyGenerated()||u)){var b=null;v.length>0&&(b=Math.min.apply(Math,v.map((function(e){return e.segment.time})))),g.length>0&&(b=null!==b?Math.min(b,g[0].segment.time):g[0].segment.time),l=nn(e,f,b,u,h)}else l=null;return{imminentDiscontinuity:l,hasFinishedLoading:u,neededSegments:g,shouldRefreshManifest:p}}var gn=L.Z.BUFFER_GC_GAPS.CALM,yn=L.Z.BUFFER_GC_GAPS.BEEFY;function _n(e,t,n){for(var r=(0,Q.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&&(D.Z.debug("Stream: GC removing part of inner range",o),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 bn(e,t,n){var r=t.pushChunk(n);return r.pipe((0,Xt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new B.Z("BUFFER_APPEND_ERROR",i)}return(0,v.z)((a=e,o=t,a.pipe((0,k.q)(1),(0,b.z)((function(e){D.Z.warn("Stream: Running garbage collector");var t=o.getBufferedRanges(),n=_n(e.position,t,gn);return 0===n.length&&(n=_n(e.position,t,yn)),D.Z.debug("Stream: GC cleaning",n),(0,He.Dp)(n.map((function(e){var t=e.start,n=e.end;return o.removeBuffer(t,n)}))).pipe((0,jt.u)())})))).pipe((0,ae.l)()),r).pipe((0,Xt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new B.Z("BUFFER_FULL_ERROR",t)})));var a,o})))}var Tn=L.Z.APPEND_WINDOW_SECURITIES;var En=function(e){var t=e.clock$,n=e.content,r=e.segmentBuffer,a=e.segmentFetcher,o=e.terminate$,l=e.options,c=n.period,f=n.adaptation,g=n.representation,_=l.bufferGoal$,T=l.drmSystemId,E=l.fastSwitchThreshold$,A=f.type,Z={segment:g.index.getInitSegment(),segmentData:null,isLoaded:!1},M=new i.x,R=new s({initSegment:null,segmentQueue:[]}),C=null!==Z.segment,P=new tn(n,R,a,C);C||(Z.segmentData=null,Z.isLoaded=!0);var N=!1,O=m.E;if(void 0!==T){var L=g.getEncryptionData(T);L.length>0&&(O=u.of.apply(void 0,L.map((function(e){return qt.Z.encryptionDataEncountered(e)}))),N=!0)}var B,U,F=P.start().pipe((0,b.z)((function(e){switch(e.type){case"retry":return(0,v.z)((0,u.of)({type:"warning",value:e.value.error}),(0,d.P)((function(){var t=e.value.segment,n=g.index;if(!1===n.isSegmentStillAvailable(t))M.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,u.of)(qt.Z.manifestMightBeOufOfSync());return m.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){en()((function(){M.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var i=g.getAllEncryptionData(),a=!N&&i.length>0?u.of.apply(void 0,i.map((function(e){return qt.Z.encryptionDataEncountered(e)}))):m.E,o=function(e){var t=e.clock$,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,d.P)((function(){if(null===i)return m.E;var e=n.representation.getMimeTypeString();return bn(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,y.U)((function(){var e=a.getBufferedRanges();return qt.Z.addedSegment(n,r,e,i)})))}))}({clock$:t,content:n,segment:e.segment,segmentData:e.initializationData,segmentBuffer:r});return(0,h.T)(a,o)}var s=e.inbandEvents,l=e.needsManifestRefresh,c=e.protectionDataUpdate&&!N?u.of.apply(void 0,g.getAllEncryptionData().map((function(e){return qt.Z.encryptionDataEncountered(e)}))):m.E,f=!0===l?(0,u.of)(qt.Z.needsManifestRefresh()):m.E,p=void 0!==s&&s.length>0?(0,u.of)({type:"inband-events",value:s}):m.E,_=Z.segmentData,b=function(e){var t=e.clock$,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,d.P)((function(){var e,s;if(null===i.chunkData)return m.E;var u=i.chunkData,l=i.chunkInfos,d=i.chunkOffset,c=i.appendWindow,f=n.representation.getMimeTypeString(),p=[void 0!==c[0]?Math.max(0,c[0]-Tn.START):void 0,void 0!==c[1]?c[1]+Tn.END:void 0],v={initSegment:r,chunk:u,timestampOffset:d,appendWindow:p,codec:f},h=null!==(e=null==l?void 0:l.time)&&void 0!==e?e:a.time,g=h+(null!==(s=null==l?void 0:l.duration)&&void 0!==s?s:a.duration);void 0!==p[0]&&(h=Math.max(h,p[0])),void 0!==p[1]&&(g=Math.min(g,p[1]));var _=(0,q.Z)({segment:a,start:h,end:g},n);return bn(t,o,{data:v,inventoryInfos:_}).pipe((0,y.U)((function(){var e=o.getBufferedRanges();return qt.Z.addedSegment(n,a,e,u)})))}))}({clock$:t,content:n,initSegmentData:_,parsedSegment:e,segment:e.segment,segmentBuffer:r});return(0,v.z)(c,f,p,b)}(e);case"end-of-segment":var i=e.value.segment;return r.endOfSegment((0,q.Z)({segment:i},n)).pipe((0,ae.l)());case"end-of-queue":return M.next(),m.E;default:(0,Lt.Z)(e)}}))),z=(0,p.a)([t,_,o.pipe((0,k.q)(1),(0,w.O)(null)),M.pipe((0,w.O)(void 0))]).pipe((0,at.M)(E),(0,b.z)((function(e){var t=e[0],i=t[0],a=t[1],o=t[2],s=e[1],l=mn(n,i,s,a,r),d=l.neededSegments,f=null;if(g.index.isInitialized()){if(d.length>0&&!Z.isLoaded&&null!==Z.segment){var p=d[0].priority;f={segment:Z.segment,priority:p}}}else null===Z.segment?D.Z.warn("Stream: Uninitialized index without an initialization segment"):Z.isLoaded?D.Z.warn("Stream: Uninitialized index with an already loaded initialization segment"):f={segment:Z.segment,priority:vn(c.start,i)};if(null===o)R.next({initSegment:f,segmentQueue:d});else{if(o.urgent)return D.Z.debug("Stream: Urgent switch, terminate now.",A),R.next({initSegment:null,segmentQueue:[]}),R.complete(),(0,u.of)(qt.Z.streamTerminating());var h=d[0],m=P.getRequestedInitSegment(),y=P.getRequestedMediaSegment(),_=null===y||void 0===h||y.id!==h.segment.id?[]:[h],b=null===m?null:f;if(R.next({initSegment:b,segmentQueue:_}),0===_.length&&null===b)return D.Z.debug("Stream: No request left, terminate",A),R.complete(),(0,u.of)(qt.Z.streamTerminating())}var T=(0,u.of)({type:"stream-status",value:{period:c,position:i.position,bufferType:A,imminentDiscontinuity:l.imminentDiscontinuity,hasFinishedLoading:l.hasFinishedLoading,neededSegments:l.neededSegments}});return l.shouldRefreshManifest?(0,v.z)((0,u.of)(qt.Z.needsManifestRefresh()),T):T})),(B=function(e){return"stream-terminating"!==e.type},void 0===(U=!0)&&(U=!1),(0,I.e)((function(e,t){var n=0;e.subscribe(new x.Q(t,(function(e){var r=B(e,n++);(r||U)&&t.next(e),!r&&t.complete()})))}))));return(0,h.T)(z,F,O).pipe((0,S.B)())};var Sn=L.Z.DELTA_POSITION_AFTER_RELOAD;var wn=function(e){var t=e.abrManager,n=e.clock$,r=e.content,a=e.options,o=e.segmentBuffer,l=e.segmentFetcherCreator,c=e.wantedBufferAhead$,f="direct"===a.manualBitrateSwitchingMode,p=r.manifest,g=r.period,T=r.adaptation,w={},A=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x,s=new i.x,l=(0,h.T)(o,s);return{estimator$:(0,h.T)((0,j.R)(r,"decipherabilityUpdate"),(0,u.of)(null)).pipe((0,y.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new B.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,_.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,Ye.w)((function(e){return t.get$(a.type,e,n,l)}))),streamFeedback$:o,requestFeedback$:s}}(r,t,n),I=A.estimator$,x=A.requestFeedback$,Z=A.streamFeedback$,M=l.createSegmentFetcher(T.type,x),R=new s(null),C=I.pipe((0,$e.b)((function(e){R.next(e)})),(0,qe.Z)(),(0,S.B)()),P=C.pipe((0,E.h)((function(e){return null!=e.bitrate})),(0,_.x)((function(e,t){return e.bitrate===t.bitrate})),(0,y.U)((function(e){var t=e.bitrate;return D.Z.debug("Stream: new "+T.type+" bitrate estimate",t),qt.Z.bitrateEstimationChange(T.type,t)}))),N=C.pipe(We((function(e,t){return O(e,0===t)})));return(0,h.T)(N,P);function O(e,t){var r=e.representation;if(f&&e.manual&&!t)return Qt(g,T.type,n,Sn.bitrateSwitch);var i=R.pipe((0,E.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,k.q)(1),(0,y.U)((function(e){return null===e?(D.Z.info("Stream: urgent Representation termination",T.type),{urgent:!0}):e.urgent?(D.Z.info("Stream: urgent Representation switch",T.type),{urgent:!0}):(D.Z.info("Stream: slow Representation switch",T.type),{urgent:!1})}))),o=a.enableFastSwitching?R.pipe((0,y.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,_.x)()):(0,u.of)(0),s=(0,u.of)(qt.Z.representationChange(T.type,g,r));return(0,v.z)(s,L(r,i,o)).pipe((0,$e.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,b.z)((function(e){if("stream-terminating"===e.type){var t=R.getValue();return null===t?m.E:O(t,!1)}return(0,u.of)(e)})))}function L(e,t,r){return(0,d.P)((function(){var i=w[e.id],s=null!=i?i:1;w[e.id]=s;var u=c.pipe((0,y.U)((function(e){return e*s})));return D.Z.info("Stream: changing representation",T.type,e),En({clock$:n,content:{representation:e,adaptation:T,period:g,manifest:p},segmentBuffer:o,segmentFetcher:M,terminate$:t,options:{bufferGoal$:u,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,Xt.K)((function(n){var i=G(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=c.getValue(),o=s;if(o<=.25||a*o<=2)throw i;return w[e.id]=o-.25,L(e,t,r)}throw i})))}))}};function kn(e,t,n,r){var i=r.period,a=!1;return(0,p.a)([e,t]).pipe((0,b.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(D.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,u.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var An=n(9252);var In=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,ut.Z)(i,(function(e){return(0,An.Z)(e,"codecs=")})),l=(0,ut.Z)(s,(function(e){return(0,An.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]},xn=L.Z.ADAPTATION_SWITCH_BUFFER_PADDINGS;function Zn(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return In(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,Q.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,Q.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var d=e.getInventory();if(!d.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var c=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}),[])}(d,t,n),f=(0,Q.uH)(l,c);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,Q.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return In(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,Q.A1)(c,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=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}(d,t);null!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=xn[g].before;null==y&&(y=0);var _=xn[g].after;if(null==_&&(_=0),v||h.push({start:p-y,end:p+_}),void 0!==t.end){var b=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(d,t);null!==b&&(void 0===b.bufferedStart||b.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var T=(0,Q.uH)(f,h);return 0===T.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:T}:{type:"clean-buffer",value:T}}var Mn=L.Z.DELTA_POSITION_AFTER_RELOAD;var Rn=function(e){var t=e.abrManager,n=e.bufferType,r=e.clock$,i=e.content,o=e.garbageCollectors,s=e.segmentFetcherCreator,l=e.segmentBuffersStore,d=e.options,c=e.wantedBufferAhead$,f=i.period,p=new a.t(1);return p.pipe((0,Ye.w)((function(e,a){var p=0===a?0:"audio"===n?Mn.trackSwitch.audio:"video"===n?Mn.trackSwitch.video:Mn.trackSwitch.other;if(null===e){D.Z.info("Stream: Set no "+n+" Adaptation",f);var g,_=l.getStatus(n);if("initialized"===_.type){if(D.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),Ht.isNative(n))return Qt(f,n,r,0);g=_.value.removeBuffer(f.start,null==f.end?1/0:f.end)}else"uninitialized"===_.type&&l.disableSegmentBuffer(n),g=(0,u.of)(null);return(0,v.z)(g.pipe((0,A.h)(qt.Z.adaptationChange(n,null,f))),kn(r,c,n,{period:f}))}if(Ht.isNative(n)&&"disabled"===l.getStatus(n).type)return Qt(f,n,r,p);D.Z.info("Stream: Updating "+n+" adaptation",e,f);var T=r.pipe((0,k.q)(1),(0,b.z)((function(a){var g=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return D.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(l,n,e,d),_={currentTime:a.getCurrentTime(),readyState:a.readyState},T=Zn(g,f,e,_,d);if("needs-reload"===T.type)return Qt(f,n,r,p);var E="flush-buffer"===T.type?(0,u.of)(qt.Z.needsBufferFlush()):m.E,S="clean-buffer"===T.type||"flush-buffer"===T.type?v.z.apply(void 0,T.value.map((function(e){var t=e.start,n=e.end;return g.removeBuffer(t,n)}))).pipe((0,ae.l)()):m.E,w=o.get(g),k=function(e,a){var o=i.manifest,p=r.pipe((0,y.U)((function(e){var t=a.getBufferedRanges();return(0,q.Z)({},e,{bufferGap:(0,Q.L7)(t,e.position)})})));return wn({abrManager:t,clock$:p,content:{manifest:o,period:f,adaptation:e},options:d,segmentBuffer:a,segmentFetcherCreator:s,wantedBufferAhead$:c}).pipe((0,Xt.K)((function(e){if(!Ht.isNative(n)){D.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),l.disposeSegmentBuffer(n);var t=G(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,v.z)((0,u.of)(qt.Z.warning(t)),kn(r,c,n,{period:f}))}throw D.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,g);return l.waitForUsableBuffers().pipe((0,b.z)((function(){return(0,v.z)(S,E,(0,h.T)(k,w))})))})));return(0,v.z)((0,u.of)(qt.Z.adaptationChange(n,e,f)),T)})),(0,w.O)(qt.Z.periodStreamReady(n,f,p)))},Cn=n(3074);function Pn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,E.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,y.U)((function(e){return"complete-stream"===e.type})),(0,w.O)(!1),(0,_.x)())}));return(0,p.a)(r).pipe((0,y.U)((function(e){return e.every((function(e){return e}))})),(0,_.x)())}var Nn=L.Z.MAXIMUM_MAX_BUFFER_AHEAD,Dn=L.Z.MAXIMUM_MAX_BUFFER_BEHIND;var On=function(e,t,n,r,a,o){var s,l,c=e.manifest,f=e.initialPeriod,T=o.maxBufferAhead$,A=o.maxBufferBehind$,I=o.wantedBufferAhead$,x=new $t((function(e){var n=e.bufferType,r=null!=Dn[n]?Dn[n]:1/0,i=null!=Nn[n]?Nn[n]:1/0;return Yt({segmentBuffer:e,clock$:t.pipe((0,y.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:A.pipe((0,y.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:T.pipe((0,y.U)((function(e){return Math.min(e,i)})))})})),Z=t.pipe((0,Xe.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<c.getMinimumPosition()){var r=new B.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return qt.Z.warning(r)}if(n>c.getMaximumPosition()){var i=new B.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return qt.Z.warning(i)}return null}),null)),M=r.getBufferTypes().map((function(e){return function(e,n){var a=new Wt((function(e,t){return e.start-t.start})),o=new i.x,s=!1;function l(t){return N(e,t,o).pipe((0,y.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return qt.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return qt.Z.needsMediaSourceReload(r,i);case"periodStreamReady":s=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,S.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var p=t.pipe((0,Xe.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!s||!f(a))return null;var u=null!==(n=c.getPeriodForTime(a))&&void 0!==n?n:c.getNextPeriod(a);return void 0===u?null:(D.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),s=!1,o.next(),u)}),null),(0,b.z)((function(e){if(null==e)throw new B.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return l(e)}))),g=(0,j.R)(c,"decipherabilityUpdate").pipe((0,b.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return m.E;var f=a.filter((function(e){return!1===e.representation.decipherable})),p=i.value,h=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){D.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var d=n[n.length-1];void 0!==d&&d.end===o?d.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(p,f);return 0===h.length?m.E:(s=!1,o.next(),v.z.apply(void 0,h.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n).pipe((0,ae.l)())})).concat([t.pipe((0,k.q)(1),(0,b.z)((function(e){return(0,v.z)((0,u.of)(qt.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,d.P)((function(){var t=e.position+e.wantedTimeOffset,n=c.getPeriodForTime(t);if(null==n)throw new B.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return l(n)})))})))])))})));return(0,h.T)(p,g,l(n))}(e,f).pipe((0,qe.Z)(),(0,S.B)())})),R=(s=M,l=s.length,h.T.apply(void 0,s).pipe((0,E.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Cn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l||l.buffers.has(u)){var d=new Set;d.add(u),e[s.id]={period:s,buffers:d}}else l.buffers.add(u)}return e}),{}),(0,y.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===l&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,_.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,E.h)((function(e){return null!==e})),(0,y.U)((function(e){return D.Z.info("Stream: New active period",e),qt.Z.activePeriodChanged(e)}))),C=(0,j.R)(c,"manifestUpdate").pipe((0,y.U)((function(){return c.isLastPeriodKnown})),(0,w.O)(c.isLastPeriodKnown),(0,_.x)()),P=(0,p.a)([Pn.apply(void 0,M),C]).pipe((0,y.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,_.x)(),(0,y.U)((function(e){return e?qt.Z.endOfStream():qt.Z.resumeStream()})));return h.T.apply(void 0,M.concat([R,P,Z]));function N(e,s,l){D.Z.info("SO: Creating new Stream for",e,s);var d=new i.x,f=new i.x,p=t.pipe((0,E.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),m=d.pipe(We((function(t){return N(e,t,f)}))),y=l.pipe((0,k.q)(1),(0,$e.b)((function(){d.complete(),f.next(),f.complete()})),(0,S.B)()),_=(0,h.T)(p,y),T=Rn({abrManager:n,bufferType:e,clock$:t,content:{manifest:c,period:s},garbageCollectors:x,segmentFetcherCreator:a,segmentBuffersStore:r,options:o,wantedBufferAhead$:I}).pipe((0,b.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=c.getPeriodAfter(s);if(null===n)return(0,v.z)((0,u.of)(t),(0,u.of)(qt.Z.streamComplete(e)));d.next(n)}else f.next();return(0,u.of)(t)})),(0,S.B)()),w=(0,v.z)(T.pipe((0,g.R)(_)),(0,u.of)(qt.Z.periodStreamCleared(e,s)).pipe((0,$e.b)((function(){D.Z.info("SO: Destroying Stream for",e,s)}))));return(0,h.T)(w,m,y.pipe((0,ae.l)()))}};function Ln(e,t,n){return function(e){return(0,h.T)((0,R.ym)(e).pipe((0,A.h)(!0)),(0,R.ep)(e).pipe((0,A.h)(!1)),(0,R.UG)(e).pipe((0,A.h)(!1))).pipe((0,w.O)("open"===e.readyState),(0,_.x)())}(e).pipe((0,Ye.w)((function(t){return t?function(e){if(0===e.length)return(0,u.of)(void 0);for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push((0,h.T)((0,Ot.R)(r,"updatestart").pipe((0,A.h)(!0)),(0,Ot.R)(r,"update").pipe((0,A.h)(!1)),(0,Dt.F)(500).pipe((0,A.h)(r.updating))).pipe((0,w.O)(r.updating),(0,_.x)()))}return(0,p.a)(t).pipe((0,E.h)((function(e){return e.every((function(e){return!e}))})),(0,A.h)(void 0))}(e.sourceBuffers):m.E})),(0,k.q)(1),(0,y.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(D.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,Xt.K)((function(e){return D.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,u.of)(null)})))}var Bn=n(5039),Un=n(4181);var Fn=R.gg,zn=R.ym,Kn=R._E;function Vn(e){return(0,d.P)((function(){if(D.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return D.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,u.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return D.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,u.of)(null);D.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return Kn(e).pipe((0,k.q)(1))}));return(0,Un.S)(h.T.apply(void 0,i).pipe((r=1,r<=0?function(){return m.E}:(0,I.e)((function(e,t){var n=[];e.subscribe(new x.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,o.XA)(n),a=i.next();!a.done;a=i.next()){var s=a.value;t.next(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),Fn(t).pipe((0,k.q)(1))).pipe((0,b.z)((function(){return Vn(e)})))}))}var Gn=n(7920),Hn=n(467);var Wn=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var $n=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(Wn(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var d={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(d)}}))}return n},jn=L.Z.STREAM_EVENT_EMITTER_POLL_INTERVAL;function Yn(e){return void 0!==e.end}var qn=function(e,t,n){var r=new WeakMap,i=[];return(0,j.R)(e,"manifestUpdate").pipe((0,w.O)(null),(0,Cn.R)((function(t){return $n(t,e)}),[])).pipe((0,$e.b)((function(e){return i=e})),(0,y.U)((function(e){return e.length>0})),(0,_.x)(),(0,Ye.w)((function(e){return e?(0,p.a)([(0,Dt.F)(jn).pipe((0,w.O)(null)),n]).pipe((0,y.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,I.e)((function(e,t){var n,r=!1;e.subscribe(new x.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,b.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],l=[],d=0;d<e.length;d++){var c=e[d],f=c.start,p=Yn(c)?c.end:void 0;r.has(c)?(f>o||void 0!==p&&o>=p)&&(Yn(c)&&l.push(c.publicEvent),r.delete(c)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:c.publicEvent}),r.set(c,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:c.publicEvent}):(s.push({type:"stream-event",value:c.publicEvent}),Yn(c)&&l.push(c.publicEvent)))}return(0,v.z)(s.length>0?u.of.apply(void 0,s):m.E,l.length>0?u.of.apply(void 0,l).pipe((0,$e.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,ae.l)()):m.E)}(i,t,n)}))):m.E})))},Xn=n(2983);function Qn(e){var t=e.mediaElement,n=e.manifest,r=e.clock$,a=e.speed$,o=e.bufferOptions,s=e.abrManager,l=e.segmentFetcherCreator,c=e.setCurrentTime;return function(e,f,v){var _,T=function(e,t){return(0,d.P)((function(){var n;return Ln(t,e).pipe((0,b.z)((function(r){return null!==r&&(n=r),(0,j.R)(e,"manifestUpdate").pipe((0,Ye.w)((function(){return Ln(t,e,n)})),(0,$e.b)((function(e){null!==e&&(n=e)})))})),(0,ae.l)())}))}(n,e),S=null!==(_=n.getPeriodForTime(f))&&void 0!==_?_:n.getNextPeriod(f);if(void 0===S){var k=new B.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,Nt._)((function(){return k}))}var A=new Ht(t,e),I=(0,Gn.Z)({clock$:r,mediaElement:t,startTime:f,mustAutoPlay:v,setCurrentTime:c,isDirectfile:!1}),x=I.seek$,Z=I.play$,M=Z.pipe((0,E.h)((function(e){return"warning"!==e.type}))),R=M.pipe((0,b.z)((function(){return qn(n,t,r)}))),C=function(e,t){var n=t.autoPlay,r=t.initialPlay$,i=t.initialSeek$,a=t.manifest,o=t.speed$,s=t.startTime,u=!1,l=!1,d=r.pipe((0,$e.b)((function(){u=!0})),(0,ae.l)()),c=i.pipe((0,$e.b)((function(){l=!0})),(0,ae.l)()),f=(0,p.a)([e,o]).pipe((0,y.U)((function(e){var t=e[0],r=e[1],i=a.isLive;return{position:t.position,getCurrentTime:t.getCurrentTime,duration:t.duration,isPaused:u?t.paused:!n,liveGap:i?a.getMaximumPosition()-t.position:1/0,readyState:t.readyState,speed:r,wantedTimeOffset:l?0:s-t.position}})));return(0,h.T)(d,c,f)}(r,{autoPlay:v,initialPlay$:M,initialSeek$:x,manifest:n,speed$:a,startTime:f}),P=new i.x,N=new i.x,O=new i.x,L=On({manifest:n,initialPeriod:S},C,s,A,l,o).pipe((0,b.z)((function(t){switch(t.type){case"end-of-stream":return D.Z.debug("Init: end-of-stream order received."),function(e){return zn(e).pipe((0,w.O)(null),(0,Ye.w)((function(){return Vn(e)})))}(e).pipe((0,ae.l)(),(0,g.R)(P));case"resume-stream":return D.Z.debug("Init: resume-stream order received."),P.next(null),m.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,o=n.position;return N.next({period:r,bufferType:i,discontinuity:a,position:o}),m.E;case"locked-stream":return O.next(t.value),m.E;default:return(0,u.of)(t)}}))),U=(0,Xn.Z)(t,a,r).pipe((0,ae.l)()),F=(0,Hn.Z)(r,t,n,N,O,c),z=Z.pipe((0,Ye.w)((function(e){return"warning"===e.type?(0,u.of)(e):(0,Bn.Z)(r,t,A,!1)})));return(0,h.T)(T,z,U,F,L,R).pipe(je((function(){A.disposeAll()})))}}var Jn=n(6625);var er=L.Z.FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,tr=L.Z.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,nr=L.Z.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE;function rr(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,s=(t=function(e,t){return i.fetch(e).pipe((0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):e.parse(t)})),(0,S.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new l.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),c=r.manifest,f=0;return(0,d.P)((function(){return p(r)}));function p(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,s=f>0?f<tr:void 0!==i&&i>=nr,l=void 0===t?0:performance.now()-t,d=Math.max(a-l,0),g=o.pipe((0,b.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&s;return ir(null!=r?r:0,a,t).pipe((0,A.h)({completeRefresh:n,unsafeMode:i}))}))),y=null===c.expired?m.E:(0,Jn.H)(d).pipe((0,M.j)((0,He.Dp)(c.expired)),(0,A.h)({completeRefresh:!0,unsafeMode:s})),_=function(){if(void 0===c.lifetime||c.lifetime<0)return m.E;var e,t=1e3*c.lifetime-l;void 0===i?e=t:c.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-l,Math.max(t,0)+i),6*t),D.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*c.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),D.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,Jn.H)(Math.max(e,d)).pipe((0,A.h)({completeRefresh:!1,unsafeMode:s}))}();return(0,h.T)(_,g,y).pipe((0,k.q)(1),(0,b.z)((function(e){return v({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):p(e)})))}function v(e){var t=e.completeRefresh,n=e.unsafeMode,r=c.updateUrl,i=t||void 0===r,o=i?c.getUrl():r,l=c.clockOffset;return n?(f+=1,D.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(f)+" consecutive time.")):f>0&&(D.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(f)+" consecutive times."),f=0),s(o,{externalClockOffset:l,previousManifest:c,unsafeMode:n}).pipe((0,b.z)((function(e){if("warning"===e.type)return(0,u.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)c.replace(t);else try{c.update(t)}catch(e){var l=e instanceof Error?e.message:"unknown error";return D.Z.warn("MUS: Attempt to update Manifest failed: "+l,"Re-downloading the Manifest fully"),ir(er,a,n).pipe((0,b.z)((function(){return v({completeRefresh:!0,unsafeMode:!1})})))}return(0,u.of)({type:"parsed",manifest:c,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function ir(e,t,n){return(0,d.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,Jn.H)(Math.max(e-r,i))}))}var ar=n(2447),or=L.Z.OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;var sr=function(e){var t,n,r,a=e.adaptiveOptions,o=e.autoPlay,s=e.bufferOptions,l=e.clock$,d=e.keySystems,c=e.lowLatencyMode,f=e.manifest$,v=e.manifestFetcher,_=e.mediaElement,x=e.minimumManifestUpdateInterval,Z=e.segmentFetcherCreator,M=e.setCurrentTime,R=e.speed$,C=e.startAt,P=e.textTrackOptions,N=new wt(a),O=Rt(_).pipe((0,T.d)({refCount:!0})),L=new i.x,B=(0,kt.Z)(_,d,L).pipe((0,qe.Z)(),(0,S.B)()),U=(0,ar.Z)(_),F=B.pipe((t=function(e,t){switch(t.type){case"eme-disabled":case"attached-media-keys":return(0,u.of)({isEmeReady:!0,drmSystemId:e.drmSystemId});case"created-media-keys":var n=t.value.initializationDataSystemId;return O.pipe((0,b.z)((function(){return t.value.attachMediaKeys$.next(),!0===t.value.options.disableMediaKeysAttachmentLock?(0,u.of)({isEmeReady:!0,drmSystemId:n}):m.E})),(0,w.O)({isEmeReady:!1,drmSystemId:n}));default:return m.E}},n={isEmeReady:!1,drmSystemId:void 0},void 0===r&&(r=1/0),(0,I.e)((function(e,i){var a=n;return(0,Ge.p)(e,i,(function(e,n){return t(a,e,n)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))),(0,E.h)((function(e){return e.isEmeReady})),(0,k.q)(1),We((function(e){var t=e.drmSystemId;return O.pipe((0,y.U)((function(e){return{mediaSource:e,drmSystemId:t}})))}))),z=(0,p.a)([f,F]).pipe((0,b.z)((function(e){var t=e[0],n=e[1];if("warning"===t.type)return(0,u.of)(t);var r=t.manifest,a=n.mediaSource,d=n.drmSystemId;D.Z.debug("Init: Calculating initial time");var f=function(e,t,n){if(D.Z.debug("Init: calculating initial time"),null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return D.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){D.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){D.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){D.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){D.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var d=e.getMinimumPosition();if(e.isLive){var c,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition();if(null==p)D.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),c=v;else{D.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var h=null==e.availabilityStartTime?0:e.availabilityStartTime,m=(performance.now()+p)/1e3-h;c=Math.min(v,m)}var g=void 0!==f?f:t?Pt.LOW_LATENCY:Pt.DEFAULT;return D.Z.debug("Init: "+c+" defined as the live time, applying a live gap of "+g),Math.max(c-g,d)}return D.Z.info("Init: starting at the minimum available position:",d),d}(r,c,C);D.Z.debug("Init: Initial time calculated:",f);var p=Qn({abrManager:N,bufferOptions:(0,q.Z)({textTrackOptions:P,drmSystemId:d},s),clock$:l,manifest:r,mediaElement:_,segmentFetcherCreator:Z,speed$:R,setCurrentTime:M}),m=function e(t,n,r){var a=new i.x,o=p(t,n,r).pipe((0,Xe.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return T.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":return T.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:or}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var t=ie(_);if(null===(r=t)||r.indexOf("widevine")<0)return a.next(e.value),null;var n=e.value.position;return n+.001<e.value.duration?M(_.currentTime+.001):M(n),null;case"encryption-data-encountered":return L.next(e.value),null;case"needs-buffer-flush":return M(_.currentTime+.001),null}var r;return e}),null)).pipe((0,g.R)(a)),s=a.pipe((0,Ye.w)((function(t){return Rt(_).pipe((0,b.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,w.O)(Ct.Z.reloadingMediaSource()))})));return(0,h.T)(s,o)}(a,f,o),T=new i.x,E=rr({initialManifest:t,manifestFetcher:v,minimumManifestUpdateInterval:x,scheduleRefresh$:T}),S=(0,h.T)((0,j.R)(r,"manifestUpdate").pipe((0,A.h)(Ct.Z.manifestUpdate())),(0,j.R)(r,"decipherabilityUpdate").pipe((0,y.U)(Ct.Z.decipherabilityUpdate))),k=B.pipe((0,$e.b)((function(e){"keys-update"===e.type?r.updateDeciperabilitiesBasedOnKeyIds(e.value):"blacklist-protection-data"===e.type&&(D.Z.info("Init: blacklisting Representations based on protection data."),r.addUndecipherableProtectionData(e.value))})),(0,ae.l)());return(0,h.T)(S,E,k,m).pipe((0,w.O)(Ct.Z.manifestReady(r)),je((function(){T.complete()})))})));return(0,h.T)(z,U,B)},ur=L.Z.SAMPLING_INTERVAL_MEDIASOURCE,lr=L.Z.SAMPLING_INTERVAL_LOW_LATENCY,dr=L.Z.SAMPLING_INTERVAL_NO_MEDIASOURCE,cr=L.Z.RESUME_GAP_AFTER_SEEKING,fr=L.Z.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,pr=L.Z.RESUME_GAP_AFTER_BUFFERING,vr=L.Z.REBUFFERING_GAP,hr=L.Z.MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING,mr=["canplay","play","seeking","seeked","loadedmetadata","ratechange"];function gr(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT";switch(e.reason){case"seeking":case"internal-seek":return cr[n];case"not-ready":return fr[n];case"buffering":return pr[n]}}function yr(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,d=(0,Q.rx)(n,r);return{bufferGap:null!==d?d.end-r:1/0,buffered:n,currentRange:d,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function _r(e,t,n){var r,i,a,o=n.withMediaSource,s=n.lowLatencyMode,u=t.event,l=t.position,d=t.bufferGap,c=t.currentRange,f=t.duration,p=t.paused,v=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=vr[r]}(c,f,s),b=v>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=s?vr.LOW_LATENCY:vr.DEFAULT;if(o){if(b)d<=E?(r=!0,T=l+d):d===1/0&&(r=!0,T=l);else if(null!==m){var S=gr(m,s);!0!==r&&null!==m&&v>1&&(_||h||d<1/0&&d>S)?i=!0:(d===1/0||d<=S)&&(T=d===1/0?l:l+d)}}else b&&(!p&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&d===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||d<1/0&&(d>gr(m,s)||_||h))&&(i=!0);return!0===i?null:!0===r||null!==m?(a="seeking"===u||null!==m&&"seeking"===m.reason?"seeking":t.seeking&&("internal-seeking"===u||null!==m&&"internal-seek"===m.reason)?"internal-seek":t.seeking?"seeking":1===v?"not-ready":"buffering",null!==m&&m.reason===a?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:a,timestamp:performance.now(),position:T}):null}var br=function(e,t){var n=0;return{clock$:(0,d.P)((function(){var r=(0,q.Z)(yr(e,"init"),{rebuffering:null,freezing:null,getCurrentTime:function(){return e.currentTime}});function i(i){var a=i;"seeking"===a&&n>0&&(a="internal-seeking",n-=1);var o,s,u=yr(e,a),l=_r(r,u,t),d=(s=u,(o=r).freezing?s.ended||s.paused||0===s.readyState||0===s.playbackRate||o.position!==s.position?null:o.freezing:"timeupdate"===s.event&&s.bufferGap>hr&&!s.ended&&!s.paused&&s.readyState>=1&&0!==s.playbackRate&&s.position===o.position?{timestamp:performance.now()}:null),c=(0,q.Z)({},{rebuffering:l,freezing:d,getCurrentTime:function(){return e.currentTime}},u);return D.Z.debug("API: current media element state",c),c}var a=mr.map((function(t){return(0,Ot.R)(e,t).pipe((0,A.h)(t))})),o=t.lowLatencyMode?lr:t.withMediaSource?ur:dr,s=(0,Dt.F)(o).pipe((0,A.h)("timeupdate"));return h.T.apply(void 0,[s].concat(a)).pipe((0,y.U)((function(e){return r=i(e),"DEBUG"===D.Z.getLevel()&&D.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 p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(r.buffered,r.position),"\n"+e),r})),(0,w.O)(r))})).pipe((0,T.d)({bufferSize:1,refCount:!0})),setCurrentTime:function(t){e.currentTime=t,n+=1}}};var Tr=L.Z.FORCED_ENDED_THRESHOLD,Er="STOPPED",Sr="LOADED",wr="LOADING",kr="PLAYING",Ar="PAUSED",Ir="ENDED",xr="BUFFERING",Zr="SEEKING",Mr="RELOADING";var Rr=n(5553);function Cr(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 Pr(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 Pr(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 Pr(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 Nr=L.Z.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,Dr=L.Z.DEFAULT_AUTO_PLAY,Or=L.Z.DEFAULT_CODEC_SWITCHING_BEHAVIOR,Lr=L.Z.DEFAULT_ENABLE_FAST_SWITCHING,Br=L.Z.DEFAULT_INITIAL_BITRATES,Ur=L.Z.DEFAULT_LIMIT_VIDEO_WIDTH,Fr=L.Z.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,zr=L.Z.DEFAULT_MIN_BITRATES,Kr=L.Z.DEFAULT_MAX_BITRATES,Vr=L.Z.DEFAULT_MAX_BUFFER_AHEAD,Gr=L.Z.DEFAULT_MAX_BUFFER_BEHIND,Hr=L.Z.DEFAULT_SHOW_NATIVE_SUBTITLE,Wr=L.Z.DEFAULT_STOP_AT_END,$r=L.Z.DEFAULT_TEXT_TRACK_MODE,jr=L.Z.DEFAULT_THROTTLE_WHEN_HIDDEN,Yr=L.Z.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,qr=L.Z.DEFAULT_WANTED_BUFFER_AHEAD;var Xr=n(7829);function Qr(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Xr.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Jr(e){return e.map((function(e){return null===e?e:{normalized:(0,Xr.ZP)(e.language),closedCaption:e.closedCaption}}))}var ei=function(){function e(e){this._periods=new Wt((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=si(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void D.Z.warn("TrackChoiceManager: "+e+" already added for period",t);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):D.Z.warn("TrackChoiceManager: "+e+" already removed for period",t)}else D.Z.warn("TrackChoiceManager: "+e+" not found for period",t)},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=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,Y.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Pe.Z)(r,i))n.adaptation$.next(i);else{var a=ni(r,Qr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,Y.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Pe.Z)(r,i))n.adaptation$.next(i);else{var a=ii(r,Jr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,Y.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,Pe.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=oi(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=di(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.audio:null;if((0,Y.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,ut.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.text:null;if((0,Y.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,ut.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,Y.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,ut.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=di(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,Y.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=si(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,Y.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,Y.Z)(r))return null;var i={language:(0,Qe.Z)(r.language,""),normalized:(0,Qe.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(li)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,Y.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,Y.Z)(r)?null:{language:(0,Qe.Z)(r.language,""),normalized:(0,Qe.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,Y.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,Y.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(ui),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(ui)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,Y.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,Y.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,Qe.Z)(e.language,""),normalized:(0,Qe.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(li)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,Y.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,Y.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,Qe.Z)(e.language,""),normalized:(0,Qe.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,Y.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(ui),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(ui)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=Qr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,Y.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,Pe.Z)(s,u))n(r+1);else{var l=ni(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Jr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,Y.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,Pe.Z)(s,u))n(r+1);else{var l=ii(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,Y.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,Pe.Z)(s,u.baseAdaptation)){var l=di(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var d=oi(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var c=di(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptation$.next(c),n(0)}n(r+1)}}}(0)},e}();function ti(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 ni(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=ti(r),a=(0,ut.Z)(e,i);if(void 0!==a)return a}return e[0]}function ri(e){return function(t){return(0,Qe.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function ii(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=ri(r),a=(0,ut.Z)(e,i);if(void 0!==a)return a}return null}function ai(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 oi(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=ai(r),a=(0,ut.Z)(e,i);if(void 0!==a)return a}return e[0]}function si(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ui(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function li(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function di(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var ci=L.Z.DEFAULT_UNMUTED_VOLUME,fi=R.zh,pi=R._K,vi=R.C1,hi=R.Q1,mi=R.Qt,gi=R.yj,yi=R.d5,_i=R.UA,bi=R.$x,Ti=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,d,c,f,p,v,h;if((0,Y.Z)(e.maxBufferAhead))t=Vr;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,Y.Z)(e.maxBufferBehind))n=Gr;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,Y.Z)(e.wantedBufferAhead))r=qr;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");var m=(0,Y.Z)(e.limitVideoWidth)?Ur:!!e.limitVideoWidth;if((0,Y.Z)(e.throttleWhenHidden)?i=jr:((0,J.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),i=!!e.throttleWhenHidden),a=!i&&((0,Y.Z)(e.throttleVideoBitrateWhenHidden)?Yr:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?s=e.preferredTextTracks:((0,J.Z)("Invalid `preferredTextTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?o=e.preferredAudioTracks:((0,J.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),o=[]):o=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?u=e.preferredVideoTracks:((0,J.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),u=[]):u=[],(0,Y.Z)(e.videoElement))l=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");l=e.videoElement}if((0,Y.Z)(e.initialVideoBitrate))d=Br.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,Y.Z)(e.initialAudioBitrate))c=Br.audio;else if(c=Number(e.initialAudioBitrate),isNaN(c))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,Y.Z)(e.minVideoBitrate))p=zr.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,Y.Z)(e.minAudioBitrate))f=zr.audio;else if(f=Number(e.minAudioBitrate),isNaN(f))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,Y.Z)(e.maxVideoBitrate))h=Kr.video;else{if(h=Number(e.maxVideoBitrate),isNaN(h))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+h+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,Y.Z)(e.maxAudioBitrate))v=Kr.audio;else{if(v=Number(e.maxAudioBitrate),isNaN(v))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(f>v)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+v+'", is inferior to the set minAudioBitrate, "'+f+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:m,videoElement:l,wantedBufferAhead:r,throttleWhenHidden:i,throttleVideoBitrateWhenHidden:a,preferredAudioTracks:o,preferredTextTracks:s,preferredVideoTracks:u,initialAudioBitrate:c,initialVideoBitrate:d,minAudioBitrate:f,minVideoBitrate:p,maxAudioBitrate:v,maxVideoBitrate:h,stopAtEnd:(0,Y.Z)(e.stopAtEnd)?Wr:!!e.stopAtEnd}}(e),o=r.initialAudioBitrate,u=r.initialVideoBitrate,l=r.limitVideoWidth,d=r.minAudioBitrate,c=r.minVideoBitrate,f=r.maxAudioBitrate,p=r.maxBufferAhead,v=r.maxBufferBehind,h=r.maxVideoBitrate,m=r.preferredAudioTracks,b=r.preferredTextTracks,T=r.preferredVideoTracks,E=r.throttleWhenHidden,S=r.throttleVideoBitrateWhenHidden,w=r.videoElement,k=r.wantedBufferAhead,A=r.stopAtEnd;return w.preload="auto",t.version="3.26.1",t.log=D.Z,t.state="STOPPED",t.videoElement=w,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),gi(w).pipe((0,g.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),hi(w).pipe((0,g.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),_i(w.textTracks).pipe((0,g.R)(t._priv_destroy$),(0,y.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,_.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_playing$=new a.t(1),t._priv_speed$=new s(w.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock$=new s(!1),t._priv_bufferOptions={wantedBufferAhead$:new s(k),maxBufferAhead$:new s(p),maxBufferBehind$:new s(v)},t._priv_bitrateInfos={lastBitrates:{audio:o,video:u},minAutoBitrates:{audio:new s(d),video:new s(c)},maxAutoBitrates:{audio:new s(f),video:new s(h)},manualBitrates:{audio:new s(-1),video:new s(-1)}},t._priv_throttleWhenHidden=E,t._priv_throttleVideoBitrateWhenHidden=S,t._priv_limitVideoWidth=l,t._priv_mutedMemory=ci,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(Er),t._priv_preferredAudioTracks=m,t._priv_preferredTextTracks=b,t._priv_preferredVideoTracks=T,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var o=r.prototype;return o.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==Er&&this._priv_setPlayerState(Er)},o.dispose=function(){this.stop(),null!==this.videoElement&&re(this.videoElement).subscribe(ee.Z),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_playing$.complete(),this._priv_speed$.complete(),this._priv_contentLock$.complete(),this._priv_bufferOptions.wantedBufferAhead$.complete(),this._priv_bufferOptions.maxBufferAhead$.complete(),this._priv_bufferOptions.maxBufferBehind$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_bitrateInfos.manualBitrates.video.complete(),this._priv_bitrateInfos.manualBitrates.audio.complete(),this._priv_bitrateInfos.minAutoBitrates.video.complete(),this._priv_bitrateInfos.minAutoBitrates.audio.complete(),this._priv_bitrateInfos.maxAutoBitrates.video.complete(),this._priv_bitrateInfos.maxAutoBitrates.audio.complete(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},o.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,d,c,f;if((0,Y.Z)(e))throw new Error("No option set on loadVideo");if((0,Y.Z)(e.url)){if((0,Y.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,Y.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 s=String(e.url);if((0,Y.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var p=(0,Y.Z)(e.autoPlay)?Dr:!!e.autoPlay;if((0,Y.Z)(e.keySystems))l=[];else for(var v,h=Cr(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(v=h()).done;){var m=v.value;if("string"!=typeof m.type||"function"!=typeof m.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var g=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,y="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},_=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,b=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,T=(0,Y.Z)(e.audioTrackSwitchingMode)?Nr:e.audioTrackSwitchingMode;(0,Pe.Z)(["seamless","direct"],T)||(D.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\nIf badly set, "+Nr+" strategy will be used as default"),T=Nr);var E=(0,Y.Z)(e.onCodecSwitch)?Or:e.onCodecSwitch;(0,Pe.Z)(["continue","reload"],E)||(D.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+Or+" will be used as default"),E=Or);var S=(0,q.Z)({},y,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:g});if(delete S.initialManifest,delete S.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,J.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var w,k=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],A=Cr(k);!(w=A()).done;){var I=w.value;if("string"!=typeof I.language||"string"!=typeof I.mimeType||"string"!=typeof I.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}S.supplementaryTextTracks=k}if(void 0!==e.supplementaryImageTracks){(0,J.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var x,Z=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],M=Cr(Z);!(x=M()).done;){var R=x.value;if("string"!=typeof R.mimeType||"string"!=typeof R.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}S.supplementaryImageTracks=Z}if((0,Y.Z)(e.textTrackMode))d=$r;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");d=e.textTrackMode}(0,Y.Z)(e.defaultAudioTrack)||(0,J.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var C=(0,Rr.iH)(e.defaultAudioTrack);(0,Y.Z)(e.defaultTextTrack)||(0,J.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var P=(0,Rr.Y1)(e.defaultTextTrack),N=!Hr;(0,Y.Z)(e.hideNativeSubtitle)||((0,J.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),N=!!e.hideNativeSubtitle);var O=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:Fr,L=(0,Y.Z)(e.enableFastSwitching)?Lr:e.enableFastSwitching;if("html"===d){if((0,Y.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.");c=e.textTrackElement}else(0,Y.Z)(e.textTrackElement)||D.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,Y.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var B=e.startAt.wallClockTime.getTime()/1e3;f=(0,q.Z)({},e.startAt,{wallClockTime:B})}else f=e.startAt;return{autoPlay:p,defaultAudioTrack:C,defaultTextTrack:P,enableFastSwitching:L,hideNativeSubtitle:N,keySystems:l,initialManifest:_,lowLatencyMode:g,manualBitrateSwitchingMode:O,audioTrackSwitchingMode:T,minimumManifestUpdateInterval:b,networkConfig:(0,Y.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:E,startAt:f,textTrackElement:c,textTrackMode:d,transport:u,transportOptions:S,url:s}}(e);D.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},o.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},o._priv_initializeContentPlayback=function(e){var t,n,r,a=this,o=e.autoPlay,s=e.audioTrackSwitchingMode,l=e.defaultAudioTrack,c=e.defaultTextTrack,R=e.enableFastSwitching,C=e.initialManifest,P=e.keySystems,N=e.lowLatencyMode,L=e.manualBitrateSwitchingMode,B=e.minimumManifestUpdateInterval,U=e.networkConfig,F=e.onCodecSwitch,z=e.startAt,K=e.transport,V=e.transportOptions,G=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var $,j="directfile"===K,Y=new i.x,X={url:G,stop$:Y,isDirectFile:j,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:l,initialTextTrack:c},Q=this.videoElement,J=br(Q,{withMediaSource:!j,lowLatencyMode:N}),ee=J.setCurrentTime,te=J.clock$,ne=this._priv_speed$.pipe((0,_.x)());if(j){if(this.stop(),this._priv_currentError=null,this._priv_playing$.next(!1),null===H.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=X,this._priv_mediaElementTrackChoiceManager=new H.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var re=void 0===l?this._priv_preferredAudioTracks:[l];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(re,!0);var ie=void 0===c?this._priv_preferredTextTracks:[c];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ie,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var ae=H.Z.directfile.initDirectFile({autoPlay:o,clock$:te,keySystems:P,mediaElement:Q,speed$:this._priv_speed$,startAt:z,setCurrentTime:ee,url:G}).pipe((0,g.R)(Y));$=f(ae,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var oe=H.Z.transports[K];if("function"!=typeof oe)throw this.stop(),this._priv_currentError=null,this._priv_playing$.next(!1),new Error('transport "'+K+'" not supported');var se,ue=oe(V),le=U.offlineRetry,de=U.segmentRetry,ce=U.manifestRetry,fe=new Me(G,ue,{lowLatencyMode:N,maxRetryRegular:ce,maxRetryOffline:le}),pe=new Ve(ue,{lowLatencyMode:N,maxRetryOffline:le,maxRetryRegular:de});(se=(se=C instanceof W.ZP?(0,u.of)({type:"parsed",manifest:C}):void 0!==C?fe.parse(C,{previousManifest:null,unsafeMode:!1}):fe.fetch(G).pipe((0,b.z)((function(e){return"warning"===e.type?(0,u.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,g.R)(Y),(0,T.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_playing$.next(!1),this._priv_contentInfos=X;var ve=O(),he={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ve?he.throttle={video:fi().pipe((0,y.U)((function(e){return e?1/0:0})),(0,g.R)(Y))}:D.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ve?he.throttleBitrate={video:pi(this._priv_pictureInPictureEvent$).pipe((0,y.U)((function(e){return e?1/0:0})),(0,g.R)(Y))}:D.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ve?he.limitWidth={video:bi(Q,this._priv_pictureInPictureEvent$).pipe((0,g.R)(Y))}:D.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var me={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:he},ge="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ye=(0,q.Z)({audioTrackSwitchingMode:s,enableFastSwitching:R,manualBitrateSwitchingMode:L,onCodecSwitch:F},this._priv_bufferOptions),_e=sr({adaptiveOptions:me,autoPlay:o,bufferOptions:ye,clock$:te,keySystems:P,lowLatencyMode:N,manifest$:se,manifestFetcher:fe,mediaElement:Q,minimumManifestUpdateInterval:B,segmentFetcherCreator:pe,setCurrentTime:ee,speed$:ne,startAt:z,textTrackOptions:ge}).pipe((0,g.R)(Y));$=f(_e,{connector:function(){return new i.x},resetOnDisconnect:!1})}var be,Te,Ee=$.pipe((0,E.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,y.U)((function(e){return e.value})),(0,_.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),Se=$.pipe((0,E.h)((function(e){return"loaded"===e.type})),(0,S.B)()),we=$.pipe((0,E.h)((function(e){return"reloading-media-source"===e.type})),(0,S.B)()),ke=vi(Q),Ae=yi(Q),Ie=(0,p.a)([this._priv_playing$,Ee.pipe((0,w.O)(null)),ke.pipe((0,w.O)(null)),Ae.pipe((0,w.O)(null))]).pipe((0,g.R)(Y),(0,y.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){if(e.ended)return Ir;if(null!==n){var r=Math.abs(e.duration-e.currentTime);return null!=Tr&&r<Tr?Ir:"seeking"===n?Zr:xr}return t?kr:Ar}(Q,t,n)}))),xe=(0,v.z)((0,u.of)(wr),Se.pipe((0,k.q)(1),(0,A.h)(Sr)),(0,h.T)(Ie.pipe((0,g.R)(we),(be=function(e){return e===Ar},(0,I.e)((function(e,t){var n=!1,r=0;e.subscribe(new x.Q(t,(function(e){return(n||(n=!be(e,r++)))&&t.next(e)})))})))),we.pipe((0,Z.c)(Se.pipe((0,k.q)(1),(0,M.j)(Ie),(0,w.O)(Mr)))))).pipe((0,_.x)());Y.pipe((0,k.q)(1)).subscribe((function(){void 0!==Te&&Te.unsubscribe()})),mi(Q).pipe((0,g.R)(Y)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)})),te.pipe((0,g.R)(Y)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),Se.pipe((0,Z.c)(function(e,t){return(0,d.P)((function(){if(null===e)return m.E;var n=t.pipe((0,E.h)((function(e){return"seeking"===e.event})),(0,A.h)("seeking")),r=n.pipe((0,Z.c)(t.pipe((0,E.h)((function(e){return"seeked"===e.event})),(0,A.h)("seeked"),(0,k.q)(1)))),i=(0,h.T)(n,r);return e.seeking?i.pipe((0,w.O)("seeking")):i}))}(this.videoElement,te)),(0,g.R)(Y)).subscribe((function(e){D.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),xe.pipe((0,g.R)(Y)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?vi(Q):m.E).pipe((0,g.R)(Y)).subscribe((function(){Y.next(),Y.complete()})),$.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock$.pipe((0,E.h)((function(e){return!e})),(0,k.q)(1),(0,g.R)(Y)).subscribe((function(){Te=$.connect()}))},o.getError=function(){return this._priv_currentError},o.getManifest=function(){return(0,J.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},o.getCurrentAdaptations=function(){if((0,J.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,Y.Z)(n[t.id])?null:n[t.id]},o.getCurrentRepresentations=function(){return(0,J.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},o.getVideoElement=function(){return this.videoElement},o.getNativeTextTrack=function(){if((0,J.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},o.getPlayerState=function(){return this.state},o.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},o.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},o.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},o.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},o.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,Q.L7)(e.buffered,e.currentTime)},o.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,Q.at)(e.buffered,e.currentTime)},o.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,Q.DD)(e.buffered,e.currentTime)},o.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;return t?this.videoElement.currentTime:null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},o.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},o.getPlaybackRate=function(){return this._priv_speed$.getValue()},o.setPlaybackRate=function(e,t){this._priv_speed$.next(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},o.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,Y.Z)(r.video)?[]:r.video.getAvailableBitrates()},o.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,Y.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},o.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},o.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},o.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,Y.Z)(e.video))return e.video.bitrate},o.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,Y.Z)(e.audio))return e.audio.bitrate},o.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},o.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},o.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},o.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},o.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,Y.Z)(t)||"function"!=typeof t.catch?X.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new B.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},o.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},o.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,Y.Z)(a.relative))if((0,Y.Z)(a.position)){if((0,Y.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},o.isFullscreen=function(){return(0,J.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),P()},o.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,J.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(!P()){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):C()},o.exitFullscreen=function(){(0,J.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),C()},o.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},o.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))},o.isMute=function(){return 0===this.getVolume()},o.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},o.unMute=function(){0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?ci:this._priv_mutedMemory)},o.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.next(e)},o.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.next(e)},o.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.next(e)},o.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.next(e)},o.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.next(e)},o.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.next(e)},o.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind$.next(e)},o.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead$.next(e)},o.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead$.next(e)},o.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind$.getValue()},o.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead$.getValue()},o.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead$.getValue()},o.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return ie(this.videoElement)},o.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},o.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},o.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},o.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},o.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},o.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},o.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},o.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},o.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},o.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},o.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},o.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},o.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},o.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},o.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},o.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},o.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},o.getImageTrackData=function(){return(0,J.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},o.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.getMinimumPosition():null},o.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.getMaximumPosition():null},o.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},o._priv_cleanUpCurrentContentState=function(){var e,t=this;D.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock$.next(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){D.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock$.next(!1)};(0,Y.Z)(this.videoElement)?n():oe(this.videoElement).subscribe({error:function(e){D.Z.error("API: An error arised when trying to clean-up the EME session:"+(e instanceof Error?e.toString():"Unknown Error")),n()},complete:function(){D.Z.debug("API: EME session cleaned-up with success!"),n()}})},o._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void D.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void D.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,Y.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},o._priv_onPlaybackError=function(e){var t=G(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,D.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(Er),this._priv_currentError===t&&this.trigger("error",t)},o._priv_onPlaybackFinished=function(){D.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(Ir)},o._priv_onPlaybackWarning=function(e){var t=G(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});D.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},o._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new ei({preferTrickModeTracks:this._priv_preferTrickModeTracks});var o=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(o,!0);var s=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(s,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,j.R)(n,"manifestUpdate").pipe((0,g.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else D.Z.error("API: The manifest is loaded but no content is.")},o._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),d=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",d)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var c=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else D.Z.error("API: The active period changed but no content is loaded")},o._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(D.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(D.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(D.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,Y.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},o._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,Y.Z)(i)&&!(0,Y.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,Y.Z)(a)&&!(0,Y.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},o._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},o._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,Y.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,Y.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var d=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",d);break;case"text":var c=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",c);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else D.Z.error("API: The adaptations changed but no content is loaded")},o._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,Y.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var d=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,Y.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",d):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d))}else D.Z.error("API: The representations changed but no content is loaded")},o._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})},o._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_playing$.next(e)},o._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},o._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,D.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},o._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==Mr){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,Y.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else D.Z.warn("API: Cannot perform time update: no content loaded.")},o._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,$.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},o._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,Y.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return F.ZB}},{key:"ErrorCodes",get:function(){return F.SM}},{key:"LogLevel",get:function(){return D.Z.getLevel()},set:function(e){D.Z.setLevel(e)}}]),r}(j.Z);Ti.version="3.26.1";var Ei=Ti,Si=n(7273);!function(){Si.Z.emeManager=n(8281).ZP,Si.Z.imageBuffer=n(7127).Z,Si.Z.imageParser=n(3203).Z,Si.Z.transports.smooth=n(2339).Z,Si.Z.transports.dash=n(5877).Z,Si.Z.dashParsers.js=n(148).Z,Si.Z.nativeTextTracksBuffer=n(9059).Z,Si.Z.nativeTextTracksParsers.vtt=n(9405).Z,Si.Z.nativeTextTracksParsers.ttml=n(1570).Z,Si.Z.nativeTextTracksParsers.sami=n(1812).Z,Si.Z.nativeTextTracksParsers.srt=n(8057).Z,Si.Z.htmlTextTracksBuffer=n(5192).Z,Si.Z.htmlTextTracksParsers.sami=n(5734).Z,Si.Z.htmlTextTracksParsers.ttml=n(7439).Z,Si.Z.htmlTextTracksParsers.srt=n(8675).Z,Si.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Si.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var wi=Ei}(),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={7757:function(e,t,n){e.exports=n(5666)},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,{kD:function(){return u},fq:function(){return o},YM:function(){return s},vU:function(){return l},G6:function(){return f},SB:function(){return p},op:function(){return c},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(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())),p=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return L},Y:function(){return j}});var r,i=n(3610),a=n(2817),o=n(9917),s=n(3714),u=n(811),l=n(8117),c=n(3666),d=n(2203),f=n(5059),p=n(3144),v=n(9589),h=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 v.Z((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,p.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),m=n(4578),g=n(6716),y=n(3071),_=n(3505),b=n(1959),T=n(8719);if(!d.Z){var E=window.MSMediaKeys;void 0!==E&&void 0!==E.prototype&&"function"==typeof E.isTypeSupported&&"function"==typeof E.prototype.createSession&&(r=E)}var S,w=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new g.x,n.closed=new v.Z((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new v.Z((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,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,y.T)(T.GJ(n._ss),T.GV(n._ss),T.Xe(n._ss)).pipe((0,_.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new v.Z((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.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}(b.Z),k=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new w(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!d.Z){var A=window.MozMediaKeys;void 0!==A&&void 0!==A.prototype&&"function"==typeof A.isTypeSupported&&"function"==typeof A.prototype.createSession&&(S=A)}var I=n(9689),Z=n(3635);function x(e){return"function"==typeof e.webkitGenerateKeyRequest}var M=function(e){function t(t,n){var r;return(r=e.call(this)||this)._closeSession$=new g.x,r._vid=t,r._key=n,r.sessionId="",r.closed=new v.Z((function(e){r._closeSession$.subscribe(e)})),r.keyStatuses=new Map,r.expiration=NaN,(0,y.T)(T.GJ(t),T.GV(t),T.Xe(t)).pipe((0,_.R)(r._closeSession$)).subscribe((function(e){return r.trigger(e.type,e)})),r.update=function(e){return new v.Z((function(t,n){try{if(r._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,Z.uR)(i)),o=(0,I.K)(a.keys[0].k),s=(0,I.K)(a.keys[0].kid);t(r._vid.webkitAddKey(r._key,o,s,""))}else t(r._vid.webkitAddKey(r._key,e,null,""))}catch(e){n(e)}}))},r}(0,m.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new v.Z((function(t){e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},t}(b.Z),R=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!x(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var C=n(6968);var P=n(158);function N(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var O=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._closeSession$=new g.x,i._videoElement=t,i._keyType=n,i.closed=new v.Z((function(e){i._closeSession$.subscribe(e)})),i.keyStatuses=new Map,i.expiration=NaN,i.update=function(e){return new v.Z((function(t,n){if(void 0===i._nativeSession||void 0===i._nativeSession.update||"function"!=typeof i._nativeSession.update)return n("Unavailable WebKit key session.");try{var r;r=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),t(i._nativeSession.update(r))}catch(e){n(e)}}))},i}(0,m.Z)(t,e);var n=t.prototype;return n.listenEvent=function(e){var t=this;(0,y.T)(T.GJ(e),T.GV(e),T.Xe(e)).pipe((0,_.R)(this._closeSession$)).subscribe((function(e){t.trigger(e.type,e)}))},n.generateRequest=function(e,t){var n=this;return new v.Z((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,C.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,C.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,C.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 v.Z((function(t,n){e._closeSession$.next(),e._closeSession$.complete(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return v.Z.resolve(!1)},n.remove=function(){return v.Z.resolve()},(0,p.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}(b.Z),D=function(){function e(e){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new P.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return N(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 O(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,v.Z.resolve()},e}();var L=null,U=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(d.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,f.Z)())L=function(e,t){return(0,l.Z)(navigator.requestMediaKeySystemAccess(e,t))};else{var B,F;if(x(HTMLVideoElement.prototype)){var z={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 R(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof R))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};B=z.isTypeSupported,F=z.createCustomMediaKeys,U=z.setMediaKeys}else if(void 0!==P.t){var K=function(){if(void 0===P.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:P.t.isTypeSupported,createCustomMediaKeys:function(e){return new D(e)},setMediaKeys:function(e,t){if(null===t)return N(e,t);if(!(t instanceof D))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();B=K.isTypeSupported,F=K.createCustomMediaKeys,U=K.setMediaKeys}else if(c.fq&&void 0!==r){var V={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new k(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof k))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};B=V.isTypeSupported,F=V.createCustomMediaKeys,U=V.setMediaKeys}else if(void 0!==S){var G={isTypeSupported:function(e,t){if(void 0===S)throw new Error("No MozMediaKeys API.");return void 0!==t?S.isTypeSupported(e,t):S.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===S)throw new Error("No MozMediaKeys API.");return new S(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};B=G.isTypeSupported,F=G.createCustomMediaKeys,U=G.setMediaKeys}else{var H=window.MediaKeys,W=function(){if(void 0===H)throw new s.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===H.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.")}};B=function(e){return W(),(0,u.Z)("function"==typeof H.isTypeSupported),H.isTypeSupported(e)},F=function(e){return W(),new H(e)}}L=function(e,t){if(!B(e))return(0,i._)((function(){return new Error("Unsupported key type")}));for(var n=0;n<t.length;n++){var r=t[n],o=r.videoCapabilities,s=r.audioCapabilities,u=r.initDataTypes,l=r.distinctiveIdentifier,c=!0;if(c=(c=c&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var d={videoCapabilities:o,audioCapabilities:s,initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]},f=F(e);return(0,a.of)(new h(e,f,d))}}return(0,i._)((function(){return new Error("Unsupported configuration")}))}}function j(e,t){return(0,o.P)((function(){return(0,l.Z)(U(e,t))}))}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},8719:function(e,t,n){"use strict";n.d(t,{Nh:function(){return F},_K:function(){return V},Oh:function(){return re},C1:function(){return q},Q1:function(){return Y},GV:function(){return ae},Xe:function(){return oe},GJ:function(){return ie},eX:function(){return se},K4:function(){return H},yj:function(){return K},Qt:function(){return $},gg:function(){return ne},ik:function(){return j},d5:function(){return W},UG:function(){return J},ep:function(){return ee},ym:function(){return Q},UA:function(){return X},_E:function(){return te},$x:function(){return G}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(7991),s=n(6362),u=n(4727),l=n(533),c=n(3833),d=n(3994);function f(e,t){return t?function(n){return(0,s.z)(t.pipe((0,u.q)(1),(0,l.l)()),n.pipe(f(e)))}:(0,d.z)((function(t,n){return e(t,n).pipe((0,u.q)(1),(0,c.h)(t))}))}var p=n(6625);function v(e,t){void 0===t&&(t=o.z);var n=(0,p.H)(e,t);return f((function(){return n}))}var h=n(6798),m=n(2566),g=n(7878),y={leading:!0,trailing:!1};function _(e,t,n){void 0===t&&(t=o.z),void 0===n&&(n=y);var r,i,a,s,u,l=(0,p.H)(e,t);return r=function(){return l},s=(a=void 0===(i=n)?y:i).leading,u=a.trailing,(0,h.e)((function(e,t){var n=!1,i=null,a=null,o=!1,l=function(){null==a||a.unsubscribe(),a=null,u&&(f(),o&&t.complete())},c=function(){a=null,o&&t.complete()},d=function(e){return a=(0,g.Xf)(r(e)).subscribe(new m.Q(t,l,c))},f=function(){if(n){n=!1;var e=i;i=null,t.next(e),!o&&d(e)}};e.subscribe(new m.Q(t,(function(e){n=!0,i=e,(!a||a.closed)&&(s?f():d(e))}),(function(){o=!0,(!(u&&n&&a)||a.closed)&&t.complete()})))}))}var b=n(2401),T=n(3071),E=n(9917),S=n(9127),w=n(6108),k=n(3741),A=n(4978),I=n(2817),Z=n(2334),x=n(6697),M=n(944),R=n(6923),C=n(2203),P=n(5059),N=["","webkit","moz","ms"],O=M.Z.INACTIVITY_DELAY,D=C.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function L(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 U(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?N:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=L(e,r)),(0,R.Z)(n)?(0,b.R)(e,n):a):T.T.apply(void 0,r.map((function(t){return(0,b.R)(e,t)})))}}function B(){var e,t=document;null!=t.hidden?e="":null!=t.mozHidden?e="moz":null!=t.msHidden?e="ms":null!=t.webkitHidden&&(e="webkit");var n=(0,R.Z)(e)?e+"Hidden":"hidden",r=(0,R.Z)(e)?e+"visibilitychange":"visibilitychange";return(0,E.P)((function(){var e=document[n];return(0,b.R)(document,r).pipe((0,S.U)((function(){return!document[n]})),(0,w.O)(!e),(0,k.x)())}))}function F(){return B().pipe((0,A.w)((function(e){return e?(0,I.of)(e):(0,I.of)(e).pipe(v(O))})))}function z(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function K(e){return(0,E.P)((function(){var t=e;if(!0===t.webkitSupportsPresentationMode&&"function"==typeof t.webkitSetPresentationMode){var n="picture-in-picture"===t.webkitPresentationMode;return(0,b.R)(t,"webkitpresentationmodechanged").pipe((0,S.U)((function(){return{isEnabled:"picture-in-picture"===t.webkitPresentationMode,pipWindow:null}})),(0,w.O)({isEnabled:n,pipWindow:null}))}var r={isEnabled:document.pictureInPictureElement===t,pipWindow:null};return(0,T.T)((0,b.R)(t,"enterpictureinpicture").pipe((0,S.U)((function(e){var t;return{isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null}}))),(0,b.R)(t,"leavepictureinpicture").pipe((0,S.U)((function(){return{isEnabled:!1,pipWindow:null}})))).pipe((0,w.O)(r))}))}function V(e){return(0,Z.a)([B(),e]).pipe((0,A.w)((function(e){var t=e[0];return e[1].isEnabled||t?(0,I.of)(!0):(0,I.of)(!1).pipe(v(O))})),(0,k.x)())}function G(e,t){return(0,Z.a)([t,(0,x.F)(2e4).pipe((0,w.O)(null)),(0,b.R)(window,"resize").pipe(_(500),(0,w.O)(null))]).pipe((0,A.w)((function(t){var n=t[0];if(n.isEnabled){if(null!=n.pipWindow){var r=n.pipWindow,i=z(e,r);return(0,b.R)(r,"resize").pipe((0,w.O)(i*D),(0,S.U)((function(){return z(e,r)*D})))}return(0,I.of)(1/0)}return(0,I.of)(e.clientWidth*D)})),(0,k.x)())}var H=U(["loadedmetadata"]),W=U(["seeking"]),j=U(["seeked"]),q=U(["ended"]),Y=(U(["timeupdate"]),U(["fullscreenchange","FullscreenChange"],N.concat("MS"))),$=function(e){return(0,T.T)(U(["play"])(e),U(["pause"])(e))},X=function(e){return(0,T.T)(U(["addtrack"])(e),U(["removetrack"])(e))},Q=U(["sourceopen","webkitsourceopen"]),J=U(["sourceclose","webkitsourceclose"]),ee=U(["sourceended","webkitsourceended"]),te=U(["update"]),ne=U(["onremovesourcebuffer"]),re=U((0,P.Z)()?["needkey"]:["encrypted","needkey"]),ie=U(["keymessage","message"]),ae=U(["keyadded","ready"]),oe=U(["keyerror","error"]),se=U(["keystatuseschange"])},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return r.G6&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},944:function(e,t){"use strict";t.Z={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,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_SESSION_CLOSING_MAX_RETRY:5,EME_SESSION_CLOSING_INITIAL_DELAY:100,EME_SESSION_CLOSING_MAX_DELAY:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:2,after:2.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}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4578),i=n(1959),a=n(7829);function o(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 s(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:o.language,id:l,normalized:(0,a.ZP)(o.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:o})}return n}function u(e){for(var t,n=[],r={},i=0;i<e.length;i++){var o=e[i],s=""===o.language?"nolang":o.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:o.language,id:l,normalized:(0,a.ZP)(o.language),closedCaption:"captions"===o.kind};n.push({track:c,nativeTrack:o})}return n}function l(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?s(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?l(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?u(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 i.enabled=!0,void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){d(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){p(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e].nativeTrack;if(t===this._audioTrackLockedOn)return void(t.enabled=!0)}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,a.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var o=this._audioTracks[i];if(o.track.normalized===r&&o.track.audioDescription===n.audioDescription)return void(o.nativeTrack.enabled=!0)}}},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 f(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else d(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 d(this._textTracks);for(var r=(0,a.ZP)(n.language),i=0;i<this._textTracks.length;i++){var o=this._textTracks[i];if(o.track.normalized===r&&o.track.closedCaption===n.closedCaption)return f(this._textTracks,o.nativeTrack),void("showing"!==o.nativeTrack.mode&&(o.nativeTrack.mode="showing"))}}d(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=s(e._nativeAudioTracks);if(o(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=s(e._nativeAudioTracks);if(o(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=u(e._nativeTextTracks);if(o(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=u(e._nativeTextTracks);if(o(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=l(e._nativeVideoTracks);if(o(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=l(e._nativeVideoTracks);if(o(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)})},t}(i.Z);function d(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function f(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}}},8281:function(e,t,n){"use strict";n.d(t,{ZP:function(){return tt}});var r=n(3994),i=n(2817),a=n(6362),o=n(8515),s=n(4975),u=n(4727),l=n(2006),c=n(3071),d=n(9127),f=n(3610),p=n(3),v=n(1545),h=n(9878),m=n(533),g=n(8719),y=n(3887),_=n(6490),b=n(4791),T=n(6968),E=n(3635),S=(0,T.pX)((0,E.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,b.Z)(t.data,r.data))return!0}return!1}function k(e){var t=e.initData,n=e.initDataType;return null==t?(y.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,T.pX)(e,n+4)!==S)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,T.pX)(new Uint8Array(e),n);if(n+r>e.length)return y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,_.Y)(i,8),data:i};w(t,a)?y.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(y.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var A=n(9917),I=n(2297),Z=n(8117);function x(e,t,n){return(0,A.P)((function(){var r;y.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){y.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,T.pX)(e,i+4)!==S)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,T.pX)(new Uint8Array(e),i);if(i+a>e.length)throw y.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,I.Xj)(o),u=null===s?void 0:o[s[1]];y.Z.info("Compat: CENC PSSH found with version",u),void 0===u?y.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,T.zo)(n,o):1===u?(y.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):y.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,T.zo)(r,o);i+=a}if(i!==e.length)throw y.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,T.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return(0,Z.Z)(e.generateRequest(i,r)).pipe((0,h.K)((function(t){if(""!==i||!(t instanceof TypeError))throw t;return y.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),(0,Z.Z)(e.generateRequest("cenc",r))})))}))}var M=n(944),R=n(5157),C=n(7714),P=n(7904),N=n(2793),O=n(1946);var D=n(3833),L=n(6108);var U=n(4181),B=n(6625),F=n(5561);function z(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,C.Z)(n,"expired")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,C.Z)(n,"internal-error")?(y.Z.debug("EME: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(y.Z.debug("EME: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function K(e,t,n){return(0,A.P)((function(){var a=e.loadedSessionsStore,o=e.persistentSessionsStore;return"temporary"===n?V(a,t):null===o?(y.Z.warn("EME: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),V(a,t)):function(e,t,n){return(0,A.P)((function(){y.Z.info("EME: Creating persistent MediaKeySession");var a=e.createSession(n,"persistent-license"),o=t.getAndReuse(n);if(null===o)return(0,i.of)({type:"created-session",value:{mediaKeySession:a,sessionType:"persistent-license"}});var s=function(){return y.Z.info("EME: Removing previous persistent session."),null!==t.get(n)&&t.delete(n),e.closeSession(n).pipe((0,d.U)((function(){return{type:"created-session",value:{mediaKeySession:e.createSession(n,"persistent-license"),sessionType:"persistent-license"}}})))};return function(e,t){return(0,A.P)((function(){return y.Z.info("Compat/EME: Load persisted session",t),(0,F.Z)((function(){return(0,Z.Z)(e.load(t))}),void 0)})).pipe((0,r.z)((function(t){return!t||e.keyStatuses.size>0?(0,i.of)(t):(0,U.S)((0,B.H)(100),(0,g.eX)(e)).pipe((0,u.q)(1),(0,d.U)((function(){return t})))})))}(a,o.sessionId).pipe((0,r.z)((function(e){return e?e&&z(a)?(t.add(n,a),y.Z.info("EME: Succeeded to load persistent session."),(0,i.of)({type:"loaded-persistent-session",value:{mediaKeySession:a,sessionType:"persistent-license"}})):(y.Z.warn("EME: Previous persistent session not usable anymore."),s()):(y.Z.warn("EME: No data stored for the loaded session"),t.delete(n),(0,i.of)({type:"created-session",value:{mediaKeySession:a,sessionType:"persistent-license"}}))})),(0,h.K)((function(e){return y.Z.warn("EME: Unable to load persistent session: "+(e instanceof Error?e.toString():"Unknown Error")),s()})))}))}(a,o,t)}))}function V(e,t){return(0,A.P)((function(){y.Z.info("EME: Creating a new temporary session");var n=e.createSession(t,"temporary");return(0,i.of)({type:"created-session",value:{mediaKeySession:n,sessionType:"temporary"}})}))}function G(e,t,n,o){return(0,A.P)((function(){var s=null,u=t.loadedSessionsStore,l=t.persistentSessionsStore,f=u.getAndReuse(e);if(null!==f){if(z(s=f.mediaKeySession))return y.Z.info("EME: Reuse loaded session",s.sessionId),(0,i.of)({type:"loaded-open-session",value:{mediaKeySession:s,sessionType:f.sessionType,initializationData:e}});null!==l&&l.delete(e)}return(null!=s?u.closeSession(e):(0,i.of)(null)).pipe((0,r.z)((function(){return(0,a.z)(function(e,t){if(t<0||t>=e.getLength())return v.E;for(var n=[],r=e.getAll().slice(),i=r.length-t,a=0;a<i;a++){var o=r[a],s=e.closeSession(o.initializationData).pipe((0,D.h)({type:"cleaned-old-session",value:o}),(0,L.O)({type:"cleaning-old-session",value:o}));n.push(s)}return c.T.apply(void 0,n)}(u,o),K(t,e,n).pipe((0,d.U)((function(t){return{type:t.type,value:{mediaKeySession:t.value.mediaKeySession,sessionType:t.value.sessionType,initializationData:e}}}))))})))}))}var H=n(5095),W=n(6139),j=n(6033);var q=n(9252);var Y=n(3666);var $=n(9592),X=M.Z.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,Q=M.Z.EME_KEY_SYSTEMS;function J(e,t,n){var r=t.getConfiguration();if(Y.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 ee(e,t){return(0,A.P)((function(){y.Z.info("EME: Searching for compatible MediaKeySystemAccess");var n=j.Z.getState(e);if(null!=n){var r=J(t,n.mediaKeySystemAccess,n.keySystemOptions);if(null!==r)return y.Z.info("EME: Found cached compatible keySystem"),(0,i.of)({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:r.keySystemAccess,options:r.keySystemOptions}})}var a=t.reduce((function(e,t){var n,r=Q[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=0,n=Object.keys(Q);t<n.length;t++){var r=n[t];if((0,C.Z)(Q[r],e))return r}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return function e(t){if(t>=a.length){var n=new R.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");return(0,f._)((function(){return n}))}if(null==W.N){var r=Error("requestMediaKeySystemAccess is not implemented in your browser.");return(0,f._)((function(){return r}))}var i=a[t],o=i.keyName,s=i.keyType,u=i.keySystemOptions,l=function(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?X:[],o=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?X:[];return 0===a.length&&a.push(void 0),0===o.length&&o.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,$.Z)(a,(function(e){return[{contentType:'video/mp4;codecs="avc1.4d401e"',robustness:e},{contentType:'video/mp4;codecs="avc1.42e01e"',robustness:e},{contentType:'video/webm;codecs="vp8"',robustness:e}]})),audioCapabilities:(0,$.Z)(o,(function(e){return[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:e},{contentType:"audio/webm;codecs=opus",robustness:e}]})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}(o,u);return y.Z.debug("EME: Request keysystem access "+s+","+(t+1)+" of "+a.length,l),(0,W.N)(s,l).pipe((0,d.U)((function(e){return y.Z.info("EME: Found compatible keysystem",s,l),{type:"create-media-key-system-access",value:{options:u,mediaKeySystemAccess:e}}})),(0,h.K)((function(){return y.Z.debug("EME: Rejected access to keysystem",s,l),e(t+1)})))}(0)}))}var te=n(2870),ne=new WeakMap,re=function(e){ne.set(e,null)},ie=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,te.Z)(n);ne.set(e,{hash:r,serverCertificate:n})},ae=function(e){var t=ne.get(e);return void 0!==t&&(null!==t||void 0)},oe=function(e,t){var n=ne.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,te.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};var se=M.Z.EME_SESSION_CLOSING_MAX_RETRY,ue=M.Z.EME_SESSION_CLOSING_INITIAL_DELAY,le=M.Z.EME_SESSION_CLOSING_MAX_DELAY;function ce(e){return function n(a){return y.Z.debug("EME: Trying to close a MediaKeySession",e.sessionId,a),function(e){return(0,U.S)((0,Z.Z)(e.close()),(0,B.H)(1e3).pipe((0,r.z)((function(){return(0,Z.Z)(e.update(new Uint8Array(1))).pipe((0,d.U)((function(){throw new Error("Compat: Couldn't know if session is closed")})),(0,h.K)((function(t){if(t instanceof Error&&"The session is already closed."===t.message)return(0,i.of)(null);var n=(0,Z.Z)(e.closed);return(0,U.S)(n,(0,B.H)(1e3).pipe((0,d.U)((function(){throw new Error("Compat: Couldn't know if session is closed")}))))})))}))))}(e).pipe((0,l.b)((function(){y.Z.debug("EME: Succeeded to close MediaKeySession")})),(0,h.K)((function(i){if(!(i instanceof Error)||"InvalidStateError"!==i.name||""!==e.sessionId)return t(i);var o=a+1;if(o>se)return t(i);var s=Math.min(Math.pow(2,a)*ue,le);return y.Z.warn("EME: attempt to close a mediaKeySession failed, scheduling retry...",s),(0,U.S)([(0,B.H)(s),(0,g.eX)(e),(0,g.GJ)(e)]).pipe((0,u.q)(1),(0,r.z)((function(){return n(o)})))})))}(0);function t(e){return y.Z.error("EME: Could not close MediaKeySession: "+(e instanceof Error?e.toString():"Unknown error")),(0,i.of)(null)}}var de=n(9689),fe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}();function pe(e,t){var n,r;return null!==(r=null!==(n=ve(e,t))&&void 0!==n?n:ve(t,e))&&void 0!==r&&r}function ve(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?fe.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?fe.decode(a.data):a.data.initData;if(!(0,b.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 c=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?fe.decode(u.data):u.data.initData,d=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?fe.decode(l.data):l.data.initData;if(!(0,b.Z)(c,d))return!1;break}}if(r===t.length)return null}return!0}}return null}var he=function(){function e(){this._storage=[]}var t=e.prototype;return t.getAll=function(){return this._storage.map((function(e){return e.payload}))},t.getLength=function(){return this._storage.length},t.isEmpty=function(){return 0===this._storage.length},t.get=function(e){var t=this._findIndex(e);return t>=0?this._storage[t].payload:void 0},t.getAndReuse=function(e){var t=this._findIndex(e);if(-1!==t){var n=this._storage.splice(t,1)[0];return this._storage.push(n),n.payload}},t.store=function(e,t){var n=this._findIndex(e);n>=0&&this._storage.splice(n,1);var r=this._formatValuesForStore(e.values);this._storage.push({type:e.type,values:r,payload:t})},t.storeIfNone=function(e,t){if(this._findIndex(e)>=0)return!1;var n=this._formatValuesForStore(e.values);return this._storage.push({type:e.type,values:n,payload:t}),!0},t.remove=function(e){var t=this._findIndex(e);if(-1!==t)return this._storage.splice(t,1)[0].payload},t._findIndex=function(e){for(var t=this._formatValuesForStore(e.values),n=this._storage.length-1;n>=0;n--){var r=this._storage[n];if(r.type===e.type&&pe(r.values,t))return n}return-1},t._formatValuesForStore=function(e){return e.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,te.Z)(n)}}))},e}(),me=function(){function e(e){this._mediaKeys=e,this._storage=new he}var t=e.prototype;return t.get=function(e){var t=this._storage.get(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.getAndReuse=function(e){var t=this._storage.getAndReuse(e);return void 0===t?null:{mediaKeySession:t.mediaKeySession,sessionType:t.sessionType}},t.reuse=function(e){return void 0!==this._storage.getAndReuse(e)},t.createSession=function(e,t){var n=this;if(void 0!==this._storage.get(e))throw new R.Z("MULTIPLE_SESSIONS_SAME_INIT_DATA","This initialization data was already stored.");var r=this._mediaKeys.createSession(t),i={mediaKeySession:r,sessionType:t,initializationData:e};return(0,O.Z)(r.closed)||r.closed.then((function(){var t=n._storage.get(e);void 0!==t&&t.mediaKeySession===r&&n._storage.remove(e)})).catch((function(e){y.Z.warn("EME-LSS: MediaKeySession.closed rejected: "+e)})),y.Z.debug("EME-LSS: Add MediaKeySession",i.sessionType),this._storage.store(e,i),r},t.closeSession=function(e){var t=this;return(0,A.P)((function(){var n=t._storage.remove(e);return void 0===n?(y.Z.warn("EME-LSS: No MediaKeySession found with the given initData and initDataType"),v.E):ce(n.mediaKeySession)}))},t.getLength=function(){return this._storage.getLength()},t.getAll=function(){return this._storage.getAll()},t.closeAllSessions=function(){var e=this;return(0,A.P)((function(){var t=e._storage.getAll().map((function(e){return ce(e.mediaKeySession)}));return y.Z.debug("EME-LSS: Closing all current MediaKeySessions",t.length),e._storage=new he,(0,a.z)(c.T.apply(void 0,t).pipe((0,m.l)()),(0,i.of)(null))}))},e}(),ge=n(811),ye=n(6923);var _e=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,de.J)(this.initData)},e.decode=function(e){return(0,de.K)(e)},e}(),be=function(){function e(e){!function(e){(0,ge.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{this._entries=this._storage.load(),Array.isArray(this._entries)||(this._entries=[])}catch(e){y.Z.warn("EME-PSS: Could not get entries from license storage",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){if(!(0,O.Z)(t)&&(0,ye.Z)(t.sessionId)){var n=t.sessionId,r=this.get(e);null!==r&&r.sessionId===n||(null!==r&&this.delete(e),y.Z.info("EME-PSS: Add new session",n),this._entries.push({version:3,sessionId:n,values:this._formatValuesForStore(e.values),initDataType:e.type}),this._save())}else y.Z.warn("EME-PSS: Invalid Persisten Session given.")},t.delete=function(e){var t=this._getIndex(e);if(-1!==t){var n=this._entries[t];y.Z.warn("EME-PSS: Delete session from store",n.sessionId),this._entries.splice(t,1),this._save()}else y.Z.warn("EME-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){y.Z.info("EME-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(y.Z.warn("EME-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){for(var t=this._formatValuesForStore(e.values),n=T.zo.apply(void 0,e.values.map((function(e){return e.data}))),r=(0,te.Z)(n),i=0;i<this._entries.length;i++){var a=this._entries[i];if(a.initDataType===e.type)switch(a.version){case 3:if(pe(t,a.values))return i;break;case 2:if(a.initDataHash===r)try{var o="string"==typeof a.initData?_e.decode(a.initData):a.initData.initData;if((0,b.Z)(o,n))return i}catch(e){y.Z.warn("EME-PSS: Could not decode initialization data.",e)}break;case 1:if(a.initDataHash===r){if(void 0===a.initData.length)return i;if((0,b.Z)(a.initData,n))return i}break;default:if(a.initData===r)return i}}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){y.Z.warn("EME-PSS: Could not save licenses in localStorage")}},t._formatValuesForStore=function(e){return e.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:new _e(n),hash:(0,te.Z)(n)}}))},e}();function Te(e,t){return ee(e,t).pipe((0,r.z)((function(t){var n=t.value,r=n.options,a=n.mediaKeySystemAccess,o=j.Z.getState(e),s=function(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new R.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return y.Z.debug("EME: Set the given license storage"),new be(t)}(r);if(null!==o&&"reuse-media-key-system-access"===t.type){var u=o.mediaKeys,l=o.loadedSessionsStore;if(!1===ae(u)||!(0,O.Z)(r.serverCertificate)&&oe(u,r.serverCertificate))return(0,i.of)({mediaKeys:u,mediaKeySystemAccess:a,stores:{loadedSessionsStore:l,persistentSessionsStore:s},options:r})}return function(e){return y.Z.info("EME: Calling createMediaKeys on the MediaKeySystemAccess"),(0,F.Z)((function(){return(0,Z.Z)(e.createMediaKeys())}),void 0).pipe((0,h.K)((function(e){var t=e instanceof Error?e.message:"Unknown error when creating MediaKeys.";throw new R.Z("CREATE_MEDIA_KEYS_ERROR",t)})))}(a).pipe((0,d.U)((function(e){y.Z.info("EME: MediaKeys created with success");var t=new me(e);return{mediaKeys:e,mediaKeySystemAccess:a,stores:{loadedSessionsStore:t,persistentSessionsStore:s},options:r}})))})))}function Ee(e,t){return Te(e,t).pipe((0,r.z)((function(t){var n,a,o=t.mediaKeys,c=t.mediaKeySystemAccess,d=t.stores,f=t.options;((0,O.Z)(f.licenseStorage)||!0===f.licenseStorage.disableRetroCompatibility)&&(a=c.keySystem,n=(0,q.Z)(a,"com.microsoft.playready")||"com.chromecast.playready"===a||"com.youtube.playready"===a?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===a?"edef8ba979d64acea3c827dcd51d21ed":(0,q.Z)(a,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,q.Z)(a,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0);var p=(0,H.Z)(!1),v=null!==e.mediaKeys&&void 0!==e.mediaKeys&&o!==e.mediaKeys,h=(0,i.of)(null);return v&&(y.Z.debug("EME: Disabling old MediaKeys"),h=function(e){return(0,A.P)((function(){return j.Z.setState(e,null),(0,W.Y)(e,null)}))}(e)),h.pipe((0,r.z)((function(){return y.Z.debug("EME: Attaching current MediaKeys"),p.asObservable().pipe((0,s.h)((function(e){return e})),(0,r.z)((function(){var t={loadedSessionsStore:d.loadedSessionsStore,mediaKeySystemAccess:c,mediaKeys:o,keySystemOptions:f};return function(e,t){var n=t.keySystemOptions,a=t.loadedSessionsStore,o=t.mediaKeySystemAccess,s=t.mediaKeys;return(0,A.P)((function(){var t=j.Z.getState(e);return(null!==t&&t.loadedSessionsStore!==a?t.loadedSessionsStore.closeAllSessions():(0,i.of)(null)).pipe((0,r.z)((function(){return j.Z.setState(e,{keySystemOptions:n,mediaKeySystemAccess:o,mediaKeys:s,loadedSessionsStore:a}),e.mediaKeys===s?(0,i.of)(null):(y.Z.info("EME: Attaching MediaKeys to the media element"),(0,W.Y)(e,s).pipe((0,l.b)((function(){y.Z.info("EME: MediaKeys attached with success")}))))})))}))}(e,t)})),(0,u.q)(1),(0,D.h)({type:"attached-media-keys",value:{mediaKeySystemAccess:c,mediaKeys:o,stores:d,options:f}}),(0,L.O)({type:"created-media-keys",value:{mediaKeySystemAccess:c,initializationDataSystemId:n,mediaKeys:o,stores:d,options:f,canAttachMediaKeys:p}}))})))})))}var Se=n(7326),we=n(4578),ke=n(2146),Ae=n(6716),Ie=n(7991),Ze=n(1454),xe=n(6798),Me=n(7878),Re=n(1819),Ce=n(2566),Pe=n(7845),Ne=(0,Re.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Oe(e){throw new Ne(e)}var De=n(278),Le=n(8474);var Ue=n(3505),Be=n(2572);var Fe="expired",ze="internal-error",Ke="output-restricted";function Ve(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(Y.YM||Y.kD)?(0,E.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case Fe:var d=new R.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,E.ci)(c)+")");if(!1!==u)throw d;r.push({type:"warning",value:d}),a.push(c);break;case ze:var f=new R.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,E.ci)(c)+")");if(!0!==s.keyInternalError)throw f;r.push({type:"warning",value:f}),i.push(c);break;case Ke:var p=new R.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,E.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw p;r.push({type:"warning",value:p}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var Ge=g.Xe,He=g.GJ,We=g.eX,je=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Se.Z)(r),t.prototype),r.sessionError=n,r}return(0,we.Z)(t,e),t}((0,ke.Z)(Error));function qe(e,t,n,a){y.Z.info("EME: Binding session events",e.sessionId);var o,s,u=new Ae.x,f=t.getLicenseConfig,p=void 0===f?{}:f,m=Ge(e).pipe((0,d.U)((function(e){throw new R.Z("KEY_ERROR",e.type)}))),g=We(e).pipe((0,r.z)((function(r){return function(e,t,n,r){y.Z.info("EME: keystatuseschange event received",e.sessionId);var i=(0,A.P)((function(){return(0,F.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?v.E:(0,Z.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,d.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=new R.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,O.Z)(e)&&(0,ye.Z)(e.message)&&(t.message=e.message),t})));return(0,c.T)(Ye(e,t,n),i)}(e,t,n,r)}))),_=He(e).pipe((0,r.z)((function(n){var i=new Uint8Array(n.message),o=(0,ye.Z)(n.messageType)?n.messageType:"license-request";y.Z.info("EME: Received message event, type "+o,e.sessionId,n);var s,l,c,f,v,m,g,_,b=(0,A.P)((function(){var e=t.getLicense(i,o),n=(0,O.Z)(p.timeout)?1e4:p.timeout;return(0,Z.Z)(e).pipe(n>=0?function(e,t){var n=(0,Ze.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?Oe:a,s=n.scheduler,u=void 0===s?null!=t?t:Ie.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,xe.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Pe.f)(t,u,(function(){try{n.unsubscribe(),(0,Me.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Ce.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):De.y)})),T=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Ne||(0,O.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:$e(t)})}}}(u,p.retry);return(s=b,l=T,c=l.baseDelay,f=l.maxDelay,v=l.totalRetry,m=l.shouldRetry,g=l.onRetry,_=0,s.pipe((0,h.K)((function(e,t){if(!(0,O.Z)(m)&&!m(e)||_++>=v)throw e;"function"==typeof g&&g(e,_);var n=Math.min(c*Math.pow(2,_-1),f),i=(0,Be.Z)(n);return(0,B.H)(i).pipe((0,r.z)((function(){return t})))})))).pipe((0,d.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,h.K)((function(e){var t=$e(e);if(!(0,O.Z)(e)&&!0===e.fallbackOnLastTry)throw y.Z.warn("EME: Last `getLicense` attempt failed. Blacklisting the current session."),new je(t);throw t})),(0,L.O)({type:"session-message",value:{messageType:o,initializationData:a}}))}))),b=(0,c.T)(_,g).pipe((o=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return function(e,t,n){return(0,O.Z)(t)?(y.Z.info("EME: No message given, skipping session.update"),(0,i.of)({type:"no-update",value:{initializationData:n}})):(y.Z.info("EME: Updating MediaKeySession with message"),(0,Z.Z)(e.update(t)).pipe((0,h.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new R.Z("KEY_UPDATE_ERROR",t)})),(0,l.b)((function(){y.Z.info("EME: MediaKeySession update succeeded.")})),(0,d.U)((function(){return{type:"session-updated",value:{session:e,license:t,initializationData:n}}}))))}(e,t.value.license,a);default:return(0,i.of)(t)}},(0,Le.m)(s)?(0,r.z)(o,s,1):(0,r.z)(o,1))),T=(0,c.T)(Ye(e,t,n),b,m,u);return(0,O.Z)(e.closed)?T:T.pipe((0,Ue.R)((0,Z.Z)(e.closed)))}function Ye(e,t,n){return(0,A.P)((function(){if(0===e.keyStatuses.size)return v.E;var r=Ve(e,t,n),o=r.warnings,s=r.blacklistedKeyIDs,u=r.whitelistedKeyIds,l=o.length>0?i.of.apply(void 0,o):v.E,c=(0,i.of)({type:"keys-update",value:{whitelistedKeyIds:u,blacklistedKeyIDs:s}});return(0,a.z)(l,c)}))}function $e(e){if(e instanceof Ne)return new R.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new R.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,O.Z)(e)&&(0,ye.Z)(e.message)&&(t.message=e.message),t}function Xe(e,t){return(0,A.P)((function(){return"function"!=typeof e.setServerCertificate?(y.Z.warn("EME: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),v.E):!0===ae(e)?(y.Z.info("EME: The MediaKeys already has a server certificate, skipping..."),v.E):(y.Z.info("EME: Setting server certificate on the MediaKeys"),re(e),function(e,t){return(0,A.P)((function(){return(0,F.Z)((function(){return(0,Z.Z)(e.setServerCertificate(t))}),void 0).pipe((0,h.K)((function(e){y.Z.warn("EME: mediaKeys.setServerCertificate returned an error",e);var t=e instanceof Error?e.toString():"`setServerCertificate` error";throw new R.Z("LICENSE_SERVER_CERTIFICATE_ERROR",t)})))}))}(e,t).pipe((0,l.b)((function(){ie(e,t)})),(0,m.l)(),(0,h.K)((function(e){return(0,i.of)({type:"warning",value:e})}))))}))}var Qe=M.Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,Je=M.Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,et=g.Oh;var tt=function(e,t,n){y.Z.debug("EME: Starting EMEManager logic.");var g=new he,_=new he,E=Ee(e,t).pipe((0,r.z)((function(e){if("attached-media-keys"!==e.type)return(0,i.of)(e);var t=e.value,n=t.mediaKeys,r=t.options.serverCertificate;return(0,O.Z)(r)?(0,i.of)(e):(0,a.z)(Xe(n,r),(0,i.of)(e))})),(0,o.d)()),S=E.pipe((0,s.h)((function(e){return"attached-media-keys"===e.type})),(0,u.q)(1)),w=et(e).pipe((0,l.b)((function(){y.Z.debug("EME: Encrypted event received from media element.")})),(0,N.Z)((function(e){return k(e)}),null),(0,o.d)({refCount:!0})),A=n.pipe((0,l.b)((function(){y.Z.debug("EME: Encrypted event received from Player")}))),I=(0,c.T)(A,w).pipe((0,r.z)((function(e){return S.pipe((0,d.U)((function(t){return[e,t]})))})),(0,r.z)((function(e){var t=e[0],n=e[1],a=n.value,o=a.mediaKeySystemAccess,s=a.stores,u=a.options,l=_.get(t);if(void 0!==l){if(void 0===t.type){y.Z.error("EME: The current session has already been blacklisted but the current content is not known. Throwing.");var E=l.sessionError;return E.fatal=!0,(0,f._)((function(){return E}))}return y.Z.warn("EME: The current session has already been blacklisted. Blacklisting content."),(0,i.of)({type:"blacklist-protection-data",value:t})}var S,w=new p.t(1);if("content"===u.singleLicensePer&&!g.isEmpty()){var k=t.keyIds;if(void 0===k)return y.Z.warn("EME: Initialization data linked to unknown key id, we'll not able to fallback from it."),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}});var A=g.getAll()[0];return A.lastKeyUpdate$.pipe((0,r.z)((function(e){return k.every((function(t){for(var n=0;n<e.whitelistedKeyIds.length;n++)if((0,b.Z)(e.whitelistedKeyIds[n],t))return!0}))?(n.value.stores.loadedSessionsStore.reuse(A.initializationData),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}})):(0,i.of)({type:"keys-update",value:{blacklistedKeyIDs:k,whitelistedKeyIds:[]}})})))}if(!g.storeIfNone(t,{initializationData:t,lastKeyUpdate$:w}))return y.Z.debug("EME: Init data already received. Skipping it."),(0,i.of)({type:"init-data-ignored",value:{initializationData:t}});!0!==u.persistentLicense?S="temporary":!function(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,C.Z)(t,"persistent-license")}(o)?(y.Z.warn('EME: Cannot create "persistent-license" session: not supported'),S="temporary"):S="persistent-license";var I="number"==typeof u.maxSessionCacheSize?u.maxSessionCacheSize:Qe;return G(t,s,S,I).pipe((0,r.z)((function(e){switch(e.type){case"cleaning-old-session":return g.remove(e.value.initializationData),v.E;case"cleaned-old-session":return v.E;case"created-session":case"loaded-open-session":case"loaded-persistent-session":break;default:(0,P.Z)(e)}var n=e.value,r=n.mediaKeySession,a=n.sessionType,l=!1,f=T.zo.apply(void 0,t.values.map((function(e){return e.data}))),p="created-session"!==e.type?v.E:x(r,t.type,f).pipe((0,h.K)((function(e){throw new R.Z("KEY_GENERATE_REQUEST_ERROR",e instanceof Error?e.toString():"Unknown error")})),(0,m.l)());return(0,c.T)(qe(r,u,o.keySystem,t),p).pipe((0,d.U)((function(e){if("keys-update"!==e.type)return e;var n=t.keyIds;if(void 0!==n&&"init-data"!==u.singleLicensePer){var i,o=n.filter((function(t){return!e.value.whitelistedKeyIds.some((function(e){return(0,b.Z)(e,t)}))&&!e.value.blacklistedKeyIDs.some((function(e){return(0,b.Z)(e,t)}))}));if(o.length>0)(i=e.value.blacklistedKeyIDs).push.apply(i,o)}if(w.next(e.value),0===e.value.whitelistedKeyIds.length&&0===e.value.blacklistedKeyIDs.length||"temporary"===a||null===s.persistentSessionsStore||l)return e;var c=s.persistentSessionsStore;return function(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;y.Z.info("EME: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}(c,Je-1),c.add(t,r),l=!0,e})),(0,h.K)((function(e){if(!(e instanceof je))throw e;_.store(t,e);var n=e.sessionError;if(void 0===t.type)throw y.Z.error("EME: Current session blacklisted and content not known. Throwing."),n.fatal=!0,n;return y.Z.warn("EME: Current session blacklisted. Blacklisting content."),(0,i.of)({type:"warning",value:n},{type:"blacklist-protection-data",value:t})})))})))})));return(0,c.T)(E,w.pipe((0,d.U)((function(e){return{type:"encrypted-event-received",value:e}}))),I)}},6033: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)}}},4507:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(3071),i=n(9127),a=n(2817),o=n(6139);var s=n(8719),u=n(5157),l=n(7874),c=n(3887),d=s.Oh;function f(e,t,n){var s=(0,r.T)(d(e),n);return null==l.Z.emeManager?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),(0,a.of)({type:"eme-disabled"})):0===t.length?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),(0,a.of)({type:"eme-disabled"})):"function"!=typeof o.N?(0,r.T)(s.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),(0,a.of)({type:"eme-disabled"})):(c.Z.debug("Init: Creating EMEManager"),l.Z.emeManager(e,t,n))}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(3994),d=n(6108),f=n(6362),p=n(9917),v=n(8117),h=n(5561);var m=n(3774),g=n(8719);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,p.P)((function(){return(0,h.Z)((function(){return(0,v.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$)(!1),p=(0,T.$)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){b.Z.info("Init: Set initial time",r);var e="function"==typeof r?r():r;n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.observe(!0));var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.observe(!0)).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(p.setValue(!0),p.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),p.setValue(!0),p.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:p,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(3994),i=n(1545),a=n(5583),o=n(533),s=n(4975),u=n(4727),l=n(4978),c=n(2817),d=n(3071),f=n(1480),p=n(3887),v=n(5767);var h=n(8333),m=n(4507),g=n(5039),y=n(7920),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,v.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var I=function(e,t){return new f.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,v.Z)(e)}}))}(E,A);p.Z.debug("Init: Calculating initial time");var Z=function(){return function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return p.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(E,k)};p.Z.debug("Init: Initial time calculated:",Z);var x=(0,y.Z)({mediaElement:E,playbackObserver:S,startTime:Z,mustAutoPlay:t}).seekAndPlay$,M=I.pipe((0,r.z)((function(){return(0,m.Z)(E,n,i.E)})),(0,h.Z)(),(0,a.B)()),R=(0,b.Z)(E),C=S.observe(!0),P=(0,T.Z)(E,w,C).pipe((0,o.l)()),N=(0,_.Z)(S,null,i.E,i.E),O=M.pipe((0,s.h)((function(e){return"created-media-keys"===e.type?(e.value.canAttachMediaKeys.setValue(!0),!0):"eme-disabled"===e.type||"attached-media-keys"===e.type})),(0,u.q)(1),(0,r.z)((function(){return x})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,g.Z)(C,E,null,!0)})));return(0,d.T)(O,M,R,P,N)}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(944),d=n(3714),f=n(3887),p=n(2829),v=n(8567),h=c.Z.BUFFER_DISCONTINUITY_THRESHOLD,m=c.Z.FORCE_DISCONTINUITY_SEEK_DELAY,g=c.Z.FREEZING_STALLED_DELAY,y=c.Z.UNFREEZING_SEEK_DELAY,_=c.Z.UNFREEZING_DELTA_POSITION,b=1/60;function T(e,t,n,c){var d,T=c.pipe((0,r.M)(e.observe(!0)),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return E(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return E(t)&&e.splice(a,0,t),e;E(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),w=null,k=null,A=n.pipe((0,r.M)(e.observe(!0)),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),I=e.observe(!0).pipe((0,r.M)(T),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,c=r.freezing;if(null!==c){var T=performance.now();if(T-(null===d?c.timestamp:d.attemptTimestamp)>y&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+_),d={attemptTimestamp:T}),T-c.timestamp>g)return{type:"stalled",value:"freezing"}}else d=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var E="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)w=r.position;else if(null!==w){var A=performance.now();if(null===k&&(k=A),l&&r.position<w&&A-k<m)return{type:"stalled",value:E};w=null}if(k=null,null===t)return{type:"stalled",value:E};var I=u.position;if(null!==I){var Z=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-b)if(null===d){var p=t.getPeriodAfter(a);null!==p?o=p.start+b:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+b&&(o=d+b);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,I);if(null!==Z){var x=Z+.001;if(!(x<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,x),e.setCurrentTime(x),v.Z.warning(S(I,x));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),x)}}var M=null!=I?I:o,R=(0,p.XS)(a,M);if(R<h){var C=M+R+b;if(e.getCurrentTime()<C)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",M,C,h),e.setCurrentTime(C),v.Z.warning(S(M,C))}for(var P=t.periods.length-2;P>=0;P--){var N=t.periods[P];if(void 0!==N.end&&N.end<=M){if(t.periods[P+1].start>M&&t.periods[P+1].start>e.getCurrentTime()){var O=t.periods[P+1];return e.setCurrentTime(O.start),v.Z.warning(S(M,O.start))}break}}return{type:"stalled",value:E}})));return(0,u.T)(A,I)}function E(e){return null!==e.discontinuity}function S(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2401),i=n(3994),a=n(3714);function o(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){switch(null==e.error?0:e.error.code){case 1:throw new a.Z("MEDIA_ERR_ABORTED","The fetching of the associated resource was aborted by the user's request.");case 2:throw new a.Z("MEDIA_ERR_NETWORK","A network error occurred which prevented the media from being successfully fetched");case 3:throw new a.Z("MEDIA_ERR_DECODE","An error occurred while trying to decode the media resource");case 4:throw new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED","The media resource has been found to be unsuitable.");default:throw new a.Z("MEDIA_ERR_UNKNOWN","The HTMLMediaElement errored due to an unknown reason.")}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,c=u.end,d=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,p=null!==(r=s[1])&&void 0!==r?r:1/0,v=l/d,h=c/d,m=Math.max(f,v),g=Math.min(p,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),p=n(9917),v=n(8719),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(944),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var I=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(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=w(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}for(s.cues=w(s.cues,t),s.end=t,s=r[o+1];void 0!==s&&n>s.end;)r.splice(o,1),s=r[o];return void a(o)}}r.push(i)},e}();function Z(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var p=s.getAttribute("data-proportional-top");null===p||isNaN(+p)||(s.style.top=String(+p*i[1])+"px");var v=s.getAttribute("data-proportional-padding-top");null===v||isNaN(+v)||(s.style.paddingTop=String(+v*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 x=v.C1,M=v.ik,R=v.d5,C=_.Z.MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,P=_.Z.TEXT_TRACK_SIZE_CHECKS_INTERVAL;function N(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function O(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 D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new I,r._currentCues=[],function(e){var t=R(e),n=M(e),r=x(e),f=(0,i.T)(n,r),p=(0,a.F)(C).pipe((0,o.O)(null));return f.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(p.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=Math.max(r._videoElement.currentTime+C/1e3/2,0),n=r._buffer.get(t);0===n.length?r._disableCurrentCues():r._displayCues(n)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,p.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,p.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,p.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;g.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,c=o.end,d=o.data,f=o.type,p=o.language,v=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a),a}(f,d,i,p);if(0!==v&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=v;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<v;)m[y].start=v,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(v,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){g.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._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)N(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._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)N(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=O(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));s.length>0&&function(e,t){return(0,p.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))}(this._textTrackElement,P).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];Z(t,n,i.resolution,i.element)}}))}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.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){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new c.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,c=u.appendWindow,f=u.chunk,p=f.start,v=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=d.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==p)i=Math.max(y,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==v)o=Math.min(_,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.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){s.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){s.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 a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return S},f:function(){return T}});var r=n(944),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t,n){var r=performance.now();this._history.push({date:r,bufferedStart:t,bufferedEnd:n,context:e}),this._cleanHistory(r)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=r.Z.BUFFERED_HISTORY_RETENTION_TIME,p=r.Z.BUFFERED_HISTORY_MAXIMUM_ENTRIES,v=r.Z.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,h=r.Z.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE,m=r.Z.MINIMUM_SEGMENT_SIZE;function g(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t;return Math.abs(t-e.bufferedStart)<=v&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(h,n/3))}function y(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,r=n-t;return Math.abs(n-e.bufferedEnd)<=v&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-r)<=Math.min(h,r/3)}function _(e,t,n,r){void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",r,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&g(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",r,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=v)?(i.Z.debug("SI: buffered start is end of previous segment",r,t,e.start,n.end),e.bufferedStart=n.end,g(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=v?(i.Z.debug("SI: found true buffered start",r,t,e.start),e.bufferedStart=t,g(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",r,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",r,e.bufferedStart,t),e.bufferedStart=t)}function b(e,t,n){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<=v&&y(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<=v?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,y(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 T,E=function(){function e(){this._inventory=[],this._bufferedHistory=new l(f,p)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,r=t[0],a=null==r?void 0:r.infos.adaptation.type,s=e.length,u=0;u<s;u++){if(void 0===r)return;var l=e.start(u),c=e.end(u);if(c-l<m)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",a,l,c);else{for(var d=n;void 0!==r&&(0,o.Z)(r.bufferedEnd,r.end)-l<m;)r=t[++n];var f=null,p=n-d;if(p>0){var v=t[d+p-1];f={end:(0,o.Z)(v.bufferedEnd,v.end),precizeEnd:v.precizeEnd},i.Z.debug("SI: "+p+" segments GCed.",a),t.splice(d,p),n=d}if(void 0===r)return;if(c-(0,o.Z)(r.bufferedStart,r.start)>=m){if(_(r,l,f,a),n===t.length-1)return void b(r,c,a);r=t[++n];for(var h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end),y=u<s-1?e.start(u+1):void 0;void 0!==r&&c-h>=m&&(void 0===y||c-h>=g-y);){var T=t[n-1];void 0===T.bufferedEnd&&(T.bufferedEnd=r.precizeStart?r.start:T.end,i.Z.debug("SI: calculating buffered end of contiguous segment",a,T.bufferedEnd,T.end)),r.bufferedStart=T.bufferedEnd,void 0!==(r=t[++n])&&(h=(0,o.Z)(r.bufferedStart,r.start),g=(0,o.Z)(r.bufferedEnd,r.end))}}var E=t[n-1];void 0!==E&&b(E,c,a)}}null!=r&&(i.Z.debug("SI: last segments have been GCed",a,n,t.length),t.splice(n,t.length-n)),void 0!==a&&"DEBUG"===i.Z.getLevel()&&i.Z.debug("SI: current "+a+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,p=n[d],v=void 0;if(void 0===p)v=o(l.infos),n[d]=((c={})[f]=v,c);else void 0===p[f]?(v=o(l.infos),p[f]=v):v=p[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+v+"|":a===v?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+v+"|",i=l,a=v}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.start,s=e.end;if(!a.isInit){var u=n.type;if(o>=s)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",u,o,s);else{for(var l=this._inventory,c={partiallyPushed:!0,splitted:!1,start:o,end:s,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},d=l.length-1;d>=0;d--){var f=l[d];if(f.start<=o){if(f.end<=o){for(i.Z.debug("SI: Pushing segment strictly after previous one.",u,o,f.end),this._inventory.splice(d+1,0,c),d+=2;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}if(f.start===o){if(f.end<=s){for(i.Z.debug("SI: Segment pushed replace another one",u,o,s,f.end),this._inventory.splice(d,1,c),d+=1;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",u,o,s,f.end),l.splice(d,0,c),f.start=c.end,f.bufferedStart=void 0,void(f.precizeStart=f.precizeStart&&c.precizeEnd)}if(f.end<=c.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",u,o,s,f.start,f.end),this._inventory.splice(d+1,0,c),f.end=c.start,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&c.precizeStart,d+=2;d<l.length&&l[d].start<c.end;){if(l[d].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[d].start),l[d].start=c.end,l[d].bufferedStart=void 0,void(l[d].precizeStart=l[d].precizeStart&&c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[d].start,l[d].end),l.splice(d,1)}return}i.Z.debug("SI: Segment pushed is contained in a previous one",u,o,s,f.start,f.end);var p={partiallyPushed:f.partiallyPushed,splitted:!0,start:c.end,end:f.end,precizeStart:f.precizeStart&&f.precizeEnd&&c.precizeEnd,precizeEnd:f.precizeEnd,bufferedStart:void 0,bufferedEnd:f.end,infos:f.infos};return f.end=c.start,f.splitted=!0,f.bufferedEnd=void 0,f.precizeEnd=f.precizeEnd&&c.precizeStart,l.splice(d+1,0,c),void l.splice(d+2,0,p)}}var v=this._inventory[0];if(void 0===v)return i.Z.debug("SI: first segment pushed",u,o,s),void this._inventory.push(c);if(!(v.start>=s)){if(v.end<=s){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",u,o,s,v.start,v.end),this._inventory.splice(0,1,c);l.length>1&&l[1].start<c.end;){if(l[1].end>c.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",u,c.end,l[1].start),l[1].start=c.end,l[1].bufferedStart=void 0,void(l[1].precizeStart=c.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",u,o,s,l[1].start,l[1].end),l.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",u,o,s,v.start,v.end),v.start=s,v.bufferedStart=void 0,v.precizeStart=c.precizeEnd,void this._inventory.splice(0,0,c)}i.Z.debug("SI: Segment pushed comes before all previous ones",u,o,s,v.start),this._inventory.splice(0,0,c)}}},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),r[0].splitted=!0));var u=o;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);)o++;var l=o-1,d=l-u,f=n[l].end,p=n[l].bufferedEnd;d>0&&(this._inventory.splice(u+1,d),o-=d),this._inventory[u].partiallyPushed=!1,this._inventory[u].end=f,this._inventory[u].bufferedEnd=p,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e);else{this.synchronizeBuffered(t);for(var v,h=c(r);!(v=h()).done;){var m=v.value;void 0!==m.bufferedStart&&void 0!==m.bufferedEnd?this._bufferedHistory.addBufferedSegment(m.infos,m.bufferedStart,m.bufferedEnd):i.Z.debug("SI: buffered range not known after sync. Skipping history.",m)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),S=function(){function e(){this._segmentInventory=new E}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(T||(T={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t){"use strict";var n={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e){return{type:"encryption-data-encountered",value:e}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=n},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){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{ZB:function(){return r},br:function(){return i},SM:function(){return a}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,s.xhr=o,s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,emeManager:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return d},Z:function(){return f}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791),c=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n=this.getAllEncryptionData(),r=[],i=0;i<n.length;i++)for(var a=!1,o=n[i],s=0;s<o.values.length;s++)if(o.values[s].systemId.toLowerCase()===e.toLowerCase())if(a)r[r.length-1].values.push(o.values[s]);else{var u=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds.map((function(e){return e.keyId}));r.push({type:o.type,keyIds:u,values:[o.values[s]]}),a=!0}return r},t.getAllEncryptionData=function(){var e;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:t,values:e.values}}))},t._addProtectionData=function(e,t){var n=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:[],initData:[{type:e,values:t}]},!0;for(var r=this.contentProtections.initData,i=0;i<r.length;i++)if(r[i].type===e){for(var a=r[i].values,o=0;o<t.length;o++){var s=t[o],c=void 0;for(c=0;c<a.length;c++)if(s.systemId===a[c].systemId){if((0,l.Z)(s.data,a[c].data))break;u.Z.warn("Manifest: different init data for the same system ID")}c===a.length&&(a.push(s),n=!0)}return n}return this.contentProtections.initData.push({type:e,values:t}),!0},e}(),d=["audio","video","text","image"],f=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.isTrickModeTrack=t.isTrickModeTrack,this.type=t.type,void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,d=[],f=!1,p=0;p<l.length;p++){var v=new c(l[p],{type:this.type});((0,i.Z)(s)||s(v,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(d.push(v),!f&&v.isSupported&&(f=!0))}d.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=d,this.isSupported=f,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(4791),s=n(3274),u=n(1959),l=n(908),c=n(8806),d=n(8999),f=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 d.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,f.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,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}))},e}(),v=n(3887),h=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){v.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){v.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var m=n(5138);function g(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),o=function(e){var t=i[e],o=(0,s.Z)(a,(function(e){return e.id===t.id}));if(void 0===o)v.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=o.representations,c=function(e){var t=u[e],i=(0,s.Z)(l,(function(e){return e.id===t.id}));void 0===i?v.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)o(u)}var y=(0,l.Z)(),_=(0,l.Z)();function b(e,t){for(var n=[],r=0;r<e.periods.length;r++)for(var i=e.periods[r],a=i.getAdaptations(),o=0;o<a.length;o++)for(var s=a[o],u=s.representations,l=0;l<u.length;l++){var c=u[l],d=t(c);d!==c.decipherable&&(n.push({manifest:e,period:i,adaptation:s,representation:c}),c.decipherable=d)}return n}var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=_(),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=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,s.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,s.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},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.getMinimumPosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.absoluteMinimumTime)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.value+a/1e3}else r=i.value;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.absoluteMinimumTime)&&void 0!==t?t:0,o)},n.getMaximumPosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.value;var t=performance.now()-e.time;return e.value+t/1e3},n.updateDeciperabilitiesBasedOnKeyIds=function(e){var t=e.whitelistedKeyIds,n=e.blacklistedKeyIDs,r=b(this,(function(e){if(!1===e.decipherable||void 0===e.contentProtections)return e.decipherable;for(var r=e.contentProtections.keyIds,i=0;i<r.length;i++){for(var a=r[i],s=0;s<n.length;s++)if((0,o.Z)(n[s],a.keyId))return!1;for(var u=0;u<t.length;u++)if((0,o.Z)(t[u],a.keyId))return!0}return e.decipherable}));r.length>0&&this.trigger("decipherabilityUpdate",r)},n.addUndecipherableProtectionData=function(e){var t=b(this,(function(t){var n,r;if(!1===t.decipherable)return!1;for(var i=null!==(r=null===(n=t.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(t){if((void 0===e.type||i[t].type===e.type)&&e.values.every((function(e){return i[t].values.some((function(t){return(void 0===e.systemId||t.systemId===e.systemId)&&(0,o.Z)(t.data,e.data)}))})))return{v:!1}},s=0;s<i.length;s++){var u=a(s);if("object"==typeof u)return u.v}return t.decipherable}));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-"+y(),o="gen-image-rep-"+y(),s=new d.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new h({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.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:[];return e.concat(c.map((function(e){var n="gen-text-ada-"+y(),s="gen-text-rep-"+y(),u=new d.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new h({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var c=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(c)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){g(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)v.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");g(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),g(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumPosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(u.Z)},520:function(e,t,n){"use strict";n.d(t,{z:function(){return i},K:function(){return a}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{iz:function(){return u},t_:function(){return o},lp:function(){return s},Qy:function(){return l},Xj:function(){return d},nR:function(){return c}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n=l(e,t);return null!==n?e.subarray(n[1],n[2]):null}function s(e,t){for(var n=[],r=e;;){var a=l(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 u(e,t){var n=l(e,t);return null!==n?e.subarray(n[0],n[2]):null}function l(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 c(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function d(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,{XA:function(){return i},uq:function(){return a},Le:function(){return o},fs:function(){return s},E3:function(){return u}});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){return r.Z.warn("ISOBMFF:",e),a}if(null==s)return a;var l=i(n,s[0],s[2]),c=u(l,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:l}),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,{LD:function(){return h},Qx:function(){return f},MM:function(){return v},Wf:function(){return d},J6:function(){return m},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var p=(0,i.pX)(e,o);o+=4;var v=2147483647&p;if(1===(2147483648&p)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+v-1]}),l+=h,r+=v}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function p(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 v(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var v=(0,i.QI)(c,d);d+=3;var h=(256&v)>0,m=0;if(!h&&void 0===(m=p(o)))return;var g=(1&v)>0,y=(4&v)>0,_=(512&v)>0,b=(1024&v)>0,T=(2048&v)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,p=d.string;c=f;var v=(0,a.DM)(o,c),h=v.end,m=v.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:p,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var p=(0,i.uR)(e.subarray(t,t+4));t+=4;var v=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:p,width:v,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=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,p=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,v=u.map((function(e){return e.url})),h=(0,s.k6)(v,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:p,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(v,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(e.timeline[0].start,e)},t.getLastPosition=function(){var e=this._index.timeline;if(0===e.length)return null;var t=e[e.length-1],n=(0,i.jH)(t,null,this._scaledPeriodEnd);return(0,i.zG)(n,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,p=e.mediaURLs,v=e.startNumber,h=null!=v?v:1,m=[],g=d.length,y=d.length>0&&null!=d[0].duration?d[0].duration:0,_=0;_<g;_++){var b=d[_],T=b.duration,E=b.start,S=b.range;y=Math.max(y,T);for(var w=(0,r.KF)(b,d[_+1],o),k=!1!==e.availabilityTimeComplete||_!==g-1&&0!==w,A=(s=T,u=void 0,(u=l-E)>0?Math.floor(u/s):0),I=E+A*T;I<c&&A<=w;){var Z=h+A,x=null===p?null:p.map((0,i.QB)(I,Z)),M=I-e.indexTimeOffset,R={id:String(I),time:M/f,end:(M+T)/f,duration:T/f,isInit:!1,range:S,timescale:1,mediaURLs:x,number:Z,timestampOffset:-e.indexTimeOffset/f,complete:k,privateInfos:{isEMSGWhitelisted:a}};m.push(R),I=E+ ++A*T}if(I>=c)return m;h+=w+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{k6:function(){return o},QB:function(){return u}});var r=n(6923),i=n(9829);function a(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 o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,a(void 0===n?0:n))}function u(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 a(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 a(e)(t,n,r)}))}}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return je}});var r=n(7904),i=n(1946),a=n(944),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return;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 previous one to calculate last position");if(null!==s)return null!==a?Math.min(a,s):s;if(null!==a)return a}}}function f(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function p(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=f(r);if(void 0===u)return;a=u}if(void 0!==i){var l=f(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}}}var v=n(9592),h=n(908),m=n(1679),g=n(3635);var y=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),_=n(7714),b=n(6923),T=n(8999);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(T.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,p=E(d);!(f=p()).done;){var v=f.value;v.id===l&&(void 0===v.trickModeTracks&&(v.trickModeTracks=[]),v.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,_.Z)(T.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,_.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var p=i(d,r);if(void 0!==p)return p}if(void 0!==f){var v=a(f);if(void 0!==v)return v}}}var I=n(8026);var Z=n(7403),x=n(3911),M=n(1915),R=n(4784),C=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.representationBaseURLs,a=t.representationId,o=t.representationBitrate,s=t.isEMSGWhitelisted;this._isEMSGWhitelisted=s,this._periodStart=r;var u=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,l=null!==(n=e.timescale)&&void 0!==n?n:1,c=u-r*l,d=i.map((function(e){return e.url})),f=e.list.map((function(e){return{mediaURLs:(0,R.k6)(d,e.media,a,o),mediaRange:e.mediaRange}}));this._index={list:f,timescale:l,duration:e.duration,indexTimeOffset:c,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,R.k6)(d,e.initialization.media,a,o),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,x.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],p=Math.floor(l/r);p<=d;){var v=i[p].mediaRange,h=i[p].mediaURLs,m=p*o+this._periodStart,g={id:String(p),time:m,isInit:!1,range:v,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),p++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e=this._index,t=e.duration;return e.list.length*t/e.timescale+this._periodStart},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),N=n(8232),O=n(1091),D=n(5505),L=n(6394),U=a.Z.DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR;function B(e,t,n){return t+U*e>=n}function F(e,t,n,r){var a=e.start,s=e.duration,u=e.repeatCount;return void 0===a&&(null===t?a=r:(0,i.Z)(t.duration)||(a=t.start+t.duration*(t.repeatCount+1))),void 0!==s&&!isNaN(s)||null===n||void 0===n.start||isNaN(n.start)||void 0===a||isNaN(a)||(s=n.start-a),void 0===a||isNaN(a)||void 0===s||isNaN(s)||void 0!==u&&isNaN(u)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:a,duration:s,repeatCount:void 0===u?0:u}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function K(e,t){for(var n=[],r=0;r<e.length;r++)n.push(z(e[r]));for(var i=[],a=0;a<n.length;a++){var o=F(n[a],void 0===i[i.length-1]?null:i[i.length-1],void 0===n[a+1]?null:n[a+1],t);null!=o&&i.push(o)}return i}function V(e,t,n){var r,i=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var p=l.getAttribute("r"),v=null===p?null:parseInt(p,10);if(null!==v){if(Number.isNaN(v)||v<0)return null;if(v>0){var h=n-c;if(h%f==0&&h/f<=v)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(v+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===i)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),K(e,n);var a=i.prevSegmentsIdx,s=i.newElementsIdx,u=i.repeatNumberInPrevSegments,l=i.repeatNumberInNewElements,c=t.length-a+s-1;if(c>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),K(e,n);var d=t.slice(a);if(u>0){var f=d[0];f.start+=f.duration*u,d[0].repeatCount-=u}if(l>0&&0!==s)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),K(e,n);var p=d[d.length-1],v=z(e[c]),h=(null!==(r=v.repeatCount)&&void 0!==r?r:0)-l;if(v.duration!==p.duration||p.repeatCount>h)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),K(e,n);void 0!==v.repeatCount&&v.repeatCount>p.repeatCount&&(p.repeatCount=v.repeatCount);for(var m=[],g=[],y=c+1;y<e.length;y++)g.push(z(e[y]));for(var _=0;_<g.length;_++){var b=F(g[_],void 0===m[m.length-1]?p:m[m.length-1],void 0===g[_+1]?null:g[_+1],n);null!==b&&m.push(b)}return d.concat(m)}var G=a.Z.MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY,H=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.manifestBoundsCalculator,u=n.isDynamic,l=n.representationBaseURLs,c=n.representationId,d=n.representationBitrate,f=n.periodStart,p=n.periodEnd,v=n.isEMSGWhitelisted,h=null!==(r=t.timescale)&&void 0!==r?r:1,m=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-f*h;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=v,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=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var g=l.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:m,initialization:null==t.initialization?void 0:{mediaURLs:(0,R.k6)(g,t.initialization.media,c,d),range:t.initialization.range},mediaURLs:(0,R.k6)(g,t.media,c,d),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:h},this._scaledPeriodStart=(0,x.gT)(f,this._index),this._scaledPeriodEnd=null==p?void 0:(0,x.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.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,L.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,x.zG)(e[0].start,this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodStart);return null===t?null:(0,x.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,x._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},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},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,D.Z)(this._index.timeline,e._index.timeline),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate},t.isFinished=function(){if(!this._isDynamic)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,x.jH)(t,null,this._scaledPeriodEnd);return B(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,x.gT)(e,this._index);(0,N.Z)(this._index.timeline,t)}},e.getIndexEnd=function(e,t){return e.length<=0?null:(0,x.jH)(e[e.length-1],null,t)},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,t=this._parseTimeline();return this._parseTimeline=null,null===this._unsafelyBaseOnPreviousIndex||t.length<G?K(t,this._scaledPeriodStart):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(e=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=e):e=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,V(t,e,this._scaledPeriodStart))},e}(),W=a.Z.MINIMUM_SEGMENT_SIZE,j=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,p=null!==(n=e.timescale)&&void 0!==n?n:1,v=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+v,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*p;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:p,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,R.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,R.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=null==s?void 0:(s-u)*p,this._isEMSGWhitelisted=f}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.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var p=Math.max(d,l),v=Math.min(f,c);if(v+r<=p)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(p/r),y=g*r;y<=v;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,R.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e=this._getLastSegmentStart();return null==e?e:(e+this._index.duration)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var a=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+a-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var o=(i-this._periodStart)*r;if(o<0)return null;var s=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+a)*r,u=Math.floor((o+s)/n);return u<=0?null:(u-1)*n}var l=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,c=Math.ceil(l/n)-1,d=c*n;return l-d>W*r||0===c?d:(c-1)*n},e}();function q(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function Q(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,p=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),v=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=q(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,p=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:p};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new Z.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new C(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=I.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=H.isTimelineIndexArgument(T)?new H(T,m):new j(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new Z.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new C(w,m)}else i=new j({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:v,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:p})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0&&e.keyIds.push({keyId:t.attributes.keyId,systemId:n}),void 0!==n){for(var r,i=[],a=Y(t.children.cencPssh);!(r=a()).done;){var o=r.value;i.push({systemId:n,data:o})}if(i.length>0){var u,l=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===l)e.initData.push({type:"cenc",values:i});else(u=l.values).push.apply(u,i)}}return e}),{keyIds:[],initData:[]});(Object.keys(T.initData).length>0||T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=X({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=Y(e);!(l=f()).done;)d();return c}function J(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 ee(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 ee(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 ee(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){if(null==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 ne(e){return null!=e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function re(e){return null!=e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ie(e,t){if((0,b.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,b.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,b.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,b.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,b.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,b.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ae(e){if(null!=e.children.supplementalProperties)for(var t,n=J(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 oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ue=(0,h.Z)();function le(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,h=new y({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||h.setLastPosition(t.duration);for(var T=function(y){var T=e[y],E=t.xlinkInfos.get(T),S=q(t.baseURLs,T.children.baseURLs),k=d[y],I=k.periodStart,Z=k.periodDuration,x=k.periodEnd,M=void 0;for(null==T.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),M="gen-dash-period-"+ue()):M=T.attributes.id;c.some((function(e){return e.id===M}));)M+="-dup";var R=void 0!==E?E.receivedTime:t.receivedTime,C=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(M))&&void 0!==r?r:null,P=null===(i=T.attributes.availabilityTimeComplete)||void 0===i||i,N=null!==(a=T.attributes.availabilityTimeOffset)&&void 0!==a?a:0,O={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:P,availabilityTimeOffset:N,baseURLs:S,manifestBoundsCalculator:h,end:x,isDynamic:f,manifestProfiles:t.manifestProfiles,receivedTime:R,segmentTemplate:T.children.segmentTemplate,start:I,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:C},D=function(e,t){var n,r,i,a,u,l,c,d={},f=[],p={},v=[],h={};e.sort((function(e,t){var n,r,i=null!==(n=e.attributes.selectionPriority)&&void 0!==n?n:1;return(null!==(r=t.attributes.selectionPriority)&&void 0!==r?r:1)-i}));for(var m,g=J(e);!(m=g()).done;){var y=m.value,T=y.children,E=T.essentialProperties,S=T.roles,k=Array.isArray(S)&&S.some((function(e){return"main"===e.value}))&&S.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),I=y.children.representations,Z=null!==(n=y.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,x=(null!==(r=y.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,M=y.attributes.mimeType,R=y.attributes.codecs,C=A(I,(0,b.Z)(M)?M:null,(0,b.Z)(R)?R:null,null!=T.roles?T.roles:null);if(void 0!==C){var P=y.attributes.id,N=void 0,O=ae(y),D=[];void 0!==t.segmentTemplate&&D.push(t.segmentTemplate),void 0!==y.children.segmentTemplate&&D.push(y.children.segmentTemplate);var L={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:Z,availabilityTimeOffset:x,baseURLs:q(t.baseURLs,T.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:D,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},U=Array.isArray(E)?(0,s.Z)(E,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,B=null===(i=null==U?void 0:U.value)||void 0===i?void 0:i.split(" "),F=void 0!==B;if("video"===C&&k&&void 0!==d.video&&d.video.length>0&&void 0!==h.video&&!F){var z,K=d.video[h.video];L.unsafelyBaseOnPreviousAdaptation=null!==(u=null===(a=t.unsafelyBaseOnPreviousPeriod)||void 0===a?void 0:a.getAdaptation(K.id))&&void 0!==u?u:null;var V=Q(I,y,L);(z=K.representations).push.apply(z,V),N=K.id}else{var G=T.accessibilities,H=void 0;void 0!==S&&S.some((function(e){return"dub"===e.value}))&&(H=!0);var W=void 0;"text"!==C?W=!1:void 0!==G&&(W=G.some(ne));var j=void 0;"audio"!==C?j=!1:void 0!==G&&(j=G.some(te));var Y=void 0;"video"!==C?Y=!1:void 0!==G&&(Y=G.some(re));for(var $=ie(y,{isAudioDescription:j,isClosedCaption:W,isSignInterpreted:Y,isTrickModeTrack:F,type:C});(0,_.Z)(v,$);)$+="-dup";N=$,v.push($),L.unsafelyBaseOnPreviousAdaptation=null!==(c=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation($))&&void 0!==c?c:null;var X={id:$,representations:Q(I,y,L),type:C,isTrickModeTrack:F};null!=y.attributes.language&&(X.language=y.attributes.language),null!=W&&(X.closedCaption=W),null!=j&&(X.audioDescription=j),!0===H&&(X.isDub=!0),!0===Y&&(X.isSignInterpreted=!0);var ee=d[C];if(void 0!==B)f.push({adaptation:X,trickModeAttachedAdaptationIds:B});else if(void 0===ee)d[C]=[X],k&&(h[C]=0);else{for(var oe,se=null,ue=function(){var e=oe.value,t=p[e];if(null!=t&&t.newID!==N&&(0,_.Z)(t.adaptationSetSwitchingIDs,P)){var n,r=(0,s.Z)(ee,(function(t){return t.id===e}));null!=r&&r.audioDescription===X.audioDescription&&r.closedCaption===X.closedCaption&&r.language===X.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',P,e),(n=r.representations).push.apply(n,X.representations),se=r)}},le=J(O);!(oe=le()).done;)ue();if(k){var ce=h[C],de=void 0===ce?0:ce+1;if(null===se)ee.splice(de,0,X),h[C]=de;else{var fe=ee.indexOf(se);fe<0?(ee.splice(de,0,X),h[C]=de):(void 0===ce||fe>ce)&&(ee.splice(fe,1),ee.splice(de,0,se),h[C]=de)}}else null===se&&ee.push(X)}}null!=P&&null==p[P]&&(p[P]={newID:N,adaptationSetSwitchingIDs:O})}}return w(d,f),d}(T.children.adaptations,O),L=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=T.attributes.namespaces)&&void 0!==l?l:[]),U=function(e,t,n){for(var r,i,a,o=[],s=oe(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,p=c.timescale,v=void 0===p?1:p,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=oe(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)/v+t,b=void 0===y.duration?void 0:_+y.duration/v,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,g.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:v,element:T}}})}}return o}(T.children.eventStreams,I,L),B={id:M,start:I,end:x,duration:Z,adaptations:D,streamEvents:U};if(c.unshift(B),!h.lastPositionIsKnown()){var F=function(e){for(var t,n=null,r=!0,i=(0,m.Z)(e).filter((function(e){return null!=e})),a=oe((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=oe(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(D);if(f)if("number"==typeof F){var z=performance.now()/1e3;h.setLastPosition(F,z)}else{var K=ce(t,I);if(void 0!==K){var V=K[0],G=K[1];h.setLastPosition(V,G)}}else"number"==typeof F&&h.setLastPosition(F)}},E=e.length-1;E>=0;E--)T(E);if(t.isDynamic&&!h.lastPositionIsKnown()){var S=ce(t,0);if(void 0!==S){var k=S[0],I=S[1];h.setLastPosition(k,I)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];void 0===i.duration||i.start+i.duration>r.start;)o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,i.duration<=0&&(t.pop(),i=t[t.length-1]);t.push(r)}return t}(c)}function ce(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function de(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pe=a.Z.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;var ve=function e(t,n,r,i,a){void 0===a&&(a=new WeakMap);var c=t.children,f=t.attributes;if(null==n.externalClockOffset){var v="dynamic"===f.type,h=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(v&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<c.periods.length;b++){var T=c.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,a,s,l,c,f,v=e.children,h=e.attributes,m="dynamic"===h.type,g=q(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],v.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=le(v.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(l=0===h.minimumUpdatePeriod?pe:h.minimumUpdatePeriod);var A=function(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");return[p(e),d(e)]}(S),I=A[0],Z=A[1],x=performance.now();if(m){var M;if(c=I,k=null!=_?_:null,void 0!==Z)M=Z;else{var R=null!=y?y:0,C=t.externalClockOffset;if(void 0===C)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-R;else M=(performance.now()+C)/1e3-R}f={isLinear:!0,value:M,time:x},null!==k&&void 0!==c&&M-c>k&&(k=M-c)}else{c=void 0!==I?I:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var P=null!=w?w:1/0;if(void 0!==S[S.length-1]){var N=S[S.length-1],O=null!==(a=N.end)&&void 0!==a?a:void 0!==N.duration?N.start+N.duration:void 0;void 0!==O&&O<P&&(P=O)}void 0!==Z&&Z<P&&(P=Z),f={isLinear:!1,value:P,time:x}}var D=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(s=S[S.length-1])||void 0===s?void 0:s.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:D,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{absoluteMinimumTime:c,timeshiftDepth:k,maximumTimeData:f},lifetime:l,uris:null==t.url?v.locations:[t.url].concat(v.locations)},warnings:n}}}(t,n,r,a):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(o){if(o.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var s=o.length-1;s>=0;s--){var u,l=_[s].index,d=o[s],f=d.parsed,p=d.warnings,v=d.receivedTime,h=d.sendingTime,m=d.url;p.length>0&&r.push.apply(r,p);for(var g,y=de(f);!(g=y()).done;){var b=g.value;a.set(b,{receivedTime:v,sendingTime:h,url:m})}(u=c.periods).splice.apply(u,[l,1].concat(f))}return e(t,n,r,i,a)}}}},he=n(7326),me=n(4578),ge=n(2146),ye=n(9689),_e=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,be=/([0-9]+)-([0-9]+)/;function Te(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Re("`"+t+'` property is not a boolean value but "'+e+'"')]}function Ee(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Re("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Se(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Re("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Re("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function ke(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Re("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function Ae(e,t){if(!(0,b.Z)(e))return[0,new Re("`"+t+"` property is empty")];var n=_e.exec(e);return null===n?[null,new Re("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,b.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,b.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,b.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,b.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,b.Z)(n[10])?n[10]:"0")+parseFloat((0,b.Z)(n[12])?n[12]:"0"),null]}function Ie(e,t){var n=be.exec(e);return null===n?[null,new Re("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ze(e,t){try{return[(0,ye.K)(e),null]}catch(n){return[null,new Re("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function xe(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Me(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Re=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,he.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,me.Z)(t,e),t}((0,ge.Z)(Error));function Ce(e){var t={},n=e.textContent,r=[],i=Me(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Pe(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}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=Ze(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:Ie,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function De(e){for(var t={},n=[],r=Me(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Oe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:Ee,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:Se,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:Te,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:Ee,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:Ee,dashName:"startNumber"})}}return[t,n]}function Le(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Ie,dashName:"mediaRange"})}}return[t,n]}function Ue(e){for(var t=De(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=Le(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,I.Z)(n,{list:i}),r]}function Be(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Fe(e){for(var t,n=De(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Be(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Me(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:Te,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=Ce(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(xe(a));break;case"SegmentBase":var l=De(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Ue(a),p=f[0],v=f[1];r=r.concat(v),t.segmentList=p;break;case"SegmentTemplate":var h=Fe(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(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:Ee,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Te,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Ee,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Se,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Se,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:Ee,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Ee,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Re("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=[xe(a)]:t.accessibilities.push(xe(a));break;case"BaseURL":var o=Ce(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=Pe(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[xe(a)]:t.essentialProperties.push(xe(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(xe(a));break;case"Representation":var l=ze(a),c=l[0],d=l[1];t.representations.push(c),d.length>0&&(r=r.concat(d));break;case"Role":null==t.roles?t.roles=[xe(a)]:t.roles.push(xe(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[xe(a)]:t.supplementalProperties.push(xe(a));break;case"SegmentBase":var f=De(a),p=f[0],v=f[1];t.segmentBase=p,v.length>0&&(r=r.concat(v));break;case"SegmentList":var h=Ue(a),m=h[0],g=h[1];t.segmentList=m,g.length>0&&(r=r.concat(g));break;case"SegmentTemplate":var y=Fe(a),_=y[0],b=y[1];t.segmentTemplate=_,b.length>0&&(r=r.concat(b));break;case"ContentProtection":var T=Ne(a),E=T[0],S=T[1];S.length>0&&(r=r.concat(S)),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=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:Ee,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:Ee,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Ee,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Ee,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Ee,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Ee,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Ee,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:Ee,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:we,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:we,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Te,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Te,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Ee,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Se,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Se,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:Ee,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Se,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Te,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ve(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Me(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:Ee,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];switch(s.nodeName){case"Event":var u=Ge(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ge(e){for(var t={eventStreamData:e},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:Ee,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Ee,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=Ce(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Ke(s),f=d[0],p=d[1];r.push(f),i=i.concat(p);break;case"EventStream":var v=Ve(s),h=v[0],m=v[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Fe(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:Ae,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:Ae,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Te,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 We(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=Ce(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=He(s),f=d[0],p=d[1];r.push(f),a=a.concat(p);break;case"UTCTiming":var v=xe(s);i.push(v)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:ke,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:ke,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:ke,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:Ae,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:Ae,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:Ae,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:Ae,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:Ae,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:Ae,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:Ae,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var je=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=We(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,p=[],v=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];v.push.apply(v,y),p.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:p,warnings:v})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(ve(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(;e.length>0;){var n=e[0];if(n.start>=t)return;if(n.repeatCount<=0)e.shift();else{var r=e[1];if(void 0!==r&&r.start<=t)e.shift();else{if(n.duration<=0)return;for(var i=n.start+n.duration,a=1;i<t&&a<=n.repeatCount;)i+=n.duration,a++;if(!(a>n.repeatCount)){var o=n.repeatCount-a;return n.start=i,void(n.repeatCount=o)}e.shift()}}}}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},jH:function(){return a},gT:function(){return o},zG:function(){return s},PZ:function(){return u},_j:function(){return l}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){var n=e.length;if(0!==e.length){if(0!==t.length){var 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)return void e.splice.apply(e,[u,n-u].concat(t));if(l<o){var c=e[u];if(c.start+c.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),void e.splice.apply(e,[u,n-u].concat(t));if(void 0===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),void e.splice.apply(e,[u+1,n-(u+1)].concat(t));if(c.start+c.duration*(c.repeatCount+1)<=o)return void e.splice.apply(e,[u+1,n-(u+1)].concat(t));var d=(o-c.start)/c.duration-1;if(d%1==0&&c.duration===t[0].duration){var f=t[0].repeatCount<0?-1:t[0].repeatCount+d+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=c.start,void(e[u].repeatCount=f)}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(d),void e.splice.apply(e,[u+1,n-(u+1)].concat(t))}}var p=e[e.length-1],v=t[t.length-1];if(void 0!==p.repeatCount&&p.repeatCount<0)return p.start>v.start?void i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),void e.splice.apply(e,[0,n].concat(t)));p.start+p.duration*(p.repeatCount+1)>=v.start+v.duration*(v.repeatCount+1)?i.Z.warn("RepresentationIndex: The new index is older than the previous one"):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)))}}else e.splice.apply(e,[0,n].concat(t))}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,v=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";p.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=p.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return v;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if(" "===c)v[v.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var p=document.createElement("div");p.className="rxp-texttrack-p",(0,r.Z)(_)&&(p.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&p.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))})),p.appendChild(y)}f.appendChild(p),d.appendChild(f),v.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,p=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";v.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=p.exec(e),f=v.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&(" "===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var p=e(a);p.style.color=a.color,r.appendChild(p)}else{var v=e(a);r.appendChild(v)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],p=0;p<d.length;p++){var v=(0,a.Z)(d[p],t);if(null!==v){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=v).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},4123: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)}n.d(t,{Z:function(){return r}})},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],p=f.name;if("style"===p)e=f.value;else if("region"===p)t=f.value;else{var v=p.substring(4);if((0,i.Z)(u,v)&&(s[v]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(5403);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(4123),f=n(3791),p=n(3887),v=n(5336);function h(e,t){return"-1px -1px "+t+" "+e+",1px -1px "+t+" "+e+",-1px 1px "+t+" "+e+",1px 1px "+t+" "+e}function m(e){var t;return null!=(t=v.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=v.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=v.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=v.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=v.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)?p.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 p.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var 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=v.eT.exec(r[0]),a=v.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])):p.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])):p.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=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=v.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])):p.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=v.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):p.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=v.eT.exec(r[0]),a=v.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])):p.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])):p.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=v.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):p.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,d.Z)(e,"div"),p=document.createElement("DIV");if(p.className="rxp-texttrack-region",p.setAttribute("data-resolution-columns",String(o.columns)),p.setAttribute("data-resolution-rows",String(o.rows)),_(p,i),null!==t){var v=(0,f.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(v)&&(p.style.backgroundColor=m(v))}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=[],d=0;d<s.length;d++){var p=s[d];if("#text"===p.nodeName){var v=(0,f.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(v)?i.backgroundColor=v:delete i.backgroundColor;var h=T(p,i,o);u.push(h)}else if("br"===p.nodeName){var m=document.createElement("BR");u.push(m)}else if("span"===p.nodeName&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var y=p.getAttribute("xml:space"),_=(0,l.Z)(y)?"default"===y:o,b=(0,c.Z)({},i,(0,f.U)(g,[p],n,t));u.push.apply(u,e(p,b,[p].concat(a),_))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return p.appendChild(h),p}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5403),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l={left:"start",center:"center",right:"end",start:"start",end:"end"},c={left:"line-left",center:"center",right:"line-right"};function d(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,d=e.ttParams,f=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,d),v=p.start,h=p.end,m=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 l=u.trim();u=l=l.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("br"===s.nodeName)i+="\n";else if("span"===s.nodeName&&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,f),g=(0,i.Z)(v+n,h+n,m);return null===g?null:((0,a.Z)(g)&&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 d=l[a];e.lineAlign=void 0===d?"":d}}(g,r),g)}var f=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=d(n[a]);null!==o&&i.push(o)}return i}},5403:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(4123),l=n(3791);var c=n(5138),d=n(7714);var 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 p(e,t){var n=[],p=(new DOMParser).parseFromString(e,"text/xml");if(null!=p){var v=p.getElementsByTagName("tt")[0];if(void 0===v)throw new Error("invalid XML");for(var h=function(e){var t=e.getElementsByTagName("body");return t.length>0?t[0]:null}(v),m=function(e){return e.getElementsByTagName("style")}(v),g=function(e){return e.getElementsByTagName("region")}(v),y=function(e){return e.getElementsByTagName("p")}(v),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),p=parseInt(d[2],10);isNaN(f)||isNaN(p)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:p}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var v=Number(t);(isNaN(v)||v<=0)&&(v=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=v,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:v*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=v*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(v),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,l.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,c.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var l=e[u];(0,d.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(l,u),r.style=(0,a.Z)({},l.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=0;I<=g.length-1;I++){var Z=g[I];if(Z instanceof Element){var x=Z.getAttribute("xml:id");null!==x&&function(){var e=(0,l.b)(Z),t=Z.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:x,style:e,extendsStyles:[]})}()}}for(var M=(0,l.U)(f,null!==h?[h]:[],b,A),R="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var N=(0,u.Z)(P,"div"),O=(0,a.Z)({},M,(0,l.U)(f,[P].concat(N),b,A)),D=P.getAttribute("xml:space"),L=(0,i.Z)(D)?"default"===D:R,U={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:O,ttParams:_,shouldTrimWhiteSpace:L};null!==U&&n.push(U)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{YU:function(){return f},Dq:function(){return d},GK:function(){return p},ev:function(){return v},eT:function(){return c},_0:function(){return l},KO:function(){return i},gu:function(){return r},wf:function(){return a},jb:function(){return o},te:function(){return u},Du:function(){return s}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,p=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,v=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},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=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var p=document.createAttribute("style");f.forEach((function(e){p.value+=e}));var v=(0,l.Z)(r,a)?a:"span";(n=document.createElement(v)).setAttributeNode(p)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,p,v,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(p||(p={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(v||(v={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[p.LEFT]=0,t[p.CENTER]=50,t[p.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={})[p.LEFT]=0,n[p.CENTER]=-50,n[p.RIGHT]=-100,n)[void 0!==e.align?E(e.align):p.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[v.START]=0,t[v.CENTER]=-50,t[v.END]=-100,t);if(void 0===e)return n[v.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[v.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var p=document.createElement("span"),v=document.createAttribute("style");v.value="background-color:rgba(0,0,0,0.8);color:white;",p.setAttributeNode(v);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 v.value+=y,p.setAttributeNode(v),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){p.appendChild(e)})),u.appendChild(d),d.appendChild(p),{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),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),p=0;p<d.length;p++){var v=(0,o.Z)(d[p],t);if(null!=v){var h=A(v,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,p=(0,o.yE)(n),v=(0,i.Z)(n,p),h=[],m=0;m<v.length;m++){var g=(0,a.Z)(v[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{yE:function(){return i},tq:function(){return o},JF:function(){return a},$4:function(){return s}});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}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=n(7874),i=n(8791),a=n(8555),o=n.n(a),s=n(4597),u=n(5278);function l(e,t,n,r){return t.segment.isInit||null===e?o().resolve({resultType:"segment-created",resultData:null}):(0,s.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}function c(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,u.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var d=n(8750),f=n(3887),p=n(1989),v=n(8026),h=n(3635);function m(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,u,l,c,m){var g,y=a.responseData,_=u.externalClockOffset,b=null!==(g=a.url)&&void 0!==g?g:u.originalUrl,T=null!=i?i:_,E={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:u.unsafeMode?u.previousManifest:null,url:b,referenceDateTime:n,externalClockOffset:T},S=r.Z.dashParsers;if(null===S.wasm||"uninitialized"===S.wasm.status||"failure"===S.wasm.status)return f.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),k();var w=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,h.tG)(e).buffer;if(e instanceof Document)return(0,h.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(y);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(w)?"initialized"===S.wasm.status?(f.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E))):(f.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),S.wasm.waitForInitialization().catch((function(){})).then((function(){return null===S.wasm||"initialized"!==S.wasm.status?(f.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),k()):(f.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E)))}))):(f.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),k());function k(){if(null===S.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,h.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")}(y);return A(S.js(e,E))}function A(t){if("done"===t.type)return t.value.warnings.length>0&&l(t.value.warnings),c.isCancelled?o().reject(c.cancellationError):{manifest:new p.ZP(t.value.parsed,e),url:b};var n=t.value,r=n.urls.map((function(e){return m((function(){return"string"===n.format?(0,s.ZP)({url:e,responseType:"text",cancelSignal:c}):(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:c})})).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,v.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,v.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,d.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,v.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return o().all(r).then((function(e){return n.format,A(n.continue(e))}))}}}var g=n(7839),y=n(5861),_=n(7757),b=n.n(_),T=n(944),E=n(9105),S=n(5992),w=n(1946),k=T.Z.DEFAULT_REQUEST_TIMEOUT,A="function"==typeof Headers?Headers:null,I="function"==typeof AbortController?AbortController:null;function Z(){return"function"==typeof window.fetch&&!(0,w.Z)(I)&&!(0,w.Z)(A)}var x=n(8806),M=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 C=n(288),P=n(4460);function N(e){return function(t,n,r,i){return new Promise((function(a,o){var s=new C.ZP,u=r.register((function(e){s.cancel(),o(e)}));function l(e){if((e instanceof Array||e instanceof Uint8Array)&&"mp4"===R(n.adaptation.type,n.representation))try{(0,P.Z)(new Uint8Array(e),n.segment.isInit)}catch(e){u(),s.cancel(),o(e)}}e(t,n,s.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){l(e),s.isUsed||i.onNewChunk(e)}})).then((function(e){s.isUsed||(u(),"segment-loaded"===e.resultType&&l(e.resultData.responseData),a(e))}),(function(e){C.ZP.isCancellationError(e)||(u(),o(e))}))}))}}var O=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,s.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,s.ZP)({url:e,headers:{Range:(0,M.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,s.ZP)({url:e,headers:{Range:(0,M.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return o().all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,O.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var L=n(8766);function U(e,t,n,r){var i=t.segment,a=void 0!==i.range?{Range:(0,M.Z)(i.range)}:void 0,o=null;return function(e){var t;if(!(0,w.Z)(e.headers))if((0,w.Z)(A))t=e.headers;else{t=new A;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}f.Z.debug("Fetch: Called with URL",e.url);var a=null,o=!1,s=performance.now(),u=(0,w.Z)(I)?null:new I;function l(){(0,w.Z)(u)?f.Z.warn("Fetch: AbortController API not available."):u.abort()}var c=(0,w.Z)(e.timeout)?k:e.timeout,d=window.setTimeout((function(){o=!0,l()}),c),p=e.cancelSignal.register((function(e){a=e,l()}));return fetch(e.url,{headers:t,method:"GET",signal:(0,w.Z)(u)?void 0:u.signal}).then((function(t){if((0,w.Z)(d)||clearTimeout(d),t.status>=300)throw f.Z.warn("Fetch: Request HTTP Error",t),new E.Z(t.url,t.status,S.br.ERROR_HTTP_CODE);if((0,w.Z)(t.body))throw new E.Z(t.url,t.status,S.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,w.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),a=0;return o();function o(){return u.apply(this,arguments)}function u(){return(u=(0,y.Z)(b().mark((function n(){var u,l,c,d,f;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((u=n.sent).done||(0,w.Z)(u.value)){n.next=11;break}return a+=u.value.byteLength,l=performance.now(),c={url:t.url,currentTime:l,duration:l-s,sendingTime:s,chunkSize:u.value.byteLength,chunk:u.value.buffer,size:a,totalSize:r},e.onData(c),n.abrupt("return",o());case 11:if(!u.done){n.next=16;break}return p(),d=performance.now(),f=d-s,n.abrupt("return",{requestDuration:f,receivedTime:d,sendingTime:s,size:a,status:t.status,url:t.url});case 16:return n.abrupt("return",o());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==a)throw a;if(p(),o)throw f.Z.warn("Fetch: Request timeouted."),new E.Z(e.url,0,S.br.TIMEOUT);if(t instanceof E.Z)throw t;throw f.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new E.Z(e.url,0,S.br.ERROR_EVENT)}))}({url:e,headers:a,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,L.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,O.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,O.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!==o?(0,O.zo)(o,t):t),a=i[0];o=i[1];for(var s=0;s<a.length;s++)if(n.onNewChunk(a[s]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function B(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=R(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(Z())return U(e,t,r,i);(0,x.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 o=t.segment;return(0,s.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,M.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(6490),z=n(4644),K=408125543,V=357149030;function G(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=q(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=Y(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return G(e,t.slice(p+1,t.length),n,[d,f])}o=f}return null}function H(e,t){var n=G(2807729,[K,V],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/$(e,n[0],r)}function W(e,t){var n=G(17545,[K,V],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function j(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function q(e,t){var n=j(e,t);if(null==n)return f.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return f.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function Y(e,t){var n=j(e,t);if(null==n)return f.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return f.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 $(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 X=n(7403);function Q(e,t,n,r){var i=(0,z.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,z.MM)(e);if(t||!n.complete)return void 0===s&&f.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function J(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh: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,h.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function ee(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i=n.period,a=n.adaptation,o=n.representation,s=n.segment,l=n.manifest,c=e.data,d=e.isChunked,f=[i.start,i.end];if(null===c)return s.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:f};var p=c instanceof Uint8Array?c:new Uint8Array(c),v=R(a.type,o),h="mp4"===v||void 0===v,m=!1;if(h){var g=(0,F.Z)(p);g.length>0&&(m=o._addProtectionData("cenc",g))}if(!s.isInit){var y=h?Q(p,d,s,r):null,_=(0,u.Z)(s.timestampOffset,0);if(h){var b=(0,z.s9)(p);if(void 0!==b){var T=J(b.filter((function(e){return void 0!==s.privateInfos&&void 0!==s.privateInfos.isEMSGWhitelisted&&s.privateInfos.isEMSGWhitelisted(e)})),l.publishTime);if(void 0!==T){var E=T.needsManifestRefresh;return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,appendWindow:f,inbandEvents:T.inbandEvents,protectionDataUpdate:m,needsManifestRefresh:E}}}}return{segmentType:"media",chunkData:p,chunkInfos:y,chunkOffset:_,protectionDataUpdate:m,appendWindow:f}}var S=s.indexRange,k=null;if("webm"===v)k=function(e,t){var n=G(K,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=H(e,r);if(null==a)return null;var o=W(e,r);if(null==o)return null;var s=G(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=G(187,[],e,[l,s[1]]);if(null==c)break;var d=G(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=$(e,d[0],d[1]-d[0]),p=G(241,[183],e,[c[0],c[1]]);if(null==p)return null;var v=$(e,p[0],p[1]-p[0])+r;u.push({time:f,rangeStart:v}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(h&&(k=(0,z.Wf)(p,Array.isArray(S)?S[0]:0),!0===t&&null!==k&&k.length>0)){var A=k[k.length-1];Array.isArray(A.range)&&(A.range[1]=1/0)}o.index instanceof X.Z&&null!==k&&k.length>0&&o.index.initializeIndex(k);var I=h?(0,z.LD)(p):"webm"===v?H(p,0):void 0;return{segmentType:"init",initializationData:p,protectionDataUpdate:m,initTimescale:(0,w.Z)(I)?void 0:I}}}var te=n(6807);function ne(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):f.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);return{data:function(e){var t=(0,te.Le)(e);return null===t?"":(0,h.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function re(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?f.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration)),{data:t,type: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),language:o.language,start:r,end:i})}function ie(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,l=n.segment,c=e.data,d=e.isChunked;if(null===c)return l.isInit?{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:null!==(i=l.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=R(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,l=s.isInit,c=s.indexRange,d="string"==typeof e?(0,h.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,z.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var p=f[f.length-1];Array.isArray(p.range)&&(p.range[1]=1/0)}var v=(0,z.LD)(d);return o.index instanceof X.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:v}}var m=Q(d,t,s,r);return{segmentType:"media",chunkData:ne(n,d,m,t),chunkInfos:m,chunkOffset:(0,u.Z)(s.timestampOffset,0),protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i=n.period,a=n.segment,o=a.timestampOffset,s=void 0===o?0:o;if(a.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var u=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,h.uR)(u)}else r=e;return{segmentType:"media",chunkData:re(n,r,t),chunkInfos:null,chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}(c,d,n)}}var ae=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=m(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:N(r);function r(e,r,i,a){if(null==e)return o().resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return B(e,r,t,a,i);var s={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(o,u){var l=!1,c=n(s,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new g.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),B(e,r,t,a,i).then(o,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),u=ee(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:u},video:{loadSegment:a,parseSegment:u},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:N(n);function n(e,n,r,i){var a=n.adaptation,u=n.representation,l=n.segment,c=l.range;if(null===e)return o().resolve({resultType:"segment-created",resultData:null});if(l.isInit)return D(e,l,r,i);var d=R(a.type,u),f="mp4"===d||void 0===d;if(t&&f){if(Z())return U(e,n,i,r);(0,x.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 f?(0,s.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,M.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,s.ZP)({url:e,responseType:"text",headers:Array.isArray(c)?{Range:(0,M.Z)(c)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ie(e)},image:{loadSegment:l,parseSegment:c}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var r=n(8555),i=n.n(r),a=n(7874),o=n(3887),s=n(1989),u=n(6807),l=n(8999),c=n(7714),d=n(811),f=n(6968),p=n(6923),v=n(8026),h=n(9829),m=n(3635),g=n(5278),y=n(2689),_={};function b(e){if(null!=_[e])return _[e];var t=(0,m.tG)(e);return _[e]=t,t}function T(e,t){var n=t.length+8;return n<=y.s?(0,f.zo)((0,f.kh)(n),b(e),t):(0,f.zo)((0,f.kh)(1),b(e),(0,f.el)(n+8),t)}function E(e,t){return T(e,f.zo.apply(void 0,t))}function S(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,c.Z)(t,r)){o.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,S(e),t.push(i)}else t.push(r);var a=n.adaptations,s=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,c.Z)(s,n)){o.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),s.push(r)}else s.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,c.Z)(i,n)){o.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,S(e),i.push(r)}else i.push(n)}))}))}))}))}var w=n(9689);function k(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,f.zo)([8,1,18,16],e)}]}function A(e,t){if(void 0===t&&(t=k),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,w.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,f.qb)(e,8),n=(0,m.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,m.wO)((0,w.K)(i));return(0,m.ci)(a).toLowerCase()}(r),a=(0,m.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),x=n(3911),M=n(1091),R=n(5505);function C(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,x.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function P(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(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 D=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,x.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},mediaURLs:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,p=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,v=0;v<f;v++){for(var h=s[v],m=h.duration,g=h.start,y=O(h,s[v+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==p||b+T<=p);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[P(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,x.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.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,x._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.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],s=n[n.length-1],u=(0,x.jH)(s,null);if(!((0,x.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,x.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==s.duration)return;var f=u-c.start;if(0===f)return o.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var p=f/c.duration-1,v=c.repeatCount-p;if(v<0)return;s.repeatCount+=v;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,R.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)C(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,Z.Z)(e.timeline,r)}}},e}();function L(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},B={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4"};var F=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=L(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,L(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"),s=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===B[l]||void 0===u)return o.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,p.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!==s?parseInt(s,10):s,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?B[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var m=r("CodecPrivateData"),y=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==y&&void 0===B[y]||void 0===m)return o.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,p.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==y?B[y]:y,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?B[k]:k,codecPrivateData:(0,g.Z)(w,"")};default:return o.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function s(t){var r=t.root,i=t.timescale,s=t.rootURL,u=t.protections,g=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),E=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,c.Z)(l.r,S)||o.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),I=r.getAttribute("Url"),Z=null===I?"":I;var x,M=L(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=M.qualityLevels,C=M.cNodes,P={timeline:(x=C,x.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=x[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,p.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:E};(0,d.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var N=w+((0,p.Z)(A)?"_"+A:""),O=R.map((function(t){var n,r,i,a,o=(0,h.Z)(s,Z),l={timeline:P.timeline,timescale:P.timescale,media:(n=o,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,p.Z)(t.mimeType)?t.mimeType:U[w],d=t.codecs,b=N+"_"+(null!=w?w+"-":"")+(null!=c?c+"-":"")+(null!=d?d+"-":"")+String(t.bitrate),E=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){E.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new D(l,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:g}),I=(0,v.Z)({},t,{index:A,mimeType:c,codecs:d,id:b});if(E.length>0||void 0!==a){var x=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return T("pssh",(0,f.zo)([n,0,0,0],(0,m.nr)(e),(0,f.kh)(t.length),t))}(r,n)}}));if(x.length>0){var M=[{type:"cenc",values:x}];I.contentProtections={keyIds:E,initData:M}}else I.contentProtections={keyIds:E,initData:[]}}return I}));if("ADVT"===k)return null;var B={id:N,type:w,representations:O,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(B.closedCaption=!0),B}return function(n,r,a){var o=(0,h.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,f,v=u.getAttribute("Timescale"),m=(0,p.Z)(v)?isNaN(+v)?1e7:+v:1e7,g=L(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(A(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/m)}var E,w,k,I,Z,x,M=_.reduce((function(e,t){var n=s({root:t,rootURL:o,timescale:m,protections:y,isLive:b,timeShiftBufferDepth:f,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}),{}),R=null,C=void 0!==M.video?M.video[0]:void 0,P=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],O=[];if(void 0!==C){var D=C.representations[0];if(void 0!==D){var U=D.index.getFirstPosition(),B=D.index.getLastPosition();null!=U&&N.push(U),null!=B&&O.push(B)}}if(void 0!==P){var F=P.representations[0];if(void 0!==F){var z=F.index.getFirstPosition(),K=F.index.getLastPosition();null!=z&&N.push(z),null!=K&&O.push(K)}}N.length>0&&(Z=Math.max.apply(Math,N)),O.length>0&&(x=Math.min.apply(Math,O))}var V=u.getAttribute("Duration"),G=null!=V&&0!=+V?+V/m:void 0;b?(E=e.suggestedPresentationDelay,w=t,k=null!=Z?Z:w,I={isLinear:!0,value:null!=x?x:Date.now()/1e3-w,time:performance.now()},R=null!=f?f:null):(k=null!=Z?Z:0,I={isLinear:!1,value:void 0!==x?x:void 0!==G?k+G:1/0,time:performance.now()});var H=b?0:k,W=b?void 0:I.value,j={availabilityStartTime:void 0===w?0:w,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{absoluteMinimumTime:k,timeshiftDepth:R,maximumTimeData:I},periods:[{adaptations:M,duration:void 0!==W?W-H:G,end:W,id:"gen-smooth-period-0",start:H}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return S(j),j}},z=n(4597),K=n(8806),V=n(4460),G=n(8791),H=n(4644),W=n(2297);function j(e,t,n,r,i){var a,s,l,c=[];if(i){var d=(0,u.XA)(e);null!==d?(l=function(e){var t=(0,W.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,f.pV)(t,16*a+5),o=(0,f.pV)(t,16*a+5+8)):(s=(0,f.pX)(t,8*a+5),o=(0,f.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),s=function(e){var t=(0,W.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,f.pV)(t,12),time:(0,f.pV)(t,4)}}(d)):o.Z.warn("smooth: could not find traf atom")}if(void 0!==l)for(var p=0;p<l.length;p++)c.push({time:l[p].time,duration:l[p].duration,timescale:n});if(void 0!==s)return{nextSegments:c,chunkInfos:{time:s.time/n,duration:s.duration/n},scaledSegmentTime:s.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,h=Math.min(.9*n,v/4),m=(0,H.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-v)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var q=n(3666);function Y(e,t){return T("schm",(0,f.zo)(4,(0,m.tG)(e),(0,f.kh)(t)))}function $(e){return T("frma",(0,m.tG)(e))}function X(e){var t=[7,[e.length]];return T("stsd",f.zo.apply(void 0,t.concat(e)))}function Q(e,t,n){return T("tenc",(0,f.zo)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(T("senc",i),function(e){if(0===e.length)return T("saiz",new Uint8Array(0));var t=(0,f.pX)(e,0),n=(0,f.pX)(e,4),r=new Uint8Array(n+9);r.set((0,f.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,f.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return T("saiz",r)}(i),function(e,t,n,r){return T("saio",(0,f.zo)(4,[0,0,0,1],(0,f.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),E("traf",a)}function ee(e,t){var n=(0,W.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,W.iz)(r,1835427940),a=(0,W.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,W.Qy)(a,1952868452),s=(0,W.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return T("tfdt",(0,f.zo)([1,0,0,0],(0,f.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,H.J6)(n)}(l,s[1]-s[0]),p=J(u,c,d,i,(0,W.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=E("moof",[i,p]),h=(0,W.Qy)(v,1836019558),m=(0,W.Qy)(p,1953653094),g=(0,W.Qy)(d,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=v.length-_,S=(0,W.Qy)(e,1835295092);if(null===S)throw new Error("Smooth: Invalid ISOBMFF given");if(!q.YM&&(0===b||b<=-8)){var w=S[1];return v.set((0,f.kh)(w),y),e.set(v,n[0]),b<=-8&&e.set(T("free",new Uint8Array(-b-8)),v.length),e}var k=S[1]+b;v.set((0,f.kh)(k),y);var A=new Uint8Array(e.length+b),I=e.subarray(0,n[0]),Z=e.subarray(n[2],e.length);return A.set(I,0),A.set(v,I.length),A.set(Z,I.length+v.length),A}var te=n(7839),ne=n(281);function re(e,t,n,r,i,a){var o,s,u,l=E("stbl",[n,T("stts",new Uint8Array(8)),T("stsc",new Uint8Array(8)),T("stsz",new Uint8Array(12)),T("stco",new Uint8Array(8))]),c=E("dinf",[function(e){return T("dref",(0,f.zo)(7,[1],e))}(T("url ",new Uint8Array([0,0,0,1])))]),d=E("minf",[r,c,l]),p=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 T("hdlr",(0,f.zo)(8,(0,m.tG)(t),12,(0,m.tG)(n),1))}(t),v=E("mdia",[function(e){return T("mdhd",(0,f.zo)(12,(0,f.kh)(e),8))}(e),p,d]),h=E("trak",[function(e,t,n){return T("tkhd",(0,f.zo)((0,f.kh)(7),8,(0,f.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,f.XT)(e),2,(0,f.XT)(t),2))}(i,a,1),v]),g=E("mvex",[(o=1,T("trex",(0,f.zo)(4,(0,f.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return E("moov",[e,t,n])}(function(e,t){return T("mvhd",(0,f.zo)(12,(0,f.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,f.XT)(t+1)))}(e,1),g,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],T("ftyp",f.zo.apply(void 0,[(0,m.tG)(s),[0,0,0,1]].concat(u.map(m.tG)))));return(0,f.zo)(_,y)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,p,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return T("avcC",(0,f.zo)([1,i,a,o,252|r,225],(0,f.XT)(e.length),e,[1],(0,f.XT)(t.length),t))}((0,m.nr)(l),(0,m.nr)(c),a);if(void 0===s){d=X([function(e,t,n,r,i,a,o){return T("avc1",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v)])}else{var h=E("schi",[Q(1,8,s)]),g=Y("cenc",65536);d=X([function(e,t,n,r,i,a,o,s){return T("encv",(0,f.zo)(6,(0,f.XT)(1),16,(0,f.XT)(e),(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),6,[0,1,i.length],(0,m.tG)(i),31-i.length,(0,f.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,E("sinf",[$("avc1"),g,h]))])}return re(e,"video",d,((p=new Uint8Array(12))[3]=1,T("vmhd",p)),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,c=function(e,t){return T("esds",(0,f.zo)(4,[3,25],(0,f.XT)(e),[0,4,17,64,21],11,[5,2],(0,m.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,m.ci)((0,f.XT)(l))):a);return re(e,"audio",function(){if(void 0===o)return X([function(e,t,n,r,i,a){return T("mp4a",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a))}(1,t,n,r,i,c)]);var e=E("schi",[Q(1,8,o)]),a=Y("cenc",65536),s=E("sinf",[$("mp4a"),a,e]);return X([function(e,t,n,r,i,a,o){return T("enca",(0,f.zo)(6,(0,f.XT)(e),8,(0,f.XT)(t),(0,f.XT)(n),2,(0,f.XT)(r),(0,f.XT)(i),2,a,o))}(1,t,n,r,i,c,s)])}(),T("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,p.Z)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function ce(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function de(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,ne.Z)(o)}),(0,z.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!ce(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,V.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var fe=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,a,o){var s=r.segment,u=r.manifest,l=r.period,c=r.adaptation,d=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,p=s.privateInfos.smoothInitSegment,v=p.codecPrivateData,h=p.timescale,m=p.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===v)throw new Error("Smooth: no codec private data.");switch(c.type){case"video":var y=d.width,_=void 0===y?0:y,b=d.height;f=ie(h,_,void 0===b?0:b,72,72,4,v,g.keyId);break;case"audio":var T=p.channels,E=void 0===T?0:T,S=p.bitsPerSample,w=void 0===S?0:S,k=p.packetSize,A=void 0===k?0:k,I=p.samplingRate;f=oe(h,E,w,A,void 0===I?0:I,v,g.keyId);break;default:0,f=new Uint8Array(0)}return i().resolve({resultType:"segment-created",resultData:f})}if(null===e)return i().resolve({resultType:"segment-created",resultData:null});var Z={adaptation:c,manifest:u,period:l,representation:d,segment:s,transport:"smooth",url:e};return"function"!=typeof n?de(e,r,o,a,t):new Promise((function(i,s){var u=!1,l=n(Z,{reject:function(e){var t,n,r;if(!u&&!a.isCancelled){u=!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.",l=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);s(l)}},resolve:function(e){if(!u&&!a.isCancelled){u=!0,a.deregister(c),ce(r.representation)&&!0===t||i({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,V.Z)(n,r.segment.isInit),i({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||a.isCancelled||(u=!0,a.deregister(c),de(e,r,o,a,t).then(i,s))},progress:function(e){u||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function ve(e,t,n){var r;o.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var s=i[a];s.index instanceof D&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?s.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):o.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var he=function(e){var t=F(e),n=fe(e),r={customManifestLoader:e.manifestLoader},l={loadSegment:function(e,t,r,i){return n(e,t,r,i)},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,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit)return{segmentType:"init",initializationData:u,initTimescale:null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale,protectionDataUpdate:!1};var d=void 0!==n?j(c,l,n,a,s.isLive):null;if(null===d||null===d.chunkInfos||void 0===d.scaledSegmentTime)throw new Error("Smooth Segment without time information");var f=d.nextSegments,p=d.chunkInfos,v=ee(c,d.scaledSegmentTime);return f.length>0&&ve(o,f,a),{segmentType:"media",chunkData:v,chunkInfos:p,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return i().resolve(void 0);var n;pe.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,z.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=i().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,K.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)(r,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,u=n.responseData,l="string"==typeof u?(new DOMParser).parseFromString(u,"text/xml"):u,c=t(l,a,o);return{manifest:new s.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:l,video:l,text:{loadSegment:function(t,n,r,a){var o=n.segment,s=n.representation;return o.isInit||null===t?i().resolve({resultType:"segment-created",resultData:null}):ce(s)?(0,z.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,V.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,z.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:a.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a=t.manifest,s=t.adaptation,l=t.representation,c=t.segment,d=s.language,f=ce(l),p=l.mimeType,v=void 0===p?"":p,h=l.codec,g=void 0===h?"":h,y=e.data,_=e.isChunked;if(c.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var b,T,E,S,w=null;if(f){var k;k="string"==typeof y?(0,m.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y);var A=void 0!==n?j(k,_,n,c,a.isLive):null;i=null==A?void 0:A.nextSegments,null===(w=null!==(r=null==A?void 0:A.chunkInfos)&&void 0!==r?r:null)?_?o.Z.warn("Smooth: Unavailable time data for current text track."):(b=c.time,T=c.end):(b=w.time,T=void 0!==w.duration?w.time+w.duration:c.end);var I=g.toLowerCase();if("application/ttml+xml+mp4"===v||"stpp"===I||"stpp.ttml.im1t"===I)S="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+v);S="vtt"}var Z=(0,u.Le)(k);E=null===Z?"":(0,m.uR)(Z)}else{var x;if(b=c.time,T=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);x=(0,m.uR)(M)}else x=y;switch(v){case"application/x-sami":case"application/smil":S="sami";break;case"application/ttml+xml":S="ttml";break;case"text/vtt":S="vtt"}if(void 0===S){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+v);S="srt"}E=x}return null!==w&&Array.isArray(i)&&i.length>0&&ve(s,i,c),{segmentType:"media",chunkData:{type:S,data:E,start:b,end:T,language:d},chunkInfos:w,chunkOffset:null!=b?b:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,r){return t.segment.isInit||null===e?i().resolve({resultType:"segment-created",resultData:null}):(0,z.ZP)({url:e,responseType:"arraybuffer",onProgress:r.onProgress,cancelSignal:n}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===a.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:a.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},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 u}});var r=n(7904),i=n(4597),a=n(8555),o=n.n(a),s=n(7839);function u(e,t){var n=e.customManifestLoader,a=function(e){return function(t,n){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",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?a:function(e,t){return function(n,r){return new(o())((function(i,a){var o=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var o=e,l=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new s.Z(l,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(i=null==o?void 0:o.isOfflineError)&&void 0!==i&&i,null==o?void 0:o.xhr);a(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-o:void 0,n=void 0!==e.sendingTime?e.sendingTime-o:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,a))}});function c(e){u||(u=!0,"function"==typeof l&&l(),a(e))}r.register(c)}))}}(n,a)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function p(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function v(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{zo:function(){return r},zK:function(){return i},QI:function(){return a},pX:function(){return o},pV:function(){return s},qb:function(){return d},dN:function(){return f},XT:function(){return u},kh:function(){return l},el:function(){return c},O_:function(){return p},_f:function(){return v}})},8117:function(e,t,n){"use strict";var r=n(8555),i=n.n(r),a=n(1480),o=n(3102),s=n(2817),u=n(1946);t.Z=function(e){return e instanceof a.y?e:e instanceof i()||e instanceof Promise||!(0,u.Z)(e)&&"function"==typeof e.then?(0,o.D)(e):(0,s.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(d.clearImmediate(n),t._scheduled=void 0)},t}(a.o),p=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),v=n(8720);function h(){return function(e){return e.pipe((0,v.R)(p))}}},1959:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},R:function(){return s}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e];Array.isArray(n)?n.push(t):this._listeners[e]=[t]},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error(e,e instanceof Error?e.stack:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},9589:function(e,t,n){"use strict";var r=n(8555),i=n.n(r);t.Z="function"==typeof Promise?Promise:i()},2829:function(e,t,n){"use strict";n.d(t,{JN:function(){return c},uH:function(){return b},F_:function(){return p},L7:function(){return m},XS:function(){return f},DD:function(){return h},rx:function(){return d},at:function(){return v},kR:function(){return g},Ti:function(){return s},A1:function(){return o},tn:function(){return _}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function 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 v(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(1480),i=n(3887);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(o)i.Z.error("Finished shared references cannot be updated");else if(t=e,0!==n.length)for(var r,s=a(n.slice());!(r=s()).done;){var u=r.value;try{u.hasBeenUnsubscribed||u.subscriber.next(e)}catch(e){}}},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={subscriber:r,hasBeenUnsubscribed:!1};return n.push(i),function(){i.hasBeenUnsubscribed=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenUnsubscribed||r.subscriber.complete()}catch(e){}}}}}t.Z=s},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(944),i=n(9105),a=n(6923),o=n(1946),s=r.Z.DEFAULT_REQUEST_TIMEOUT;var u=function(e){var t={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?s:e.timeout};return new Promise((function(n,r){var s=e.onProgress,u=e.cancelSignal,l=t.url,c=t.headers,d=t.responseType,f=t.timeout,p=new XMLHttpRequest;if(p.open("GET",l,!0),f>=0&&(p.timeout=f),p.responseType=d,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,o.Z)(c)){var v=c;for(var h in v)v.hasOwnProperty(h)&&p.setRequestHeader(h,v[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(p)||4===p.readyState||p.abort(),r(e)})),u.isCancelled)||(p.onerror=function(){null!==g&&g(),r(new i.Z(l,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){null!==g&&g(),r(new i.Z(l,p.status,"TIMEOUT",p))},void 0!==s&&(p.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(null!==g&&g(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,c=p.status,d=p.responseType,f=(0,a.Z)(p.responseURL)?p.responseURL:l;if(t="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,o.Z)(t))return void r(new i.Z(l,p.status,"PARSE_ERROR",p));n({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:t})}else r(new i.Z(l,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{ci:function(){return p},nr:function(){return f},tG:function(){return l},uR:function(){return d},TZ:function(){return s},wV:function(){return u},wO:function(){return v},DM:function(){return h}});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){r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",e)}for(var t="",n=0;n<e.length;n+=2)t+=String.fromCharCode((e[n+1]<<8)+e[n]);return t}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",e)}var t,n=encodeURIComponent(e);if("function"==typeof unescape)t=unescape(n);else{var i=/[0-9a-fA-F]/,a=n.length;t="";for(var s=0;s<n.length;s++){var u=!1;if("%"===n[s])if(s<=a-6&&"u"===n[s+1]&&i.test(n[s+2])&&i.test(n[s+3])&&i.test(n[s+4])&&i.test(n[s+5])){var l=parseInt(n.substring(s+1,s+6),16);t+=String.fromCharCode(l),u=!0,s+=5}else if(s<=a-3&&i.test(n[s+1])&&i.test(n[s+2])){var c=parseInt(n.substring(s+1,s+3),16);t+=String.fromCharCode(c),u=!0,s+=2}u||(t+=n[s])}}for(var d=new Uint8Array(t.length),f=0;f<t.length;f++)d[f]=255&t.charCodeAt(f);return d}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",e)}var t=e;239===t[0]&&187===t[1]&&191===t[2]&&(t=t.subarray(3));var n,i=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}(t);if("function"==typeof escape)n=escape(i);else{var o=/[A-Za-z0-9*_\+-\.\/]/;n="";for(var s=0;s<i.length;s++)if(o.test(i[s]))n+=i[s];else{var u=i.charCodeAt(s);n+=u>=256?"%u"+c(u,4):"%"+c(u,2)}}return decodeURIComponent(n)}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 p(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 v(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(){var e,t=(e=s.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this.isUsed=!1,this._trigger=n,this.signal=new l(r)}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},8555:function(e,t,n){"use strict";var r,i="pending",a="settled",o="fulfilled",s="rejected",u=function(){},l=void 0!==n.g&&void 0!==n.g.process&&"function"==typeof n.g.process.emit,c="undefined"==typeof setImmediate?setTimeout:setImmediate,d=[];function f(){for(var e=0;e<d.length;e++)d[e][0](d[e][1]);d=[],r=!1}function p(e,t){d.push([e,t]),r||(r=!0,c(f,0))}function v(e){var t=e.owner,n=t._state,r=t._data,i=e[n],a=e.then;if("function"==typeof i){n=o;try{r=i(r)}catch(e){y(a,e)}}h(a,r)||(n===o&&m(a,r),n===s&&y(a,r))}function h(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"==typeof t)){var r=t.then;if("function"==typeof r)return r.call(t,(function(r){n||(n=!0,t===r?g(e,r):m(e,r))}),(function(t){n||(n=!0,y(e,t))})),!0}}catch(t){return n||y(e,t),!0}return!1}function m(e,t){e!==t&&h(e,t)||g(e,t)}function g(e,t){e._state===i&&(e._state=a,e._data=t,p(b,e))}function y(e,t){e._state===i&&(e._state=a,e._data=t,p(T,e))}function _(e){e._then=e._then.forEach(v)}function b(e){e._state=o,_(e)}function T(e){e._state=s,_(e),!e._handled&&l&&n.g.process.emit("unhandledRejection",e._data,e)}function E(e){n.g.process.emit("rejectionHandled",e)}function S(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof S==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){y(t,e)}try{e((function(e){m(t,e)}),n)}catch(e){n(e)}}(e,this)}S.prototype={constructor:S,_state:i,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(u),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===s&&l&&p(E,this)),this._state===o||this._state===s?p(v,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},S.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new S((function(t,n){var r=[],i=0;function a(e){return i++,function(n){r[e]=n,--i||t(r)}}for(var o,s=0;s<e.length;s++)(o=e[s])&&"function"==typeof o.then?o.then(a(s),n):r[s]=o;i||t(r)}))},S.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new S((function(t,n){for(var r,i=0;i<e.length;i++)(r=e[i])&&"function"==typeof r.then?r.then(t,n):t(r)}))},S.resolve=function(e){return e&&"object"==typeof e&&e.constructor===S?e:new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},e.exports=S},5666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new Z(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return M()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?v:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function m(){}function g(){}function y(){}var _={};u(_,a,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(x([])));T&&T!==n&&r.call(T,a)&&(_=T);var E=y.prototype=m.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function A(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Z(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function x(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:M}}function M(){return{value:t,done:!0}}return g.prototype=y,u(E,"constructor",y),u(y,"constructor",g),g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(w.prototype),u(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=x,Z.prototype={constructor:Z,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(I),!e)for(var n in this)"t"===n.charAt(0)&&r.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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},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),I(n),h}},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;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return v},Lv:function(){return p}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),p=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),v=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(p);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var v=(0,r.XA)(p),h=v.next();!h.done;h=v.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2334:function(e,t,n){"use strict";n.d(t,{a:function(){return m}});var r=n(1480),i=Array.isArray,a=Object.getPrototypeOf,o=Object.prototype,s=Object.keys;function u(e){if(1===e.length){var t=e[0];if(i(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&a(r)===o){var n=s(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var l=n(3102),c=n(278),d=n(3211),f=n(2457);function p(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var v=n(2566),h=n(7845);function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,f.yG)(e),i=(0,f.jO)(e),a=u(e),o=a.args,s=a.keys;if(0===o.length)return(0,l.D)([],n);var v=new r.y(g(o,n,s?function(e){return p(s,e)}:c.y));return i?v.pipe((0,d.Z)(i)):v}function g(e,t,n){return void 0===n&&(n=c.y),function(r){y(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){y(t,(function(){var u=(0,l.D)(e[i],t),c=!1;u.subscribe(new v.Q(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function y(e,t,n){e?(0,h.f)(n,e,t):t()}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var p=n(1764),v=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,p.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,v.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(5987),i=n(7878),a=n(1480),o=n(3994),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function p(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return p(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(v(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(v(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return p(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function v(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),p=n(5),v=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[v.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,p.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},4181:function(e,t,n){"use strict";n.d(t,{S:function(){return u}});var r=n(1480),i=n(7878),a=Array.isArray;function o(e){return 1===e.length&&a(e[0])?e[0]:e}var s=n(2566);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o(e)).length?(0,i.Xf)(e[0]):new r.y(l(e))}function l(e){return function(t){for(var n=[],r=function(r){n.push((0,i.Xf)(e[r]).subscribe(new s.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},a=0;n&&!t.closed&&a<e.length;a++)r(a)}}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},3833:function(e,t,n){"use strict";n.d(t,{h:function(){return i}});var r=n(9127);function i(e){return(0,r.U)((function(){return e}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(3994),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},9007:function(e,t,n){"use strict";n.d(t,{p:function(){return o}});var r=n(7878),i=n(7845),a=n(2566);function o(e,t,n,o,s,u,l,c){var d=[],f=0,p=0,v=!1,h=function(){!v||d.length||f||t.complete()},m=function(e){return f<o?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,r.Xf)(n(e,p++)).subscribe(new a.Q(t,(function(e){null==s||s(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,i.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<o;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new a.Q(t,m,(function(){v=!0,h()}))),function(){null==c||c()}}},3994:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var r=n(9127),i=n(7878),a=n(6798),o=n(9007),s=n(8474);function u(e,t,n){return void 0===n&&(n=1/0),(0,s.m)(t)?u((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return(0,o.p)(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,v=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=v=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,v||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||v||f||(r=c(g,p))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){v=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,p=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},v=0;v<l;v++)p(v);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{z:function(){return i},P:function(){return a}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{jO:function(){return o},yG:function(){return s},_6:function(){return u}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{x:function(){return a},O:function(){return o}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{Q:function(){return a},L:function(){return o}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{ZT:function(){return i},mG:function(){return a},Jh:function(){return o},XA:function(){return s},CR:function(){return u},ev:function(){return l},qq:function(){return c},FC:function(){return d},KL:function(){return f}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct: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}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return wi}});var e=n(3144),t=n(4578),i=n(6716),a=n(3),o=n(3505),s=n(9127),u=n(3741),l=n(2817),c=n(3994),d=n(8515),f=n(1480),p=n(9917),v={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=v);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new f.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,p.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=n(2334),_=n(6108),b=n(6362),T=n(4727),E=n(3071),S=n(6798),w=n(2566);var k=n(4978),A=n(1545),I=n(8719);function Z(){if(x()){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 x(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var M=n(3666),R=n(3887);function C(){if(!M.vU)return!0;var e=function(){if(!M.vU)return R.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 P=n(944),N=n(3714),O=n(8750),D=n(5992),L=n(7874),U=n(1989),B=n(4791),F=n(1959),z=n(1946),K=n(8026),V=n(9589),G=n(2829),H=n(5095),W=n(8806),j=n(8894),q=n(6139),Y=n(6033);function $(e){return(0,p.P)((function(){var t=Y.Z.getState(e);if(null===t)return(0,l.of)(null);R.Z.info("EME: Disposing of the current MediaKeys");var n=t.loadedSessionsStore;return Y.Z.clearState(e),n.closeAllSessions().pipe((0,c.z)((function(){return(0,q.Y)(e,null)})))}))}function X(e){var t=Y.Z.getState(e);return null==t?null:t.keySystemOptions.type}var Q=n(533);function J(e){return(0,p.P)((function(){if(R.Z.info("EME: Clearing-up EME session."),M.fq)return R.Z.info("EME: disposing current MediaKeys."),$(e).pipe((0,Q.l)());var t=Y.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(R.Z.info("EME: closing all current sessions."),t.loadedSessionsStore.closeAllSessions().pipe((0,Q.l)())):(R.Z.info("EME: Nothing to clear. Returning right away. No state =",null===t),A.E)}))}var ee=n(5861),te=n(7757),ne=n.n(te),re=n(8555),ie=n.n(re),ae=n(811),oe=n(288),se=n(9105),ue=n(9362);function le(e){return e instanceof se.Z?new ue.Z("PIPELINE_LOAD_ERROR",e):(0,O.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var ce=n(7839),de=n(9822);function fe(e,t){return new(ie())((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}var pe=n(2572);function ve(e){return e instanceof se.Z?e.type===D.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===D.br.TIMEOUT||e.type===D.br.ERROR_EVENT:e instanceof ce.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,de.Z)(e)&&"INTEGRITY_ERROR"===e.code}function he(e){return e instanceof se.Z?e.type===D.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof ce.Z&&e.isOfflineError}function me(e){return he(e)?2:1}function ge(e,t,n,r){if(r.isCancelled)return ie().reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(R.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),ie().reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return p.apply(this,arguments)}function p(){return(p=(0,ee.Z)(ne().mark((function e(n,p){var v,h,m,g,y,_,b,T;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return v=e.sent,e.abrupt("return",v);case 7:if(e.prev=7,e.t0=e.catch(0),!oe.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(ve(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(p,1),h=p>=d.length-1?0:p,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=me(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(p<d.length-1)){e.next=29;break}if(y=p+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,pe.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,fe(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function ye(e,t,n){return ge([null],e,t,n)}function _e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return be(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 be(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 be(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 Te=P.Z.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,Ee=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Se=P.Z.INITIAL_BACKOFF_DELAY_BASE,we=P.Z.MAX_BACKOFF_DELAY_BASE;var ke=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new f.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new oe.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:le(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,ae.Z)(void 0!==i),ye((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(le(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return ye((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new f.y((function(r){var i,a=performance.now(),o=new oe.ZP,s=e.sendingTime,u=e.receivedTime,l=n._getBackoffSetting((function(e){r.next({type:"warning",value:le(e)})})),c={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var d=n._pipelines.parseManifest(e,c,p,o.signal,(function(e){return f.apply(this,arguments)}));(i=d)instanceof ie()||i instanceof Promise?d.then((function(e){return v(e.manifest)})).catch((function(e){o.isUsed||h(e,!0)})):v(d.manifest)}catch(e){if(o.isUsed)return;h(e,!0)}return function(){o.cancel()};function f(){return(f=(0,ee.Z)(ne().mark((function e(t){var n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ye(t,l,o.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),le(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function p(e){for(var t,n=_e(e);!(t=n()).done;){var r=t.value;if(o.isUsed)return;h(r,!1)}}function v(e){p(e.contentWarnings);var t=performance.now()-a;R.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:s,receivedTime:u,parsingTime:t}),r.complete()}function h(e,t){var n=(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=this._settings,n=t.lowLatencyMode,r=t.maxRetryRegular,i=t.maxRetryOffline;return{onRetry:e,baseDelay:n?Se.LOW_LATENCY:Se.REGULAR,maxDelay:n?we.LOW_LATENCY:we.REGULAR,maxRetryRegular:null!=r?r:Te,maxRetryOffline:null!=i?i:Ee}},e}();var Ae=n(5138),Ie=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("FP Error: 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){var n=this,r=new f.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ae.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ae.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void R.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ae.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)R.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;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._startWaitingQueueTask(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._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?R.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,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})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ae.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,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._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),Ze=n(520),xe=n(7714),Me=n(908),Re=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}(),Ce=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,Pe=P.Z.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,Ne=P.Z.INITIAL_BACKOFF_DELAY_BASE,Oe=P.Z.MAX_BACKOFF_DELAY_BASE,De=(0,Me.Z)();var Le=P.Z.MIN_CANCELABLE_PRIORITY,Ue=P.Z.MAX_HIGH_PRIORITY_LEVEL,Be=function(){function e(e,t){this._transport=e,this._prioritizer=new Ie({prioritySteps:{high:Ue,low:Le}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode;return{maxRetryRegular:"image"===e?0:null!=n?n:Ce,maxRetryOffline:null!=r?r:Pe,baseDelay:i?Ne.LOW_LATENCY:Ne.REGULAR,maxDelay:i?Oe.LOW_LATENCY:Oe.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,xe.Z)(["audio","video"],e)?new Re:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,Ze.K)(e);return new f.y((function(u){var l,c,d,f=De(),p=new oe.ZP,v=[],h=0,m=!1,g={onProgress:function(e){var t;void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(R.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(R.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),ge(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,K.Z)({onRetry:function(e){u.next({type:"retry",value:le(e)})}},r),p.signal).then((function(t){var r;if(R.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});R.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType&&(d=t.resultData,b()),p.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){R.Z.debug("SF: Segment request failed",s),d=null,u.error(le(e))})),function(){var e;void 0===d&&(R.Z.debug("SF: Segment request cancelled",s),d=null,p.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){v.push(!1);var r=v.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return v[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,v[r]=!0,b()),s}catch(e){throw(0,O.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,z.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&v.length>0&&v.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):R.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Fe=n(9007);var ze=n(7878);function Ke(e,t){return t?function(n){return n.pipe(Ke((function(n,r){return(0,ze.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,S.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new w.Q(n,(function(t){i||(i=new w.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,ze.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Ve=n(2006);function Ge(e){return(0,S.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var He=n(8333),We=n(2793),je=n(5278),qe=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}(),Ye=P.Z.ABR_MINIMUM_TOTAL_BYTES,$e=P.Z.ABR_MINIMUM_CHUNK_SIZE,Xe=P.Z.ABR_FAST_EMA,Qe=P.Z.ABR_SLOW_EMA,Je=function(){function e(){this._fastEWMA=new qe(Xe),this._slowEWMA=new qe(Qe),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<$e)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){if(!(this._bytesSampled<Ye))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){this._fastEWMA=new qe(Xe),this._slowEWMA=new qe(Qe),this._bytesSampled=0},e}(),et=n(3428);function tt(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}}function nt(e,t){var n=tt(t);return R.Z.debug("ABR: Steps for buffer based chooser.",n.map((function(e,n){return{bufferLevel:e,bitrate:t[n]}}))),e.pipe((0,s.U)((function(e){return function(e,t,n){var r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return t[0];var s,u=(0,Ae.Z)(t,(function(e){return e===i}));if(u<0||t.length!==n.length)return R.Z.error("ABR: Current Bitrate not found in the calculated levels"),t[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=n[u],c=function(){for(var e=u+1;e<n.length;e++)if(n[e]>l)return e}();if(null!=c&&r>=n[c])return t[c]}if((null==s||s<1.15)&&r<n[u]){for(var d=u-1;d>=0;d--)if(t[d]<i)return t[d];return i}return i}(e,t,n)})))}var rt=n(3274),it=P.Z.ABR_REGULAR_FACTOR,at=P.Z.ABR_STARVATION_DURATION_DELTA,ot=P.Z.ABR_STARVATION_FACTOR,st=P.Z.ABR_STARVATION_GAP,ut=P.Z.OUT_OF_STARVATION_GAP;function lt(e){if(!(e.progress.length<5)){for(var t=new qe(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 ct(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var dt=function(){function e(e,t){this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:st.LOW_LATENCY,outOfStarvationGap:ut.LOW_LATENCY,starvationBitrateFactor:ot.LOW_LATENCY,regularBitrateFactor:it.LOW_LATENCY}:{starvationGap:st.DEFAULT,outOfStarvationGap:ut.DEFAULT,starvationBitrateFactor:ot.DEFAULT,regularBitrateFactor:it.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0;return isNaN(c)||d+l<c-at?!this._inStarvationMode&&d<=s.starvationGap?(R.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(R.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(R.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(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+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,p=lt(c);if(void 0!==f&&void 0!==p){var v=ct(f,p);if((d-f.timestamp)/1e3<=v&&v-u/o>2e3)return p}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(R.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position+r,a=(0,rt.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=lt(a);if(void 0===s||void 0===u)return!0;var l=ct(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function ft(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 pt(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 pt(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 pt(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 vt=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=ht(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(R.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,Ae.Z)(e,(function(e){return e.id===t.id}));if(n<0)return R.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=ht(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=ft(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=lt(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function ht(e,t){var n=e.length,r=(0,Ae.Z)(e,(function(e){return e.id===t.id}));if(r<0)return R.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var mt=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}(),gt=n(1679),yt=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):R.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&R.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,gt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),_t=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 qe(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(R.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function bt(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ae.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}function Tt(e,t){var n=e;return null!=t.bitrate&&(n=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,Ae.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(n,t.bitrate)),null!=t.width&&(n=function(e,t){var n=e.slice().sort((function(e,t){return(0,je.Z)(e.width,0)-(0,je.Z)(t.width,0)})),r=(0,rt.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}))}(n,t.width)),n}function Et(e){var t=e.bandwidthEstimator,n=e.observation$,r=e.filters$,i=e.initialBitrate,a=e.lowLatencyMode,o=e.manualBitrate$,u=e.minAutoBitrate$,c=e.maxAutoBitrate$,d=e.representations,f=e.streamEvents$,v=new _t,h=new dt(null==i?0:i,a),g=new yt;var b=f.pipe((0,m.h)((function(e){return"metrics"===e.type})),(0,Ve.b)((function(e){return function(e){var n=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(t.addSample(n,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,n/1e3,u)}}(e.value)})),(0,Q.l)()),T=f.pipe((0,Ve.b)((function(e){switch(e.type){case"requestBegin":g.add(e.value);break;case"requestEnd":g.remove(e.value.id);break;case"progress":g.addProgress(e.value)}})),(0,Q.l)()),S=f.pipe((0,m.h)((function(e){return"representationChange"===e.type})),(0,s.U)((function(e){return e.value.representation})),(0,_.O)(null)),w=(0,p.P)((function(){if(0===d.length)throw new Error("ABRManager: no representation choice given");return 1===d.length?(0,l.of)({bitrate:void 0,representation:d[0],manual:!1,urgent:!0,knownStableBitrate:void 0}):o.pipe((0,k.w)((function(e){if(e>=0){var i=bt(d,e,0,1/0);return(0,l.of)({representation:i,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}var o=new mt,p=!1,b=new vt(v,o),T=nt(f.pipe((0,m.h)((function(e){return"added-segment"===e.type})),(0,et.M)(n),(0,s.U)((function(e){var t=e[0].value,n=e[1],r=n.speed,i=n.position,a=t.buffered,o=(0,G.L7)(a,i),s=t.content.representation,u=v.getEstimate(s),l=null==u?void 0:u[0];return{bufferGap:o,currentBitrate:s.bitrate,currentScore:l,speed:r}}))),d.map((function(e){return e.bitrate}))).pipe((0,_.O)(void 0));return(0,y.a)([n,u,c,r,T]).pipe((0,et.M)(S),(0,s.U)((function(e){var n=e[0],r=n[0],i=n[1],s=n[2],u=n[3],l=n[4],c=e[1],f=r.bufferGap,m=r.liveGap,y=Tt(d,u),_=g.getRequests(),T=h.getBandwidthEstimate(r,t,c,_,o.bandwidth),E=T.bandwidthEstimate,S=T.bitrateChosen,w=v.getLastStableRepresentation(),k=null===w?void 0:w.bitrate/(r.speed>0?r.speed:1);p&&f<=5?p=!1:!p&&isFinite(f)&&f>10&&(p=!0);var A=bt(y,S,i,s),I=A.bitrate,Z=null;p&&void 0!==l&&l>I&&(I=(Z=bt(y,l,i,s)).bitrate);var x=null;return a&&null!==c&&void 0!==m&&m<40&&(x=b.getGuess(d,r,c,I,_)),null!==x&&x.bitrate>I?(R.Z.debug("ABR: Choosing representation with guess-based estimation.",x.bitrate,x.id),o.update(x,E,2),{bitrate:E,representation:x,urgent:null===c||x.bitrate<c.bitrate,manual:!1,knownStableBitrate:k}):null!==Z?(R.Z.debug("ABR: Choosing representation with buffer-based estimation.",Z.bitrate,Z.id),o.update(Z,E,0),{bitrate:E,representation:Z,urgent:h.isUrgent(Z.bitrate,c,_,r),manual:!1,knownStableBitrate:k}):(R.Z.debug("ABR: Choosing representation with bandwidth estimation.",A.bitrate,A.id),o.update(A,E,1),{bitrate:E,representation:A,urgent:h.isUrgent(A.bitrate,c,_,r),manual:!1,knownStableBitrate:k})})))})))}));return(0,E.T)(b,T,w)}var St=function(){function e(e){this._manualBitrates=e.manualBitrates,this._minAutoBitrates=e.minAutoBitrates,this._maxAutoBitrates=e.maxAutoBitrates,this._initialBitrates=e.initialBitrates,this._throttlers=e.throttlers,this._bandwidthEstimators={},this._lowLatencyMode=e.lowLatencyMode}var t=e.prototype;return t.get$=function(e,t,n,r){var i,a,o,u=this._getBandwidthEstimator(e),c=(0,je.Z)(null===(i=this._manualBitrates[e])||void 0===i?void 0:i.asObservable(),(0,l.of)(-1)),d=(0,je.Z)(null===(a=this._minAutoBitrates[e])||void 0===a?void 0:a.asObservable(),(0,l.of)(0)),f=(0,je.Z)(null===(o=this._maxAutoBitrates[e])||void 0===o?void 0:o.asObservable(),(0,l.of)(1/0)),p=(0,je.Z)(this._initialBitrates[e],0);return Et({bandwidthEstimator:u,streamEvents$:r,observation$:n,filters$:function(e,t,n){var r=[];null!=e&&r.push(e.pipe((0,s.U)((function(e){return{width:e}}))));null!=n&&r.push(n.pipe((0,s.U)((function(e){return{bitrate:e}}))));null!=t&&r.push(t.pipe((0,s.U)((function(e){return{bitrate:e}}))));return r.length>0?(0,y.a)(r).pipe((0,s.U)((function(e){return K.Z.apply(void 0,[{}].concat(e))}))):(0,l.of)({})}(this._throttlers.limitWidth[e],this._throttlers.throttleBitrate[e],this._throttlers.throttle[e]),initialBitrate:p,manualBitrate$:c,minAutoBitrate$:d,maxAutoBitrate$:f,representations:t,lowLatencyMode:this._lowLatencyMode})},t._getBandwidthEstimator=function(e){var t=this._bandwidthEstimators[e];if(null==t){R.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var n=new Je;return this._bandwidthEstimators[e]=n,n}return t},e}(),wt=n(4507),kt=n(5767),At=n(3774),It=n(6923),Zt=I.ym;function xt(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&&(R.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){R.Z.warn("Init: Error while disposing SourceBuffer",e)}}i.length>0&&R.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,kt.Z)(e),null!==n)try{R.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){R.Z.warn("Init: Error while revoking the media source URL",e)}}function Mt(e){return function(e){return new f.y((function(t){if(null==At.J)throw new N.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,It.Z)(e.src)?e.src:null;xt(e,null,n),R.Z.info("Init: Creating MediaSource");var r=new At.J,i=URL.createObjectURL(r);return R.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){xt(e,r,i)}}))}(e).pipe((0,c.z)((function(e){return Zt(e).pipe((0,T.q)(1),(0,s.U)((function(){return e})))})))}var Rt=n(8343),Ct=P.Z.DEFAULT_LIVE_GAP;var Pt=n(3610),Nt=n(6697),Ot=n(2401);var Dt=n(7904),Lt=n(6968),Ut=n(2870),Bt=n(9612),Ft=P.Z.SOURCE_BUFFER_FLUSHING_INTERVAL;var zt=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);return a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n,(0,Nt.F)(Ft).pipe((0,Ve.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"error").pipe((0,Ve.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,Ot.R)(a._sourceBuffer,"updateend").pipe((0,Ve.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return R.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,Ze.K)(e.inventoryInfos)),this._addToQueue({type:Bt.f.Push,value:e})},r.removeBuffer=function(e,t){return R.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Bt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return R.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,Ze.K)(e)),this._addToQueue({type:Bt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Bt.f.Push:case Bt.f.Remove:case Bt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){R.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e)}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new f.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,K.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Bt.f.Push||0===e.data.length){switch(e.type){case Bt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Bt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case Bt.f.Remove:this.synchronizeInventory();break;default:(0,Dt.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Bt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,K.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,K.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Bt.f.EndOfSegment:return R.Z.debug("AVSB: Acknowledging complete segment",(0,Ze.K)(this._pendingTask.value)),void this._flush();case Bt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();R.Z.debug("AVSB: pushing segment",this.bufferType,(0,Ze.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case Bt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;R.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Dt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(R.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return R.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:R.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;R.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Lt._f)(s);this._lastInitSegment={data:u,hash:(0,Ut.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Lt._f)(e);if((0,Ut.Z)(n)===this._lastInitSegment.hash&&(0,B.Z)(t,n))return!0}return!1},n}(Bt.C),Kt=["audio","video","text","image"];function Vt(e){return"audio"===e||"video"===e}var Gt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Vt(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==L.Z.nativeTextTracksBuffer&&null==L.Z.htmlTextTracksBuffer||e.push("text"),null!=L.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(){var e=this;return this._areNativeBuffersUsable()?(0,l.of)(void 0):new f.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},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 R.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(Vt(e)){if(null!=i)return i instanceof zt&&i.codec!==t?R.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):R.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;R.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new zt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return R.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(R.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==L.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new L.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==L.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new L.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==L.Z.imageBuffer)throw new Error("Image buffer feature not activated");return R.Z.info("SB: Creating a new image SegmentBuffer"),r=new L.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw R.Z.error("SB: Unknown buffer type:",e),new N.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?(R.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):R.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Kt.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}(),Ht=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,rt.Z)(this._array,e)},t.has=function(e){return(0,xe.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}(),Wt=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}(),jt=n(3102),qt=n(9834);function Yt(e){var t=e.segmentBuffer,n=e.currentTime$,r=e.maxBufferBehind$,i=e.maxBufferAhead$;return(0,y.a)([n,r,i]).pipe((0,c.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return A.E;var i=[],a=(0,G.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,jt.D)(i.map((function(t){return R.Z.debug("GC: cleaning range from SegmentBuffer",t),e.removeBuffer(t.start,t.end)}))).pipe((0,qt.u)(),(0,Q.l)())}(t,n,r,i)})))}var $t=n(8567),Xt=n(9878);function Qt(e,t,n,r){return n.observe(!0).pipe((0,s.U)((function(i){var a,o=n.getCurrentTime()+r,s=Math.min(Math.max(e.start,o),null!==(a=e.end)&&void 0!==a?a:1/0);return $t.Z.waitingMediaSourceReload(t,e,s,!i.isPaused)})))}var Jt=n(7473),en=n.n(Jt);var tn=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new a.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,p.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,k.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():A.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,k.w)((function(t){return null===t.initSegment?A.E:e._requestInitSegment(t.initSegment)})));return(0,E.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,l.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,a=(0,K.Z)({segment:r},e._content),o=e._segmentFetcher.createRequest(a,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:o},o.pipe((0,c.z)((function(n){switch(n.type){case"retry":return(0,l.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return R.Z.info("Stream: segment request interrupted temporarly.",r),A.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,l.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,T.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,ae.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,K.Z)({},t,{type:"parsed-media",segment:r})})),Ge((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,Dt.Z)(n)}})))};return(0,p.P)((function(){return n(t)})).pipe(Ge((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,A.E;var n=e.segment,r=e.priority,i=(0,K.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,l.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return R.Z.info("Stream: init segment request interrupted temporarly.",n),A.E;case"chunk":var r=e.parse(void 0);return(0,ae.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,b.z)((0,l.of)((0,K.Z)({},r,{type:"parsed-init",segment:n})),(0,p.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),A.E})));case"chunk-complete":return(0,l.of)({type:"end-of-segment",value:{segment:n}});case"ended":return A.E;default:(0,Dt.Z)(e)}}))).pipe(Ge((function(){t._initSegmentRequest=null})))},e}();function nn(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return R.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return R.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!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,p=i[d].bufferedStart;return R.Z.debug("RS: future discontinuity encountered",o.type,f,p),{start:f,end:p}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var v=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!==v){var h=i[v];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return R.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}var rn=P.Z.CONTENT_REPLACEMENT_PADDING,an=P.Z.BITRATE_REBUFFERING_RATIO,on=P.Z.MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT,sn=P.Z.MINIMUM_SEGMENT_SIZE,un=Math.min(1/60,sn);function ln(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=n.representation.index.getSegments(o.start,o.end-o.start),l=t.filter((function(e){return!dn(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){if(void 0===e.bufferedStart)return R.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>on)return R.Z.info("Stream: The start of the wanted segment has been garbage collected",e),!0;return!1}(e,r,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedStart;if(void 0!==t&&t-n>.05)return!0;var r=e[e.length-2].bufferedStart;return Math.abs(r-n)>.01}(s=a(e.infos),e.bufferedStart))return!1;R.Z.debug("Stream: skipping segment gc-ed at the start",e)}if(function(e,t,n){if(void 0===e.bufferedEnd)return R.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>on)return R.Z.info("Stream: The end of the wanted segment has been garbage collected",e),!0;return!1}(e,i,o.start)){if(function(e,t){if(e.length<2)return!0;var n=e[e.length-1].bufferedEnd;if(void 0!==t&&n-t>.05)return!0;var r=e[e.length-2].bufferedEnd;return Math.abs(r-n)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;R.Z.debug("Stream: skipping segment gc-ed at the end",e)}return!0}));return u.filter((function(e){var t=(0,K.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,Ze.z)(t,e)})))return!1;var a=e.duration,o=e.time,u=e.end;if(e.isInit)return!0;if(e.complete&&a<sn)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-un>o)&&(!(a.end+un<u)&&!dn(e,t,r,i))})))return!1;for(var c=0;c<l.length;c++){var d=l[c];if(d.infos.period.id===n.period.id){var f=d.infos.segment;if(o-f.time>-un&&f.end-u>-un)return!1}}for(var p=0;p<l.length;p++){var v=l[p];if(v.end>o)return v.start>o+un||cn(l,p).end<u-un}return!0}))}function cn(e,t){for(var n=t+1;n<e.length-1&&e[n-1].end+un>e[n].start;)n++;return e[--n]}function dn(e,t,n,r){return e.period.id===t.period.id&&(!(e.segment.time<n+rn)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate;if(void 0===n){var i=r*an;return t.bitrate>i}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}var fn=P.Z.SEGMENT_PRIORITIES_STEPS;function pn(e,t){for(var n=e-t,r=0;r<fn.length;r++)if(n<fn[r])return r;return fn.length}var vn=P.Z.MINIMUM_SEGMENT_SIZE;function hn(e,t,n,r,i,a){var o,s=e.period,u=e.representation;a.synchronizeInventory();var l,c,d=t+i,f={start:Math.max(t,s.start),end:Math.min(d,null!==(o=s.end)&&void 0!==o?o:1/0)},p=u.index.shouldRefresh(t,d),v=a.getPendingOperations().filter((function(e){return e.type===Bt.f.EndOfSegment})).map((function(e){return e.value})),h=function(e,t){for(var n=Math.max(1/60,vn),r=e.start+n,i=e.end-n,a=[],o=t.length-1;o>=0;o--){var s=t[o],u=s.infos.representation;if(!s.partiallyPushed&&!1!==u.decipherable&&u.isSupported){var l=s.infos.segment,c=l.time/l.timescale;((l.complete?c+l.duration/l.timescale:s.end)>r&&c<i||s.end>r&&s.start<i)&&a.unshift(s)}}return a}({start:Math.max(f.start-.5,0),end:f.end+.5},a.getInventory()),m=ln({content:e,bufferedSegments:h,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:a.getSegmentHistory.bind(a),neededRange:f,segmentsBeingPushed:v}).map((function(e){return{priority:pn(e.time,t),segment:e}})),g=u.index.getLastPosition();if(!u.index.isInitialized()||void 0===s.end||m.length>0)l=!1;else if(void 0===g)l=f.end>=s.end&&u.index.isFinished();else if(null===g)l=u.index.isFinished();else{var y=void 0!==s.end?Math.min(s.end,g):g;l=f.end>=y&&u.index.isFinished()}if(u.index.isInitialized()&&(u.index.areSegmentsChronologicallyGenerated()||l)){var _=null;v.length>0&&(_=Math.min.apply(Math,v.map((function(e){return e.segment.time})))),m.length>0&&(_=null!==_?Math.min(_,m[0].segment.time):m[0].segment.time),c=nn(e,f,_,l,h)}else c=null;return{imminentDiscontinuity:c,hasFinishedLoading:l,neededSegments:m,shouldRefreshManifest:p}}var mn=P.Z.BUFFER_GC_GAPS.CALM,gn=P.Z.BUFFER_GC_GAPS.BEEFY;function yn(e,t,n){for(var r=(0,G.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&&(R.Z.debug("Stream: GC removing part of inner range",o),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 _n(e,t,n){var r=t.pushChunk(n);return r.pipe((0,Xt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new N.Z("BUFFER_APPEND_ERROR",i)}return e.observe(!0).pipe((0,c.z)((function(e){var n,i,a=e.position+e.wantedTimeOffset;return(0,b.z)((n=a,i=t,(0,p.P)((function(){R.Z.warn("Stream: Running garbage collector");var e=i.getBufferedRanges(),t=yn(n,e,mn);return 0===t.length&&(t=yn(n,e,gn)),R.Z.debug("Stream: GC cleaning",t),(0,jt.D)(t.map((function(e){var t=e.start,n=e.end;return i.removeBuffer(t,n)}))).pipe((0,qt.u)())}))).pipe((0,Q.l)()),r).pipe((0,Xt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new N.Z("BUFFER_FULL_ERROR",t)})))})))})))}var bn=P.Z.APPEND_WINDOW_SECURITIES;var Tn=function(e){var t=e.content,n=e.options,r=e.playbackObserver,a=e.segmentBuffer,o=e.segmentFetcher,u=e.terminate$,d=t.period,f=t.adaptation,v=t.representation,h=n.bufferGoal$,m=n.drmSystemId,k=n.fastSwitchThreshold$,I=f.type,Z={segment:v.index.getInitSegment(),segmentData:null,isLoaded:!1},x=new i.x,M=(0,H.$)({initSegment:null,segmentQueue:[]}),C=null!==Z.segment,P=new tn(t,M,o,C);C||(Z.segmentData=null,Z.isLoaded=!0);var N=!1,O=A.E;if(void 0!==m){var D=v.getEncryptionData(m);D.length>0&&(O=l.of.apply(void 0,D.map((function(e){return $t.Z.encryptionDataEncountered(e)}))),N=!0)}var L,U,B=P.start().pipe((0,c.z)((function(e){switch(e.type){case"retry":return(0,b.z)((0,l.of)({type:"warning",value:e.value.error}),(0,p.P)((function(){var t=e.value.segment,n=v.index;if(!1===n.isSegmentStillAvailable(t))x.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,l.of)($t.Z.manifestMightBeOufOfSync());return A.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){en()((function(){x.next()})),Z.segmentData=e.initializationData,Z.isLoaded=!0;var n=v.getAllEncryptionData(),i=!N&&n.length>0?l.of.apply(void 0,n.map((function(e){return $t.Z.encryptionDataEncountered(e)}))):A.E,o=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,p.P)((function(){if(null===i)return A.E;var e=n.representation.getMimeTypeString();return _n(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return $t.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:a});return(0,E.T)(i,o)}var u=e.inbandEvents,c=e.needsManifestRefresh,d=e.protectionDataUpdate&&!N?l.of.apply(void 0,v.getAllEncryptionData().map((function(e){return $t.Z.encryptionDataEncountered(e)}))):A.E,f=!0===c?(0,l.of)($t.Z.needsManifestRefresh()):A.E,h=void 0!==u&&u.length>0?(0,l.of)({type:"inband-events",value:u}):A.E,m=Z.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,p.P)((function(){var e,u;if(null===i.chunkData)return A.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.appendWindow,p=n.representation.getMimeTypeString(),v=[void 0!==f[0]?Math.max(0,f[0]-bn.START):void 0,void 0!==f[1]?f[1]+bn.END:void 0],h={initSegment:r,chunk:l,timestampOffset:d,appendWindow:v,codec:p},m=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,g=m+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==v[0]&&(m=Math.max(m,v[0])),void 0!==v[1]&&(g=Math.min(g,v[1]));var y=(0,K.Z)({segment:a,start:m,end:g},n);return _n(t,o,{data:h,inventoryInfos:y}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return $t.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:a});return(0,b.z)(d,f,h,g)}(e);case"end-of-segment":var n=e.value.segment;return a.endOfSegment((0,K.Z)({segment:n},t)).pipe((0,Q.l)());case"end-of-queue":return x.next(),A.E;default:(0,Dt.Z)(e)}}))),F=(0,y.a)([r.observe(!0),h,u.pipe((0,T.q)(1),(0,_.O)(null)),x.pipe((0,_.O)(void 0))]).pipe((0,et.M)(k),(0,c.z)((function(e){var n=e[0],i=n[0],o=n[1],s=n[2],u=e[1],c=i.position+i.wantedTimeOffset,f=hn(t,c,r,u,o,a),p=f.neededSegments,h=null;if(v.index.isInitialized()){if(p.length>0&&!Z.isLoaded&&null!==Z.segment){var m=p[0].priority;h={segment:Z.segment,priority:m}}}else if(null===Z.segment)R.Z.warn("Stream: Uninitialized index without an initialization segment");else if(Z.isLoaded)R.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var g=i.position+i.wantedTimeOffset;h={segment:Z.segment,priority:pn(d.start,g)}}if(null===s)M.setValue({initSegment:h,segmentQueue:p});else{if(s.urgent)return R.Z.debug("Stream: Urgent switch, terminate now.",I),M.setValue({initSegment:null,segmentQueue:[]}),M.finish(),(0,l.of)($t.Z.streamTerminating());var y=p[0],_=P.getRequestedInitSegment(),T=P.getRequestedMediaSegment(),E=null===T||void 0===y||T.id!==y.segment.id?[]:[y],S=null===_?null:h;if(M.setValue({initSegment:S,segmentQueue:E}),0===E.length&&null===S)return R.Z.debug("Stream: No request left, terminate",I),M.finish(),(0,l.of)($t.Z.streamTerminating())}var w=(0,l.of)({type:"stream-status",value:{period:d,position:i.position,bufferType:I,imminentDiscontinuity:f.imminentDiscontinuity,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}});return f.shouldRefreshManifest?(0,b.z)((0,l.of)($t.Z.needsManifestRefresh()),w):w})),(L=function(e){return"stream-terminating"!==e.type},void 0===(U=!0)&&(U=!1),(0,S.e)((function(e,t){var n=0;e.subscribe(new w.Q(t,(function(e){var r=L(e,n++);(r||U)&&t.next(e),!r&&t.complete()})))}))));return(0,E.T)(F,B,O).pipe((0,g.B)())};var En=P.Z.DELTA_POSITION_AFTER_RELOAD;var Sn=function(e){var t=e.abrManager,n=e.playbackObserver,r=e.content,a=e.options,o=e.segmentBuffer,d=e.segmentFetcherCreator,f=e.wantedBufferAhead,v="direct"===a.manualBitrateSwitchingMode,h=r.manifest,y=r.period,_=r.adaptation,S={},w=function(e,t,n){var r=e.manifest,a=e.adaptation,o=new i.x;return{estimator$:(0,E.T)((0,F.R)(r,"decipherabilityUpdate"),(0,l.of)(null)).pipe((0,s.U)((function(){var e=a.getPlayableRepresentations();if(e.length<=0)throw new N.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+a.type+" Adaptation can be played");return e})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(e[n].id!==t[n].id)return!1;return!0})),(0,k.w)((function(e){return t.get$(a.type,e,n,o)}))),abrFeedbacks$:o}}(r,t,n.observe(!0)),I=w.estimator$,Z=w.abrFeedbacks$,x=d.createSegmentFetcher(_.type,{onRequestBegin:function(e){Z.next({type:"requestBegin",value:e})},onRequestEnd:function(e){Z.next({type:"requestEnd",value:e})},onProgress:function(e){Z.next({type:"progress",value:e})},onMetrics:function(e){Z.next({type:"metrics",value:e})}}),M=(0,H.$)(null),C=I.pipe((0,Ve.b)((function(e){M.setValue(e)})),(0,He.Z)(),(0,g.B)()),P=C.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return R.Z.debug("Stream: new "+_.type+" bitrate estimate",t),$t.Z.bitrateEstimationChange(_.type,t)}))),D=C.pipe(Ke((function(e,t){return L(e,0===t)})));return(0,E.T)(D,P);function L(e,t){var r=e.representation;if(v&&e.manual&&!t)return Qt(y,_.type,n,En.bitrateSwitch);var i=M.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==r.id||t.manual&&!e.manual})),(0,T.q)(1),(0,s.U)((function(e){return null===e?(R.Z.info("Stream: urgent Representation termination",_.type),{urgent:!0}):e.urgent?(R.Z.info("Stream: urgent Representation switch",_.type),{urgent:!0}):(R.Z.info("Stream: slow Representation switch",_.type),{urgent:!1})}))),o=a.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,l.of)(0),d=(0,l.of)($t.Z.representationChange(_.type,y,r));return(0,b.z)(d,U(r,i,o)).pipe((0,Ve.b)((function(e){if("representationChange"===e.type||"added-segment"===e.type)return Z.next(e)})),(0,c.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?A.E:L(t,!1)}return(0,l.of)(e)})))}function U(e,t,r){return(0,p.P)((function(){var i=S[e.id],u=null!=i?i:1;S[e.id]=u;var l=f.asObservable().pipe((0,s.U)((function(e){return e*u})));return R.Z.info("Stream: changing representation",_.type,e.id,e.bitrate),Tn({playbackObserver:n,content:{representation:e,adaptation:_,period:y,manifest:h},segmentBuffer:o,segmentFetcher:x,terminate$:t,options:{bufferGoal$:l,drmSystemId:a.drmSystemId,fastSwitchThreshold$:r}}).pipe((0,Xt.K)((function(n){var i=(0,O.Z)(n,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===i.code){var a=f.getValue(),o=u;if(o<=.25||a*o<=2)throw i;return S[e.id]=o-.25,U(e,t,r)}throw i})))}))}};function wn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable(),s=e.observe(!0);return(0,y.a)([s,o]).pipe((0,c.z)((function(e){var t=e[0],r=e[1],o=t.position;return void 0!==i.end&&o+r>=i.end&&(R.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,l.of)({type:"stream-status",value:{period:i,bufferType:n,position:t.position,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var kn=n(9252);var An=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,rt.Z)(i,(function(e){return(0,kn.Z)(e,"codecs=")})),l=(0,rt.Z)(s,(function(e){return(0,kn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]},In=P.Z.ADAPTATION_SWITCH_BUFFER_PADDINGS;function Zn(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return An(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,G.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,G.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,G.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var p=r.currentTime;if("video"===n.type&&(0,G.Ti)({start:s,end:u},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return An(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,G.A1)(d,p))return{type:"needs-reload",value:void 0};var v="audio"===n.type&&"direct"===i.audioTrackSwitchingMode,h=[],m=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!==m&&(void 0===m.bufferedEnd||t.start-m.bufferedEnd<1)&&h.push({start:0,end:t.start+1});var g=n.type,y=In[g].before;null==y&&(y=0);var _=In[g].after;if(null==_&&(_=0),v||h.push({start:p-y,end:p+_}),void 0!==t.end){var b=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!==b&&(void 0===b.bufferedStart||b.bufferedStart-t.end<1)&&h.push({start:t.end-1,end:Number.MAX_VALUE})}var T=(0,G.uH)(f,h);return 0===T.length?{type:"continue",value:void 0}:v?{type:"flush-buffer",value:T}:{type:"clean-buffer",value:T}}var xn=P.Z.DELTA_POSITION_AFTER_RELOAD;var Mn=function(e){var t=e.abrManager,n=e.bufferType,r=e.content,i=e.garbageCollectors,o=e.playbackObserver,u=e.segmentFetcherCreator,d=e.segmentBuffersStore,f=e.options,v=e.wantedBufferAhead,h=r.period,m=new a.t(1);return m.pipe((0,k.w)((function(e,a){var m=0===a?0:"audio"===n?xn.trackSwitch.audio:"video"===n?xn.trackSwitch.video:xn.trackSwitch.other;if(null===e){R.Z.info("Stream: Set no "+n+" Adaptation. P:",h.start);var g,y=d.getStatus(n);if("initialized"===y.type){if(R.Z.info("Stream: Clearing previous "+n+" SegmentBuffer"),Gt.isNative(n))return Qt(h,n,o,0);g=y.value.removeBuffer(h.start,null==h.end?1/0:h.end)}else"uninitialized"===y.type&&d.disableSegmentBuffer(n),g=(0,l.of)(null);return(0,b.z)(g.pipe((0,s.U)((function(){return $t.Z.adaptationChange(n,null,h)}))),wn(o,v,n,{period:h}))}if(Gt.isNative(n)&&"disabled"===d.getStatus(n).type)return Qt(h,n,o,m);R.Z.info("Stream: Updating "+n+" adaptation","A: "+e.id,"P: "+h.start);var _=(0,p.P)((function(){var a=o.getReadyState(),p=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return R.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.representations;if(null==t[0])return"";return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(d,n,e,f),g={currentTime:o.getCurrentTime(),readyState:a},y=Zn(p,h,e,g,f);if("needs-reload"===y.type)return Qt(h,n,o,m);var _="flush-buffer"===y.type?(0,l.of)($t.Z.needsBufferFlush()):A.E,T="clean-buffer"===y.type||"flush-buffer"===y.type?b.z.apply(void 0,y.value.map((function(e){var t=e.start,n=e.end;return p.removeBuffer(t,n)}))).pipe((0,Q.l)()):A.E,S=i.get(p),w=function(e,i){var a=r.manifest,c=function(e,t){return e.deriveReadOnlyObserver((function(e){return e.pipe((0,s.U)(n))}),n);function n(e){var n=t.getBufferedRanges();return(0,K.Z)({},e,{bufferGap:(0,G.L7)(n,e.position)})}}(o,i);return Sn({abrManager:t,content:{manifest:a,period:h,adaptation:e},options:f,playbackObserver:c,segmentBuffer:i,segmentFetcherCreator:u,wantedBufferAhead:v}).pipe((0,Xt.K)((function(e){if(!Gt.isNative(n)){R.Z.error("Stream: "+n+" Stream crashed. Aborting it.",e),d.disposeSegmentBuffer(n);var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,b.z)((0,l.of)($t.Z.warning(t)),wn(o,v,n,{period:h}))}throw R.Z.error("Stream: "+n+" Stream crashed. Stopping playback.",e),e})))}(e,p);return d.waitForUsableBuffers().pipe((0,c.z)((function(){return(0,b.z)(T,_,(0,E.T)(w,S))})))}));return(0,b.z)((0,l.of)($t.Z.adaptationChange(n,e,h)),_)})),(0,_.O)($t.Z.periodStreamReady(n,h,m)))},Rn=n(3074);function Cn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,_.O)(!1),(0,u.x)())}));return(0,y.a)(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var Pn=P.Z.MAXIMUM_MAX_BUFFER_AHEAD,Nn=P.Z.MAXIMUM_MAX_BUFFER_BEHIND;var On=function(e,t,n,r,a,d){var f,v,h=e.manifest,S=e.initialPeriod,w=d.maxBufferAhead,k=d.maxBufferBehind,I=d.wantedBufferAhead,Z=new Wt((function(e){var n=e.bufferType,r=null!=Nn[n]?Nn[n]:1/0,i=null!=Pn[n]?Pn[n]:1/0;return Yt({segmentBuffer:e,currentTime$:t.observe(!0).pipe((0,s.U)((function(e){return e.position+e.wantedTimeOffset}))),maxBufferBehind$:k.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:w.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),x=t.observe(!0).pipe((0,We.Z)((function(e){var t=e.position,n=e.wantedTimeOffset+t;if(n<h.getMinimumPosition()){var r=new N.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return $t.Z.warning(r)}if(n>h.getMaximumPosition()){var i=new N.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return $t.Z.warning(i)}return null}),null)),M=r.getBufferTypes().map((function(e){return function(e,n){var a=new Ht((function(e,t){return e.start-t.start})),o=new i.x,u=!1;function d(t){return D(e,t,o).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=a.head();if(void 0===t||t.id!==e.value.period.id)return $t.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return $t.Z.needsMediaSourceReload(r,i);case"periodStreamReady":u=!0,a.add(e.value.period);break;case"periodStreamCleared":a.removeElement(e.value.period)}return e})),(0,g.B)())}function f(e){var t=a.head(),n=a.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var v=t.observe(!0).pipe((0,We.Z)((function(t){var n,r=t.position,i=t.wantedTimeOffset,a=i+r;if(!u||!f(a))return null;var s=null!==(n=h.getPeriodForTime(a))&&void 0!==n?n:h.getNextPeriod(a);return void 0===s?null:(R.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,r+i),u=!1,o.next(),s)}),null),(0,c.z)((function(e){if(null==e)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(e)}))),m=(0,F.R)(h,"decipherabilityUpdate").pipe((0,c.z)((function(n){var i=r.getStatus(e),a=n.filter((function(t){return t.adaptation.type===e}));if(0===a.length||"initialized"!==i.type)return A.E;var s=a.filter((function(e){return!1===e.representation.decipherable})),f=i.value,v=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){R.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(f,s);return 0===v.length?A.E:(u=!1,o.next(),b.z.apply(void 0,v.map((function(e){var t=e.start,n=e.end;return f.removeBuffer(t,n).pipe((0,Q.l)())})).concat([t.observe(!0).pipe((0,T.q)(1),(0,c.z)((function(e){return(0,b.z)((0,l.of)($t.Z.needsDecipherabilityFlush(e.position,!e.isPaused,e.duration)),(0,p.P)((function(){var t=e.position+e.wantedTimeOffset,n=h.getPeriodForTime(t);if(null==n)throw new N.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return d(n)})))})))])))})));return(0,E.T)(v,m,d(n))}(e,S).pipe((0,He.Z)(),(0,g.B)())})),C=(f=M,v=f.length,E.T.apply(void 0,f).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Rn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===v&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return R.Z.info("Stream: New active period",e.start),$t.Z.activePeriodChanged(e)}))),P=(0,F.R)(h,"manifestUpdate").pipe((0,s.U)((function(){return h.isLastPeriodKnown})),(0,_.O)(h.isLastPeriodKnown),(0,u.x)()),O=(0,y.a)([Cn.apply(void 0,M),P]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?$t.Z.endOfStream():$t.Z.resumeStream()})));return E.T.apply(void 0,M.concat([C,O,x]));function D(e,s,u){R.Z.info("SO: Creating new Stream for",e,s.start);var f=new i.x,p=new i.x,v=t.observe(!0).pipe((0,m.h)((function(e){var t=e.position,n=e.wantedTimeOffset;return null!=s.end&&t+n>=s.end}))),y=f.pipe(Ke((function(t){return D(e,t,p)}))),_=u.pipe((0,T.q)(1),(0,Ve.b)((function(){f.complete(),p.next(),p.complete()})),(0,g.B)()),S=(0,E.T)(v,_),w=Mn({abrManager:n,bufferType:e,content:{manifest:h,period:s},garbageCollectors:Z,segmentFetcherCreator:a,segmentBuffersStore:r,options:d,playbackObserver:t,wantedBufferAhead:I}).pipe((0,c.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=h.getPeriodAfter(s);if(null===n)return(0,b.z)((0,l.of)(t),(0,l.of)($t.Z.streamComplete(e)));f.next(n)}else p.next();return(0,l.of)(t)})),(0,g.B)()),k=(0,b.z)(w.pipe((0,o.R)(S)),(0,l.of)($t.Z.periodStreamCleared(e,s)).pipe((0,Ve.b)((function(){R.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,E.T)(k,y,_.pipe((0,Q.l)()))}};function Dn(e,t,n){return function(e){return(0,E.T)((0,I.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,I.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,I.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,_.O)("open"===e.readyState),(0,u.x)())}(e).pipe((0,k.w)((function(t){return t?function(e){if(0===e.length)return(0,l.of)(void 0);for(var t=[],n=function(n){var r=e[n];t.push((0,E.T)((0,Ot.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,Ot.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,Nt.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,_.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return(0,y.a)(t).pipe((0,m.h)((function(e){return e.every((function(e){return!e}))})),(0,s.U)((function(){})))}(e.sourceBuffers):A.E})),(0,T.q)(1),(0,s.U)((function(){var r=t.getMaximumPosition(),i=t.isLive?Math.max(Math.pow(2,32),r+31536e3):r;return e.duration>=i||i===n?null:isNaN(e.duration)||!isFinite(e.duration)||i-e.duration>.01?(R.Z.info("Init: Updating duration",i),e.duration=i,i):null})),(0,Xt.K)((function(e){return R.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e),(0,l.of)(null)})))}var Ln=n(5039),Un=n(4181),Bn=n(5987);var Fn=I.gg,zn=I.ym,Kn=I._E;function Vn(e){return(0,p.P)((function(){if(R.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return R.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,l.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return R.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,l.of)(null);R.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return Kn(e).pipe((0,T.q)(1))}));return(0,Un.S)(E.T.apply(void 0,i).pipe((r=1,r<=0?function(){return A.E}:(0,S.e)((function(e,t){var n=[];e.subscribe(new w.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,Bn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),Fn(t).pipe((0,T.q)(1))).pipe((0,c.z)((function(){return Vn(e)})))}))}var Gn=n(7920),Hn=n(467);var Wn=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var jn=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(Wn(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n},qn=P.Z.STREAM_EVENT_EMITTER_POLL_INTERVAL;function Yn(e){return void 0!==e.end}var $n=function(e,t,n){var r=new WeakMap,i=[];return(0,F.R)(e,"manifestUpdate").pipe((0,_.O)(null),(0,Rn.R)((function(t){return jn(t,e)}),[])).pipe((0,Ve.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,k.w)((function(e){return e?(0,y.a)([(0,Nt.F)(qn).pipe((0,_.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,S.e)((function(e,t){var n,r=!1;e.subscribe(new w.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,c.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],c=0;c<e.length;c++){var d=e[c],f=d.start,p=Yn(d)?d.end:void 0;r.has(d)?(f>o||void 0!==p&&o>=p)&&(Yn(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==p&&o<p?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=p?p:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),Yn(d)&&u.push(d.publicEvent)))}return(0,b.z)(s.length>0?l.of.apply(void 0,s):A.E,u.length>0?l.of.apply(void 0,u).pipe((0,Ve.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,Q.l)()):A.E)}(i,t,n)}))):A.E})))},Xn=n(2983);function Qn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.abrManager,d=e.playbackObserver,f=e.segmentFetcherCreator;return function(e,v,h){var g,b=function(e,t){return(0,p.P)((function(){var n;return Dn(t,e).pipe((0,c.z)((function(r){return null!==r&&(n=r),(0,F.R)(e,"manifestUpdate").pipe((0,k.w)((function(){return Dn(t,e,n)})),(0,Ve.b)((function(e){null!==e&&(n=e)})))})),(0,Q.l)())}))}(n,e),T=null!==(g=n.getPeriodForTime(v))&&void 0!==g?g:n.getNextPeriod(v);if(void 0===T){var S=new N.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,Pt._)((function(){return S}))}var w=new Gt(t,e),I=(0,Gn.Z)({mediaElement:t,playbackObserver:d,startTime:v,mustAutoPlay:h}),Z=I.seekAndPlay$,x=I.initialPlayPerformed,M=I.initialSeekPerformed,C=d.observe(!0),P=x.asObservable().pipe((0,m.h)((function(e){return e})),(0,c.z)((function(){return $n(n,t,C)}))),O=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,u=n.startTime;return t.deriveReadOnlyObserver((function(t){return(0,y.a)([t,o.asObservable()]).pipe((0,s.U)((function(t){var n=t[0],o=t[1];return{liveGap:e.isLive?e.getMaximumPosition()-n.position:void 0,position:n.position,duration:n.duration,isPaused:i.getValue()?n.paused:!r,readyState:n.readyState,speed:o,wantedTimeOffset:a.getValue()?0:u-n.position}})))}))}(n,d,{autoPlay:h,initialPlayPerformed:x,initialSeekPerformed:M,speed:r,startTime:v}),D=new i.x,L=new i.x,U=new i.x,B=On({manifest:n,initialPeriod:T},O,u,w,f,a).pipe((0,c.z)((function(t){switch(t.type){case"end-of-stream":return R.Z.debug("Init: end-of-stream order received."),function(e){return zn(e).pipe((0,_.O)(null),(0,k.w)((function(){return Vn(e)})))}(e).pipe((0,Q.l)(),(0,o.R)(D));case"resume-stream":return R.Z.debug("Init: resume-stream order received."),D.next(null),A.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return L.next({period:r,bufferType:i,discontinuity:a,position:s}),A.E;case"locked-stream":return U.next(t.value),A.E;default:return(0,l.of)(t)}}))),z=(0,Xn.Z)(t,r,C).pipe((0,Q.l)()),K=(0,Hn.Z)(d,n,U,L),V=Z.pipe((0,k.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,Ln.Z)(C,t,w,!1)})));return(0,E.T)(b,V,z,K,B,P).pipe(Ge((function(){w.disposeAll()})))}}var Jn=n(6625);var er=P.Z.FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,tr=P.Z.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,nr=P.Z.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE;function rr(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,a=e.minimumManifestUpdateInterval,o=e.scheduleRefresh$,u=(t=function(e,t){return i.fetch(e).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new f.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),d=r.manifest,v=0;return(0,p.P)((function(){return h(r)}));function h(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,u=v>0?v<tr:void 0!==i&&i>=nr,f=void 0===t?0:performance.now()-t,p=Math.max(a-f,0),g=o.pipe((0,c.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&u;return ir(null!=r?r:0,a,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),y=null===d.expired?A.E:(0,Jn.H)(p).pipe((0,c.z)((function(){return null===d.expired?A.E:(0,jt.D)(d.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:u}}))),_=function(){if(void 0===d.lifetime||d.lifetime<0)return A.E;var e,t=1e3*d.lifetime-f;void 0===i?e=t:d.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-f,Math.max(t,0)+i),6*t),R.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*d.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),R.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,Jn.H)(Math.max(e,p)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:u}})))}();return(0,E.T)(_,g,y).pipe((0,T.q)(1),(0,c.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):h(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=d.updateUrl,i=t||void 0===r,o=i?d.getUrl():r,s=d.clockOffset;return n?(v+=1,R.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(v)+" consecutive time.")):v>0&&(R.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(v)+" consecutive times."),v=0),u(o,{externalClockOffset:s,previousManifest:d,unsafeMode:n}).pipe((0,c.z)((function(e){if("warning"===e.type)return(0,l.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,o=e.parsingTime,s=performance.now();if(i)d.replace(t);else try{d.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return R.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),ir(er,a,n).pipe((0,c.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,l.of)({type:"parsed",manifest:d,sendingTime:n,receivedTime:r,parsingTime:o,updatingTime:performance.now()-s})})))}}function ir(e,t,n){return(0,p.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,Jn.H)(Math.max(e-r,i))}))}var ar=n(2447),or=P.Z.OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;var sr=function(e){var t,n,r,a=e.adaptiveOptions,u=e.autoPlay,f=e.bufferOptions,p=e.keySystems,v=e.lowLatencyMode,h=e.manifest$,b=e.manifestFetcher,w=e.mediaElement,I=e.minimumManifestUpdateInterval,Z=e.playbackObserver,x=e.segmentFetcherCreator,M=e.speed,C=e.startAt,P=e.textTrackOptions,N=new St(a),O=Mt(w).pipe((0,d.d)({refCount:!0})),D=new i.x,L=(0,wt.Z)(w,p,D).pipe((0,He.Z)(),(0,g.B)()),U=(0,ar.Z)(w),B=L.pipe((t=function(e,t){switch(t.type){case"eme-disabled":case"attached-media-keys":return(0,l.of)({isEmeReady:!0,drmSystemId:e.drmSystemId});case"created-media-keys":var n=t.value.initializationDataSystemId;return O.pipe((0,c.z)((function(){return t.value.canAttachMediaKeys.setValue(!0),!0===t.value.options.disableMediaKeysAttachmentLock?(0,l.of)({isEmeReady:!0,drmSystemId:n}):A.E})),(0,_.O)({isEmeReady:!1,drmSystemId:n}));default:return A.E}},n={isEmeReady:!1,drmSystemId:void 0},void 0===r&&(r=1/0),(0,S.e)((function(e,i){var a=n;return(0,Fe.p)(e,i,(function(e,n){return t(a,e,n)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))),(0,m.h)((function(e){return e.isEmeReady})),(0,T.q)(1),Ke((function(e){var t=e.drmSystemId;return O.pipe((0,s.U)((function(e){return{mediaSource:e,drmSystemId:t}})))}))),z=(0,y.a)([h,B]).pipe((0,c.z)((function(e){var t=e[0],n=e[1];if("warning"===t.type)return(0,l.of)(t);var r=t.manifest,a=n.mediaSource,d=n.drmSystemId;R.Z.debug("Init: Calculating initial time");var p=function(e,t,n){if(null!=n){var r=e.getMinimumPosition(),i=e.getMaximumPosition();if(null!=n.position)return R.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,i),r);if(null!=n.wallClockTime){R.Z.debug("Init: using startAt.wallClockTime");var a=null==e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,i),r)}if(null!=n.fromFirstPosition){R.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?r:Math.min(i,r+s)}if(null!=n.fromLastPosition){R.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?i:Math.max(r,i+u)}if(null!=n.percentage){R.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?i:l<0?r:r+ +l/100*(i-r)}}var c=e.getMinimumPosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,p=e.clockOffset,v=e.getMaximumPosition();if(null==p)R.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=v;else{R.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var h=null==e.availabilityStartTime?0:e.availabilityStartTime,m=(performance.now()+p)/1e3-h;d=Math.min(v,m)}var g=void 0!==f?f:t?Ct.LOW_LATENCY:Ct.DEFAULT;return R.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+g),Math.max(d-g,c)}return R.Z.info("Init: starting at the minimum available position:",c),c}(r,v,C);R.Z.debug("Init: Initial time calculated:",p);var h=Qn({abrManager:N,bufferOptions:(0,K.Z)({textTrackOptions:P,drmSystemId:d},f),manifest:r,mediaElement:w,playbackObserver:Z,segmentFetcherCreator:x,speed:M}),m=function e(t,n,r){var a=new i.x,s=h(t,n,r).pipe((0,We.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return g.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":return g.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:or}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var t=X(w);if(null===(r=t)||r.indexOf("widevine")<0)return a.next(e.value),null;var n=e.value.position;return n+.001<e.value.duration?Z.setCurrentTime(w.currentTime+.001):Z.setCurrentTime(n),null;case"encryption-data-encountered":return D.next(e.value),null;case"needs-buffer-flush":return Z.setCurrentTime(w.currentTime+.001),null}var r;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,k.w)((function(t){return Mt(w).pipe((0,c.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,_.O)(Rt.Z.reloadingMediaSource()))})));return(0,E.T)(u,s)}(a,p,u),g=new i.x,y=rr({initialManifest:t,manifestFetcher:b,minimumManifestUpdateInterval:I,scheduleRefresh$:g}),T=(0,E.T)((0,F.R)(r,"manifestUpdate").pipe((0,s.U)((function(){return Rt.Z.manifestUpdate()}))),(0,F.R)(r,"decipherabilityUpdate").pipe((0,s.U)(Rt.Z.decipherabilityUpdate))),S=L.pipe((0,Ve.b)((function(e){"keys-update"===e.type?r.updateDeciperabilitiesBasedOnKeyIds(e.value):"blacklist-protection-data"===e.type&&(R.Z.info("Init: blacklisting Representations based on protection data."),r.addUndecipherableProtectionData(e.value))})),(0,Q.l)());return(0,E.T)(T,y,S,m).pipe((0,_.O)(Rt.Z.manifestReady(r)),Ge((function(){g.complete()})))})));return(0,E.T)(z,U,L)};var ur=P.Z.FORCED_ENDED_THRESHOLD,lr="STOPPED",cr="LOADED",dr="LOADING",fr="PLAYING",pr="PAUSED",vr="ENDED",hr="BUFFERING",mr="SEEKING",gr="RELOADING";var yr=n(5553);function _r(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 br(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 br(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 br(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 Tr=P.Z.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,Er=P.Z.DEFAULT_AUTO_PLAY,Sr=P.Z.DEFAULT_CODEC_SWITCHING_BEHAVIOR,wr=P.Z.DEFAULT_ENABLE_FAST_SWITCHING,kr=P.Z.DEFAULT_INITIAL_BITRATES,Ar=P.Z.DEFAULT_LIMIT_VIDEO_WIDTH,Ir=P.Z.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,Zr=P.Z.DEFAULT_MIN_BITRATES,xr=P.Z.DEFAULT_MAX_BITRATES,Mr=P.Z.DEFAULT_MAX_BUFFER_AHEAD,Rr=P.Z.DEFAULT_MAX_BUFFER_BEHIND,Cr=P.Z.DEFAULT_SHOW_NATIVE_SUBTITLE,Pr=P.Z.DEFAULT_STOP_AT_END,Nr=P.Z.DEFAULT_TEXT_TRACK_MODE,Or=P.Z.DEFAULT_THROTTLE_WHEN_HIDDEN,Dr=P.Z.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,Lr=P.Z.DEFAULT_WANTED_BUFFER_AHEAD;var Ur=P.Z.SAMPLING_INTERVAL_MEDIASOURCE,Br=P.Z.SAMPLING_INTERVAL_LOW_LATENCY,Fr=P.Z.SAMPLING_INTERVAL_NO_MEDIASOURCE,zr=P.Z.RESUME_GAP_AFTER_SEEKING,Kr=P.Z.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,Vr=P.Z.RESUME_GAP_AFTER_BUFFERING,Gr=P.Z.REBUFFERING_GAP,Hr=P.Z.MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING,Wr=["canplay","play","seeking","seeked","loadedmetadata","ratechange"],jr=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._lastObservation=null,this._observation$=null}var t=e.prototype;return t.getCurrentTime=function(){return this._mediaElement.currentTime},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.observe=function(e){var t=this;return(0,p.P)((function(){return null===t._observation$||null===t._lastObservation?(t._lastObservation=t._generateInitialObservation(),t._observation$=t._createInnerObservable().pipe((0,g.B)()),t.observe(e)):e?t._observation$.pipe((0,_.O)(t._lastObservation)):t._observation$}))},t.deriveReadOnlyObserver=function(e){return $r(this,e)},t._createInnerObservable=function(){var e=this;return(0,p.P)((function(){var t=function(t){var n,r=t;"seeking"===r&&e._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",e._internalSeekingEventsIncomingCounter-=1);var i=null!==(n=e._lastObservation)&&void 0!==n?n:e._generateInitialObservation(),a=Yr(e._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=t.event,u=t.position,l=t.bufferGap,c=t.currentRange,d=t.duration,f=t.paused,p=t.readyState,v=t.ended,h=e.rebuffering,m=e.event,g=e.position,y=function(e,t,n){var r=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=Gr[r]}(c,d,o),_=p>=1&&"loadedmetadata"!==s&&null===h&&!(y||v),b=null,T=o?Gr.LOW_LATENCY:Gr.DEFAULT;if(a){if(_)l<=T?(r=!0,b=u+l):l===1/0&&(r=!0,b=u);else if(null!==h){var E=qr(h,o);!0!==r&&null!==h&&p>1&&(y||v||l<1/0&&l>E)?i=!0:(l===1/0||l<=E)&&(b=l===1/0?u:u+l)}}else _&&(!f&&"timeupdate"===s&&"timeupdate"===m&&u===g||"seeking"===s&&l===1/0)?r=!0:null!==h&&("seeking"!==s&&u!==g||"canplay"===s||l<1/0&&(l>qr(h,o)||y||v))&&(i=!0);if(!0===i)return null;var S;if(!0===r||null!==h)return S="seeking"===s||null!==h&&"seeking"===h.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==h&&h.reason===S?{reason:h.reason,timestamp:h.timestamp,position:b}:{reason:S,timestamp:performance.now(),position:b};return null}(i,a,{lowLatencyMode:e._lowLatencyMode,withMediaSource:e._withMediaSource}),u=function(e,t){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&&t.bufferGap>Hr&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,K.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return R.Z.debug("API: current media element state",l),l},n=Wr.map((function(t){return(0,Ot.R)(e._mediaElement,t).pipe((0,s.U)((function(){return t})))})),r=e._lowLatencyMode?Br:e._withMediaSource?Ur:Fr,i=(0,Nt.F)(r).pipe((0,s.U)((function(){return"timeupdate"})));return E.T.apply(void 0,[i].concat(n)).pipe((0,s.U)((function(n){var r=t(n);return"DEBUG"===R.Z.getLevel()&&R.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var p=n.length-Math.floor(f.length/2);r=" ".repeat(p)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(r.buffered,r.position),"\n"+n),e._lastObservation=r,r})))}))},t._generateInitialObservation=function(){return(0,K.Z)(Yr(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function qr(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT";switch(e.reason){case"seeking":return zr[n];case"not-ready":return Kr[n];case"buffering":return Vr[n]}}function Yr(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,G.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function $r(e,t){var n=(0,p.P)((function(){return t(e.observe(!0))})).pipe((0,d.d)({bufferSize:1,refCount:!0}));return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},observe:function(e){return e?n:n.pipe((t=1,(0,m.h)((function(e,n){return t<=n}))));var t},deriveReadOnlyObserver:function(e){return $r(this,e)}}}var Xr=n(7829);function Qr(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Xr.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function Jr(e){return e.map((function(e){return null===e?e:{normalized:(0,Xr.ZP)(e.language),closedCaption:e.closedCaption}}))}var ei=function(){function e(e){this._periods=new Ht((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=si(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void R.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):R.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else R.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=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,xe.Z)(r,i))n.adaptation$.next(i);else{var a=ni(r,Qr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,xe.Z)(r,i))n.adaptation$.next(i);else{var a=ii(r,Jr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,z.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,xe.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=oi(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=ci(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.audio:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.text:null;if((0,z.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,rt.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ci(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=si(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,z.Z)(r))return null;var i={language:(0,je.Z)(r.language,""),normalized:(0,je.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(li)};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,z.Z)(r)?null:{language:(0,je.Z)(r.language,""),normalized:(0,je.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id}},t.getChosenVideoTrack=function(e){var t=si(this._periods,e),n=void 0!==t?t.video:null;if((0,z.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,z.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(ui),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(ui)};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.audio:null;if((0,z.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,je.Z)(e.language,""),normalized:(0,je.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(li)};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=si(this._periods,e),n=void 0!==t?t.text:null;if((0,z.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,z.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,je.Z)(e.language,""),normalized:(0,je.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id}}))},t.getAvailableVideoTracks=function(e){var t,n=si(this._periods,e),r=void 0!==n?n.video:null;if((0,z.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(ui),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(ui)};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=Qr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.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,xe.Z)(s,u))n(r+1);else{var l=ni(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=Jr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.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,xe.Z)(s,u))n(r+1);else{var l=ii(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,z.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,xe.Z)(s,u.baseAdaptation)){var l=ci(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=oi(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=ci(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function ti(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 ni(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=ti(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return e[0]}function ri(e){return function(t){return(0,je.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function ii(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=ri(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return null}function ai(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 oi(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=ai(r),a=(0,rt.Z)(e,i);if(void 0!==a)return a}return e[0]}function si(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ui(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function li(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function ci(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var di=P.Z.DEFAULT_UNMUTED_VOLUME,fi=I.Nh,pi=I._K,vi=I.C1,hi=I.Q1,mi=I.Qt,gi=I.yj,yi=I.d5,_i=I.UA,bi=I.$x,Ti=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,p,v,h;if((0,z.Z)(e.maxBufferAhead))t=Mr;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,z.Z)(e.maxBufferBehind))n=Rr;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,z.Z)(e.wantedBufferAhead))r=Lr;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");var m=(0,z.Z)(e.limitVideoWidth)?Ar:!!e.limitVideoWidth;if((0,z.Z)(e.throttleWhenHidden)?i=Or:((0,W.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),i=!!e.throttleWhenHidden),a=!i&&((0,z.Z)(e.throttleVideoBitrateWhenHidden)?Dr:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?s=e.preferredTextTracks:((0,W.Z)("Invalid `preferredTextTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?o=e.preferredAudioTracks:((0,W.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),o=[]):o=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?u=e.preferredVideoTracks:((0,W.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),u=[]):u=[],(0,z.Z)(e.videoElement))l=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");l=e.videoElement}if((0,z.Z)(e.initialVideoBitrate))c=kr.video;else if(c=Number(e.initialVideoBitrate),isNaN(c))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.initialAudioBitrate))d=kr.audio;else if(d=Number(e.initialAudioBitrate),isNaN(d))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.minVideoBitrate))p=Zr.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,z.Z)(e.minAudioBitrate))f=Zr.audio;else if(f=Number(e.minAudioBitrate),isNaN(f))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,z.Z)(e.maxVideoBitrate))h=xr.video;else{if(h=Number(e.maxVideoBitrate),isNaN(h))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>h)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+h+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,z.Z)(e.maxAudioBitrate))v=xr.audio;else{if(v=Number(e.maxAudioBitrate),isNaN(v))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(f>v)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+v+'", is inferior to the set minAudioBitrate, "'+f+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:m,videoElement:l,wantedBufferAhead:r,throttleWhenHidden:i,throttleVideoBitrateWhenHidden:a,preferredAudioTracks:o,preferredTextTracks:s,preferredVideoTracks:u,initialAudioBitrate:d,initialVideoBitrate:c,minAudioBitrate:f,minVideoBitrate:p,maxAudioBitrate:v,maxVideoBitrate:h,stopAtEnd:(0,z.Z)(e.stopAtEnd)?Pr:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,p=r.minVideoBitrate,v=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.stopAtEnd;return S.preload="auto",t.version="3.26.2",t.log=R.Z,t.state="STOPPED",t.videoElement=S,t._priv_destroy$=new i.x,t._priv_pictureInPictureEvent$=new a.t(1),gi(S).pipe((0,o.R)(t._priv_destroy$)).subscribe(t._priv_pictureInPictureEvent$),hi(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),_i(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_isPlaying=(0,H.Z)(!1),t._priv_speed=(0,H.Z)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,H.Z)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,H.Z)(w),maxBufferAhead:(0,H.Z)(h),maxBufferBehind:(0,H.Z)(m)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,H.Z)(f),video:(0,H.Z)(p)},maxAutoBitrates:{audio:(0,H.Z)(v),video:(0,H.Z)(g)},manualBitrates:{audio:(0,H.Z)(-1),video:(0,H.Z)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=di,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=k,t._priv_setPlayerState(lr),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var f=r.prototype;return f.stop=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this.state!==lr&&this._priv_setPlayerState(lr)},f.dispose=function(){this.stop(),null!==this.videoElement&&$(this.videoElement).subscribe(j.Z),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_pictureInPictureEvent$.complete(),this._priv_isPlaying.finish(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},f.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f;if((0,z.Z)(e))throw new Error("No option set on loadVideo");if((0,z.Z)(e.url)){if((0,z.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,z.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 s=String(e.url);if((0,z.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var p=(0,z.Z)(e.autoPlay)?Er:!!e.autoPlay;if((0,z.Z)(e.keySystems))l=[];else for(var v,h=_r(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(v=h()).done;){var m=v.value;if("string"!=typeof m.type||"function"!=typeof m.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var g=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,y="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},_=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,b=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,T=(0,z.Z)(e.audioTrackSwitchingMode)?Tr:e.audioTrackSwitchingMode;(0,xe.Z)(["seamless","direct"],T)||(R.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\nIf badly set, "+Tr+" strategy will be used as default"),T=Tr);var E=(0,z.Z)(e.onCodecSwitch)?Sr:e.onCodecSwitch;(0,xe.Z)(["continue","reload"],E)||(R.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+Sr+" will be used as default"),E=Sr);var S=(0,K.Z)({},y,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:g});if(delete S.initialManifest,delete S.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,W.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var w,k=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],A=_r(k);!(w=A()).done;){var I=w.value;if("string"!=typeof I.language||"string"!=typeof I.mimeType||"string"!=typeof I.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}S.supplementaryTextTracks=k}if(void 0!==e.supplementaryImageTracks){(0,W.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var Z,x=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],M=_r(x);!(Z=M()).done;){var C=Z.value;if("string"!=typeof C.mimeType||"string"!=typeof C.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}S.supplementaryImageTracks=x}if((0,z.Z)(e.textTrackMode))c=Nr;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,z.Z)(e.defaultAudioTrack)||(0,W.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var P=(0,yr.iH)(e.defaultAudioTrack);(0,z.Z)(e.defaultTextTrack)||(0,W.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var N=(0,yr.Y1)(e.defaultTextTrack),O=!Cr;(0,z.Z)(e.hideNativeSubtitle)||((0,W.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),O=!!e.hideNativeSubtitle);var D=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:Ir,L=(0,z.Z)(e.enableFastSwitching)?wr:e.enableFastSwitching;if("html"===c){if((0,z.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.");d=e.textTrackElement}else(0,z.Z)(e.textTrackElement)||R.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,z.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var U=e.startAt.wallClockTime.getTime()/1e3;f=(0,K.Z)({},e.startAt,{wallClockTime:U})}else f=e.startAt;return{autoPlay:p,defaultAudioTrack:P,defaultTextTrack:N,enableFastSwitching:L,hideNativeSubtitle:O,keySystems:l,initialManifest:_,lowLatencyMode:g,manualBitrateSwitchingMode:D,audioTrackSwitchingMode:T,minimumManifestUpdateInterval:b,networkConfig:(0,z.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:E,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:S,url:s}}(e);R.Z.info("API: Calling loadvideo",t),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},f.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},f._priv_initializeContentPlayback=function(e){var t,n,r,a=this,f=e.autoPlay,v=e.audioTrackSwitchingMode,I=e.defaultAudioTrack,Z=e.defaultTextTrack,x=e.enableFastSwitching,M=e.initialManifest,P=e.keySystems,N=e.lowLatencyMode,O=e.manualBitrateSwitchingMode,D=e.minimumManifestUpdateInterval,B=e.networkConfig,F=e.onCodecSwitch,z=e.startAt,V=e.transport,G=e.transportOptions,H=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var W,j="directfile"===V,q=new i.x,Y={url:H,stop$:q,isDirectFile:j,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:I,initialTextTrack:Z},$=this.videoElement,X=new jr($,{withMediaSource:!j,lowLatencyMode:N});if(j){if(this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),null===L.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=Y,this._priv_mediaElementTrackChoiceManager=new L.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var Q=void 0===I?this._priv_preferredAudioTracks:[I];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(Q,!0);var J=void 0===Z?this._priv_preferredTextTracks:[Z];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(J,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return a.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return a.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return a.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return a.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return a.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return a.trigger("textTrackChange",e)}));var ee=L.Z.directfile.initDirectFile({autoPlay:f,keySystems:P,mediaElement:$,speed:this._priv_speed,playbackObserver:X,startAt:z,url:H}).pipe((0,o.R)(q));W=h(ee,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var te=L.Z.transports[V];if("function"!=typeof te)throw this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),new Error('transport "'+V+'" not supported');var ne,re=te(G),ie=B.offlineRetry,ae=B.segmentRetry,oe=B.manifestRetry,se=new ke(H,re,{lowLatencyMode:N,maxRetryRegular:oe,maxRetryOffline:ie}),ue=new Be(re,{lowLatencyMode:N,maxRetryOffline:ie,maxRetryRegular:ae});(ne=(ne=M instanceof U.ZP?(0,l.of)({type:"parsed",manifest:M}):void 0!==M?se.parse(M,{previousManifest:null,unsafeMode:!1}):se.fetch(H).pipe((0,c.z)((function(e){return"warning"===e.type?(0,l.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(q),(0,d.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_isPlaying.setValue(!1),this._priv_contentInfos=Y;var le=C(),ce={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(le?ce.throttle={video:fi().pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(q))}:R.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(le?ce.throttleBitrate={video:pi(this._priv_pictureInPictureEvent$).pipe((0,s.U)((function(e){return e?1/0:0})),(0,o.R)(q))}:R.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(le?ce.limitWidth={video:bi($,this._priv_pictureInPictureEvent$).pipe((0,o.R)(q))}:R.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var de={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:N,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:ce},fe="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},pe=(0,K.Z)({audioTrackSwitchingMode:v,enableFastSwitching:x,manualBitrateSwitchingMode:O,onCodecSwitch:F},this._priv_bufferOptions),ve=sr({adaptiveOptions:de,autoPlay:f,bufferOptions:pe,playbackObserver:X,keySystems:P,lowLatencyMode:N,manifest$:ne,manifestFetcher:se,mediaElement:$,minimumManifestUpdateInterval:D,segmentFetcherCreator:ue,speed:this._priv_speed,startAt:z,textTrackOptions:fe}).pipe((0,o.R)(q));W=h(ve,{connector:function(){return new i.x},resetOnDisconnect:!1})}var he,me,ge=W.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),ye=W.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),_e=W.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),be=vi($),Te=yi($),Ee=(0,y.a)([this._priv_isPlaying.asObservable(),ge.pipe((0,_.O)(null)),be.pipe((0,_.O)(null)),Te.pipe((0,_.O)(null))]).pipe((0,o.R)(q),(0,s.U)((function(e){var t=e[0],n=e[1];return function(e,t,n){if(e.ended)return vr;if(null!==n){var r=Math.abs(e.duration-e.currentTime);return null!=ur&&r<ur?vr:"seeking"===n?mr:hr}return t?fr:pr}($,t,n)}))),Se=(0,b.z)((0,l.of)(dr),ye.pipe((0,T.q)(1),(0,s.U)((function(){return cr}))),(0,E.T)(Ee.pipe((0,o.R)(_e),(he=function(e){return e===pr},(0,S.e)((function(e,t){var n=!1,r=0;e.subscribe(new w.Q(t,(function(e){return(n||(n=!he(e,r++)))&&t.next(e)})))})))),_e.pipe((0,k.w)((function(){return ye.pipe((0,T.q)(1),(0,c.z)((function(){return Ee})),(0,_.O)(gr))}))))).pipe((0,u.x)());q.pipe((0,T.q)(1)).subscribe((function(){void 0!==me&&me.unsubscribe()})),mi($).pipe((0,o.R)(q)).subscribe((function(e){return a._priv_onPlayPauseNext("play"===e.type)}));var we=X.observe(!0);we.pipe((0,o.R)(q)).subscribe((function(e){return a._priv_triggerPositionUpdate(e)})),ye.pipe((0,k.w)((function(){return function(e,t){return(0,p.P)((function(){if(null===e)return A.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,_.O)("seeking")));var r=n.pipe((0,k.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,T.q)(1))})));return(0,E.T)(n,r)}))}(a.videoElement,we)})),(0,o.R)(q)).subscribe((function(e){R.Z.info('API: Triggering "'+e+'" event'),a.trigger(e,null)})),Se.pipe((0,o.R)(q)).subscribe((function(e){return a._priv_setPlayerState(e)})),(this._priv_stopAtEnd?vi($):A.E).pipe((0,o.R)(q)).subscribe((function(){q.next(),q.complete()})),W.subscribe({next:function(e){return a._priv_onPlaybackEvent(e)},error:function(e){return a._priv_onPlaybackError(e)},complete:function(){return a._priv_onPlaybackFinished()}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,T.q)(1),(0,o.R)(q)).subscribe((function(){me=W.connect()}))},f.getError=function(){return this._priv_currentError},f.getManifest=function(){return(0,W.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},f.getCurrentAdaptations=function(){if((0,W.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,z.Z)(n[t.id])?null:n[t.id]},f.getCurrentRepresentations=function(){return(0,W.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},f.getVideoElement=function(){return this.videoElement},f.getNativeTextTrack=function(){if((0,W.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},f.getPlayerState=function(){return this.state},f.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},f.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},f.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},f.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},f.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.L7)(e.buffered,e.currentTime)},f.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.at)(e.buffered,e.currentTime)},f.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,G.DD)(e.buffered,e.currentTime)},f.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;return t?this.videoElement.currentTime:null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},f.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},f.getPlaybackRate=function(){return this._priv_speed.getValue()},f.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},f.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,z.Z)(r.video)?[]:r.video.getAvailableBitrates()},f.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,z.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},f.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},f.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},f.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.video))return e.video.bitrate},f.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,z.Z)(e.audio))return e.audio.bitrate},f.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},f.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},f.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},f.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},f.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,z.Z)(t)||"function"!=typeof t.catch?V.Z.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new N.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},f.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},f.seekTo=function(e){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var t,n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if(!r&&null===i)throw new Error("player: the content did not load yet");if("number"==typeof e)t=e;else if("object"==typeof e){var a=e,o=this.videoElement.currentTime;if((0,z.Z)(a.relative))if((0,z.Z)(a.position)){if((0,z.Z)(a.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');t=r||null===i?a.wallClockTime:a.wallClockTime-(void 0!==i.availabilityStartTime?i.availabilityStartTime:0)}else t=a.position;else t=o+a.relative}if(void 0===t)throw new Error("invalid time given");var s=t;if(null!==i&&!i.isLive){var u=i.getMaximumPosition();s=void 0!==u?Math.min(t,u-.001):t}return this.videoElement.currentTime=s,t},f.isFullscreen=function(){return(0,W.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),x()},f.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,W.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(!x()){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):Z()},f.exitFullscreen=function(){(0,W.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),Z()},f.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},f.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))},f.isMute=function(){return 0===this.getVolume()},f.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},f.unMute=function(){0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?di:this._priv_mutedMemory)},f.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},f.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},f.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)},f.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)},f.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)},f.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)},f.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},f.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},f.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},f.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},f.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},f.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},f.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return X(this.videoElement)},f.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},f.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},f.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},f.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},f.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},f.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},f.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},f.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},f.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},f.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},f.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},f.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},f.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},f.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},f.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},f.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},f.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},f.getImageTrackData=function(){return(0,W.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},f.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.getMinimumPosition():null},f.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.getMaximumPosition():null},f.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},f._priv_cleanUpCurrentContentState=function(){var e,t=this;R.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){R.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1)};(0,z.Z)(this.videoElement)?n():J(this.videoElement).subscribe({error:function(e){R.Z.error("API: An error arised when trying to clean-up the EME session:"+(e instanceof Error?e.toString():"Unknown Error")),n()},complete:function(){R.Z.debug("API: EME session cleaned-up with success!"),n()}})},f._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void R.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void R.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,z.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},f._priv_onPlaybackError=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,R.Z.error("API: The player stopped because of an error:",e),this._priv_setPlayerState(lr),this._priv_currentError===t&&this.trigger("error",t)},f._priv_onPlaybackFinished=function(){R.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),null!==this._priv_contentInfos&&(this._priv_contentInfos.stop$.next(),this._priv_contentInfos.stop$.complete()),this._priv_cleanUpCurrentContentState(),this._priv_setPlayerState(vr)},f._priv_onPlaybackWarning=function(e){var t=(0,O.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});R.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},f._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new ei({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(u,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),(0,F.R)(n,"manifestUpdate").pipe((0,o.R)(r.stop$)).subscribe((function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}))}else R.Z.error("API: The manifest is loaded but no content is.")},f._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else R.Z.error("API: The active period changed but no content is loaded")},f._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(R.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,z.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},f._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,z.Z)(i)&&!(0,z.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,z.Z)(a)&&!(0,z.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},f._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},f._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,z.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,z.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var p=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",p)}}else R.Z.error("API: The adaptations changed but no content is loaded")},f._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,z.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,z.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else R.Z.error("API: The representations changed but no content is loaded")},f._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})},f._priv_onPlayPauseNext=function(e){if(null===this.videoElement)throw new Error("Disposed player");this._priv_isPlaying.setValue(e)},f._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},f._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,R.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},f._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==gr){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,z.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumPosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&void 0!==a&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s,o.liveGap=a-e.position}this.trigger("positionUpdate",o)}}}else R.Z.warn("API: Cannot perform time update: no content loaded.")},f._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,B.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},f._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,z.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return D.ZB}},{key:"ErrorCodes",get:function(){return D.SM}},{key:"LogLevel",get:function(){return R.Z.getLevel()},set:function(e){R.Z.setLevel(e)}}]),r}(F.Z);Ti.version="3.26.2";var Ei=Ti,Si=n(7273);!function(){Si.Z.emeManager=n(8281).ZP,Si.Z.imageBuffer=n(7127).Z,Si.Z.imageParser=n(3203).Z,Si.Z.transports.smooth=n(2339).Z,Si.Z.transports.dash=n(5877).Z,Si.Z.dashParsers.js=n(3501).Z,Si.Z.nativeTextTracksBuffer=n(9059).Z,Si.Z.nativeTextTracksParsers.vtt=n(9405).Z,Si.Z.nativeTextTracksParsers.ttml=n(1570).Z,Si.Z.nativeTextTracksParsers.sami=n(1812).Z,Si.Z.nativeTextTracksParsers.srt=n(8057).Z,Si.Z.htmlTextTracksBuffer=n(5192).Z,Si.Z.htmlTextTracksParsers.sami=n(5734).Z,Si.Z.htmlTextTracksParsers.ttml=n(7439).Z,Si.Z.htmlTextTracksParsers.srt=n(8675).Z,Si.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Si.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}();var wi=Ei}(),r=r.default}()}));
|