Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

chore(deps): 接管 根 package.json(本地固定 web 依赖) 的升级

longmeidao78eb4b577959
diff --git a/docs/REUSE.md b/docs/REUSE.md
index 82420f8e5..183208e29 100644
--- a/docs/REUSE.md
+++ b/docs/REUSE.md
@@ -257,7 +257,7 @@ DMM / MGS 的只读商品号识别复用 `sources.dmm` 的 CID 结构与 `catalo
响应头策略复用 Starlette 1.8.0(BSD-3-Clause,项目已有固定依赖)的 `MutableHeaders` 与官方 [ASGI 中间件模式](https://www.starlette.io/middleware/#pure-asgi-middleware),只在 `http.response.start` 阶段设置缓存、安全及机器人策略。文件响应继续使用同一 `receive` 的断连消息,真实异常直接传播,不维护异常文本匹配或统一忽略网络错误的分支。整片转码继续复用 FFmpeg 和现有回退链,Peach 只保留有界本机证据与隐私投影,无新增依赖。
-本机诊断继续复用项目的脱敏日志与 ZIP 导出,浏览器使用标准 `canPlayType()`、MSE、Resource Timing 和有界的 [UA Client Hints](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues),服务端复用 Python 3.14 标准库的依赖元数据、磁盘余量、系统信息以及现有媒体探测缓存。字段白名单和本机证据汇总属于 Peach 的诊断边界;浏览器监控 SDK 会扩大依赖与采集范围,不承担这条本机导出链路。依赖沿用 Video.js 10.1.0 与现有 FFmpeg,不增加运行时依赖,不为导出执行媒体读取或硬件压力探测。能力声明与真实播放的区别按 [MDN `canPlayType()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType) 和 [Video.js 媒体来源契约](https://videojs.org/docs/framework/html/guides/media-sources)核对,隔离回归覆盖无视频请求、编码能力缺失、错误状态、脱敏和仅本机写入。
+本机诊断继续复用项目的脱敏日志与 ZIP 导出,浏览器使用标准 `canPlayType()`、MSE、Resource Timing 和有界的 [UA Client Hints](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues),服务端复用 Python 3.14 标准库的依赖元数据、磁盘余量、系统信息以及现有媒体探测缓存。字段白名单和本机证据汇总属于 Peach 的诊断边界;浏览器监控 SDK 会扩大依赖与采集范围,不承担这条本机导出链路。依赖沿用 Video.js 10.2.0 与现有 FFmpeg,不增加运行时依赖,不为导出执行媒体读取或硬件压力探测。能力声明与真实播放的区别按 [MDN `canPlayType()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType) 和 [Video.js 媒体来源契约](https://videojs.org/docs/framework/html/guides/media-sources)核对,隔离回归覆盖无视频请求、编码能力缺失、错误状态、脱敏和仅本机写入。
STRM 采用文本指针、播放时解析的通用行为,参考 SmartStrm 文档、OpenList 的 `drivers/strm` 与 Jellyfin 的 STRM 探测入口;固定 revision、许可证与实际读取位置见 [取证记录](reference-snapshots/strm-source-evidence.md)。SmartStrm 核心闭源,源码未取得。Peach 独立实现受限 HTTP(S) 指针,复用 HTTPX、现有 Range 传输、`m3u8` 解析与播放器计划;无新增运行依赖,也不复制上游应用代码。
@@ -363,7 +363,7 @@ FC2 卖家名册复用 `sources/fc2.py` 的 `label`、`seller_url` 来源契约
JAV 发现卡复用馆藏的 `data-media-card` 网格与悬停面、`coverImage` 封面取景、`cardRatio` 大小图比例和 `feedIdentity` 身份头像;筛选复用 `FilterGlassRows`、`FilterPill`、`Segments` 与 `SortKeys`。出演者引用由 `web_catalog.entity_ref` 提供图片版本与取景;标题保留两行,操作区贴底。发现查询复用口味汇总与 `related.rank_related` 的 IDF/MMR,输出相关度和实际选择分,支持口味、发行日期、来源评分、时长、番号排序。来源资料复用 `PublicAPI`、`BackgroundJob(runs=None)`、`fsutil.atomic_write_text` 与标准库 `ContextVar`;固定至多 100 部,真实 HTTP 预算 202 次、16 MiB、900 秒,3 秒串行间隔。资料边车有效期 6 小时、最多 2,048 条、失败冷却 15 分钟,完成或停止后由显式刷新续跑。`WantMagnets` 以 `queryUrl` 共用作品详情和想要清单的资源布局,按资源区容器宽度排列操作,缓存按来源分开,容量复用 `fmtSize`。JAV 与名册的静态搜索框复用 `islandSearchInput`。资料扩展见 [JAV 发现](JAV_DISCOVERY.md),无新增依赖。
-JAV 作品详情与馆藏视频共用 `IdentityCell` 的头像、标识和首字回退,标题折叠复用 `useFoldedTitle`。厂牌大小写唯一匹配与 `sources.javdb.maker_writing` 的日英组合解析只用于来源身份投影,标识按规范名读取。评论、资源复用 `Disclosure` 和 `setCollapseOpen`;来源与评论评分共用按小数裁切填充的星星。桌面右栏以 `contain:size` 排除正文的固有高度贡献,媒体区决定框体高度,正文在右栏内滚动。写操作取 `/healthz` 的账本只读状态,与运行配置权限分别处理。图片切换由 `MediaCarousel` 同时服务关注、库外 JAV 与馆藏详情,提供环形翻页、横向缩略图和位置圆点。缩略图与圆点复用浏览器原生 `overflow-x:auto`、`wireHorizontalScroller`,选中项在切图、循环和容器缩窄时保持可见。缩略图使用 `IntersectionObserver` 按可见范围挂载,馆藏经 `/sample-thumb`,来源图片共享查询缓存,关注优先取附件小图;Swiper 14.3.0 留给灯箱。馆藏样张复用 `sample_images.detail_refs` 和 `/sample-image`,`/api/item` 只读本地序号、最多 30 项;查看图片暂停正片,返回保留位置。推荐分标签复用 BoardUI `Chip` 与共享 Tooltip。视频预览的 `mountPreviewPlayer` 复用已固定的 Video.js 10.1.0(Apache-2.0)、官方 HLS 媒体组件、`mountPlayerQualityControl`、`mountPlayerSeekPreview` 和 `mountPlayerSpinner`,安装共用控制条、设置、时间、音量与窄宽度折叠。来源给定的 HLS 直接由播放器请求;片源代理、馆藏 ID 和观看上报沿用各自入口。播放器生命周期由当前详情管理,异步加载完成前离开会取消挂载,切换与关闭会停止并销毁实例。
+JAV 作品详情与馆藏视频共用 `IdentityCell` 的头像、标识和首字回退,标题折叠复用 `useFoldedTitle`。厂牌大小写唯一匹配与 `sources.javdb.maker_writing` 的日英组合解析只用于来源身份投影,标识按规范名读取。评论、资源复用 `Disclosure` 和 `setCollapseOpen`;来源与评论评分共用按小数裁切填充的星星。桌面右栏以 `contain:size` 排除正文的固有高度贡献,媒体区决定框体高度,正文在右栏内滚动。写操作取 `/healthz` 的账本只读状态,与运行配置权限分别处理。图片切换由 `MediaCarousel` 同时服务关注、库外 JAV 与馆藏详情,提供环形翻页、横向缩略图和位置圆点。缩略图与圆点复用浏览器原生 `overflow-x:auto`、`wireHorizontalScroller`,选中项在切图、循环和容器缩窄时保持可见。缩略图使用 `IntersectionObserver` 按可见范围挂载,馆藏经 `/sample-thumb`,来源图片共享查询缓存,关注优先取附件小图;Swiper 14.3.0 留给灯箱。馆藏样张复用 `sample_images.detail_refs` 和 `/sample-image`,`/api/item` 只读本地序号、最多 30 项;查看图片暂停正片,返回保留位置。推荐分标签复用 BoardUI `Chip` 与共享 Tooltip。视频预览的 `mountPreviewPlayer` 复用已固定的 Video.js 10.2.0(Apache-2.0)、官方 HLS 媒体组件、`mountPlayerQualityControl`、`mountPlayerSeekPreview` 和 `mountPlayerSpinner`,安装共用控制条、设置、时间、音量与窄宽度折叠。来源给定的 HLS 直接由播放器请求;片源代理、馆藏 ID 和观看上报沿用各自入口。播放器生命周期由当前详情管理,异步加载完成前离开会取消挂载,切换与关闭会停止并销毁实例。
卡片多选由 `MediaCard`、`FollowCard` 的 `selectMode` 统一控制:保留选择入口,单项保存、已看、忽略、稍后看、预览跳转和回收站操作不挂载;退出多选恢复单项操作。首页、实体页、关注与回收站沿用同一组组件。
@@ -385,9 +385,9 @@ JAV 作品详情与馆藏视频共用 `IdentityCell` 的头像、标识和首字
待找资源复用 `MagnetSearch` 的来源链、发行时间策略与串行限速,服务端结果使用 `atomic_write_text` 原子保存为私有 JSON 边车。读缓存和网络查询分锁;重启时将原始墙钟时间转换为当前进程的单调时钟。边车最多 128 部、16 MiB,不保存错误,主动刷新失败保留成功结果。浏览器沿用 TanStack Query 和 localStorage,不新增缓存服务或依赖。
-清晰度控件复用 Video.js 10.1.0 官方 `@videojs/hlsjs-video` 的 hls.js 引擎。多档播放从实际轨道读取分辨率,自动码率和固定轨道通过引擎选择;单档 HLS 缺少尺寸时读取原生视频元素的实际尺寸,并响应 `loadedmetadata`、`resize`。尺寸未取得时显示「当前画质」,轨道 ID 不作界面名称。来源各自独立的 MP4 档位由 Peach 保留播放位置后切换片源。
+清晰度控件复用 Video.js 10.2.0 官方 `@videojs/hlsjs-video` 的 hls.js 引擎。多档播放从实际轨道读取分辨率,自动码率和固定轨道通过引擎选择;单档 HLS 缺少尺寸时读取原生视频元素的实际尺寸,并响应 `loadedmetadata`、`resize`。尺寸未取得时显示「当前画质」,轨道 ID 不作界面名称。来源各自独立的 MP4 档位由 Peach 保留播放位置后切换片源。
-画面旋转复用浏览器 CSS `transform` 与 `ResizeObserver`;Peach 仅计算保持比例的显示尺寸、设置菜单及会话释放。采用现有 Video.js 10.1.0,不增加依赖;依赖旧版组件接口的旋转插件不进入运行时。本地播放器复用 Python 标准库 `os.startfile`、`subprocess` 和 macOS `/usr/bin/open`,保留固定播放器名单、媒体根授权、本机直连与 Docker 边界。本机请求判断由 `web_local_access` 供配置与媒体路由共用。媒体路径复用 `media.normalized_path`,Windows 保留可直接读取的挂载盘盘符,不向虚拟文件系统请求最终路径。系统能力随 Python/操作系统发布,无额外许可证或包体积;真实桌面应用唤起与浏览器协议支持分别验收,不能由进程请求成功推断解码成功。用法与上游依据见[外部播放器](EXTERNAL_PLAYERS.md)。
+画面旋转复用浏览器 CSS `transform` 与 `ResizeObserver`;Peach 仅计算保持比例的显示尺寸、设置菜单及会话释放。采用现有 Video.js 10.2.0,不增加依赖;依赖旧版组件接口的旋转插件不进入运行时。本地播放器复用 Python 标准库 `os.startfile`、`subprocess` 和 macOS `/usr/bin/open`,保留固定播放器名单、媒体根授权、本机直连与 Docker 边界。本机请求判断由 `web_local_access` 供配置与媒体路由共用。媒体路径复用 `media.normalized_path`,Windows 保留可直接读取的挂载盘盘符,不向虚拟文件系统请求最终路径。系统能力随 Python/操作系统发布,无额外许可证或包体积;真实桌面应用唤起与浏览器协议支持分别验收,不能由进程请求成功推断解码成功。用法与上游依据见[外部播放器](EXTERNAL_PLAYERS.md)。
播放器按 [Video.js 10 官方迁移指南](https://videojs.org/docs/framework/html/guides/migrate-from-video-js-8) 和 [10.1.0 源码](https://github.com/videojs/video.js/tree/919ad955a9baf2433c68aba8151654dde0e58b5d/packages)接入 `video-player`、`media-container`、官方按钮/滑条与 HLS/DASH 媒体组件。`@videojs/cdn` 10.1.0(Apache-2.0)提供固定 ESM 模块,构建脚本按静态与字面量动态导入闭包分发并登记哈希;浏览器支持沿用项目目标。Peach 保留片源授权、时长口径、统计、字幕菜单和舞台生命周期,原生视频经 `media` 插槽携带字幕与观看上报。`video.js` 10.1.0 包的旧入口只有带错误码的 shim,不作为运行依赖;v8 的组件和 VHS 不进入产物。真实短片回归覆盖 MP4、HLS 和 DASH 解码,质量档位选择按 HLS 引擎验证,DASH 不声明手动档位能力。生产切换与 ledger 不属于依赖接管工作树。
@@ -534,7 +534,7 @@ OneJAV、Free JAV Torrent 只给种子链接。这类条目经索引器同源的
JAV 默认封面(官方封面/预览图)与视频默认大小(大图/小图)独立保存,用 localStorage、共享 Switch 与既有 `/cover`、`/poster`。设置弹窗同步首页与 JAV 的版式,筛选条可单独调当前视图。`frontend/src/jav-artwork.ts` 管作品身份、偏好恢复与缺图回退,首页、接着看、实体作品、详情推荐、Mix 静止与翻图、播放队列共用封面选择。小图展示完整封套,竖版正封完整放入大图卡片;新作封面完成取景才显示,缓存图插入时重算取景。
-关注视频与馆藏详情的续播复用 Video.js 10.1.0(Apache-2.0)的元数据事件和 `currentTime`、浏览器 localStorage 与既有活动接口。`player/progress` 按本地资产、关注条目和媒体序号登记秒数,暂停、定位、关闭、小窗销毁、页面退出均保存;原生 video 回退也恢复,明确的时间深链优先,放完从头开始。本地既有记录可按 `leave_ratio × duration` 恢复;最远观看位置与累计观看时长不作为续播秒数。活动请求用 keepalive,销毁同步冲掉末段并清理定时器与监听。此状态属于当前浏览器,未引入账本迁移或跨设备同步,无新增依赖。
+关注视频与馆藏详情的续播复用 Video.js 10.2.0(Apache-2.0)的元数据事件和 `currentTime`、浏览器 localStorage 与既有活动接口。`player/progress` 按本地资产、关注条目和媒体序号登记秒数,暂停、定位、关闭、小窗销毁、页面退出均保存;原生 video 回退也恢复,明确的时间深链优先,放完从头开始。本地既有记录可按 `leave_ratio × duration` 恢复;最远观看位置与累计观看时长不作为续播秒数。活动请求用 keepalive,销毁同步冲掉末段并清理定时器与监听。此状态属于当前浏览器,未引入账本迁移或跨设备同步,无新增依赖。
详情人物头像复用 `card-art.entityFaceImg` 与 `avatarFrame`,图片直接挂在有尺寸的 `[data-id-face]` 圆框内。取景读取图片的父框几何,`display:contents` 包装层没有可用尺寸。首字与图片由同一段 HTML 承载,图片加载失败时共用回退链,浏览器回归覆盖带人脸框的桌面与手机详情。
@@ -836,8 +836,8 @@ A 盘垃圾隔离使用短名称 `peach-purge-<32 位 UUID>.peach-quarantine`,
| FC2 目录元数据与跨号证据 | 已缓存的 fc2cmadb Inertia `article`/评论;Javinizer-Go v1.5.2 的 FC2 解析器(MIT)只作商品页字段边界参考 | 旧文章仍有标题、原始标签、日期、时长、卖家、FC2 CDN 封面与 `comments`(2026-08-31 登录态实测);无歧义标签译成现有词表,标题/标签进 `/review`,`w1200` 封面过尺寸与解码门槛落生成产物;pair、合集/分片保护、hash/时长/尺寸佐证、库外 evidence、健康统计与复核归 Peach,不依赖 FC2-Leak-Detector/JavSP,镜像候选不直写 ledger |
| 缺索引 MP4 重建 | untrunc(anthwlock `9d86ec9`,GPL-2.0-or-later)与兼容的 FFmpeg 8.1.3 静态构建,固定来源及哈希见 `scripts/untrunc-sources.json`。Windows 安装包与免安装包携带 `tools/untrunc`,同一 Release 提供完整对应源码;原生样片实测覆盖尾部 `moov` 缺失后的 H.264/AAC 恢复、时长与全片解码。显式 `PEACH_UNTRUNC` 优先,其后依次查随包目录、数据工具与 PATH | `src/peach/mp4recover.py` 挑参照(同目录文件名最近的先试,最多 4 部)、验收(解码错误 ≤3 行、音视频时长差 ≤5%)、换回原路径并把坏原件改名成同目录的 `.文件名.peach-original`;缺整个 `moov` 的片子哪里都打不开,所以结果替换原文件,不像缺 `ctts` 那样另存头。实测见 [取证](SOURCING.md#媒体与关注实测) |
| 媒体探测/转码 | Windows 独立包从固定源码交叉编译 FFmpeg 9.0.2、x264、dav1d、nv-codec-headers、AMF 头文件与 libvpl,按 GPL-3.0-or-later 分发;版本、来源和哈希见 `scripts/ffmpeg-sources.json`。工具与完整对应源码一起构建,安装包和免安装 ZIP 共用经校验的 `tools/ffmpeg`。源码与 CI 媒体测试仍可使用 PATH 工具([取证](SOURCING.md#依赖与工具实测)) | 容器与编码分别检查:MP4/M4V 的 H.264 8-bit 加兼容音轨直出,其余容器里的 H.264 8-bit 只换 MP4 封装;重编码按[硬件转码后端](#硬件转码后端)及本机播放加速偏好选择 |
-| HTML5/HLS/DASH 播放 | Video.js 10.1.0 的 `@videojs/html`、`@videojs/hlsjs-video` 与 `@videojs/dash-video`,通过官方 `@videojs/cdn` 本地固定模块分发(Apache-2.0) | 流方案、授权、稳定时长、回退顺序和统计面板;详情不兼容片源复用 HlsSegmentService 与 FFmpeg 按六秒编码 H.264/AAC,独立缓存、绝对时间轴及会话取消,无整片预转码 |
-| 播放器设置与影院布局 | Video.js 10.1.0 的播放器状态、原生媒体事件、播放/静音/全屏/画中画按钮与进度/音量滑条;YouTube `e937390a` 实际 DOM/CSS/JS 给几何、状态、动画和图形证据 | Peach 皮肤组合氛围模式、倍速、真实清晰度和影院模式:59 px 两排控制栏、40→111 px 横向音量、4→6 px 进度、右侧共享胶囊、整行悬停的 274 px 设置菜单、视口级全屏;普通视图 `contain`,全屏 `cover`。播放会话与同一枚原生视频经过舞台和小窗整体搬移,状态、字幕与上报保留;设置、时间、预览、统计、字幕菜单、中央提示和错误反馈属于 Peach。皮肤沿用本地 SVG 与 spinner,不复制上游按钮、滑条或媒体引擎的控制逻辑 |
+| HTML5/HLS/DASH 播放 | Video.js 10.2.0 的 `@videojs/html`、`@videojs/hlsjs-video` 与 `@videojs/dash-video`,通过官方 `@videojs/cdn` 本地固定模块分发(Apache-2.0) | 流方案、授权、稳定时长、回退顺序和统计面板;详情不兼容片源复用 HlsSegmentService 与 FFmpeg 按六秒编码 H.264/AAC,独立缓存、绝对时间轴及会话取消,无整片预转码 |
+| 播放器设置与影院布局 | Video.js 10.2.0 的播放器状态、原生媒体事件、播放/静音/全屏/画中画按钮与进度/音量滑条;YouTube `e937390a` 实际 DOM/CSS/JS 给几何、状态、动画和图形证据 | Peach 皮肤组合氛围模式、倍速、真实清晰度和影院模式:59 px 两排控制栏、40→111 px 横向音量、4→6 px 进度、右侧共享胶囊、整行悬停的 274 px 设置菜单、视口级全屏;普通视图 `contain`,全屏 `cover`。播放会话与同一枚原生视频经过舞台和小窗整体搬移,状态、字幕与上报保留;设置、时间、预览、统计、字幕菜单、中央提示和错误反馈属于 Peach。皮肤沿用本地 SVG 与 spinner,不复制上游按钮、滑条或媒体引擎的控制逻辑 |
| 播放器时刻预览 | Video.js 原生进度控件、统一时间索引与 `/timeline?id=&s=`;取不到时退回 `/poster?id=&c=0…8` 九宫格 | `timeline_sources` 读取 Jellyfin Trickplay、Emby/Roku/Plex 导出的 BIF、WebVTT 图片 cue、HLS/DASH 图片轨,复用现有 Pillow、标准库与 `m3u8==6.0.0`,无新增依赖;配对、格式边界及取证见[已有时间轴预览](VIDEO_PREVIEWS.md)。`timeline_sheets` 只对本机缺少可用产物的视频按每 10/30 秒预铺。网盘读取已有图片不触发视频抽帧;原视频抽帧的[流量判据](SOURCING.md#媒体与关注实测)保留。前端专用 VTT/sprite 插件不能承担磁盘索引和 BIF,不引入 |
| 外挂字幕 sidecar | 浏览器原生 `TextTrack` 与 [WebVTT 规范](https://www.w3.org/TR/webvtt1/);配对复用 `catalog_rules` 的 `VERSION_TAIL_TOKENS` 与 `release_code_from_filename`。行为证据:sakuramediabe `import_service.py`/`movie_numbers.py` 的 `subtitle_matches_movie_number`(同目录、纯番号、不回退同名),NeoAVDC `organizeMedia.ts`/`parseNumber.ts` 的 `isSubtitleFile`(`.srt .ass .sub .vtt .ssa`,按视频主名前缀);Peach 的判据是两者的并集加顺序 | `subtitles.py` 只做同目录配对(exact/suffix/code/orphan)、`asset_subtitle` 幂等登记、srt/ass/ssa → WebVTT。不用 `pysubs2`(为几十行加运行时依赖)和 FFmpeg(每次起子进程、报不出「编码认不出来」),编码要认 GBK/Big5/Shift_JIS,不用几乎吞下任何字节的 `gb18030`。内封字幕轨不在此列,`media_probe.py` 只取 `v:0`,流信息不落库 |
| 播放偏好与字幕记忆 | 原生 `TextTrack.id`;现有 `filelock==4.2.0` 与 `fsutil.atomic_write_text`,沿用本机状态文件的并发锁与原子替换 | `playerMemory` 与 `SubtitleSession` 供详情、小窗与沉浸播放复用;服务端 `state/player-subtitles/` 按资产、关注条目及帖子内视频分别保留 WebVTT,`subtitles.json` 同存旋转、倍速、字幕外观、轨道身份与最后选择,`null` 表示关闭。偏好以字段补丁在同一文件锁内合并,客户端同身份写入串行,用户操作不受迟到的读取覆盖。旁挂字幕按目录内文件名生成稳定身份,登记与载入顺序不参与身份;已保存的登记 ID 通过轨道别名恢复。同目录发现复用现有配对、转码与读取上限,只读授权目录并与已登记路径去重。内容保存先于成功回执,重复导入按轨道键覆盖;重新播放直接读保存内容。保留转换器与 SubtitleCat 接口,不新增解析器、浏览器数据库依赖或 ledger 迁移 |
diff --git a/frontend/src/player/videojs.ts b/frontend/src/player/videojs.ts
index c362aef90..f40e03247 100644
--- a/frontend/src/player/videojs.ts
+++ b/frontend/src/player/videojs.ts
@@ -2,7 +2,7 @@
import type { VideojsFactory } from './types';
import { createV10Player } from './v10-player';
-const VIDEOJS = '/vendor/videojs/10.1.0/';
+const VIDEOJS = '/vendor/videojs/10.2.0/';
const MODULES = [
'video-player.js', 'media/hlsjs-video.js', 'media/dash-video.js', 'ui/container.js', 'ui/play-button.js',
'ui/mute-button.js', 'ui/fullscreen-button.js', 'ui/pip-button.js', 'ui/time-slider.js',
diff --git a/package-lock.json b/package-lock.json
index a9730801a..01b60112c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,9 +8,9 @@
"devDependencies": {
"@fontsource-variable/inter": "5.3.0",
"@phosphor-icons/core": "2.1.1",
- "@videojs/cdn": "10.1.0",
+ "@videojs/cdn": "10.2.0",
"healthicons": "2.0.0",
- "lucide-static": "1.57.0",
+ "lucide-static": "1.61.0",
"remixicon": "4.9.1",
"swiper": "14.3.0"
},
@@ -36,9 +36,9 @@
"license": "MIT"
},
"node_modules/@videojs/cdn": {
- "version": "10.1.0",
- "resolved": "https://registry.npmjs.org/@videojs/cdn/-/cdn-10.1.0.tgz",
- "integrity": "sha512-xn8NRHdWXzAm3vEchRI+zkUsoQS5YAh44IFC03osW9FMA+5ATOYFfL9AuSsL2n19mNoJMWtCoTF7c0fYR9AM/A==",
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/@videojs/cdn/-/cdn-10.2.0.tgz",
+ "integrity": "sha512-prkTxxd5h5FcEafOfBKdSKABBHQUAirExL4/DPckQajngE8xpnR4PnkvdBCue5J0Hr064C6CXXGiE0om5kSxXA==",
"dev": true,
"license": "Apache-2.0"
},
@@ -50,9 +50,9 @@
"license": "MIT"
},
"node_modules/lucide-static": {
- "version": "1.57.0",
- "resolved": "https://registry.npmjs.org/lucide-static/-/lucide-static-1.57.0.tgz",
- "integrity": "sha512-nuf4YoaKt3Pq9scXVQ71SLr0Q1/UZiTcfBBivFsCVL6biAzPplTikVWXLetBmK3oFEJS6f2L1rzgEsoJN/Ce0Q==",
+ "version": "1.61.0",
+ "resolved": "https://registry.npmjs.org/lucide-static/-/lucide-static-1.61.0.tgz",
+ "integrity": "sha512-yLAiQB3MWUJEstsEDAwenSA3m7vr1tdLvgnC16Q/XMxRRma0DWwMs8M2bWlvgShrIs1m2mWMJ+0AiahqQO4GrA==",
"dev": true,
"license": "ISC"
},
diff --git a/package.json b/package.json
index 1bdf58fe9..6b460b7c4 100644
--- a/package.json
+++ b/package.json
@@ -11,10 +11,10 @@
},
"devDependencies": {
"@fontsource-variable/inter": "5.3.0",
- "@videojs/cdn": "10.1.0",
+ "@videojs/cdn": "10.2.0",
"@phosphor-icons/core": "2.1.1",
"healthicons": "2.0.0",
- "lucide-static": "1.57.0",
+ "lucide-static": "1.61.0",
"remixicon": "4.9.1",
"swiper": "14.3.0"
}
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index acd106e90..58fd42ecf 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -2,7 +2,7 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "46c860c3-fe0f-46e7-8b3c-a41e724abe3b", e._sentryDebugIdIdentifier = "sentry-dbid-46c860c3-fe0f-46e7-8b3c-a41e724abe3b");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "9e97a633-15eb-4ecb-8d9f-dd41af91101d", e._sentryDebugIdIdentifier = "sentry-dbid-9e97a633-15eb-4ecb-8d9f-dd41af91101d");
} catch {}
})();
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
@@ -32672,7 +32672,7 @@ var iM = (e) => typeof e == "string" ? [e] : e, Nse = (e, t) => {
n.id = String(t.id || ""), t.legacyId && (n.dataset.subtitleAlias = String(t.legacyId)), n.kind = String(t.kind || "subtitles"), n.src = String(t.src || ""), n.srclang = String(t.srclang || ""), n.label = String(t.label || ""), e.append(n);
}
};
-}, Pse = "/vendor/videojs/10.1.0/", Fse = [
+}, Pse = "/vendor/videojs/10.2.0/", Fse = [
"video-player.js",
"media/hlsjs-video.js",
"media/dash-video.js",
@@ -81196,4 +81196,4 @@ HPe($9);
//#endregion
export { kI as $2ec61d1d4f780267$export$a8a3e93435678ff9, RI as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, tR as $542a13ca2fa5b484$export$5b6b19405a83ff9d, AT as $72abaeab4d80592f$export$78efe591171d7d45, qR as $76d00c5a4edb230a$export$76ccd210b9029917, WR as $76d00c5a4edb230a$export$816b5d811295e6bc, XR as $76d00c5a4edb230a$export$b59bdbef9ce70de2, QR as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, UR as $76d00c5a4edb230a$export$f850895b287ef28e, ffe as $b4f18e3395fe64d7$export$3d96ec278d3efce4, dfe as $b4f18e3395fe64d7$export$3e41faf802a29e71, cfe as $b4f18e3395fe64d7$export$b2539bed5023c21c, nz as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, hfe as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, _w as $ea3928288112382f$export$439d29a4e110a164, mR as $f2ff30fde7b014be$export$3ddf2d174ce01153, xR as $fe21c36db05242bb$export$a98f0dcb43a68a25, SR as $fe21c36db05242bb$export$d7b12c4107be0d61, Zfe as $l, Qk as ACCENTS, STe as AMANE_BRIDGE_CHECK_URL, Z$ as AMANE_BRIDGE_KEY, CTe as AMANE_BRIDGE_REBUILD_URL, Hn as ApiError, PW as ArtSlot, q as Button, nI as ButtonLink, ope as Bx, Qt as CLOUD_LOCATIONS, Z1 as CLOUD_PROXY_HELP, Dr as COLUMN_SORT, l1 as CONFIGURATION_KEY, qY as CONFIGURATION_URL, wTe as COOKIE_TEXT_LIMIT, X$ as COVER_JOB_KEY, Ai as CREDENTIAL_STATE, K$ as CUSTOM_SOURCES_KEY, G$ as CUSTOM_SOURCES_URL, tV as Checkbox, eV as CheckboxGlyph, GB as ChevronSortDown, cZ as Chip, J2 as CloudDownloadDialog, UH as CollapseChevron, HH as CollapseRegion, p$ as CollectionSummary, obe as DEFAULT_CATEGORY, Kn as DEFAULT_SORT, MQ as DIAGNOSTICS_KEY, rxe as DIRECTORY_TEMPLATE_ERROR, M0 as DISCOVERY_SORTS, H2 as DOWNLOADS_KEY, V2 as DOWNLOADS_URL, _Y as DUPLICATES_KEY, QJ as DataTableFooter, JJ as DataTableFrame, ZJ as DataTableSort, YH as Disclosure, NOe as DownloadsPanel, Hfe as E3, sbe as ENTITY_REVIEW_KINDS, Y1 as ENTRY_LINKS_HELP, X1 as ENTRY_LINKS_HINT, epe as Ea, _pe as EmptyFocusButton, Pz as EmptyState, qH as ErrorText, ege as ExternalLink, Sr as FEEDS_KEY, tX as FEED_SCHEDULE_KEY, MAe as FLOW_LABEL_X, z3 as FLOW_VIEWBOX, br as FOLLOW_CHECK_KEY, yr as FOLLOW_CREDENTIALS_KEY, P8 as FOLLOW_INITIAL_RANGE_OPTIONS, vr as FOLLOW_MANAGE_KEY, IZ as FOLLOW_MANAGE_NAV, xr as FOLLOW_RESOLVE_KEY, eX as FOLLOW_SCHEDULE_KEY, nge as Fact, tge as FactList, JH as FieldLabel, R$ as Fieldset, L$ as FieldsetTitle, KF as FilterGlass, qF as FilterGlassRows, GF as FilterIconButton, YF as FilterPill, $he as Footer, vz as Gg, ZF as GlassPill, KH as Help, Tz as HintText, wAe as IDLE_POLL_MS, Yye as IDLE_REPAIR, BF as IconButton, Az as Input, kz as InputBase, _A as JAV_LAYOUTS, P0 as JAV_RECOMMENDATION_GRID, wX as JUNK_KEY, Q3 as JavHeader, Uye as KEEP_LABELS, wr as LAYOUTS, J1 as LIBRARY_FOLDER_HELP, cH as LIBRARY_PROCESSING_KEY, zY as LINKS_KEY, BY as LINK_CHECK_KEY, kbe as LINK_KINDS, VY as LINK_PRUNE_KEY, Ln as LOC, wz as Label, V$ as LibraryProcessingCard, Zz as LibraryShortcuts, wH as LinkButton, LH as LoadingDots, Wfe as M6, Pbe as MEDIA_PROCESSING_KEY, rX as MEDIA_PROCESSING_URL, SY as MEDIA_REPAIR_KEY, xY as MEDIA_REPAIR_URL, er as MEDIA_SOURCES_KEY, Zo as MEDIA_SOURCE_ICONS, Xt as MEDIA_SOURCE_OPTIONS, YB as MENU_ITEM, XB as MENU_ITEM_INTERACTIVE, JB as MENU_POPOVER_SURFACE, OH as MenuDialog, AG as MixCard, jz as ModalFrame, Hv as MotionConfigContext, Cz as NR, Nz as Note, ppe as OA, oX as ORGANIZE_KEY, lX as ORPHAN_RECORDS_KEY, _z as OV, uz as P7, Bwe as PHASES, JY as PICK_FOLDER_URL, U$ as PLAYLISTS_KEY, wEe as POLICY_COLUMNS, EEe as POLICY_COVER_NOTE, TEe as POLICY_MATRIX, q1 as POLICY_SUMMARY, XJ as Pagination, B$ as PathLine, dF as PillTabList, zH as Progress, DY as QUALITY_GOALS_KEY, j$ as REPAIR_CARD_TEXT, CY as REPAIR_LIBRARIES_KEY, mX as RESOURCE_APPLY_KEY, pX as RESOURCE_SCAN_KEY, $we as RESULT_PANEL, eTe as RESULT_SECTION, abe as REVIEW_CATEGORIES, CX as REVIEW_COUNTS_KEY, AY as REVIEW_KEY, jY as REVIEW_LABELS, NW as RetryNote, fpe as Rf, Xhe as Rows, bTe as SCRAPING_CHECK_URL, J$ as SCRAPING_COVER_URL, Y$ as SCRAPING_KEY, yTe as SCRAPING_SETTINGS_URL, MU as SEGMENT, jU as SEGMENTED_TRACK, $Y as SETTINGS_KEY, YY as SETTINGS_URL, qn as SORT_DEFAULT_DIR, Gn as SORT_OPTIONS, $t as SOURCE_LABELS, u3 as STATS_KEY, Yhe as Section, Qhe as SectionSkeleton, AU as SegmentedRadioGroup, Kge as SegmentedTabList, dW as Segments, YJ as Select, CU as Select$1, p1 as SelectField, wU as SelectItem, aY as SelectionActions, Ak as SelectionDock, oY as SelectionPopover, WH as SettingsCard, Jhe as SettingsRow, GH as SettingsSectionLabel, oge as SiteLabel, LU as SortDirectionIcon, mW as SortKeys, hQ as SourceAvatar, $H as SourceLabel, XH as SourceMark, Zhe as Stack, z$ as StatusLabel, F2 as Switch, bF as TASKS_KEY, pAe as TASTE_REFRESH_KEY, mAe as TASTE_WINDOWS, nX as THUMBNAIL_JOBS_KEY, EX as TRASH_KEY, aue as TRIGGER_LABELS, zJ as Table, sY as TableColumnControls, cY as TableColumnResizer, uY as TableSelectionHeader, n$ as TagManager, BH as TaskProgress, Dz as TextField, Ez as TextFieldContext, gz as Un, _$ as WANTS_KEY, i4 as WantMagnets, mp as WithPromise, dz as Wt, hz as Xc, Sz as Xf, Kfe as Xt, Ufe as _8, o as __commonJSMin, s as __exportAll, l as __toESM, dpe as aB, si as addAlias, oi as addSource, y$ as addWant, B as apiGet, V as apiSend, dA as appSettingsStore, Sxe as applyConfirmText, SX as applyLeftovers, xxe as applyPlanText, wxe as applyText, hA as applyTheme, u_ as asNumber, uxe as attachOrphan, Ur as authorAvatar, Gr as authorGroups, Hr as authorInitial, Vr as authorName, Dq as autoResetPageIndex, Za as avatarInner, g3 as bandRows, ixe as baseName, Jye as batchOperate, Fk as boundedPreference, Gye as bulkCloudPreferences, Rz as busyProps, upe as cB, UOe as cachedMagnetStates, ip as calcGeneratorVelocity, pbe as canApprove, kf as cancelFrame, hxe as candidateText, IH as cardClass, AA as cardRatio, mz as cc, Ei as checkEvidenceGap, Ti as checkFailures, gi as checkFeeds, Nbe as checkLine, Ci as checkReceipt, wi as checkSummary, ETe as checkText, Di as checkedText, nG as clickedBlank, Lye as cloudLocations, O0 as cloudProxySkeleton, Ix as clsx, rpe as cn, uh as collectMotionValues, qq as columnVisibilityFeature, PJ as column_getCanSort, AJ as column_getSortFn, dbe as commonReviewSources, aV as configurationSection, vAe as configureTasteBrowser, Vc as confirmModal, lq as copyInstancePropertiesWithoutMemos, Wa as coverUrl, Rq as createColumnHelper, pTe as createPlaylist, ji as credentialDone, w0 as credentialsSkeleton, Sbe as currentReviewRow, cF as cx, bz as dZ, ybe as decisionPayload, bbe as decisionReceipt, vbe as defaultChoice, hTe as deletePlaylist, x as diagnosticHeaders, K1 as diagnosticsSkeleton, Jwe as discoveryArtwork, w$ as discoveryKey, XEe as discoveryScore, Vye as distinctName, Tbe as dropReviewRows, xi as dropSources, lpe as du, Kye as duplicateVictims, DF as elapsedText, Xa as entityFaceImg, hn as entityPath, Ir as errorHeadline, Wn as errorMessage, z as esc, Eq as expandRowModel, sz as f1, Fr as feedIntervalText, e1 as fetchAmaneBridge, $r as fetchCheckJob, u1 as fetchConfiguration, $$ as fetchCoverJob, Qr as fetchCredentials, q$ as fetchCustomSources, NQ as fetchDiagnostics, T$ as fetchDiscoveries, yY as fetchDuplicates, eue as fetchEarlier, Lbe as fetchFeedSchedule, pi as fetchFeeds, Zr as fetchFollow, Ibe as fetchFollowSchedule, OX as fetchJunkSummary, WY as fetchLinkCheck, GY as fetchLinkPrune, UY as fetchLinkStats, Fbe as fetchMediaProcessing, wY as fetchMediaRepair, tr as fetchMediaSources, sX as fetchOrganize, Xbe as fetchOrganizeExample, uX as fetchOrphanRecords, fi as fetchPending, W$ as fetchPlaylists, OY as fetchQualityGoals, TY as fetchRepairLibraries, ei as fetchResolveJob, gX as fetchResourceApply, hX as fetchResourceScan, IY as fetchReview, DX as fetchReviewCounts, iX as fetchSettings, Q$ as fetchSources, d3 as fetchStats, ti as fetchSuggestions, SF as fetchTasks, I3 as fetchTaste, yAe as fetchTasteJob, Rbe as fetchThumbnailJobs, kX as fetchTrashSummary, v$ as fetchWants, lbe as filterReviewRows, Fn as firstGrapheme, IK as flexRender, PAe as flowGraph, FAe as flowLabel, Nke as fmtCount, kn as fmtDur, jn as fmtSize, mue as foldRoutine, vi as followFeedByName, Cr as followSuggestKey, gue as followupDetail, Of as frame, Nfe as g4, Xq as getDefaultPaginationState, kA as gridLayout, Wr as groupByAuthor, pue as groupFollowups, NY as groupReviewRows, yxe as hasChanges, _X as hasResourceRoots, wF as hasResultProblems, TAe as historySpan, cz as i2, CAe as importTasteExport, T0 as indexersSkeleton, Xf as interpolate, x$ as invalidateWants, EF as isActive, Pr as isBroken, Or as isLayout, Fh as isMotionValue, MY as isReviewCategory, hue as isRoutine, E0 as javBrowserSkeleton, I0 as javContentSkeleton, SA as javLayout, F0 as javTagSkeleton, kxe as junkBreakdown, gTe as keepPlaylist, ke as keepPreviousData, Jr as keepSelected, f3 as known, Lfe as l7, fue as latestOfKind, Gke as lengthRows, ir as localTime, _i as lookupFeedActor, Bfe as m7, yz as mM, cn as mapLimit, di as markItem, _3 as max, Uke as mediumRows, tue as mergeFinished, v3 as min, Dbe as mirrorText, Qye as missingToolText, bY as mixedCloudPreferences, PF as momentText, Zy as motion, fh as motionValue, oxe as organizeOutcome, Z0 as overlayHost, kr as pageSizeOf, qr as pageWindow, Xn as paginationRange, bi as patchSource, qV as peachHistory, qV as peachHistory$1, _be as pendingGenres, Fke as percentText, $be as pickOrganizeFolder, axe as planSummary, p3 as playedFor, Lke as playedItemUrl, xF as pollInterval, ks as popCount, fTe as posterUrl, QW as previewLibraryColor, Qbe as previewOrganize, tbe as previewUrl, due as problemDestination, OF as progressText, QH as providerIcon, Mbe as pruneText, yX as purgeCount, dxe as purgeOrphan, xz as pv, cpe as qE, H as queryClient, lz as r2, jAe as radarRows, Bke as radialArc, Vke as radialBarSize, zke as radialCeiling, Rke as radialSlices, Yj as randomId, kAe as rankDetail, AAe as rankShares, h3 as reachedShare, kF as readableErrorHeadline, ZEe as recommendationScore, Cbe as recordGenre, pxe as recordsText, _Te as recreatePlaylist, uTe as refreshPlaylists, xl as relayoutCovers, Si as reloadFollowManage, Ebe as reloadReview, kEe as rememberShape, txe as rememberTemplates, ci as removeAlias, hi as removeFeed, ai as removeSource, SAe as removeTasteSource, b$ as removeWants, li as renameAliasGroup, mTe as renamePlaylist, qke as replayRows, ie as require_jsx_runtime, A as require_react, te as require_react_dom, aq as require_with_selector, Uwe as resetWants, Yn as resolveFollowSort, up as resolveStartTime, dTe as resumeAssetId, cbe as reviewGroupingOptions, Oxe as reviewSummary, ube as reviewWindow, hbe as rowEvidence, FY as rowFieldName, rJ as rowPaginationFeature, wJ as rowSelectionFeature, LJ as rowSortingFeature, PY as rowSubject, gbe as rowTags, mbe as rowTitle, Pfe as s5, ui as saveCredential, bxe as scanLine, Ube as schedulePollInterval, Gwe as searchNote, fbe as selectReviewRange, Yr as selectionState, mi as setFeedEnabled, ii as setSourceEnabled, lV as settingsPath, Bye as sharedNamePrefix, JV as shellNavigate, x8 as showToast, xn as siteMarkUrl, _q as skipFirstRun, lF as sortCx, jr as sortLabel, en as sourceDefaultCost, ki as sourceIconUrl, Cxe as sourceMeta, bs as spinnerHtml, qf as spring, Iz as spriteGlyph, ni as startCheck, Abe as startLinkCheck, jbe as startLinkPrune, exe as startOrganize, ri as startResolve, _xe as startResourceApply, gxe as startResourceScan, xAe as startTasteRefresh, sue as statusLabel, Zye as statusLine, Nr as statusText, jA as storeJavLayout, xbe as submitDecision, IF as summaryItems, zq as tableFeatures, vq as tableMemo, Kr as tableRows, uue as taskIssues, L3 as tasteDate, DAe as tasteDimensions, EAe as tasteHours, F3 as tasteKey, gAe as tasteRefetchInterval, _Ae as tasteTime, hF as textLang, ld as time, Xfe as tl, Xr as toggleGroup, R3 as topScores, $fe as uo, TH as useAction, jZ as useBackgroundJob, gU as useClientUpdates, xu as useConstant, UF as useHorizontalScroller, Su as useIsomorphicLayoutEffect, eG as useLibraryTints, Ft as useMutation, nV as useOverlayScrollbar, Pt as useQuery, oe as useQueryClient, Uy as useReducedMotion, Hbe as useRunSchedule, Bbe as useSaveFollowSchedule, aX as useSaveSettings, Wbe as useSaveThumbnailMode, RJ as useTable, tY as useTablePreferences, qye as victimBytes, Wwe as wantName, Ike as watchNote, m3 as watchedShare, cc as wireHorizontalScroller, nxe as withOrganizeJob };
-//# debugId=46c860c3-fe0f-46e7-8b3c-a41e724abe3b
\ No newline at end of file
+//# debugId=9e97a633-15eb-4ecb-8d9f-dd41af91101d
\ No newline at end of file
diff --git a/web/index.html b/web/index.html
index e355effbd..08e400ff9 100644
--- a/web/index.html
+++ b/web/index.html
@@ -36,7 +36,7 @@ if(location.pathname==='/wall')document.documentElement.setAttribute('data-wall-
</head>
<body>
<a class="skiplink" href="#main">跳到正文</a>
-<!-- Lucide static 1.57.0, ISC. Local pinned subset; no CDN/runtime dependency.
+<!-- Lucide static 1.61.0, ISC. Local pinned subset; no CDN/runtime dependency.
Climax uses Health Icons 2.0.0 sperm outline-24px, CC0/public domain.
Phosphor 2.1.1 regular, MIT: filled glyphs where a stroked icon cannot say it. -->
<svg aria-hidden="true" width="0" height="0" style="position:absolute;overflow:hidden">
diff --git a/web/vendor/lucide-ORIGIN.md b/web/vendor/lucide-ORIGIN.md
index 3d3388f4d..eab60afb1 100644
--- a/web/vendor/lucide-ORIGIN.md
+++ b/web/vendor/lucide-ORIGIN.md
@@ -1,7 +1,7 @@
-# Lucide static 1.57.0
+# Lucide static 1.61.0
-- npm 包:`[email protected]`
-- npm lock integrity:`sha512-nuf4YoaKt3Pq9scXVQ71SLr0Q1/UZiTcfBBivFsCVL6biAzPplTikVWXLetBmK3oFEJS6f2L1rzgEsoJN/Ce0Q==`
+- npm 包:`[email protected]`
+- npm lock integrity:`sha512-yLAiQB3MWUJEstsEDAwenSA3m7vr1tdLvgnC16Q/XMxRRma0DWwMs8M2bWlvgShrIs1m2mWMJ+0AiahqQO4GrA==`
- 许可证:ISC;原文见 `lucide-LICENSE.txt`
- 消费者:`web/index.html` 内联的 127 个 symbol
diff --git a/web/vendor/videojs/10.1.0/session-data-B6deNOmy.js b/web/vendor/videojs/10.1.0/session-data-B6deNOmy.js
deleted file mode 100644
index f1c379c84..000000000
--- a/web/vendor/videojs/10.1.0/session-data-B6deNOmy.js
+++ /dev/null
@@ -1,2 +0,0 @@
-function e(e,t){return new URL(e,t).href}function t(t,n){if(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/^https?:/i.test(t))return t;try{return e(t,n)}catch{return t}}function n(e){return Math.exp(Math.log(.5)/e)}function r(e,t,r,i){let a=n(i)**r;return t*(1-a)+a*e}function i(e,t,r){return t===0?0:e/(1-n(r)**t)}const a={fastHalfLife:2,slowHalfLife:5,minTotalBytes:128e3,minBytes:16e3,minDuration:5};function o(e,t,n,i=a){let o=e.bytesSampled+n;if(n<i.minBytes||t<i.minDuration)return{...e,bytesSampled:o};let s=8e3*n/t,c=t/1e3;return{fastEstimate:r(e.fastEstimate,s,c,i.fastHalfLife),fastTotalWeight:e.fastTotalWeight+c,slowEstimate:r(e.slowEstimate,s,c,i.slowHalfLife),slowTotalWeight:e.slowTotalWeight+c,bytesSampled:o}}function s(e,t,n=a){if(!e||!(e.bytesSampled>=n.minTotalBytes&&e.fastTotalWeight>0&&e.slowTotalWeight>0))return t;let r=i(e.fastEstimate,e.fastTotalWeight,n.fastHalfLife),o=i(e.slowEstimate,e.slowTotalWeight,n.slowHalfLife);return Math.min(r,o)}const c=2**17;var l=class{#e;#t;constructor(e,{minChunkSize:t=c}={}){this.#t=e,this.#e=t}async*[Symbol.asyncIterator](){let e,t=this.#t.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n){e&&(yield e);break}e=e?u(e,r):r,e.length>=this.#e&&(yield e,e=void 0)}}finally{t.releaseLock()}}};function u(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}async function d(e,t){let n=new Headers(t?.headers);if(e.byteRange){let{start:t,end:r}=e.byteRange;n.set(`Range`,`bytes=${t}-${r}`)}let r=new Request(e.url,{method:`GET`,...t,headers:n});return fetch(r)}function f(e){return e.text()}const p=async(e,t)=>{let n=await d(e,t);if(!n.ok)throw Error(`fetchResolvableText: ${n.status} ${n.statusText} for ${e.url}`);return f(n)};async function m(e,t){let{minChunkSize:n,...r}=t??{},i=await d(e,r);if(!i.ok)throw Error(`fetchStream: ${i.status} ${i.statusText} for ${e.url}`);if(!i.body)throw Error(`Response has no body`);return new l(i.body,...n===void 0?[]:[{minChunkSize:n}])}function h(e,t){let n=e;return async(e,r)=>{let i=await m(e,r);return{[Symbol.asyncIterator]:async function*(){let e=performance.now();for await(let r of i){let i=performance.now()-e;n=o(n,i,r.byteLength),t(n),yield r,e=performance.now()}}}}}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e.matchAll(/([A-Z0-9-]+)=(?:"([^"]*)"|([^,]*))/g)){let e=n[1],r=n[2]??n[3]??``;e&&t.set(e,r)}return t}function _(e){let t=/^(\d+)x(\d+)$/.exec(e);return t?{width:Number.parseInt(t[1],10),height:Number.parseInt(t[2],10)}:null}function v(e){let t=Number.parseFloat(e);if(!(Number.isNaN(t)||t<=0))return Math.abs(t-23.976)<.01?{frameRateNumerator:24e3,frameRateDenominator:1001}:Math.abs(t-29.97)<.01?{frameRateNumerator:3e4,frameRateDenominator:1001}:Math.abs(t-59.94)<.01?{frameRateNumerator:6e4,frameRateDenominator:1001}:(t%1,{frameRateNumerator:Math.round(t)})}const y=[`mp4a.`,`ac-3`,`ec-3`,`ac-4`,`opus`,`flac`,`dts`,`alac`,`vorbis`];function b(e){let t=e.split(`,`).map(e=>e.trim()),n={};for(let e of t){let t=e.toLowerCase();e.startsWith(`avc1.`)||e.startsWith(`hvc1.`)||e.startsWith(`hev1.`)?n.video=e:y.some(e=>t.startsWith(e))&&(n.audio=e)}return n}function x(e){let t=e.split(`,`)[0]??e,n=Number.parseFloat(t);return Number.isNaN(n)?0:n}function S(e,t){let n=/^(\d+)(?:@(\d+))?$/.exec(e);if(!n)return null;let r=Number.parseInt(n[1],10);if(Number.isNaN(r))return null;let i;if(n[2]!==void 0){if(i=Number.parseInt(n[2],10),Number.isNaN(i))return null}else if(t!==void 0)i=t;else return null;return{start:i,end:i+r-1}}function C(e){let t=g(e);return{get(e){return t.get(e)},getInt(e,n){let r=t.get(e);if(r===void 0)return n;let i=Number.parseInt(r,10);return Number.isNaN(i)?n:i},getFloat(e,n){let r=t.get(e);if(r===void 0)return n;let i=Number.parseFloat(r);return Number.isNaN(i)?n:i},getBool(e){return t.get(e)===`YES`},getResolution(e){let n=t.get(e);if(n)return _(n)??void 0},getFrameRate(e){let n=t.get(e);if(n)return v(n)}}}function w(e,t){let n=`#${t}:`;return e.startsWith(n)?C(e.slice(n.length)):null}function T(t,n){let r=t.get(`DATA-ID`),i=t.get(`VALUE`),a=t.get(`URI`);if(!r||i===void 0&&a===void 0)return;let o=t.get(`LANGUAGE`),s={dataId:r};return i!==void 0&&(s.value=i),a!==void 0&&(s.uri=e(a,n),s.format=t.get(`FORMAT`)===`RAW`?`RAW`:`JSON`),o&&(s.language=o),s}function E(e,t,n){for(let r of e.split(/\r?\n/)){let e=w(r.trim(),`EXT-X-SESSION-DATA`),i=e&&T(e,n);if(i?.dataId===t&&i.uri)return i.uri}}export{b as a,d as c,f as d,a as f,e as h,S as i,p as l,t as m,T as n,x as o,s as p,w as r,h as s,E as t,m as u};
-//# sourceMappingURL=session-data-B6deNOmy.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/LICENSE b/web/vendor/videojs/10.2.0/LICENSE
similarity index 100%
rename from web/vendor/videojs/10.1.0/LICENSE
rename to web/vendor/videojs/10.2.0/LICENSE
diff --git a/web/vendor/videojs/10.1.0/ORIGIN.md b/web/vendor/videojs/10.2.0/ORIGIN.md
similarity index 93%
rename from web/vendor/videojs/10.1.0/ORIGIN.md
rename to web/vendor/videojs/10.2.0/ORIGIN.md
index f816b0889..aacf01ef0 100644
--- a/web/vendor/videojs/10.1.0/ORIGIN.md
+++ b/web/vendor/videojs/10.2.0/ORIGIN.md
@@ -1,11 +1,11 @@
-# @videojs/cdn 10.1.0
+# @videojs/cdn 10.2.0
-- npm 包:`@videojs/[email protected]`
-- npm lock integrity:`sha512-xn8NRHdWXzAm3vEchRI+zkUsoQS5YAh44IFC03osW9FMA+5ATOYFfL9AuSsL2n19mNoJMWtCoTF7c0fYR9AM/A==`
+- npm 包:`@videojs/[email protected]`
+- npm lock integrity:`sha512-prkTxxd5h5FcEafOfBKdSKABBHQUAirExL4/DPckQajngE8xpnR4PnkvdBCue5J0Hr064C6CXXGiE0om5kSxXA==`
- 许可证:见同目录 `LICENSE`
- `abort-CDkm8-HH.js` SHA-256:`13BF62DFCBFDB09181E24628786F85DA608CAC74844229146EB52085FB043CCA`
-- `adapter-CbeHSDev.js` SHA-256:`54D2828617648145CFE18EBDE12E517BC59CF182B2DD5D097A60757EAA699C49`
-- `adapter-DnHSdWh1.js` SHA-256:`E0D7982F9DE5B5E151F40AB36961A55A9C1AB9B73D5847C1F05B46CFA634A31B`
+- `adapter-B_5kn1ML.js` SHA-256:`2AD5ACB80D0B5D575F974C155DB4E3E8AE396020C12A9006AAACC543DFA1EA76`
+- `adapter-CU0vk5zH.js` SHA-256:`2574A8FDAA1ABF0A345E266A966CE16E57812BC15FB888097446EE5C31479A31`
- `ar-D_zi_Hz2.js` SHA-256:`98DBD56BDE5422945E430EE9C800D8E82494761C8DED2AAF8C060B471AE3BAA4`
- `attributes-DrTKm-Cs.js` SHA-256:`D5A23B58DB4B37C6EF714316795B2F7588D731FBCBF474D5ADBCD7DB94932A82`
- `az-DbXa5TeW.js` SHA-256:`C4C2910B97DDABC92DCD97F89E09FE448DC90E8FA33C63344AA634E748E34FA7`
@@ -66,7 +66,7 @@
- `ko-CMng7IiT.js` SHA-256:`979438212CA0B28EED8B0A10F04E0B2EB56413BD108B6CF880B2F60623FA14A8`
- `layout-DqqwqjPS.js` SHA-256:`69A0A87F4B2546B20B5694C6284C5DA1B4E10D88CA1A926F7AE8BC9057F49456`
- `listen-4VrUltMW.js` SHA-256:`0FCF132E9A9ADA9F2D52FE39A823A637DCD284E2FC7C1C6CD92CF8BF5978A09B`
-- `load-chapters-tracks-D1x4MkCp.js` SHA-256:`B9B3B5FFC64E7078D9948995B808A4AA79B34291D8B0BF0CC1E216297814B48F`
+- `load-chapters-tracks-Btgfpe8i.js` SHA-256:`BFD3F07598BBBFDD13B3004F109339D6641ED14745DA4CA75BD6DBC755EA95B2`
- `locales/zh-CN.js` SHA-256:`E9B68101342526D7D85D14D22BECCFE77B5966B6C764C4FCCEEFE0B3593B23E6`
- `lt-BTJ_wwtC.js` SHA-256:`B6003A5B2786B8D2D0D1A4EFC4F910EB3BAE263D7EF67D0783FB9D262E8B83D0`
- `lv-BnFI_F0g.js` SHA-256:`D628CE5DF9EA002B2FE07434A8E4733FF8FB5B1444C429DBEDC97A41105DEDF3`
@@ -74,7 +74,7 @@
- `media-button-element-Ch1MLKNP.js` SHA-256:`F4008035ED42AFB687ED478C74213C221FCFBC0496C9A5DA871AB5DB06836899`
- `media-error-CtsbOTR1.js` SHA-256:`C463496E32F5E0841FC8D8A6B8EB5BA318940AD88B9E2AFED9AF3B97398130EA`
- `media/dash-video.js` SHA-256:`47B64CF0F315F41EEEF5FDEECC81FF94C18734E8739116AAA75340B6507CAB9C`
-- `media/hlsjs-video.js` SHA-256:`637F14B71CF33AA98016DA43567B05BEEC468BAB797579BC9043184DCBEE5221`
+- `media/hlsjs-video.js` SHA-256:`9659EAED97CADF14CE12B729195ABF2C3AC68532557E8D229F2F6D72639E4716`
- `mixin-BUx02nig.js` SHA-256:`CA3773019C4EDFF0E5A0F96C6AF42E1678CDA5E092A95FD6370D80F7D917A2A6`
- `mr--MsdgHNa.js` SHA-256:`4F291AF2C105F657427179F6D2D7393AAF1558A9AD60BE130E7E6A2EA1E11EF9`
- `nb-BXZqkmve.js` SHA-256:`9330C124D18740AFD822C0DF096A97DCA1DFDF6000197051218442B937EF390C`
@@ -103,7 +103,7 @@
- `ru-C5e8OFTp.js` SHA-256:`B5A0454C5419B2FE9F47E7A8AFC15116410489B6972723E5C9B306AF2976A5F7`
- `safe-define-DXxmf7BV.js` SHA-256:`FEB05D3D1B5491C4A7B7E1455C3A2C107C97C083832C66B481152C47F50C0E4A`
- `selectors-DMVJijlA.js` SHA-256:`897B8E19A28D7165AEAA0B658DEB23F78702024A3B42A61CB8FF6AD77AF410E7`
-- `session-data-B6deNOmy.js` SHA-256:`20C163DA6B4196FD8F740BE04A7416E4BC1D4AE045C5994E6A1C369F78B385A5`
+- `session-data-Ca8-DKdu.js` SHA-256:`051637B1E0988B6F5CF31493AA5E82FA6E040D8C27DD9CB184F650A62F9A1926`
- `shallow-equal-KV1zFqZi.js` SHA-256:`0AA0609E5F360B4C1006A0AAABAA935EFD38C3A4E182AD2C3795B35260248DF8`
- `sk-Bh5EH8V-.js` SHA-256:`1525C3FB804372347AA40CA013E67FE760DD7B8067B54C99E7627579C4B79E19`
- `sl-C7qQj8Td.js` SHA-256:`7B56907C1B156FDBC9D199A9C69E5173F0B0A7550A1C901B07DEE65D04EE8618`
@@ -132,8 +132,8 @@
- `ui/slider-thumb.js` SHA-256:`B205CE9D55A0ECD0A27EDD412F666A13D2C6D62388AE38ABFBF83E5285BBEE6F`
- `ui/slider-track.js` SHA-256:`8A1F2D7E7CD0FE943099E8CCEA7DF9A5C98DA5B087E7C2679430E6BFD4C373E4`
- `ui/slider-value.js` SHA-256:`966A0D6B0874810DB8C77A4412C91919C0B6CAC338AE16315EB17E74EC8CB7B3`
-- `ui/time-slider.js` SHA-256:`B9C80D3BB56DC2E04A64E44747344B006D0A3ACC2B19A74F4FDCEC5E954C38DC`
-- `ui/volume-slider.js` SHA-256:`F102A925142B54FB0D19D40EF1A7C809E5E06215238C7B72FBC1CBDBA3AB8A0D`
+- `ui/time-slider.js` SHA-256:`B773E981BF5676EBB0028095FE9DEAB4D12B7B052874F164EE6B92F51FE2BF20`
+- `ui/volume-slider.js` SHA-256:`D14B69BC7B7739365982D610BC51AF9F3F60555A6C651F115ABABAC3BED0BBEB`
- `uk-Br37zRSF.js` SHA-256:`4F2F2CC73B6CE314144302B42EC5A5056DBD20791412A4073F015C396016C405`
- `vi-BFXv9B0L.js` SHA-256:`2DB28AC565E20A313CE08F8062F6E9CE672937233393B27FC856B8CBBDB9B770`
- `video-player.js` SHA-256:`5CED2A7C8A95C920EBAF353F8E25DA4E93D3F43B12082767711D731C41F85C50`
diff --git a/web/vendor/videojs/10.1.0/abort-CDkm8-HH.js b/web/vendor/videojs/10.2.0/abort-CDkm8-HH.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/abort-CDkm8-HH.js
rename to web/vendor/videojs/10.2.0/abort-CDkm8-HH.js
diff --git a/web/vendor/videojs/10.1.0/adapter-DnHSdWh1.js b/web/vendor/videojs/10.2.0/adapter-B_5kn1ML.js
similarity index 97%
rename from web/vendor/videojs/10.1.0/adapter-DnHSdWh1.js
rename to web/vendor/videojs/10.2.0/adapter-B_5kn1ML.js
index 38794bcc4..eabfcc3f4 100644
--- a/web/vendor/videojs/10.1.0/adapter-DnHSdWh1.js
+++ b/web/vendor/videojs/10.2.0/adapter-B_5kn1ML.js
@@ -1,4 +1,4 @@
-import{d as e}from"./predicate-DSCS8XT4.js";import{t}from"./deep-equal-BgDgiSiY.js";import{t as n}from"./listen-4VrUltMW.js";import{r}from"./text-track-aC_8Gh6M.js";import{t as i}from"./webkit-DljEkldb.js";import{t as a}from"./adapter-CbeHSDev.js";import{t as o}from"./media-error-CtsbOTR1.js";import{n as s}from"./types-HOYOipK7.js";import{t as c}from"./html-video-adapter-BGKgkryA.js";import{t as l}from"./mixin-BUx02nig.js";import{n as u,t as d}from"./load-chapters-tracks-D1x4MkCp.js";function f(e,t){e.dispatchEvent&&=e=>t.dispatchEvent(new e.constructor(e.type,e))}const p=Number.isFinite||function(e){return typeof e==`number`&&isFinite(e)},m=Number.isSafeInteger||function(e){return typeof e==`number`&&Math.abs(e)<=h},h=2**53-1||9007199254740991;let g=/*#__PURE__*/ function(e){return e.NETWORK_ERROR=`networkError`,e.MEDIA_ERROR=`mediaError`,e.KEY_SYSTEM_ERROR=`keySystemError`,e.MUX_ERROR=`muxError`,e.OTHER_ERROR=`otherError`,e}({}),_=/*#__PURE__*/ function(e){return e.KEY_SYSTEM_NO_KEYS=`keySystemNoKeys`,e.KEY_SYSTEM_NO_ACCESS=`keySystemNoAccess`,e.KEY_SYSTEM_NO_SESSION=`keySystemNoSession`,e.KEY_SYSTEM_NO_CONFIGURED_LICENSE=`keySystemNoConfiguredLicense`,e.KEY_SYSTEM_LICENSE_REQUEST_FAILED=`keySystemLicenseRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED=`keySystemServerCertificateRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED=`keySystemServerCertificateUpdateFailed`,e.KEY_SYSTEM_SESSION_UPDATE_FAILED=`keySystemSessionUpdateFailed`,e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED=`keySystemStatusOutputRestricted`,e.KEY_SYSTEM_STATUS_INTERNAL_ERROR=`keySystemStatusInternalError`,e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR=`keySystemDestroyMediaKeysError`,e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR=`keySystemDestroyCloseSessionError`,e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR=`keySystemDestroyRemoveSessionError`,e.MANIFEST_LOAD_ERROR=`manifestLoadError`,e.MANIFEST_LOAD_TIMEOUT=`manifestLoadTimeOut`,e.MANIFEST_PARSING_ERROR=`manifestParsingError`,e.MANIFEST_INCOMPATIBLE_CODECS_ERROR=`manifestIncompatibleCodecsError`,e.LEVEL_EMPTY_ERROR=`levelEmptyError`,e.LEVEL_LOAD_ERROR=`levelLoadError`,e.LEVEL_LOAD_TIMEOUT=`levelLoadTimeOut`,e.LEVEL_PARSING_ERROR=`levelParsingError`,e.LEVEL_SWITCH_ERROR=`levelSwitchError`,e.AUDIO_TRACK_LOAD_ERROR=`audioTrackLoadError`,e.AUDIO_TRACK_LOAD_TIMEOUT=`audioTrackLoadTimeOut`,e.SUBTITLE_LOAD_ERROR=`subtitleTrackLoadError`,e.SUBTITLE_TRACK_LOAD_TIMEOUT=`subtitleTrackLoadTimeOut`,e.FRAG_LOAD_ERROR=`fragLoadError`,e.FRAG_LOAD_TIMEOUT=`fragLoadTimeOut`,e.FRAG_DECRYPT_ERROR=`fragDecryptError`,e.FRAG_PARSING_ERROR=`fragParsingError`,e.FRAG_GAP=`fragGap`,e.REMUX_ALLOC_ERROR=`remuxAllocError`,e.KEY_LOAD_ERROR=`keyLoadError`,e.KEY_LOAD_TIMEOUT=`keyLoadTimeOut`,e.BUFFER_ADD_CODEC_ERROR=`bufferAddCodecError`,e.BUFFER_INCOMPATIBLE_CODECS_ERROR=`bufferIncompatibleCodecsError`,e.BUFFER_APPEND_ERROR=`bufferAppendError`,e.BUFFER_APPENDING_ERROR=`bufferAppendingError`,e.BUFFER_STALLED_ERROR=`bufferStalledError`,e.BUFFER_FULL_ERROR=`bufferFullError`,e.BUFFER_SEEK_OVER_HOLE=`bufferSeekOverHole`,e.BUFFER_NUDGE_ON_STALL=`bufferNudgeOnStall`,e.ASSET_LIST_LOAD_ERROR=`assetListLoadError`,e.ASSET_LIST_LOAD_TIMEOUT=`assetListLoadTimeout`,e.ASSET_LIST_PARSING_ERROR=`assetListParsingError`,e.INTERSTITIAL_ASSET_ITEM_ERROR=`interstitialAssetItemError`,e.INTERNAL_EXCEPTION=`internalException`,e.INTERNAL_ABORTED=`aborted`,e.ATTACH_MEDIA_ERROR=`attachMediaError`,e.UNKNOWN=`unknown`,e}({}),v=/*#__PURE__*/ function(e){return e.MEDIA_ATTACHING=`hlsMediaAttaching`,e.MEDIA_ATTACHED=`hlsMediaAttached`,e.MEDIA_DETACHING=`hlsMediaDetaching`,e.MEDIA_DETACHED=`hlsMediaDetached`,e.MEDIA_ENDED=`hlsMediaEnded`,e.STALL_RESOLVED=`hlsStallResolved`,e.BUFFER_RESET=`hlsBufferReset`,e.BUFFER_CODECS=`hlsBufferCodecs`,e.BUFFER_CREATED=`hlsBufferCreated`,e.BUFFER_APPENDING=`hlsBufferAppending`,e.BUFFER_APPENDED=`hlsBufferAppended`,e.BUFFER_EOS=`hlsBufferEos`,e.BUFFERED_TO_END=`hlsBufferedToEnd`,e.BUFFER_FLUSHING=`hlsBufferFlushing`,e.BUFFER_FLUSHED=`hlsBufferFlushed`,e.MANIFEST_LOADING=`hlsManifestLoading`,e.MANIFEST_LOADED=`hlsManifestLoaded`,e.MANIFEST_PARSED=`hlsManifestParsed`,e.LEVEL_SWITCHING=`hlsLevelSwitching`,e.LEVEL_SWITCHED=`hlsLevelSwitched`,e.LEVEL_LOADING=`hlsLevelLoading`,e.LEVEL_LOADED=`hlsLevelLoaded`,e.LEVEL_UPDATED=`hlsLevelUpdated`,e.LEVEL_PTS_UPDATED=`hlsLevelPtsUpdated`,e.LEVELS_UPDATED=`hlsLevelsUpdated`,e.AUDIO_TRACKS_UPDATED=`hlsAudioTracksUpdated`,e.AUDIO_TRACK_SWITCHING=`hlsAudioTrackSwitching`,e.AUDIO_TRACK_SWITCHED=`hlsAudioTrackSwitched`,e.AUDIO_TRACK_LOADING=`hlsAudioTrackLoading`,e.AUDIO_TRACK_LOADED=`hlsAudioTrackLoaded`,e.AUDIO_TRACK_UPDATED=`hlsAudioTrackUpdated`,e.SUBTITLE_TRACKS_UPDATED=`hlsSubtitleTracksUpdated`,e.SUBTITLE_TRACKS_CLEARED=`hlsSubtitleTracksCleared`,e.SUBTITLE_TRACK_SWITCH=`hlsSubtitleTrackSwitch`,e.SUBTITLE_TRACK_LOADING=`hlsSubtitleTrackLoading`,e.SUBTITLE_TRACK_LOADED=`hlsSubtitleTrackLoaded`,e.SUBTITLE_TRACK_UPDATED=`hlsSubtitleTrackUpdated`,e.SUBTITLE_FRAG_PROCESSED=`hlsSubtitleFragProcessed`,e.CUES_PARSED=`hlsCuesParsed`,e.NON_NATIVE_TEXT_TRACKS_FOUND=`hlsNonNativeTextTracksFound`,e.INIT_PTS_FOUND=`hlsInitPtsFound`,e.FRAG_LOADING=`hlsFragLoading`,e.FRAG_LOAD_EMERGENCY_ABORTED=`hlsFragLoadEmergencyAborted`,e.FRAG_LOADED=`hlsFragLoaded`,e.FRAG_DECRYPTED=`hlsFragDecrypted`,e.FRAG_PARSING_INIT_SEGMENT=`hlsFragParsingInitSegment`,e.FRAG_PARSING_USERDATA=`hlsFragParsingUserdata`,e.FRAG_PARSING_METADATA=`hlsFragParsingMetadata`,e.FRAG_PARSED=`hlsFragParsed`,e.FRAG_BUFFERED=`hlsFragBuffered`,e.FRAG_CHANGED=`hlsFragChanged`,e.FPS_DROP=`hlsFpsDrop`,e.FPS_DROP_LEVEL_CAPPING=`hlsFpsDropLevelCapping`,e.MAX_AUTO_LEVEL_UPDATED=`hlsMaxAutoLevelUpdated`,e.ERROR=`hlsError`,e.DESTROYING=`hlsDestroying`,e.KEY_LOADING=`hlsKeyLoading`,e.KEY_LOADED=`hlsKeyLoaded`,e.LIVE_BACK_BUFFER_REACHED=`hlsLiveBackBufferReached`,e.BACK_BUFFER_REACHED=`hlsBackBufferReached`,e.STEERING_MANIFEST_LOADED=`hlsSteeringManifestLoaded`,e.ASSET_LIST_LOADING=`hlsAssetListLoading`,e.ASSET_LIST_LOADED=`hlsAssetListLoaded`,e.INTERSTITIALS_UPDATED=`hlsInterstitialsUpdated`,e.INTERSTITIALS_BUFFERED_TO_BOUNDARY=`hlsInterstitialsBufferedToBoundary`,e.INTERSTITIAL_ASSET_PLAYER_CREATED=`hlsInterstitialAssetPlayerCreated`,e.INTERSTITIAL_STARTED=`hlsInterstitialStarted`,e.INTERSTITIAL_ASSET_STARTED=`hlsInterstitialAssetStarted`,e.INTERSTITIAL_ASSET_ENDED=`hlsInterstitialAssetEnded`,e.INTERSTITIAL_ASSET_ERROR=`hlsInterstitialAssetError`,e.INTERSTITIAL_ENDED=`hlsInterstitialEnded`,e.INTERSTITIALS_PRIMARY_RESUMED=`hlsInterstitialsPrimaryResumed`,e.PLAYOUT_LIMIT_REACHED=`hlsPlayoutLimitReached`,e.EVENT_CUE_ENTER=`hlsEventCueEnter`,e}({});var y={MANIFEST:`manifest`,LEVEL:`level`,AUDIO_TRACK:`audioTrack`,SUBTITLE_TRACK:`subtitleTrack`},b={MAIN:`main`,AUDIO:`audio`,SUBTITLE:`subtitle`},x=class{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){let n=this.alpha_**+e;this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){let e=1-this.alpha_**+this.totalWeight_;if(e)return this.estimate_/e}return this.estimate_}},S=class{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new x(e),this.fast_=new x(t),this.defaultTTFB_=r,this.ttfb_=new x(e)}update(e,t){let{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new x(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new x(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new x(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);let n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){let t=e/1e3,n=Math.sqrt(2)*Math.exp(-(t**2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}};function C(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(null,arguments)}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function O(e){var t=D(e,`string`);return typeof t==`symbol`?t:t+``}var k=class{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;let n=`[${e}]:`;this.trace=A,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}};const A=function(){},j={trace:A,debug:A,log:A,warn:A,info:A,error:A};function M(){return w({},j)}function ee(e,t){let n=self.console[e];return n?n.bind(self.console,`${t?`[`+t+`] `:``}[${e}] >`):A}function te(e,t,n){return t[e]?t[e].bind(t):ee(e,n)}const N=M();function ne(e,t,n){let r=M();if(typeof console==`object`&&e===!0||typeof e==`object`){let i=[`debug`,`log`,`info`,`warn`,`error`];i.forEach(t=>{r[t]=te(t,e,n)});try{r.log(`Debug logs enabled for "${t}" in hls.js version 1.6.19`)}catch{return M()}i.forEach(t=>{N[t]=te(t,e)})}else w(N,r);return r}const P=N;function re(e=!0){if(typeof self<`u`)return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ie(e){return typeof self<`u`&&e===self.ManagedMediaSource}function ae(e,t){let n=Object.keys(e),r=Object.keys(t),i=n.length,a=r.length;return!i||!a||i===a&&!n.some(e=>r.indexOf(e)===-1)}function oe(e,t=!1){if(typeof TextDecoder<`u`){let n=new TextDecoder(`utf-8`).decode(e);if(t){let e=n.indexOf(`\0`);return e===-1?n:n.substring(0,e)}return n.replace(/\0/g,``)}let n=e.length,r,i,a,o=``,s=0;for(;s<n;){if(r=e[s++],r===0&&t)return o;if(r!==0&&r!==3)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:i=e[s++],o+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=e[s++],a=e[s++],o+=String.fromCharCode((r&15)<<12|(i&63)<<6|(a&63)<<0)}}return o}function F(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length<2&&(r=`0`+r),t+=r}return t}function se(e){return Uint8Array.from(e.replace(/^0x/,``).replace(/([\da-fA-F]{2}) ?/g,`0x$1 `).replace(/ +$/,``).split(` `)).buffer}function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var le={exports:{}},ue;function de(){return ue?le.exports:(ue=1,(function(e,t){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw Error(`Error trying to parse base URL.`);return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw Error(`Error trying to parse relative URL.`);if(a.scheme)return n.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var s=o.parseURL(e);if(!s)throw Error(`Error trying to parse base URL.`);if(!s.netLoc&&s.path&&s.path[0]!==`/`){var c=r.exec(s.path);s.netLoc=c[1],s.path=c[2]}s.netLoc&&!s.path&&(s.path=`/`);var l={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=s.netLoc,a.path[0]!==`/`)){if(!a.path)l.path=s.path,a.params||(l.params=s.params,a.query||(l.query=s.query));else{var u=s.path,d=u.substring(0,u.lastIndexOf(`/`)+1)+a.path;l.path=o.normalizePath(d)}}return l.path===null&&(l.path=n.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(i,``);e.length!==(e=e.replace(a,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=o})()})(le),le.exports)}var fe=de(),pe=class{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},I={AUDIO:`audio`,VIDEO:`video`,AUDIOVIDEO:`audiovideo`},me=class{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e==`string`&&(e={url:e}),this.base=e,ve(this,`stats`)}setByteRange(e,t){let n=e.split(`@`,2),r;r=n.length===1?t?.byteRangeEndOffset||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[I.AUDIO]:null,[I.VIDEO]:null,[I.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new pe),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=fe.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||``}set url(e){this._url=e}clearElementaryStreamInfo(){let{elementaryStreams:e}=this;e[I.AUDIO]=null,e[I.VIDEO]=null,e[I.AUDIOVIDEO]=null}};function L(e){return e.sn!==`initSegment`}var he=class extends me{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){let e=this.stats.total;if(e)return e}if(this.byteRange.length){let e=this.byteRange[0],t=this.byteRange[1];if(p(e)&&p(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;let{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||=t.identity.getDecryptData(this.sn);else if(!((e=this._decryptdata)!=null&&e.keyId)){let e=Object.keys(t);if(e.length===1){let n=this._decryptdata=t[e[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;let e=p(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;let e=Object.keys(this.levelkeys),n=e.length;if(n>1||n===1&&(t=this.levelkeys[e[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!p(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return L(this)?(this._ref||={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime},this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){let t=this.levelkeys;if(t){var n;let r=t[e];r&&!((n=this._decryptdata)!=null&&n.keyId)&&(this._decryptdata=r.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,r,i,a=!1){let{elementaryStreams:o}=this,s=o[e];if(!s){o[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:a};return}s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,n),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,i)}},ge=class extends me{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint(`DURATION`),this.gap=e.bool(`GAP`),this.independent=e.bool(`INDEPENDENT`),this.relurl=e.enumeratedString(`URI`),this.fragment=t,this.index=r;let a=e.enumeratedString(`BYTERANGE`);a&&this.setByteRange(a,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){let{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}};function _e(e,t){let n=Object.getPrototypeOf(e);if(n)return Object.getOwnPropertyDescriptor(n,t)||_e(n,t)}function ve(e,t){let n=_e(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}const ye=2**32-1,be=[].push,xe={video:1,audio:2,id3:3,text:4};function R(e){return String.fromCharCode.apply(null,e)}function Se(e,t){let n=e[t]<<8|e[t+1];return n<0?65536+n:n}function z(e,t){let n=we(e,t);return n<0?4294967296+n:n}function Ce(e,t){let n=z(e,t);return n*=2**32,n+=z(e,t+4),n}function we(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Te(e){let t=e.byteLength;for(let n=0;n<t;){let r=z(e,n);if(r>8&&e[n+4]===109&&e[n+5]===111&&e[n+6]===111&&e[n+7]===102)return!0;n=r>1?n+r:t}return!1}function B(e,t){let n=[];if(!t.length)return n;let r=e.byteLength;for(let i=0;i<r;){let a=z(e,i),o=R(e.subarray(i+4,i+8)),s=a>1?i+a:r;if(o===t[0]){if(t.length===1)n.push(e.subarray(i+8,s));else{let r=B(e.subarray(i+8,s),t.slice(1));r.length&&be.apply(n,r)}}i=s}return n}function Ee(e){let t=[],n=e[0],r=8,i=z(e,r);r+=4;let a=0,o=0;n===0?(a=z(e,r),o=z(e,r+4),r+=8):(a=Ce(e,r),o=Ce(e,r+8),r+=16),r+=2;let s=e.length+o,c=Se(e,r);r+=2;for(let n=0;n<c;n++){let n=r,a=z(e,n);n+=4;let o=a&2147483647;if((a&2147483648)>>>31==1)return P.warn(`SIDX has hierarchical references (not supported)`),null;let c=z(e,n);n+=4,t.push({referenceSize:o,subsegmentDuration:c,info:{duration:c/i,start:s,end:s+o-1}}),s+=o,n+=4,r=n}return{earliestPresentationTime:a,timescale:i,version:n,referencesCount:c,references:t}}function De(e){let t=[],n=B(e,[`moov`,`trak`]);for(let e=0;e<n.length;e++){let r=n[e],i=B(r,[`tkhd`])[0];if(i){let e=i[0],n=z(i,e===0?12:20),a=B(r,[`mdia`,`mdhd`])[0];if(a){e=a[0];let i=z(a,e===0?12:20),o=B(r,[`mdia`,`hdlr`])[0];if(o){let e=R(o.subarray(8,12)),a={soun:I.AUDIO,vide:I.VIDEO}[e],s=B(r,[`mdia`,`minf`,`stbl`,`stsd`])[0],c=Oe(s);a?(t[n]={timescale:i,type:a,stsd:c},t[a]=E({timescale:i,id:n},c)):t[n]={timescale:i,type:e,stsd:c}}}}}return B(e,[`moov`,`mvex`,`trex`]).forEach(e=>{let n=z(e,4),r=t[n];r&&(r.default={duration:z(e,12),flags:z(e,20)})}),t}function Oe(e){let t=e.subarray(8),n=t.subarray(86),r=R(t.subarray(4,8)),i=r,a,o=r===`enca`||r===`encv`;o&&B(B(t,[r])[0].subarray(r===`enca`?28:78),[`sinf`]).forEach(e=>{let t=B(e,[`schm`])[0];if(t){let n=R(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=B(e,[`frma`])[0];t&&(i=R(t))}}});let s=i;switch(i){case`avc1`:case`avc2`:case`avc3`:case`avc4`:{let e=B(n,[`avcC`])[0];e&&e.length>3&&(i+=`.`+Me(e[1])+Me(e[2])+Me(e[3]),a=ke(s===`avc1`?`dva1`:`dvav`,n));break}case`mp4a`:{let e=B(t,[r])[0],n=B(e.subarray(28),[`esds`])[0];if(n&&n.length>7){let e=4;if(n[e++]!==3)break;e=je(n,e),e+=2;let t=n[e++];if(t&128&&(e+=2),t&64&&(e+=n[e++]),n[e++]!==4)break;e=je(n,e);let r=n[e++];if(r===64)i+=`.`+Me(r);else break;if(e+=12,n[e++]!==5)break;e=je(n,e);let a=n[e++],o=(a&248)>>3;o===31&&(o+=1+((a&7)<<3)+((n[e]&224)>>5)),i+=`.`+o}break}case`hvc1`:case`hev1`:{let e=B(n,[`hvcC`])[0];if(e&&e.length>12){let t=e[1],n=[``,`A`,`B`,`C`][t>>6],r=t&31,a=z(e,2),o=(t&32)>>5?`H`:`L`,s=e[12],c=e.subarray(6,12);i+=`.`+n+r,i+=`.`+Ae(a).toString(16).toUpperCase(),i+=`.`+o+s;let l=``;for(let e=c.length;e--;){let t=c[e];(t||l)&&(l=`.`+t.toString(16).toUpperCase()+l)}i+=l}a=ke(s==`hev1`?`dvhe`:`dvh1`,n);break}case`dvh1`:case`dvhe`:case`dvav`:case`dva1`:case`dav1`:i=ke(i,n)||i;break;case`vp09`:{let e=B(n,[`vpcC`])[0];if(e&&e.length>6){let t=e[4],n=e[5],r=e[6]>>4&15;i+=`.`+Ne(t)+`.`+Ne(n)+`.`+Ne(r)}break}case`av01`:{let e=B(n,[`av1C`])[0];if(e&&e.length>2){let t=e[1]>>>5,r=e[1]&31,o=e[2]>>>7?`H`:`M`,s=(e[2]&64)>>6,c=(e[2]&32)>>5,l=t===2&&s?c?12:10:s?10:8,u=(e[2]&16)>>4,d=(e[2]&8)>>3,f=(e[2]&4)>>2,p=e[2]&3;i+=`.`+t+`.`+Ne(r)+o+`.`+Ne(l)+`.`+u+`.`+d+f+p+`.`+Ne(1)+`.`+Ne(1)+`.`+Ne(1)+`.0`,a=ke(`dav1`,n)}break}}return{codec:i,encrypted:o,supplemental:a}}function ke(e,t){let n=B(t,[`dvvC`]),r=n.length?n[0]:B(t,[`dvcC`])[0];if(r){let t=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return e+`.`+Ne(t)+`.`+Ne(n)}}function Ae(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}function je(e,t){let n=t+5;for(;e[t++]&128&&t<n;);return t}function Me(e){return(`0`+e.toString(16).toUpperCase()).slice(-2)}function Ne(e){return(e<10?`0`:``)+e}function Pe(e,t){if(!e||!t)return;let n=t.keyId;n&&t.isCommonEncryption&&Ie(e,(e,t)=>{let r=e.subarray(8,24);r.some(e=>e!==0)||(P.log(`[eme] Patching keyId in 'enc${t?`a`:`v`}>sinf>>tenc' box: ${F(r)} -> ${F(n)}`),e.set(n,8))})}function Fe(e){let t=[];return Ie(e,e=>t.push(e.subarray(8,24))),t}function Ie(e,t){B(e,[`moov`,`trak`]).forEach(e=>{let n=B(e,[`mdia`,`minf`,`stbl`,`stsd`])[0];if(!n)return;let r=n.subarray(8),i=B(r,[`enca`]),a=i.length>0;a||(i=B(r,[`encv`])),i.forEach(e=>{B(a?e.subarray(28):e.subarray(78),[`sinf`]).forEach(e=>{let n=Le(e);n&&t(n,a)})})})}function Le(e){let t=B(e,[`schm`])[0];if(t){let n=R(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=B(e,[`schi`,`tenc`])[0];if(t)return t}}}function Re(e,t,n){let r={},i=B(e,[`moof`,`traf`]);for(let e=0;e<i.length;e++){let a=i[e],o=B(a,[`tfhd`])[0],s=z(o,4),c=t[s];if(!c)continue;r[s]||(r[s]={start:NaN,duration:0,sampleCount:0,timescale:c.timescale,type:c.type});let l=r[s],u=B(a,[`tfdt`])[0];if(u){let e=u[0],t=z(u,4);e===1&&(t===ye?n.warn(`[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time`):(t*=ye+1,t+=z(u,8))),p(t)&&(!p(l.start)||t<l.start)&&(l.start=t)}let d=c.default,f=z(o,0)|d?.flags,m=d?.duration||0;f&8&&(m=f&2?z(o,12):z(o,8));let h=B(a,[`trun`]),g=l.start||0,_=0,v=m;for(let e=0;e<h.length;e++){let t=h[e],n=z(t,4),r=l.sampleCount;l.sampleCount+=n;let i=t[3]&1,a=t[3]&4,o=t[2]&1,s=t[2]&2,c=t[2]&4,u=t[2]&8,d=8,f=n;for(i&&(d+=4),a&&n&&(!(t[d+1]&1)&&l.keyFrameIndex===void 0&&(l.keyFrameIndex=r),d+=4,o?(v=z(t,d),d+=4):v=m,s&&(d+=4),u&&(d+=4),g+=v,_+=v,f--);f--;)o?(v=z(t,d),d+=4):v=m,s&&(d+=4),c&&(t[d+1]&1||l.keyFrameIndex===void 0&&(l.keyFrameIndex=l.sampleCount-(f+1),l.keyFrameStart=g),d+=4),u&&(d+=4),g+=v,_+=v;!_&&m&&(_+=m*n)}l.duration+=_}if(!Object.keys(r).some(e=>r[e].duration)){let t=1/0,n=0,i=B(e,[`sidx`]);for(let e=0;e<i.length;e++){let r=Ee(i[e]);if(r!=null&&r.references){t=Math.min(t,r.earliestPresentationTime/r.timescale);let e=r.references.reduce((e,t)=>e+t.info.duration||0,0);n=Math.max(n,e+r.earliestPresentationTime/r.timescale)}}n&&p(n)&&Object.keys(r).forEach(e=>{r[e].duration||(r[e].duration=n*r[e].timescale-r[e].start)})}return r}function ze(e){let t={valid:null,remainder:null},n=B(e,[`moof`]);if(n.length<2)return t.remainder=e,t;let r=n[n.length-1];return t.valid=e.slice(0,r.byteOffset-8),t.remainder=e.slice(r.byteOffset-8),t}function Be(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Ve(e,t){let n=[],r=t.samples,i=t.timescale,a=t.id,o=!1;return B(r,[`moof`]).map(s=>{let c=s.byteOffset-8;B(s,[`traf`]).map(s=>{let l=B(s,[`tfdt`]).map(e=>{let t=e[0],n=z(e,4);return t===1&&(n*=2**32,n+=z(e,8)),n/i})[0];return l!==void 0&&(e=l),B(s,[`tfhd`]).map(l=>{let u=z(l,4),d=z(l,0)&16777215,f=!!(d&1),p=!!(d&2),m=!!(d&8),h=0,g=!!(d&16),_=0,v=!!(d&32),y=8;u===a&&(f&&(y+=8),p&&(y+=4),m&&(h=z(l,y),y+=4),g&&(_=z(l,y),y+=4),v&&(y+=4),t.type===`video`&&(o=He(t.codec)),B(s,[`trun`]).map(a=>{let s=a[0],l=z(a,0)&16777215,u=!!(l&1),d=0,f=!!(l&4),p=!!(l&256),m=0,g=!!(l&512),v=0,y=!!(l&1024),b=!!(l&2048),x=0,S=z(a,4),C=8;u&&(d=z(a,C),C+=4),f&&(C+=4);let w=d+c;for(let c=0;c<S;c++){if(p?(m=z(a,C),C+=4):m=h,g?(v=z(a,C),C+=4):v=_,y&&(C+=4),b&&(x=s===0?z(a,C):we(a,C),C+=4),t.type===I.VIDEO){let t=0;for(;t<v;){let a=z(r,w);w+=4,Ue(o,r[w])&&We(r.subarray(w,w+a),o?2:1,e+x/i,n),w+=a,t+=a+4}}e+=m/i}}))})})}),n}function He(e){if(!e)return!1;let t=e.substring(0,4);return t===`hvc1`||t===`hev1`||t===`dvh1`||t===`dvhe`}function Ue(e,t){if(e){let e=t>>1&63;return e===39||e===40}return(t&31)==6}function We(e,t,n,r){let i=Ge(e),a=0;a+=t;let o=0,s=0,c=0;for(;a<i.length;){o=0;do{if(a>=i.length)break;c=i[a++],o+=c}while(c===255);s=0;do{if(a>=i.length)break;c=i[a++],s+=c}while(c===255);let e=i.length-a,t=a;if(s<e)a+=s;else if(s>e){P.error(`Malformed SEI payload. ${s} is too small, only ${e} bytes left to parse.`);break}if(o===4){if(i[t++]===181){let e=Se(i,t);if(t+=2,e===49){let e=z(i,t);if(t+=4,e===1195456820){let e=i[t++];if(e===3){let a=i[t++],s=31&a,c=64&a,l=c?2+s*3:0,u=new Uint8Array(l);if(c){u[0]=a;for(let e=1;e<l;e++)u[e]=i[t++]}r.push({type:e,payloadType:o,pts:n,bytes:u})}}}}}else if(o===5&&s>16){let e=[];for(let n=0;n<16;n++){let r=i[t++].toString(16);e.push(r.length==1?`0`+r:r),(n===3||n===5||n===7||n===9)&&e.push(`-`)}let a=s-16,c=new Uint8Array(a);for(let e=0;e<a;e++)c[e]=i[t++];r.push({payloadType:o,pts:n,uuid:e.join(``),userData:oe(c),userDataBytes:c})}}}function Ge(e){let t=e.byteLength,n=[],r=1;for(;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;let i=t-n.length,a=new Uint8Array(i),o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=e[o];return a}function Ke(e){let t=e[0],n=``,r=``,i=0,a=0,o=0,s=0,c=0,l=0;if(t===0){for(;R(e.subarray(l,l+1))!==`\0`;)n+=R(e.subarray(l,l+1)),l+=1;for(n+=R(e.subarray(l,l+1)),l+=1;R(e.subarray(l,l+1))!==`\0`;)r+=R(e.subarray(l,l+1)),l+=1;r+=R(e.subarray(l,l+1)),l+=1,i=z(e,12),a=z(e,16),s=z(e,20),c=z(e,24),l=28}else if(t===1){l+=4,i=z(e,l),l+=4;let t=z(e,l);l+=4;let a=z(e,l);for(l+=4,o=2**32*t+a,m(o)||(o=2**53-1,P.warn(`Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box`)),s=z(e,l),l+=4,c=z(e,l),l+=4;R(e.subarray(l,l+1))!==`\0`;)n+=R(e.subarray(l,l+1)),l+=1;for(n+=R(e.subarray(l,l+1)),l+=1;R(e.subarray(l,l+1))!==`\0`;)r+=R(e.subarray(l,l+1)),l+=1;r+=R(e.subarray(l,l+1)),l+=1}let u=e.subarray(l,e.byteLength);return{schemeIdUri:n,value:r,timeScale:i,presentationTime:o,presentationTimeDelta:a,eventDuration:s,id:c,payload:u}}function qe(e,...t){let n=t.length,r=8,i=n;for(;i--;)r+=t[i].byteLength;let a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(e,4),i=0,r=8;i<n;i++)a.set(t[i],r),r+=t[i].byteLength;return a}function Je(e,t,n){if(e.byteLength!==16)throw RangeError(`Invalid system id`);let r,i;r=0,i=/* @__PURE__ */ new Uint8Array;let a;r>0?(a=/* @__PURE__ */ new Uint8Array(4),t.length>0&&new DataView(a.buffer).setUint32(0,t.length,!1)):a=/* @__PURE__ */ new Uint8Array;let o=/* @__PURE__ */ new Uint8Array(4);return n.byteLength>0&&new DataView(o.buffer).setUint32(0,n.byteLength,!1),qe([112,115,115,104],new Uint8Array([r,0,0,0]),e,a,i,o,n)}function Ye(e){let t=[];if(e instanceof ArrayBuffer){let n=e.byteLength,r=0;for(;r+32<n;){let n=Xe(new DataView(e,r));t.push(n),r+=n.size}}return t}function Xe(e){let t=e.getUint32(0),n=e.byteOffset,r=e.byteLength;if(r<t)return{offset:n,size:r};if(e.getUint32(4)!==1886614376)return{offset:n,size:t};let i=e.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:n,size:t};let a=e.buffer,o=F(new Uint8Array(a,n+12,16)),s=null,c=null,l=0;if(i===0)l=28;else{let i=e.getUint32(28);if(!i||r<32+i*16)return{offset:n,size:t};s=[];for(let e=0;e<i;e++)s.push(new Uint8Array(a,n+32+e*16,16));l=32+i*16}if(!l)return{offset:n,size:t};let u=e.getUint32(l);return t-32<u?{offset:n,size:t}:(c=new Uint8Array(a,n+l+4,u),{version:i,systemId:o,kids:s,data:c,offset:n,size:t})}const Ze=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Qe={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function $e(e,t){let n=Qe[t];return!!n&&!!n[e.slice(0,4)]}function et(e,t,n=!0){return!e.split(`,`).some(e=>!tt(e,t,n))}function tt(e,t,n=!0){return re(n)?.isTypeSupported(nt(e,t))??!1}function nt(e,t){return`${t}/mp4;codecs=${e}`}function rt(e){if(e){let t=e.substring(0,4);return Qe.video[t]}return 2}function it(e){let t=Ze();return e.split(`,`).reduce((e,n)=>{let r=t&&He(n)?9:Qe.video[n];return r?(r*2+e)/(e?3:2):(Qe.audio[n]+e)/(e?2:1)},0)}const at={};function ot(e,t=!0){if(at[e])return at[e];let n={flac:[`flac`,`fLaC`,`FLAC`],opus:[`opus`,`Opus`],"mp4a.40.34":[`mp3`]}[e];for(let i=0;i<n.length;i++){var r;if(tt(n[i],`audio`,t))return at[e]=n[i],n[i];if(n[i]===`mp3`&&(r=re(t))!=null&&r.isTypeSupported(`audio/mpeg`))return``}return e}const st=/flac|opus|mp4a\.40\.34/i;function ct(e,t=!0){return e.replace(st,e=>ot(e.toLowerCase(),t))}function lt(e,t){let n=[];if(e){let t=e.split(`,`);for(let e=0;e<t.length;e++)$e(t[e],`video`)||n.push(t[e])}return t&&n.push(t),n.join(`,`)}function ut(e,t){if(e&&(e.length>4||[`ac-3`,`ec-3`,`alac`,`fLaC`,`Opus`].indexOf(e)!==-1)&&(dt(e,`audio`)||dt(e,`video`)))return e;if(t){let n=t.split(`,`);if(n.length>1){if(e){for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t]}return n[0]}}return t||e}function dt(e,t){return $e(e,t)&&tt(e,t)}function ft(e){let t=e.split(`,`);for(let e=0;e<t.length;e++){let n=t[e].split(`.`);n.length>2&&n[0]===`avc1`&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${(`000`+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(`,`)}function pt(e){if(e.startsWith(`av01.`)){let t=e.split(`.`),n=[`0`,`111`,`01`,`01`,`01`,`0`];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(`.`)}return e}function mt(e){let t=re(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported(`audio/mpeg`),mp3:t.isTypeSupported(`audio/mp4; codecs="mp3"`),ac3:t.isTypeSupported(`audio/mp4; codecs="ac-3"`)}}function ht(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,`$1`)}const gt={supported:!0,powerEfficient:!0,smooth:!0},_t={supported:!1,smooth:!1,powerEfficient:!1},vt={supported:!0,configurations:[],decodingInfoResults:[gt]};function yt(e,t){return{supported:!1,configurations:t,decodingInfoResults:[_t],error:e}}function bt(e,t,n,r,i,a){let o=e.videoCodec,s=e.audioCodec?e.audioGroups:null,c=a?.audioCodec,l=a?.channels,u=l?parseInt(l):c?1/0:2,d=null;if(s!=null&&s.length)try{d=s.length===1&&s[0]?t.groups[s[0]].channels:s.reduce((e,n)=>{if(n){let r=t.groups[n];if(!r)throw Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach(t=>{e[t]=(e[t]||0)+r.channels[t]})}return e},{2:0})}catch{return!0}return o!==void 0&&(o.split(`,`).some(e=>He(e))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||e.videoRange!==`SDR`&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!d&&p(u)&&Object.keys(d).some(e=>parseInt(e)>u)}function xt(e,t,n,r={}){let i=e.videoCodec;if(!i&&!e.audioCodec||!n)return Promise.resolve(vt);let a=[],o=St(e),s=o.length,c=Ct(e,t,s>0),l=c.length;for(let e=s||1*l||1;e--;){let t={type:`media-source`};if(s&&(t.video=o[e%s]),l){t.audio=c[e%l];let n=t.audio.bitrate;t.video&&n&&(t.video.bitrate-=n)}a.push(t)}if(i){let e=navigator.userAgent;if(i.split(`,`).some(e=>He(e))&&Ze())return Promise.resolve(yt(/* @__PURE__ */ Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),a))}return Promise.all(a.map(e=>{let t=Et(e);return r[t]||(r[t]=n.decodingInfo(e))})).then(e=>({supported:!e.some(e=>!e.supported),configurations:a,decodingInfoResults:e})).catch(e=>({supported:!1,configurations:a,decodingInfoResults:[],error:e}))}function St(e){let t=e.videoCodec?.split(`,`),n=Tt(e),r=e.width||640,i=e.height||480,a=e.frameRate||30,o=e.videoRange.toLowerCase();return t?t.map(e=>{let t={contentType:nt(pt(e),`video`),width:r,height:i,bitrate:n,framerate:a};return o!==`sdr`&&(t.transferFunction=o),t}):[]}function Ct(e,t,n){let r=e.audioCodec?.split(`,`),i=Tt(e);return r&&e.audioGroups?e.audioGroups.reduce((e,a)=>{let o=a?t.groups[a]?.tracks:null;return o?o.reduce((e,t)=>{if(t.groupId===a){let a=parseFloat(t.channels||``);r.forEach(t=>{let r={contentType:nt(t,`audio`),bitrate:n?wt(t,i):i};a&&(r.channels=``+a),e.push(r)})}return e},e):e},[]):[]}function wt(e,t){if(t<=1)return 1;let n=128e3;return e===`ec-3`?n=768e3:e===`ac-3`&&(n=64e4),Math.min(t/2,n)}function Tt(e){return Math.ceil(Math.max(e.bitrate*.9,e.averageBitrate)/1e3)*1e3||1}function Et(e){let t=``,{audio:n,video:r}=e;if(r){let e=ht(r.contentType);t+=`${e}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||`sd`}_${Math.ceil(r.bitrate/1e5)}`}if(n){let e=ht(n.contentType);t+=`${r?`_`:``}${e}_c${n.channels}`}return t}const Dt=[`NONE`,`TYPE-0`,`TYPE-1`,null];function Ot(e){return Dt.indexOf(e)>-1}const kt=[`SDR`,`PQ`,`HLG`];function At(e){return!!e&&kt.indexOf(e)>-1}var jt={No:``,Yes:`YES`,v2:`v2`};function Mt(e){let{canSkipUntil:t,canSkipDateRanges:n,age:r}=e,i=r<t/2;return t&&i?n?jt.v2:jt.Yes:jt.No}var Nt=class{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){let t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set(`_HLS_msn`,this.msn.toString()),this.part!==void 0&&t.searchParams.set(`_HLS_part`,this.part.toString()),this.skip&&t.searchParams.set(`_HLS_skip`,this.skip),t.href}},Pt=class{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat(`FRAME-RATE`,0),this._avgBitrate=e.attrs.decimalInteger(`AVERAGE-BANDWIDTH`),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(e=>!!e).map(e=>e.substring(0,4)).join(`,`),`supplemental`in e){this.supplemental=e.supplemental;let t=e.supplemental?.videoCodec;t&&t!==e.videoCodec&&(this.codecSet+=`,${t.substring(0,4)}`)}this.addGroupId(`audio`,e.attrs.AUDIO),this.addGroupId(`text`,e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||``}get pathwayId(){return this.attrs[`PATHWAY-ID`]||`.`}get videoRange(){return this.attrs[`VIDEO-RANGE`]||`SDR`}get score(){return this.attrs.optionalFloat(`SCORE`,0)}get uri(){return this.url[0]||``}hasAudioGroup(e){return Ft(this._audioGroups,e)}hasSubtitleGroup(e){return Ft(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e===`audio`){let e=this._audioGroups;e||=this._audioGroups=[],e.indexOf(t)===-1&&e.push(t)}else if(e===`text`){let e=this._subtitleGroups;e||=this._subtitleGroups=[],e.indexOf(t)===-1&&e.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){return this.audioGroups?.[0]}get textGroupId(){return this.subtitleGroups?.[0]}addFallback(){}};function Ft(e,t){return!t||!e?!1:e.indexOf(t)!==-1}function It(){if(typeof matchMedia==`function`){let e=matchMedia(`(dynamic-range: high)`),t=matchMedia(`bad query`);if(e.media!==t.media)return e.matches===!0}return!1}function Lt(e,t){let n=!1,r=[];if(e&&(n=e!==`SDR`,r=[e]),t){r=t.allowedVideoRanges||kt.slice(0);let e=r.join(``)!==`SDR`&&!t.videoCodec;n=t.preferHDR===void 0?e&&It():t.preferHDR,n||(r=[`SDR`])}return{preferHDR:n,allowedVideoRanges:r}}const Rt=e=>{let t=/* @__PURE__ */ new WeakSet;return(n,r)=>{if(e&&(r=e(n,r)),typeof r==`object`&&r){if(t.has(r))return;t.add(r)}return r}},V=(e,t)=>JSON.stringify(e,Rt(t));function zt(e,t,n,r,i){let a=Object.keys(e),o=r?.channels,s=r?.audioCodec,c=i?.videoCodec,l=o&&parseInt(o)===2,u=!1,d=!1,f=1/0,m=1/0,h=1/0,g=1/0,_=0,v=[],{preferHDR:y,allowedVideoRanges:b}=Lt(t,i);for(let t=a.length;t--;){let n=e[a[t]];u||=n.channels[2]>0,f=Math.min(f,n.minHeight),m=Math.min(m,n.minFramerate),h=Math.min(h,n.minBitrate),b.filter(e=>n.videoRanges[e]>0).length>0&&(d=!0)}f=p(f)?f:0,m=p(m)?m:0;let x=Math.max(1080,f),S=Math.max(30,m);h=p(h)?h:n,n=Math.max(h,n),d||(t=void 0);let C=a.length>1;return{codecSet:a.reduce((t,r)=>{let i=e[r];if(r===t)return t;if(v=d?b.filter(e=>i.videoRanges[e]>0):[],C){if(i.minBitrate>n)return Bt(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),t;if(!i.hasDefaultAudio)return Bt(r,`no renditions with default or auto-select sound found`),t;if(s&&r.indexOf(s.substring(0,4))%5!=0)return Bt(r,`audio codec preference "${s}" not found`),t;if(o&&!l){if(!i.channels[o])return Bt(r,`no renditions with ${o} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!s||l)&&u&&i.channels[2]===0)return Bt(r,`no renditions with stereo sound found`),t;if(i.minHeight>x)return Bt(r,`min resolution of ${i.minHeight} > maximum of ${x}`),t;if(i.minFramerate>S)return Bt(r,`min framerate of ${i.minFramerate} > maximum of ${S}`),t;if(!v.some(e=>i.videoRanges[e]>0))return Bt(r,`no variants with VIDEO-RANGE of ${V(v)} found`),t;if(c&&r.indexOf(c.substring(0,4))%5!=0)return Bt(r,`video codec preference "${c}" not found`),t;if(i.maxScore<_)return Bt(r,`max score of ${i.maxScore} < selected max of ${_}`),t}return t&&(it(r)>=it(t)||i.fragmentError>e[t].fragmentError)?t:(g=i.minIndex,_=i.maxScore,r)},void 0),videoRanges:v,preferHDR:y,minFramerate:m,minBitrate:h,minIndex:g}}function Bt(e,t){P.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function Vt(e){return e.reduce((e,t)=>{let n=e.groups[t.groupId];n||=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1},n.tracks.push(t);let r=t.channels||`2`;return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Ht(e,t,n,r){return e.slice(n,r+1).reduce((e,n,r)=>{if(!n.codecSet)return e;let i=n.audioGroups,a=e[n.codecSet];a||(e[n.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!i,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,n.bitrate);let o=Math.min(n.height,n.width);return a.minHeight=Math.min(a.minHeight,o),a.minFramerate=Math.min(a.minFramerate,n.frameRate),a.minIndex=Math.min(a.minIndex,r),a.maxScore=Math.max(a.maxScore,n.score),a.fragmentError+=n.fragmentError,a.videoRanges[n.videoRange]=(a.videoRanges[n.videoRange]||0)+1,i&&i.forEach(e=>{if(!e)return;let n=t.groups[e];n&&(a.hasDefaultAudio=a.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach(e=>{a.channels[e]=(a.channels[e]||0)+n.channels[e]}))}),e},{})}function Ut(e){if(!e)return e;let{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:a}=e;return{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:a}}function Wt(e,t,n){if(`attrs`in e){let n=t.indexOf(e);if(n!==-1)return n}for(let r=0;r<t.length;r++){let i=t[r];if(Gt(e,i,n))return r}return-1}function Gt(e,t,n){let{groupId:r,name:i,lang:a,assocLang:o,default:s}=e,c=e.forced;return(r===void 0||t.groupId===r)&&(i===void 0||t.name===i)&&(a===void 0||Kt(a,t.lang))&&(a===void 0||t.assocLang===o)&&(s===void 0||t.default===s)&&(c===void 0||t.forced===c)&&(!(`characteristics`in e)||qt(e.characteristics||``,t.characteristics))&&(n===void 0||n(e,t))}function Kt(e,t=`--`){return e.length===t.length?e===t:e.startsWith(t)||t.startsWith(e)}function qt(e,t=``){let n=e.split(`,`),r=t.split(`,`);return n.length===r.length&&!n.some(e=>r.indexOf(e)===-1)}function Jt(e,t){let{audioCodec:n,channels:r}=e;return(n===void 0||(t.audioCodec||``).substring(0,4)===n.substring(0,4))&&(r===void 0||r===(t.channels||`2`))}function Yt(e,t,n,r,i){let a=t[r],o=t.reduce((e,t,n)=>{let r=t.uri;return(e[r]||(e[r]=[])).push(n),e},{})[a.uri];o.length>1&&(r=Math.max.apply(Math,o));let s=a.videoRange,c=a.frameRate,l=a.codecSet.substring(0,4),u=Xt(t,r,t=>{if(t.videoRange!==s||t.frameRate!==c||t.codecSet.substring(0,4)!==l)return!1;let r=t.audioGroups;return Wt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1});return u>-1?u:Xt(t,r,t=>{let r=t.audioGroups;return Wt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1})}function Xt(e,t,n){for(let r=t;r>-1;r--)if(n(e[r]))return r;for(let r=t+1;r<e.length;r++)if(n(e[r]))return r;return-1}function Zt(e,t){return!!e&&e!==t.loadLevelObj?.uri}var Qt=class extends k{constructor(e){super(`abr`,e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey=``,this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{let{fragCurrent:t,partCurrent:n,hls:r}=this,{autoLevelEnabled:i,media:a}=r;if(!t||!a)return;let o=performance.now(),s=n?n.stats:t.stats,c=n?n.duration:t.duration,l=o-s.loading.start,u=r.minAutoLevel,d=t.level,f=this._nextAutoLevel;if(s.aborted||s.loaded&&s.loaded===s.total||d<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i)return;let m=f>-1&&f!==d,h=!!e||m;if(!h&&(a.paused||!a.playbackRate||!a.readyState))return;let g=r.mainForwardBufferInfo;if(!h&&g===null)return;let _=this.bwEstimator.getEstimateTTFB(),y=Math.abs(a.playbackRate);if(l<=Math.max(_,1e3*(c/(y*2))))return;let b=g?g.len/y:0,x=s.loading.first?s.loading.first-s.loading.start:-1,S=s.loaded&&x>-1,C=this.getBwEstimate(),w=r.levels,T=w[d],E=Math.max(s.loaded,Math.round(c*(t.bitrate||T.averageBitrate)/8)),D=S?l-x:l;D<1&&S&&(D=Math.min(l,s.loaded*8/C));let O=S?s.loaded*1e3/D:0,k=_/1e3,A=O?(E-s.loaded)/O:E*8/C+k;if(A<=b)return;let j=O?O*8:C,M=(e?.details||this.hls.latestLevelDetails)?.live===!0,ee=this.hls.config.abrBandWidthUpFactor,te=1/0,N;for(N=d-1;N>u;N--){let e=w[N].maxBitrate,t=!w[N].details||M;if(te=this.getTimeToLoadFrag(k,j,c*e,t),te<Math.min(b,c+k))break}if(te>=A||te>c*10)return;S?this.bwEstimator.sample(l-Math.min(_,x),s.loaded):this.bwEstimator.sampleTTFB(l);let ne=w[N].maxBitrate;this.getBwEstimate()*ee>ne&&this.resetEstimator(ne);let P=this.findBestLevel(ne,u,N,0,b,1,1);P>-1&&(N=P),this.warn(`Fragment ${t.sn}${n?` part `+n.index:``} of level ${d} is loading too slowly;
+import{d as e}from"./predicate-DSCS8XT4.js";import{t}from"./deep-equal-BgDgiSiY.js";import{t as n}from"./listen-4VrUltMW.js";import{r}from"./text-track-aC_8Gh6M.js";import{t as i}from"./webkit-DljEkldb.js";import{t as a}from"./adapter-CU0vk5zH.js";import{t as o}from"./media-error-CtsbOTR1.js";import{n as s}from"./types-HOYOipK7.js";import{t as c}from"./html-video-adapter-BGKgkryA.js";import{t as l}from"./mixin-BUx02nig.js";import{n as u,t as d}from"./load-chapters-tracks-Btgfpe8i.js";function f(e,t){e.dispatchEvent&&=e=>t.dispatchEvent(new e.constructor(e.type,e))}const p=Number.isFinite||function(e){return typeof e==`number`&&isFinite(e)},m=Number.isSafeInteger||function(e){return typeof e==`number`&&Math.abs(e)<=h},h=2**53-1||9007199254740991;let g=/*#__PURE__*/ function(e){return e.NETWORK_ERROR=`networkError`,e.MEDIA_ERROR=`mediaError`,e.KEY_SYSTEM_ERROR=`keySystemError`,e.MUX_ERROR=`muxError`,e.OTHER_ERROR=`otherError`,e}({}),_=/*#__PURE__*/ function(e){return e.KEY_SYSTEM_NO_KEYS=`keySystemNoKeys`,e.KEY_SYSTEM_NO_ACCESS=`keySystemNoAccess`,e.KEY_SYSTEM_NO_SESSION=`keySystemNoSession`,e.KEY_SYSTEM_NO_CONFIGURED_LICENSE=`keySystemNoConfiguredLicense`,e.KEY_SYSTEM_LICENSE_REQUEST_FAILED=`keySystemLicenseRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED=`keySystemServerCertificateRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED=`keySystemServerCertificateUpdateFailed`,e.KEY_SYSTEM_SESSION_UPDATE_FAILED=`keySystemSessionUpdateFailed`,e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED=`keySystemStatusOutputRestricted`,e.KEY_SYSTEM_STATUS_INTERNAL_ERROR=`keySystemStatusInternalError`,e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR=`keySystemDestroyMediaKeysError`,e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR=`keySystemDestroyCloseSessionError`,e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR=`keySystemDestroyRemoveSessionError`,e.MANIFEST_LOAD_ERROR=`manifestLoadError`,e.MANIFEST_LOAD_TIMEOUT=`manifestLoadTimeOut`,e.MANIFEST_PARSING_ERROR=`manifestParsingError`,e.MANIFEST_INCOMPATIBLE_CODECS_ERROR=`manifestIncompatibleCodecsError`,e.LEVEL_EMPTY_ERROR=`levelEmptyError`,e.LEVEL_LOAD_ERROR=`levelLoadError`,e.LEVEL_LOAD_TIMEOUT=`levelLoadTimeOut`,e.LEVEL_PARSING_ERROR=`levelParsingError`,e.LEVEL_SWITCH_ERROR=`levelSwitchError`,e.AUDIO_TRACK_LOAD_ERROR=`audioTrackLoadError`,e.AUDIO_TRACK_LOAD_TIMEOUT=`audioTrackLoadTimeOut`,e.SUBTITLE_LOAD_ERROR=`subtitleTrackLoadError`,e.SUBTITLE_TRACK_LOAD_TIMEOUT=`subtitleTrackLoadTimeOut`,e.FRAG_LOAD_ERROR=`fragLoadError`,e.FRAG_LOAD_TIMEOUT=`fragLoadTimeOut`,e.FRAG_DECRYPT_ERROR=`fragDecryptError`,e.FRAG_PARSING_ERROR=`fragParsingError`,e.FRAG_GAP=`fragGap`,e.REMUX_ALLOC_ERROR=`remuxAllocError`,e.KEY_LOAD_ERROR=`keyLoadError`,e.KEY_LOAD_TIMEOUT=`keyLoadTimeOut`,e.BUFFER_ADD_CODEC_ERROR=`bufferAddCodecError`,e.BUFFER_INCOMPATIBLE_CODECS_ERROR=`bufferIncompatibleCodecsError`,e.BUFFER_APPEND_ERROR=`bufferAppendError`,e.BUFFER_APPENDING_ERROR=`bufferAppendingError`,e.BUFFER_STALLED_ERROR=`bufferStalledError`,e.BUFFER_FULL_ERROR=`bufferFullError`,e.BUFFER_SEEK_OVER_HOLE=`bufferSeekOverHole`,e.BUFFER_NUDGE_ON_STALL=`bufferNudgeOnStall`,e.ASSET_LIST_LOAD_ERROR=`assetListLoadError`,e.ASSET_LIST_LOAD_TIMEOUT=`assetListLoadTimeout`,e.ASSET_LIST_PARSING_ERROR=`assetListParsingError`,e.INTERSTITIAL_ASSET_ITEM_ERROR=`interstitialAssetItemError`,e.INTERNAL_EXCEPTION=`internalException`,e.INTERNAL_ABORTED=`aborted`,e.ATTACH_MEDIA_ERROR=`attachMediaError`,e.UNKNOWN=`unknown`,e}({}),v=/*#__PURE__*/ function(e){return e.MEDIA_ATTACHING=`hlsMediaAttaching`,e.MEDIA_ATTACHED=`hlsMediaAttached`,e.MEDIA_DETACHING=`hlsMediaDetaching`,e.MEDIA_DETACHED=`hlsMediaDetached`,e.MEDIA_ENDED=`hlsMediaEnded`,e.STALL_RESOLVED=`hlsStallResolved`,e.BUFFER_RESET=`hlsBufferReset`,e.BUFFER_CODECS=`hlsBufferCodecs`,e.BUFFER_CREATED=`hlsBufferCreated`,e.BUFFER_APPENDING=`hlsBufferAppending`,e.BUFFER_APPENDED=`hlsBufferAppended`,e.BUFFER_EOS=`hlsBufferEos`,e.BUFFERED_TO_END=`hlsBufferedToEnd`,e.BUFFER_FLUSHING=`hlsBufferFlushing`,e.BUFFER_FLUSHED=`hlsBufferFlushed`,e.MANIFEST_LOADING=`hlsManifestLoading`,e.MANIFEST_LOADED=`hlsManifestLoaded`,e.MANIFEST_PARSED=`hlsManifestParsed`,e.LEVEL_SWITCHING=`hlsLevelSwitching`,e.LEVEL_SWITCHED=`hlsLevelSwitched`,e.LEVEL_LOADING=`hlsLevelLoading`,e.LEVEL_LOADED=`hlsLevelLoaded`,e.LEVEL_UPDATED=`hlsLevelUpdated`,e.LEVEL_PTS_UPDATED=`hlsLevelPtsUpdated`,e.LEVELS_UPDATED=`hlsLevelsUpdated`,e.AUDIO_TRACKS_UPDATED=`hlsAudioTracksUpdated`,e.AUDIO_TRACK_SWITCHING=`hlsAudioTrackSwitching`,e.AUDIO_TRACK_SWITCHED=`hlsAudioTrackSwitched`,e.AUDIO_TRACK_LOADING=`hlsAudioTrackLoading`,e.AUDIO_TRACK_LOADED=`hlsAudioTrackLoaded`,e.AUDIO_TRACK_UPDATED=`hlsAudioTrackUpdated`,e.SUBTITLE_TRACKS_UPDATED=`hlsSubtitleTracksUpdated`,e.SUBTITLE_TRACKS_CLEARED=`hlsSubtitleTracksCleared`,e.SUBTITLE_TRACK_SWITCH=`hlsSubtitleTrackSwitch`,e.SUBTITLE_TRACK_LOADING=`hlsSubtitleTrackLoading`,e.SUBTITLE_TRACK_LOADED=`hlsSubtitleTrackLoaded`,e.SUBTITLE_TRACK_UPDATED=`hlsSubtitleTrackUpdated`,e.SUBTITLE_FRAG_PROCESSED=`hlsSubtitleFragProcessed`,e.CUES_PARSED=`hlsCuesParsed`,e.NON_NATIVE_TEXT_TRACKS_FOUND=`hlsNonNativeTextTracksFound`,e.INIT_PTS_FOUND=`hlsInitPtsFound`,e.FRAG_LOADING=`hlsFragLoading`,e.FRAG_LOAD_EMERGENCY_ABORTED=`hlsFragLoadEmergencyAborted`,e.FRAG_LOADED=`hlsFragLoaded`,e.FRAG_DECRYPTED=`hlsFragDecrypted`,e.FRAG_PARSING_INIT_SEGMENT=`hlsFragParsingInitSegment`,e.FRAG_PARSING_USERDATA=`hlsFragParsingUserdata`,e.FRAG_PARSING_METADATA=`hlsFragParsingMetadata`,e.FRAG_PARSED=`hlsFragParsed`,e.FRAG_BUFFERED=`hlsFragBuffered`,e.FRAG_CHANGED=`hlsFragChanged`,e.FPS_DROP=`hlsFpsDrop`,e.FPS_DROP_LEVEL_CAPPING=`hlsFpsDropLevelCapping`,e.MAX_AUTO_LEVEL_UPDATED=`hlsMaxAutoLevelUpdated`,e.ERROR=`hlsError`,e.DESTROYING=`hlsDestroying`,e.KEY_LOADING=`hlsKeyLoading`,e.KEY_LOADED=`hlsKeyLoaded`,e.LIVE_BACK_BUFFER_REACHED=`hlsLiveBackBufferReached`,e.BACK_BUFFER_REACHED=`hlsBackBufferReached`,e.STEERING_MANIFEST_LOADED=`hlsSteeringManifestLoaded`,e.ASSET_LIST_LOADING=`hlsAssetListLoading`,e.ASSET_LIST_LOADED=`hlsAssetListLoaded`,e.INTERSTITIALS_UPDATED=`hlsInterstitialsUpdated`,e.INTERSTITIALS_BUFFERED_TO_BOUNDARY=`hlsInterstitialsBufferedToBoundary`,e.INTERSTITIAL_ASSET_PLAYER_CREATED=`hlsInterstitialAssetPlayerCreated`,e.INTERSTITIAL_STARTED=`hlsInterstitialStarted`,e.INTERSTITIAL_ASSET_STARTED=`hlsInterstitialAssetStarted`,e.INTERSTITIAL_ASSET_ENDED=`hlsInterstitialAssetEnded`,e.INTERSTITIAL_ASSET_ERROR=`hlsInterstitialAssetError`,e.INTERSTITIAL_ENDED=`hlsInterstitialEnded`,e.INTERSTITIALS_PRIMARY_RESUMED=`hlsInterstitialsPrimaryResumed`,e.PLAYOUT_LIMIT_REACHED=`hlsPlayoutLimitReached`,e.EVENT_CUE_ENTER=`hlsEventCueEnter`,e}({});var y={MANIFEST:`manifest`,LEVEL:`level`,AUDIO_TRACK:`audioTrack`,SUBTITLE_TRACK:`subtitleTrack`},b={MAIN:`main`,AUDIO:`audio`,SUBTITLE:`subtitle`},x=class{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){let n=this.alpha_**+e;this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){let e=1-this.alpha_**+this.totalWeight_;if(e)return this.estimate_/e}return this.estimate_}},S=class{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new x(e),this.fast_=new x(t),this.defaultTTFB_=r,this.ttfb_=new x(e)}update(e,t){let{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new x(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new x(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new x(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);let n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){let t=e/1e3,n=Math.sqrt(2)*Math.exp(-(t**2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}};function C(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(null,arguments)}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function O(e){var t=D(e,`string`);return typeof t==`symbol`?t:t+``}var k=class{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;let n=`[${e}]:`;this.trace=A,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}};const A=function(){},j={trace:A,debug:A,log:A,warn:A,info:A,error:A};function M(){return w({},j)}function ee(e,t){let n=self.console[e];return n?n.bind(self.console,`${t?`[`+t+`] `:``}[${e}] >`):A}function te(e,t,n){return t[e]?t[e].bind(t):ee(e,n)}const N=M();function ne(e,t,n){let r=M();if(typeof console==`object`&&e===!0||typeof e==`object`){let i=[`debug`,`log`,`info`,`warn`,`error`];i.forEach(t=>{r[t]=te(t,e,n)});try{r.log(`Debug logs enabled for "${t}" in hls.js version 1.6.19`)}catch{return M()}i.forEach(t=>{N[t]=te(t,e)})}else w(N,r);return r}const P=N;function re(e=!0){if(typeof self<`u`)return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ie(e){return typeof self<`u`&&e===self.ManagedMediaSource}function ae(e,t){let n=Object.keys(e),r=Object.keys(t),i=n.length,a=r.length;return!i||!a||i===a&&!n.some(e=>r.indexOf(e)===-1)}function oe(e,t=!1){if(typeof TextDecoder<`u`){let n=new TextDecoder(`utf-8`).decode(e);if(t){let e=n.indexOf(`\0`);return e===-1?n:n.substring(0,e)}return n.replace(/\0/g,``)}let n=e.length,r,i,a,o=``,s=0;for(;s<n;){if(r=e[s++],r===0&&t)return o;if(r!==0&&r!==3)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:i=e[s++],o+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=e[s++],a=e[s++],o+=String.fromCharCode((r&15)<<12|(i&63)<<6|(a&63)<<0)}}return o}function F(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length<2&&(r=`0`+r),t+=r}return t}function se(e){return Uint8Array.from(e.replace(/^0x/,``).replace(/([\da-fA-F]{2}) ?/g,`0x$1 `).replace(/ +$/,``).split(` `)).buffer}function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var le={exports:{}},ue;function de(){return ue?le.exports:(ue=1,(function(e,t){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw Error(`Error trying to parse base URL.`);return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw Error(`Error trying to parse relative URL.`);if(a.scheme)return n.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var s=o.parseURL(e);if(!s)throw Error(`Error trying to parse base URL.`);if(!s.netLoc&&s.path&&s.path[0]!==`/`){var c=r.exec(s.path);s.netLoc=c[1],s.path=c[2]}s.netLoc&&!s.path&&(s.path=`/`);var l={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=s.netLoc,a.path[0]!==`/`)){if(!a.path)l.path=s.path,a.params||(l.params=s.params,a.query||(l.query=s.query));else{var u=s.path,d=u.substring(0,u.lastIndexOf(`/`)+1)+a.path;l.path=o.normalizePath(d)}}return l.path===null&&(l.path=n.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(i,``);e.length!==(e=e.replace(a,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=o})()})(le),le.exports)}var fe=de(),pe=class{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},I={AUDIO:`audio`,VIDEO:`video`,AUDIOVIDEO:`audiovideo`},me=class{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e==`string`&&(e={url:e}),this.base=e,ve(this,`stats`)}setByteRange(e,t){let n=e.split(`@`,2),r;r=n.length===1?t?.byteRangeEndOffset||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[I.AUDIO]:null,[I.VIDEO]:null,[I.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new pe),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=fe.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||``}set url(e){this._url=e}clearElementaryStreamInfo(){let{elementaryStreams:e}=this;e[I.AUDIO]=null,e[I.VIDEO]=null,e[I.AUDIOVIDEO]=null}};function L(e){return e.sn!==`initSegment`}var he=class extends me{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){let e=this.stats.total;if(e)return e}if(this.byteRange.length){let e=this.byteRange[0],t=this.byteRange[1];if(p(e)&&p(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;let{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||=t.identity.getDecryptData(this.sn);else if(!((e=this._decryptdata)!=null&&e.keyId)){let e=Object.keys(t);if(e.length===1){let n=this._decryptdata=t[e[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;let e=p(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;let e=Object.keys(this.levelkeys),n=e.length;if(n>1||n===1&&(t=this.levelkeys[e[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!p(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return L(this)?(this._ref||={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime},this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){let t=this.levelkeys;if(t){var n;let r=t[e];r&&!((n=this._decryptdata)!=null&&n.keyId)&&(this._decryptdata=r.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,r,i,a=!1){let{elementaryStreams:o}=this,s=o[e];if(!s){o[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:a};return}s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,n),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,i)}},ge=class extends me{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint(`DURATION`),this.gap=e.bool(`GAP`),this.independent=e.bool(`INDEPENDENT`),this.relurl=e.enumeratedString(`URI`),this.fragment=t,this.index=r;let a=e.enumeratedString(`BYTERANGE`);a&&this.setByteRange(a,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){let{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}};function _e(e,t){let n=Object.getPrototypeOf(e);if(n)return Object.getOwnPropertyDescriptor(n,t)||_e(n,t)}function ve(e,t){let n=_e(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}const ye=2**32-1,be=[].push,xe={video:1,audio:2,id3:3,text:4};function R(e){return String.fromCharCode.apply(null,e)}function Se(e,t){let n=e[t]<<8|e[t+1];return n<0?65536+n:n}function z(e,t){let n=we(e,t);return n<0?4294967296+n:n}function Ce(e,t){let n=z(e,t);return n*=2**32,n+=z(e,t+4),n}function we(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Te(e){let t=e.byteLength;for(let n=0;n<t;){let r=z(e,n);if(r>8&&e[n+4]===109&&e[n+5]===111&&e[n+6]===111&&e[n+7]===102)return!0;n=r>1?n+r:t}return!1}function B(e,t){let n=[];if(!t.length)return n;let r=e.byteLength;for(let i=0;i<r;){let a=z(e,i),o=R(e.subarray(i+4,i+8)),s=a>1?i+a:r;if(o===t[0]){if(t.length===1)n.push(e.subarray(i+8,s));else{let r=B(e.subarray(i+8,s),t.slice(1));r.length&&be.apply(n,r)}}i=s}return n}function Ee(e){let t=[],n=e[0],r=8,i=z(e,r);r+=4;let a=0,o=0;n===0?(a=z(e,r),o=z(e,r+4),r+=8):(a=Ce(e,r),o=Ce(e,r+8),r+=16),r+=2;let s=e.length+o,c=Se(e,r);r+=2;for(let n=0;n<c;n++){let n=r,a=z(e,n);n+=4;let o=a&2147483647;if((a&2147483648)>>>31==1)return P.warn(`SIDX has hierarchical references (not supported)`),null;let c=z(e,n);n+=4,t.push({referenceSize:o,subsegmentDuration:c,info:{duration:c/i,start:s,end:s+o-1}}),s+=o,n+=4,r=n}return{earliestPresentationTime:a,timescale:i,version:n,referencesCount:c,references:t}}function De(e){let t=[],n=B(e,[`moov`,`trak`]);for(let e=0;e<n.length;e++){let r=n[e],i=B(r,[`tkhd`])[0];if(i){let e=i[0],n=z(i,e===0?12:20),a=B(r,[`mdia`,`mdhd`])[0];if(a){e=a[0];let i=z(a,e===0?12:20),o=B(r,[`mdia`,`hdlr`])[0];if(o){let e=R(o.subarray(8,12)),a={soun:I.AUDIO,vide:I.VIDEO}[e],s=B(r,[`mdia`,`minf`,`stbl`,`stsd`])[0],c=Oe(s);a?(t[n]={timescale:i,type:a,stsd:c},t[a]=E({timescale:i,id:n},c)):t[n]={timescale:i,type:e,stsd:c}}}}}return B(e,[`moov`,`mvex`,`trex`]).forEach(e=>{let n=z(e,4),r=t[n];r&&(r.default={duration:z(e,12),flags:z(e,20)})}),t}function Oe(e){let t=e.subarray(8),n=t.subarray(86),r=R(t.subarray(4,8)),i=r,a,o=r===`enca`||r===`encv`;o&&B(B(t,[r])[0].subarray(r===`enca`?28:78),[`sinf`]).forEach(e=>{let t=B(e,[`schm`])[0];if(t){let n=R(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=B(e,[`frma`])[0];t&&(i=R(t))}}});let s=i;switch(i){case`avc1`:case`avc2`:case`avc3`:case`avc4`:{let e=B(n,[`avcC`])[0];e&&e.length>3&&(i+=`.`+Me(e[1])+Me(e[2])+Me(e[3]),a=ke(s===`avc1`?`dva1`:`dvav`,n));break}case`mp4a`:{let e=B(t,[r])[0],n=B(e.subarray(28),[`esds`])[0];if(n&&n.length>7){let e=4;if(n[e++]!==3)break;e=je(n,e),e+=2;let t=n[e++];if(t&128&&(e+=2),t&64&&(e+=n[e++]),n[e++]!==4)break;e=je(n,e);let r=n[e++];if(r===64)i+=`.`+Me(r);else break;if(e+=12,n[e++]!==5)break;e=je(n,e);let a=n[e++],o=(a&248)>>3;o===31&&(o+=1+((a&7)<<3)+((n[e]&224)>>5)),i+=`.`+o}break}case`hvc1`:case`hev1`:{let e=B(n,[`hvcC`])[0];if(e&&e.length>12){let t=e[1],n=[``,`A`,`B`,`C`][t>>6],r=t&31,a=z(e,2),o=(t&32)>>5?`H`:`L`,s=e[12],c=e.subarray(6,12);i+=`.`+n+r,i+=`.`+Ae(a).toString(16).toUpperCase(),i+=`.`+o+s;let l=``;for(let e=c.length;e--;){let t=c[e];(t||l)&&(l=`.`+t.toString(16).toUpperCase()+l)}i+=l}a=ke(s==`hev1`?`dvhe`:`dvh1`,n);break}case`dvh1`:case`dvhe`:case`dvav`:case`dva1`:case`dav1`:i=ke(i,n)||i;break;case`vp09`:{let e=B(n,[`vpcC`])[0];if(e&&e.length>6){let t=e[4],n=e[5],r=e[6]>>4&15;i+=`.`+Ne(t)+`.`+Ne(n)+`.`+Ne(r)}break}case`av01`:{let e=B(n,[`av1C`])[0];if(e&&e.length>2){let t=e[1]>>>5,r=e[1]&31,o=e[2]>>>7?`H`:`M`,s=(e[2]&64)>>6,c=(e[2]&32)>>5,l=t===2&&s?c?12:10:s?10:8,u=(e[2]&16)>>4,d=(e[2]&8)>>3,f=(e[2]&4)>>2,p=e[2]&3;i+=`.`+t+`.`+Ne(r)+o+`.`+Ne(l)+`.`+u+`.`+d+f+p+`.`+Ne(1)+`.`+Ne(1)+`.`+Ne(1)+`.0`,a=ke(`dav1`,n)}break}}return{codec:i,encrypted:o,supplemental:a}}function ke(e,t){let n=B(t,[`dvvC`]),r=n.length?n[0]:B(t,[`dvcC`])[0];if(r){let t=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return e+`.`+Ne(t)+`.`+Ne(n)}}function Ae(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}function je(e,t){let n=t+5;for(;e[t++]&128&&t<n;);return t}function Me(e){return(`0`+e.toString(16).toUpperCase()).slice(-2)}function Ne(e){return(e<10?`0`:``)+e}function Pe(e,t){if(!e||!t)return;let n=t.keyId;n&&t.isCommonEncryption&&Ie(e,(e,t)=>{let r=e.subarray(8,24);r.some(e=>e!==0)||(P.log(`[eme] Patching keyId in 'enc${t?`a`:`v`}>sinf>>tenc' box: ${F(r)} -> ${F(n)}`),e.set(n,8))})}function Fe(e){let t=[];return Ie(e,e=>t.push(e.subarray(8,24))),t}function Ie(e,t){B(e,[`moov`,`trak`]).forEach(e=>{let n=B(e,[`mdia`,`minf`,`stbl`,`stsd`])[0];if(!n)return;let r=n.subarray(8),i=B(r,[`enca`]),a=i.length>0;a||(i=B(r,[`encv`])),i.forEach(e=>{B(a?e.subarray(28):e.subarray(78),[`sinf`]).forEach(e=>{let n=Le(e);n&&t(n,a)})})})}function Le(e){let t=B(e,[`schm`])[0];if(t){let n=R(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=B(e,[`schi`,`tenc`])[0];if(t)return t}}}function Re(e,t,n){let r={},i=B(e,[`moof`,`traf`]);for(let e=0;e<i.length;e++){let a=i[e],o=B(a,[`tfhd`])[0],s=z(o,4),c=t[s];if(!c)continue;r[s]||(r[s]={start:NaN,duration:0,sampleCount:0,timescale:c.timescale,type:c.type});let l=r[s],u=B(a,[`tfdt`])[0];if(u){let e=u[0],t=z(u,4);e===1&&(t===ye?n.warn(`[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time`):(t*=ye+1,t+=z(u,8))),p(t)&&(!p(l.start)||t<l.start)&&(l.start=t)}let d=c.default,f=z(o,0)|d?.flags,m=d?.duration||0;f&8&&(m=f&2?z(o,12):z(o,8));let h=B(a,[`trun`]),g=l.start||0,_=0,v=m;for(let e=0;e<h.length;e++){let t=h[e],n=z(t,4),r=l.sampleCount;l.sampleCount+=n;let i=t[3]&1,a=t[3]&4,o=t[2]&1,s=t[2]&2,c=t[2]&4,u=t[2]&8,d=8,f=n;for(i&&(d+=4),a&&n&&(!(t[d+1]&1)&&l.keyFrameIndex===void 0&&(l.keyFrameIndex=r),d+=4,o?(v=z(t,d),d+=4):v=m,s&&(d+=4),u&&(d+=4),g+=v,_+=v,f--);f--;)o?(v=z(t,d),d+=4):v=m,s&&(d+=4),c&&(t[d+1]&1||l.keyFrameIndex===void 0&&(l.keyFrameIndex=l.sampleCount-(f+1),l.keyFrameStart=g),d+=4),u&&(d+=4),g+=v,_+=v;!_&&m&&(_+=m*n)}l.duration+=_}if(!Object.keys(r).some(e=>r[e].duration)){let t=1/0,n=0,i=B(e,[`sidx`]);for(let e=0;e<i.length;e++){let r=Ee(i[e]);if(r!=null&&r.references){t=Math.min(t,r.earliestPresentationTime/r.timescale);let e=r.references.reduce((e,t)=>e+t.info.duration||0,0);n=Math.max(n,e+r.earliestPresentationTime/r.timescale)}}n&&p(n)&&Object.keys(r).forEach(e=>{r[e].duration||(r[e].duration=n*r[e].timescale-r[e].start)})}return r}function ze(e){let t={valid:null,remainder:null},n=B(e,[`moof`]);if(n.length<2)return t.remainder=e,t;let r=n[n.length-1];return t.valid=e.slice(0,r.byteOffset-8),t.remainder=e.slice(r.byteOffset-8),t}function Be(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Ve(e,t){let n=[],r=t.samples,i=t.timescale,a=t.id,o=!1;return B(r,[`moof`]).map(s=>{let c=s.byteOffset-8;B(s,[`traf`]).map(s=>{let l=B(s,[`tfdt`]).map(e=>{let t=e[0],n=z(e,4);return t===1&&(n*=2**32,n+=z(e,8)),n/i})[0];return l!==void 0&&(e=l),B(s,[`tfhd`]).map(l=>{let u=z(l,4),d=z(l,0)&16777215,f=!!(d&1),p=!!(d&2),m=!!(d&8),h=0,g=!!(d&16),_=0,v=!!(d&32),y=8;u===a&&(f&&(y+=8),p&&(y+=4),m&&(h=z(l,y),y+=4),g&&(_=z(l,y),y+=4),v&&(y+=4),t.type===`video`&&(o=He(t.codec)),B(s,[`trun`]).map(a=>{let s=a[0],l=z(a,0)&16777215,u=!!(l&1),d=0,f=!!(l&4),p=!!(l&256),m=0,g=!!(l&512),v=0,y=!!(l&1024),b=!!(l&2048),x=0,S=z(a,4),C=8;u&&(d=z(a,C),C+=4),f&&(C+=4);let w=d+c;for(let c=0;c<S;c++){if(p?(m=z(a,C),C+=4):m=h,g?(v=z(a,C),C+=4):v=_,y&&(C+=4),b&&(x=s===0?z(a,C):we(a,C),C+=4),t.type===I.VIDEO){let t=0;for(;t<v;){let a=z(r,w);w+=4,Ue(o,r[w])&&We(r.subarray(w,w+a),o?2:1,e+x/i,n),w+=a,t+=a+4}}e+=m/i}}))})})}),n}function He(e){if(!e)return!1;let t=e.substring(0,4);return t===`hvc1`||t===`hev1`||t===`dvh1`||t===`dvhe`}function Ue(e,t){if(e){let e=t>>1&63;return e===39||e===40}return(t&31)==6}function We(e,t,n,r){let i=Ge(e),a=0;a+=t;let o=0,s=0,c=0;for(;a<i.length;){o=0;do{if(a>=i.length)break;c=i[a++],o+=c}while(c===255);s=0;do{if(a>=i.length)break;c=i[a++],s+=c}while(c===255);let e=i.length-a,t=a;if(s<e)a+=s;else if(s>e){P.error(`Malformed SEI payload. ${s} is too small, only ${e} bytes left to parse.`);break}if(o===4){if(i[t++]===181){let e=Se(i,t);if(t+=2,e===49){let e=z(i,t);if(t+=4,e===1195456820){let e=i[t++];if(e===3){let a=i[t++],s=31&a,c=64&a,l=c?2+s*3:0,u=new Uint8Array(l);if(c){u[0]=a;for(let e=1;e<l;e++)u[e]=i[t++]}r.push({type:e,payloadType:o,pts:n,bytes:u})}}}}}else if(o===5&&s>16){let e=[];for(let n=0;n<16;n++){let r=i[t++].toString(16);e.push(r.length==1?`0`+r:r),(n===3||n===5||n===7||n===9)&&e.push(`-`)}let a=s-16,c=new Uint8Array(a);for(let e=0;e<a;e++)c[e]=i[t++];r.push({payloadType:o,pts:n,uuid:e.join(``),userData:oe(c),userDataBytes:c})}}}function Ge(e){let t=e.byteLength,n=[],r=1;for(;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;let i=t-n.length,a=new Uint8Array(i),o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=e[o];return a}function Ke(e){let t=e[0],n=``,r=``,i=0,a=0,o=0,s=0,c=0,l=0;if(t===0){for(;R(e.subarray(l,l+1))!==`\0`;)n+=R(e.subarray(l,l+1)),l+=1;for(n+=R(e.subarray(l,l+1)),l+=1;R(e.subarray(l,l+1))!==`\0`;)r+=R(e.subarray(l,l+1)),l+=1;r+=R(e.subarray(l,l+1)),l+=1,i=z(e,12),a=z(e,16),s=z(e,20),c=z(e,24),l=28}else if(t===1){l+=4,i=z(e,l),l+=4;let t=z(e,l);l+=4;let a=z(e,l);for(l+=4,o=2**32*t+a,m(o)||(o=2**53-1,P.warn(`Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box`)),s=z(e,l),l+=4,c=z(e,l),l+=4;R(e.subarray(l,l+1))!==`\0`;)n+=R(e.subarray(l,l+1)),l+=1;for(n+=R(e.subarray(l,l+1)),l+=1;R(e.subarray(l,l+1))!==`\0`;)r+=R(e.subarray(l,l+1)),l+=1;r+=R(e.subarray(l,l+1)),l+=1}let u=e.subarray(l,e.byteLength);return{schemeIdUri:n,value:r,timeScale:i,presentationTime:o,presentationTimeDelta:a,eventDuration:s,id:c,payload:u}}function qe(e,...t){let n=t.length,r=8,i=n;for(;i--;)r+=t[i].byteLength;let a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(e,4),i=0,r=8;i<n;i++)a.set(t[i],r),r+=t[i].byteLength;return a}function Je(e,t,n){if(e.byteLength!==16)throw RangeError(`Invalid system id`);let r,i;r=0,i=/* @__PURE__ */ new Uint8Array;let a;r>0?(a=/* @__PURE__ */ new Uint8Array(4),t.length>0&&new DataView(a.buffer).setUint32(0,t.length,!1)):a=/* @__PURE__ */ new Uint8Array;let o=/* @__PURE__ */ new Uint8Array(4);return n.byteLength>0&&new DataView(o.buffer).setUint32(0,n.byteLength,!1),qe([112,115,115,104],new Uint8Array([r,0,0,0]),e,a,i,o,n)}function Ye(e){let t=[];if(e instanceof ArrayBuffer){let n=e.byteLength,r=0;for(;r+32<n;){let n=Xe(new DataView(e,r));t.push(n),r+=n.size}}return t}function Xe(e){let t=e.getUint32(0),n=e.byteOffset,r=e.byteLength;if(r<t)return{offset:n,size:r};if(e.getUint32(4)!==1886614376)return{offset:n,size:t};let i=e.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:n,size:t};let a=e.buffer,o=F(new Uint8Array(a,n+12,16)),s=null,c=null,l=0;if(i===0)l=28;else{let i=e.getUint32(28);if(!i||r<32+i*16)return{offset:n,size:t};s=[];for(let e=0;e<i;e++)s.push(new Uint8Array(a,n+32+e*16,16));l=32+i*16}if(!l)return{offset:n,size:t};let u=e.getUint32(l);return t-32<u?{offset:n,size:t}:(c=new Uint8Array(a,n+l+4,u),{version:i,systemId:o,kids:s,data:c,offset:n,size:t})}const Ze=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Qe={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function $e(e,t){let n=Qe[t];return!!n&&!!n[e.slice(0,4)]}function et(e,t,n=!0){return!e.split(`,`).some(e=>!tt(e,t,n))}function tt(e,t,n=!0){return re(n)?.isTypeSupported(nt(e,t))??!1}function nt(e,t){return`${t}/mp4;codecs=${e}`}function rt(e){if(e){let t=e.substring(0,4);return Qe.video[t]}return 2}function it(e){let t=Ze();return e.split(`,`).reduce((e,n)=>{let r=t&&He(n)?9:Qe.video[n];return r?(r*2+e)/(e?3:2):(Qe.audio[n]+e)/(e?2:1)},0)}const at={};function ot(e,t=!0){if(at[e])return at[e];let n={flac:[`flac`,`fLaC`,`FLAC`],opus:[`opus`,`Opus`],"mp4a.40.34":[`mp3`]}[e];for(let i=0;i<n.length;i++){var r;if(tt(n[i],`audio`,t))return at[e]=n[i],n[i];if(n[i]===`mp3`&&(r=re(t))!=null&&r.isTypeSupported(`audio/mpeg`))return``}return e}const st=/flac|opus|mp4a\.40\.34/i;function ct(e,t=!0){return e.replace(st,e=>ot(e.toLowerCase(),t))}function lt(e,t){let n=[];if(e){let t=e.split(`,`);for(let e=0;e<t.length;e++)$e(t[e],`video`)||n.push(t[e])}return t&&n.push(t),n.join(`,`)}function ut(e,t){if(e&&(e.length>4||[`ac-3`,`ec-3`,`alac`,`fLaC`,`Opus`].indexOf(e)!==-1)&&(dt(e,`audio`)||dt(e,`video`)))return e;if(t){let n=t.split(`,`);if(n.length>1){if(e){for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t]}return n[0]}}return t||e}function dt(e,t){return $e(e,t)&&tt(e,t)}function ft(e){let t=e.split(`,`);for(let e=0;e<t.length;e++){let n=t[e].split(`.`);n.length>2&&n[0]===`avc1`&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${(`000`+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(`,`)}function pt(e){if(e.startsWith(`av01.`)){let t=e.split(`.`),n=[`0`,`111`,`01`,`01`,`01`,`0`];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(`.`)}return e}function mt(e){let t=re(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported(`audio/mpeg`),mp3:t.isTypeSupported(`audio/mp4; codecs="mp3"`),ac3:t.isTypeSupported(`audio/mp4; codecs="ac-3"`)}}function ht(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,`$1`)}const gt={supported:!0,powerEfficient:!0,smooth:!0},_t={supported:!1,smooth:!1,powerEfficient:!1},vt={supported:!0,configurations:[],decodingInfoResults:[gt]};function yt(e,t){return{supported:!1,configurations:t,decodingInfoResults:[_t],error:e}}function bt(e,t,n,r,i,a){let o=e.videoCodec,s=e.audioCodec?e.audioGroups:null,c=a?.audioCodec,l=a?.channels,u=l?parseInt(l):c?1/0:2,d=null;if(s!=null&&s.length)try{d=s.length===1&&s[0]?t.groups[s[0]].channels:s.reduce((e,n)=>{if(n){let r=t.groups[n];if(!r)throw Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach(t=>{e[t]=(e[t]||0)+r.channels[t]})}return e},{2:0})}catch{return!0}return o!==void 0&&(o.split(`,`).some(e=>He(e))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||e.videoRange!==`SDR`&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!d&&p(u)&&Object.keys(d).some(e=>parseInt(e)>u)}function xt(e,t,n,r={}){let i=e.videoCodec;if(!i&&!e.audioCodec||!n)return Promise.resolve(vt);let a=[],o=St(e),s=o.length,c=Ct(e,t,s>0),l=c.length;for(let e=s||1*l||1;e--;){let t={type:`media-source`};if(s&&(t.video=o[e%s]),l){t.audio=c[e%l];let n=t.audio.bitrate;t.video&&n&&(t.video.bitrate-=n)}a.push(t)}if(i){let e=navigator.userAgent;if(i.split(`,`).some(e=>He(e))&&Ze())return Promise.resolve(yt(/* @__PURE__ */ Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),a))}return Promise.all(a.map(e=>{let t=Et(e);return r[t]||(r[t]=n.decodingInfo(e))})).then(e=>({supported:!e.some(e=>!e.supported),configurations:a,decodingInfoResults:e})).catch(e=>({supported:!1,configurations:a,decodingInfoResults:[],error:e}))}function St(e){let t=e.videoCodec?.split(`,`),n=Tt(e),r=e.width||640,i=e.height||480,a=e.frameRate||30,o=e.videoRange.toLowerCase();return t?t.map(e=>{let t={contentType:nt(pt(e),`video`),width:r,height:i,bitrate:n,framerate:a};return o!==`sdr`&&(t.transferFunction=o),t}):[]}function Ct(e,t,n){let r=e.audioCodec?.split(`,`),i=Tt(e);return r&&e.audioGroups?e.audioGroups.reduce((e,a)=>{let o=a?t.groups[a]?.tracks:null;return o?o.reduce((e,t)=>{if(t.groupId===a){let a=parseFloat(t.channels||``);r.forEach(t=>{let r={contentType:nt(t,`audio`),bitrate:n?wt(t,i):i};a&&(r.channels=``+a),e.push(r)})}return e},e):e},[]):[]}function wt(e,t){if(t<=1)return 1;let n=128e3;return e===`ec-3`?n=768e3:e===`ac-3`&&(n=64e4),Math.min(t/2,n)}function Tt(e){return Math.ceil(Math.max(e.bitrate*.9,e.averageBitrate)/1e3)*1e3||1}function Et(e){let t=``,{audio:n,video:r}=e;if(r){let e=ht(r.contentType);t+=`${e}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||`sd`}_${Math.ceil(r.bitrate/1e5)}`}if(n){let e=ht(n.contentType);t+=`${r?`_`:``}${e}_c${n.channels}`}return t}const Dt=[`NONE`,`TYPE-0`,`TYPE-1`,null];function Ot(e){return Dt.indexOf(e)>-1}const kt=[`SDR`,`PQ`,`HLG`];function At(e){return!!e&&kt.indexOf(e)>-1}var jt={No:``,Yes:`YES`,v2:`v2`};function Mt(e){let{canSkipUntil:t,canSkipDateRanges:n,age:r}=e,i=r<t/2;return t&&i?n?jt.v2:jt.Yes:jt.No}var Nt=class{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){let t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set(`_HLS_msn`,this.msn.toString()),this.part!==void 0&&t.searchParams.set(`_HLS_part`,this.part.toString()),this.skip&&t.searchParams.set(`_HLS_skip`,this.skip),t.href}},Pt=class{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat(`FRAME-RATE`,0),this._avgBitrate=e.attrs.decimalInteger(`AVERAGE-BANDWIDTH`),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(e=>!!e).map(e=>e.substring(0,4)).join(`,`),`supplemental`in e){this.supplemental=e.supplemental;let t=e.supplemental?.videoCodec;t&&t!==e.videoCodec&&(this.codecSet+=`,${t.substring(0,4)}`)}this.addGroupId(`audio`,e.attrs.AUDIO),this.addGroupId(`text`,e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||``}get pathwayId(){return this.attrs[`PATHWAY-ID`]||`.`}get videoRange(){return this.attrs[`VIDEO-RANGE`]||`SDR`}get score(){return this.attrs.optionalFloat(`SCORE`,0)}get uri(){return this.url[0]||``}hasAudioGroup(e){return Ft(this._audioGroups,e)}hasSubtitleGroup(e){return Ft(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e===`audio`){let e=this._audioGroups;e||=this._audioGroups=[],e.indexOf(t)===-1&&e.push(t)}else if(e===`text`){let e=this._subtitleGroups;e||=this._subtitleGroups=[],e.indexOf(t)===-1&&e.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){return this.audioGroups?.[0]}get textGroupId(){return this.subtitleGroups?.[0]}addFallback(){}};function Ft(e,t){return!t||!e?!1:e.indexOf(t)!==-1}function It(){if(typeof matchMedia==`function`){let e=matchMedia(`(dynamic-range: high)`),t=matchMedia(`bad query`);if(e.media!==t.media)return e.matches===!0}return!1}function Lt(e,t){let n=!1,r=[];if(e&&(n=e!==`SDR`,r=[e]),t){r=t.allowedVideoRanges||kt.slice(0);let e=r.join(``)!==`SDR`&&!t.videoCodec;n=t.preferHDR===void 0?e&&It():t.preferHDR,n||(r=[`SDR`])}return{preferHDR:n,allowedVideoRanges:r}}const Rt=e=>{let t=/* @__PURE__ */ new WeakSet;return(n,r)=>{if(e&&(r=e(n,r)),typeof r==`object`&&r){if(t.has(r))return;t.add(r)}return r}},V=(e,t)=>JSON.stringify(e,Rt(t));function zt(e,t,n,r,i){let a=Object.keys(e),o=r?.channels,s=r?.audioCodec,c=i?.videoCodec,l=o&&parseInt(o)===2,u=!1,d=!1,f=1/0,m=1/0,h=1/0,g=1/0,_=0,v=[],{preferHDR:y,allowedVideoRanges:b}=Lt(t,i);for(let t=a.length;t--;){let n=e[a[t]];u||=n.channels[2]>0,f=Math.min(f,n.minHeight),m=Math.min(m,n.minFramerate),h=Math.min(h,n.minBitrate),b.filter(e=>n.videoRanges[e]>0).length>0&&(d=!0)}f=p(f)?f:0,m=p(m)?m:0;let x=Math.max(1080,f),S=Math.max(30,m);h=p(h)?h:n,n=Math.max(h,n),d||(t=void 0);let C=a.length>1;return{codecSet:a.reduce((t,r)=>{let i=e[r];if(r===t)return t;if(v=d?b.filter(e=>i.videoRanges[e]>0):[],C){if(i.minBitrate>n)return Bt(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),t;if(!i.hasDefaultAudio)return Bt(r,`no renditions with default or auto-select sound found`),t;if(s&&r.indexOf(s.substring(0,4))%5!=0)return Bt(r,`audio codec preference "${s}" not found`),t;if(o&&!l){if(!i.channels[o])return Bt(r,`no renditions with ${o} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!s||l)&&u&&i.channels[2]===0)return Bt(r,`no renditions with stereo sound found`),t;if(i.minHeight>x)return Bt(r,`min resolution of ${i.minHeight} > maximum of ${x}`),t;if(i.minFramerate>S)return Bt(r,`min framerate of ${i.minFramerate} > maximum of ${S}`),t;if(!v.some(e=>i.videoRanges[e]>0))return Bt(r,`no variants with VIDEO-RANGE of ${V(v)} found`),t;if(c&&r.indexOf(c.substring(0,4))%5!=0)return Bt(r,`video codec preference "${c}" not found`),t;if(i.maxScore<_)return Bt(r,`max score of ${i.maxScore} < selected max of ${_}`),t}return t&&(it(r)>=it(t)||i.fragmentError>e[t].fragmentError)?t:(g=i.minIndex,_=i.maxScore,r)},void 0),videoRanges:v,preferHDR:y,minFramerate:m,minBitrate:h,minIndex:g}}function Bt(e,t){P.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function Vt(e){return e.reduce((e,t)=>{let n=e.groups[t.groupId];n||=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1},n.tracks.push(t);let r=t.channels||`2`;return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Ht(e,t,n,r){return e.slice(n,r+1).reduce((e,n,r)=>{if(!n.codecSet)return e;let i=n.audioGroups,a=e[n.codecSet];a||(e[n.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!i,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,n.bitrate);let o=Math.min(n.height,n.width);return a.minHeight=Math.min(a.minHeight,o),a.minFramerate=Math.min(a.minFramerate,n.frameRate),a.minIndex=Math.min(a.minIndex,r),a.maxScore=Math.max(a.maxScore,n.score),a.fragmentError+=n.fragmentError,a.videoRanges[n.videoRange]=(a.videoRanges[n.videoRange]||0)+1,i&&i.forEach(e=>{if(!e)return;let n=t.groups[e];n&&(a.hasDefaultAudio=a.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach(e=>{a.channels[e]=(a.channels[e]||0)+n.channels[e]}))}),e},{})}function Ut(e){if(!e)return e;let{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:a}=e;return{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:a}}function Wt(e,t,n){if(`attrs`in e){let n=t.indexOf(e);if(n!==-1)return n}for(let r=0;r<t.length;r++){let i=t[r];if(Gt(e,i,n))return r}return-1}function Gt(e,t,n){let{groupId:r,name:i,lang:a,assocLang:o,default:s}=e,c=e.forced;return(r===void 0||t.groupId===r)&&(i===void 0||t.name===i)&&(a===void 0||Kt(a,t.lang))&&(a===void 0||t.assocLang===o)&&(s===void 0||t.default===s)&&(c===void 0||t.forced===c)&&(!(`characteristics`in e)||qt(e.characteristics||``,t.characteristics))&&(n===void 0||n(e,t))}function Kt(e,t=`--`){return e.length===t.length?e===t:e.startsWith(t)||t.startsWith(e)}function qt(e,t=``){let n=e.split(`,`),r=t.split(`,`);return n.length===r.length&&!n.some(e=>r.indexOf(e)===-1)}function Jt(e,t){let{audioCodec:n,channels:r}=e;return(n===void 0||(t.audioCodec||``).substring(0,4)===n.substring(0,4))&&(r===void 0||r===(t.channels||`2`))}function Yt(e,t,n,r,i){let a=t[r],o=t.reduce((e,t,n)=>{let r=t.uri;return(e[r]||(e[r]=[])).push(n),e},{})[a.uri];o.length>1&&(r=Math.max.apply(Math,o));let s=a.videoRange,c=a.frameRate,l=a.codecSet.substring(0,4),u=Xt(t,r,t=>{if(t.videoRange!==s||t.frameRate!==c||t.codecSet.substring(0,4)!==l)return!1;let r=t.audioGroups;return Wt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1});return u>-1?u:Xt(t,r,t=>{let r=t.audioGroups;return Wt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1})}function Xt(e,t,n){for(let r=t;r>-1;r--)if(n(e[r]))return r;for(let r=t+1;r<e.length;r++)if(n(e[r]))return r;return-1}function Zt(e,t){return!!e&&e!==t.loadLevelObj?.uri}var Qt=class extends k{constructor(e){super(`abr`,e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey=``,this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{let{fragCurrent:t,partCurrent:n,hls:r}=this,{autoLevelEnabled:i,media:a}=r;if(!t||!a)return;let o=performance.now(),s=n?n.stats:t.stats,c=n?n.duration:t.duration,l=o-s.loading.start,u=r.minAutoLevel,d=t.level,f=this._nextAutoLevel;if(s.aborted||s.loaded&&s.loaded===s.total||d<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i)return;let m=f>-1&&f!==d,h=!!e||m;if(!h&&(a.paused||!a.playbackRate||!a.readyState))return;let g=r.mainForwardBufferInfo;if(!h&&g===null)return;let _=this.bwEstimator.getEstimateTTFB(),y=Math.abs(a.playbackRate);if(l<=Math.max(_,1e3*(c/(y*2))))return;let b=g?g.len/y:0,x=s.loading.first?s.loading.first-s.loading.start:-1,S=s.loaded&&x>-1,C=this.getBwEstimate(),w=r.levels,T=w[d],E=Math.max(s.loaded,Math.round(c*(t.bitrate||T.averageBitrate)/8)),D=S?l-x:l;D<1&&S&&(D=Math.min(l,s.loaded*8/C));let O=S?s.loaded*1e3/D:0,k=_/1e3,A=O?(E-s.loaded)/O:E*8/C+k;if(A<=b)return;let j=O?O*8:C,M=(e?.details||this.hls.latestLevelDetails)?.live===!0,ee=this.hls.config.abrBandWidthUpFactor,te=1/0,N;for(N=d-1;N>u;N--){let e=w[N].maxBitrate,t=!w[N].details||M;if(te=this.getTimeToLoadFrag(k,j,c*e,t),te<Math.min(b,c+k))break}if(te>=A||te>c*10)return;S?this.bwEstimator.sample(l-Math.min(_,x),s.loaded):this.bwEstimator.sampleTTFB(l);let ne=w[N].maxBitrate;this.getBwEstimate()*ee>ne&&this.resetEstimator(ne);let P=this.findBestLevel(ne,u,N,0,b,1,1);P>-1&&(N=P),this.warn(`Fragment ${t.sn}${n?` part `+n.index:``} of level ${d} is loading too slowly;
Fragment duration: ${t.duration.toFixed(3)}
Time to underbuffer: ${b.toFixed(3)} s
Estimated load time for current fragment: ${A.toFixed(3)} s
@@ -37,5 +37,5 @@ Schedule: ${a.map(e=>gc(e))} pos: ${this.timelinePos}`),s.length&&this.log(`Remo
`).split(`
`),l=[],u=t?Va(t.baseTime,t.timescale):0,d=`00:00.000`,f=0,p=0,m,h=!0;s.oncue=function(e){let a=n[r],o=n.ccOffset,s=(f-u)/9e4;if(a!=null&&a.new&&(p===void 0?tl(n,r,s):o=n.ccOffset=a.start),s){if(!t){m=/* @__PURE__ */ Error(`Missing initPTS for VTT MPEGTS`);return}o=s-n.presentationOffset}let c=e.endTime-e.startTime,d=Ja((e.startTime+o-p)*9e4,i*9e4)/9e4;e.startTime=Math.max(d,0),e.endTime=Math.max(d+c,0);let h=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(h)),e.id||=el(e.startTime,e.endTime,h),e.endTime>0&&l.push(e)},s.onparsingerror=function(e){m=e},s.onflush=function(){if(m){o(m);return}a(l)},c.forEach(e=>{if(h){if(Qc(e,`X-TIMESTAMP-MAP=`)){h=!1,e.slice(16).split(`,`).forEach(e=>{Qc(e,`LOCAL:`)?d=e.slice(6):Qc(e,`MPEGTS:`)&&(f=parseInt(e.slice(7)))});try{p=$c(d)/1e3}catch(e){m=e}return}e===``&&(h=!1)}s.parse(e+`
`)}),s.flush()}const rl=`stpp.ttml.im1t`,il=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,al=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ol={left:`start`,center:`center`,right:`end`,start:`start`,end:`end`};function sl(e,t,n,r){let i=B(new Uint8Array(e),[`mdat`]);if(i.length===0){r(/* @__PURE__ */ Error(`Could not parse IMSC1 mdat`));return}let a=i.map(e=>oe(e)),o=za(t.baseTime,1,t.timescale);try{a.forEach(e=>n(cl(e,o)))}catch(e){r(e)}}function cl(e,t){let n=new DOMParser().parseFromString(e,`text/xml`).getElementsByTagName(`tt`)[0];if(!n)throw Error(`Invalid ttml`);let r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(r).reduce((e,t)=>(e[t]=n.getAttribute(`ttp:${t}`)||r[t],e),{}),a=n.getAttribute(`xml:space`)!==`preserve`,o=ul(ll(n,`styling`,`style`)),s=ul(ll(n,`layout`,`region`)),c=ll(n,`body`,`[begin]`);return[].map.call(c,e=>{let n=dl(e,a);if(!n||!e.hasAttribute(`begin`))return null;let r=hl(e.getAttribute(`begin`),i),c=hl(e.getAttribute(`dur`),i),l=hl(e.getAttribute(`end`),i);if(r===null)throw ml(e);if(l===null){if(c===null)throw ml(e);l=r+c}let u=new Vc(r-t,l-t,n);u.id=el(u.startTime,u.endTime,u.text);let d=s[e.getAttribute(`region`)],f=o[e.getAttribute(`style`)],p=fl(d,f,o),{textAlign:m}=p;if(m){let e=ol[m];e&&(u.lineAlign=e),u.align=m}return w(u,p),u}).filter(e=>e!==null)}function ll(e,t,n){let r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function ul(e){return e.reduce((e,t)=>{let n=t.getAttribute(`xml:id`);return n&&(e[n]=t),e},{})}function dl(e,t){return[].slice.call(e.childNodes).reduce((e,n,r)=>{var i;return n.nodeName===`br`&&r?e+`
-`:(i=n.childNodes)!=null&&i.length?dl(n,t):t?e+n.textContent.trim().replace(/\s+/g,` `):e+n.textContent},``)}function fl(e,t,n){let r=`http://www.w3.org/ns/ttml#styling`,i=null,a=[`displayAlign`,`textAlign`,`color`,`backgroundColor`,`fontSize`,`fontFamily`],o=e!=null&&e.hasAttribute(`style`)?e.getAttribute(`style`):null;return o&&n.hasOwnProperty(o)&&(i=n[o]),a.reduce((n,a)=>{let o=pl(t,r,a)||pl(e,r,a)||pl(i,r,a);return o&&(n[a]=o),n},{})}function pl(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function ml(e){return/* @__PURE__ */ Error(`Could not parse ttml timestamp ${e}`)}function hl(e,t){if(!e)return null;let n=Uc(e);return n===null&&(il.test(e)?n=gl(e,t):al.test(e)&&(n=_l(e,t))),n}function gl(e,t){let n=il.exec(e),r=(n[4]|0)+(n[5]|0)/t.subFrameRate;return(n[1]|0)*3600+(n[2]|0)*60+(n[3]|0)+r/t.frameRate}function _l(e,t){let n=al.exec(e),r=Number(n[1]);switch(n[2]){case`h`:return r*3600;case`m`:return r*60;case`ms`:return r*1e3;case`f`:return r/t.frameRate;case`t`:return r/t.tickRate}return r}var vl=class{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}},yl=class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Cl(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(v.FRAG_LOADING,this.onFragLoading,this),e.on(v.FRAG_LOADED,this.onFragLoaded,this),e.on(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){let{hls:e}=this;e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(v.FRAG_LOADING,this.onFragLoading,this),e.off(v.FRAG_LOADED,this.onFragLoaded,this),e.off(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){let e=new vl(this,`textTrack1`),t=new vl(this,`textTrack2`),n=new vl(this,`textTrack3`),r=new vl(this,`textTrack4`);this.cea608Parser1=new Lc(1,e,t),this.cea608Parser2=new Lc(3,n,r)}addCues(e,t,n,r,i){let a=!1;for(let e=i.length;e--;){let r=i[e],o=Sl(r[0],r[1],t,n);if(o>=0&&(r[0]=Math.min(r[0],t),r[1]=Math.max(r[1],n),a=!0,o/(n-t)>.5))return}if(a||i.push([t,n]),this.config.renderTextTracksNatively){let i=this.captionsTracks[e];this.Cues.newCue(i,t,n,r)}else{let i=this.Cues.newCue(null,t,n,r);this.hls.trigger(v.CUES_PARSED,{type:`captions`,cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i,trackId:a}){let{unparsedVttFrags:o}=this;n===b.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i,trackId:a}),o.length&&(this.unparsedVttFrags=[],o.forEach(e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(v.FRAG_LOADED,e):this.hls.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:/* @__PURE__ */ Error(`Subtitle discontinuity domain does not match main`)})}))}getExistingTrack(e,t){let{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){let i=n.textTracks[r];if(xl(i,{name:e,lang:t,characteristics:`transcribes-spoken-dialog,describes-music-and-sound`}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;let{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:a}=t[e],o=this.getExistingTrack(i,a);if(o)n[e]=o,Xs(n[e]),Js(n[e],r);else{let t=this.createTextTrack(`captions`,i,a);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;let t=this.captionsProperties[e];if(!t)return;let n={_id:e,label:t.label,kind:`captions`,default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){let r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){let n=!!t.transferMedia;if(this.media=null,n)return;let{captionsTracks:r}=this;Object.keys(r).forEach(e=>{Xs(r[e]),delete r[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Cl(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){let{media:e}=this;if(!e)return;let t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Xs(t[e])}onSubtitleTracksUpdated(e,t){let n=t.subtitleTracks||[],r=n.some(e=>e.textCodec===rl);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(ho(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){let e=this.media,t=e?ec(e.textTracks):null;if(this.tracks.forEach((e,n)=>{let r;if(t){let n=null;for(let r=0;r<t.length;r++)if(t[r]&&xl(t[r],e)){n=t[r],t[r]=null;break}n&&(r=n)}if(r)Xs(r);else{let t=bl(e);r=this.createTextTrack(t,e.name,e.lang),r&&(r.mode=`disabled`)}r&&this.textTracks.push(r)}),t!=null&&t.length){let e=t.filter(e=>e!==null).map(e=>e.label);e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(`, `)}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){let e=this.tracks.map(e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{let t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;let n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)})}closedCaptionsForLevel(e){return this.hls.levels[e.level]?.attrs[`CLOSED-CAPTIONS`]}onFragLoading(e,t){if(this.enabled&&t.frag.type===b.MAIN){let{cea608Parser1:e,cea608Parser2:n,lastSn:r}=this,{cc:i,sn:a}=t.frag,o=t.part?.index??-1;e&&n&&(a!==r+1||a===r&&o!==this.lastPartIndex+1||i!==this.lastCc)&&(e.reset(),n.reset()),this.lastCc=i,this.lastSn=a,this.lastPartIndex=o}}onFragLoaded(e,t){let{frag:n,payload:r}=t;if(n.type===b.SUBTITLE){if(r.byteLength){let e=n.decryptdata,i=`stats`in t;if(e==null||!e.encrypted||i){let e=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===rl?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:/* @__PURE__ */ Error(`Empty subtitle payload`)})}}_parseIMSC1(e,t){let n=this.hls;sl(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),n.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;let{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:a}=this,o=i.length-1;if(!i[n.cc]&&o===-1){a.push(e);return}let s=this.hls;nl((t=n.initSegment)!=null&&t.data?Be(n.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,e=>{this._appendCues(e,n.level),s.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},t=>{let i=t.message===`Missing initPTS for VTT MPEGTS`;i?a.push(e):this._fallbackToIMSC1(n,r),s.logger.log(`Failed to parse VTT cue: ${t}`),!(i&&o>n.cc)&&s.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})})}_fallbackToIMSC1(e,t){let n=this.tracks[e.level];n.textCodec||sl(t,this.initPTS[e.cc],()=>{n.textCodec=rl,this._parseIMSC1(e,t)},()=>{n.textCodec=`wvtt`})}_appendCues(e,t){let n=this.hls;if(this.config.renderTextTracksNatively){let n=this.textTracks[t];if(!n||n.mode===`disabled`)return;e.forEach(e=>Ys(n,e))}else{let r=this.tracks[t];if(!r)return;let i=r.default?`default`:`subtitles`+t;n.trigger(v.CUES_PARSED,{type:`subtitles`,cues:e,track:i})}}onFragDecrypted(e,t){let{frag:n}=t;n.type===b.SUBTITLE&&this.onFragLoaded(v.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;let{frag:n,samples:r}=t;if(n.type!==b.MAIN||this.closedCaptionsForLevel(n)!==`NONE`)for(let e=0;e<r.length;e++){let t=r[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();let n=this.extractCea608Data(t);this.cea608Parser1.addData(r[e].pts,n[0]),this.cea608Parser2.addData(r[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){let{media:a}=this;if(!(!a||a.currentTime<n)){if(!i||i===`video`){let{captionsTracks:e}=this;Object.keys(e).forEach(r=>Zs(e[r],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){let{textTracks:e}=this;Object.keys(e).forEach(n=>Zs(e[n],t,r))}}}extractCea608Data(e){let t=[[],[]],n=e[0]&31,r=2;for(let i=0;i<n;i++){let n=e[r++],i=127&e[r++],a=127&e[r++];if((i!==0||a!==0)&&4&n){let e=3&n;(e===0||e===1)&&(t[e].push(i),t[e].push(a))}}return t}};function bl(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?`captions`:`subtitles`}function xl(e,t){return!!e&&e.kind===bl(t)&&_o(t,e)}function Sl(e,t,n,r){return Math.min(t,r)-Math.max(e,n)}function Cl(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wl=/\s/,Tl={newCue(e,t,n,r){let i=[],a,o,s,c,l,u=self.VTTCue||self.TextTrackCue;for(let f=0;f<r.rows.length;f++)if(a=r.rows[f],s=!0,c=0,l=``,!a.isEmpty()){var d;for(let e=0;e<a.chars.length;e++)wl.test(a.chars[e].uchar)&&s?c++:(l+=a.chars[e].uchar,s=!1);a.cueStartTime=t,t===n&&(n+=1e-4),c>=16?c--:c++;let r=Yc(l.trim()),p=el(t,n,r);e!=null&&(d=e.cues)!=null&&d.getCueById(p)||(o=new u(t,n,r),o.id=p,o.line=f+1,o.align=`left`,o.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(o))}return e&&i.length&&(i.sort((e,t)=>e.line===`auto`||t.line===`auto`?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),i.forEach(t=>Ys(e,t))),i}};function El(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const Dl=/(\d+)-(\d+)\/(\d+)/;var Ol=class{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Ml,this.controller=new self.AbortController,this.stats=new pe}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){let r=this.stats;if(r.loading.start)throw Error(`Loader can only be used once.`);r.loading.start=self.performance.now();let i=kl(e,this.controller.signal),a=e.responseType===`arraybuffer`,o=a?`byteLength`:`length`,{maxTimeToFirstByteMs:s,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=s&&p(s)?s:c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(so(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(n=>{this.response=this.loader=n;let i=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},c-(i-r.loading.start)),!n.ok){let{status:e,statusText:t}=n;throw new Nl(t||`fetch, bad network response`,e,n)}r.loading.first=i,r.total=jl(n.headers)||r.total;let o=this.callbacks?.onProgress;return o&&p(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,o):a?n.arrayBuffer():e.responseType===`json`?n.json():n.text()}).then(n=>{var i;let a=this.response;if(!a)throw Error(`loader destroyed`);self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);let s=n[o];s&&(r.loaded=r.total=s);let c={url:a.url,data:n,code:a.status},l=this.callbacks?.onProgress;l&&!p(t.highWaterMark)&&l(r,e,n,a),(i=this.callbacks)==null||i.onSuccess(c,r,e,a)}).catch(t=>{var n;if(self.clearTimeout(this.requestTimeout),r.aborted)return;let i=t&&t.code||0,a=t?t.message:null;(n=this.callbacks)==null||n.onError({code:i,text:a},e,t?t.details:null,r)})}getCacheAge(){let e=null;if(this.response){let t=this.response.headers.get(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){let a=new ui,o=e.body.getReader(),s=()=>o.read().then(o=>{if(o.done)return a.dataLength&&i(t,n,a.flush().buffer,e),Promise.resolve(/* @__PURE__ */ new ArrayBuffer(0));let c=o.value,l=c.length;return t.loaded+=l,l<r||a.dataLength?(a.push(c),a.dataLength>=r&&i(t,n,a.flush().buffer,e)):i(t,n,c.buffer,e),s()}).catch(()=>Promise.reject());return s()}};function kl(e,t){let n={method:`GET`,mode:`cors`,credentials:`same-origin`,signal:t,headers:new self.Headers(w({},e.headers))};return e.rangeEnd&&n.headers.set(`Range`,`bytes=`+e.rangeStart+`-`+String(e.rangeEnd-1)),n}function Al(e){let t=Dl.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function jl(e){let t=e.get(`Content-Range`);if(t){let e=Al(t);if(p(e))return e}let n=e.get(`Content-Length`);if(n)return parseInt(n)}function Ml(e,t){return new self.Request(e.url,t)}var Nl=class extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}};const Pl=/^age:\s*[\d.]+\s*$/im;var Fl=class{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new pe,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){let e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw Error(`Loader can only be used once.`);this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){let{config:e,context:t}=this;if(!e||!t)return;let n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;let i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(e=>{if(!(this.loader!==n||this.stats.aborted))return n.open(`GET`,t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(e=>{var i;(i=this.callbacks)==null||i.onError({code:n.status,text:e.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open(`GET`,t.url,!0);let r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:a}=n.loadPolicy;if(r)for(let t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader(`Range`,`bytes=`+t.rangeStart+`-`+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&p(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){let{context:e,loader:t,stats:n}=this;if(!e||!t)return;let r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;let r=t.status,s=t.responseType===`text`?t.responseText:null;if(r>=200&&r<300){let i=s??t.response;if(i!=null){var a;n.loading.end=Math.max(self.performance.now(),n.loading.first),n.loaded=n.total=t.responseType===`arraybuffer`?i.byteLength:i.length,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);let o=this.callbacks?.onProgress;o&&o(n,e,i,t);let s={url:t.responseURL,data:i,code:r};(a=this.callbacks)==null||a.onSuccess(s,n,e,t);return}}let c=i.loadPolicy.errorRetry,l=n.retry;if(pn(c,l,!1,{url:e.url,data:void 0,code:r}))this.retry(c);else{var o;P.error(`${r} while loading ${e.url}`),(o=this.callbacks)==null||o.onError({code:r,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;let e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(pn(e,t,!0))this.retry(e);else{P.warn(`timeout while loading ${this.context?.url}`);let e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){let{context:t,stats:n}=this;this.retryDelay=dn(e,n.retry),n.retry++,P.warn(`${status?`HTTP Status `+status:`Timeout`} while loading ${t?.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){let t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Pl.test(this.loader.getAllResponseHeaders())){let t=this.loader.getResponseHeader(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&RegExp(`^${e}:\\s*[\\d.]+\\s*$`,`im`).test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}};const Il=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:1/0,preferManagedMediaSource:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:`edge`,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Qt,bufferController:Co,capLevelController:Do,errorController:_n,fpsController:qs,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:ur,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ll()),{},{subtitleStreamController:xc,subtitleTrackController:tc,timelineController:yl,audioStreamController:po,audioTrackController:vo,emeController:Hs,cmcdController:Rs,contentSteeringController:zs,interstitialsController:bc});function Ll(){return{cueHandler:Tl,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:`English`,captionsTextTrack1LanguageCode:`en`,captionsTextTrack2Label:`Spanish`,captionsTextTrack2LanguageCode:`es`,captionsTextTrack3Label:`Unknown CC`,captionsTextTrack3LanguageCode:``,captionsTextTrack4Label:`Unknown CC`,captionsTextTrack4LanguageCode:``,renderTextTracksNatively:!0}}function Rl(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw Error(`Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration`);if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw Error(`Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"`);if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw Error(`Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"`);let r=zl(e),i=[`manifest`,`level`,`frag`],a=[`TimeOut`,`MaxRetry`,`RetryDelay`,`MaxRetryTimeout`];return i.forEach(e=>{let i=`${e===`level`?`playlist`:e}LoadPolicy`,o=t[i]===void 0,s=[];a.forEach(n=>{let a=`${e}Loading${n}`,c=t[a];if(c!==void 0&&o){s.push(a);let e=r[i].default;switch(t[i]={default:e},n){case`TimeOut`:e.maxLoadTimeMs=c,e.maxTimeToFirstByteMs=c;break;case`MaxRetry`:e.errorRetry.maxNumRetry=c,e.timeoutRetry.maxNumRetry=c;break;case`RetryDelay`:e.errorRetry.retryDelayMs=c,e.timeoutRetry.retryDelayMs=c;break;case`MaxRetryTimeout`:e.errorRetry.maxRetryDelayMs=c,e.timeoutRetry.maxRetryDelayMs=c}}}),s.length&&n.warn(`hls.js config: "${s.join(`", "`)}" setting(s) are deprecated, use "${i}": ${V(t[i])}`)}),E(E({},r),t)}function zl(e){return e&&typeof e==`object`?Array.isArray(e)?e.map(zl):Object.keys(e).reduce((t,n)=>(t[n]=zl(e[n]),t),{}):e}function Bl(e,t){let n=e.loader;n!==Ol&&n!==Fl?(t.log(`[config]: Custom loader detected, cannot enable progressive streaming`),e.progressive=!1):El()&&(e.loader=Ol,e.progressive=!0,e.enableSoftwareAES=!0,t.log(`[config]: Progressive streaming enabled, using FetchLoader`))}var Vl=class extends In{constructor(e,t){super(`gap-controller`,e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;(e=this.media)!=null&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{this.hls&&(this.ended=this.media?.currentTime||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(100),this.mediaSource=t.mediaSource;let n=this.media=t.media;J(n,`playing`,this.onMediaPlaying),J(n,`waiting`,this.onMediaWaiting),J(n,`ended`,this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();let{media:n}=this;n&&(Y(n,`playing`,this.onMediaPlaying),Y(n,`waiting`,this.onMediaWaiting),Y(n,`ended`,this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;let t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){let n=this.hls?.config;if(!n)return;let r=this.media;if(!r)return;let{seeking:i}=r,a=this.seeking&&!i,o=!this.seeking&&i,s=r.paused&&!i||r.ended||r.playbackRate===0;if(this.seeking=i,e!==t){t&&(this.ended=0),this.moved=!0,i||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!s&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(o||a){a&&this.stallResolved(e);return}if(s){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&r.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1}));return}if(!W.getBuffered(r).length){this.nudgeRetry=0;return}let c=W.bufferInfo(r,e,0),l=c.nextStart||0,u=this.fragmentTracker;if(i&&u&&this.hls){let t=Hl(this.hls.inFlightFragments,e),n=c.len>2,r=!l||t||l-e>2&&!u.getPartialFragment(e);if(n||r)return;this.moved=!1}let d=this.hls?.latestLevelDetails;if(!this.moved&&this.stalled!==null&&u){if(!(c.len>0)&&!l)return;let t=Math.max(l,c.start||0)-e,n=d!=null&&d.live?d.targetduration*2:2,i=Wl(e,u);if(t>0&&(t<=n||i)){r.paused||this._trySkipBufferHole(i);return}}let f=n.detectStallWithCurrentTimeMs,p=self.performance.now(),m=this.waiting,h=this.stalled;if(h===null){if(m>0&&p-m<f)h=this.stalled=m;else{this.stalled=p;return}}let g=p-h;if(!i&&(g>=f||m)&&this.hls){if(this.mediaSource?.readyState===`ended`&&!(d!=null&&d.live)&&Math.abs(e-(d?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(c),!this.media||!this.hls)return}let _=W.bufferInfo(r,e,n.maxBufferHole);this._tryFixBufferStall(_,g,e)}stallResolved(e){let t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){let n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(v.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;let r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){let n=W.bufferedInfo(W.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){let n=W.timeRangesToArray(r),i=W.bufferedInfo(n,t,0).bufferedIndex;if(i>-1&&i<n.length-1){let t=W.bufferedInfo(n,e,0).bufferedIndex,r=n[i].end,a=n[i+1].start;if((t===-1||t>i)&&a-r<1&&e-r<2){let n=/* @__PURE__ */ Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${r} -> ${a} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;let i=Wl(e,this.fragmentTracker);i&&`fragment`in i?i=i.fragment:i||=void 0;let o=W.bufferInfo(this.media,e,0);this.hls.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:i,buffer:o.len,bufferInfo:o})}}}}}_tryFixBufferStall(e,t,n){let{fragmentTracker:r,media:i}=this,a=this.hls?.config;if(!i||!r||!a)return;let o=this.hls?.latestLevelDetails,s=Wl(n,r);if((s||o!=null&&o.live&&n<o.fragmentStart)&&(this._trySkipBufferHole(s)||!this.media))return;let c=e.buffered,l=this.adjacentTraversal(e,n);(c&&c.length>1&&e.len>a.maxBufferHole||e.nextStart&&(e.nextStart-n<a.maxBufferHole||l))&&(t>a.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn(`Trying to nudge playhead over buffer-hole`),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){let n=this.fragmentTracker,r=e.nextStart;if(n&&r){let e=n.getFragAtPos(t,b.MAIN),i=n.getFragAtPos(r,b.MAIN);if(e&&i)return i.sn-e.sn<2}return!1}_reportStall(e){let{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;let r=/* @__PURE__ */ Error(`Playback stalling at @${n.currentTime} due to low buffer (${V(e)})`);this.warn(r.message),t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){let{fragmentTracker:t,media:n}=this,r=this.hls?.config;if(!n||!t||!r)return 0;let i=n.currentTime,a=W.bufferInfo(n,i,0),o=i<a.start?a.start:a.nextStart;if(o&&this.hls){let c=a.len<=r.maxBufferHole,l=a.len>0&&a.len<1&&n.readyState<3,u=o-i;if(u>0&&(c||l)){if(u>r.maxBufferHole){let n=!1;if(i===0){let e=t.getAppendedFrag(0,b.MAIN);e&&o<e.end&&(n=!0)}if(!n&&e){var s;if(!((s=this.hls.loadLevelObj)!=null&&s.details)||Hl(this.hls.inFlightFragments,o))return 0;let n=!1,r=e.end;for(;r<o;){let e=Wl(r,t);if(e)r+=e.duration;else{n=!0;break}}if(n)return 0}}let c=Math.max(o+.05,i+.1);if(this.warn(`skipping hole, adjusting currentTime from ${i} to ${c}`),this.moved=!0,n.currentTime=c,!(e!=null&&e.gap)){let t=/* @__PURE__ */ Error(`fragment loaded with buffer holes, seeking from ${i} to ${c}`),n={type:g.MEDIA_ERROR,details:_.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,buffer:a.len,bufferInfo:a};e&&(`fragment`in e?n.part=e:n.frag=e),this.hls.trigger(v.ERROR,n)}return c}}return 0}_tryNudgeBuffer(e){let{hls:t,media:n,nudgeRetry:r}=this,i=t?.config;if(!n||!i)return 0;let a=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){let o=a+(r+1)*i.nudgeOffset,s=/* @__PURE__ */ Error(`Nudging 'currentTime' from ${a} to ${o}`);this.warn(s.message),n.currentTime=o,t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_NUDGE_ON_STALL,error:s,fatal:!1,buffer:e.len,bufferInfo:e})}else{let n=/* @__PURE__ */ Error(`Playhead still not moving while enough data buffered @${a} after ${i.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}};function Hl(e,t){let n=Ul(e.main);if(n&&n.start<=t)return n;let r=Ul(e.audio);return r&&r.start<=t?r:null}function Ul(e){if(!e)return null;switch(e.state){case X.IDLE:case X.STOPPED:case X.ENDED:case X.ERROR:return null}return e.frag}function Wl(e,t){return t.getAppendedFrag(e,b.MAIN)||t.getPartialFragment(e)}function Gl(){if(typeof self<`u`)return self.VTTCue||self.TextTrackCue}function Kl(e,t,n,r,i){let a=new e(t,n,``);try{a.value=r,i&&(a.type=i)}catch{a=new e(t,n,V(i?E({type:i},r):r))}return a}const ql=(()=>{let e=Gl();try{e&&new e(0,1/0,``)}catch{return Number.MAX_VALUE}return 1/0})();var Jl=class{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(v.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){this.media=t.media,t.overrides?.cueRemoval===!1&&(this.removeCues=!1)}onMediaAttached(){let e=this.hls?.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&=(this.removeCues&&Xs(this.id3Track,this.onEventCueEnter),null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){let t=this.getID3Track(e.textTracks);return t.mode=`hidden`,t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){let n=e[t];if(n.kind===`metadata`&&n.label===`id3`)return Js(n,this.media),n}return this.media.addTextTrack(`metadata`,`id3`)}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;let{enableEmsgMetadataCues:n,enableID3MetadataCues:r}=this.hls.config;if(!n&&!r)return;let{samples:i}=t;this.id3Track||=this.createTrack(this.media);let a=Gl();if(a)for(let e=0;e<i.length;e++){let t=i[e].type;if(t===ea.emsg&&!n||!r)continue;let o=Xi(i[e].data),s=i[e].pts,c=s+i[e].duration;c>ql&&(c=ql),c-s<=0&&(c=s+.25);for(let e=0;e<o.length;e++){let n=o[e];if(!Zi(n)){this.updateId3CueEnds(s,t);let e=Kl(a,s,c,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){let n=this.id3Track?.cues;if(n)for(let r=n.length;r--;){let i=n[r];i.type===t&&i.startTime<e&&i.endTime===ql&&(i.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){let{id3Track:i,hls:a}=this;if(!a)return;let{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:s}}=a;if(i&&(o||s)){let e;e=r===`audio`?e=>e.type===ea.audioId3&&s:r===`video`?e=>e.type===ea.emsg&&o:e=>e.type===ea.audioId3&&s||e.type===ea.emsg&&o,Zs(i,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;let{assetPlayerId:n,timelineOffset:r,enableDateRangeMetadataCues:i,interstitialsController:a}=this.hls.config;if(!i)return;let o=Gl();if(n&&r&&!a){let{fragmentStart:t,fragmentEnd:r}=e,i=this.assetCue;i?(i.startTime=t,i.endTime=r):o&&(i=this.assetCue=Kl(o,t,r,{assetPlayerId:this.hls.config.assetPlayerId},`hlsjs.interstitial.asset`),i&&(i.id=n,this.id3Track||=this.createTrack(this.media),this.id3Track.addCue(i),i.addEventListener(`enter`,this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;let{id3Track:s}=this,{dateRanges:c}=e,l=Object.keys(c),u=this.dateRangeCuesAppended;if(s&&t){var d;if((d=s.cues)!=null&&d.length){let e=Object.keys(u).filter(e=>!l.includes(e));for(let t=e.length;t--;){let n=e[t],r=u[n]?.cues;delete u[n],r&&Object.keys(r).forEach(e=>{let t=r[e];if(t){t.removeEventListener(`enter`,this.onEventCueEnter);try{s.removeCue(t)}catch{}}})}}else u=this.dateRangeCuesAppended={}}let f=e.fragments[e.fragments.length-1];if(l.length!==0&&p(f?.programDateTime)){this.id3Track||=this.createTrack(this.media);for(let e=0;e<l.length;e++){let t=l[e],n=c[t],r=n.startTime,i=u[t],s=i?.cues||{},d=i?.durationKnown||!1,f=ql,{duration:p,endDate:m}=n;if(m&&p!==null)f=r+p,d=!0;else if(n.endOnNext&&!d){let e=l.reduce((e,t)=>{if(t!==n.id){let r=c[t];if(r.class===n.class&&r.startDate>n.startDate&&(!e||n.startDate<e.startDate))return r}return e},null);e&&(f=e.startTime,d=!0)}let h=Object.keys(n.attr);for(let e=0;e<h.length;e++){let c=h[e];if(!qn(c))continue;let l=s[c];if(l)d&&!(i!=null&&i.durationKnown)?l.endTime=f:Math.abs(l.startTime-r)>.01&&(l.startTime=r,l.endTime=f);else if(o){let e=n.attr[c];Jn(c)&&(e=se(e));let i=Kl(o,r,f,{key:c,data:e},ea.dateRange);i&&(i.id=t,this.id3Track.addCue(i),s[c]=i,a&&(c===`X-ASSET-LIST`||c===`X-ASSET-URL`)&&i.addEventListener(`enter`,this.onEventCueEnter))}}u[t]={cues:s,dateRange:n,durationKnown:d}}}}},Yl=class{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{let{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;let n=this.computeLatency();if(n===null)return;this._latency=n;let{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||i===1||!t.live)return;let a=this.targetLatency;if(a===null)return;let o=n-a;if(o<Math.min(this.maxLatency,a+t.targetduration)&&o>.05&&this.forwardBufferLength>1){let t=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20,r=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,r)}else e.playbackRate!==1&&e.playbackRate!==0&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){return this.hls?.latestLevelDetails||null}get latency(){return this._latency||0}get maxLatency(){let{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;let t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){let e=this.levelDetails;if(e===null||this.hls===null)return null;let{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,s=this.hls.userConfig,c=o&&n||t;(this._targetLatencyUpdated||s.liveSyncDuration||s.liveSyncDurationCount||c===0)&&(c=i===void 0?a*r:i);let l=r;return c+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,l)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){let e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;let n=this.levelDetails;if(n===null)return null;let r=n.edge,i=e-t-this.edgeStalled,a=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,i),o)}get drift(){let e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){let e=this.levelDetails;if(e===null)return 0;let t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){let{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;let n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.ERROR,this.onError,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener(`timeupdate`,this.onTimeupdate)}onMediaDetaching(){this.media&&=(this.media.removeEventListener(`timeupdate`,this.onTimeupdate),null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener(`timeupdate`,this.onTimeupdate)}onError(e,t){var n;t.details===_.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn(`[latency-controller]: Stall detected, adjusting target latency`))}changeMediaPlaybackRate(e,t){var n;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${this.targetLatency?.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){let e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){let e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}},Xl=class extends mo{constructor(e,t){super(e,`level-controller`),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){let{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this),e.on(v.ERROR,this.onError,this)}_unregisterListeners(){let{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this),e.off(v.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){let n=this.hls.config.preferManagedMediaSource,r=[],i={},a={},o=!1,s=!1,c=!1;t.levels.forEach(e=>{let t=e.attrs,{audioCodec:l,videoCodec:u}=e;l&&(e.audioCodec=l=ct(l,n)||void 0),u&&=e.videoCodec=ft(u);let{width:d,height:f,unknownCodecs:p}=e,m=p?.length||0;if(o||=!!(d&&f),s||=!!u,c||=!!l,m||l&&!this.isAudioSupported(l)||u&&!this.isVideoSupported(u)){this.log(`Some or all CODECS not supported "${t.CODECS}"`);return}let{CODECS:h,"FRAME-RATE":g,"HDCP-LEVEL":_,"PATHWAY-ID":v,RESOLUTION:y,"VIDEO-RANGE":b}=t,x=`${`${v||`.`}-`}${e.bitrate}-${y}-${g}-${h}-${b}-${_}`;if(!i[x]){let t=this.createLevel(e);i[x]=t,a[x]=1,r.push(t)}else if(i[x].uri!==e.url&&!e.attrs[`PATHWAY-ID`]){let t=a[x]+=1;e.attrs[`PATHWAY-ID`]=Array(t+1).join(`.`);let n=this.createLevel(e);i[x]=n,r.push(n)}else i[x].addGroupId(`audio`,t.AUDIO),i[x].addGroupId(`text`,t.SUBTITLES)}),this.filterAndSortMediaOptions(r,t,o,s,c)}createLevel(e){let t=new Pt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){let e=/* @__PURE__ */ Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=yt(e,[])}return t}isAudioSupported(e){return et(e,`audio`,this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return et(e,`video`,this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let a=[],o=[],s=e,c=t.stats?.parsing||{};if((n||r)&&i&&(s=s.filter(({videoCodec:e,videoRange:t,width:n,height:r})=>(!!e||!!(n&&r))&&At(t))),s.length===0){Promise.resolve().then(()=>{if(this.hls){let e=`no level with compatible codecs found in manifest`,n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${V(t.levels.map(e=>e.attrs.CODECS).filter((e,t,n)=>n.indexOf(e)===t))}`,this.warn(n),e+=` (${n})`);let r=Error(e);this.hls.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:r,reason:n})}}),c.end=performance.now();return}t.audioTracks&&(a=t.audioTracks.filter(e=>!e.audioCodec||this.isAudioSupported(e.audioCodec)),Zl(a)),t.subtitles&&(o=t.subtitles,Zl(o));let l=s.slice(0);s.sort((e,t)=>{if(e.attrs[`HDCP-LEVEL`]!==t.attrs[`HDCP-LEVEL`])return(e.attrs[`HDCP-LEVEL`]||``)>(t.attrs[`HDCP-LEVEL`]||``)?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return kt.indexOf(e.videoRange)-kt.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){let n=rt(e.videoCodec),r=rt(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){let n=it(e.codecSet),r=it(t.codecSet);if(n!==r)return r-n}return e.averageBitrate===t.averageBitrate?0:e.averageBitrate-t.averageBitrate});let u=l[0];if(this.steering&&(s=this.steering.filterParsedLevels(s),s.length!==l.length)){for(let e=0;e<l.length;e++)if(l[e].pathwayId===s[0].pathwayId){u=l[e];break}}this._levels=s;for(let e=0;e<s.length;e++)if(s[e]===u){this._firstLevel=e;let t=u.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${s.length} level(s) found, first bitrate: ${t}`),this.hls.userConfig?.abrEwmaDefaultEstimate===void 0){let e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}let d=i&&!r,f=this.hls.config,p=!!(f.audioStreamController&&f.audioTrackController),m={levels:s,audioTracks:a,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:p&&!d&&a.some(e=>!!e.url)};c.end=performance.now(),this.hls.trigger(v.MANIFEST_PARSED,m)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){let t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){let n=/* @__PURE__ */ Error(`invalid level idx`),r=e<0;if(this.hls.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}let n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs[`PATHWAY-ID`]:void 0,a=t[e],o=a.attrs[`PATHWAY-ID`];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&r&&i===o)return;this.log(`Switching to level ${e} (${a.height?a.height+`p `:``}${a.videoRange?a.videoRange+` `:``}${a.codecSet?a.codecSet+` `:``}@${a.bitrate})${o?` with Pathway `+o:``} from level ${n}${i?` with Pathway `+i:``}`);let s={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(v.LEVEL_SWITCHING,s);let c=a.details;if(!c||c.live){let e=this.switchParams(a.uri,r?.details,c);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){let e=this.hls.config.startLevel;return e===void 0?this.hls.firstAutoLevel:e}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){let t=this.steering.pathways(),n=e.filter(e=>t.indexOf(e)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){!t.fatal&&t.context&&t.context.type===y.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===b.MAIN){let e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return;let n=this._levels[t.level];n!=null&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;let{level:r,details:i}=t,a=t.levelInfo;if(!a){var o;this.warn(`Invalid level index ${r}`),(o=t.deliveryDirectives)!=null&&o.skip&&(i.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let e=a.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(r,t,e)}else(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);let n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs[`PATHWAY-ID`],a=e.details,o=a?.age;this.log(`Loading level index ${r}${t?.msn===void 0?``:` at sn `+t.msn+` part `+t.part}${i?` Pathway `+i:``}${o&&a.live?` age `+o.toFixed(1)+(a.type&&` `+a.type||``):``} ${n}`),this.hls.trigger(v.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs[`PATHWAY-ID`],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex===-1?this.hls.nextAutoLevel:this.manualLevelIndex}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;let n=this._levels.filter((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach(e=>e.level=-1)),!1));Zr(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);let r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&=Math.min(this._startLevel,r),this.hls.trigger(v.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){let{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(v.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}};function Zl(e){let t={};e.forEach(e=>{let n=e.groupId||``;e.id=t[n]=t[n]||0,t[n]++})}function Ql(){return self.SourceBuffer||self.WebKitSourceBuffer}function $l(){if(!re())return!1;let e=Ql();return!e||e.prototype&&typeof e.prototype.appendBuffer==`function`&&typeof e.prototype.remove==`function`}function eu(){if(!$l())return!1;let e=re();return typeof e?.isTypeSupported==`function`&&([`avc1.42E01E,mp4a.40.2`,`av01.0.01M.08`,`vp09.00.50.08`].some(t=>e.isTypeSupported(nt(t,`video`)))||[`mp4a.40.2`,`fLaC`].some(t=>e.isTypeSupported(nt(t,`audio`))))}function tu(){var e;let t=Ql();return typeof(t==null||(e=t.prototype)==null?void 0:e.changeType)==`function`}var nu=class extends ci{constructor(e,t,n){super(e,t,n,`stream-controller`,b.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{let e=this.media,t=e?e.currentTime:null;if(t===null||!p(t)||(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t)))return;let n=this.getFwdBufferInfoAtPos(e,t,b.MAIN,0);if(n===null||n.len===0){this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:`empty`})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();let{hls:e}=this;e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(v.BUFFER_CREATED,this.onBufferCreated,this),e.on(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();let{hls:e}=this;e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(v.BUFFER_CREATED,this.onBufferCreated,this),e.off(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){let{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=r.startLevel;e===-1&&(r.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=r.firstAutoLevel),r.nextLoadLevel=e,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=X.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=X.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case X.WAITING_LEVEL:{let{levels:e,level:t}=this,n=e?.[t],r=n?.details;if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=X.IDLE;break}if(this.hls.nextLoadLevel!==this.level){this.state=X.IDLE;break}break}case X.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate()}this.state===X.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){let{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;let i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;let a=n[i],o=this.getMainFwdBufferInfo();if(o===null)return;let s=this.getLevelDetails();if(s&&this._streamEnded(o,s)){let e={};this.altAudio===2&&(e.type=`video`),this.hls.trigger(v.BUFFER_EOS,e),this.state=X.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;let c=a.details;if(!c||this.state===X.WAITING_LEVEL||this.waitForLive(a)){this.level=i,this.state=X.WAITING_LEVEL,this.startFragRequested=!1;return}let l=o.len,u=this.getMaxBufferLength(a.maxBitrate);if(l>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);let d=this.backtrackFragment?this.backtrackFragment.start:o.end,f=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&f&&L(f)&&this.fragmentTracker.getState(f)!==U.OK){let e=(this.backtrackFragment??f).sn-c.startSN,t=c.fragments[e-1];t&&f.cc===t.cc&&(f=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,d)){if(!f.gap){let e=this.audioOnly&&!this.altAudio?I.AUDIO:I.VIDEO,t=(e===I.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,b.MAIN)}f=this.getNextFragmentLoopLoading(f,c,o,b.MAIN,u)}f&&(this.exceedsMaxBuffer(o,u,f)||(f.initSegment&&!f.initSegment.data&&!this.bitrateTest&&(f=f.initSegment),this.loadFragment(f,a,d)))}loadFragment(e,t,n){let r=this.fragmentTracker.getState(e);r===U.NOT_LOADED||r===U.PARTIAL?L(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,b.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,1/0),this.altAudio!==0&&(this.getLevelDetails()?.fragmentStart||0)>this.lastCurrentTime&&super.flushMainBuffer(0,1/0,`audio`)}nextLevelSwitch(){let{levels:e,media:t}=this;if(t!=null&&t.readyState){let n,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);let i=this.getLevelDetails();if(i!=null&&i.live){let e=this.getMainFwdBufferInfo();if(!e||e.len<i.targetduration*2)return}if(!t.paused&&e){let t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;let a=this.getBufferedFrag(t.currentTime+n);if(a){let e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();let t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,1/0)}}}}abortCurrentFrag(){let e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case X.KEY_LOADING:case X.FRAG_LOADING:case X.FRAG_LOADING_WAITING_RETRY:case X.PARSING:case X.PARSED:this.state=X.IDLE}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?`video`:null)}onMediaAttached(e,t){super.onMediaAttached(e,t);let n=t.media;J(n,`playing`,this.onMediaPlaying),J(n,`seeked`,this.onMediaSeeked)}onMediaDetaching(e,t){let{media:n}=this;n&&(Y(n,`playing`,this.onMediaPlaying),Y(n,`seeked`,this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log(`Trigger BUFFER_RESET`),this.hls.trigger(v.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;for(let e=0;e<t.levels.length;e++){let i=t.levels[e].audioCodec;i&&(n||=i.indexOf(`mp4a.40.2`)!==-1,r||=i.indexOf(`mp4a.40.5`)!==-1)}this.audioCodecSwitch=n&&r&&!tu(),this.audioCodecSwitch&&this.log(`Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC`),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){let{levels:n}=this;if(!n||this.state!==X.IDLE)return;let r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=X.WAITING_LEVEL)}onLevelLoaded(e,t){var n;let{levels:r,startFragRequested:i}=this,a=t.level,o=t.details,s=o.totalduration;if(!r){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:``}, cc [${o.startCC}, ${o.endCC}] duration:${s}`);let c=t.levelInfo,l=this.fragCurrent;l&&(this.state===X.FRAG_LOADING||this.state===X.FRAG_LOADING_WAITING_RETRY)&&l.level!==t.level&&l.loader&&this.abortCurrentFrag();let u=0;if(o.live||(n=c.details)!=null&&n.live){if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;u=this.alignPlaylists(o,c.details,this.levelLastLoaded?.details)}if(c.details=o,this.levelLastLoaded=c,i||this.setStartPosition(o,u),this.hls.trigger(v.LEVEL_UPDATED,{details:o,level:a}),this.state===X.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=X.IDLE}i&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){let{config:t,media:n}=this;if(!n)return;let r=this.hls.liveSyncPosition,i=this.getLoadPosition(),a=e.fragmentStart,o=e.edge,s=i>=a-t.maxFragLookUpTolerance&&i<=o;if(r!==null&&n.duration>r&&(i<r||!s)){let a=t.liveMaxLatencyDuration===void 0?t.liveMaxLatencyDurationCount*e.targetduration:t.liveMaxLatencyDuration;if((!s&&n.readyState<4||i<o-a)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState)){if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode===`buffered`){var c;let e=W.bufferInfo(n,r,0);if(!((c=e.buffered)!=null&&c.length)){n.currentTime=r;return}if(e.start<=i){n.currentTime=r;return}let{nextStart:t}=W.bufferedInfo(e.buffered,i,0);t&&(n.currentTime=t)}else n.currentTime=r}}}_handleFragmentLoadProgress(e){let t=e.frag,{part:n,payload:r}=e,{levels:i}=this;if(!i){this.warn(`Levels were reset while fragment load was in progress. Fragment ${t.sn} of level ${t.level} will not be buffered`);return}let a=i[t.level];if(!a){this.warn(`Level ${t.level} not found on progress`);return}let o=a.details;if(!o){this.warn(`Dropping fragment ${t.sn} of level ${t.level} after level details were reset`),this.fragmentTracker.removeFragment(t);return}let s=a.videoCodec,c=o.PTSKnown||!o.live,l=t.initSegment?.data,u=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new fo(this.hls,b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=n?n.index:-1,p=f!==-1,m=new Ln(t.level,t.sn,t.stats.chunkCount,r.byteLength,f,p),h=this.initPTS[t.cc];d.push(r,l,u,s,t,n,o.totalduration,c,m,h)}onAudioTrackSwitching(e,t){let n=this.hls,r=this.altAudio!==0;if(Zt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log(`Switching on main audio, use media.buffered to schedule main fragment loading`),this.mediaBuffer=this.media;let e=this.fragCurrent;e&&(this.log(`Switching to main audio track, cancel main fragment load`),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(v.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(v.AUDIO_TRACK_SWITCHED,t)}),n.trigger(v.BUFFER_FLUSHING,{startOffset:0,endOffset:1/0,type:null});return}n.trigger(v.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){let n=Zt(t.url,this.hls);if(n){let e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log(`Switching on alternate audio, use video.buffered to schedule main fragment loading`),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){let n=t.tracks,r,i,a=!1;for(let e in n){let t=n[e];if(t.id===`main`){if(i=e,r=t,e===`video`){let t=n[e];t&&(this.videoBuffer=t.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){let{frag:n,part:r}=t,i=n.type===b.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?` p: `+r.index:``} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===X.PARSED&&(this.state=X.IDLE);return}let e=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),L(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}let a=this.media;a&&(!this._hasEnoughToStart&&W.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){if(t.fatal){this.state=X.ERROR;return}switch(t.details){case _.FRAG_GAP:case _.FRAG_PARSING_ERROR:case _.FRAG_DECRYPT_ERROR:case _.FRAG_LOAD_ERROR:case _.FRAG_LOAD_TIMEOUT:case _.KEY_LOAD_ERROR:case _.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.MAIN,t);break;case _.LEVEL_LOAD_ERROR:case _.LEVEL_LOAD_TIMEOUT:case _.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===X.WAITING_LEVEL&&t.context?.type===y.LEVEL&&(this.state=X.IDLE);break;case _.BUFFER_ADD_CODEC_ERROR:case _.BUFFER_APPEND_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case _.BUFFER_FULL_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,1/0));break;case _.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=X.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==I.AUDIO||!this.altAudio){let e=(t===I.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,b.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){let{media:e}=this;if(!e)return;let t=e.currentTime,n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}let r=this.timelineOffset;r&&n&&(n+=r);let i=this.getLevelDetails(),a=W.getBuffered(e),o=a.length?a.start(0):0,s=o-n,c=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||s>0&&(s<c||this.loadingParts&&s<2*(i?.partTarget||0)))&&(this.log(`adjusting start position by ${s} to match buffer start`),n+=s,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log(`Swapping audio codec`),t=t.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(e=>{let{hls:n}=this,r=e?.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=X.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;let i=r.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),n.trigger(v.FRAG_LOADED,e),r.bitrateTest=!1}).catch(t=>{this.state!==X.STOPPED&&this.state!==X.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){let t=this.playlistType,{hls:n}=this,{remuxResult:r,chunkMeta:i}=e,a=this.getCurrentContext(i);if(!a){this.resetWhenMissingContext(i);return}let{frag:o,part:s,level:c}=a,{video:l,text:u,id3:d,initSegment:f}=r,{details:m}=c,h=this.altAudio?void 0:r.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=X.PARSING,f){let e=f.tracks;if(e){let r=o.initSegment||o;if(this.unhandledEncryptionError(f,o))return;this._bufferInitSegment(c,e,r,i),n.trigger(v.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:t,tracks:e})}let r=f.initPTS,a=f.timescale,s=this.initPTS[o.cc];if(p(r)&&(!s||s.baseTime!==r||s.timescale!==a)){let e=f.trackId;this.initPTS[o.cc]={baseTime:r,timescale:a,trackId:e},n.trigger(v.INIT_PTS_FOUND,{frag:o,id:t,initPTS:r,timescale:a,trackId:e})}}if(l&&m){h&&l.type===`audiovideo`&&this.logMuxedErr(o);let e=m.fragments[o.sn-1-m.startSN],t=o.sn===m.startSN,n=!e||o.cc>e.cc;if(r.independent!==!1){let{startPTS:e,endPTS:r,startDTS:a,endDTS:c}=l;if(s)s.elementaryStreams[l.type]={startPTS:e,endPTS:r,startDTS:a,endDTS:c};else if(l.firstKeyFrame&&l.independent&&i.id===1&&!n&&(this.couldBacktrack=!0),l.dropped&&l.independent){let i=this.getMainFwdBufferInfo(),a=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,s=l.firstKeyFramePTS?l.firstKeyFramePTS:e;if(!t&&a<s-this.config.maxBufferHole&&!n){this.backtrack(o);return}n&&(o.gap=!0),o.setElementaryStreamInfo(l.type,o.start,r,o.start,c,!0)}else t&&e-(m.appliedTimelineOffset||0)>2&&(o.gap=!0);o.setElementaryStreamInfo(l.type,e,r,a,c),this.backtrackFragment&&=o,this.bufferFragmentData(l,o,s,i,t||n)}else if(t||n)o.gap=!0;else{this.backtrack(o);return}}if(h){let{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=h;s&&(s.elementaryStreams[I.AUDIO]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(I.AUDIO,e,t,n,r),this.bufferFragmentData(h,o,s,i)}if(m&&d!=null&&d.samples.length){let e={id:t,frag:o,details:m,samples:d.samples};n.trigger(v.FRAG_PARSING_METADATA,e)}if(m&&u){let e={id:t,frag:o,details:m,samples:u.samples};n.trigger(v.FRAG_PARSING_USERDATA,e)}}logMuxedErr(e){this.warn(`${L(e)?`Media`:`Init`} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==X.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));let{audio:i,video:a,audiovideo:o}=t;if(i){let n=e.audioCodec,r=ut(i.codec,n);r===`mp4a`&&(r=`mp4a.40.5`);let a=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&=r.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`;let e=i.metadata;e&&`channelCount`in e&&(e.channelCount||1)!==1&&a.indexOf(`firefox`)===-1&&(r=`mp4a.40.5`)}r&&r.indexOf(`mp4a.40.5`)!==-1&&a.indexOf(`android`)!==-1&&i.container!==`audio/mpeg`&&(r=`mp4a.40.2`,this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),i.levelCodec=r,i.id=b.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${r||``}/${n||``}/${i.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=b.MAIN;let n=a.codec;if(n?.length===4)switch(n){case`hvc1`:case`hev1`:a.codec=`hvc1.1.6.L120.90`;break;case`av01`:a.codec=`av01.0.04M.08`;break;case`avc1`:a.codec=`avc1.42e01e`}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||``}/${n}]${a.codec===n?``:` parsed-corrected=`+a.codec}${a.supplemental?` supplemental=`+a.supplemental:``}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);let s=Object.keys(t);if(s.length){if(this.hls.trigger(v.BUFFER_CODECS,t),!this.hls)return;s.forEach(e=>{let i=t[e].initSegment;i!=null&&i.byteLength&&this.hls.trigger(v.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){let e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,b.MAIN)}get maxBufferLength(){let{levels:e,level:t}=this,n=e?.[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=X.IDLE}checkFragmentChanged(){let e=this.media,t=null;if(e&&e.readyState>1&&e.seeking===!1){let n=e.currentTime;if(W.isBuffered(e,n)?t=this.getAppendedFrag(n):W.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;let e=this.fragPlaying,n=t.level;(!e||t.sn!==e.sn||e.level!==n)&&(this.fragPlaying=t,this.hls.trigger(v.FRAG_CHANGED,{frag:t}),(!e||e.level!==n)&&this.hls.trigger(v.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){let e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){if(this.fragPlaying)return this.fragPlaying;let e=this.media?.currentTime||this.lastCurrentTime;return p(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){let e=this.media?.currentTime||this.lastCurrentTime;if(p(e)){let t=this.getLevelDetails(),n=this.currentFrag||(t?tn(null,t.fragments,e):null);if(n){let t=n.programDateTime;if(t!==null){let r=t+(e-n.start)*1e3;return new Date(r)}}}return null}get currentLevel(){let e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){let e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}},ru=class extends k{constructor(e,t){super(`key-loader`,t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(let t in this.keyIdToKeyInfo){let n=this.keyIdToKeyInfo[t].loader;if(n){if(e&&e!==n.context?.frag.type)return;n.abort()}}}detach(){for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=_.KEY_LOAD_ERROR,n,r,i){return new Fn({type:g.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,i=t.length;r<i;r++){let a=t[r];if(e.cc<=a.cc&&(!L(e)||!L(a)||e.sn<a.sn)||!n&&r==i-1)return this.emeController.selectKeySystemFormat(a).then(e=>{if(!this.emeController)return;a.setKeyFormat(e);let t=sr(e);if(t)return this.emeController.getKeySystemAccess([t])})}if(this.config.requireKeySystemAccessOnStart){let e=lr(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);let i=e.decryptdata;if(!i){let n=/* @__PURE__ */ Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,n))}let a=i.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`Invalid key URI: "${a}"`)));let o=iu(i),s=this.keyIdToKeyInfo[o];if((n=s)!=null&&n.decryptdata.key)return i.key=s.decryptdata.key,Promise.resolve({frag:e,keyInfo:s});if(this.emeController&&(r=s)!=null&&r.keyLoadPromise)switch(this.emeController.getKeyStatus(s.decryptdata)){case`usable`:case`usable-in-future`:return s.keyLoadPromise.then(t=>{let{keyInfo:n}=t;return i.key=n.decryptdata.key,{frag:e,keyInfo:n}})}switch(this.log(`${this.keyIdToKeyInfo[o]?`Rel`:`L`}oading${i.keyId?` keyId: `+F(i.keyId):``} URI: ${i.uri} from ${e.type} ${e.level}`),s=this.keyIdToKeyInfo[o]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case`SAMPLE-AES`:case`SAMPLE-AES-CENC`:case`SAMPLE-AES-CTR`:return i.keyFormat===`identity`?this.loadKeyHTTP(s,e):this.loadKeyEME(s,e);case`AES-128`:case`AES-256`:case`AES-256-CTR`:return this.loadKeyHTTP(s,e);default:return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){let n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&(r=t.initSegment)!=null&&r.data){let n=Fe(t.initSegment.data);if(n.length){let t=n[0];t.some(e=>e!==0)?(this.log(`Using keyId found in init segment ${F(t)}`),gr.setKeyIdForUri(e.decryptdata.uri,t)):(t=gr.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${F(t)}`)),e.decryptdata.keyId=t}}return!e.decryptdata.keyId&&!L(t)?Promise.resolve(n):(e.keyLoadPromise=this.emeController.loadKey(n).then(t=>(e.mediaKeySessionContext=t,n))).catch(n=>{throw e.keyLoadPromise=null,`data`in n&&(n.data.frag=t),n})}return Promise.resolve(n)}loadKeyHTTP(e,t){let n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((r,a)=>{let o={keyInfo:e,frag:t,responseType:`arraybuffer`,url:e.decryptdata.uri},s=n.keyLoadPolicy.default,c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};i.load(o,c,{onSuccess:(e,t,n,i)=>{let{frag:o,keyInfo:s}=n,c=iu(s.decryptdata);if(!o.decryptdata||s!==this.keyIdToKeyInfo[c])return a(this.createKeyLoadError(o,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`after key load, decryptdata unset or changed`),i));s.decryptdata.key=o.decryptdata.key=new Uint8Array(e.data),o.keyLoader=null,s.loader=null,r({frag:o,keyInfo:s})},onError:(e,n,r,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`HTTP Error ${e.code} loading key ${e.text}`),r,E({url:o.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.KEY_LOAD_TIMEOUT,/* @__PURE__ */ Error(`key loading timed out`),r))},onAbort:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.INTERNAL_ABORTED,/* @__PURE__ */ Error(`key loading aborted`),r))}})})}resetLoader(e){let{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null);let a=iu(n.decryptdata)||r;delete this.keyIdToKeyInfo[a],i&&i.destroy()}};function iu(e){if(e.keyFormat!==q.FAIRPLAY){let t=e.keyId;if(t)return F(t)}return e.uri}function au(e){let{type:t}=e;switch(t){case y.AUDIO_TRACK:return b.AUDIO;case y.SUBTITLE_TRACK:return b.SUBTITLE;default:return b.MAIN}}function ou(e,t){let n=e.url;return(n===void 0||n.indexOf(`data:`)===0)&&(n=t.url),n}var su=class{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){let{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){let{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_LOADING,this.onLevelLoading,this),e.off(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){let t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(let e in this.loaders){let t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){let{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:`text`,type:y.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){let{id:n,level:r,pathwayId:i,url:a,deliveryDirectives:o,levelInfo:s}=t;this.load({id:n,level:r,pathwayId:i,responseType:`text`,type:y.LEVEL,url:a,deliveryDirectives:o,levelOrTrack:s})}onAudioTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:a,track:o}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:y.AUDIO_TRACK,url:i,deliveryDirectives:a,levelOrTrack:o})}onSubtitleTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:a,track:o}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:y.SUBTITLE_TRACK,url:i,deliveryDirectives:a,levelOrTrack:o})}onLevelsUpdated(e,t){let n=this.loaders[y.LEVEL];if(n){let e=n.context;e&&!t.levels.some(t=>t===e.levelOrTrack)&&(n.abort(),delete this.loaders[y.LEVEL])}}load(e){let t=this.hls.config,n=this.getInternalLoader(e);if(n){let t=this.hls.logger,r=n.context;if(r&&r.levelOrTrack===e.levelOrTrack&&(r.url===e.url||r.deliveryDirectives&&!e.deliveryDirectives)){r.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${r.url}`);return}t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let r;if(r=e.type===y.MANIFEST?t.manifestLoadPolicy.default:w({},t.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),p(e.deliveryDirectives?.part)){let t;if(e.type===y.LEVEL&&e.level!==null?t=this.hls.levels[e.level].details:e.type===y.AUDIO_TRACK&&e.id!==null?t=this.hls.audioTracks[e.id].details:e.type===y.SUBTITLE_TRACK&&e.id!==null&&(t=this.hls.subtitleTracks[e.id].details),t){let e=t.partTarget,n=t.targetduration;if(e&&n){let t=Math.max(e*3,n*.8)*1e3;r=w({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}let i=r.errorRetry||r.timeoutRetry||{},a={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:i.maxNumRetry||0,retryDelay:i.retryDelayMs||0,maxRetryDelay:i.maxRetryDelayMs||0};n.load(e,a,{onSuccess:(e,t,n,r)=>{let i=this.getInternalLoader(n);this.resetInternalLoader(n.type);let a=e.data;t.parsing.start=performance.now(),Tr.isMediaPlaylist(a)||n.type!==y.MANIFEST?this.handleTrackOrLevelPlaylist(e,t,n,r||null,i):this.handleMasterPlaylist(e,t,n,r)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}})}checkAutostartLoad(){if(!this.hls)return;let{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?`auto`:`force`} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){let i=this.hls,a=e.data,o=ou(e,n),s=Tr.parseMasterPlaylist(a,o);if(s.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,n,s.playlistParsingError,r,t);return}let{contentSteering:c,levels:l,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:p}=s;this.variableList=p,l.forEach(e=>{let{unknownCodecs:t}=e;if(t){let{preferManagedMediaSource:n}=this.hls.config,{audioCodec:r,videoCodec:i}=e;for(let a=t.length;a--;){let o=t[a];et(o,`audio`,n)?(e.audioCodec=r=r?`${r},${o}`:o,Qe.audio[r.substring(0,4)]=2,t.splice(a,1)):et(o,`video`,n)&&(e.videoCodec=i=i?`${i},${o}`:o,Qe.video[i.substring(0,4)]=2,t.splice(a,1))}}});let{AUDIO:m=[],SUBTITLES:h,"CLOSED-CAPTIONS":g}=Tr.parseMasterPlaylistMedia(a,o,s);m.length&&!m.some(e=>!e.url)&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(this.hls.logger.log(`[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one`),m.unshift({type:`main`,name:`main`,groupId:`main`,default:!1,autoselect:!1,forced:!1,id:-1,attrs:new G({}),bitrate:0,url:``})),i.trigger(v.MANIFEST_LOADED,{levels:l,audioTracks:m,subtitles:h,captions:g,contentSteering:c,url:o,stats:t,networkDetails:r,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,r,i){let a=this.hls,{id:o,level:s,type:c}=n,l=ou(e,n),u=p(s)?s:p(o)?o:0,d=au(n),f=Tr.parseLevelPlaylist(e.data,l,u,d,0,this.variableList);if(c===y.MANIFEST){let e={attrs:new G({}),bitrate:0,details:f,name:``,url:l};f.requestScheduled=t.loading.start+qr(f,0),a.trigger(v.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:l,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=f,this.handlePlaylistLoaded(f,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.MANIFEST_PARSING_ERROR,fatal:t.type===y.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let a=`A network ${n?`timeout`:`error`+(r?` (status `+r.code+`)`:``)} occurred while loading ${e.type}`;e.type===y.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===y.AUDIO_TRACK||e.type===y.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);let o=Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let s=_.UNKNOWN,c=!1,l=this.getInternalLoader(e);switch(e.type){case y.MANIFEST:s=n?_.MANIFEST_LOAD_TIMEOUT:_.MANIFEST_LOAD_ERROR,c=!0;break;case y.LEVEL:s=n?_.LEVEL_LOAD_TIMEOUT:_.LEVEL_LOAD_ERROR,c=!1;break;case y.AUDIO_TRACK:s=n?_.AUDIO_TRACK_LOAD_TIMEOUT:_.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case y.SUBTITLE_TRACK:s=n?_.SUBTITLE_TRACK_LOAD_TIMEOUT:_.SUBTITLE_LOAD_ERROR,c=!1}l&&this.resetInternalLoader(e.type);let u={type:g.NETWORK_ERROR,details:s,fatal:c,url:e.url,loader:l,context:e,error:o,networkDetails:t,stats:i};r&&(u.response=E({url:t?.url||e.url,data:void 0},r)),this.hls.trigger(v.ERROR,u)}handlePlaylistLoaded(e,t,n,r,i,a){let o=this.hls,{type:s,level:c,levelOrTrack:l,id:u,groupId:d,deliveryDirectives:f}=r,p=ou(t,r),m=au(r),h=typeof r.level==`number`&&m===b.MAIN?c:void 0,x=e.playlistParsingError;if(x){if(this.hls.logger.warn(`${x} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:x,reason:x.message,response:t,context:r,level:h,parent:m,networkDetails:i,stats:n});return}e.playlistParsingError=null}if(!e.fragments.length){let a=e.playlistParsingError=/* @__PURE__ */ Error(`No Segments found in Playlist`);o.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:a,reason:a.message,response:t,context:r,level:h,parent:m,networkDetails:i,stats:n});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),s){case y.MANIFEST:case y.LEVEL:if(h){if(!l)h=0;else if(l!==o.levels[h]){let e=o.levels.indexOf(l);e>-1&&(h=e)}}o.trigger(v.LEVEL_LOADED,{details:e,levelInfo:l||o.levels[0],level:h||0,id:u||0,stats:n,networkDetails:i,deliveryDirectives:f,withoutMultiVariant:s===y.MANIFEST});break;case y.AUDIO_TRACK:o.trigger(v.AUDIO_TRACK_LOADED,{details:e,track:l,id:u||0,groupId:d||``,stats:n,networkDetails:i,deliveryDirectives:f});break;case y.SUBTITLE_TRACK:o.trigger(v.SUBTITLE_TRACK_LOADED,{details:e,track:l,id:u||0,groupId:d||``,stats:n,networkDetails:i,deliveryDirectives:f})}}},$=class e{static get version(){return gi}static isMSESupported(){return $l()}static isSupported(){return eu()}static getMediaSource(){return re()}static get Events(){return v}static get MetadataSchema(){return ea}static get ErrorTypes(){return g}static get ErrorDetails(){return _}static get DefaultConfig(){return e.defaultConfig?e.defaultConfig:Il}static set DefaultConfig(t){e.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new hi,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;let n=this.logger=ne(t.debug||!1,`Hls instance`,t.assetPlayerId),r=this.config=Rl(e.DefaultConfig,t,n);this.userConfig=t,r.progressive&&Bl(r,n);let{abrController:i,bufferController:a,capLevelController:o,errorController:s,fpsController:c}=r,l=new s(this),u=this.abrController=new i(this),d=new yn(this),f=r.interstitialsController,p=f?this.interstitialsController=new f(this,e):null,m=this.bufferController=new a(this,d),h=this.capLevelController=new o(this),g=new c(this),_=new su(this),y=r.contentSteeringController,b=y?new y(this):null,x=this.levelController=new Xl(this,b),S=new Jl(this),C=new ru(this.config,this.logger),w=this.streamController=new nu(this,d,C),T=this.gapController=new Vl(this,d);h.setStreamController(w),g.setStreamController(w);let E=[_,x,w];p&&E.splice(1,0,p),b&&E.splice(1,0,b),this.networkControllers=E;let D=[u,m,T,h,g,S,d];this.audioTrackController=this.createController(r.audioTrackController,E);let O=r.audioStreamController;O&&E.push(this.audioStreamController=new O(this,d,C)),this.subtitleTrackController=this.createController(r.subtitleTrackController,E);let k=r.subtitleStreamController;k&&E.push(this.subtititleStreamController=new k(this,d,C)),this.createController(r.timelineController,D),C.emeController=this.emeController=this.createController(r.emeController,D),this.cmcdController=this.createController(r.cmcdController,D),this.latencyController=this.createController(Yl,D),this.coreComponents=D,E.push(l);let A=l.onErrorOut;typeof A==`function`&&this.on(v.ERROR,A,l),this.on(v.MANIFEST_LOADED,_.onManifestLoaded,_)}createController(e,t){if(e){let n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error(`An internal error happened while handling event `+e+`. Error message: "`+t.message+`". Here is a stacktrace:`,t),!this.triggeringException){this.triggeringException=!0;let n=e===v.ERROR;this.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log(`destroy`),this.trigger(v.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;let e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||`media`in e&&!e.media){let t=/* @__PURE__ */ Error(`attachMedia failed: invalid argument (${e})`);this.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.ATTACH_MEDIA_ERROR,fatal:!0,error:t});return}this.logger.log(`attachMedia`),this._media&&(this.logger.warn(`media must be detached before attaching`),this.detachMedia());let t=`media`in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(v.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log(`detachMedia`),this.trigger(v.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;let e=this.bufferController.transferMedia();return this.trigger(v.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();let t=this.media,n=this._url,r=this._url=fe.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(v.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?`, <skip seek to start>`:``)})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log(`stopLoad`),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log(`resume buffering`),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log(`pause buffering`),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){let e={[b.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[b.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[b.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log(`swapAudioCodec`),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log(`recoverMediaError`);let e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||=this._sessionId=nc(),e}get levels(){return this.levelController.levels||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){let e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){let t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){let{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Ot(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){let{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;let n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){let{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this,r;if(r=t===-1&&e!=null&&e.length?e.length-1:t,n)for(let t=r;t--;){let r=e[t].attrs[`HDCP-LEVEL`];if(r&&r<=n)return t}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){return this.audioTrackController?.setAudioOption(e)||null}setSubtitleOption(e){return this.subtitleTrackController?.setSubtitleOption(e)||null}get allAudioTracks(){let e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){let e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){let e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){let t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){let e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){let e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){let e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){let t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){let e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){let t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){return this.interstitialsController?.interstitialsManager||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return xt(e,Vt(t),navigator.mediaCapabilities)}};$.defaultConfig=void 0;function cu(e){class t extends e{#e=null;#t=null;#n=!1;constructor(...e){super(...e),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#r()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#o()),this.engine?.on($.Events.DESTROYING,()=>this.#o()),this.engine?.on($.Events.MANIFEST_LOADING,(e,t)=>{this.#e&&(this.#e.src=t.url)})}get disableRemotePlayback(){return super.disableRemotePlayback}set disableRemotePlayback(e){let t=e!==this.#n;this.#n=e,super.disableRemotePlayback=e,t&&this.#e&&this.#r()}#r(){this.#o();let e=this.target;e&&i(e)&&(this.#n||(e.disableRemotePlayback=!1),this.#i(e),this.#a(e))}#i(e){this.#e=document.createElement(`source`),this.#e.type=`application/x-mpegURL`,this.#e.src=this.engine?.url??``,e.append(this.#e)}#a(e){let t=()=>{e.webkitCurrentPlaybackTargetIsWireless&&this.engine?.stopLoad()};this.#t=new AbortController,n(e,`webkitcurrentplaybacktargetiswirelesschanged`,t,{signal:this.#t.signal}),t()}#o(){this.#t?.abort(),this.#t=null,this.#e?.remove(),this.#e=null}}return t}function lu(e){if(e===void 0)return 1/0;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?Math.ceil(t*16/9)*t:1/0}function uu(e,t){let n=lu(t);if(n===1/0||e.length===0)return;let r=e.findIndex(e=>(e.width??0)*(e.height??0)>n);return r===-1?e.length-1:Math.max(0,r-1)}function du(e,t){let n=lu(t);if(n===1/0||e.length===0)return;let r=e.findIndex(e=>(e.width??0)*(e.height??0)>=n);return r===-1?e.length-1:r}function fu(e,t=$.DefaultConfig.capLevelController){return class extends t{#e;#t=!1;#n=!1;constructor(t){super(t),this.#e=t,e.controller=this,t.on($.Events.MANIFEST_PARSED,this.#o),t.on($.Events.LEVELS_UPDATED,this.#o)}destroy(){this.#e.off($.Events.MANIFEST_PARSED,this.#o),this.#e.off($.Events.LEVELS_UPDATED,this.#o),e.controller===this&&(e.controller=void 0),super.destroy()}startCapping(){this.#t=!0,super.startCapping()}stopCapping(){this.#t=!1,super.stopCapping()}get mediaWidth(){return this.#r?super.mediaWidth:1/0}get mediaHeight(){return this.#r?super.mediaHeight:1/0}get#r(){return e.capToPlayerSize&&!this.#n}#i(e){this.#n=!0;try{return super.getMaxLevel(e)}finally{this.#n=!1}}getMaxLevel(t){let{levels:n}=this.#e,r=super.getMaxLevel(t);if(e.capToPlayerSize&&r>=0){let i=du(n,e.minAutoResolution);i!==void 0&&(r=Math.min(Math.max(r,i),this.#i(t)))}let i=uu(n,e.maxAutoResolution);return i!==void 0&&(r=Math.min(r,i)),Math.min(r,t)}detectPlayerSize(){super.detectPlayerSize(),!(super.mediaWidth>0&&super.mediaHeight>0)&&this.#a()}apply(){if(this.#t){this.detectPlayerSize();return}this.#a()}#a(){let{levels:t}=this.#e;t?.length&&(this.#e.autoLevelCapping=uu(t,e.maxAutoResolution)??-1)}#o=()=>this.apply()}}function pu(e){return e?.toLowerCase()===`use-credentials`}function mu(e,t){let{xhrSetup:n,fetchSetup:r}=e;return{async xhrSetup(e,r){pu(t())&&(e.withCredentials=!0),await n?.(e,r)},fetchSetup(e,n){return pu(t())&&(n.credentials=`include`),r?r(e,n):new Request(e.url,n)}}}function hu(t){class n extends t{#e=null;#t=null;constructor(...t){super(...t);let{engine:n}=this;n&&(n.on($.Events.MANIFEST_LOADING,()=>this.#i()),n.on($.Events.MANIFEST_LOADED,(t,n)=>{let r=n.sessionData?.[u]?.URI;this.#i(),this.#e=e(r)&&r?gu(r,n.url):null,this.#n()}),n.on($.Events.MEDIA_ATTACHED,()=>this.#n()),n.on($.Events.MEDIA_DETACHED,()=>this.#r()),n.on($.Events.DESTROYING,()=>this.#i()))}#n(){let e=this.target;!e||!this.#e||this.#t||(this.#t=new AbortController,d(e,this.#e,this.#t.signal,{preferredLanguage:this.engine?.config.subtitlePreference?.lang,credentials:pu(e.crossOrigin)?`include`:void 0}))}#r(){this.#t?.abort(),this.#t=null}#i(){this.#e=null,this.#r()}}return n}function gu(e,t){try{return new URL(e,t).href}catch{return null}}function _u(e){e.config.emeEnabled&&(e.config.requestMediaKeySystemAccessFunc=e.userConfig.requestMediaKeySystemAccessFunc??vu)}const vu=(e,t)=>{let n=e.includes(`widevine`)?yu(t):t;return navigator.requestMediaKeySystemAccess(e,n)};function yu(e){return[...e.map(e=>{let{videoCapabilities:t}=e;return t?{...e,videoCapabilities:t.map(e=>({...e,robustness:`HW_SECURE_ALL`}))}:e}),...e]}const bu={[$.ErrorTypes.NETWORK_ERROR]:o.MEDIA_ERR_NETWORK,[$.ErrorTypes.MEDIA_ERROR]:o.MEDIA_ERR_DECODE,[$.ErrorTypes.KEY_SYSTEM_ERROR]:o.MEDIA_ERR_ENCRYPTED,[$.ErrorTypes.MUX_ERROR]:o.MEDIA_ERR_DECODE,[$.ErrorTypes.OTHER_ERROR]:o.MEDIA_ERR_CUSTOM};function xu(e){class t extends e{#e=null;#t=null;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>this.#r()),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#r()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#n()),this.engine?.on($.Events.DESTROYING,()=>this.#n())}get error(){return this.#t}#n(){this.#e?.abort(),this.#e=null}#r(){this.#e?.abort(),this.#e=new AbortController;let{engine:e,target:t}=this;if(!e||!t)return;let n=(e,t)=>{if(!t.fatal)return;let n=bu[t.type]??o.MEDIA_ERR_CUSTOM,r=new o(t.error?.message,n,!0,t.details);r.data=t,this.#t=r;let i=new ErrorEvent(`error`,{error:r,message:r.message});this.dispatchEvent(i)};e.on($.Events.ERROR,n),this.#e.signal.addEventListener(`abort`,()=>{e.off($.Events.ERROR,n),this.#t=null},{once:!0})}}return t}function Su(e){class t extends e{#e=NaN;#t;#n=null;#r=!1;constructor(...e){super(...e);let{engine:t}=this;t?.on($.Events.MANIFEST_LOADING,()=>{this.#a(),this.#c()}),t?.on($.Events.MEDIA_ATTACHED,()=>this.#c()),t?.on($.Events.MEDIA_DETACHED,()=>this.#l()),t?.on($.Events.DESTROYING,()=>{this.#a(),this.#l()}),t?.on($.Events.LEVEL_LOADED,(e,t)=>{this.#i(t.details),this.#r&&this.#u()})}get targetLiveWindow(){return this.#e}get liveEdgeStart(){if(this.#t===void 0)return NaN;let{target:e}=this;if(!e)return NaN;let{seekable:t}=e;return t.length?t.end(t.length-1)-this.#t:NaN}#i(e){if(!e.live)return this.#a();let t=Cu(e);this.#t=t.liveEdgeStartOffset,this.#o(t),this.#s(t.targetLiveWindow)}#a(){this.#t=void 0,this.#s(NaN)}#o({streamType:e,lowLatency:t}){if(e===s.LIVE){let e=this.engine;if(!e)return;t?(e.config.backBufferLength=e.userConfig.backBufferLength??4,e.config.maxFragLookUpTolerance=e.userConfig.maxFragLookUpTolerance??.001,e.config.abrBandWidthUpFactor=e.userConfig.abrBandWidthUpFactor??e.config.abrBandWidthFactor):e.config.backBufferLength=e.userConfig.backBufferLength??8}}#s(e){Object.is(this.#e,e)||(this.#e=e,this.dispatchEvent(new Event(`targetlivewindowchange`)))}#c(){this.#l();let e=this.target;e&&!e.autoplay&&(this.#n=new AbortController,e.addEventListener(`play`,()=>{this.#r=!0,this.#u()},{signal:this.#n.signal,once:!0}))}#l(){this.#n?.abort(),this.#n=null,this.#r=!1}#u(){let e=this.target;if(!e)return;let{liveEdgeStart:t}=this;Number.isFinite(t)&&(e.currentTime<t&&(e.currentTime=t),this.#r=!1)}}return t}const Cu=e=>{let t=e.type,n=wu(t),r=Tu(t),i=!!e.partList?.length,a;return n===s.LIVE&&(a=i?e.partHoldBack||e.partTarget*2:e.holdBack||e.targetduration*3),{streamType:n,targetLiveWindow:r,liveEdgeStartOffset:a,lowLatency:i}},wu=e=>e===`VOD`?s.ON_DEMAND:s.LIVE,Tu=e=>e===`EVENT`?1/0:e===`VOD`?NaN:0;function Eu(e){return`${e.url[0]??``}|${e.width}x${e.height}|${e.videoCodec}|${e.bitrate}`}function Du(e){return e.default?`main`:`alternative`}function Ou(e){class t extends e{#e=/* @__PURE__ */ new Map;#t=null;constructor(...e){super(...e);let{engine:t}=this;t&&(t.on($.Events.MANIFEST_PARSED,this.#n),t.on($.Events.AUDIO_TRACKS_UPDATED,this.#r),t.on($.Events.AUDIO_TRACK_SWITCHING,this.#i),t.on($.Events.AUDIO_TRACK_SWITCHED,this.#i),t.on($.Events.LEVELS_UPDATED,this.#s),t.on($.Events.LEVEL_SWITCHED,this.#c),t.once($.Events.DESTROYING,this.#u),this.audioTracks.addEventListener(`change`,this.#o),this.videoRenditions.addEventListener(`change`,this.#l))}#n=(e,t)=>{this.#d(),this.#e.clear();let n=this.addVideoTrack(`main`);this.#t=n,n.selected=!0;for(let[e,r]of t.levels.entries()){let t=n.addRendition(r.url[0]??``,r.width,r.height,r.videoCodec,r.bitrate);this.#e.set(Eu(r),`${e}`),t.id=`${e}`}};#r=(e,t)=>{if(!this.#a(t.audioTracks)){this.#p();for(let e of t.audioTracks){let t=this.addAudioTrack(Du(e),e.name,e.lang);t.id=`${e.id}`}}};#i=(e,t)=>{let n=`${t.id}`;for(let e of this.audioTracks)e.enabled=e.id===n};#a(e){let t=[...this.audioTracks];return t.length===e.length&&e.every((e,n)=>{let r=t[n];return r?.id===`${e.id}`&&r.kind===Du(e)&&r.label===(e.name??``)&&r.language===(e.lang??``)})}#o=()=>{let{engine:e}=this;if(!e)return;let t=[...this.audioTracks].filter(e=>e.enabled),n=t.find(t=>Number(t.id)!==e.audioTrack)??t[0];if(!n?.id)return;let r=Number(n.id),i=e.audioTracks.map(e=>e.id);r!==e.audioTrack&&i.includes(r)&&(e.audioTrack=r);for(let e of t)e!==n&&(e.enabled=!1)};#s=(e,t)=>{if(!this.#t)return;let n=t.levels.map(e=>this.#e.get(Eu(e)));for(let e of this.videoRenditions)e.id&&!n.includes(e.id)&&this.#t.removeRendition(e)};#c=(e,t)=>{let n=`${t.level}`;for(let e of this.videoRenditions)e.active=e.id===n};#l=()=>{let{engine:e}=this;if(!e)return;let t=this.videoRenditions.selectedIndex;t!==e.manualLevel&&(e.nextLevel=t)};#u=()=>{let{engine:e}=this;e?.off($.Events.MANIFEST_PARSED,this.#n),e?.off($.Events.AUDIO_TRACKS_UPDATED,this.#r),e?.off($.Events.AUDIO_TRACK_SWITCHING,this.#i),e?.off($.Events.AUDIO_TRACK_SWITCHED,this.#i),e?.off($.Events.LEVELS_UPDATED,this.#s),e?.off($.Events.LEVEL_SWITCHED,this.#c),e?.off($.Events.DESTROYING,this.#u),this.audioTracks.removeEventListener(`change`,this.#o),this.videoRenditions.removeEventListener(`change`,this.#l),this.#d(),this.#e.clear(),this.#t=null};#d(){this.#f(),this.#p()}#f(){for(let e of this.videoTracks)this.removeVideoTrack(e)}#p(){for(let e of this.audioTracks)this.removeAudioTrack(e)}}return t}function ku(e){class t extends e{constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADED,()=>this.#e()),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#e())}#e(){let e=this.target;e&&[...e.textTracks].forEach(t=>{if(t.kind!==`metadata`&&t.kind!==`chapters`)return;let n=`track`;t.kind&&(n+=`[kind="${t.kind}"]`),t.label&&(n+=`[label="${t.label}"]`);let r=e.querySelector(n);if(!r)return;if((r.getAttribute(`src`)??``)&&r.readyState===2&&!t.cues?.length){let t=r.cloneNode();e.replaceChild(t,r)}let i=e.querySelector(n);i?.default&&i.track.mode!==`hidden`&&(i.track.mode=`hidden`)})}}return t}function Au(e){class t extends e{#e=null;#t=`metadata`;#n;#r;#i=!1;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>{this.#i=!1,this.#o()}),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#o()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#a()),this.engine?.on($.Events.DESTROYING,()=>this.#a())}get preload(){return this.#t}set preload(e){this.#t=e,this.#o()}#a(){this.#e?.abort(),this.#e=null,this.#i=!1}#o(){this.#e?.abort();let e=this.target;if(!e)return;e.preload!==this.preload&&(e.preload=this.preload);let{engine:t}=this;if(!t)return;this.#n??=t.config.maxBufferLength,this.#r??=t.config.maxBufferSize;let n=this.#n,r=this.#r,i=(e,t)=>{let{engine:i}=this;if(i){if(i.config.maxBufferLength=e??n,i.config.maxBufferSize=t??r,this.#i){i.resumeBuffering?.();return}this.#i=!0,i.startLoad()}};if(this.preload===`auto`||!e.paused){i();return}this.preload===`metadata`&&i(1,1),this.#e=new AbortController,e.addEventListener(`play`,()=>i(),{signal:this.#e.signal,once:!0})}}return t}function ju(e){class t extends e{#e=s.UNKNOWN;#t=!1;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>this.#n(s.UNKNOWN)),this.engine?.on($.Events.DESTROYING,()=>this.#n(s.UNKNOWN)),this.engine?.on($.Events.LEVEL_LOADED,(e,t)=>{this.#n(t.details.live?s.LIVE:s.ON_DEMAND)})}get streamType(){return this.#e}set streamType(e){if(e===s.UNKNOWN){this.#t=!1,this.#r(s.UNKNOWN);return}this.#t=!0,this.#r(e)}#n(e){this.#t||this.#r(e)}#r(e){this.#e!==e&&(this.#e=e,this.dispatchEvent(new Event(`streamtypechange`)))}}return t}const Mu=`data-removeondestroy`;function Nu(e,t){let n=e?Fu(e):[];try{t()}finally{for(let e of n)Iu(e)}}function Pu(e){let t=e?.querySelectorAll(`track[${Mu}]`)??[];for(let e of t)e.track.mode=`disabled`,e.remove()}function Fu(e){let t=[];for(let n of e.querySelectorAll(`track`)){if(n.hasAttribute(Mu))continue;let{track:e}=n;(e.mode!==`disabled`||n.readyState===2)&&t.push({track:e,mode:e.mode,cues:Lu(e,()=>Array.from(e.cues??[]))})}return t}function Iu({track:e,mode:t,cues:n}){e.mode!==t&&(e.mode=t),n.length&&Lu(e,()=>{let t=new Set(e.cues??[]);for(let r of n)t.has(r)||e.addCue(r)})}function Lu(e,t){let{mode:n}=e;n===`disabled`&&(e.mode=`hidden`);try{return t()}finally{n===`disabled`&&(e.mode=n)}}function Ru(e){class t extends e{#e=null;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>{Pu(this.target),this.#n()}),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#n()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#t()),this.engine?.on($.Events.DESTROYING,()=>this.#t())}#t(){this.#e?.abort(),this.#e=null,Pu(this.target)}#n(){this.#e?.abort(),this.#e=new AbortController;let{signal:e}=this.#e,{engine:t}=this;if(!t||!this.target)return;let i=this.target,a=(e,n)=>{Pu(this.target);for(let e of n.tracks){let n=e.subtitleTrack??e.closedCaptions,r=t.subtitleTracks.findIndex(({lang:t,name:r,type:i})=>t===n?.lang&&r===e.label&&i.toLowerCase()===e.kind),a=e._id??e.default?`default`:`${e.kind}${r}`;zu(i,e.kind,e.label,n?.lang,a,e.default)}},o=(e,{track:t,cues:n})=>{let r=i.textTracks.getTrackById(t);if(!r)return;let a=r.mode===`disabled`;a&&(r.mode=`hidden`),n.forEach(e=>{r.cues?.getCueById(e.id)||r.addCue(e)}),a&&(r.mode=`disabled`)};t.on($.Events.NON_NATIVE_TEXT_TRACKS_FOUND,a),t.on($.Events.CUES_PARSED,o),n(i.textTracks,`change`,()=>{if(!t.subtitleTracks.length)return;let e=Array.from(i.textTracks).find(e=>e.id&&e.mode===`showing`&&r(e));if(!e)return;let n=t.subtitleTracks[t.subtitleTrack],a=n?n.default?`default`:`${t.subtitleTracks[t.subtitleTrack]?.type.toLowerCase()}${t.subtitleTrack}`:void 0;if(t.subtitleTrack<0||e?.id!==a){let n=t.subtitleTracks.findIndex(({lang:t,name:n,type:r,default:i})=>e.id==="default"&&i||t===e.language&&n===e.label&&r.toLowerCase()===e.kind);t.subtitleTrack=n}e?.id===a&&e.cues&&Array.from(e.cues).forEach(t=>{e.addCue(t)})},{signal:e}),e.addEventListener(`abort`,()=>{t.off($.Events.NON_NATIVE_TEXT_TRACKS_FOUND,a),t.off($.Events.CUES_PARSED,o)},{once:!0})}}return t}function zu(e,t,n,i,a,o){let s=document.createElement(`track`);return s.kind=t,s.label=n,i&&(s.srclang=i),a&&(s.id=a),o&&(s.default=!0),s.track.mode=r({kind:t})?`disabled`:`hidden`,s.setAttribute(Mu,``),e.append(s),s.track}const Bu={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,autoStartLoad:!1},Vu=cu(Au(Su(ju(Ou(hu(ku(Ru(xu(l(class extends c{#e=null;#t={maxAutoResolution:void 0,capToPlayerSize:!0,minAutoResolution:`720p`};constructor(e){super();let t={...Bu,...e.config};this.#e=new $({...t,capLevelController:fu(this.#t,t.capLevelController),...mu(t,()=>this.target?.crossOrigin)}),_u(this.#e)}get engine(){return this.#e}get maxAutoResolution(){return this.#t.maxAutoResolution}set maxAutoResolution(e){this.#t.maxAutoResolution!==e&&(this.#t.maxAutoResolution=e,this.#t.controller?.apply())}get capRenditionToPlayerSize(){return this.#t.capToPlayerSize}set capRenditionToPlayerSize(e){let t=e??!0;this.#t.capToPlayerSize!==t&&(this.#t.capToPlayerSize=t,this.#t.controller?.apply())}get minAutoResolution(){return this.#t.minAutoResolution??`720p`}set minAutoResolution(e){let t=e??`720p`;this.#t.minAutoResolution!==t&&(this.#t.minAutoResolution=t,this.#t.controller?.apply())}get src(){return this.#e?.url??``}set src(e){Nu(this.target,()=>this.#e?.loadSource(e))}attach(e){super.attach(e),Nu(e,()=>this.#e?.attachMedia(e))}detach(){Nu(this.target,()=>this.#e?.detachMedia()),super.detach()}destroy(){this.detach(),this.#e?.destroy(),this.#e=null}}))))))))));var Hu=class extends Vu{};const Uu={MSE:`mse`,NATIVE:`native`},Wu={M3U8:`application/vnd.apple.mpegurl`,MP4:`video/mp4`},Gu=/* @__PURE__ */ new Set([Wu.M3U8,`application/x-mpegurl`,`application/mpegurl`,`audio/mpegurl`,`audio/x-mpegurl`]),Ku=/* @__PURE__ */ new Set([Wu.MP4]),qu=s;var Ju=class extends Event{},Yu=class e extends c{static{this.defaultProps={src:``,source:null,preload:`metadata`,streamType:s.UNKNOWN,disableRemotePlayback:!1}}#e=null;#t=null;#n=e.defaultProps.src;#r=e.defaultProps.source;#i=e.defaultProps.preload;#a=e.defaultProps.streamType;#o=!1;#s;#c;#l;constructor(){super(),this.addEventListener(`loadstart`,this.#f)}attach(e){this.#t=e,super.attach(e),this.#e?.attach(e)}detach(){this.#e?.detach(),super.detach(),this.#t=null}destroy(){this.detach(),this.#g(),super.destroy(),this.removeEventListener(`loadstart`,this.#f)}get engine(){return this.#e?.engine??null}get error(){return this.#e?.error??null}get videoTracks(){return this.#e instanceof Hu?this.#e.videoTracks:void 0}get audioTracks(){return this.#e instanceof Hu?this.#e.audioTracks:void 0}get videoRenditions(){return this.#e instanceof Hu?this.#e.videoRenditions:void 0}get audioRenditions(){return this.#e instanceof Hu?this.#e.audioRenditions:void 0}get src(){return this.#n}set src(e){let{type:t,preferPlayback:n,drm:r,engine:i,maxAutoResolution:a,capRenditionToPlayerSize:o,minAutoResolution:s}=this.#r??{},c={...t&&{type:t},...n&&{preferPlayback:n},...r&&{drm:r},...i&&{engine:i},...a&&{maxAutoResolution:a},...o!==void 0&&{capRenditionToPlayerSize:o},...s&&{minAutoResolution:s},...e&&{src:e}};this.source=Object.keys(c).length>0?c:null}get source(){return this.#r}set source(e){let t=e??null;if(t===this.#r)return;let n=t?.src??``,r=this.#n!==n;this.#r=t,this.#n=n,this.#d(),this.dispatchEvent(new Event(`sourcechange`)),(r||this.#m(this.#h()))&&this.#p()}get preload(){return this.#i}set preload(e){this.#i=e,this.#e&&(this.#e.preload=e)}get disableRemotePlayback(){return super.disableRemotePlayback}set disableRemotePlayback(e){this.#l=e,super.disableRemotePlayback=e,this.#e instanceof Hu&&(this.#e.disableRemotePlayback=e)}get streamType(){return this.#e?.streamType??this.#a}set streamType(e){if(this.#o=e!==qu.UNKNOWN,this.#e){this.#e.streamType=e,this.#a=this.#e.streamType;return}this.#a!==e&&(this.#a=e,this.dispatchEvent(new Ju(`streamtypechange`)))}get liveEdgeStart(){return this.#e?.liveEdgeStart??NaN}get targetLiveWindow(){return this.#e?.targetLiveWindow??NaN}async load(){if(this.#s=null,this.remote.state===`connected`)return this.dispatchEvent(new Ju(`loadstart`)),super.load();if(this.#m(this.#h())){this.#g(),this.#c=this.#h();let{type:e,preferPlayback:t,drm:n,engine:r,maxAutoResolution:i,capRenditionToPlayerSize:a,minAutoResolution:o}=this.#r??{},{hlsJs:s,nativeHls:c}=r??{},l=Zu(e,this.src),u=$.isSupported()&&l===Wu.M3U8&&t!==Uu.NATIVE;this.#e=u?new Hu({config:Xu(s,n)}):this.#u(n,c,s),f(this.#e,this),this.#o&&(this.#e.streamType=this.#a),this.#e.preload=this.preload,this.#d(),this.#l!==void 0&&this.#e instanceof Hu&&(this.#e.disableRemotePlayback=this.#l),this.#t&&this.#e.attach(this.#t)}this.#e&&(this.dispatchEvent(new Ju(`loadstart`)),this.#e.src=this.src)}#u(e,t,n){let r=new a,i={...e&&{drm:e},...t&&{engine:{nativeHls:t}}};return Object.keys(i).length>0&&(r.source=i),r}#d(){this.#e instanceof Hu&&(this.#e.maxAutoResolution=this.#r?.maxAutoResolution,this.#e.capRenditionToPlayerSize=this.#r?.capRenditionToPlayerSize,this.#e.minAutoResolution=this.#r?.minAutoResolution)}#f=e=>{e instanceof Ju||e.stopImmediatePropagation()};async#p(){this.#s||(await(this.#s=Promise.resolve()),this.#s=null,this.load())}#m(e){return!t(this.#c,e)}#h(){let{type:e,preferPlayback:t,drm:n,engine:r}=this.#r??{};return{drm:n,engine:r,preferPlayback:t,contentType:Zu(e,this.src)}}#g(){this.#e?.destroy(),this.#e=null,this.#c=null,this.#s=null,this.#o||(this.#a=qu.UNKNOWN)}};function Xu(e,t){let n=e?.drmSystems??t;return!n||Object.keys(n).length===0?{...e}:{emeEnabled:!0,...e,drmSystems:n}}function Zu(e,t){if(!e)return Qu(t);let n=(e.split(`;`)[0]??``).trim().toLowerCase();if(Gu.has(n))return Wu.M3U8;if(Ku.has(n))return Wu.MP4}function Qu(e){return(e.split(/[?#]/)[0]??``).endsWith(`.mp4`)?Wu.MP4:Wu.M3U8}export{Yu as t};
-//# sourceMappingURL=adapter-DnHSdWh1.js.map
\ No newline at end of file
+`:(i=n.childNodes)!=null&&i.length?dl(n,t):t?e+n.textContent.trim().replace(/\s+/g,` `):e+n.textContent},``)}function fl(e,t,n){let r=`http://www.w3.org/ns/ttml#styling`,i=null,a=[`displayAlign`,`textAlign`,`color`,`backgroundColor`,`fontSize`,`fontFamily`],o=e!=null&&e.hasAttribute(`style`)?e.getAttribute(`style`):null;return o&&n.hasOwnProperty(o)&&(i=n[o]),a.reduce((n,a)=>{let o=pl(t,r,a)||pl(e,r,a)||pl(i,r,a);return o&&(n[a]=o),n},{})}function pl(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function ml(e){return/* @__PURE__ */ Error(`Could not parse ttml timestamp ${e}`)}function hl(e,t){if(!e)return null;let n=Uc(e);return n===null&&(il.test(e)?n=gl(e,t):al.test(e)&&(n=_l(e,t))),n}function gl(e,t){let n=il.exec(e),r=(n[4]|0)+(n[5]|0)/t.subFrameRate;return(n[1]|0)*3600+(n[2]|0)*60+(n[3]|0)+r/t.frameRate}function _l(e,t){let n=al.exec(e),r=Number(n[1]);switch(n[2]){case`h`:return r*3600;case`m`:return r*60;case`ms`:return r*1e3;case`f`:return r/t.frameRate;case`t`:return r/t.tickRate}return r}var vl=class{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}},yl=class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Cl(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(v.FRAG_LOADING,this.onFragLoading,this),e.on(v.FRAG_LOADED,this.onFragLoaded,this),e.on(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){let{hls:e}=this;e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(v.FRAG_LOADING,this.onFragLoading,this),e.off(v.FRAG_LOADED,this.onFragLoaded,this),e.off(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){let e=new vl(this,`textTrack1`),t=new vl(this,`textTrack2`),n=new vl(this,`textTrack3`),r=new vl(this,`textTrack4`);this.cea608Parser1=new Lc(1,e,t),this.cea608Parser2=new Lc(3,n,r)}addCues(e,t,n,r,i){let a=!1;for(let e=i.length;e--;){let r=i[e],o=Sl(r[0],r[1],t,n);if(o>=0&&(r[0]=Math.min(r[0],t),r[1]=Math.max(r[1],n),a=!0,o/(n-t)>.5))return}if(a||i.push([t,n]),this.config.renderTextTracksNatively){let i=this.captionsTracks[e];this.Cues.newCue(i,t,n,r)}else{let i=this.Cues.newCue(null,t,n,r);this.hls.trigger(v.CUES_PARSED,{type:`captions`,cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i,trackId:a}){let{unparsedVttFrags:o}=this;n===b.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i,trackId:a}),o.length&&(this.unparsedVttFrags=[],o.forEach(e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(v.FRAG_LOADED,e):this.hls.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:/* @__PURE__ */ Error(`Subtitle discontinuity domain does not match main`)})}))}getExistingTrack(e,t){let{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){let i=n.textTracks[r];if(xl(i,{name:e,lang:t,characteristics:`transcribes-spoken-dialog,describes-music-and-sound`}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;let{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:a}=t[e],o=this.getExistingTrack(i,a);if(o)n[e]=o,Xs(n[e]),Js(n[e],r);else{let t=this.createTextTrack(`captions`,i,a);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;let t=this.captionsProperties[e];if(!t)return;let n={_id:e,label:t.label,kind:`captions`,default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){let r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){let n=!!t.transferMedia;if(this.media=null,n)return;let{captionsTracks:r}=this;Object.keys(r).forEach(e=>{Xs(r[e]),delete r[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Cl(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){let{media:e}=this;if(!e)return;let t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Xs(t[e])}onSubtitleTracksUpdated(e,t){let n=t.subtitleTracks||[],r=n.some(e=>e.textCodec===rl);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(ho(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){let e=this.media,t=e?ec(e.textTracks):null;if(this.tracks.forEach((e,n)=>{let r;if(t){let n=null;for(let r=0;r<t.length;r++)if(t[r]&&xl(t[r],e)){n=t[r],t[r]=null;break}n&&(r=n)}if(r)Xs(r);else{let t=bl(e);r=this.createTextTrack(t,e.name,e.lang),r&&(r.mode=`disabled`)}r&&this.textTracks.push(r)}),t!=null&&t.length){let e=t.filter(e=>e!==null).map(e=>e.label);e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(`, `)}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){let e=this.tracks.map(e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{let t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;let n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)})}closedCaptionsForLevel(e){return this.hls.levels[e.level]?.attrs[`CLOSED-CAPTIONS`]}onFragLoading(e,t){if(this.enabled&&t.frag.type===b.MAIN){let{cea608Parser1:e,cea608Parser2:n,lastSn:r}=this,{cc:i,sn:a}=t.frag,o=t.part?.index??-1;e&&n&&(a!==r+1||a===r&&o!==this.lastPartIndex+1||i!==this.lastCc)&&(e.reset(),n.reset()),this.lastCc=i,this.lastSn=a,this.lastPartIndex=o}}onFragLoaded(e,t){let{frag:n,payload:r}=t;if(n.type===b.SUBTITLE){if(r.byteLength){let e=n.decryptdata,i=`stats`in t;if(e==null||!e.encrypted||i){let e=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===rl?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:/* @__PURE__ */ Error(`Empty subtitle payload`)})}}_parseIMSC1(e,t){let n=this.hls;sl(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),n.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;let{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:a}=this,o=i.length-1;if(!i[n.cc]&&o===-1){a.push(e);return}let s=this.hls;nl((t=n.initSegment)!=null&&t.data?Be(n.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,e=>{this._appendCues(e,n.level),s.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},t=>{let i=t.message===`Missing initPTS for VTT MPEGTS`;i?a.push(e):this._fallbackToIMSC1(n,r),s.logger.log(`Failed to parse VTT cue: ${t}`),!(i&&o>n.cc)&&s.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})})}_fallbackToIMSC1(e,t){let n=this.tracks[e.level];n.textCodec||sl(t,this.initPTS[e.cc],()=>{n.textCodec=rl,this._parseIMSC1(e,t)},()=>{n.textCodec=`wvtt`})}_appendCues(e,t){let n=this.hls;if(this.config.renderTextTracksNatively){let n=this.textTracks[t];if(!n||n.mode===`disabled`)return;e.forEach(e=>Ys(n,e))}else{let r=this.tracks[t];if(!r)return;let i=r.default?`default`:`subtitles`+t;n.trigger(v.CUES_PARSED,{type:`subtitles`,cues:e,track:i})}}onFragDecrypted(e,t){let{frag:n}=t;n.type===b.SUBTITLE&&this.onFragLoaded(v.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;let{frag:n,samples:r}=t;if(n.type!==b.MAIN||this.closedCaptionsForLevel(n)!==`NONE`)for(let e=0;e<r.length;e++){let t=r[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();let n=this.extractCea608Data(t);this.cea608Parser1.addData(r[e].pts,n[0]),this.cea608Parser2.addData(r[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){let{media:a}=this;if(!(!a||a.currentTime<n)){if(!i||i===`video`){let{captionsTracks:e}=this;Object.keys(e).forEach(r=>Zs(e[r],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){let{textTracks:e}=this;Object.keys(e).forEach(n=>Zs(e[n],t,r))}}}extractCea608Data(e){let t=[[],[]],n=e[0]&31,r=2;for(let i=0;i<n;i++){let n=e[r++],i=127&e[r++],a=127&e[r++];if((i!==0||a!==0)&&4&n){let e=3&n;(e===0||e===1)&&(t[e].push(i),t[e].push(a))}}return t}};function bl(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?`captions`:`subtitles`}function xl(e,t){return!!e&&e.kind===bl(t)&&_o(t,e)}function Sl(e,t,n,r){return Math.min(t,r)-Math.max(e,n)}function Cl(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wl=/\s/,Tl={newCue(e,t,n,r){let i=[],a,o,s,c,l,u=self.VTTCue||self.TextTrackCue;for(let f=0;f<r.rows.length;f++)if(a=r.rows[f],s=!0,c=0,l=``,!a.isEmpty()){var d;for(let e=0;e<a.chars.length;e++)wl.test(a.chars[e].uchar)&&s?c++:(l+=a.chars[e].uchar,s=!1);a.cueStartTime=t,t===n&&(n+=1e-4),c>=16?c--:c++;let r=Yc(l.trim()),p=el(t,n,r);e!=null&&(d=e.cues)!=null&&d.getCueById(p)||(o=new u(t,n,r),o.id=p,o.line=f+1,o.align=`left`,o.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(o))}return e&&i.length&&(i.sort((e,t)=>e.line===`auto`||t.line===`auto`?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),i.forEach(t=>Ys(e,t))),i}};function El(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const Dl=/(\d+)-(\d+)\/(\d+)/;var Ol=class{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Ml,this.controller=new self.AbortController,this.stats=new pe}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){let r=this.stats;if(r.loading.start)throw Error(`Loader can only be used once.`);r.loading.start=self.performance.now();let i=kl(e,this.controller.signal),a=e.responseType===`arraybuffer`,o=a?`byteLength`:`length`,{maxTimeToFirstByteMs:s,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=s&&p(s)?s:c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(so(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(n=>{this.response=this.loader=n;let i=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},c-(i-r.loading.start)),!n.ok){let{status:e,statusText:t}=n;throw new Nl(t||`fetch, bad network response`,e,n)}r.loading.first=i,r.total=jl(n.headers)||r.total;let o=this.callbacks?.onProgress;return o&&p(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,o):a?n.arrayBuffer():e.responseType===`json`?n.json():n.text()}).then(n=>{var i;let a=this.response;if(!a)throw Error(`loader destroyed`);self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);let s=n[o];s&&(r.loaded=r.total=s);let c={url:a.url,data:n,code:a.status},l=this.callbacks?.onProgress;l&&!p(t.highWaterMark)&&l(r,e,n,a),(i=this.callbacks)==null||i.onSuccess(c,r,e,a)}).catch(t=>{var n;if(self.clearTimeout(this.requestTimeout),r.aborted)return;let i=t&&t.code||0,a=t?t.message:null;(n=this.callbacks)==null||n.onError({code:i,text:a},e,t?t.details:null,r)})}getCacheAge(){let e=null;if(this.response){let t=this.response.headers.get(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){let a=new ui,o=e.body.getReader(),s=()=>o.read().then(o=>{if(o.done)return a.dataLength&&i(t,n,a.flush().buffer,e),Promise.resolve(/* @__PURE__ */ new ArrayBuffer(0));let c=o.value,l=c.length;return t.loaded+=l,l<r||a.dataLength?(a.push(c),a.dataLength>=r&&i(t,n,a.flush().buffer,e)):i(t,n,c.buffer,e),s()}).catch(()=>Promise.reject());return s()}};function kl(e,t){let n={method:`GET`,mode:`cors`,credentials:`same-origin`,signal:t,headers:new self.Headers(w({},e.headers))};return e.rangeEnd&&n.headers.set(`Range`,`bytes=`+e.rangeStart+`-`+String(e.rangeEnd-1)),n}function Al(e){let t=Dl.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function jl(e){let t=e.get(`Content-Range`);if(t){let e=Al(t);if(p(e))return e}let n=e.get(`Content-Length`);if(n)return parseInt(n)}function Ml(e,t){return new self.Request(e.url,t)}var Nl=class extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}};const Pl=/^age:\s*[\d.]+\s*$/im;var Fl=class{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new pe,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){let e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw Error(`Loader can only be used once.`);this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){let{config:e,context:t}=this;if(!e||!t)return;let n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;let i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(e=>{if(!(this.loader!==n||this.stats.aborted))return n.open(`GET`,t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(e=>{var i;(i=this.callbacks)==null||i.onError({code:n.status,text:e.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open(`GET`,t.url,!0);let r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:a}=n.loadPolicy;if(r)for(let t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader(`Range`,`bytes=`+t.rangeStart+`-`+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&p(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){let{context:e,loader:t,stats:n}=this;if(!e||!t)return;let r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;let r=t.status,s=t.responseType===`text`?t.responseText:null;if(r>=200&&r<300){let i=s??t.response;if(i!=null){var a;n.loading.end=Math.max(self.performance.now(),n.loading.first),n.loaded=n.total=t.responseType===`arraybuffer`?i.byteLength:i.length,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);let o=this.callbacks?.onProgress;o&&o(n,e,i,t);let s={url:t.responseURL,data:i,code:r};(a=this.callbacks)==null||a.onSuccess(s,n,e,t);return}}let c=i.loadPolicy.errorRetry,l=n.retry;if(pn(c,l,!1,{url:e.url,data:void 0,code:r}))this.retry(c);else{var o;P.error(`${r} while loading ${e.url}`),(o=this.callbacks)==null||o.onError({code:r,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;let e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(pn(e,t,!0))this.retry(e);else{P.warn(`timeout while loading ${this.context?.url}`);let e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){let{context:t,stats:n}=this;this.retryDelay=dn(e,n.retry),n.retry++,P.warn(`${status?`HTTP Status `+status:`Timeout`} while loading ${t?.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){let t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Pl.test(this.loader.getAllResponseHeaders())){let t=this.loader.getResponseHeader(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&RegExp(`^${e}:\\s*[\\d.]+\\s*$`,`im`).test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}};const Il=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:1/0,preferManagedMediaSource:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:`edge`,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Qt,bufferController:Co,capLevelController:Do,errorController:_n,fpsController:qs,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:ur,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ll()),{},{subtitleStreamController:xc,subtitleTrackController:tc,timelineController:yl,audioStreamController:po,audioTrackController:vo,emeController:Hs,cmcdController:Rs,contentSteeringController:zs,interstitialsController:bc});function Ll(){return{cueHandler:Tl,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:`English`,captionsTextTrack1LanguageCode:`en`,captionsTextTrack2Label:`Spanish`,captionsTextTrack2LanguageCode:`es`,captionsTextTrack3Label:`Unknown CC`,captionsTextTrack3LanguageCode:``,captionsTextTrack4Label:`Unknown CC`,captionsTextTrack4LanguageCode:``,renderTextTracksNatively:!0}}function Rl(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw Error(`Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration`);if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw Error(`Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"`);if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw Error(`Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"`);let r=zl(e),i=[`manifest`,`level`,`frag`],a=[`TimeOut`,`MaxRetry`,`RetryDelay`,`MaxRetryTimeout`];return i.forEach(e=>{let i=`${e===`level`?`playlist`:e}LoadPolicy`,o=t[i]===void 0,s=[];a.forEach(n=>{let a=`${e}Loading${n}`,c=t[a];if(c!==void 0&&o){s.push(a);let e=r[i].default;switch(t[i]={default:e},n){case`TimeOut`:e.maxLoadTimeMs=c,e.maxTimeToFirstByteMs=c;break;case`MaxRetry`:e.errorRetry.maxNumRetry=c,e.timeoutRetry.maxNumRetry=c;break;case`RetryDelay`:e.errorRetry.retryDelayMs=c,e.timeoutRetry.retryDelayMs=c;break;case`MaxRetryTimeout`:e.errorRetry.maxRetryDelayMs=c,e.timeoutRetry.maxRetryDelayMs=c}}}),s.length&&n.warn(`hls.js config: "${s.join(`", "`)}" setting(s) are deprecated, use "${i}": ${V(t[i])}`)}),E(E({},r),t)}function zl(e){return e&&typeof e==`object`?Array.isArray(e)?e.map(zl):Object.keys(e).reduce((t,n)=>(t[n]=zl(e[n]),t),{}):e}function Bl(e,t){let n=e.loader;n!==Ol&&n!==Fl?(t.log(`[config]: Custom loader detected, cannot enable progressive streaming`),e.progressive=!1):El()&&(e.loader=Ol,e.progressive=!0,e.enableSoftwareAES=!0,t.log(`[config]: Progressive streaming enabled, using FetchLoader`))}var Vl=class extends In{constructor(e,t){super(`gap-controller`,e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;(e=this.media)!=null&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{this.hls&&(this.ended=this.media?.currentTime||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(100),this.mediaSource=t.mediaSource;let n=this.media=t.media;J(n,`playing`,this.onMediaPlaying),J(n,`waiting`,this.onMediaWaiting),J(n,`ended`,this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();let{media:n}=this;n&&(Y(n,`playing`,this.onMediaPlaying),Y(n,`waiting`,this.onMediaWaiting),Y(n,`ended`,this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;let t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){let n=this.hls?.config;if(!n)return;let r=this.media;if(!r)return;let{seeking:i}=r,a=this.seeking&&!i,o=!this.seeking&&i,s=r.paused&&!i||r.ended||r.playbackRate===0;if(this.seeking=i,e!==t){t&&(this.ended=0),this.moved=!0,i||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!s&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(o||a){a&&this.stallResolved(e);return}if(s){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&r.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1}));return}if(!W.getBuffered(r).length){this.nudgeRetry=0;return}let c=W.bufferInfo(r,e,0),l=c.nextStart||0,u=this.fragmentTracker;if(i&&u&&this.hls){let t=Hl(this.hls.inFlightFragments,e),n=c.len>2,r=!l||t||l-e>2&&!u.getPartialFragment(e);if(n||r)return;this.moved=!1}let d=this.hls?.latestLevelDetails;if(!this.moved&&this.stalled!==null&&u){if(!(c.len>0)&&!l)return;let t=Math.max(l,c.start||0)-e,n=d!=null&&d.live?d.targetduration*2:2,i=Wl(e,u);if(t>0&&(t<=n||i)){r.paused||this._trySkipBufferHole(i);return}}let f=n.detectStallWithCurrentTimeMs,p=self.performance.now(),m=this.waiting,h=this.stalled;if(h===null){if(m>0&&p-m<f)h=this.stalled=m;else{this.stalled=p;return}}let g=p-h;if(!i&&(g>=f||m)&&this.hls){if(this.mediaSource?.readyState===`ended`&&!(d!=null&&d.live)&&Math.abs(e-(d?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(c),!this.media||!this.hls)return}let _=W.bufferInfo(r,e,n.maxBufferHole);this._tryFixBufferStall(_,g,e)}stallResolved(e){let t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){let n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(v.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;let r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){let n=W.bufferedInfo(W.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){let n=W.timeRangesToArray(r),i=W.bufferedInfo(n,t,0).bufferedIndex;if(i>-1&&i<n.length-1){let t=W.bufferedInfo(n,e,0).bufferedIndex,r=n[i].end,a=n[i+1].start;if((t===-1||t>i)&&a-r<1&&e-r<2){let n=/* @__PURE__ */ Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${r} -> ${a} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;let i=Wl(e,this.fragmentTracker);i&&`fragment`in i?i=i.fragment:i||=void 0;let o=W.bufferInfo(this.media,e,0);this.hls.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:i,buffer:o.len,bufferInfo:o})}}}}}_tryFixBufferStall(e,t,n){let{fragmentTracker:r,media:i}=this,a=this.hls?.config;if(!i||!r||!a)return;let o=this.hls?.latestLevelDetails,s=Wl(n,r);if((s||o!=null&&o.live&&n<o.fragmentStart)&&(this._trySkipBufferHole(s)||!this.media))return;let c=e.buffered,l=this.adjacentTraversal(e,n);(c&&c.length>1&&e.len>a.maxBufferHole||e.nextStart&&(e.nextStart-n<a.maxBufferHole||l))&&(t>a.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn(`Trying to nudge playhead over buffer-hole`),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){let n=this.fragmentTracker,r=e.nextStart;if(n&&r){let e=n.getFragAtPos(t,b.MAIN),i=n.getFragAtPos(r,b.MAIN);if(e&&i)return i.sn-e.sn<2}return!1}_reportStall(e){let{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;let r=/* @__PURE__ */ Error(`Playback stalling at @${n.currentTime} due to low buffer (${V(e)})`);this.warn(r.message),t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){let{fragmentTracker:t,media:n}=this,r=this.hls?.config;if(!n||!t||!r)return 0;let i=n.currentTime,a=W.bufferInfo(n,i,0),o=i<a.start?a.start:a.nextStart;if(o&&this.hls){let c=a.len<=r.maxBufferHole,l=a.len>0&&a.len<1&&n.readyState<3,u=o-i;if(u>0&&(c||l)){if(u>r.maxBufferHole){let n=!1;if(i===0){let e=t.getAppendedFrag(0,b.MAIN);e&&o<e.end&&(n=!0)}if(!n&&e){var s;if(!((s=this.hls.loadLevelObj)!=null&&s.details)||Hl(this.hls.inFlightFragments,o))return 0;let n=!1,r=e.end;for(;r<o;){let e=Wl(r,t);if(e)r+=e.duration;else{n=!0;break}}if(n)return 0}}let c=Math.max(o+.05,i+.1);if(this.warn(`skipping hole, adjusting currentTime from ${i} to ${c}`),this.moved=!0,n.currentTime=c,!(e!=null&&e.gap)){let t=/* @__PURE__ */ Error(`fragment loaded with buffer holes, seeking from ${i} to ${c}`),n={type:g.MEDIA_ERROR,details:_.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,buffer:a.len,bufferInfo:a};e&&(`fragment`in e?n.part=e:n.frag=e),this.hls.trigger(v.ERROR,n)}return c}}return 0}_tryNudgeBuffer(e){let{hls:t,media:n,nudgeRetry:r}=this,i=t?.config;if(!n||!i)return 0;let a=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){let o=a+(r+1)*i.nudgeOffset,s=/* @__PURE__ */ Error(`Nudging 'currentTime' from ${a} to ${o}`);this.warn(s.message),n.currentTime=o,t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_NUDGE_ON_STALL,error:s,fatal:!1,buffer:e.len,bufferInfo:e})}else{let n=/* @__PURE__ */ Error(`Playhead still not moving while enough data buffered @${a} after ${i.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}};function Hl(e,t){let n=Ul(e.main);if(n&&n.start<=t)return n;let r=Ul(e.audio);return r&&r.start<=t?r:null}function Ul(e){if(!e)return null;switch(e.state){case X.IDLE:case X.STOPPED:case X.ENDED:case X.ERROR:return null}return e.frag}function Wl(e,t){return t.getAppendedFrag(e,b.MAIN)||t.getPartialFragment(e)}function Gl(){if(typeof self<`u`)return self.VTTCue||self.TextTrackCue}function Kl(e,t,n,r,i){let a=new e(t,n,``);try{a.value=r,i&&(a.type=i)}catch{a=new e(t,n,V(i?E({type:i},r):r))}return a}const ql=(()=>{let e=Gl();try{e&&new e(0,1/0,``)}catch{return Number.MAX_VALUE}return 1/0})();var Jl=class{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(v.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){this.media=t.media,t.overrides?.cueRemoval===!1&&(this.removeCues=!1)}onMediaAttached(){let e=this.hls?.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&=(this.removeCues&&Xs(this.id3Track,this.onEventCueEnter),null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){let t=this.getID3Track(e.textTracks);return t.mode=`hidden`,t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){let n=e[t];if(n.kind===`metadata`&&n.label===`id3`)return Js(n,this.media),n}return this.media.addTextTrack(`metadata`,`id3`)}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;let{enableEmsgMetadataCues:n,enableID3MetadataCues:r}=this.hls.config;if(!n&&!r)return;let{samples:i}=t;this.id3Track||=this.createTrack(this.media);let a=Gl();if(a)for(let e=0;e<i.length;e++){let t=i[e].type;if(t===ea.emsg&&!n||!r)continue;let o=Xi(i[e].data),s=i[e].pts,c=s+i[e].duration;c>ql&&(c=ql),c-s<=0&&(c=s+.25);for(let e=0;e<o.length;e++){let n=o[e];if(!Zi(n)){this.updateId3CueEnds(s,t);let e=Kl(a,s,c,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){let n=this.id3Track?.cues;if(n)for(let r=n.length;r--;){let i=n[r];i.type===t&&i.startTime<e&&i.endTime===ql&&(i.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){let{id3Track:i,hls:a}=this;if(!a)return;let{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:s}}=a;if(i&&(o||s)){let e;e=r===`audio`?e=>e.type===ea.audioId3&&s:r===`video`?e=>e.type===ea.emsg&&o:e=>e.type===ea.audioId3&&s||e.type===ea.emsg&&o,Zs(i,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;let{assetPlayerId:n,timelineOffset:r,enableDateRangeMetadataCues:i,interstitialsController:a}=this.hls.config;if(!i)return;let o=Gl();if(n&&r&&!a){let{fragmentStart:t,fragmentEnd:r}=e,i=this.assetCue;i?(i.startTime=t,i.endTime=r):o&&(i=this.assetCue=Kl(o,t,r,{assetPlayerId:this.hls.config.assetPlayerId},`hlsjs.interstitial.asset`),i&&(i.id=n,this.id3Track||=this.createTrack(this.media),this.id3Track.addCue(i),i.addEventListener(`enter`,this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;let{id3Track:s}=this,{dateRanges:c}=e,l=Object.keys(c),u=this.dateRangeCuesAppended;if(s&&t){var d;if((d=s.cues)!=null&&d.length){let e=Object.keys(u).filter(e=>!l.includes(e));for(let t=e.length;t--;){let n=e[t],r=u[n]?.cues;delete u[n],r&&Object.keys(r).forEach(e=>{let t=r[e];if(t){t.removeEventListener(`enter`,this.onEventCueEnter);try{s.removeCue(t)}catch{}}})}}else u=this.dateRangeCuesAppended={}}let f=e.fragments[e.fragments.length-1];if(l.length!==0&&p(f?.programDateTime)){this.id3Track||=this.createTrack(this.media);for(let e=0;e<l.length;e++){let t=l[e],n=c[t],r=n.startTime,i=u[t],s=i?.cues||{},d=i?.durationKnown||!1,f=ql,{duration:p,endDate:m}=n;if(m&&p!==null)f=r+p,d=!0;else if(n.endOnNext&&!d){let e=l.reduce((e,t)=>{if(t!==n.id){let r=c[t];if(r.class===n.class&&r.startDate>n.startDate&&(!e||n.startDate<e.startDate))return r}return e},null);e&&(f=e.startTime,d=!0)}let h=Object.keys(n.attr);for(let e=0;e<h.length;e++){let c=h[e];if(!qn(c))continue;let l=s[c];if(l)d&&!(i!=null&&i.durationKnown)?l.endTime=f:Math.abs(l.startTime-r)>.01&&(l.startTime=r,l.endTime=f);else if(o){let e=n.attr[c];Jn(c)&&(e=se(e));let i=Kl(o,r,f,{key:c,data:e},ea.dateRange);i&&(i.id=t,this.id3Track.addCue(i),s[c]=i,a&&(c===`X-ASSET-LIST`||c===`X-ASSET-URL`)&&i.addEventListener(`enter`,this.onEventCueEnter))}}u[t]={cues:s,dateRange:n,durationKnown:d}}}}},Yl=class{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{let{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;let n=this.computeLatency();if(n===null)return;this._latency=n;let{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||i===1||!t.live)return;let a=this.targetLatency;if(a===null)return;let o=n-a;if(o<Math.min(this.maxLatency,a+t.targetduration)&&o>.05&&this.forwardBufferLength>1){let t=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20,r=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,r)}else e.playbackRate!==1&&e.playbackRate!==0&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){return this.hls?.latestLevelDetails||null}get latency(){return this._latency||0}get maxLatency(){let{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;let t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){let e=this.levelDetails;if(e===null||this.hls===null)return null;let{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,s=this.hls.userConfig,c=o&&n||t;(this._targetLatencyUpdated||s.liveSyncDuration||s.liveSyncDurationCount||c===0)&&(c=i===void 0?a*r:i);let l=r;return c+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,l)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){let e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;let n=this.levelDetails;if(n===null)return null;let r=n.edge,i=e-t-this.edgeStalled,a=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,i),o)}get drift(){let e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){let e=this.levelDetails;if(e===null)return 0;let t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){let{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;let n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){let{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.ERROR,this.onError,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener(`timeupdate`,this.onTimeupdate)}onMediaDetaching(){this.media&&=(this.media.removeEventListener(`timeupdate`,this.onTimeupdate),null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener(`timeupdate`,this.onTimeupdate)}onError(e,t){var n;t.details===_.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn(`[latency-controller]: Stall detected, adjusting target latency`))}changeMediaPlaybackRate(e,t){var n;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${this.targetLatency?.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){let e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){let e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}},Xl=class extends mo{constructor(e,t){super(e,`level-controller`),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){let{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this),e.on(v.ERROR,this.onError,this)}_unregisterListeners(){let{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this),e.off(v.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){let n=this.hls.config.preferManagedMediaSource,r=[],i={},a={},o=!1,s=!1,c=!1;t.levels.forEach(e=>{let t=e.attrs,{audioCodec:l,videoCodec:u}=e;l&&(e.audioCodec=l=ct(l,n)||void 0),u&&=e.videoCodec=ft(u);let{width:d,height:f,unknownCodecs:p}=e,m=p?.length||0;if(o||=!!(d&&f),s||=!!u,c||=!!l,m||l&&!this.isAudioSupported(l)||u&&!this.isVideoSupported(u)){this.log(`Some or all CODECS not supported "${t.CODECS}"`);return}let{CODECS:h,"FRAME-RATE":g,"HDCP-LEVEL":_,"PATHWAY-ID":v,RESOLUTION:y,"VIDEO-RANGE":b}=t,x=`${`${v||`.`}-`}${e.bitrate}-${y}-${g}-${h}-${b}-${_}`;if(!i[x]){let t=this.createLevel(e);i[x]=t,a[x]=1,r.push(t)}else if(i[x].uri!==e.url&&!e.attrs[`PATHWAY-ID`]){let t=a[x]+=1;e.attrs[`PATHWAY-ID`]=Array(t+1).join(`.`);let n=this.createLevel(e);i[x]=n,r.push(n)}else i[x].addGroupId(`audio`,t.AUDIO),i[x].addGroupId(`text`,t.SUBTITLES)}),this.filterAndSortMediaOptions(r,t,o,s,c)}createLevel(e){let t=new Pt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){let e=/* @__PURE__ */ Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=yt(e,[])}return t}isAudioSupported(e){return et(e,`audio`,this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return et(e,`video`,this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let a=[],o=[],s=e,c=t.stats?.parsing||{};if((n||r)&&i&&(s=s.filter(({videoCodec:e,videoRange:t,width:n,height:r})=>(!!e||!!(n&&r))&&At(t))),s.length===0){Promise.resolve().then(()=>{if(this.hls){let e=`no level with compatible codecs found in manifest`,n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${V(t.levels.map(e=>e.attrs.CODECS).filter((e,t,n)=>n.indexOf(e)===t))}`,this.warn(n),e+=` (${n})`);let r=Error(e);this.hls.trigger(v.ERROR,{type:g.MEDIA_ERROR,details:_.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:r,reason:n})}}),c.end=performance.now();return}t.audioTracks&&(a=t.audioTracks.filter(e=>!e.audioCodec||this.isAudioSupported(e.audioCodec)),Zl(a)),t.subtitles&&(o=t.subtitles,Zl(o));let l=s.slice(0);s.sort((e,t)=>{if(e.attrs[`HDCP-LEVEL`]!==t.attrs[`HDCP-LEVEL`])return(e.attrs[`HDCP-LEVEL`]||``)>(t.attrs[`HDCP-LEVEL`]||``)?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return kt.indexOf(e.videoRange)-kt.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){let n=rt(e.videoCodec),r=rt(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){let n=it(e.codecSet),r=it(t.codecSet);if(n!==r)return r-n}return e.averageBitrate===t.averageBitrate?0:e.averageBitrate-t.averageBitrate});let u=l[0];if(this.steering&&(s=this.steering.filterParsedLevels(s),s.length!==l.length)){for(let e=0;e<l.length;e++)if(l[e].pathwayId===s[0].pathwayId){u=l[e];break}}this._levels=s;for(let e=0;e<s.length;e++)if(s[e]===u){this._firstLevel=e;let t=u.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${s.length} level(s) found, first bitrate: ${t}`),this.hls.userConfig?.abrEwmaDefaultEstimate===void 0){let e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}let d=i&&!r,f=this.hls.config,p=!!(f.audioStreamController&&f.audioTrackController),m={levels:s,audioTracks:a,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:p&&!d&&a.some(e=>!!e.url)};c.end=performance.now(),this.hls.trigger(v.MANIFEST_PARSED,m)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){let t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){let n=/* @__PURE__ */ Error(`invalid level idx`),r=e<0;if(this.hls.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}let n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs[`PATHWAY-ID`]:void 0,a=t[e],o=a.attrs[`PATHWAY-ID`];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&r&&i===o)return;this.log(`Switching to level ${e} (${a.height?a.height+`p `:``}${a.videoRange?a.videoRange+` `:``}${a.codecSet?a.codecSet+` `:``}@${a.bitrate})${o?` with Pathway `+o:``} from level ${n}${i?` with Pathway `+i:``}`);let s={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(v.LEVEL_SWITCHING,s);let c=a.details;if(!c||c.live){let e=this.switchParams(a.uri,r?.details,c);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){let e=this.hls.config.startLevel;return e===void 0?this.hls.firstAutoLevel:e}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){let t=this.steering.pathways(),n=e.filter(e=>t.indexOf(e)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){!t.fatal&&t.context&&t.context.type===y.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===b.MAIN){let e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return;let n=this._levels[t.level];n!=null&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;let{level:r,details:i}=t,a=t.levelInfo;if(!a){var o;this.warn(`Invalid level index ${r}`),(o=t.deliveryDirectives)!=null&&o.skip&&(i.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let e=a.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(r,t,e)}else(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);let n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs[`PATHWAY-ID`],a=e.details,o=a?.age;this.log(`Loading level index ${r}${t?.msn===void 0?``:` at sn `+t.msn+` part `+t.part}${i?` Pathway `+i:``}${o&&a.live?` age `+o.toFixed(1)+(a.type&&` `+a.type||``):``} ${n}`),this.hls.trigger(v.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs[`PATHWAY-ID`],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex===-1?this.hls.nextAutoLevel:this.manualLevelIndex}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;let n=this._levels.filter((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach(e=>e.level=-1)),!1));Zr(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);let r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&=Math.min(this._startLevel,r),this.hls.trigger(v.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){let{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(v.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}};function Zl(e){let t={};e.forEach(e=>{let n=e.groupId||``;e.id=t[n]=t[n]||0,t[n]++})}function Ql(){return self.SourceBuffer||self.WebKitSourceBuffer}function $l(){if(!re())return!1;let e=Ql();return!e||e.prototype&&typeof e.prototype.appendBuffer==`function`&&typeof e.prototype.remove==`function`}function eu(){if(!$l())return!1;let e=re();return typeof e?.isTypeSupported==`function`&&([`avc1.42E01E,mp4a.40.2`,`av01.0.01M.08`,`vp09.00.50.08`].some(t=>e.isTypeSupported(nt(t,`video`)))||[`mp4a.40.2`,`fLaC`].some(t=>e.isTypeSupported(nt(t,`audio`))))}function tu(){var e;let t=Ql();return typeof(t==null||(e=t.prototype)==null?void 0:e.changeType)==`function`}var nu=class extends ci{constructor(e,t,n){super(e,t,n,`stream-controller`,b.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{let e=this.media,t=e?e.currentTime:null;if(t===null||!p(t)||(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t)))return;let n=this.getFwdBufferInfoAtPos(e,t,b.MAIN,0);if(n===null||n.len===0){this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:`empty`})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();let{hls:e}=this;e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(v.BUFFER_CREATED,this.onBufferCreated,this),e.on(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();let{hls:e}=this;e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(v.BUFFER_CREATED,this.onBufferCreated,this),e.off(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){let{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=r.startLevel;e===-1&&(r.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=r.firstAutoLevel),r.nextLoadLevel=e,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=X.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=X.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case X.WAITING_LEVEL:{let{levels:e,level:t}=this,n=e?.[t],r=n?.details;if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=X.IDLE;break}if(this.hls.nextLoadLevel!==this.level){this.state=X.IDLE;break}break}case X.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate()}this.state===X.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){let{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;let i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;let a=n[i],o=this.getMainFwdBufferInfo();if(o===null)return;let s=this.getLevelDetails();if(s&&this._streamEnded(o,s)){let e={};this.altAudio===2&&(e.type=`video`),this.hls.trigger(v.BUFFER_EOS,e),this.state=X.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;let c=a.details;if(!c||this.state===X.WAITING_LEVEL||this.waitForLive(a)){this.level=i,this.state=X.WAITING_LEVEL,this.startFragRequested=!1;return}let l=o.len,u=this.getMaxBufferLength(a.maxBitrate);if(l>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);let d=this.backtrackFragment?this.backtrackFragment.start:o.end,f=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&f&&L(f)&&this.fragmentTracker.getState(f)!==U.OK){let e=(this.backtrackFragment??f).sn-c.startSN,t=c.fragments[e-1];t&&f.cc===t.cc&&(f=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,d)){if(!f.gap){let e=this.audioOnly&&!this.altAudio?I.AUDIO:I.VIDEO,t=(e===I.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,b.MAIN)}f=this.getNextFragmentLoopLoading(f,c,o,b.MAIN,u)}f&&(this.exceedsMaxBuffer(o,u,f)||(f.initSegment&&!f.initSegment.data&&!this.bitrateTest&&(f=f.initSegment),this.loadFragment(f,a,d)))}loadFragment(e,t,n){let r=this.fragmentTracker.getState(e);r===U.NOT_LOADED||r===U.PARTIAL?L(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,b.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,1/0),this.altAudio!==0&&(this.getLevelDetails()?.fragmentStart||0)>this.lastCurrentTime&&super.flushMainBuffer(0,1/0,`audio`)}nextLevelSwitch(){let{levels:e,media:t}=this;if(t!=null&&t.readyState){let n,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);let i=this.getLevelDetails();if(i!=null&&i.live){let e=this.getMainFwdBufferInfo();if(!e||e.len<i.targetduration*2)return}if(!t.paused&&e){let t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;let a=this.getBufferedFrag(t.currentTime+n);if(a){let e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();let t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,1/0)}}}}abortCurrentFrag(){let e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case X.KEY_LOADING:case X.FRAG_LOADING:case X.FRAG_LOADING_WAITING_RETRY:case X.PARSING:case X.PARSED:this.state=X.IDLE}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?`video`:null)}onMediaAttached(e,t){super.onMediaAttached(e,t);let n=t.media;J(n,`playing`,this.onMediaPlaying),J(n,`seeked`,this.onMediaSeeked)}onMediaDetaching(e,t){let{media:n}=this;n&&(Y(n,`playing`,this.onMediaPlaying),Y(n,`seeked`,this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log(`Trigger BUFFER_RESET`),this.hls.trigger(v.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;for(let e=0;e<t.levels.length;e++){let i=t.levels[e].audioCodec;i&&(n||=i.indexOf(`mp4a.40.2`)!==-1,r||=i.indexOf(`mp4a.40.5`)!==-1)}this.audioCodecSwitch=n&&r&&!tu(),this.audioCodecSwitch&&this.log(`Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC`),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){let{levels:n}=this;if(!n||this.state!==X.IDLE)return;let r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=X.WAITING_LEVEL)}onLevelLoaded(e,t){var n;let{levels:r,startFragRequested:i}=this,a=t.level,o=t.details,s=o.totalduration;if(!r){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:``}, cc [${o.startCC}, ${o.endCC}] duration:${s}`);let c=t.levelInfo,l=this.fragCurrent;l&&(this.state===X.FRAG_LOADING||this.state===X.FRAG_LOADING_WAITING_RETRY)&&l.level!==t.level&&l.loader&&this.abortCurrentFrag();let u=0;if(o.live||(n=c.details)!=null&&n.live){if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;u=this.alignPlaylists(o,c.details,this.levelLastLoaded?.details)}if(c.details=o,this.levelLastLoaded=c,i||this.setStartPosition(o,u),this.hls.trigger(v.LEVEL_UPDATED,{details:o,level:a}),this.state===X.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=X.IDLE}i&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){let{config:t,media:n}=this;if(!n)return;let r=this.hls.liveSyncPosition,i=this.getLoadPosition(),a=e.fragmentStart,o=e.edge,s=i>=a-t.maxFragLookUpTolerance&&i<=o;if(r!==null&&n.duration>r&&(i<r||!s)){let a=t.liveMaxLatencyDuration===void 0?t.liveMaxLatencyDurationCount*e.targetduration:t.liveMaxLatencyDuration;if((!s&&n.readyState<4||i<o-a)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState)){if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode===`buffered`){var c;let e=W.bufferInfo(n,r,0);if(!((c=e.buffered)!=null&&c.length)){n.currentTime=r;return}if(e.start<=i){n.currentTime=r;return}let{nextStart:t}=W.bufferedInfo(e.buffered,i,0);t&&(n.currentTime=t)}else n.currentTime=r}}}_handleFragmentLoadProgress(e){let t=e.frag,{part:n,payload:r}=e,{levels:i}=this;if(!i){this.warn(`Levels were reset while fragment load was in progress. Fragment ${t.sn} of level ${t.level} will not be buffered`);return}let a=i[t.level];if(!a){this.warn(`Level ${t.level} not found on progress`);return}let o=a.details;if(!o){this.warn(`Dropping fragment ${t.sn} of level ${t.level} after level details were reset`),this.fragmentTracker.removeFragment(t);return}let s=a.videoCodec,c=o.PTSKnown||!o.live,l=t.initSegment?.data,u=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new fo(this.hls,b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=n?n.index:-1,p=f!==-1,m=new Ln(t.level,t.sn,t.stats.chunkCount,r.byteLength,f,p),h=this.initPTS[t.cc];d.push(r,l,u,s,t,n,o.totalduration,c,m,h)}onAudioTrackSwitching(e,t){let n=this.hls,r=this.altAudio!==0;if(Zt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log(`Switching on main audio, use media.buffered to schedule main fragment loading`),this.mediaBuffer=this.media;let e=this.fragCurrent;e&&(this.log(`Switching to main audio track, cancel main fragment load`),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(v.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(v.AUDIO_TRACK_SWITCHED,t)}),n.trigger(v.BUFFER_FLUSHING,{startOffset:0,endOffset:1/0,type:null});return}n.trigger(v.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){let n=Zt(t.url,this.hls);if(n){let e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log(`Switching on alternate audio, use video.buffered to schedule main fragment loading`),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){let n=t.tracks,r,i,a=!1;for(let e in n){let t=n[e];if(t.id===`main`){if(i=e,r=t,e===`video`){let t=n[e];t&&(this.videoBuffer=t.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){let{frag:n,part:r}=t,i=n.type===b.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?` p: `+r.index:``} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===X.PARSED&&(this.state=X.IDLE);return}let e=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),L(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}let a=this.media;a&&(!this._hasEnoughToStart&&W.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){if(t.fatal){this.state=X.ERROR;return}switch(t.details){case _.FRAG_GAP:case _.FRAG_PARSING_ERROR:case _.FRAG_DECRYPT_ERROR:case _.FRAG_LOAD_ERROR:case _.FRAG_LOAD_TIMEOUT:case _.KEY_LOAD_ERROR:case _.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.MAIN,t);break;case _.LEVEL_LOAD_ERROR:case _.LEVEL_LOAD_TIMEOUT:case _.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===X.WAITING_LEVEL&&t.context?.type===y.LEVEL&&(this.state=X.IDLE);break;case _.BUFFER_ADD_CODEC_ERROR:case _.BUFFER_APPEND_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case _.BUFFER_FULL_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,1/0));break;case _.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=X.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==I.AUDIO||!this.altAudio){let e=(t===I.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,b.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){let{media:e}=this;if(!e)return;let t=e.currentTime,n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}let r=this.timelineOffset;r&&n&&(n+=r);let i=this.getLevelDetails(),a=W.getBuffered(e),o=a.length?a.start(0):0,s=o-n,c=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||s>0&&(s<c||this.loadingParts&&s<2*(i?.partTarget||0)))&&(this.log(`adjusting start position by ${s} to match buffer start`),n+=s,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log(`Swapping audio codec`),t=t.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(e=>{let{hls:n}=this,r=e?.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=X.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;let i=r.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),n.trigger(v.FRAG_LOADED,e),r.bitrateTest=!1}).catch(t=>{this.state!==X.STOPPED&&this.state!==X.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){let t=this.playlistType,{hls:n}=this,{remuxResult:r,chunkMeta:i}=e,a=this.getCurrentContext(i);if(!a){this.resetWhenMissingContext(i);return}let{frag:o,part:s,level:c}=a,{video:l,text:u,id3:d,initSegment:f}=r,{details:m}=c,h=this.altAudio?void 0:r.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=X.PARSING,f){let e=f.tracks;if(e){let r=o.initSegment||o;if(this.unhandledEncryptionError(f,o))return;this._bufferInitSegment(c,e,r,i),n.trigger(v.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:t,tracks:e})}let r=f.initPTS,a=f.timescale,s=this.initPTS[o.cc];if(p(r)&&(!s||s.baseTime!==r||s.timescale!==a)){let e=f.trackId;this.initPTS[o.cc]={baseTime:r,timescale:a,trackId:e},n.trigger(v.INIT_PTS_FOUND,{frag:o,id:t,initPTS:r,timescale:a,trackId:e})}}if(l&&m){h&&l.type===`audiovideo`&&this.logMuxedErr(o);let e=m.fragments[o.sn-1-m.startSN],t=o.sn===m.startSN,n=!e||o.cc>e.cc;if(r.independent!==!1){let{startPTS:e,endPTS:r,startDTS:a,endDTS:c}=l;if(s)s.elementaryStreams[l.type]={startPTS:e,endPTS:r,startDTS:a,endDTS:c};else if(l.firstKeyFrame&&l.independent&&i.id===1&&!n&&(this.couldBacktrack=!0),l.dropped&&l.independent){let i=this.getMainFwdBufferInfo(),a=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,s=l.firstKeyFramePTS?l.firstKeyFramePTS:e;if(!t&&a<s-this.config.maxBufferHole&&!n){this.backtrack(o);return}n&&(o.gap=!0),o.setElementaryStreamInfo(l.type,o.start,r,o.start,c,!0)}else t&&e-(m.appliedTimelineOffset||0)>2&&(o.gap=!0);o.setElementaryStreamInfo(l.type,e,r,a,c),this.backtrackFragment&&=o,this.bufferFragmentData(l,o,s,i,t||n)}else if(t||n)o.gap=!0;else{this.backtrack(o);return}}if(h){let{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=h;s&&(s.elementaryStreams[I.AUDIO]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(I.AUDIO,e,t,n,r),this.bufferFragmentData(h,o,s,i)}if(m&&d!=null&&d.samples.length){let e={id:t,frag:o,details:m,samples:d.samples};n.trigger(v.FRAG_PARSING_METADATA,e)}if(m&&u){let e={id:t,frag:o,details:m,samples:u.samples};n.trigger(v.FRAG_PARSING_USERDATA,e)}}logMuxedErr(e){this.warn(`${L(e)?`Media`:`Init`} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==X.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));let{audio:i,video:a,audiovideo:o}=t;if(i){let n=e.audioCodec,r=ut(i.codec,n);r===`mp4a`&&(r=`mp4a.40.5`);let a=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&=r.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`;let e=i.metadata;e&&`channelCount`in e&&(e.channelCount||1)!==1&&a.indexOf(`firefox`)===-1&&(r=`mp4a.40.5`)}r&&r.indexOf(`mp4a.40.5`)!==-1&&a.indexOf(`android`)!==-1&&i.container!==`audio/mpeg`&&(r=`mp4a.40.2`,this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),i.levelCodec=r,i.id=b.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${r||``}/${n||``}/${i.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=b.MAIN;let n=a.codec;if(n?.length===4)switch(n){case`hvc1`:case`hev1`:a.codec=`hvc1.1.6.L120.90`;break;case`av01`:a.codec=`av01.0.04M.08`;break;case`avc1`:a.codec=`avc1.42e01e`}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||``}/${n}]${a.codec===n?``:` parsed-corrected=`+a.codec}${a.supplemental?` supplemental=`+a.supplemental:``}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);let s=Object.keys(t);if(s.length){if(this.hls.trigger(v.BUFFER_CODECS,t),!this.hls)return;s.forEach(e=>{let i=t[e].initSegment;i!=null&&i.byteLength&&this.hls.trigger(v.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){let e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,b.MAIN)}get maxBufferLength(){let{levels:e,level:t}=this,n=e?.[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=X.IDLE}checkFragmentChanged(){let e=this.media,t=null;if(e&&e.readyState>1&&e.seeking===!1){let n=e.currentTime;if(W.isBuffered(e,n)?t=this.getAppendedFrag(n):W.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;let e=this.fragPlaying,n=t.level;(!e||t.sn!==e.sn||e.level!==n)&&(this.fragPlaying=t,this.hls.trigger(v.FRAG_CHANGED,{frag:t}),(!e||e.level!==n)&&this.hls.trigger(v.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){let e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){if(this.fragPlaying)return this.fragPlaying;let e=this.media?.currentTime||this.lastCurrentTime;return p(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){let e=this.media?.currentTime||this.lastCurrentTime;if(p(e)){let t=this.getLevelDetails(),n=this.currentFrag||(t?tn(null,t.fragments,e):null);if(n){let t=n.programDateTime;if(t!==null){let r=t+(e-n.start)*1e3;return new Date(r)}}}return null}get currentLevel(){let e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){let e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}},ru=class extends k{constructor(e,t){super(`key-loader`,t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(let t in this.keyIdToKeyInfo){let n=this.keyIdToKeyInfo[t].loader;if(n){if(e&&e!==n.context?.frag.type)return;n.abort()}}}detach(){for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=_.KEY_LOAD_ERROR,n,r,i){return new Fn({type:g.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,i=t.length;r<i;r++){let a=t[r];if(e.cc<=a.cc&&(!L(e)||!L(a)||e.sn<a.sn)||!n&&r==i-1)return this.emeController.selectKeySystemFormat(a).then(e=>{if(!this.emeController)return;a.setKeyFormat(e);let t=sr(e);if(t)return this.emeController.getKeySystemAccess([t])})}if(this.config.requireKeySystemAccessOnStart){let e=lr(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);let i=e.decryptdata;if(!i){let n=/* @__PURE__ */ Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,n))}let a=i.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`Invalid key URI: "${a}"`)));let o=iu(i),s=this.keyIdToKeyInfo[o];if((n=s)!=null&&n.decryptdata.key)return i.key=s.decryptdata.key,Promise.resolve({frag:e,keyInfo:s});if(this.emeController&&(r=s)!=null&&r.keyLoadPromise)switch(this.emeController.getKeyStatus(s.decryptdata)){case`usable`:case`usable-in-future`:return s.keyLoadPromise.then(t=>{let{keyInfo:n}=t;return i.key=n.decryptdata.key,{frag:e,keyInfo:n}})}switch(this.log(`${this.keyIdToKeyInfo[o]?`Rel`:`L`}oading${i.keyId?` keyId: `+F(i.keyId):``} URI: ${i.uri} from ${e.type} ${e.level}`),s=this.keyIdToKeyInfo[o]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case`SAMPLE-AES`:case`SAMPLE-AES-CENC`:case`SAMPLE-AES-CTR`:return i.keyFormat===`identity`?this.loadKeyHTTP(s,e):this.loadKeyEME(s,e);case`AES-128`:case`AES-256`:case`AES-256-CTR`:return this.loadKeyHTTP(s,e);default:return Promise.reject(this.createKeyLoadError(e,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){let n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&(r=t.initSegment)!=null&&r.data){let n=Fe(t.initSegment.data);if(n.length){let t=n[0];t.some(e=>e!==0)?(this.log(`Using keyId found in init segment ${F(t)}`),gr.setKeyIdForUri(e.decryptdata.uri,t)):(t=gr.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${F(t)}`)),e.decryptdata.keyId=t}}return!e.decryptdata.keyId&&!L(t)?Promise.resolve(n):(e.keyLoadPromise=this.emeController.loadKey(n).then(t=>(e.mediaKeySessionContext=t,n))).catch(n=>{throw e.keyLoadPromise=null,`data`in n&&(n.data.frag=t),n})}return Promise.resolve(n)}loadKeyHTTP(e,t){let n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((r,a)=>{let o={keyInfo:e,frag:t,responseType:`arraybuffer`,url:e.decryptdata.uri},s=n.keyLoadPolicy.default,c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};i.load(o,c,{onSuccess:(e,t,n,i)=>{let{frag:o,keyInfo:s}=n,c=iu(s.decryptdata);if(!o.decryptdata||s!==this.keyIdToKeyInfo[c])return a(this.createKeyLoadError(o,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`after key load, decryptdata unset or changed`),i));s.decryptdata.key=o.decryptdata.key=new Uint8Array(e.data),o.keyLoader=null,s.loader=null,r({frag:o,keyInfo:s})},onError:(e,n,r,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.KEY_LOAD_ERROR,/* @__PURE__ */ Error(`HTTP Error ${e.code} loading key ${e.text}`),r,E({url:o.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.KEY_LOAD_TIMEOUT,/* @__PURE__ */ Error(`key loading timed out`),r))},onAbort:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,_.INTERNAL_ABORTED,/* @__PURE__ */ Error(`key loading aborted`),r))}})})}resetLoader(e){let{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null);let a=iu(n.decryptdata)||r;delete this.keyIdToKeyInfo[a],i&&i.destroy()}};function iu(e){if(e.keyFormat!==q.FAIRPLAY){let t=e.keyId;if(t)return F(t)}return e.uri}function au(e){let{type:t}=e;switch(t){case y.AUDIO_TRACK:return b.AUDIO;case y.SUBTITLE_TRACK:return b.SUBTITLE;default:return b.MAIN}}function ou(e,t){let n=e.url;return(n===void 0||n.indexOf(`data:`)===0)&&(n=t.url),n}var su=class{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){let{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){let{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_LOADING,this.onLevelLoading,this),e.off(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){let t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(let e in this.loaders){let t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){let{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:`text`,type:y.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){let{id:n,level:r,pathwayId:i,url:a,deliveryDirectives:o,levelInfo:s}=t;this.load({id:n,level:r,pathwayId:i,responseType:`text`,type:y.LEVEL,url:a,deliveryDirectives:o,levelOrTrack:s})}onAudioTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:a,track:o}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:y.AUDIO_TRACK,url:i,deliveryDirectives:a,levelOrTrack:o})}onSubtitleTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:a,track:o}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:y.SUBTITLE_TRACK,url:i,deliveryDirectives:a,levelOrTrack:o})}onLevelsUpdated(e,t){let n=this.loaders[y.LEVEL];if(n){let e=n.context;e&&!t.levels.some(t=>t===e.levelOrTrack)&&(n.abort(),delete this.loaders[y.LEVEL])}}load(e){let t=this.hls.config,n=this.getInternalLoader(e);if(n){let t=this.hls.logger,r=n.context;if(r&&r.levelOrTrack===e.levelOrTrack&&(r.url===e.url||r.deliveryDirectives&&!e.deliveryDirectives)){r.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${r.url}`);return}t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let r;if(r=e.type===y.MANIFEST?t.manifestLoadPolicy.default:w({},t.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),p(e.deliveryDirectives?.part)){let t;if(e.type===y.LEVEL&&e.level!==null?t=this.hls.levels[e.level].details:e.type===y.AUDIO_TRACK&&e.id!==null?t=this.hls.audioTracks[e.id].details:e.type===y.SUBTITLE_TRACK&&e.id!==null&&(t=this.hls.subtitleTracks[e.id].details),t){let e=t.partTarget,n=t.targetduration;if(e&&n){let t=Math.max(e*3,n*.8)*1e3;r=w({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}let i=r.errorRetry||r.timeoutRetry||{},a={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:i.maxNumRetry||0,retryDelay:i.retryDelayMs||0,maxRetryDelay:i.maxRetryDelayMs||0};n.load(e,a,{onSuccess:(e,t,n,r)=>{let i=this.getInternalLoader(n);this.resetInternalLoader(n.type);let a=e.data;t.parsing.start=performance.now(),Tr.isMediaPlaylist(a)||n.type!==y.MANIFEST?this.handleTrackOrLevelPlaylist(e,t,n,r||null,i):this.handleMasterPlaylist(e,t,n,r)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}})}checkAutostartLoad(){if(!this.hls)return;let{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?`auto`:`force`} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){let i=this.hls,a=e.data,o=ou(e,n),s=Tr.parseMasterPlaylist(a,o);if(s.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,n,s.playlistParsingError,r,t);return}let{contentSteering:c,levels:l,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:p}=s;this.variableList=p,l.forEach(e=>{let{unknownCodecs:t}=e;if(t){let{preferManagedMediaSource:n}=this.hls.config,{audioCodec:r,videoCodec:i}=e;for(let a=t.length;a--;){let o=t[a];et(o,`audio`,n)?(e.audioCodec=r=r?`${r},${o}`:o,Qe.audio[r.substring(0,4)]=2,t.splice(a,1)):et(o,`video`,n)&&(e.videoCodec=i=i?`${i},${o}`:o,Qe.video[i.substring(0,4)]=2,t.splice(a,1))}}});let{AUDIO:m=[],SUBTITLES:h,"CLOSED-CAPTIONS":g}=Tr.parseMasterPlaylistMedia(a,o,s);m.length&&!m.some(e=>!e.url)&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(this.hls.logger.log(`[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one`),m.unshift({type:`main`,name:`main`,groupId:`main`,default:!1,autoselect:!1,forced:!1,id:-1,attrs:new G({}),bitrate:0,url:``})),i.trigger(v.MANIFEST_LOADED,{levels:l,audioTracks:m,subtitles:h,captions:g,contentSteering:c,url:o,stats:t,networkDetails:r,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,r,i){let a=this.hls,{id:o,level:s,type:c}=n,l=ou(e,n),u=p(s)?s:p(o)?o:0,d=au(n),f=Tr.parseLevelPlaylist(e.data,l,u,d,0,this.variableList);if(c===y.MANIFEST){let e={attrs:new G({}),bitrate:0,details:f,name:``,url:l};f.requestScheduled=t.loading.start+qr(f,0),a.trigger(v.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:l,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=f,this.handlePlaylistLoaded(f,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.MANIFEST_PARSING_ERROR,fatal:t.type===y.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let a=`A network ${n?`timeout`:`error`+(r?` (status `+r.code+`)`:``)} occurred while loading ${e.type}`;e.type===y.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===y.AUDIO_TRACK||e.type===y.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);let o=Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let s=_.UNKNOWN,c=!1,l=this.getInternalLoader(e);switch(e.type){case y.MANIFEST:s=n?_.MANIFEST_LOAD_TIMEOUT:_.MANIFEST_LOAD_ERROR,c=!0;break;case y.LEVEL:s=n?_.LEVEL_LOAD_TIMEOUT:_.LEVEL_LOAD_ERROR,c=!1;break;case y.AUDIO_TRACK:s=n?_.AUDIO_TRACK_LOAD_TIMEOUT:_.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case y.SUBTITLE_TRACK:s=n?_.SUBTITLE_TRACK_LOAD_TIMEOUT:_.SUBTITLE_LOAD_ERROR,c=!1}l&&this.resetInternalLoader(e.type);let u={type:g.NETWORK_ERROR,details:s,fatal:c,url:e.url,loader:l,context:e,error:o,networkDetails:t,stats:i};r&&(u.response=E({url:t?.url||e.url,data:void 0},r)),this.hls.trigger(v.ERROR,u)}handlePlaylistLoaded(e,t,n,r,i,a){let o=this.hls,{type:s,level:c,levelOrTrack:l,id:u,groupId:d,deliveryDirectives:f}=r,p=ou(t,r),m=au(r),h=typeof r.level==`number`&&m===b.MAIN?c:void 0,x=e.playlistParsingError;if(x){if(this.hls.logger.warn(`${x} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:x,reason:x.message,response:t,context:r,level:h,parent:m,networkDetails:i,stats:n});return}e.playlistParsingError=null}if(!e.fragments.length){let a=e.playlistParsingError=/* @__PURE__ */ Error(`No Segments found in Playlist`);o.trigger(v.ERROR,{type:g.NETWORK_ERROR,details:_.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:a,reason:a.message,response:t,context:r,level:h,parent:m,networkDetails:i,stats:n});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),s){case y.MANIFEST:case y.LEVEL:if(h){if(!l)h=0;else if(l!==o.levels[h]){let e=o.levels.indexOf(l);e>-1&&(h=e)}}o.trigger(v.LEVEL_LOADED,{details:e,levelInfo:l||o.levels[0],level:h||0,id:u||0,stats:n,networkDetails:i,deliveryDirectives:f,withoutMultiVariant:s===y.MANIFEST});break;case y.AUDIO_TRACK:o.trigger(v.AUDIO_TRACK_LOADED,{details:e,track:l,id:u||0,groupId:d||``,stats:n,networkDetails:i,deliveryDirectives:f});break;case y.SUBTITLE_TRACK:o.trigger(v.SUBTITLE_TRACK_LOADED,{details:e,track:l,id:u||0,groupId:d||``,stats:n,networkDetails:i,deliveryDirectives:f})}}},$=class e{static get version(){return gi}static isMSESupported(){return $l()}static isSupported(){return eu()}static getMediaSource(){return re()}static get Events(){return v}static get MetadataSchema(){return ea}static get ErrorTypes(){return g}static get ErrorDetails(){return _}static get DefaultConfig(){return e.defaultConfig?e.defaultConfig:Il}static set DefaultConfig(t){e.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new hi,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;let n=this.logger=ne(t.debug||!1,`Hls instance`,t.assetPlayerId),r=this.config=Rl(e.DefaultConfig,t,n);this.userConfig=t,r.progressive&&Bl(r,n);let{abrController:i,bufferController:a,capLevelController:o,errorController:s,fpsController:c}=r,l=new s(this),u=this.abrController=new i(this),d=new yn(this),f=r.interstitialsController,p=f?this.interstitialsController=new f(this,e):null,m=this.bufferController=new a(this,d),h=this.capLevelController=new o(this),g=new c(this),_=new su(this),y=r.contentSteeringController,b=y?new y(this):null,x=this.levelController=new Xl(this,b),S=new Jl(this),C=new ru(this.config,this.logger),w=this.streamController=new nu(this,d,C),T=this.gapController=new Vl(this,d);h.setStreamController(w),g.setStreamController(w);let E=[_,x,w];p&&E.splice(1,0,p),b&&E.splice(1,0,b),this.networkControllers=E;let D=[u,m,T,h,g,S,d];this.audioTrackController=this.createController(r.audioTrackController,E);let O=r.audioStreamController;O&&E.push(this.audioStreamController=new O(this,d,C)),this.subtitleTrackController=this.createController(r.subtitleTrackController,E);let k=r.subtitleStreamController;k&&E.push(this.subtititleStreamController=new k(this,d,C)),this.createController(r.timelineController,D),C.emeController=this.emeController=this.createController(r.emeController,D),this.cmcdController=this.createController(r.cmcdController,D),this.latencyController=this.createController(Yl,D),this.coreComponents=D,E.push(l);let A=l.onErrorOut;typeof A==`function`&&this.on(v.ERROR,A,l),this.on(v.MANIFEST_LOADED,_.onManifestLoaded,_)}createController(e,t){if(e){let n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error(`An internal error happened while handling event `+e+`. Error message: "`+t.message+`". Here is a stacktrace:`,t),!this.triggeringException){this.triggeringException=!0;let n=e===v.ERROR;this.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log(`destroy`),this.trigger(v.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;let e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||`media`in e&&!e.media){let t=/* @__PURE__ */ Error(`attachMedia failed: invalid argument (${e})`);this.trigger(v.ERROR,{type:g.OTHER_ERROR,details:_.ATTACH_MEDIA_ERROR,fatal:!0,error:t});return}this.logger.log(`attachMedia`),this._media&&(this.logger.warn(`media must be detached before attaching`),this.detachMedia());let t=`media`in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(v.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log(`detachMedia`),this.trigger(v.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;let e=this.bufferController.transferMedia();return this.trigger(v.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();let t=this.media,n=this._url,r=this._url=fe.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(v.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?`, <skip seek to start>`:``)})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log(`stopLoad`),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log(`resume buffering`),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log(`pause buffering`),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){let e={[b.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[b.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[b.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log(`swapAudioCodec`),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log(`recoverMediaError`);let e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||=this._sessionId=nc(),e}get levels(){return this.levelController.levels||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){let e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){let t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){let{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Ot(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){let{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;let n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){let{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this,r;if(r=t===-1&&e!=null&&e.length?e.length-1:t,n)for(let t=r;t--;){let r=e[t].attrs[`HDCP-LEVEL`];if(r&&r<=n)return t}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){return this.audioTrackController?.setAudioOption(e)||null}setSubtitleOption(e){return this.subtitleTrackController?.setSubtitleOption(e)||null}get allAudioTracks(){let e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){let e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){let e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){let t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){let e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){let e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){let e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){let t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){let e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){let t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){return this.interstitialsController?.interstitialsManager||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return xt(e,Vt(t),navigator.mediaCapabilities)}};$.defaultConfig=void 0;function cu(e){class t extends e{#e=null;#t=null;#n=!1;constructor(...e){super(...e),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#r()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#o()),this.engine?.on($.Events.DESTROYING,()=>this.#o()),this.engine?.on($.Events.MANIFEST_LOADING,(e,t)=>{this.#e&&(this.#e.src=t.url)})}get disableRemotePlayback(){return super.disableRemotePlayback}set disableRemotePlayback(e){let t=e!==this.#n;this.#n=e,super.disableRemotePlayback=e,t&&this.#e&&this.#r()}#r(){this.#o();let e=this.target;e&&i(e)&&(this.#n||(e.disableRemotePlayback=!1),this.#i(e),this.#a(e))}#i(e){this.#e=document.createElement(`source`),this.#e.type=`application/x-mpegURL`,this.#e.src=this.engine?.url??``,e.append(this.#e)}#a(e){let t=()=>{e.webkitCurrentPlaybackTargetIsWireless&&this.engine?.stopLoad()};this.#t=new AbortController,n(e,`webkitcurrentplaybacktargetiswirelesschanged`,t,{signal:this.#t.signal}),t()}#o(){this.#t?.abort(),this.#t=null,this.#e?.remove(),this.#e=null}}return t}function lu(e){if(e===void 0)return 1/0;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?Math.ceil(t*16/9)*t:1/0}function uu(e,t){let n=lu(t);if(n===1/0||e.length===0)return;let r=e.findIndex(e=>(e.width??0)*(e.height??0)>n);return r===-1?e.length-1:Math.max(0,r-1)}function du(e,t){let n=lu(t);if(n===1/0||e.length===0)return;let r=e.findIndex(e=>(e.width??0)*(e.height??0)>=n);return r===-1?e.length-1:r}function fu(e,t=$.DefaultConfig.capLevelController){return class extends t{#e;#t=!1;#n=!1;constructor(t){super(t),this.#e=t,e.controller=this,t.on($.Events.MANIFEST_PARSED,this.#o),t.on($.Events.LEVELS_UPDATED,this.#o)}destroy(){this.#e.off($.Events.MANIFEST_PARSED,this.#o),this.#e.off($.Events.LEVELS_UPDATED,this.#o),e.controller===this&&(e.controller=void 0),super.destroy()}startCapping(){this.#t=!0,super.startCapping()}stopCapping(){this.#t=!1,super.stopCapping()}get mediaWidth(){return this.#r?super.mediaWidth:1/0}get mediaHeight(){return this.#r?super.mediaHeight:1/0}get#r(){return e.capToPlayerSize&&!this.#n}#i(e){this.#n=!0;try{return super.getMaxLevel(e)}finally{this.#n=!1}}getMaxLevel(t){let{levels:n}=this.#e,r=super.getMaxLevel(t);if(e.capToPlayerSize&&r>=0){let i=du(n,e.minAutoResolution);i!==void 0&&(r=Math.min(Math.max(r,i),this.#i(t)))}let i=uu(n,e.maxAutoResolution);return i!==void 0&&(r=Math.min(r,i)),Math.min(r,t)}detectPlayerSize(){super.detectPlayerSize(),!(super.mediaWidth>0&&super.mediaHeight>0)&&this.#a()}apply(){if(this.#t){this.detectPlayerSize();return}this.#a()}#a(){let{levels:t}=this.#e;t?.length&&(this.#e.autoLevelCapping=uu(t,e.maxAutoResolution)??-1)}#o=()=>this.apply()}}function pu(e){return e?.toLowerCase()===`use-credentials`}function mu(e,t){let{xhrSetup:n,fetchSetup:r}=e;return{async xhrSetup(e,r){pu(t())&&(e.withCredentials=!0),await n?.(e,r)},fetchSetup(e,n){return pu(t())&&(n.credentials=`include`),r?r(e,n):new Request(e.url,n)}}}function hu(t){class n extends t{#e=null;#t=null;constructor(...t){super(...t);let{engine:n}=this;n&&(n.on($.Events.MANIFEST_LOADING,()=>this.#i()),n.on($.Events.MANIFEST_LOADED,(t,n)=>{let r=n.sessionData?.[u]?.URI;this.#i(),this.#e=e(r)&&r?gu(r,n.url):null,this.#n()}),n.on($.Events.MEDIA_ATTACHED,()=>this.#n()),n.on($.Events.MEDIA_DETACHED,()=>this.#r()),n.on($.Events.DESTROYING,()=>this.#i()))}#n(){let e=this.target;!e||!this.#e||this.#t||(this.#t=new AbortController,d(e,this.#e,this.#t.signal,{preferredLanguage:this.engine?.config.subtitlePreference?.lang,credentials:pu(e.crossOrigin)?`include`:void 0}))}#r(){this.#t?.abort(),this.#t=null}#i(){this.#e=null,this.#r()}}return n}function gu(e,t){try{return new URL(e,t).href}catch{return null}}function _u(e){e.config.emeEnabled&&(e.config.requestMediaKeySystemAccessFunc=e.userConfig.requestMediaKeySystemAccessFunc??vu)}const vu=(e,t)=>{let n=e.includes(`widevine`)?yu(t):t;return navigator.requestMediaKeySystemAccess(e,n)};function yu(e){return[...e.map(e=>{let{videoCapabilities:t}=e;return t?{...e,videoCapabilities:t.map(e=>({...e,robustness:`HW_SECURE_ALL`}))}:e}),...e]}const bu={[$.ErrorTypes.NETWORK_ERROR]:o.MEDIA_ERR_NETWORK,[$.ErrorTypes.MEDIA_ERROR]:o.MEDIA_ERR_DECODE,[$.ErrorTypes.KEY_SYSTEM_ERROR]:o.MEDIA_ERR_ENCRYPTED,[$.ErrorTypes.MUX_ERROR]:o.MEDIA_ERR_DECODE,[$.ErrorTypes.OTHER_ERROR]:o.MEDIA_ERR_CUSTOM};function xu(e){class t extends e{#e=null;#t=null;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>this.#r()),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#r()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#n()),this.engine?.on($.Events.DESTROYING,()=>this.#n())}get error(){return this.#t}#n(){this.#e?.abort(),this.#e=null}#r(){this.#e?.abort(),this.#e=new AbortController;let{engine:e,target:t}=this;if(!e||!t)return;let n=(e,t)=>{if(!t.fatal)return;let n=bu[t.type]??o.MEDIA_ERR_CUSTOM,r=new o(t.error?.message,n,!0,t.details);r.data=t,this.#t=r;let i=new ErrorEvent(`error`,{error:r,message:r.message});this.dispatchEvent(i)};e.on($.Events.ERROR,n),this.#e.signal.addEventListener(`abort`,()=>{e.off($.Events.ERROR,n),this.#t=null},{once:!0})}}return t}function Su(e){class t extends e{#e=NaN;#t=null;#n=!1;constructor(...e){super(...e);let{engine:t}=this;t?.on($.Events.MANIFEST_LOADING,()=>{this.#i(),this.#s()}),t?.on($.Events.MEDIA_ATTACHED,()=>this.#s()),t?.on($.Events.MEDIA_DETACHED,()=>this.#c()),t?.on($.Events.DESTROYING,()=>{this.#i(),this.#c()}),t?.on($.Events.LEVEL_LOADED,(e,t)=>{this.#r(t.details),this.#n&&this.#l()})}get targetLiveWindow(){return this.#e}get liveEdgeStart(){if(Number.isNaN(this.#e))return NaN;let{target:e}=this;return e?.seekable.length?this.engine?.liveSyncPosition??NaN:NaN}#r(e){if(!e.live)return this.#i();let t=Cu(e);this.#a(t),this.#o(t.targetLiveWindow)}#i(){this.#o(NaN)}#a({streamType:e,lowLatency:t}){if(e===s.LIVE){let e=this.engine;if(!e)return;t?(e.config.backBufferLength=e.userConfig.backBufferLength??4,e.config.maxFragLookUpTolerance=e.userConfig.maxFragLookUpTolerance??.001,e.config.abrBandWidthUpFactor=e.userConfig.abrBandWidthUpFactor??e.config.abrBandWidthFactor):e.config.backBufferLength=e.userConfig.backBufferLength??8}}#o(e){Object.is(this.#e,e)||(this.#e=e,this.dispatchEvent(new Event(`targetlivewindowchange`)))}#s(){this.#c();let e=this.target;e&&!e.autoplay&&(this.#t=new AbortController,e.addEventListener(`play`,()=>{this.#n=!0,this.#l()},{signal:this.#t.signal,once:!0}))}#c(){this.#t?.abort(),this.#t=null,this.#n=!1}#l(){let e=this.target;if(!e)return;let{liveEdgeStart:t}=this;Number.isFinite(t)&&(e.currentTime<t&&(e.currentTime=t),this.#n=!1)}}return t}const Cu=e=>{let t=e.type;return{streamType:wu(t),targetLiveWindow:Tu(t),lowLatency:!!e.partList?.length}},wu=e=>e===`VOD`?s.ON_DEMAND:s.LIVE,Tu=e=>e===`EVENT`?1/0:e===`VOD`?NaN:0;function Eu(e){return`${e.url[0]??``}|${e.width}x${e.height}|${e.videoCodec}|${e.bitrate}`}function Du(e){return e.default?`main`:`alternative`}function Ou(e){class t extends e{#e=/* @__PURE__ */ new Map;#t=null;constructor(...e){super(...e);let{engine:t}=this;t&&(t.on($.Events.MANIFEST_PARSED,this.#n),t.on($.Events.AUDIO_TRACKS_UPDATED,this.#r),t.on($.Events.AUDIO_TRACK_SWITCHING,this.#i),t.on($.Events.AUDIO_TRACK_SWITCHED,this.#i),t.on($.Events.LEVELS_UPDATED,this.#s),t.on($.Events.LEVEL_SWITCHED,this.#c),t.once($.Events.DESTROYING,this.#u),this.audioTracks.addEventListener(`change`,this.#o),this.videoRenditions.addEventListener(`change`,this.#l))}#n=(e,t)=>{this.#d(),this.#e.clear();let n=this.addVideoTrack(`main`);this.#t=n,n.selected=!0;for(let[e,r]of t.levels.entries()){let t=n.addRendition(r.url[0]??``,r.width,r.height,r.videoCodec,r.bitrate);this.#e.set(Eu(r),`${e}`),t.id=`${e}`}};#r=(e,t)=>{if(!this.#a(t.audioTracks)){this.#p();for(let e of t.audioTracks){let t=this.addAudioTrack(Du(e),e.name,e.lang);t.id=`${e.id}`}}};#i=(e,t)=>{let n=`${t.id}`;for(let e of this.audioTracks)e.enabled=e.id===n};#a(e){let t=[...this.audioTracks];return t.length===e.length&&e.every((e,n)=>{let r=t[n];return r?.id===`${e.id}`&&r.kind===Du(e)&&r.label===(e.name??``)&&r.language===(e.lang??``)})}#o=()=>{let{engine:e}=this;if(!e)return;let t=[...this.audioTracks].filter(e=>e.enabled),n=t.find(t=>Number(t.id)!==e.audioTrack)??t[0];if(!n?.id)return;let r=Number(n.id),i=e.audioTracks.map(e=>e.id);r!==e.audioTrack&&i.includes(r)&&(e.audioTrack=r);for(let e of t)e!==n&&(e.enabled=!1)};#s=(e,t)=>{if(!this.#t)return;let n=t.levels.map(e=>this.#e.get(Eu(e)));for(let e of this.videoRenditions)e.id&&!n.includes(e.id)&&this.#t.removeRendition(e)};#c=(e,t)=>{let n=`${t.level}`;for(let e of this.videoRenditions)e.active=e.id===n};#l=()=>{let{engine:e}=this;if(!e)return;let t=this.videoRenditions.selectedIndex;t!==e.manualLevel&&(e.nextLevel=t)};#u=()=>{let{engine:e}=this;e?.off($.Events.MANIFEST_PARSED,this.#n),e?.off($.Events.AUDIO_TRACKS_UPDATED,this.#r),e?.off($.Events.AUDIO_TRACK_SWITCHING,this.#i),e?.off($.Events.AUDIO_TRACK_SWITCHED,this.#i),e?.off($.Events.LEVELS_UPDATED,this.#s),e?.off($.Events.LEVEL_SWITCHED,this.#c),e?.off($.Events.DESTROYING,this.#u),this.audioTracks.removeEventListener(`change`,this.#o),this.videoRenditions.removeEventListener(`change`,this.#l),this.#d(),this.#e.clear(),this.#t=null};#d(){this.#f(),this.#p()}#f(){for(let e of this.videoTracks)this.removeVideoTrack(e)}#p(){for(let e of this.audioTracks)this.removeAudioTrack(e)}}return t}function ku(e){class t extends e{constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADED,()=>this.#e()),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#e())}#e(){let e=this.target;e&&[...e.textTracks].forEach(t=>{if(t.kind!==`metadata`&&t.kind!==`chapters`)return;let n=`track`;t.kind&&(n+=`[kind="${t.kind}"]`),t.label&&(n+=`[label="${t.label}"]`);let r=e.querySelector(n);if(!r)return;if((r.getAttribute(`src`)??``)&&r.readyState===2&&!t.cues?.length){let t=r.cloneNode();e.replaceChild(t,r)}let i=e.querySelector(n);i?.default&&i.track.mode!==`hidden`&&(i.track.mode=`hidden`)})}}return t}function Au(e){class t extends e{#e=null;#t=`metadata`;#n;#r;#i=!1;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>{this.#i=!1,this.#o()}),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#o()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#a()),this.engine?.on($.Events.DESTROYING,()=>this.#a())}get preload(){return this.#t}set preload(e){this.#t=e,this.#o()}#a(){this.#e?.abort(),this.#e=null,this.#i=!1}#o(){this.#e?.abort();let e=this.target;if(!e)return;e.preload!==this.preload&&(e.preload=this.preload);let{engine:t}=this;if(!t)return;this.#n??=t.config.maxBufferLength,this.#r??=t.config.maxBufferSize;let n=this.#n,r=this.#r,i=(e,t)=>{let{engine:i}=this;if(i){if(i.config.maxBufferLength=e??n,i.config.maxBufferSize=t??r,this.#i){i.resumeBuffering?.();return}this.#i=!0,i.startLoad()}};if(this.preload===`auto`||!e.paused){i();return}this.preload===`metadata`&&i(1,1),this.#e=new AbortController,e.addEventListener(`play`,()=>i(),{signal:this.#e.signal,once:!0})}}return t}function ju(e){class t extends e{#e=s.UNKNOWN;#t=!1;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>this.#n(s.UNKNOWN)),this.engine?.on($.Events.DESTROYING,()=>this.#n(s.UNKNOWN)),this.engine?.on($.Events.LEVEL_LOADED,(e,t)=>{this.#n(t.details.live?s.LIVE:s.ON_DEMAND)})}get streamType(){return this.#e}set streamType(e){if(e===s.UNKNOWN){this.#t=!1,this.#r(s.UNKNOWN);return}this.#t=!0,this.#r(e)}#n(e){this.#t||this.#r(e)}#r(e){this.#e!==e&&(this.#e=e,this.dispatchEvent(new Event(`streamtypechange`)))}}return t}const Mu=`data-removeondestroy`;function Nu(e,t){let n=e?Fu(e):[];try{t()}finally{for(let e of n)Iu(e)}}function Pu(e){let t=e?.querySelectorAll(`track[${Mu}]`)??[];for(let e of t)e.track.mode=`disabled`,e.remove()}function Fu(e){let t=[];for(let n of e.querySelectorAll(`track`)){if(n.hasAttribute(Mu))continue;let{track:e}=n;(e.mode!==`disabled`||n.readyState===2)&&t.push({track:e,mode:e.mode,cues:Lu(e,()=>Array.from(e.cues??[]))})}return t}function Iu({track:e,mode:t,cues:n}){e.mode!==t&&(e.mode=t),n.length&&Lu(e,()=>{let t=new Set(e.cues??[]);for(let r of n)t.has(r)||e.addCue(r)})}function Lu(e,t){let{mode:n}=e;n===`disabled`&&(e.mode=`hidden`);try{return t()}finally{n===`disabled`&&(e.mode=n)}}function Ru(e){class t extends e{#e=null;constructor(...e){super(...e),this.engine?.on($.Events.MANIFEST_LOADING,()=>{Pu(this.target),this.#n()}),this.engine?.on($.Events.MEDIA_ATTACHED,()=>this.#n()),this.engine?.on($.Events.MEDIA_DETACHED,()=>this.#t()),this.engine?.on($.Events.DESTROYING,()=>this.#t())}#t(){this.#e?.abort(),this.#e=null,Pu(this.target)}#n(){this.#e?.abort(),this.#e=new AbortController;let{signal:e}=this.#e,{engine:t}=this;if(!t||!this.target)return;let i=this.target,a=(e,n)=>{Pu(this.target);for(let e of n.tracks){let n=e.subtitleTrack??e.closedCaptions,r=t.subtitleTracks.findIndex(({lang:t,name:r,type:i})=>t===n?.lang&&r===e.label&&i.toLowerCase()===e.kind),a=e._id??e.default?`default`:`${e.kind}${r}`;zu(i,e.kind,e.label,n?.lang,a,e.default)}},o=(e,{track:t,cues:n})=>{let r=i.textTracks.getTrackById(t);if(!r)return;let a=r.mode===`disabled`;a&&(r.mode=`hidden`),n.forEach(e=>{r.cues?.getCueById(e.id)||r.addCue(e)}),a&&(r.mode=`disabled`)};t.on($.Events.NON_NATIVE_TEXT_TRACKS_FOUND,a),t.on($.Events.CUES_PARSED,o),n(i.textTracks,`change`,()=>{if(!t.subtitleTracks.length)return;let e=Array.from(i.textTracks).find(e=>e.id&&e.mode===`showing`&&r(e));if(!e)return;let n=t.subtitleTracks[t.subtitleTrack],a=n?n.default?`default`:`${t.subtitleTracks[t.subtitleTrack]?.type.toLowerCase()}${t.subtitleTrack}`:void 0;if(t.subtitleTrack<0||e?.id!==a){let n=t.subtitleTracks.findIndex(({lang:t,name:n,type:r,default:i})=>e.id==="default"&&i||t===e.language&&n===e.label&&r.toLowerCase()===e.kind);t.subtitleTrack=n}e?.id===a&&e.cues&&Array.from(e.cues).forEach(t=>{e.addCue(t)})},{signal:e}),e.addEventListener(`abort`,()=>{t.off($.Events.NON_NATIVE_TEXT_TRACKS_FOUND,a),t.off($.Events.CUES_PARSED,o)},{once:!0})}}return t}function zu(e,t,n,i,a,o){let s=document.createElement(`track`);return s.kind=t,s.label=n,i&&(s.srclang=i),a&&(s.id=a),o&&(s.default=!0),s.track.mode=r({kind:t})?`disabled`:`hidden`,s.setAttribute(Mu,``),e.append(s),s.track}const Bu={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,autoStartLoad:!1},Vu=cu(Au(Su(ju(Ou(hu(ku(Ru(xu(l(class extends c{#e=null;#t={maxAutoResolution:void 0,capToPlayerSize:!0,minAutoResolution:`720p`};constructor(e){super();let t={...Bu,...e.config};this.#e=new $({...t,capLevelController:fu(this.#t,t.capLevelController),...mu(t,()=>this.target?.crossOrigin)}),_u(this.#e)}get engine(){return this.#e}get maxAutoResolution(){return this.#t.maxAutoResolution}set maxAutoResolution(e){this.#t.maxAutoResolution!==e&&(this.#t.maxAutoResolution=e,this.#t.controller?.apply())}get capRenditionToPlayerSize(){return this.#t.capToPlayerSize}set capRenditionToPlayerSize(e){let t=e??!0;this.#t.capToPlayerSize!==t&&(this.#t.capToPlayerSize=t,this.#t.controller?.apply())}get minAutoResolution(){return this.#t.minAutoResolution??`720p`}set minAutoResolution(e){let t=e??`720p`;this.#t.minAutoResolution!==t&&(this.#t.minAutoResolution=t,this.#t.controller?.apply())}get src(){return this.#e?.url??``}set src(e){Nu(this.target,()=>this.#e?.loadSource(e))}attach(e){super.attach(e),Nu(e,()=>this.#e?.attachMedia(e))}detach(){Nu(this.target,()=>this.#e?.detachMedia()),super.detach()}destroy(){this.detach(),this.#e?.destroy(),this.#e=null}}))))))))));var Hu=class extends Vu{};const Uu={MSE:`mse`,NATIVE:`native`},Wu={M3U8:`application/vnd.apple.mpegurl`,MP4:`video/mp4`},Gu=/* @__PURE__ */ new Set([Wu.M3U8,`application/x-mpegurl`,`application/mpegurl`,`audio/mpegurl`,`audio/x-mpegurl`]),Ku=/* @__PURE__ */ new Set([Wu.MP4]),qu=s;var Ju=class extends Event{},Yu=class e extends c{static{this.defaultProps={src:``,source:null,preload:`metadata`,streamType:s.UNKNOWN,disableRemotePlayback:!1}}#e=null;#t=null;#n=e.defaultProps.src;#r=e.defaultProps.source;#i=e.defaultProps.preload;#a=e.defaultProps.streamType;#o=!1;#s;#c;#l;constructor(){super(),this.addEventListener(`loadstart`,this.#f)}attach(e){this.#t=e,super.attach(e),this.#e?.attach(e)}detach(){this.#e?.detach(),super.detach(),this.#t=null}destroy(){this.detach(),this.#g(),super.destroy(),this.removeEventListener(`loadstart`,this.#f)}get engine(){return this.#e?.engine??null}get error(){return this.#e?.error??null}get videoTracks(){return this.#e instanceof Hu?this.#e.videoTracks:void 0}get audioTracks(){return this.#e instanceof Hu?this.#e.audioTracks:void 0}get videoRenditions(){return this.#e instanceof Hu?this.#e.videoRenditions:void 0}get audioRenditions(){return this.#e instanceof Hu?this.#e.audioRenditions:void 0}get src(){return this.#n}set src(e){let{type:t,preferPlayback:n,drm:r,engine:i,maxAutoResolution:a,capRenditionToPlayerSize:o,minAutoResolution:s}=this.#r??{},c={...t&&{type:t},...n&&{preferPlayback:n},...r&&{drm:r},...i&&{engine:i},...a&&{maxAutoResolution:a},...o!==void 0&&{capRenditionToPlayerSize:o},...s&&{minAutoResolution:s},...e&&{src:e}};this.source=Object.keys(c).length>0?c:null}get source(){return this.#r}set source(e){let t=e??null;if(t===this.#r)return;let n=t?.src??``,r=this.#n!==n;this.#r=t,this.#n=n,this.#d(),this.dispatchEvent(new Event(`sourcechange`)),(r||this.#m(this.#h()))&&this.#p()}get preload(){return this.#i}set preload(e){this.#i=e,this.#e&&(this.#e.preload=e)}get disableRemotePlayback(){return super.disableRemotePlayback}set disableRemotePlayback(e){this.#l=e,super.disableRemotePlayback=e,this.#e instanceof Hu&&(this.#e.disableRemotePlayback=e)}get streamType(){return this.#e?.streamType??this.#a}set streamType(e){if(this.#o=e!==qu.UNKNOWN,this.#e){this.#e.streamType=e,this.#a=this.#e.streamType;return}this.#a!==e&&(this.#a=e,this.dispatchEvent(new Ju(`streamtypechange`)))}get liveEdgeStart(){return this.#e?.liveEdgeStart??NaN}get targetLiveWindow(){return this.#e?.targetLiveWindow??NaN}async load(){if(this.#s=null,this.remote.state===`connected`)return this.dispatchEvent(new Ju(`loadstart`)),super.load();if(this.#m(this.#h())){this.#g(),this.#c=this.#h();let{type:e,preferPlayback:t,drm:n,engine:r,maxAutoResolution:i,capRenditionToPlayerSize:a,minAutoResolution:o}=this.#r??{},{hlsJs:s,nativeHls:c}=r??{},l=Zu(e,this.src),u=$.isSupported()&&l===Wu.M3U8&&t!==Uu.NATIVE;this.#e=u?new Hu({config:Xu(s,n)}):this.#u(n,c,s),f(this.#e,this),this.#o&&(this.#e.streamType=this.#a),this.#e.preload=this.preload,this.#d(),this.#l!==void 0&&this.#e instanceof Hu&&(this.#e.disableRemotePlayback=this.#l),this.#t&&this.#e.attach(this.#t)}this.#e&&(this.dispatchEvent(new Ju(`loadstart`)),this.#e.src=this.src)}#u(e,t,n){let r=new a,i={...e&&{drm:e},...t&&{engine:{nativeHls:t}}};return Object.keys(i).length>0&&(r.source=i),r}#d(){this.#e instanceof Hu&&(this.#e.maxAutoResolution=this.#r?.maxAutoResolution,this.#e.capRenditionToPlayerSize=this.#r?.capRenditionToPlayerSize,this.#e.minAutoResolution=this.#r?.minAutoResolution)}#f=e=>{e instanceof Ju||e.stopImmediatePropagation()};async#p(){this.#s||(await(this.#s=Promise.resolve()),this.#s=null,this.load())}#m(e){return!t(this.#c,e)}#h(){let{type:e,preferPlayback:t,drm:n,engine:r}=this.#r??{};return{drm:n,engine:r,preferPlayback:t,contentType:Zu(e,this.src)}}#g(){this.#e?.destroy(),this.#e=null,this.#c=null,this.#s=null,this.#o||(this.#a=qu.UNKNOWN)}};function Xu(e,t){let n=e?.drmSystems??t;return!n||Object.keys(n).length===0?{...e}:{emeEnabled:!0,...e,drmSystems:n}}function Zu(e,t){if(!e)return Qu(t);let n=(e.split(`;`)[0]??``).trim().toLowerCase();if(Gu.has(n))return Wu.M3U8;if(Ku.has(n))return Wu.MP4}function Qu(e){return(e.split(/[?#]/)[0]??``).endsWith(`.mp4`)?Wu.MP4:Wu.M3U8}export{Yu as t};
+//# sourceMappingURL=adapter-B_5kn1ML.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/adapter-CbeHSDev.js b/web/vendor/videojs/10.2.0/adapter-CU0vk5zH.js
similarity index 98%
rename from web/vendor/videojs/10.1.0/adapter-CbeHSDev.js
rename to web/vendor/videojs/10.2.0/adapter-CU0vk5zH.js
index 8cf361781..44b087b89 100644
--- a/web/vendor/videojs/10.1.0/adapter-CbeHSDev.js
+++ b/web/vendor/videojs/10.2.0/adapter-CU0vk5zH.js
@@ -1,2 +1,2 @@
-import{t as e}from"./webkit-DljEkldb.js";import{t}from"./media-error-CtsbOTR1.js";import{n}from"./types-HOYOipK7.js";import{t as r}from"./html-video-adapter-BGKgkryA.js";import{t as i}from"./session-data-B6deNOmy.js";import{n as a,t as o}from"./load-chapters-tracks-D1x4MkCp.js";const s={FAIRPLAY:`com.apple.fps`,WIDEVINE:`com.widevine.alpha`,PLAYREADY:`com.microsoft.playready`,CLEARKEY:`org.w3.clearkey`},c=`application/vnd.apple.mpegurl`,l={MISSING_CONFIGURATION:`drmMissingConfiguration`,UNSUPPORTED_KEY_SYSTEM:`drmUnsupportedKeySystem`,CERTIFICATE_REQUEST_FAILED:`drmCertificateRequestFailed`,SERVER_CERTIFICATE_FAILED:`drmServerCertificateFailed`,GENERATE_REQUEST_FAILED:`drmGenerateRequestFailed`,LICENSE_REQUEST_FAILED:`drmLicenseRequestFailed`,UPDATE_LICENSE_FAILED:`drmUpdateLicenseFailed`,CDM_ERROR:`drmCdmError`,OUTPUT_RESTRICTED:`drmOutputRestricted`},u={MISSING_CONFIGURATION:`This media is DRM-protected, but no DRM license server was configured for it.`,MISSING_CERTIFICATE_URL:`This media is DRM-protected, but no DRM application certificate was configured for it.`,UNSUPPORTED_KEY_SYSTEM:`This browser cannot play DRM-protected content with its current security configuration. Try another browser.`,CERTIFICATE_REQUEST_FAILED:`The DRM application certificate could not be loaded.`,SERVER_CERTIFICATE_FAILED:`The DRM application certificate was rejected. It may no longer be valid.`,GENERATE_REQUEST_FAILED:`A DRM license could not be requested for this media.`,LICENSE_REQUEST_FAILED:`The DRM license could not be loaded.`,UPDATE_LICENSE_FAILED:`The DRM license was rejected for this media.`,CDM_ERROR:`The DRM Content Decryption Module failed. Try reloading the page, updating your browser, or another browser.`,OUTPUT_RESTRICTED:`This output is not secure enough for DRM playback. The video may render as a black screen.`};function d(e,n,r=!0){return new t(e,t.MEDIA_ERR_ENCRYPTED,r,n)}function f(e,n,r){if(e instanceof t)return e;let i=d(n,r);return i.data=e,i}async function p({config:e,signal:t}){let{serverCertificateUrl:n}=e;if(!n)return null;let r=await fetch(n,{signal:t}).catch(e=>{throw f(e,u.CERTIFICATE_REQUEST_FAILED,l.CERTIFICATE_REQUEST_FAILED)});if(!r.ok)throw d(u.CERTIFICATE_REQUEST_FAILED,l.CERTIFICATE_REQUEST_FAILED);return r.arrayBuffer()}async function m({config:e,signal:t},n){let r=await fetch(e.licenseUrl,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:n,signal:t}).catch(e=>{throw f(e,u.LICENSE_REQUEST_FAILED,l.LICENSE_REQUEST_FAILED)});if(!r.ok)throw d(u.LICENSE_REQUEST_FAILED,l.LICENSE_REQUEST_FAILED);return new Uint8Array(await r.arrayBuffer())}function h(e){return e.toLowerCase().includes(`.m3u8`)}function g(e){return e.includes(`#EXT-X-STREAM-INF`)}function _(e,t){let n=e.split(/\r?\n/),r=n.findIndex(e=>e.startsWith(`#EXT-X-STREAM-INF`));if(r===-1)return null;let i=n.slice(r+1).map(e=>e.trim()).find(e=>e&&!e.startsWith(`#`));if(!i)return null;try{return new URL(i,t).toString()}catch{return null}}function v(e){return new RegExp(String.raw`(?:^|[:,\s])${e}\s*=\s*([0-9.]+)\s*(?=[,]|$)`,`i`)}const y=v(`PART-TARGET`),b=v(`HOLD-BACK`),x=v(`PART-HOLD-BACK`);function S(e,t){let n=t.exec(e);if(!n)return;let r=Number(n[1]);return Number.isFinite(r)?r:void 0}function C(e){let t=e.split(/\r?\n/),n,r=!1,i,a,o,s;for(let e of t){let t=e.trim();if(t.startsWith(`#EXT-X-PLAYLIST-TYPE:`))n=t.slice(21).trim().toUpperCase();else if(t===`#EXT-X-ENDLIST`)r=!0;else if(t.startsWith(`#EXT-X-TARGETDURATION:`)){let e=Number(t.slice(22));Number.isFinite(e)&&(i=e)}else t.startsWith(`#EXT-X-PART-INF`)?a=S(t,y)??a:t.startsWith(`#EXT-X-SERVER-CONTROL`)&&(s=S(t,x)??s,o=S(t,b)??o)}return n===`VOD`||r?{targetLiveWindow:NaN,liveEdgeStartOffset:void 0}:{targetLiveWindow:n===`EVENT`?1/0:0,liveEdgeStartOffset:a===void 0?o||(i===void 0?void 0:i*3):s||a*2}}async function w(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`Failed to fetch playlist (${n.status}): ${e}`);return{text:await n.text(),url:n.url||e}}async function T(e,t){let n=t?{signal:t}:{},{text:r,url:i}=await w(e,n);if(!g(r))return C(r);let a=_(r,i);if(!a)throw Error(`No media playlist URL found in multivariant playlist`);return C((await w(a,n)).text)}function E(e){class t extends e{#e=null;#t=null;#n=``;attach(e){super.attach(e),this.#a(e)}detach(){this.#r(),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#e?.abort(),this.#e=null,this.#i()}#i(){this.#t?.abort(),this.#t=null,this.#n=``}#a(e){this.#r(),this.#e=new AbortController;let{signal:t}=this.#e;e.addEventListener(`loadstart`,()=>this.#o(e),{signal:t}),e.addEventListener(`emptied`,()=>this.#i(),{signal:t}),(e.currentSrc||e.src)&&this.#o(e)}async#o(e){let t=e.currentSrc||e.src;if(!t||!h(t)||t===this.#n)return;this.#i(),this.#n=t;let n=this.#t=new AbortController;try{let r=await w(t,{signal:n.signal});if(n.signal.aborted||!g(r.text))return;let s=i(r.text,a,r.url);s&&o(e,s,n.signal)}catch{}}}return t}const D={initDataTypes:[`skd`],videoCapabilities:[{contentType:c,robustness:``}],distinctiveIdentifier:`not-allowed`,persistentState:`not-allowed`,sessionTypes:[`temporary`]};function O(e,t={}){let{media:n,signal:r,reportError:i}=e,a=/* @__PURE__ */ new Set,o=null,c=null;async function h(){let t;try{t=await navigator.requestMediaKeySystemAccess(s.FAIRPLAY,[D])}catch(e){throw f(e,u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM)}let i=await t.createMediaKeys(),a=await(c??=p(e));if(a&&!await i.setServerCertificate(a).catch(()=>!1))throw d(u.SERVER_CERTIFICATE_FAILED,l.SERVER_CERTIFICATE_FAILED);return r.aborted||await n.setMediaKeys(i),i}async function g(t,n){try{let i=await m(e,n.message);if(r.aborted)return;await t.update(i).catch(e=>{throw f(e,u.UPDATE_LICENSE_FAILED,l.UPDATE_LICENSE_FAILED)})}catch(e){if(r.aborted)return;i(f(e,u.CDM_ERROR,l.CDM_ERROR))}}function _(e){e.keyStatuses.forEach(e=>{e===`internal-error`?i(d(u.CDM_ERROR,l.CDM_ERROR)):(e===`output-restricted`||e===`output-downscaled`)&&i(d(u.OUTPUT_RESTRICTED,l.OUTPUT_RESTRICTED,!1))})}async function v(e,i,o){let s=e.createSession();a.add(s),s.addEventListener(`message`,e=>void g(s,e),{signal:r}),s.addEventListener(`keystatuseschange`,()=>_(s),{signal:r});try{await s.generateRequest(i,o)}catch(e){if(a.delete(s),await s.close().catch(()=>{}),k(n,e)){t.onUnsupported?.();return}throw f(e,u.GENERATE_REQUEST_FAILED,l.GENERATE_REQUEST_FAILED)}}return{async request(e){if(e.initDataType!==`skd`||!e.initData)return;let t=await(o??=h());r.aborted||await v(t,e.initDataType,e.initData)},async close(){let e=[...a].map(e=>e.close().catch(()=>{}));a.clear();let t=o;o=null,c=null,await Promise.all(e);let r=await t?.catch(()=>null);r&&n.mediaKeys===r&&await n.setMediaKeys(null).catch(()=>{})}}}function k(e,t){return t instanceof DOMException&&t.name===`NotSupportedError`&&!!e.webkitCurrentPlaybackTargetIsWireless}function A(e){return`WebKitMediaKeys`in globalThis&&`webkitSetMediaKeys`in e}function j(e){let{media:t,signal:n,reportError:r}=e,i=t,a=/* @__PURE__ */ new Set,o=null;function s(){if(i.webkitKeys)return;let e=globalThis.WebKitMediaKeys;if(!e||!A(t))throw d(u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM);try{i.webkitSetMediaKeys(new e(`com.apple.fps.1_0`))}catch(e){throw f(e,u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM)}}async function h(t,i){try{let r=await m(e,i.message);if(n.aborted)return;t.update(r)}catch(e){if(n.aborted)return;r(f(e,u.UPDATE_LICENSE_FAILED,l.UPDATE_LICENSE_FAILED))}}function g(e){let t=d(u.CDM_ERROR,l.CDM_ERROR);t.data=e.error,r(t)}return{async request(t){if(!t.initData)return;s();let r=await(o??=p(e));if(n.aborted)return;if(!r)throw d(u.MISSING_CERTIFICATE_URL,l.MISSING_CONFIGURATION);let f=i.webkitKeys.createSession(c,M(t.initData,r));a.add(f),f.addEventListener(`webkitkeymessage`,e=>void h(f,e),{signal:n}),f.addEventListener(`webkitkeyerror`,()=>g(f),{signal:n})},async close(){for(let e of a)try{e.close()}catch{}a.clear(),o=null;try{i.webkitSetMediaKeys(null)}catch{}}}}function M(e,t){let n=new Uint8Array(e),r=P(N(e)),i=new Uint8Array(t),a=new Uint8Array(n.byteLength+4+r.byteLength+4+i.byteLength),o=new DataView(a.buffer),s=0,c=e=>{a.set(e,s),s+=e.byteLength},l=e=>{o.setUint32(s,e.byteLength,!0),s+=4,c(e)};return c(n),l(r),l(i),a}function N(e){let t=new TextDecoder(`utf-16le`).decode(e),n=t.indexOf(`skd://`);return n===-1?t:t.slice(n+6)}function P(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setUint16(t*2,e.charCodeAt(t),!0);return t}function F(n){class r extends n{#e=null;#t=null;#n=!1;attach(e){super.attach(e),this.#i(e)}detach(){this.#r(),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#e?.abort(),this.#e=null,this.#n=!1,this.#c()}#i(t){this.#r(),this.#e=new AbortController;let{signal:n}=this.#e;t.addEventListener(`encrypted`,e=>this.#o(e,!1),{signal:n}),t.addEventListener(`webkitneedkey`,e=>this.#o(e,!0),{signal:n}),t.addEventListener(`emptied`,()=>void this.#c(),{signal:n}),e(t)&&t.addEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,()=>{this.#n=!1,this.#c()},{signal:n})}#a(){let{drm:e,engine:t}=this.source??{};return t?.nativeHls?.drmSystems??e??{}}#o(e,n){if(n!==this.#n)return;let r=this.target,i=this.#a()[s.FAIRPLAY];if(!r)return;if(!i?.licenseUrl){this.setError(d(u.MISSING_CONFIGURATION,l.MISSING_CONFIGURATION));return}let a=this.#t??=this.#s(r,i);a.keySystem.request(e).catch(e=>{a.disconnect.signal.aborted||this.setError(e instanceof t?e:d(u.CDM_ERROR,l.CDM_ERROR))})}#s(e,t){let n=new AbortController,r=()=>this.#a()[s.FAIRPLAY]??t,i={media:e,get config(){return r()},signal:n.signal,reportError:e=>this.setError(e)};return{keySystem:this.#n?j(i):O(i,{onUnsupported:()=>void this.#l(e)}),disconnect:n}}#c(){let e=this.#t;return this.#t=null,e?.disconnect.abort(),e?.keySystem.close()??Promise.resolve()}async#l(e){this.#n||(this.#n=!0,await this.#c(),this.#e&&!this.#e.signal.aborted&&e.load())}}return r}function I(e){class n extends e{#e=null;#t=null;get error(){return this.#t}setError(e){e.fatal&&(this.#t=e),this.dispatchEvent(new ErrorEvent(`error`,{error:e,message:e.message}))}attach(e){super.attach(e),this.#r(e)}detach(){this.#n(),super.detach?.()}destroy(){this.#n(),super.destroy?.()}#n(){this.#e?.abort(),this.#e=null,this.#t=null}#r(e){this.#n(),this.#e=new AbortController;let n=this.#e.signal;e.addEventListener(`error`,n=>{if(n.target!==e)return;n.stopImmediatePropagation();let r=e.error;if(!r)return;let i=r.code,a=i>=t.MEDIA_ERR_ABORTED&&i<=t.MEDIA_ERR_ENCRYPTED;this.setError(new t(a?void 0:r.message,i,!0))},{signal:n,capture:!0}),e.addEventListener(`emptied`,()=>{this.#t=null},{signal:n})}}return n}function L(e){class t extends e{#e=NaN;#t;#n=null;#r=``;get targetLiveWindow(){return this.#e}get liveEdgeStart(){if(this.#t===void 0)return NaN;let e=this.target;if(!e)return NaN;let{seekable:t,buffered:n}=e,r=t.length?t:n;return r.length?r.end(r.length-1)-this.#t:NaN}attach(e){super.attach(e),this.#a(e)}detach(){this.#i(),super.detach?.()}destroy(){this.#i(),super.destroy?.()}#i(){this.#n?.abort(),this.#n=null,this.#r=``,this.#t=void 0,this.#s(NaN)}#a(e){this.#i(),this.#n=new AbortController;let{signal:t}=this.#n;e.addEventListener(`loadstart`,()=>this.#o(e),{signal:t}),e.addEventListener(`emptied`,()=>{this.#r=``,this.#t=void 0,this.#s(NaN)},{signal:t}),(e.currentSrc||e.src)&&this.#o(e)}async#o(e){let t=e.currentSrc||e.src;if(!t||!h(t)||t===this.#r)return;this.#r=t,this.#t=void 0,this.#s(NaN);let n=this.#n?.signal;try{let r=await T(t,n);if(n?.aborted||(e.currentSrc||e.src)!==t)return;this.#t=r.liveEdgeStartOffset,this.#s(r.targetLiveWindow)}catch{}}#s(e){Object.is(this.#e,e)||(this.#e=e,this.dispatchEvent(new Event(`targetlivewindowchange`)))}}return t}function R(e){class t extends e{#e=n.UNKNOWN;#t=!1;#n=null;get streamType(){return this.#e}set streamType(e){if(e===n.UNKNOWN){this.#t=!1,this.#o(this.#a());return}this.#t=!0,this.#s(e)}attach(e){super.attach(e),this.#i(e)}detach(){this.#r(),this.#o(n.UNKNOWN),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#n?.abort(),this.#n=null}#i(e){this.#r(),this.#n=new AbortController;let{signal:t}=this.#n,r=()=>this.#o(this.#a(e));e.addEventListener(`durationchange`,r,{signal:t}),e.addEventListener(`loadedmetadata`,r,{signal:t}),e.addEventListener(`emptied`,()=>this.#o(n.UNKNOWN),{signal:t}),r()}#a(e=this.target){if(!e)return n.UNKNOWN;let{duration:t}=e;return t===1/0?n.LIVE:Number.isFinite(t)&&t>0?n.ON_DEMAND:n.UNKNOWN}#o(e){this.#t||this.#s(e)}#s(e){this.#e!==e&&(this.#e=e,this.dispatchEvent(new Event(`streamtypechange`)))}}return t}var z=class e extends r{static{this.defaultProps={src:``,source:null,preload:`metadata`,streamType:n.UNKNOWN}}#e=e.defaultProps.src;#t=e.defaultProps.source;#n=e.defaultProps.preload;get engine(){return null}get src(){return this.#e}set src(e){let{drm:t,engine:n}=this.#t??{},r={...t&&{drm:t},...n&&{engine:n},...e&&{src:e}};this.#t=Object.keys(r).length>0?r:null,this.#e=e,this.target&&(this.target.src=e)}get source(){return this.#t}set source(e){let t=e??null;if(t===this.#t)return;let n=t?.src??``,r=this.#e!==n;this.#t=t,this.#e=n,r&&this.target&&(this.target.src=n)}get preload(){return this.#n}set preload(e){this.#n=e,this.target&&(this.target.preload=e)}attach(e){super.attach(e),this.preload!==e.preload&&(e.preload=this.preload),this.src&&(e.src=this.src)}},B=class extends E(L(R(F(I(z))))){};export{B as t};
-//# sourceMappingURL=adapter-CbeHSDev.js.map
\ No newline at end of file
+import{t as e}from"./webkit-DljEkldb.js";import{t}from"./media-error-CtsbOTR1.js";import{n}from"./types-HOYOipK7.js";import{t as r}from"./html-video-adapter-BGKgkryA.js";import{t as i}from"./session-data-Ca8-DKdu.js";import{n as a,t as o}from"./load-chapters-tracks-Btgfpe8i.js";const s={FAIRPLAY:`com.apple.fps`,WIDEVINE:`com.widevine.alpha`,PLAYREADY:`com.microsoft.playready`,CLEARKEY:`org.w3.clearkey`},c=`application/vnd.apple.mpegurl`,l={MISSING_CONFIGURATION:`drmMissingConfiguration`,UNSUPPORTED_KEY_SYSTEM:`drmUnsupportedKeySystem`,CERTIFICATE_REQUEST_FAILED:`drmCertificateRequestFailed`,SERVER_CERTIFICATE_FAILED:`drmServerCertificateFailed`,GENERATE_REQUEST_FAILED:`drmGenerateRequestFailed`,LICENSE_REQUEST_FAILED:`drmLicenseRequestFailed`,UPDATE_LICENSE_FAILED:`drmUpdateLicenseFailed`,CDM_ERROR:`drmCdmError`,OUTPUT_RESTRICTED:`drmOutputRestricted`},u={MISSING_CONFIGURATION:`This media is DRM-protected, but no DRM license server was configured for it.`,MISSING_CERTIFICATE_URL:`This media is DRM-protected, but no DRM application certificate was configured for it.`,UNSUPPORTED_KEY_SYSTEM:`This browser cannot play DRM-protected content with its current security configuration. Try another browser.`,CERTIFICATE_REQUEST_FAILED:`The DRM application certificate could not be loaded.`,SERVER_CERTIFICATE_FAILED:`The DRM application certificate was rejected. It may no longer be valid.`,GENERATE_REQUEST_FAILED:`A DRM license could not be requested for this media.`,LICENSE_REQUEST_FAILED:`The DRM license could not be loaded.`,UPDATE_LICENSE_FAILED:`The DRM license was rejected for this media.`,CDM_ERROR:`The DRM Content Decryption Module failed. Try reloading the page, updating your browser, or another browser.`,OUTPUT_RESTRICTED:`This output is not secure enough for DRM playback. The video may render as a black screen.`};function d(e,n,r=!0){return new t(e,t.MEDIA_ERR_ENCRYPTED,r,n)}function f(e,n,r){if(e instanceof t)return e;let i=d(n,r);return i.data=e,i}async function p({config:e,signal:t}){let{serverCertificateUrl:n}=e;if(!n)return null;let r=await fetch(n,{signal:t}).catch(e=>{throw f(e,u.CERTIFICATE_REQUEST_FAILED,l.CERTIFICATE_REQUEST_FAILED)});if(!r.ok)throw d(u.CERTIFICATE_REQUEST_FAILED,l.CERTIFICATE_REQUEST_FAILED);return r.arrayBuffer()}async function m({config:e,signal:t},n){let r=await fetch(e.licenseUrl,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:n,signal:t}).catch(e=>{throw f(e,u.LICENSE_REQUEST_FAILED,l.LICENSE_REQUEST_FAILED)});if(!r.ok)throw d(u.LICENSE_REQUEST_FAILED,l.LICENSE_REQUEST_FAILED);return new Uint8Array(await r.arrayBuffer())}function h(e){return e.toLowerCase().includes(`.m3u8`)}function g(e){return e.includes(`#EXT-X-STREAM-INF`)}function _(e,t){let n=e.split(/\r?\n/),r=n.findIndex(e=>e.startsWith(`#EXT-X-STREAM-INF`));if(r===-1)return null;let i=n.slice(r+1).map(e=>e.trim()).find(e=>e&&!e.startsWith(`#`));if(!i)return null;try{return new URL(i,t).toString()}catch{return null}}function v(e){return new RegExp(String.raw`(?:^|[:,\s])${e}\s*=\s*([0-9.]+)\s*(?=[,]|$)`,`i`)}const y=v(`PART-TARGET`),b=v(`HOLD-BACK`),x=v(`PART-HOLD-BACK`);function S(e,t){let n=t.exec(e);if(!n)return;let r=Number(n[1]);return Number.isFinite(r)?r:void 0}function C(e){let t=e.split(/\r?\n/),n,r=!1,i,a,o,s;for(let e of t){let t=e.trim();if(t.startsWith(`#EXT-X-PLAYLIST-TYPE:`))n=t.slice(21).trim().toUpperCase();else if(t===`#EXT-X-ENDLIST`)r=!0;else if(t.startsWith(`#EXT-X-TARGETDURATION:`)){let e=Number(t.slice(22));Number.isFinite(e)&&(i=e)}else t.startsWith(`#EXT-X-PART-INF`)?a=S(t,y)??a:t.startsWith(`#EXT-X-SERVER-CONTROL`)&&(s=S(t,x)??s,o=S(t,b)??o)}return n===`VOD`||r?{targetLiveWindow:NaN,liveEdgeStartOffset:void 0}:{targetLiveWindow:n===`EVENT`?1/0:0,liveEdgeStartOffset:a===void 0?o||(i===void 0?void 0:i*3):s||a*2}}async function w(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`Failed to fetch playlist (${n.status}): ${e}`);return{text:await n.text(),url:n.url||e}}async function T(e,t){let n=t?{signal:t}:{},{text:r,url:i}=await w(e,n);if(!g(r))return C(r);let a=_(r,i);if(!a)throw Error(`No media playlist URL found in multivariant playlist`);return C((await w(a,n)).text)}function E(e){class t extends e{#e=null;#t=null;#n=``;attach(e){super.attach(e),this.#a(e)}detach(){this.#r(),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#e?.abort(),this.#e=null,this.#i()}#i(){this.#t?.abort(),this.#t=null,this.#n=``}#a(e){this.#r(),this.#e=new AbortController;let{signal:t}=this.#e;e.addEventListener(`loadstart`,()=>this.#o(e),{signal:t}),e.addEventListener(`emptied`,()=>this.#i(),{signal:t}),(e.currentSrc||e.src)&&this.#o(e)}async#o(e){let t=e.currentSrc||e.src;if(!t||!h(t)||t===this.#n)return;this.#i(),this.#n=t;let n=this.#t=new AbortController;try{let r=await w(t,{signal:n.signal});if(n.signal.aborted||!g(r.text))return;let s=i(r.text,a,r.url);s&&o(e,s,n.signal)}catch{}}}return t}const D={initDataTypes:[`skd`],videoCapabilities:[{contentType:c,robustness:``}],distinctiveIdentifier:`not-allowed`,persistentState:`not-allowed`,sessionTypes:[`temporary`]};function O(e,t={}){let{media:n,signal:r,reportError:i}=e,a=/* @__PURE__ */ new Set,o=null,c=null;async function h(){let t;try{t=await navigator.requestMediaKeySystemAccess(s.FAIRPLAY,[D])}catch(e){throw f(e,u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM)}let i=await t.createMediaKeys(),a=await(c??=p(e));if(a&&!await i.setServerCertificate(a).catch(()=>!1))throw d(u.SERVER_CERTIFICATE_FAILED,l.SERVER_CERTIFICATE_FAILED);return r.aborted||await n.setMediaKeys(i),i}async function g(t,n){try{let i=await m(e,n.message);if(r.aborted)return;await t.update(i).catch(e=>{throw f(e,u.UPDATE_LICENSE_FAILED,l.UPDATE_LICENSE_FAILED)})}catch(e){if(r.aborted)return;i(f(e,u.CDM_ERROR,l.CDM_ERROR))}}function _(e){e.keyStatuses.forEach(e=>{e===`internal-error`?i(d(u.CDM_ERROR,l.CDM_ERROR)):(e===`output-restricted`||e===`output-downscaled`)&&i(d(u.OUTPUT_RESTRICTED,l.OUTPUT_RESTRICTED,!1))})}async function v(e,i,o){let s=e.createSession();a.add(s),s.addEventListener(`message`,e=>void g(s,e),{signal:r}),s.addEventListener(`keystatuseschange`,()=>_(s),{signal:r});try{await s.generateRequest(i,o)}catch(e){if(a.delete(s),await s.close().catch(()=>{}),k(n,e)){t.onUnsupported?.();return}throw f(e,u.GENERATE_REQUEST_FAILED,l.GENERATE_REQUEST_FAILED)}}return{async request(e){if(e.initDataType!==`skd`||!e.initData)return;let t=await(o??=h());r.aborted||await v(t,e.initDataType,e.initData)},async close(){let e=[...a].map(e=>e.close().catch(()=>{}));a.clear();let t=o;o=null,c=null,await Promise.all(e);let r=await t?.catch(()=>null);r&&n.mediaKeys===r&&await n.setMediaKeys(null).catch(()=>{})}}}function k(e,t){return t instanceof DOMException&&t.name===`NotSupportedError`&&!!e.webkitCurrentPlaybackTargetIsWireless}function A(e){return`WebKitMediaKeys`in globalThis&&`webkitSetMediaKeys`in e}function j(e){let{media:t,signal:n,reportError:r}=e,i=t,a=/* @__PURE__ */ new Set,o=null;function s(){if(i.webkitKeys)return;let e=globalThis.WebKitMediaKeys;if(!e||!A(t))throw d(u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM);try{i.webkitSetMediaKeys(new e(`com.apple.fps.1_0`))}catch(e){throw f(e,u.UNSUPPORTED_KEY_SYSTEM,l.UNSUPPORTED_KEY_SYSTEM)}}async function h(t,i){try{let r=await m(e,i.message);if(n.aborted)return;t.update(r)}catch(e){if(n.aborted)return;r(f(e,u.UPDATE_LICENSE_FAILED,l.UPDATE_LICENSE_FAILED))}}function g(e){let t=d(u.CDM_ERROR,l.CDM_ERROR);t.data=e.error,r(t)}return{async request(t){if(!t.initData)return;s();let r=await(o??=p(e));if(n.aborted)return;if(!r)throw d(u.MISSING_CERTIFICATE_URL,l.MISSING_CONFIGURATION);let f=i.webkitKeys.createSession(c,M(t.initData,r));a.add(f),f.addEventListener(`webkitkeymessage`,e=>void h(f,e),{signal:n}),f.addEventListener(`webkitkeyerror`,()=>g(f),{signal:n})},async close(){for(let e of a)try{e.close()}catch{}a.clear(),o=null;try{i.webkitSetMediaKeys(null)}catch{}}}}function M(e,t){let n=new Uint8Array(e),r=P(N(e)),i=new Uint8Array(t),a=new Uint8Array(n.byteLength+4+r.byteLength+4+i.byteLength),o=new DataView(a.buffer),s=0,c=e=>{a.set(e,s),s+=e.byteLength},l=e=>{o.setUint32(s,e.byteLength,!0),s+=4,c(e)};return c(n),l(r),l(i),a}function N(e){let t=new TextDecoder(`utf-16le`).decode(e),n=t.indexOf(`skd://`);return n===-1?t:t.slice(n+6)}function P(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setUint16(t*2,e.charCodeAt(t),!0);return t}function F(n){class r extends n{#e=null;#t=null;#n=!1;attach(e){super.attach(e),this.#i(e)}detach(){this.#r(),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#e?.abort(),this.#e=null,this.#n=!1,this.#c()}#i(t){this.#r(),this.#e=new AbortController;let{signal:n}=this.#e;t.addEventListener(`encrypted`,e=>this.#o(e,!1),{signal:n}),t.addEventListener(`webkitneedkey`,e=>this.#o(e,!0),{signal:n}),t.addEventListener(`emptied`,()=>void this.#c(),{signal:n}),e(t)&&t.addEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,()=>{this.#n=!1,this.#c()},{signal:n})}#a(){let{drm:e,engine:t}=this.source??{};return t?.nativeHls?.drmSystems??e??{}}#o(e,n){if(n!==this.#n)return;let r=this.target,i=this.#a()[s.FAIRPLAY];if(!r)return;if(!i?.licenseUrl){this.setError(d(u.MISSING_CONFIGURATION,l.MISSING_CONFIGURATION));return}let a=this.#t??=this.#s(r,i);a.keySystem.request(e).catch(e=>{a.disconnect.signal.aborted||this.setError(e instanceof t?e:d(u.CDM_ERROR,l.CDM_ERROR))})}#s(e,t){let n=new AbortController,r=()=>this.#a()[s.FAIRPLAY]??t,i={media:e,get config(){return r()},signal:n.signal,reportError:e=>this.setError(e)};return{keySystem:this.#n?j(i):O(i,{onUnsupported:()=>void this.#l(e)}),disconnect:n}}#c(){let e=this.#t;return this.#t=null,e?.disconnect.abort(),e?.keySystem.close()??Promise.resolve()}async#l(e){this.#n||(this.#n=!0,await this.#c(),this.#e&&!this.#e.signal.aborted&&e.load())}}return r}function I(e){class n extends e{#e=null;#t=null;get error(){return this.#t}setError(e){e.fatal&&(this.#t=e),this.dispatchEvent(new ErrorEvent(`error`,{error:e,message:e.message}))}attach(e){super.attach(e),this.#r(e)}detach(){this.#n(),super.detach?.()}destroy(){this.#n(),super.destroy?.()}#n(){this.#e?.abort(),this.#e=null,this.#t=null}#r(e){this.#n(),this.#e=new AbortController;let n=this.#e.signal;e.addEventListener(`error`,n=>{if(n.target!==e)return;n.stopImmediatePropagation();let r=e.error;if(!r)return;let i=r.code,a=i>=t.MEDIA_ERR_ABORTED&&i<=t.MEDIA_ERR_ENCRYPTED;this.setError(new t(a?void 0:r.message,i,!0))},{signal:n,capture:!0}),e.addEventListener(`emptied`,()=>{this.#t=null},{signal:n})}}return n}function L(e){class t extends e{#e=NaN;#t;#n=null;#r=``;get targetLiveWindow(){return this.#e}get liveEdgeStart(){if(this.#t===void 0)return NaN;let e=this.target;if(!e)return NaN;let{seekable:t,buffered:n}=e,r=t.length?t:n;return r.length?r.end(r.length-1)-this.#t:NaN}attach(e){super.attach(e),this.#a(e)}detach(){this.#i(),super.detach?.()}destroy(){this.#i(),super.destroy?.()}#i(){this.#n?.abort(),this.#n=null,this.#r=``,this.#t=void 0,this.#s(NaN)}#a(e){this.#i(),this.#n=new AbortController;let{signal:t}=this.#n;e.addEventListener(`loadstart`,()=>this.#o(e),{signal:t}),e.addEventListener(`emptied`,()=>{this.#r=``,this.#t=void 0,this.#s(NaN)},{signal:t}),(e.currentSrc||e.src)&&this.#o(e)}async#o(e){let t=e.currentSrc||e.src;if(!t||!h(t)||t===this.#r)return;this.#r=t,this.#t=void 0,this.#s(NaN);let n=this.#n?.signal;try{let r=await T(t,n);if(n?.aborted||(e.currentSrc||e.src)!==t)return;this.#t=r.liveEdgeStartOffset,this.#s(r.targetLiveWindow)}catch{}}#s(e){Object.is(this.#e,e)||(this.#e=e,this.dispatchEvent(new Event(`targetlivewindowchange`)))}}return t}function R(e){class t extends e{#e=n.UNKNOWN;#t=!1;#n=null;get streamType(){return this.#e}set streamType(e){if(e===n.UNKNOWN){this.#t=!1,this.#o(this.#a());return}this.#t=!0,this.#s(e)}attach(e){super.attach(e),this.#i(e)}detach(){this.#r(),this.#o(n.UNKNOWN),super.detach?.()}destroy(){this.#r(),super.destroy?.()}#r(){this.#n?.abort(),this.#n=null}#i(e){this.#r(),this.#n=new AbortController;let{signal:t}=this.#n,r=()=>this.#o(this.#a(e));e.addEventListener(`durationchange`,r,{signal:t}),e.addEventListener(`loadedmetadata`,r,{signal:t}),e.addEventListener(`emptied`,()=>this.#o(n.UNKNOWN),{signal:t}),r()}#a(e=this.target){if(!e)return n.UNKNOWN;let{duration:t}=e;return t===1/0?n.LIVE:Number.isFinite(t)&&t>0?n.ON_DEMAND:n.UNKNOWN}#o(e){this.#t||this.#s(e)}#s(e){this.#e!==e&&(this.#e=e,this.dispatchEvent(new Event(`streamtypechange`)))}}return t}var z=class e extends r{static{this.defaultProps={src:``,source:null,preload:`metadata`,streamType:n.UNKNOWN}}#e=e.defaultProps.src;#t=e.defaultProps.source;#n=e.defaultProps.preload;get engine(){return null}get src(){return this.#e}set src(e){let{drm:t,engine:n}=this.#t??{},r={...t&&{drm:t},...n&&{engine:n},...e&&{src:e}};this.#t=Object.keys(r).length>0?r:null,this.#e=e,this.target&&(this.target.src=e)}get source(){return this.#t}set source(e){let t=e??null;if(t===this.#t)return;let n=t?.src??``,r=this.#e!==n;this.#t=t,this.#e=n,r&&this.target&&(this.target.src=n)}get preload(){return this.#n}set preload(e){this.#n=e,this.target&&(this.target.preload=e)}attach(e){super.attach(e),this.preload!==e.preload&&(e.preload=this.preload),this.src&&(e.src=this.src)}},B=class extends E(L(R(F(I(z))))){};export{B as t};
+//# sourceMappingURL=adapter-CU0vk5zH.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/ar-D_zi_Hz2.js b/web/vendor/videojs/10.2.0/ar-D_zi_Hz2.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ar-D_zi_Hz2.js
rename to web/vendor/videojs/10.2.0/ar-D_zi_Hz2.js
diff --git a/web/vendor/videojs/10.1.0/attributes-DrTKm-Cs.js b/web/vendor/videojs/10.2.0/attributes-DrTKm-Cs.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/attributes-DrTKm-Cs.js
rename to web/vendor/videojs/10.2.0/attributes-DrTKm-Cs.js
diff --git a/web/vendor/videojs/10.1.0/az-DbXa5TeW.js b/web/vendor/videojs/10.2.0/az-DbXa5TeW.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/az-DbXa5TeW.js
rename to web/vendor/videojs/10.2.0/az-DbXa5TeW.js
diff --git a/web/vendor/videojs/10.1.0/bg-Be7_Mhav.js b/web/vendor/videojs/10.2.0/bg-Be7_Mhav.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/bg-Be7_Mhav.js
rename to web/vendor/videojs/10.2.0/bg-Be7_Mhav.js
diff --git a/web/vendor/videojs/10.1.0/bn-Bs7u2efP.js b/web/vendor/videojs/10.2.0/bn-Bs7u2efP.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/bn-Bs7u2efP.js
rename to web/vendor/videojs/10.2.0/bn-Bs7u2efP.js
diff --git a/web/vendor/videojs/10.1.0/bs-Bdi6PrZl.js b/web/vendor/videojs/10.2.0/bs-Bdi6PrZl.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/bs-Bdi6PrZl.js
rename to web/vendor/videojs/10.2.0/bs-Bdi6PrZl.js
diff --git a/web/vendor/videojs/10.1.0/button-Y55WuR0m.js b/web/vendor/videojs/10.2.0/button-Y55WuR0m.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/button-Y55WuR0m.js
rename to web/vendor/videojs/10.2.0/button-Y55WuR0m.js
diff --git a/web/vendor/videojs/10.1.0/buttons-CUtb8x8R.js b/web/vendor/videojs/10.2.0/buttons-CUtb8x8R.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/buttons-CUtb8x8R.js
rename to web/vendor/videojs/10.2.0/buttons-CUtb8x8R.js
diff --git a/web/vendor/videojs/10.1.0/ca-CNHYHx9P.js b/web/vendor/videojs/10.2.0/ca-CNHYHx9P.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ca-CNHYHx9P.js
rename to web/vendor/videojs/10.2.0/ca-CNHYHx9P.js
diff --git a/web/vendor/videojs/10.1.0/casing-CxqC0yQL.js b/web/vendor/videojs/10.2.0/casing-CxqC0yQL.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/casing-CxqC0yQL.js
rename to web/vendor/videojs/10.2.0/casing-CxqC0yQL.js
diff --git a/web/vendor/videojs/10.1.0/constants-B4LD5zrj.js b/web/vendor/videojs/10.2.0/constants-B4LD5zrj.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/constants-B4LD5zrj.js
rename to web/vendor/videojs/10.2.0/constants-B4LD5zrj.js
diff --git a/web/vendor/videojs/10.1.0/context-BEwcGq-j.js b/web/vendor/videojs/10.2.0/context-BEwcGq-j.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/context-BEwcGq-j.js
rename to web/vendor/videojs/10.2.0/context-BEwcGq-j.js
diff --git a/web/vendor/videojs/10.1.0/context-D_k9hQ7P.js b/web/vendor/videojs/10.2.0/context-D_k9hQ7P.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/context-D_k9hQ7P.js
rename to web/vendor/videojs/10.2.0/context-D_k9hQ7P.js
diff --git a/web/vendor/videojs/10.1.0/context-consumer-BGkzZG3G.js b/web/vendor/videojs/10.2.0/context-consumer-BGkzZG3G.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/context-consumer-BGkzZG3G.js
rename to web/vendor/videojs/10.2.0/context-consumer-BGkzZG3G.js
diff --git a/web/vendor/videojs/10.1.0/context-part-element-Dy5xX1HE.js b/web/vendor/videojs/10.2.0/context-part-element-Dy5xX1HE.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/context-part-element-Dy5xX1HE.js
rename to web/vendor/videojs/10.2.0/context-part-element-Dy5xX1HE.js
diff --git a/web/vendor/videojs/10.1.0/context-provider-ivCWVZbp.js b/web/vendor/videojs/10.2.0/context-provider-ivCWVZbp.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/context-provider-ivCWVZbp.js
rename to web/vendor/videojs/10.2.0/context-provider-ivCWVZbp.js
diff --git a/web/vendor/videojs/10.1.0/controller-4KIPcUJn.js b/web/vendor/videojs/10.2.0/controller-4KIPcUJn.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/controller-4KIPcUJn.js
rename to web/vendor/videojs/10.2.0/controller-4KIPcUJn.js
diff --git a/web/vendor/videojs/10.1.0/controller-DyVV6rgW.js b/web/vendor/videojs/10.2.0/controller-DyVV6rgW.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/controller-DyVV6rgW.js
rename to web/vendor/videojs/10.2.0/controller-DyVV6rgW.js
diff --git a/web/vendor/videojs/10.1.0/create-context--NqP-Eqb.js b/web/vendor/videojs/10.2.0/create-context--NqP-Eqb.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/create-context--NqP-Eqb.js
rename to web/vendor/videojs/10.2.0/create-context--NqP-Eqb.js
diff --git a/web/vendor/videojs/10.1.0/create-player-B5Xsr_sp.js b/web/vendor/videojs/10.2.0/create-player-B5Xsr_sp.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/create-player-B5Xsr_sp.js
rename to web/vendor/videojs/10.2.0/create-player-B5Xsr_sp.js
diff --git a/web/vendor/videojs/10.1.0/cs-DZWtuE0-.js b/web/vendor/videojs/10.2.0/cs-DZWtuE0-.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/cs-DZWtuE0-.js
rename to web/vendor/videojs/10.2.0/cs-DZWtuE0-.js
diff --git a/web/vendor/videojs/10.1.0/css-vars-7FASVoTa.js b/web/vendor/videojs/10.2.0/css-vars-7FASVoTa.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/css-vars-7FASVoTa.js
rename to web/vendor/videojs/10.2.0/css-vars-7FASVoTa.js
diff --git a/web/vendor/videojs/10.1.0/custom-media-element-dQqnF2UH.js b/web/vendor/videojs/10.2.0/custom-media-element-dQqnF2UH.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/custom-media-element-dQqnF2UH.js
rename to web/vendor/videojs/10.2.0/custom-media-element-dQqnF2UH.js
diff --git a/web/vendor/videojs/10.1.0/cy-DxHjr2g1.js b/web/vendor/videojs/10.2.0/cy-DxHjr2g1.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/cy-DxHjr2g1.js
rename to web/vendor/videojs/10.2.0/cy-DxHjr2g1.js
diff --git a/web/vendor/videojs/10.1.0/da-BSq1GeB9.js b/web/vendor/videojs/10.2.0/da-BSq1GeB9.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/da-BSq1GeB9.js
rename to web/vendor/videojs/10.2.0/da-BSq1GeB9.js
diff --git a/web/vendor/videojs/10.1.0/data-JRMbnaJJ.js b/web/vendor/videojs/10.2.0/data-JRMbnaJJ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/data-JRMbnaJJ.js
rename to web/vendor/videojs/10.2.0/data-JRMbnaJJ.js
diff --git a/web/vendor/videojs/10.1.0/de-DE8lsjAg.js b/web/vendor/videojs/10.2.0/de-DE8lsjAg.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/de-DE8lsjAg.js
rename to web/vendor/videojs/10.2.0/de-DE8lsjAg.js
diff --git a/web/vendor/videojs/10.1.0/deep-equal-BgDgiSiY.js b/web/vendor/videojs/10.2.0/deep-equal-BgDgiSiY.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/deep-equal-BgDgiSiY.js
rename to web/vendor/videojs/10.2.0/deep-equal-BgDgiSiY.js
diff --git a/web/vendor/videojs/10.1.0/defaults-BMkSdEzN.js b/web/vendor/videojs/10.2.0/defaults-BMkSdEzN.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/defaults-BMkSdEzN.js
rename to web/vendor/videojs/10.2.0/defaults-BMkSdEzN.js
diff --git a/web/vendor/videojs/10.1.0/device-pixel-ratio-BHQMoAGQ.js b/web/vendor/videojs/10.2.0/device-pixel-ratio-BHQMoAGQ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/device-pixel-ratio-BHQMoAGQ.js
rename to web/vendor/videojs/10.2.0/device-pixel-ratio-BHQMoAGQ.js
diff --git a/web/vendor/videojs/10.1.0/el-fdhymOWw.js b/web/vendor/videojs/10.2.0/el-fdhymOWw.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/el-fdhymOWw.js
rename to web/vendor/videojs/10.2.0/el-fdhymOWw.js
diff --git a/web/vendor/videojs/10.1.0/element-props-B1KSgbJ9.js b/web/vendor/videojs/10.2.0/element-props-B1KSgbJ9.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/element-props-B1KSgbJ9.js
rename to web/vendor/videojs/10.2.0/element-props-B1KSgbJ9.js
diff --git a/web/vendor/videojs/10.1.0/es-DtHaH4Cv.js b/web/vendor/videojs/10.2.0/es-DtHaH4Cv.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/es-DtHaH4Cv.js
rename to web/vendor/videojs/10.2.0/es-DtHaH4Cv.js
diff --git a/web/vendor/videojs/10.1.0/et-Dnq9Ha0N.js b/web/vendor/videojs/10.2.0/et-Dnq9Ha0N.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/et-Dnq9Ha0N.js
rename to web/vendor/videojs/10.2.0/et-Dnq9Ha0N.js
diff --git a/web/vendor/videojs/10.1.0/eu-CIQj5YNt.js b/web/vendor/videojs/10.2.0/eu-CIQj5YNt.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/eu-CIQj5YNt.js
rename to web/vendor/videojs/10.2.0/eu-CIQj5YNt.js
diff --git a/web/vendor/videojs/10.1.0/fa-BDhltlcs.js b/web/vendor/videojs/10.2.0/fa-BDhltlcs.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/fa-BDhltlcs.js
rename to web/vendor/videojs/10.2.0/fa-BDhltlcs.js
diff --git a/web/vendor/videojs/10.1.0/fi-D08_lc7a.js b/web/vendor/videojs/10.2.0/fi-D08_lc7a.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/fi-D08_lc7a.js
rename to web/vendor/videojs/10.2.0/fi-D08_lc7a.js
diff --git a/web/vendor/videojs/10.1.0/focus-AxQnuRrV.js b/web/vendor/videojs/10.2.0/focus-AxQnuRrV.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/focus-AxQnuRrV.js
rename to web/vendor/videojs/10.2.0/focus-AxQnuRrV.js
diff --git a/web/vendor/videojs/10.1.0/format-YaJWnevo.js b/web/vendor/videojs/10.2.0/format-YaJWnevo.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/format-YaJWnevo.js
rename to web/vendor/videojs/10.2.0/format-YaJWnevo.js
diff --git a/web/vendor/videojs/10.1.0/fr-DOyBpoE_.js b/web/vendor/videojs/10.2.0/fr-DOyBpoE_.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/fr-DOyBpoE_.js
rename to web/vendor/videojs/10.2.0/fr-DOyBpoE_.js
diff --git a/web/vendor/videojs/10.1.0/fullscreen-sMHMAZ5s.js b/web/vendor/videojs/10.2.0/fullscreen-sMHMAZ5s.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/fullscreen-sMHMAZ5s.js
rename to web/vendor/videojs/10.2.0/fullscreen-sMHMAZ5s.js
diff --git a/web/vendor/videojs/10.1.0/gd-Boe1Lw8V.js b/web/vendor/videojs/10.2.0/gd-Boe1Lw8V.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/gd-Boe1Lw8V.js
rename to web/vendor/videojs/10.2.0/gd-Boe1Lw8V.js
diff --git a/web/vendor/videojs/10.1.0/gl-BIJpjPxx.js b/web/vendor/videojs/10.2.0/gl-BIJpjPxx.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/gl-BIJpjPxx.js
rename to web/vendor/videojs/10.2.0/gl-BIJpjPxx.js
diff --git a/web/vendor/videojs/10.1.0/he-BCc94Bhw.js b/web/vendor/videojs/10.2.0/he-BCc94Bhw.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/he-BCc94Bhw.js
rename to web/vendor/videojs/10.2.0/he-BCc94Bhw.js
diff --git a/web/vendor/videojs/10.1.0/hi-DUvo0qXq.js b/web/vendor/videojs/10.2.0/hi-DUvo0qXq.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/hi-DUvo0qXq.js
rename to web/vendor/videojs/10.2.0/hi-DUvo0qXq.js
diff --git a/web/vendor/videojs/10.1.0/hls.js.LICENSE.txt b/web/vendor/videojs/10.2.0/hls.js.LICENSE.txt
similarity index 100%
rename from web/vendor/videojs/10.1.0/hls.js.LICENSE.txt
rename to web/vendor/videojs/10.2.0/hls.js.LICENSE.txt
diff --git a/web/vendor/videojs/10.1.0/hotkey-BsoOdVau.js b/web/vendor/videojs/10.2.0/hotkey-BsoOdVau.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/hotkey-BsoOdVau.js
rename to web/vendor/videojs/10.2.0/hotkey-BsoOdVau.js
diff --git a/web/vendor/videojs/10.1.0/hotkey-events-8krRcXxl.js b/web/vendor/videojs/10.2.0/hotkey-events-8krRcXxl.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/hotkey-events-8krRcXxl.js
rename to web/vendor/videojs/10.2.0/hotkey-events-8krRcXxl.js
diff --git a/web/vendor/videojs/10.1.0/hr-DD86TLT0.js b/web/vendor/videojs/10.2.0/hr-DD86TLT0.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/hr-DD86TLT0.js
rename to web/vendor/videojs/10.2.0/hr-DD86TLT0.js
diff --git a/web/vendor/videojs/10.1.0/html-media-adapter-C-kNY70j.js b/web/vendor/videojs/10.2.0/html-media-adapter-C-kNY70j.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/html-media-adapter-C-kNY70j.js
rename to web/vendor/videojs/10.2.0/html-media-adapter-C-kNY70j.js
diff --git a/web/vendor/videojs/10.1.0/html-video-adapter-BGKgkryA.js b/web/vendor/videojs/10.2.0/html-video-adapter-BGKgkryA.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/html-video-adapter-BGKgkryA.js
rename to web/vendor/videojs/10.2.0/html-video-adapter-BGKgkryA.js
diff --git a/web/vendor/videojs/10.1.0/hu-DSwPjulK.js b/web/vendor/videojs/10.2.0/hu-DSwPjulK.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/hu-DSwPjulK.js
rename to web/vendor/videojs/10.2.0/hu-DSwPjulK.js
diff --git a/web/vendor/videojs/10.1.0/i18n-BdP2ANgX.js b/web/vendor/videojs/10.2.0/i18n-BdP2ANgX.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/i18n-BdP2ANgX.js
rename to web/vendor/videojs/10.2.0/i18n-BdP2ANgX.js
diff --git a/web/vendor/videojs/10.1.0/i18n.js b/web/vendor/videojs/10.2.0/i18n.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/i18n.js
rename to web/vendor/videojs/10.2.0/i18n.js
diff --git a/web/vendor/videojs/10.1.0/id-Dwf4xt81.js b/web/vendor/videojs/10.2.0/id-Dwf4xt81.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/id-Dwf4xt81.js
rename to web/vendor/videojs/10.2.0/id-Dwf4xt81.js
diff --git a/web/vendor/videojs/10.1.0/interaction-lock-DKc9gO7E.js b/web/vendor/videojs/10.2.0/interaction-lock-DKc9gO7E.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/interaction-lock-DKc9gO7E.js
rename to web/vendor/videojs/10.2.0/interaction-lock-DKc9gO7E.js
diff --git a/web/vendor/videojs/10.1.0/it-B-6IOqhs.js b/web/vendor/videojs/10.2.0/it-B-6IOqhs.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/it-B-6IOqhs.js
rename to web/vendor/videojs/10.2.0/it-B-6IOqhs.js
diff --git a/web/vendor/videojs/10.1.0/ja-DptyuNiN.js b/web/vendor/videojs/10.2.0/ja-DptyuNiN.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ja-DptyuNiN.js
rename to web/vendor/videojs/10.2.0/ja-DptyuNiN.js
diff --git a/web/vendor/videojs/10.1.0/ko-CMng7IiT.js b/web/vendor/videojs/10.2.0/ko-CMng7IiT.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ko-CMng7IiT.js
rename to web/vendor/videojs/10.2.0/ko-CMng7IiT.js
diff --git a/web/vendor/videojs/10.1.0/layout-DqqwqjPS.js b/web/vendor/videojs/10.2.0/layout-DqqwqjPS.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/layout-DqqwqjPS.js
rename to web/vendor/videojs/10.2.0/layout-DqqwqjPS.js
diff --git a/web/vendor/videojs/10.1.0/listen-4VrUltMW.js b/web/vendor/videojs/10.2.0/listen-4VrUltMW.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/listen-4VrUltMW.js
rename to web/vendor/videojs/10.2.0/listen-4VrUltMW.js
diff --git a/web/vendor/videojs/10.1.0/load-chapters-tracks-D1x4MkCp.js b/web/vendor/videojs/10.2.0/load-chapters-tracks-Btgfpe8i.js
similarity index 58%
rename from web/vendor/videojs/10.1.0/load-chapters-tracks-D1x4MkCp.js
rename to web/vendor/videojs/10.2.0/load-chapters-tracks-Btgfpe8i.js
index 1824786a4..64494b686 100644
--- a/web/vendor/videojs/10.1.0/load-chapters-tracks-D1x4MkCp.js
+++ b/web/vendor/videojs/10.2.0/load-chapters-tracks-Btgfpe8i.js
@@ -1,2 +1,2 @@
-import{n as e}from"./predicate-DSCS8XT4.js";import{c as t,d as n,h as r}from"./session-data-B6deNOmy.js";const i=`com.apple.hls.chapters`;function a(e,t){return e.map((n,i)=>{let a=n[`start-time`],o=n.duration===void 0?e[i+1]?.[`start-time`]:a+n.duration,s={startTime:a,titles:Object.fromEntries((n.titles??[]).map(({language:e,title:t})=>[e,t]))};return o!==void 0&&(s.endTime=o),n.images&&(s.images=n.images.map(e=>({category:e[`image-category`],width:e[`pixel-width`],height:e[`pixel-height`],url:r(e.url,t)}))),n.metadata&&(s.metadata=n.metadata),s})}const o=2**53-1;function s(e,t){let n=[];for(let t of e)for(let e of Object.keys(t.titles))n.includes(e)||n.push(e);let r=[t,`und`].find(e=>e!==void 0&&n.includes(e));return r&&(n.splice(n.indexOf(r),1),n.unshift(r)),n}function c(e,t){if(e.readyState>=HTMLTrackElement.LOADED){t();return}let n=()=>{e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t()};e.addEventListener(`load`,n),e.addEventListener(`error`,n)}function l(e,t,{preferredLanguage:n}={}){for(let r of s(t,n)){let n=document.createElement(`track`);n.kind=`chapters`,n.srclang=r,n.toggleAttribute(`data-src-chapters-track`,!0),e.appendChild(n),n.track.mode=`hidden`,c(n,()=>{if(n.parentNode===e){n.track.mode=`disabled`;for(let e of t){let t=e.titles[r];t!==void 0&&n.track.addCue(new VTTCue(e.startTime,e.endTime??o,t))}n.track.mode=`hidden`}})}}function u(e){let t=e.querySelectorAll(`track[data-src-chapters-track]`);for(let e of t)e.remove()}async function d(r,i,o){try{let e=await t({url:r},{signal:i,credentials:o});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return a(JSON.parse(await n(e)),e.url||r)}catch(t){return!i.aborted&&!e(t)&&console.warn(`[loadChaptersTracks] Failed to load the chapters document at ${r}`,t),[]}}function f(e,t,n,{credentials:r,...i}={}){n.aborted||(n.addEventListener(`abort`,()=>u(e),{once:!0}),d(t,n,r).then(t=>{n.aborted||l(e,t,i)}))}export{i as n,f as t};
-//# sourceMappingURL=load-chapters-tracks-D1x4MkCp.js.map
\ No newline at end of file
+import{n as e}from"./predicate-DSCS8XT4.js";import{i as t,p as n,s as r}from"./session-data-Ca8-DKdu.js";const i=`com.apple.hls.chapters`;function a(e,t){return e.map((r,i)=>{let a=r[`start-time`],o=r.duration===void 0?e[i+1]?.[`start-time`]:a+r.duration,s={startTime:a,titles:Object.fromEntries((r.titles??[]).map(({language:e,title:t})=>[e,t]))};return o!==void 0&&(s.endTime=o),r.images&&(s.images=r.images.map(e=>({category:e[`image-category`],width:e[`pixel-width`],height:e[`pixel-height`],url:n(e.url,t)}))),r.metadata&&(s.metadata=r.metadata),s})}const o=2**53-1;function s(e,t){let n=[];for(let t of e)for(let e of Object.keys(t.titles))n.includes(e)||n.push(e);let r=[t,`und`].find(e=>e!==void 0&&n.includes(e));return r&&(n.splice(n.indexOf(r),1),n.unshift(r)),n}function c(e,t){if(e.readyState>=HTMLTrackElement.LOADED){t();return}let n=()=>{e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t()};e.addEventListener(`load`,n),e.addEventListener(`error`,n)}function l(e,t,{preferredLanguage:n}={}){for(let r of s(t,n)){let n=document.createElement(`track`);n.kind=`chapters`,n.srclang=r,n.toggleAttribute(`data-src-chapters-track`,!0),e.appendChild(n),n.track.mode=`hidden`,c(n,()=>{if(n.parentNode===e){n.track.mode=`disabled`;for(let e of t){let t=e.titles[r];t!==void 0&&n.track.addCue(new VTTCue(e.startTime,e.endTime??o,t))}n.track.mode=`hidden`}})}}function u(e){let t=e.querySelectorAll(`track[data-src-chapters-track]`);for(let e of t)e.remove()}async function d(n,i,o){try{let e=await t({url:n},{signal:i,credentials:o});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return a(JSON.parse(await r(e)),e.url||n)}catch(t){return!i.aborted&&!e(t)&&console.warn(`[loadChaptersTracks] Failed to load the chapters document at ${n}`,t),[]}}function f(e,t,n,{credentials:r,...i}={}){n.aborted||(n.addEventListener(`abort`,()=>u(e),{once:!0}),d(t,n,r).then(t=>{n.aborted||l(e,t,i)}))}export{i as n,f as t};
+//# sourceMappingURL=load-chapters-tracks-Btgfpe8i.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/locales/zh-CN.js b/web/vendor/videojs/10.2.0/locales/zh-CN.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/locales/zh-CN.js
rename to web/vendor/videojs/10.2.0/locales/zh-CN.js
diff --git a/web/vendor/videojs/10.1.0/lt-BTJ_wwtC.js b/web/vendor/videojs/10.2.0/lt-BTJ_wwtC.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/lt-BTJ_wwtC.js
rename to web/vendor/videojs/10.2.0/lt-BTJ_wwtC.js
diff --git a/web/vendor/videojs/10.1.0/lv-BnFI_F0g.js b/web/vendor/videojs/10.2.0/lv-BnFI_F0g.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/lv-BnFI_F0g.js
rename to web/vendor/videojs/10.2.0/lv-BnFI_F0g.js
diff --git a/web/vendor/videojs/10.1.0/media-attach-mixin-BA1JRbCc.js b/web/vendor/videojs/10.2.0/media-attach-mixin-BA1JRbCc.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/media-attach-mixin-BA1JRbCc.js
rename to web/vendor/videojs/10.2.0/media-attach-mixin-BA1JRbCc.js
diff --git a/web/vendor/videojs/10.1.0/media-button-element-Ch1MLKNP.js b/web/vendor/videojs/10.2.0/media-button-element-Ch1MLKNP.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/media-button-element-Ch1MLKNP.js
rename to web/vendor/videojs/10.2.0/media-button-element-Ch1MLKNP.js
diff --git a/web/vendor/videojs/10.1.0/media-error-CtsbOTR1.js b/web/vendor/videojs/10.2.0/media-error-CtsbOTR1.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/media-error-CtsbOTR1.js
rename to web/vendor/videojs/10.2.0/media-error-CtsbOTR1.js
diff --git a/web/vendor/videojs/10.1.0/media/dash-video.js b/web/vendor/videojs/10.2.0/media/dash-video.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/media/dash-video.js
rename to web/vendor/videojs/10.2.0/media/dash-video.js
diff --git a/web/vendor/videojs/10.1.0/media/dash.all.min.js.LICENSE.txt b/web/vendor/videojs/10.2.0/media/dash.all.min.js.LICENSE.txt
similarity index 100%
rename from web/vendor/videojs/10.1.0/media/dash.all.min.js.LICENSE.txt
rename to web/vendor/videojs/10.2.0/media/dash.all.min.js.LICENSE.txt
diff --git a/web/vendor/videojs/10.1.0/media/hlsjs-video.js b/web/vendor/videojs/10.2.0/media/hlsjs-video.js
similarity index 74%
rename from web/vendor/videojs/10.1.0/media/hlsjs-video.js
rename to web/vendor/videojs/10.2.0/media/hlsjs-video.js
index d1befb80e..07930fa42 100644
--- a/web/vendor/videojs/10.1.0/media/hlsjs-video.js
+++ b/web/vendor/videojs/10.2.0/media/hlsjs-video.js
@@ -1,3 +1,3 @@
/*! Video.js | https://videojs.org/help */
-import{t as e}from"../custom-media-element-dQqnF2UH.js";import{t}from"../safe-define-DXxmf7BV.js";import{t as n}from"../adapter-DnHSdWh1.js";import{t as r}from"../media-attach-mixin-BA1JRbCc.js";var i=class extends r(e(`video`,n)){},a=class extends i{static{this.tagName=`hlsjs-video`}};t(a);export{a as HlsJsVideoElement};
+import{t as e}from"../custom-media-element-dQqnF2UH.js";import{t}from"../safe-define-DXxmf7BV.js";import{t as n}from"../adapter-B_5kn1ML.js";import{t as r}from"../media-attach-mixin-BA1JRbCc.js";var i=class extends r(e(`video`,n)){},a=class extends i{static{this.tagName=`hlsjs-video`}};t(a);export{a as HlsJsVideoElement};
//# sourceMappingURL=hlsjs-video.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/mixin-BUx02nig.js b/web/vendor/videojs/10.2.0/mixin-BUx02nig.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/mixin-BUx02nig.js
rename to web/vendor/videojs/10.2.0/mixin-BUx02nig.js
diff --git a/web/vendor/videojs/10.1.0/mr--MsdgHNa.js b/web/vendor/videojs/10.2.0/mr--MsdgHNa.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/mr--MsdgHNa.js
rename to web/vendor/videojs/10.2.0/mr--MsdgHNa.js
diff --git a/web/vendor/videojs/10.1.0/nb-BXZqkmve.js b/web/vendor/videojs/10.2.0/nb-BXZqkmve.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/nb-BXZqkmve.js
rename to web/vendor/videojs/10.2.0/nb-BXZqkmve.js
diff --git a/web/vendor/videojs/10.1.0/ne-Bq2woZsI.js b/web/vendor/videojs/10.2.0/ne-Bq2woZsI.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ne-Bq2woZsI.js
rename to web/vendor/videojs/10.2.0/ne-Bq2woZsI.js
diff --git a/web/vendor/videojs/10.1.0/nl-uhYdoQtJ.js b/web/vendor/videojs/10.2.0/nl-uhYdoQtJ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/nl-uhYdoQtJ.js
rename to web/vendor/videojs/10.2.0/nl-uhYdoQtJ.js
diff --git a/web/vendor/videojs/10.1.0/nn-DmjHOVhc.js b/web/vendor/videojs/10.2.0/nn-DmjHOVhc.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/nn-DmjHOVhc.js
rename to web/vendor/videojs/10.2.0/nn-DmjHOVhc.js
diff --git a/web/vendor/videojs/10.1.0/noop-Ch0IHcOP.js b/web/vendor/videojs/10.2.0/noop-Ch0IHcOP.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/noop-Ch0IHcOP.js
rename to web/vendor/videojs/10.2.0/noop-Ch0IHcOP.js
diff --git a/web/vendor/videojs/10.1.0/number-CWlYxwN1.js b/web/vendor/videojs/10.2.0/number-CWlYxwN1.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/number-CWlYxwN1.js
rename to web/vendor/videojs/10.2.0/number-CWlYxwN1.js
diff --git a/web/vendor/videojs/10.1.0/observe-elements-DVlFNzIr.js b/web/vendor/videojs/10.2.0/observe-elements-DVlFNzIr.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/observe-elements-DVlFNzIr.js
rename to web/vendor/videojs/10.2.0/observe-elements-DVlFNzIr.js
diff --git a/web/vendor/videojs/10.1.0/oc-BGJhb6mN.js b/web/vendor/videojs/10.2.0/oc-BGJhb6mN.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/oc-BGJhb6mN.js
rename to web/vendor/videojs/10.2.0/oc-BGJhb6mN.js
diff --git a/web/vendor/videojs/10.1.0/pick-66qBhPHR.js b/web/vendor/videojs/10.2.0/pick-66qBhPHR.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/pick-66qBhPHR.js
rename to web/vendor/videojs/10.2.0/pick-66qBhPHR.js
diff --git a/web/vendor/videojs/10.1.0/pl-DC22PCut.js b/web/vendor/videojs/10.2.0/pl-DC22PCut.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/pl-DC22PCut.js
rename to web/vendor/videojs/10.2.0/pl-DC22PCut.js
diff --git a/web/vendor/videojs/10.1.0/player-BdRyYiuB.js b/web/vendor/videojs/10.2.0/player-BdRyYiuB.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/player-BdRyYiuB.js
rename to web/vendor/videojs/10.2.0/player-BdRyYiuB.js
diff --git a/web/vendor/videojs/10.1.0/popup-group-context-DtGmevFv.js b/web/vendor/videojs/10.2.0/popup-group-context-DtGmevFv.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/popup-group-context-DtGmevFv.js
rename to web/vendor/videojs/10.2.0/popup-group-context-DtGmevFv.js
diff --git a/web/vendor/videojs/10.1.0/predicate-C1YKBF75.js b/web/vendor/videojs/10.2.0/predicate-C1YKBF75.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/predicate-C1YKBF75.js
rename to web/vendor/videojs/10.2.0/predicate-C1YKBF75.js
diff --git a/web/vendor/videojs/10.1.0/predicate-DSCS8XT4.js b/web/vendor/videojs/10.2.0/predicate-DSCS8XT4.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/predicate-DSCS8XT4.js
rename to web/vendor/videojs/10.2.0/predicate-DSCS8XT4.js
diff --git a/web/vendor/videojs/10.1.0/predicates-DfMqV1aQ.js b/web/vendor/videojs/10.2.0/predicates-DfMqV1aQ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/predicates-DfMqV1aQ.js
rename to web/vendor/videojs/10.2.0/predicates-DfMqV1aQ.js
diff --git a/web/vendor/videojs/10.1.0/pt-BR-CpFEn1oM.js b/web/vendor/videojs/10.2.0/pt-BR-CpFEn1oM.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/pt-BR-CpFEn1oM.js
rename to web/vendor/videojs/10.2.0/pt-BR-CpFEn1oM.js
diff --git a/web/vendor/videojs/10.1.0/pt-DMN9ATI8.js b/web/vendor/videojs/10.2.0/pt-DMN9ATI8.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/pt-DMN9ATI8.js
rename to web/vendor/videojs/10.2.0/pt-DMN9ATI8.js
diff --git a/web/vendor/videojs/10.1.0/pt-PT-Bqxy0wLE.js b/web/vendor/videojs/10.2.0/pt-PT-Bqxy0wLE.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/pt-PT-Bqxy0wLE.js
rename to web/vendor/videojs/10.2.0/pt-PT-Bqxy0wLE.js
diff --git a/web/vendor/videojs/10.1.0/registered-media-BTb9nUxf.js b/web/vendor/videojs/10.2.0/registered-media-BTb9nUxf.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/registered-media-BTb9nUxf.js
rename to web/vendor/videojs/10.2.0/registered-media-BTb9nUxf.js
diff --git a/web/vendor/videojs/10.1.0/resolve-label-Csj4NyOQ.js b/web/vendor/videojs/10.2.0/resolve-label-Csj4NyOQ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/resolve-label-Csj4NyOQ.js
rename to web/vendor/videojs/10.2.0/resolve-label-Csj4NyOQ.js
diff --git a/web/vendor/videojs/10.1.0/resolve-text-lYzRwXIu.js b/web/vendor/videojs/10.2.0/resolve-text-lYzRwXIu.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/resolve-text-lYzRwXIu.js
rename to web/vendor/videojs/10.2.0/resolve-text-lYzRwXIu.js
diff --git a/web/vendor/videojs/10.1.0/ro-BOIwh-ex.js b/web/vendor/videojs/10.2.0/ro-BOIwh-ex.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ro-BOIwh-ex.js
rename to web/vendor/videojs/10.2.0/ro-BOIwh-ex.js
diff --git a/web/vendor/videojs/10.1.0/rolldown-runtime-hePW80VL.js b/web/vendor/videojs/10.2.0/rolldown-runtime-hePW80VL.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/rolldown-runtime-hePW80VL.js
rename to web/vendor/videojs/10.2.0/rolldown-runtime-hePW80VL.js
diff --git a/web/vendor/videojs/10.1.0/ru-C5e8OFTp.js b/web/vendor/videojs/10.2.0/ru-C5e8OFTp.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ru-C5e8OFTp.js
rename to web/vendor/videojs/10.2.0/ru-C5e8OFTp.js
diff --git a/web/vendor/videojs/10.1.0/safe-define-DXxmf7BV.js b/web/vendor/videojs/10.2.0/safe-define-DXxmf7BV.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/safe-define-DXxmf7BV.js
rename to web/vendor/videojs/10.2.0/safe-define-DXxmf7BV.js
diff --git a/web/vendor/videojs/10.1.0/selectors-DMVJijlA.js b/web/vendor/videojs/10.2.0/selectors-DMVJijlA.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/selectors-DMVJijlA.js
rename to web/vendor/videojs/10.2.0/selectors-DMVJijlA.js
diff --git a/web/vendor/videojs/10.2.0/session-data-Ca8-DKdu.js b/web/vendor/videojs/10.2.0/session-data-Ca8-DKdu.js
new file mode 100644
index 000000000..e491c7a9d
--- /dev/null
+++ b/web/vendor/videojs/10.2.0/session-data-Ca8-DKdu.js
@@ -0,0 +1,2 @@
+function e(e){return Math.exp(Math.log(.5)/e)}function t(t,n,r,i){let a=e(i)**r;return n*(1-a)+a*t}function n(t,n,r){return n===0?0:t/(1-e(r)**n)}const r={fastHalfLife:2,slowHalfLife:5,minTotalBytes:128e3,minBytes:16e3,minDuration:5};function i(e,n,i,a=r){let o=e.bytesSampled+i;if(i<a.minBytes||n<a.minDuration)return{...e,bytesSampled:o};let s=8e3*i/n,c=n/1e3;return{fastEstimate:t(e.fastEstimate,s,c,a.fastHalfLife),fastTotalWeight:e.fastTotalWeight+c,slowEstimate:t(e.slowEstimate,s,c,a.slowHalfLife),slowTotalWeight:e.slowTotalWeight+c,bytesSampled:o}}function a(e,t,i=r){if(!e||!(e.bytesSampled>=i.minTotalBytes&&e.fastTotalWeight>0&&e.slowTotalWeight>0))return t;let a=n(e.fastEstimate,e.fastTotalWeight,i.fastHalfLife),o=n(e.slowEstimate,e.slowTotalWeight,i.slowHalfLife);return Math.min(a,o)}function o(e,t){return new URL(e,t).href}function s(e,t){if(/^[a-z][a-z0-9+.-]*:/i.test(e)&&!/^https?:/i.test(e))return e;try{return o(e,t)}catch{return e}}function c(e){let t=/* @__PURE__ */ new Map;for(let n of e.matchAll(/([A-Z0-9-]+)=(?:"([^"]*)"|([^,]*))/g)){let e=n[1],r=n[2]??n[3]??``;e&&t.set(e,r)}return t}function l(e){let t=/^(\d+)x(\d+)$/.exec(e);return t?{width:Number.parseInt(t[1],10),height:Number.parseInt(t[2],10)}:null}function u(e){let t=Number.parseFloat(e);if(!(Number.isNaN(t)||t<=0))return Math.abs(t-23.976)<.01?{frameRateNumerator:24e3,frameRateDenominator:1001}:Math.abs(t-29.97)<.01?{frameRateNumerator:3e4,frameRateDenominator:1001}:Math.abs(t-59.94)<.01?{frameRateNumerator:6e4,frameRateDenominator:1001}:(t%1,{frameRateNumerator:Math.round(t)})}const d=[`mp4a.`,`ac-3`,`ec-3`,`ac-4`,`opus`,`flac`,`dts`,`alac`,`vorbis`];function f(e){let t=e.split(`,`).map(e=>e.trim()),n={};for(let e of t){let t=e.toLowerCase();e.startsWith(`avc1.`)||e.startsWith(`hvc1.`)||e.startsWith(`hev1.`)?n.video=e:d.some(e=>t.startsWith(e))&&(n.audio=e)}return n}function p(e){let t=e.split(`,`)[0]??e,n=Number.parseFloat(t);return Number.isNaN(n)?0:n}function m(e,t){let n=/^(\d+)(?:@(\d+))?$/.exec(e);if(!n)return null;let r=Number.parseInt(n[1],10);if(Number.isNaN(r))return null;let i;if(n[2]!==void 0){if(i=Number.parseInt(n[2],10),Number.isNaN(i))return null}else if(t!==void 0)i=t;else return null;return{start:i,end:i+r-1}}function h(e){let t=c(e);return{get(e){return t.get(e)},getInt(e,n){let r=t.get(e);if(r===void 0)return n;let i=Number.parseInt(r,10);return Number.isNaN(i)?n:i},getFloat(e,n){let r=t.get(e);if(r===void 0)return n;let i=Number.parseFloat(r);return Number.isNaN(i)?n:i},getBool(e){return t.get(e)===`YES`},getResolution(e){let n=t.get(e);if(n)return l(n)??void 0},getFrameRate(e){let n=t.get(e);if(n)return u(n)}}}function g(e,t){let n=`#${t}:`;return e.startsWith(n)?h(e.slice(n.length)):null}const _=2**17;var v=class{#e;#t;constructor(e,{minChunkSize:t=_}={}){this.#t=e,this.#e=t}async*[Symbol.asyncIterator](){let e,t=this.#t.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n){e&&(yield e);break}e=e?y(e,r):r,e.length>=this.#e&&(yield e,e=void 0)}}finally{t.releaseLock()}}};function y(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}async function b(e,t){let n=new Headers(t?.headers);if(e.byteRange){let{start:t,end:r}=e.byteRange;n.set(`Range`,`bytes=${t}-${r}`)}let r=new Request(e.url,{method:`GET`,...t,headers:n});return fetch(r)}function x(e){return e.text()}const S=async(e,t)=>{let n=await b(e,t);if(!n.ok)throw Error(`fetchResolvableText: ${n.status} ${n.statusText} for ${e.url}`);return x(n)};async function C(e,t){let{minChunkSize:n,...r}=t??{},i=await b(e,r);if(!i.ok)throw Error(`fetchStream: ${i.status} ${i.statusText} for ${e.url}`);if(!i.body)throw Error(`Response has no body`);return new v(i.body,...n===void 0?[]:[{minChunkSize:n}])}function w(e,t){let n=e;return async(e,r)=>{let a=await C(e,r);return{[Symbol.asyncIterator]:async function*(){let e=performance.now();for await(let r of a){let a=performance.now()-e;n=i(n,a,r.byteLength),t(n),yield r,e=performance.now()}}}}}function T(e,t){let n=e.get(`DATA-ID`),r=e.get(`VALUE`),i=e.get(`URI`);if(!n||r===void 0&&i===void 0)return;let a=e.get(`LANGUAGE`),s={dataId:n};return r!==void 0&&(s.value=r),i!==void 0&&(s.uri=o(i,t),s.format=e.get(`FORMAT`)===`RAW`?`RAW`:`JSON`),a&&(s.language=a),s}function E(e,t,n){for(let r of e.split(/\r?\n/)){let e=g(r.trim(),`EXT-X-SESSION-DATA`),i=e&&T(e,n);if(i?.dataId===t&&i.uri)return i.uri}}export{S as a,g as c,p as d,s as f,a as h,b as i,m as l,r as m,T as n,C as o,o as p,w as r,x as s,E as t,f as u};
+//# sourceMappingURL=session-data-Ca8-DKdu.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/shallow-equal-KV1zFqZi.js b/web/vendor/videojs/10.2.0/shallow-equal-KV1zFqZi.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/shallow-equal-KV1zFqZi.js
rename to web/vendor/videojs/10.2.0/shallow-equal-KV1zFqZi.js
diff --git a/web/vendor/videojs/10.1.0/sk-Bh5EH8V-.js b/web/vendor/videojs/10.2.0/sk-Bh5EH8V-.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/sk-Bh5EH8V-.js
rename to web/vendor/videojs/10.2.0/sk-Bh5EH8V-.js
diff --git a/web/vendor/videojs/10.1.0/sl-C7qQj8Td.js b/web/vendor/videojs/10.2.0/sl-C7qQj8Td.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/sl-C7qQj8Td.js
rename to web/vendor/videojs/10.2.0/sl-C7qQj8Td.js
diff --git a/web/vendor/videojs/10.1.0/snapshot-controller-D07v57w-.js b/web/vendor/videojs/10.2.0/snapshot-controller-D07v57w-.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/snapshot-controller-D07v57w-.js
rename to web/vendor/videojs/10.2.0/snapshot-controller-D07v57w-.js
diff --git a/web/vendor/videojs/10.1.0/sr-riuwToe5.js b/web/vendor/videojs/10.2.0/sr-riuwToe5.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/sr-riuwToe5.js
rename to web/vendor/videojs/10.2.0/sr-riuwToe5.js
diff --git a/web/vendor/videojs/10.1.0/state-CABM1wUm.js b/web/vendor/videojs/10.2.0/state-CABM1wUm.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/state-CABM1wUm.js
rename to web/vendor/videojs/10.2.0/state-CABM1wUm.js
diff --git a/web/vendor/videojs/10.1.0/state-data-attrs-CjNZtRJA.js b/web/vendor/videojs/10.2.0/state-data-attrs-CjNZtRJA.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/state-data-attrs-CjNZtRJA.js
rename to web/vendor/videojs/10.2.0/state-data-attrs-CjNZtRJA.js
diff --git a/web/vendor/videojs/10.1.0/style-iIgYFplF.js b/web/vendor/videojs/10.2.0/style-iIgYFplF.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/style-iIgYFplF.js
rename to web/vendor/videojs/10.2.0/style-iIgYFplF.js
diff --git a/web/vendor/videojs/10.1.0/sv-CojyShpZ.js b/web/vendor/videojs/10.2.0/sv-CojyShpZ.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/sv-CojyShpZ.js
rename to web/vendor/videojs/10.2.0/sv-CojyShpZ.js
diff --git a/web/vendor/videojs/10.1.0/te-3TSXNC1r.js b/web/vendor/videojs/10.2.0/te-3TSXNC1r.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/te-3TSXNC1r.js
rename to web/vendor/videojs/10.2.0/te-3TSXNC1r.js
diff --git a/web/vendor/videojs/10.1.0/text-track-aC_8Gh6M.js b/web/vendor/videojs/10.2.0/text-track-aC_8Gh6M.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/text-track-aC_8Gh6M.js
rename to web/vendor/videojs/10.2.0/text-track-aC_8Gh6M.js
diff --git a/web/vendor/videojs/10.1.0/th-LeVwXfqc.js b/web/vendor/videojs/10.2.0/th-LeVwXfqc.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/th-LeVwXfqc.js
rename to web/vendor/videojs/10.2.0/th-LeVwXfqc.js
diff --git a/web/vendor/videojs/10.1.0/time-DYSdevo1.js b/web/vendor/videojs/10.2.0/time-DYSdevo1.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/time-DYSdevo1.js
rename to web/vendor/videojs/10.2.0/time-DYSdevo1.js
diff --git a/web/vendor/videojs/10.1.0/tr-P0AuPQR-.js b/web/vendor/videojs/10.2.0/tr-P0AuPQR-.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/tr-P0AuPQR-.js
rename to web/vendor/videojs/10.2.0/tr-P0AuPQR-.js
diff --git a/web/vendor/videojs/10.1.0/translate-text-BRTkqA4G.js b/web/vendor/videojs/10.2.0/translate-text-BRTkqA4G.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/translate-text-BRTkqA4G.js
rename to web/vendor/videojs/10.2.0/translate-text-BRTkqA4G.js
diff --git a/web/vendor/videojs/10.1.0/tree-Db6JWG7V.js b/web/vendor/videojs/10.2.0/tree-Db6JWG7V.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/tree-Db6JWG7V.js
rename to web/vendor/videojs/10.2.0/tree-Db6JWG7V.js
diff --git a/web/vendor/videojs/10.1.0/types-HOYOipK7.js b/web/vendor/videojs/10.2.0/types-HOYOipK7.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/types-HOYOipK7.js
rename to web/vendor/videojs/10.2.0/types-HOYOipK7.js
diff --git a/web/vendor/videojs/10.1.0/ui-element-CUMzLga1.js b/web/vendor/videojs/10.2.0/ui-element-CUMzLga1.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui-element-CUMzLga1.js
rename to web/vendor/videojs/10.2.0/ui-element-CUMzLga1.js
diff --git a/web/vendor/videojs/10.1.0/ui/container.js b/web/vendor/videojs/10.2.0/ui/container.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/container.js
rename to web/vendor/videojs/10.2.0/ui/container.js
diff --git a/web/vendor/videojs/10.1.0/ui/fullscreen-button.js b/web/vendor/videojs/10.2.0/ui/fullscreen-button.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/fullscreen-button.js
rename to web/vendor/videojs/10.2.0/ui/fullscreen-button.js
diff --git a/web/vendor/videojs/10.1.0/ui/mute-button.js b/web/vendor/videojs/10.2.0/ui/mute-button.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/mute-button.js
rename to web/vendor/videojs/10.2.0/ui/mute-button.js
diff --git a/web/vendor/videojs/10.1.0/ui/pip-button.js b/web/vendor/videojs/10.2.0/ui/pip-button.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/pip-button.js
rename to web/vendor/videojs/10.2.0/ui/pip-button.js
diff --git a/web/vendor/videojs/10.1.0/ui/play-button.js b/web/vendor/videojs/10.2.0/ui/play-button.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/play-button.js
rename to web/vendor/videojs/10.2.0/ui/play-button.js
diff --git a/web/vendor/videojs/10.1.0/ui/slider-buffer.js b/web/vendor/videojs/10.2.0/ui/slider-buffer.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/slider-buffer.js
rename to web/vendor/videojs/10.2.0/ui/slider-buffer.js
diff --git a/web/vendor/videojs/10.1.0/ui/slider-fill.js b/web/vendor/videojs/10.2.0/ui/slider-fill.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/slider-fill.js
rename to web/vendor/videojs/10.2.0/ui/slider-fill.js
diff --git a/web/vendor/videojs/10.1.0/ui/slider-thumb.js b/web/vendor/videojs/10.2.0/ui/slider-thumb.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/slider-thumb.js
rename to web/vendor/videojs/10.2.0/ui/slider-thumb.js
diff --git a/web/vendor/videojs/10.1.0/ui/slider-track.js b/web/vendor/videojs/10.2.0/ui/slider-track.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/slider-track.js
rename to web/vendor/videojs/10.2.0/ui/slider-track.js
diff --git a/web/vendor/videojs/10.1.0/ui/slider-value.js b/web/vendor/videojs/10.2.0/ui/slider-value.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/ui/slider-value.js
rename to web/vendor/videojs/10.2.0/ui/slider-value.js
diff --git a/web/vendor/videojs/10.1.0/ui/time-slider.js b/web/vendor/videojs/10.2.0/ui/time-slider.js
similarity index 57%
rename from web/vendor/videojs/10.1.0/ui/time-slider.js
rename to web/vendor/videojs/10.2.0/ui/time-slider.js
index f564383ed..fa10ba54a 100644
--- a/web/vendor/videojs/10.1.0/ui/time-slider.js
+++ b/web/vendor/videojs/10.2.0/ui/time-slider.js
@@ -1,3 +1,3 @@
/*! Video.js | https://videojs.org/help */
-import{t as e}from"../defaults-BMkSdEzN.js";import{t}from"../context-provider-ivCWVZbp.js";import{r as n,t as r}from"../controller-DyVV6rgW.js";import{O as i}from"../volume-cOW73aoK.js";import{t as a}from"../style-iIgYFplF.js";import{t as o}from"../ui-element-CUMzLga1.js";import{t as s}from"../safe-define-DXxmf7BV.js";import{i as c}from"../context-BEwcGq-j.js";import{n as l,r as u,t as d}from"../data-JRMbnaJJ.js";import{t as f}from"../state-CABM1wUm.js";import{t as p}from"../controller-4KIPcUJn.js";import{m,r as h,t as g}from"../predicate-C1YKBF75.js";import{l as _,m as v,n as y,r as b}from"../selectors-DMVJijlA.js";import{r as x}from"../number-CWlYxwN1.js";import{i as S,r as C}from"../css-vars-7FASVoTa.js";import{t as w}from"../element-props-B1KSgbJ9.js";import{t as T}from"../state-data-attrs-CjNZtRJA.js";import{n as E,t as D}from"../format-YaJWnevo.js";import{a as O,p as k}from"../time-DYSdevo1.js";import{t as A}from"../context-D_k9hQ7P.js";import{translateText as j}from"../i18n.js";function M(e){let t=f({percent:void 0}),n,r=!1,a=null;function o(){let s=a?.getAnimations?.().some(t=>`transitionProperty`in t&&t.transitionProperty===e&&t.playState!==`finished`);if(r||s){n=i(o);return}n=void 0,t.patch({percent:void 0})}function s(e){n?.(),t.patch({percent:e}),n=i(o)}return{state:t,seek:s,update(e,n,i){a=i,e&&!r&&t.current.percent===void 0&&s(n),r=e},destroy(){n?.(),n=void 0,r=!1,a=null,t.patch({percent:void 0})}}}const N={key:`slider.seek`,text:`Seek`};var P=class t extends l{static defaultProps={...l.defaultProps,label:``,changeThrottle:100,pauseOnDrag:!1};#e={...t.defaultProps};#t=null;#n;#r=!1;#i;constructor(e){super(),e&&this.setProps(e)}setProps(n){this.#e=e(n,t.defaultProps),super.setProps({...n,min:0})}setMedia(e){this.#t=e}setFormatLocale(e){this.#n!==e&&(this.#i=void 0),this.#n=e}getState(){let e=this.#t,{currentTime:t,seeking:n,buffered:r}=e,i=g(e);super.setProps({...this.#e,disabled:this.#e.disabled||!h(e),min:0,max:i});let a=super.getSliderState(t),o=r.length>0?r[r.length-1][1]:0,s=x(o,0,i);return{...a,currentTime:t,duration:i,seeking:n,bufferPercent:s}}getLabel(e){return super.getLabel(e)||N}#a(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#o(e){return this.#n===void 0?E(e):E(e,{locale:this.#n})}getValueText(e){return e.duration<=0?k:Number.isFinite(e.duration)?O:this.getValueTextParams(e).current}getValueTextParams(e){let t=Math.floor(this.#a(e)),n=Math.floor(e.duration);if(this.#i&&this.#i.current===t&&this.#i.duration===n)return this.#i.params;let r=Number.isFinite(n)?{current:this.#o(t),duration:this.#o(n)}:{current:this.#o(t)};return this.#i={current:t,duration:n,params:r},r}startDrag(e){this.#r=!1,this.#e.pauseOnDrag&&e&&!e.paused&&(this.#r=!0,e.pause())}endDrag(e){this.#r&&e?.play().catch(()=>{}),this.#r=!1}getAttrs(e){let t=super.getAttrs(e),n=this.#a(e);return{...t,"aria-valuenow":n,"aria-valuetext":this.getValueText(e)}}};const F={...d,seeking:`data-seeking`};var I=class extends o{constructor(...e){super(...e),this.label=``,this.changeThrottle=P.defaultProps.changeThrottle,this.step=P.defaultProps.step,this.largeStep=P.defaultProps.largeStep,this.orientation=P.defaultProps.orientation,this.disabled=P.defaultProps.disabled,this.thumbAlignment=P.defaultProps.thumbAlignment,this.pauseOnDrag=P.defaultProps.pauseOnDrag,this.#e=new P,this.#t=new p(this,c,b),this.#n=new t(this,{context:A}),this.#r=new p(this,c,v),this.#i=new p(this,c,y),this.#a=new p(this,c,_),this.#o=M(S.fill),this.#s=new r(this,n),this.#c={},this.#l=null,this.#u=null,this.#d=null}static{this.tagName=`media-time-slider`}static{this.properties={label:{type:String},changeThrottle:{type:Number,attribute:`change-throttle`},step:{type:Number},largeStep:{type:Number,attribute:`large-step`},orientation:{type:String},disabled:{type:Boolean},thumbAlignment:{type:String,attribute:`thumb-alignment`},pauseOnDrag:{type:Boolean,attribute:`pause-on-drag`}}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;connectedCallback(){if(super.connectedCallback(),this.destroyed)return;this.#u=new AbortController;let e=this.#u.signal;this.#l=u({getElement:()=>this,getThumbElement:()=>this.querySelector(`media-slider-thumb`),getOrientation:()=>this.orientation,isDisabled:()=>{let e=this.#r.value,t=this.#i.value;return this.disabled||!e||!h({...e,...t??{buffered:[],seekable:[]}})},getPercent:()=>{let e=this.#r.value;return e?this.#e.percentFromValue(e.currentTime):0},getStepPercent:()=>this.#e.getStepPercent(),getLargeStepPercent:()=>this.#e.getLargeStepPercent(),onValueCommit:e=>{let t=this.#r.value;if(t){let n=this.#e.rawValueFromPercent(e);this.#o.seek(e),t.seek(n)}},changeThrottle:this.changeThrottle,onPressStart:()=>{this.#d??=this.#t.value?.requestControlsLock()??null},onPressEnd:()=>this.#p(),onDragStart:()=>{this.#e.startDrag(this.#a.value),this.dispatchEvent(new CustomEvent(`drag-start`,{bubbles:!0}))},onDragEnd:()=>{this.#e.endDrag(this.#a.value),this.dispatchEvent(new CustomEvent(`drag-end`,{bubbles:!0}))},adjustPercent:(e,t,n)=>this.#e.adjustPercentForAlignment(e,t,n),onResize:()=>this.requestUpdate()}),w(this,this.#l.rootProps,{signal:e}),a(this,this.#l.rootStyle),this.#l.input.subscribe(()=>this.requestUpdate(),{signal:e}),this.#o.state.subscribe(()=>this.requestUpdate(),{signal:e})}disconnectedCallback(){this.#p(),this.#f(),this.#o.destroy(),super.disconnectedCallback(),this.#u?.abort(),this.#u=null}destroyCallback(){this.#p(),this.#f(),this.#o.destroy(),this.#l?.destroy(),super.destroyCallback()}#f(){this.#e.endDrag(this.#a.value)}#p(){this.#d?.(),this.#d=null}willUpdate(e){super.willUpdate(e),this.#e.setProps({label:this.label,changeThrottle:this.changeThrottle,step:this.step,largeStep:this.largeStep,orientation:this.orientation,disabled:this.disabled,thumbAlignment:this.thumbAlignment,pauseOnDrag:this.pauseOnDrag}),this.#e.setFormatLocale(this.#s.locale)}update(e){if(super.update(e),!this.#l)return;let t=this.#r.value,n=this.#i.value;if(!t){this.#o.destroy(),this.removeAttribute(`data-playing`);return}this.#e.setInput(this.#l.input.current);let r={...t,...n??{buffered:[],seekable:[]}};this.#e.setMedia(r);let i=this.#e.getState();this.#o.update(i.seeking,i.fillPercent,this);let o=this.#o.state.current.percent;this.toggleAttribute(`data-playing`,m(this.#a.value)&&!i.disabled&&!i.dragging&&!i.seeking&&o===void 0);let s=o===void 0||i.dragging||i.disabled?i:{...i,fillPercent:o},c=C(this.#l.adjustForAlignment(s)),l=Object.fromEntries(Object.entries(c).filter(([e,t])=>this.#c[e]!==t));a(this,l),this.#c=c;let u=this.#e.getAttrs(i);T(this,i,F),this.#n.setValue({state:i,stateAttrMap:F,pointerValue:this.#e.rawValueFromPercent(i.pointerPercent),thumbAttrs:{...u,"aria-label":j(u[`aria-label`],this.#s.value),"aria-valuetext":j(u[`aria-valuetext`],this.#s.value,this.#e.getValueTextParams(i))},thumbProps:this.#l.thumbProps,formatValue:e=>D(e,i.duration,{locale:this.#s.locale})})}};s(I);
+import{t as e}from"../defaults-BMkSdEzN.js";import{t}from"../context-provider-ivCWVZbp.js";import{r as n,t as r}from"../controller-DyVV6rgW.js";import{O as i}from"../volume-cOW73aoK.js";import{t as a}from"../style-iIgYFplF.js";import{t as o}from"../ui-element-CUMzLga1.js";import{t as s}from"../safe-define-DXxmf7BV.js";import{i as c}from"../context-BEwcGq-j.js";import{n as l,r as u,t as d}from"../data-JRMbnaJJ.js";import{t as f}from"../state-CABM1wUm.js";import{t as p}from"../controller-4KIPcUJn.js";import{m,r as h,t as g}from"../predicate-C1YKBF75.js";import{l as _,m as v,n as y,r as b}from"../selectors-DMVJijlA.js";import{r as x}from"../number-CWlYxwN1.js";import{i as S,r as C}from"../css-vars-7FASVoTa.js";import{t as w}from"../element-props-B1KSgbJ9.js";import{t as T}from"../state-data-attrs-CjNZtRJA.js";import{n as E,t as D}from"../format-YaJWnevo.js";import{a as O,p as k}from"../time-DYSdevo1.js";import{t as A}from"../context-D_k9hQ7P.js";import{translateText as j}from"../i18n.js";function M(e){let t=f({percent:void 0}),n,r=!1,a=null;function o(){let s=a?.getAnimations?.().some(t=>`transitionProperty`in t&&t.transitionProperty===e&&t.playState!==`finished`);if(r||s){n=i(o);return}n=void 0,t.patch({percent:void 0})}function s(e){n?.(),t.patch({percent:e}),n=i(o)}return{state:t,seek:s,update(e,n,i){a=i,e&&!r&&t.current.percent===void 0&&s(n),r=e},destroy(){n?.(),n=void 0,r=!1,a=null,t.patch({percent:void 0})}}}const N={key:`slider.seek`,text:`Seek`};var P=class t extends l{static defaultProps={...l.defaultProps,label:``,changeThrottle:100,pauseOnDrag:!1};#e={...t.defaultProps};#t=null;#n;#r=!1;#i;constructor(e){super(),e&&this.setProps(e)}setProps(n){this.#e=e(n,t.defaultProps),super.setProps({...n,min:0})}setMedia(e){this.#t=e}setFormatLocale(e){this.#n!==e&&(this.#i=void 0),this.#n=e}getState(){let e=this.#t,{currentTime:t,seeking:n,buffered:r}=e,i=g(e);super.setProps({...this.#e,disabled:this.#e.disabled||!h(e),min:0,max:i});let a=super.getSliderState(t),o=r.length>0?r[r.length-1][1]:0,s=x(o,0,i);return{...a,currentTime:t,duration:i,seeking:n,bufferPercent:s}}getLabel(e){return super.getLabel(e)||N}#a(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#o(e){return this.#n===void 0?E(e):E(e,{locale:this.#n})}getValueText(e){return e.duration<=0?k:Number.isFinite(e.duration)?O:this.getValueTextParams(e).current}getValueTextParams(e){let t=Math.floor(this.#a(e)),n=Math.floor(e.duration);if(this.#i&&this.#i.current===t&&this.#i.duration===n)return this.#i.params;let r=Number.isFinite(n)?{current:this.#o(t),duration:this.#o(n)}:{current:this.#o(t)};return this.#i={current:t,duration:n,params:r},r}startDrag(e){this.#r=!1,this.#e.pauseOnDrag&&e&&!e.paused&&(this.#r=!0,e.pause())}endDrag(e){this.#r&&e?.play().catch(()=>{}),this.#r=!1}getAttrs(e){let t=super.getAttrs(e),n=this.#a(e);return{...t,"aria-valuenow":n,"aria-valuetext":this.getValueText(e)}}};const F={...d,seeking:`data-seeking`};var I=class extends o{constructor(...e){super(...e),this.label=``,this.changeThrottle=P.defaultProps.changeThrottle,this.step=P.defaultProps.step,this.largeStep=P.defaultProps.largeStep,this.orientation=P.defaultProps.orientation,this.disabled=P.defaultProps.disabled,this.thumbAlignment=P.defaultProps.thumbAlignment,this.pauseOnDrag=P.defaultProps.pauseOnDrag,this.#e=new P,this.#t=new p(this,c,b),this.#n=new t(this,{context:A}),this.#r=new p(this,c,v),this.#i=new p(this,c,y),this.#a=new p(this,c,_),this.#o=M(S.fill),this.#s=new r(this,n),this.#c={},this.#l=null,this.#u=null,this.#d=null}static{this.tagName=`media-time-slider`}static{this.properties={label:{type:String},changeThrottle:{type:Number,attribute:`change-throttle`},step:{type:Number},largeStep:{type:Number,attribute:`large-step`},orientation:{type:String},disabled:{type:Boolean},thumbAlignment:{type:String,attribute:`thumb-alignment`},pauseOnDrag:{type:Boolean,attribute:`pause-on-drag`}}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;connectedCallback(){if(super.connectedCallback(),this.destroyed)return;this.#u=new AbortController;let e=this.#u.signal,t,n=e=>{let t=this.#r.value;if(t){let n=this.#e.rawValueFromPercent(e);this.#o.seek(e),t.seek(n)}};this.#l=u({getElement:()=>this,getThumbElement:()=>this.querySelector(`media-slider-thumb`),getOrientation:()=>this.orientation,isDisabled:()=>{let e=this.#r.value,t=this.#i.value;return this.disabled||!e||!h({...e,...t??{buffered:[],seekable:[]}})},getPercent:()=>{let e=this.#r.value;return e?this.#e.percentFromValue(e.currentTime):0},getStepPercent:()=>this.#e.getStepPercent(),getLargeStepPercent:()=>this.#e.getLargeStepPercent(),onValueChange:e=>{this.#l?.input.current.dragging&&e!==t&&(t=e,n(e))},onValueCommit:e=>{e!==t&&n(e),t=void 0},changeThrottle:this.changeThrottle,onPressStart:()=>{this.#d??=this.#t.value?.requestControlsLock()??null},onPressEnd:()=>this.#p(),onDragStart:()=>{this.#e.startDrag(this.#a.value),this.dispatchEvent(new CustomEvent(`drag-start`,{bubbles:!0}))},onDragEnd:()=>{this.#e.endDrag(this.#a.value),this.dispatchEvent(new CustomEvent(`drag-end`,{bubbles:!0}))},adjustPercent:(e,t,n)=>this.#e.adjustPercentForAlignment(e,t,n),onResize:()=>{this.thumbAlignment===`edge`&&this.requestUpdate()}}),w(this,this.#l.rootProps,{signal:e}),a(this,this.#l.rootStyle),this.#l.input.subscribe(()=>this.requestUpdate(),{signal:e}),this.#o.state.subscribe(()=>this.requestUpdate(),{signal:e})}disconnectedCallback(){this.#p(),this.#f(),this.#o.destroy(),super.disconnectedCallback(),this.#u?.abort(),this.#u=null}destroyCallback(){this.#p(),this.#f(),this.#o.destroy(),this.#l?.destroy(),super.destroyCallback()}#f(){this.#e.endDrag(this.#a.value)}#p(){this.#d?.(),this.#d=null}willUpdate(e){super.willUpdate(e),this.#e.setProps({label:this.label,changeThrottle:this.changeThrottle,step:this.step,largeStep:this.largeStep,orientation:this.orientation,disabled:this.disabled,thumbAlignment:this.thumbAlignment,pauseOnDrag:this.pauseOnDrag}),this.#e.setFormatLocale(this.#s.locale)}update(e){if(super.update(e),!this.#l)return;let t=this.#r.value,n=this.#i.value;if(!t){this.#o.destroy(),this.removeAttribute(`data-playing`);return}this.#e.setInput(this.#l.input.current);let r={...t,...n??{buffered:[],seekable:[]}};this.#e.setMedia(r);let i=this.#e.getState();this.#o.update(i.seeking,i.fillPercent,this);let o=this.#o.state.current.percent;this.toggleAttribute(`data-playing`,m(this.#a.value)&&!i.disabled&&!i.dragging&&!i.seeking&&o===void 0);let s=o===void 0||i.dragging||i.disabled?i:{...i,fillPercent:o},c=C(this.#l.adjustForAlignment(s)),l=Object.fromEntries(Object.entries(c).filter(([e,t])=>this.#c[e]!==t));a(this,l),this.#c=c;let u=this.#e.getAttrs(i);T(this,i,F),this.#n.setValue({state:i,stateAttrMap:F,pointerValue:this.#e.rawValueFromPercent(i.pointerPercent),thumbAttrs:{...u,"aria-label":j(u[`aria-label`],this.#s.value),"aria-valuetext":j(u[`aria-valuetext`],this.#s.value,this.#e.getValueTextParams(i))},thumbProps:this.#l.thumbProps,formatValue:e=>D(e,i.duration,{locale:this.#s.locale})})}};s(I);
//# sourceMappingURL=time-slider.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/ui/volume-slider.js b/web/vendor/videojs/10.2.0/ui/volume-slider.js
similarity index 75%
rename from web/vendor/videojs/10.1.0/ui/volume-slider.js
rename to web/vendor/videojs/10.2.0/ui/volume-slider.js
index e094e897c..f0b1a90da 100644
--- a/web/vendor/videojs/10.1.0/ui/volume-slider.js
+++ b/web/vendor/videojs/10.2.0/ui/volume-slider.js
@@ -1,3 +1,3 @@
/*! Video.js | https://videojs.org/help */
-import{s as e}from"../predicate-DSCS8XT4.js";import{t}from"../defaults-BMkSdEzN.js";import{t as n}from"../context-provider-ivCWVZbp.js";import{r,t as i}from"../controller-DyVV6rgW.js";import{t as a}from"../style-iIgYFplF.js";import{t as o}from"../ui-element-CUMzLga1.js";import{t as s}from"../safe-define-DXxmf7BV.js";import{i as c}from"../context-BEwcGq-j.js";import{n as l,r as u,t as d}from"../data-JRMbnaJJ.js";import{t as f}from"../controller-4KIPcUJn.js";import{h as p,r as m}from"../selectors-DMVJijlA.js";import{t as h}from"../number-CWlYxwN1.js";import{t as g}from"../css-vars-7FASVoTa.js";import{t as _}from"../element-props-B1KSgbJ9.js";import{t as v}from"../state-data-attrs-CjNZtRJA.js";import{r as y,t as b}from"../volume-bLkHAx2V.js";import{t as x}from"../context-D_k9hQ7P.js";import{translateText as S}from"../i18n.js";function C(e){return{onWheel(t){if(e.isDisabled())return;let n=Math.sign(t.deltaY);if(n===0)return;t.preventDefault();let r=e.getStepPercent(),i=e.getPercent(),a=h(i-n*r,0,100);e.onValueChange?.(a)}}}const w=/* @__PURE__ */ new Map;function T(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function E(e){let t=T(e),n=w.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),w.set(t,n)}catch{return}return n}function D(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function O(t,n){let r=!e(t)||!Number.isFinite(t)?0:Math.min(1,Math.max(0,t));try{let e=E(n)??E(void 0);if(e)return e.format(r)}catch{}return D(r)}var k=class e extends l{static defaultProps={...l.defaultProps,label:``,step:5,wheelStep:5};#e=e.defaultProps.wheelStep;#t=null;#n;constructor(e){super(),e&&this.setProps(e)}setProps(n){let r=t(n,e.defaultProps);this.#e=r.wheelStep,super.setProps(r)}setMedia(e){this.#t=e}setFormatLocale(e){this.#n=e}getState(){let e=this.#t,{volume:t,muted:n}=e,r=n||t===0,{dragging:i,dragPercent:a}=this.input,o=t*100,s=i?this.valueFromPercent(a):o,c=super.getSliderState(s),l=e.volumeAvailability;return{...c,disabled:c.disabled||l!==`available`,fillPercent:r?0:c.fillPercent,volume:t,muted:r,availability:l,hidden:l!==`available`}}getWheelStepPercent(){let{min:e,max:t}=this.props,n=t-e;return n>0?this.#e/n*100:0}getLabel(e){return super.getLabel(e)||b}getValueText(e){return e.muted?y:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:O(e.value/100,this.#n)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}};const A={...d,availability:`data-availability`,hidden:`data-hidden`};var j=class extends o{constructor(...e){super(...e),this.label=``,this.step=k.defaultProps.step,this.largeStep=k.defaultProps.largeStep,this.wheelStep=k.defaultProps.wheelStep,this.orientation=k.defaultProps.orientation,this.disabled=k.defaultProps.disabled,this.thumbAlignment=k.defaultProps.thumbAlignment,this.#e=new k,this.#t=new f(this,c,m),this.#n=new n(this,{context:x}),this.#r=new f(this,c,p),this.#i=new i(this,r),this.#a=null,this.#o=null,this.#s=null}static{this.tagName=`media-volume-slider`}static{this.properties={label:{type:String},step:{type:Number},largeStep:{type:Number,attribute:`large-step`},wheelStep:{type:Number,attribute:`wheel-step`},orientation:{type:String},disabled:{type:Boolean},thumbAlignment:{type:String,attribute:`thumb-alignment`}}}#e;#t;#n;#r;#i;#a;#o;#s;connectedCallback(){if(super.connectedCallback(),this.destroyed)return;this.#o=new AbortController;let e=this.#o.signal,t=()=>{let e=this.#r.value;return this.disabled||!e||e.volumeAvailability!==`available`},n=()=>(this.#r.value?.volume??0)*100,r=()=>this.#e.getStepPercent(),i=e=>this.#l(e);this.#a=u({getElement:()=>this,getThumbElement:()=>this.querySelector(`media-slider-thumb`),getOrientation:()=>this.orientation,isDisabled:t,getPercent:n,getStepPercent:r,getLargeStepPercent:()=>this.#e.getLargeStepPercent(),onValueChange:i,onValueCommit:i,onPressStart:()=>{this.#s??=this.#t.value?.requestControlsLock()??null},onPressEnd:()=>this.#c(),onDragStart:()=>{this.dispatchEvent(new CustomEvent(`drag-start`,{bubbles:!0}))},onDragEnd:()=>{this.dispatchEvent(new CustomEvent(`drag-end`,{bubbles:!0}))},adjustPercent:(e,t,n)=>this.#e.adjustPercentForAlignment(e,t,n),onResize:()=>this.requestUpdate()});let o=C({isDisabled:t,getPercent:n,getStepPercent:()=>this.#e.getWheelStepPercent(),onValueChange:e=>this.#r.value?.setVolume(this.#e.rawValueFromPercent(e)/100)});_(this,this.#a.rootProps,{signal:e}),_(this,o,{signal:e}),a(this,this.#a.rootStyle),this.#a.input.subscribe(()=>this.requestUpdate(),{signal:e})}disconnectedCallback(){this.#c(),super.disconnectedCallback(),this.#o?.abort(),this.#o=null}destroyCallback(){this.#c(),this.#a?.destroy(),super.destroyCallback()}#c(){this.#s?.(),this.#s=null}willUpdate(e){super.willUpdate(e),this.#e.setProps(this),this.#e.setFormatLocale(this.#i.locale)}update(e){if(super.update(e),!this.#a)return;let t=this.#r.value;if(!t)return;this.#e.setInput(this.#a.input.current),this.#e.setMedia(t);let n=this.#e.getState(),r=g(this.#a.adjustForAlignment(n)),i=this.#e.getAttrs(n);a(this,r),v(this,n,A),_(this,{hidden:n.hidden?``:void 0}),this.#n.setValue({state:n,stateAttrMap:A,pointerValue:this.#e.valueFromPercent(n.pointerPercent),thumbAttrs:{...i,"aria-label":S(i[`aria-label`],this.#i.value),"aria-valuetext":S(i[`aria-valuetext`],this.#i.value,this.#e.getValueTextParams(n))},thumbProps:this.#a.thumbProps,formatValue:e=>`${Math.round(e)}%`})}#l(e){this.#r.value?.setVolume(this.#e.valueFromPercent(e)/100)}};s(j);
+import{s as e}from"../predicate-DSCS8XT4.js";import{t}from"../defaults-BMkSdEzN.js";import{t as n}from"../context-provider-ivCWVZbp.js";import{r,t as i}from"../controller-DyVV6rgW.js";import{t as a}from"../style-iIgYFplF.js";import{t as o}from"../ui-element-CUMzLga1.js";import{t as s}from"../safe-define-DXxmf7BV.js";import{i as c}from"../context-BEwcGq-j.js";import{n as l,r as u,t as d}from"../data-JRMbnaJJ.js";import{t as f}from"../controller-4KIPcUJn.js";import{h as p,r as m}from"../selectors-DMVJijlA.js";import{t as h}from"../number-CWlYxwN1.js";import{t as g}from"../css-vars-7FASVoTa.js";import{t as _}from"../element-props-B1KSgbJ9.js";import{t as v}from"../state-data-attrs-CjNZtRJA.js";import{r as y,t as b}from"../volume-bLkHAx2V.js";import{t as x}from"../context-D_k9hQ7P.js";import{translateText as S}from"../i18n.js";function C(e){return{onWheel(t){if(e.isDisabled())return;let n=Math.sign(t.deltaY);if(n===0)return;t.preventDefault();let r=e.getStepPercent(),i=e.getPercent(),a=h(i-n*r,0,100);e.onValueChange?.(a)}}}const w=/* @__PURE__ */ new Map;function T(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function E(e){let t=T(e),n=w.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),w.set(t,n)}catch{return}return n}function D(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function O(t,n){let r=!e(t)||!Number.isFinite(t)?0:Math.min(1,Math.max(0,t));try{let e=E(n)??E(void 0);if(e)return e.format(r)}catch{}return D(r)}var k=class e extends l{static defaultProps={...l.defaultProps,label:``,step:5,wheelStep:5};#e=e.defaultProps.wheelStep;#t=null;#n;constructor(e){super(),e&&this.setProps(e)}setProps(n){let r=t(n,e.defaultProps);this.#e=r.wheelStep,super.setProps(r)}setMedia(e){this.#t=e}setFormatLocale(e){this.#n=e}getState(){let e=this.#t,{volume:t,muted:n}=e,r=n||t===0,{dragging:i,dragPercent:a}=this.input,o=t*100,s=i?this.valueFromPercent(a):o,c=super.getSliderState(s),l=e.volumeAvailability;return{...c,disabled:c.disabled||l!==`available`,fillPercent:r?0:c.fillPercent,volume:t,muted:r,availability:l,hidden:l!==`available`}}getWheelStepPercent(){let{min:e,max:t}=this.props,n=t-e;return n>0?this.#e/n*100:0}getLabel(e){return super.getLabel(e)||b}getValueText(e){return e.muted?y:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:O(e.value/100,this.#n)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}};const A={...d,availability:`data-availability`,hidden:`data-hidden`};var j=class extends o{constructor(...e){super(...e),this.label=``,this.step=k.defaultProps.step,this.largeStep=k.defaultProps.largeStep,this.wheelStep=k.defaultProps.wheelStep,this.orientation=k.defaultProps.orientation,this.disabled=k.defaultProps.disabled,this.thumbAlignment=k.defaultProps.thumbAlignment,this.#e=new k,this.#t=new f(this,c,m),this.#n=new n(this,{context:x}),this.#r=new f(this,c,p),this.#i=new i(this,r),this.#a=null,this.#o=null,this.#s=null}static{this.tagName=`media-volume-slider`}static{this.properties={label:{type:String},step:{type:Number},largeStep:{type:Number,attribute:`large-step`},wheelStep:{type:Number,attribute:`wheel-step`},orientation:{type:String},disabled:{type:Boolean},thumbAlignment:{type:String,attribute:`thumb-alignment`}}}#e;#t;#n;#r;#i;#a;#o;#s;connectedCallback(){if(super.connectedCallback(),this.destroyed)return;this.#o=new AbortController;let e=this.#o.signal,t=()=>{let e=this.#r.value;return this.disabled||!e||e.volumeAvailability!==`available`},n=()=>(this.#r.value?.volume??0)*100,r=()=>this.#e.getStepPercent(),i=e=>this.#l(e);this.#a=u({getElement:()=>this,getThumbElement:()=>this.querySelector(`media-slider-thumb`),getOrientation:()=>this.orientation,isDisabled:t,getPercent:n,getStepPercent:r,getLargeStepPercent:()=>this.#e.getLargeStepPercent(),onValueChange:i,onValueCommit:i,onPressStart:()=>{this.#s??=this.#t.value?.requestControlsLock()??null},onPressEnd:()=>this.#c(),onDragStart:()=>{this.dispatchEvent(new CustomEvent(`drag-start`,{bubbles:!0}))},onDragEnd:()=>{this.dispatchEvent(new CustomEvent(`drag-end`,{bubbles:!0}))},adjustPercent:(e,t,n)=>this.#e.adjustPercentForAlignment(e,t,n),onResize:()=>{this.thumbAlignment===`edge`&&this.requestUpdate()}});let o=C({isDisabled:t,getPercent:n,getStepPercent:()=>this.#e.getWheelStepPercent(),onValueChange:e=>this.#r.value?.setVolume(this.#e.rawValueFromPercent(e)/100)});_(this,this.#a.rootProps,{signal:e}),_(this,o,{signal:e}),a(this,this.#a.rootStyle),this.#a.input.subscribe(()=>this.requestUpdate(),{signal:e})}disconnectedCallback(){this.#c(),super.disconnectedCallback(),this.#o?.abort(),this.#o=null}destroyCallback(){this.#c(),this.#a?.destroy(),super.destroyCallback()}#c(){this.#s?.(),this.#s=null}willUpdate(e){super.willUpdate(e),this.#e.setProps(this),this.#e.setFormatLocale(this.#i.locale)}update(e){if(super.update(e),!this.#a)return;let t=this.#r.value;if(!t)return;this.#e.setInput(this.#a.input.current),this.#e.setMedia(t);let n=this.#e.getState(),r=g(this.#a.adjustForAlignment(n)),i=this.#e.getAttrs(n);a(this,r),v(this,n,A),_(this,{hidden:n.hidden?``:void 0}),this.#n.setValue({state:n,stateAttrMap:A,pointerValue:this.#e.valueFromPercent(n.pointerPercent),thumbAttrs:{...i,"aria-label":S(i[`aria-label`],this.#i.value),"aria-valuetext":S(i[`aria-valuetext`],this.#i.value,this.#e.getValueTextParams(n))},thumbProps:this.#a.thumbProps,formatValue:e=>`${Math.round(e)}%`})}#l(e){this.#r.value?.setVolume(this.#e.valueFromPercent(e)/100)}};s(j);
//# sourceMappingURL=volume-slider.js.map
\ No newline at end of file
diff --git a/web/vendor/videojs/10.1.0/uk-Br37zRSF.js b/web/vendor/videojs/10.2.0/uk-Br37zRSF.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/uk-Br37zRSF.js
rename to web/vendor/videojs/10.2.0/uk-Br37zRSF.js
diff --git a/web/vendor/videojs/10.1.0/vi-BFXv9B0L.js b/web/vendor/videojs/10.2.0/vi-BFXv9B0L.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/vi-BFXv9B0L.js
rename to web/vendor/videojs/10.2.0/vi-BFXv9B0L.js
diff --git a/web/vendor/videojs/10.1.0/video-player.js b/web/vendor/videojs/10.2.0/video-player.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/video-player.js
rename to web/vendor/videojs/10.2.0/video-player.js
diff --git a/web/vendor/videojs/10.1.0/volume-bLkHAx2V.js b/web/vendor/videojs/10.2.0/volume-bLkHAx2V.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/volume-bLkHAx2V.js
rename to web/vendor/videojs/10.2.0/volume-bLkHAx2V.js
diff --git a/web/vendor/videojs/10.1.0/volume-cOW73aoK.js b/web/vendor/videojs/10.2.0/volume-cOW73aoK.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/volume-cOW73aoK.js
rename to web/vendor/videojs/10.2.0/volume-cOW73aoK.js
diff --git a/web/vendor/videojs/10.1.0/webkit-DljEkldb.js b/web/vendor/videojs/10.2.0/webkit-DljEkldb.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/webkit-DljEkldb.js
rename to web/vendor/videojs/10.2.0/webkit-DljEkldb.js
diff --git a/web/vendor/videojs/10.1.0/zh-CN-DIlfWElT.js b/web/vendor/videojs/10.2.0/zh-CN-DIlfWElT.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/zh-CN-DIlfWElT.js
rename to web/vendor/videojs/10.2.0/zh-CN-DIlfWElT.js
diff --git a/web/vendor/videojs/10.1.0/zh-Ch29egLH.js b/web/vendor/videojs/10.2.0/zh-Ch29egLH.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/zh-Ch29egLH.js
rename to web/vendor/videojs/10.2.0/zh-Ch29egLH.js
diff --git a/web/vendor/videojs/10.1.0/zh-TW-C-MO8iT5.js b/web/vendor/videojs/10.2.0/zh-TW-C-MO8iT5.js
similarity index 100%
rename from web/vendor/videojs/10.1.0/zh-TW-C-MO8iT5.js
rename to web/vendor/videojs/10.2.0/zh-TW-C-MO8iT5.js