From 9e21121f8b13df00a7844efce2c339d665b9176f Mon Sep 17 00:00:00 2001 From: Linrador <68631622+Linrador@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:27:17 +0100 Subject: [PATCH] updated --- .gitignore | 1 + backend/chaturbate_online.go | 240 +++-- backend/live.go | 29 + backend/models_api.go | 39 +- backend/models_store.go | 19 +- backend/postwork.go | 112 ++- backend/preview.go | 44 +- backend/record.go | 170 ++++ backend/routes.go | 1 + backend/sse.go | 190 ++-- backend/web/dist/assets/index-C6R3TW-y.css | 1 - backend/web/dist/assets/index-z2cKWgjr.js | 449 ---------- backend/web/dist/index.html | 14 - backend/web/dist/vite.svg | 1 - frontend/src/App.tsx | 818 +++++++----------- frontend/src/components/ui/Downloads.tsx | 427 +++++++-- .../ui/FinishedDownloadsCardsView.tsx | 388 +++++---- frontend/src/components/ui/LiveVideo.tsx | 32 +- frontend/src/components/ui/ModelPreview.tsx | 27 +- frontend/src/components/ui/ModelsTab.tsx | 50 +- frontend/src/components/ui/Player.tsx | 2 +- 21 files changed, 1569 insertions(+), 1485 deletions(-) delete mode 100644 backend/web/dist/assets/index-C6R3TW-y.css delete mode 100644 backend/web/dist/assets/index-z2cKWgjr.js delete mode 100644 backend/web/dist/index.html delete mode 100644 backend/web/dist/vite.svg diff --git a/.gitignore b/.gitignore index b432e05..4377a13 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ records .DS_Store backend/generated backend/nsfwapp.exe +backend/web/dist diff --git a/backend/chaturbate_online.go b/backend/chaturbate_online.go index c92600d..1dc52f6 100644 --- a/backend/chaturbate_online.go +++ b/backend/chaturbate_online.go @@ -301,9 +301,7 @@ func syncChaturbateRoomStateIntoModelStore(store *ModelStore, rooms []Chaturbate fetchedAt, ) - if sm, ok := store.GetByHostAndModelKey("chaturbate.com", modelKey); ok { - publishRoomStateForModel(sm) - } + publishJobUpsertsForModelKey(modelKey) } // bekannte Chaturbate-Models, die NICHT im Online-Snapshot sind => offline setzen @@ -333,9 +331,32 @@ func syncChaturbateRoomStateIntoModelStore(store *ModelStore, rooms []Chaturbate fetchedAt, ) - if sm, ok := store.GetByHostAndModelKey("chaturbate.com", modelKey); ok { - publishRoomStateForModel(sm) + publishJobUpsertsForModelKey(modelKey) + } +} + +func publishJobUpsertsForModelKey(modelKey string) { + modelKey = strings.ToLower(strings.TrimSpace(modelKey)) + if modelKey == "" { + return + } + + jobsMu.Lock() + list := make([]*RecordJob, 0, len(jobs)) + for _, j := range jobs { + if j == nil || j.Hidden { + continue } + if sseModelEventNameForJob(j) != modelKey { + continue + } + c := *j + list = append(list, &c) + } + jobsMu.Unlock() + + for _, j := range list { + publishJobUpsert(j) } } @@ -466,6 +487,37 @@ func cbApplySnapshot(rooms []ChaturbateRoom) time.Time { return fetchedAtNow } +func refreshChaturbateSnapshotNow(ctx context.Context) (time.Time, error) { + rooms, err := fetchChaturbateOnlineRooms(ctx) + if err != nil { + cbMu.Lock() + cb.LastErr = err.Error() + cb.Rooms = nil + cb.RoomsByUser = nil + cb.LiteByUser = nil + cbMu.Unlock() + return time.Time{}, err + } + + fetchedAtNow := cbApplySnapshot(rooms) + + if cbModelStore != nil { + // ✅ bekannten Store sofort auf aktuellen Snapshot ziehen + syncChaturbateRoomStateIntoModelStore( + cbModelStore, + append([]ChaturbateRoom(nil), rooms...), + fetchedAtNow, + ) + + // optional / best effort + if len(rooms) > 0 { + go cbModelStore.FillMissingTagsFromChaturbateOnline(rooms) + } + } + + return fetchedAtNow, nil +} + // startChaturbateOnlinePoller pollt die API alle paar Sekunden, // aber nur, wenn der Settings-Switch "useChaturbateApi" aktiviert ist. func startChaturbateOnlinePoller(store *ModelStore) { @@ -925,75 +977,48 @@ func chaturbateOnlineHandler(w http.ResponseWriter, r *http.Request) { return } - // --------------------------- - // Snapshot Cache lesen (nur Lite) - // --------------------------- - cbMu.RLock() - fetchedAt := cb.FetchedAt - lastErr := cb.LastErr - lastAttempt := cb.LastAttempt - liteByUser := cb.LiteByUser - cbMu.RUnlock() - - // --------------------------- - // ✅ HLS URL Refresh für laufende Jobs (best effort) - // Trigger nur, wenn explizite Users angefragt werden (dein Frontend macht das so) - // und nur wenn User gerade online ist. - // --------------------------- - if onlySpecificUsers && liteByUser != nil { - const hlsMinInterval = 12 * time.Second // throttle pro user - - for _, u := range users { - rm, ok := liteByUser[u] - if !ok { - continue // offline -> nichts - } - - // Optional: nur wenn wirklich "public" (reduziert unnötige fetches) - // Wenn du auch in "private" previewen willst, entferne diesen Block. - show := strings.ToLower(strings.TrimSpace(rm.CurrentShow)) - if show == "offline" || show == "" { - continue - } - - // throttle - if !shouldRefreshHLS(u, hlsMinInterval) { - continue - } - - // HLS holen (kurzer Timeout – soll /online nicht blockieren) - ctx, cancel := context.WithTimeout(r.Context(), 8*time.Second) - newHls, err := fetchCurrentBestHLS(ctx, rm.Username, cookieHeader, reqUA) - cancel() - if err != nil || strings.TrimSpace(newHls) == "" { - continue - } - - // Jobs aktualisieren + ggf. Preview stoppen - refreshRunningJobsHLS(u, newHls, cookieHeader, reqUA) - } - } - - // --------------------------- - // Persist "last seen online/offline" für explizit angefragte User - // --------------------------- - if cbModelStore != nil && onlySpecificUsers && liteByUser != nil && !fetchedAt.IsZero() { - seenAt := fetchedAt.UTC().Format(time.RFC3339Nano) - for _, u := range users { - _, isOnline := liteByUser[u] - _ = cbModelStore.SetLastSeenOnline("chaturbate.com", u, isOnline, seenAt) - } - } - // --------------------------- // Refresh/Bootstrap-Strategie // --------------------------- const bootstrapCooldown = 8 * time.Second - needBootstrap := fetchedAt.IsZero() - shouldTriggerFetch := wantRefresh || (needBootstrap && time.Since(lastAttempt) >= bootstrapCooldown) + // ersten Snapshot lesen + cbMu.RLock() + fetchedAt := cb.FetchedAt + lastErr := cb.LastErr + lastAttempt := cb.LastAttempt + cbMu.RUnlock() - if shouldTriggerFetch { + needBootstrap := fetchedAt.IsZero() + + // ✅ Bei explizitem refresh synchron aktualisieren, + // damit die Response garantiert den neuesten Stand enthält. + if wantRefresh { + cbRefreshMu.Lock() + if cbRefreshInFlight { + cbRefreshMu.Unlock() + } else { + cbRefreshInFlight = true + cbRefreshMu.Unlock() + + cbMu.Lock() + cb.LastAttempt = time.Now() + cbMu.Unlock() + + ctx, cancel := context.WithTimeout(r.Context(), 30*time.Second) + _, err := refreshChaturbateSnapshotNow(ctx) + cancel() + + cbRefreshMu.Lock() + cbRefreshInFlight = false + cbRefreshMu.Unlock() + + if err != nil { + // Fehler nur im Cache halten; Antwort wird unten aus aktuellem Snapshot gebaut + } + } + } else if needBootstrap && time.Since(lastAttempt) >= bootstrapCooldown { + // ✅ Bootstrap darf weiterhin asynchron bleiben cbRefreshMu.Lock() if cbRefreshInFlight { cbRefreshMu.Unlock() @@ -1013,33 +1038,68 @@ func chaturbateOnlineHandler(w http.ResponseWriter, r *http.Request) { }() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - rooms, err := fetchChaturbateOnlineRooms(ctx) - cancel() + defer cancel() - if err != nil { - cbMu.Lock() - cb.LastErr = err.Error() - cb.Rooms = nil - cb.RoomsByUser = nil - cb.LiteByUser = nil - // fetchedAt NICHT ändern (bleibt letzte erfolgreiche Zeit) - cbMu.Unlock() - return - } - - fetchedAtNow := cbApplySnapshot(rooms) - - if cbModelStore != nil { - _ = cbModelStore.SyncChaturbateOnlineForKnownModels(rooms, fetchedAtNow) - - if len(rooms) > 0 { - cbModelStore.FillMissingTagsFromChaturbateOnline(rooms) - } - } + _, _ = refreshChaturbateSnapshotNow(ctx) }() } } + // ✅ JETZT erst den finalen Snapshot lesen + cbMu.RLock() + fetchedAt = cb.FetchedAt + lastErr = cb.LastErr + lastAttempt = cb.LastAttempt + liteByUser := cb.LiteByUser + cbMu.RUnlock() + + needBootstrap = fetchedAt.IsZero() + + // --------------------------- + // ✅ HLS URL Refresh für laufende Jobs (best effort) + // Trigger nur, wenn explizite Users angefragt werden (dein Frontend macht das so) + // und nur wenn User gerade online ist. + // --------------------------- + const hlsMinInterval = 12 * time.Second + + if onlySpecificUsers && liteByUser != nil { + for _, u := range users { + rm, ok := liteByUser[u] + if !ok { + continue + } + + show := strings.ToLower(strings.TrimSpace(rm.CurrentShow)) + if show == "offline" || show == "" { + continue + } + + if !shouldRefreshHLS(u, hlsMinInterval) { + continue + } + + ctx, cancel := context.WithTimeout(r.Context(), 8*time.Second) + newHls, err := fetchCurrentBestHLS(ctx, rm.Username, cookieHeader, reqUA) + cancel() + if err != nil || strings.TrimSpace(newHls) == "" { + continue + } + + refreshRunningJobsHLS(u, newHls, cookieHeader, reqUA) + } + } + + // --------------------------- + // Persist "last seen online/offline" für explizit angefragte User + // --------------------------- + if cbModelStore != nil && onlySpecificUsers && liteByUser != nil && !fetchedAt.IsZero() { + seenAt := fetchedAt.UTC().Format(time.RFC3339Nano) + for _, u := range users { + _, isOnline := liteByUser[u] + _ = cbModelStore.SetLastSeenOnline("chaturbate.com", u, isOnline, seenAt) + } + } + // --------------------------- // Rooms bauen (LITE, O(Anzahl requested Users)) // --------------------------- diff --git a/backend/live.go b/backend/live.go index ca52bb2..c577c8b 100644 --- a/backend/live.go +++ b/backend/live.go @@ -629,6 +629,35 @@ func recordPreviewLiveFMP4(w http.ResponseWriter, r *http.Request) { return } + username := extractUsername(job.SourceURL) + if strings.TrimSpace(username) != "" { + cookie := strings.TrimSpace(job.PreviewCookie) + ua := strings.TrimSpace(job.PreviewUA) + if ua == "" { + ua = "Mozilla/5.0" + } + + ctxRefresh, cancelRefresh := context.WithTimeout(r.Context(), 8*time.Second) + newHls, err := fetchCurrentBestHLS(ctxRefresh, username, cookie, ua) + cancelRefresh() + + if err == nil && strings.TrimSpace(newHls) != "" { + jobsMu.Lock() + oldHls := strings.TrimSpace(job.PreviewM3U8) + job.PreviewM3U8 = strings.TrimSpace(newHls) + job.PreviewCookie = cookie + job.PreviewUA = ua + job.PreviewState = "" + job.PreviewStateAt = "" + job.PreviewStateMsg = "" + jobsMu.Unlock() + + if oldHls != "" && oldHls != strings.TrimSpace(newHls) { + stopPreview(job) + } + } + } + // ensure ffmpeg preview input data exists // (PreviewM3U8 + Cookie/UA werden beim Job gesetzt) m3u8 := strings.TrimSpace(job.PreviewM3U8) diff --git a/backend/models_api.go b/backend/models_api.go index da8e6fe..20a2d43 100644 --- a/backend/models_api.go +++ b/backend/models_api.go @@ -519,28 +519,12 @@ func RegisterModelAPI(mux *http.ServeMux, store *ModelStore) { modelsWriteJSON(w, http.StatusMethodNotAllowed, map[string]string{"error": "method not allowed"}) return } + var req ModelFlagsPatch if err := modelsReadJSON(r, &req); err != nil { modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": err.Error()}) return } - // ✅ id optional: wenn fehlt -> per (host, modelKey) sicherstellen + id setzen - if strings.TrimSpace(req.ID) == "" { - key := strings.TrimSpace(req.ModelKey) - host := strings.TrimSpace(req.Host) - - if key == "" { - modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": "id oder modelKey fehlt"}) - return - } - - ensured, err := store.EnsureByHostModelKey(host, key) // host darf leer sein - if err != nil { - modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": err.Error()}) - return - } - req.ID = ensured.ID - } store := getModelStore() if store == nil { @@ -548,16 +532,35 @@ func RegisterModelAPI(mux *http.ServeMux, store *ModelStore) { return } + req.ID = strings.TrimSpace(req.ID) + req.ModelKey = strings.TrimSpace(req.ModelKey) + req.Host = strings.TrimPrefix(strings.ToLower(strings.TrimSpace(req.Host)), "www.") + + // Nur wenn wirklich keine ID mitkommt -> Ensure + if req.ID == "" { + if req.ModelKey == "" { + modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": "id oder modelKey fehlt"}) + return + } + + ensured, err := store.EnsureByHostModelKey(req.Host, req.ModelKey) + if err != nil { + modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": err.Error()}) + return + } + req.ID = ensured.ID + } + m, err := store.PatchFlags(req) if err != nil { modelsWriteJSON(w, http.StatusBadRequest, map[string]string{"error": err.Error()}) return } - // ✅ Cleanup wenn kein relevanter Flag mehr gesetzt ist likedOn := (m.Liked != nil && *m.Liked) if !m.Watching && !m.Favorite && !likedOn { _ = store.Delete(m.ID) + w.WriteHeader(http.StatusNoContent) return } diff --git a/backend/models_store.go b/backend/models_store.go index e5875b2..18eee44 100644 --- a/backend/models_store.go +++ b/backend/models_store.go @@ -222,9 +222,6 @@ func (s *ModelStore) SetChaturbateRoomState( seenAt = seenAt.UTC() now := time.Now().UTC() - s.mu.Lock() - defer s.mu.Unlock() - _, err := s.db.Exec(` UPDATE models SET @@ -444,9 +441,6 @@ func (s *ModelStore) FillMissingTagsFromChaturbateOnline(rooms []ChaturbateRoom) now := time.Now().UTC() - s.mu.Lock() - defer s.mu.Unlock() - tx, err := s.db.Begin() if err != nil { return @@ -719,9 +713,6 @@ func (s *ModelStore) SetLastSeenOnline(host, modelKey string, online bool, seenA onlineArg = false } - s.mu.Lock() - defer s.mu.Unlock() - res, err := s.db.Exec(` UPDATE models SET last_seen_online=$1, last_seen_online_at=$2, updated_at=$3 @@ -1194,9 +1185,6 @@ func (s *ModelStore) SyncChaturbateOnlineForKnownModels(rooms []ChaturbateRoom, roomsByUser := indexRoomsByUser(rooms) - s.mu.Lock() - defer s.mu.Unlock() - tx, err := s.db.Begin() if err != nil { return err @@ -1569,13 +1557,11 @@ func (s *ModelStore) PatchFlags(patch ModelFlagsPatch) (StoredModel, error) { return StoredModel{}, errors.New("id fehlt") } - s.mu.Lock() - defer s.mu.Unlock() - var ( watching, favorite, hot, keep bool liked sql.NullBool ) + err := s.db.QueryRow(`SELECT watching,favorite,hot,keep,liked FROM models WHERE id=$1;`, patch.ID). Scan(&watching, &favorite, &hot, &keep, &liked) if err != nil { @@ -1634,9 +1620,6 @@ func (s *ModelStore) Delete(id string) error { return errors.New("id fehlt") } - s.mu.Lock() - defer s.mu.Unlock() - _, err := s.db.Exec(`DELETE FROM models WHERE id=$1;`, id) return err } diff --git a/backend/postwork.go b/backend/postwork.go index 40ad434..dae0910 100644 --- a/backend/postwork.go +++ b/backend/postwork.go @@ -3,7 +3,6 @@ package main import ( "context" - "reflect" "strings" "sync" "time" @@ -90,10 +89,63 @@ func (pq *PostWorkQueue) removeWaitingKeyLocked(key string) { } } +func (pq *PostWorkQueue) RemoveQueued(key string) bool { + if strings.TrimSpace(key) == "" { + return false + } + + pq.mu.Lock() + defer pq.mu.Unlock() + + // running darf hier NICHT entfernt werden + if _, running := pq.runningKeys[key]; running { + return false + } + + found := false + for i, k := range pq.waitingKeys { + if k == key { + pq.waitingKeys = append(pq.waitingKeys[:i], pq.waitingKeys[i+1:]...) + found = true + break + } + } + if !found { + return false + } + + delete(pq.inflight, key) + if pq.queued > 0 { + pq.queued-- + } + + // Das Task-Element bleibt evtl. noch im Channel liegen. + // Beim Worker-Start muss es dann erkannt und übersprungen werden. + return true +} + func (pq *PostWorkQueue) workerLoop(id int) { for task := range pq.q { + pq.mu.Lock() + _, stillInflight := pq.inflight[task.Key] + _, alreadyRunning := pq.runningKeys[task.Key] + + waitingFound := false + for _, k := range pq.waitingKeys { + if k == task.Key { + waitingFound = true + break + } + } + pq.mu.Unlock() + + // queued Job wurde zwischenzeitlich entfernt -> Task aus dem Channel verwerfen + if !stillInflight || (!waitingFound && !alreadyRunning) { + continue + } + // 1) Heavy-Gate: erst wenn ein Slot frei ist, gilt der Task als "running" - pq.ffmpegSem <- struct{}{} // kann blocken + pq.ffmpegSem <- struct{}{} // 2) Ab hier startet er wirklich → waiting -> running pq.mu.Lock() @@ -201,7 +253,7 @@ func (pq *PostWorkQueue) StatusForKey(key string) PostWorkKeyStatus { } // global (oder in deinem app struct halten) -var postWorkQ = NewPostWorkQueue(512, 4) // maxParallelFFmpeg = 4 +var postWorkQ = NewPostWorkQueue(512, 2) // maxParallelFFmpeg = 4 // --- Status Refresher (ehemals postwork_refresh.go) --- @@ -222,9 +274,61 @@ func startPostWorkStatusRefresher() { st := postWorkQ.StatusForKey(key) - if job.PostWork == nil || !reflect.DeepEqual(*job.PostWork, st) { + changed := false + + // PostWork-Daten aktualisieren + if job.PostWork == nil || + job.PostWork.State != st.State || + job.PostWork.Position != st.Position || + job.PostWork.Waiting != st.Waiting || + job.PostWork.Running != st.Running || + job.PostWork.MaxParallel != st.MaxParallel { tmp := st job.PostWork = &tmp + changed = true + } + + // Status / Phase für UI vereinheitlichen + switch st.State { + case "queued": + if job.Status != JobPostwork { + job.Status = JobPostwork + changed = true + } + + phaseLower := strings.TrimSpace(strings.ToLower(job.Phase)) + if phaseLower == "" || phaseLower == "recording" { + job.Phase = "postwork" + changed = true + } + + if job.Progress < 0 || job.Progress > 100 { + job.Progress = 0 + changed = true + } + + case "running": + if job.Status != JobPostwork { + job.Status = JobPostwork + changed = true + } + + phaseLower := strings.TrimSpace(strings.ToLower(job.Phase)) + + // Konkrete Unterphasen NICHT überschreiben + switch phaseLower { + case "probe", "remuxing", "moving", "assets": + // ok, so lassen + default: + if phaseLower == "" || phaseLower == "recording" || phaseLower == "postwork" { + if phaseLower != "postwork" { + job.Phase = "postwork" + changed = true + } + } + } + } + if changed { changedJobs = append(changedJobs, job) } } diff --git a/backend/preview.go b/backend/preview.go index 44032f8..19adfe8 100644 --- a/backend/preview.go +++ b/backend/preview.go @@ -1188,29 +1188,61 @@ func servePreviewStatusSVG(w http.ResponseWriter, label string, status int) { // --- WebP extraction helpers --- func extractLastFrameWebP(path string) ([]byte, error) { - cmd := exec.Command( + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + + cmd := exec.CommandContext( + ctx, ffmpegPath, - "-hide_banner", "-loglevel", "error", - "-sseof", "-0.1", + "-hide_banner", + "-loglevel", "error", + + // relativ zum Dateiende suchen + "-sseof", "-0.25", + "-i", path, + + // nur den ersten Video-Stream verwenden + "-map", "0:v:0", + + // alles andere hart abschalten + "-an", + "-sn", + "-dn", + + // genau 1 Frame "-frames:v", "1", - "-vf", "scale=720:-2", - "-quality", "75", - "-f", "image2pipe", + + // schneller skalieren + "-vf", "scale=720:-2:flags=fast_bilinear", + + // WebP: Qualität + schnellerer Encode "-vcodec", "libwebp", + "-quality", "75", + "-compression_level", "2", + "-preset", "photo", + + "-f", "image2pipe", "pipe:1", ) + var out bytes.Buffer var stderr bytes.Buffer cmd.Stdout = &out cmd.Stderr = &stderr + if err := cmd.Run(); err != nil { + if ctx.Err() == context.DeadlineExceeded { + return nil, fmt.Errorf("ffmpeg last-frame webp: timeout") + } return nil, fmt.Errorf("ffmpeg last-frame webp: %w (%s)", err, strings.TrimSpace(stderr.String())) } + b := out.Bytes() if len(b) == 0 { return nil, fmt.Errorf("ffmpeg last-frame webp: empty output") } + return b, nil } diff --git a/backend/record.go b/backend/record.go index cf58e79..bdd22d4 100644 --- a/backend/record.go +++ b/backend/record.go @@ -567,6 +567,176 @@ func ensureMetaJSONForPlayback(ctx context.Context, videoPath string) { _, _ = ensureVideoMetaForFileBestEffort(ctx, videoPath, "") } +func isTerminalJobStatus(status any) bool { + s := strings.TrimSpace(strings.ToLower(fmt.Sprint(status))) + switch s { + case "stopped", "finished", "failed", "done", "completed", "canceled", "cancelled": + return true + default: + return false + } +} + +func isPostworkJob(job *RecordJob) bool { + if job == nil { + return false + } + + phase := strings.TrimSpace(strings.ToLower(job.Phase)) + pwKey := strings.TrimSpace(job.PostWorkKey) + + // 1) expliziter Queue-Key vorhanden + if pwKey != "" { + return true + } + + // 2) postWork-Status vom Refresher/Queue vorhanden + if job.PostWork != nil { + state := strings.TrimSpace(strings.ToLower(job.PostWork.State)) + if state == "queued" || state == "running" { + return true + } + } + + // 3) Aufnahme ist beendet und es gibt noch eine Nachbearbeitungs-Phase + if job.EndedAt != nil && phase != "" { + return true + } + + // 4) explizite postwork-Phase + if phase == "postwork" { + return true + } + + return false +} + +func getEffectivePostworkState(job *RecordJob) string { + if job == nil { + return "none" + } + + phase := strings.TrimSpace(strings.ToLower(job.Phase)) + pwState := "" + hasPwKey := strings.TrimSpace(job.PostWorkKey) != "" + if job.PostWork != nil { + pwState = strings.TrimSpace(strings.ToLower(job.PostWork.State)) + } + + if !isPostworkJob(job) { + return "none" + } + if isTerminalJobStatus(job.Status) { + return "none" + } + + // 1) Harte Wahrheit aus postWork + if pwState == "queued" { + return "queued" + } + if pwState == "running" { + return "running" + } + + if job.PostWork != nil { + if job.PostWork.Position > 0 { + return "queued" + } + if job.PostWork.Running > 0 && job.PostWork.Position <= 0 { + return "running" + } + } + + // 2) Sobald ein PostWorkKey existiert und nichts explizit "running" sagt: + // lieber queued statt alte phase dominieren lassen + if hasPwKey { + return "queued" + } + + // 3) Nur noch Heuristik für Alt-Fälle ohne PostWorkKey + switch phase { + case "postwork": + if job.Progress > 0 { + return "running" + } + return "queued" + case "remuxing", "moving", "assets", "probe": + return "running" + } + + if job.EndedAt != nil { + return "queued" + } + + return "none" +} + +func recordRemoveQueuedPostwork(w http.ResponseWriter, r *http.Request) { + if !mustMethod(w, r, http.MethodPost) { + return + } + + id := strings.TrimSpace(r.URL.Query().Get("id")) + if id == "" { + http.Error(w, "id fehlt", http.StatusBadRequest) + return + } + + jobsMu.Lock() + job, ok := jobs[id] + jobsMu.Unlock() + if !ok || job == nil { + http.Error(w, "job nicht gefunden", http.StatusNotFound) + return + } + + if !isPostworkJob(job) { + http.Error(w, "job ist kein postwork-job", http.StatusConflict) + return + } + + state := getEffectivePostworkState(job) + if state != "queued" { + http.Error(w, "nur queued postwork-jobs können entfernt werden", http.StatusConflict) + return + } + + postKey := strings.TrimSpace(job.PostWorkKey) + if postKey == "" { + http.Error(w, "postwork key fehlt", http.StatusConflict) + return + } + + if ok := postWorkQ.RemoveQueued(postKey); !ok { + http.Error(w, "postwork job konnte nicht aus der warteschlange entfernt werden", http.StatusConflict) + return + } + + out := strings.TrimSpace(job.Output) + if out != "" { + _ = removeWithRetry(out) + purgeDurationCacheForPath(out) + + base := filepath.Base(out) + id1 := stripHotPrefix(strings.TrimSuffix(base, filepath.Ext(base))) + if strings.TrimSpace(id1) != "" { + removeGeneratedForID(id1) + } + } + + jobsMu.Lock() + delete(jobs, job.ID) + jobsMu.Unlock() + + publishJobRemove(job) + notifyDoneChanged() + + respondJSON(w, map[string]any{ + "ok": true, + "id": id, + }) +} + func recordVideo(w http.ResponseWriter, r *http.Request) { tw := &rwTrack{ResponseWriter: w} w = tw diff --git a/backend/routes.go b/backend/routes.go index 8495051..1839ad7 100644 --- a/backend/routes.go +++ b/backend/routes.go @@ -46,6 +46,7 @@ func registerRoutes(mux *http.ServeMux, auth *AuthManager) *ModelStore { api.HandleFunc("/api/record", startRecordingFromRequest) api.HandleFunc("/api/record/status", recordStatus) api.HandleFunc("/api/record/stop", recordStop) + api.HandleFunc("/api/record/postwork/remove", recordRemoveQueuedPostwork) api.HandleFunc("/api/preview", recordPreview) api.HandleFunc("/api/preview/live", recordPreviewLive) api.HandleFunc("/api/preview-scrubber/", recordPreviewScrubberFrame) diff --git a/backend/sse.go b/backend/sse.go index c5ff41c..b826dcf 100644 --- a/backend/sse.go +++ b/backend/sse.go @@ -41,7 +41,11 @@ type jobEvent struct { IsOnline bool `json:"isOnline,omitempty"` ModelImageURL string `json:"modelImageUrl,omitempty"` ModelChatRoomURL string `json:"modelChatRoomUrl,omitempty"` - TS int64 `json:"ts"` + + PostWorkKey string `json:"postWorkKey,omitempty"` + PostWork any `json:"postWork,omitempty"` + + TS int64 `json:"ts"` } type ssePublishItem struct { @@ -49,6 +53,78 @@ type ssePublishItem struct { Data []byte } +func isTerminalJobStatusForSSE(status JobStatus) bool { + s := strings.ToLower(strings.TrimSpace(string(status))) + return s == "stopped" || + s == "finished" || + s == "failed" || + s == "done" || + s == "completed" || + s == "canceled" || + s == "cancelled" +} + +func isPostworkJobForSSE(j *RecordJob) bool { + if j == nil { + return false + } + + phase := strings.ToLower(strings.TrimSpace(j.Phase)) + pwKey := strings.TrimSpace(j.PostWorkKey) + + if pwKey != "" { + return true + } + + if j.PostWork != nil { + // falls PostWork als struct/map vorliegt, reicht für SSE der generelle Hinweis: + return true + } + + if j.EndedAt != nil && phase != "" { + return true + } + + if phase == "postwork" { + return true + } + + return false +} + +func isVisibleDownloadJobForSSE(j *RecordJob) bool { + if j == nil { + return false + } + if isPostworkJobForSSE(j) { + return false + } + if isTerminalJobStatusForSSE(j.Status) { + return false + } + if j.EndedAt != nil { + return false + } + return true +} + +func isVisiblePostworkJobForSSE(j *RecordJob) bool { + if j == nil { + return false + } + if !isPostworkJobForSSE(j) { + return false + } + if isTerminalJobStatusForSSE(j.Status) { + return false + } + return true +} + +func shouldPublishModelEventForJob(j *RecordJob) bool { + return isVisibleDownloadJobForSSE(j) || isVisiblePostworkJobForSSE(j) +} + func visibleJobEventsJSON() []ssePublishItem { nowTs := time.Now().UnixMilli() out := make([]ssePublishItem, 0, 64) @@ -60,6 +136,9 @@ func visibleJobEventsJSON() []ssePublishItem { if j == nil || j.Hidden { continue } + if !shouldPublishModelEventForJob(j) { + continue + } eventName := sseModelEventNameForJob(j) if eventName == "" { @@ -80,6 +159,8 @@ func visibleJobEventsJSON() []ssePublishItem { SizeBytes: j.SizeBytes, DurationSeconds: j.DurationSeconds, PreviewState: j.PreviewState, + PostWorkKey: strings.TrimSpace(j.PostWorkKey), + PostWork: j.PostWork, TS: nowTs, } @@ -109,53 +190,13 @@ func visibleJobEventsJSON() []ssePublishItem { return out } -func visibleRoomStateEventsJSON() []ssePublishItem { - nowTs := time.Now().UnixMilli() - out := make([]ssePublishItem, 0, 128) - - if cbModelStore == nil { - return out - } - - models := cbModelStore.List() - for _, sm := range models { - if strings.ToLower(strings.TrimSpace(sm.Host)) != "chaturbate.com" { - continue - } - - modelKey := strings.ToLower(strings.TrimSpace(sm.ModelKey)) - if modelKey == "" { - continue - } - - payload := jobEvent{ - Type: "room_state", - Model: modelKey, - RoomStatus: strings.ToLower(strings.TrimSpace(sm.RoomStatus)), - IsOnline: sm.IsOnline, - ModelImageURL: strings.TrimSpace(sm.ImageURL), - ModelChatRoomURL: strings.TrimSpace(sm.ChatRoomURL), - TS: nowTs, - } - - b, err := json.Marshal(payload) - if err != nil { - continue - } - - out = append(out, ssePublishItem{ - EventName: modelKey, - Data: b, - }) - } - - return out -} - func publishJobUpsert(j *RecordJob) { if j == nil || j.Hidden { return } + if !shouldPublishModelEventForJob(j) { + return + } eventName := sseModelEventNameForJob(j) if eventName == "" { @@ -177,6 +218,8 @@ func publishJobUpsert(j *RecordJob) { SizeBytes: j.SizeBytes, DurationSeconds: j.DurationSeconds, PreviewState: j.PreviewState, + PostWorkKey: strings.TrimSpace(j.PostWorkKey), + PostWork: j.PostWork, TS: time.Now().UnixMilli(), } @@ -215,34 +258,6 @@ func publishJobRemove(j *RecordJob) { publishSSE(eventName, b) } -func publishRoomStateForModel(sm *StoredModel) { - if sm == nil { - return - } - - if strings.ToLower(strings.TrimSpace(sm.Host)) != "chaturbate.com" { - return - } - - modelKey := strings.ToLower(strings.TrimSpace(sm.ModelKey)) - if modelKey == "" { - return - } - - payload := jobEvent{ - Type: "room_state", - Model: modelKey, - RoomStatus: strings.ToLower(strings.TrimSpace(sm.RoomStatus)), - IsOnline: sm.IsOnline, - ModelImageURL: strings.TrimSpace(sm.ImageURL), - ModelChatRoomURL: strings.TrimSpace(sm.ChatRoomURL), - TS: time.Now().UnixMilli(), - } - - b, _ := json.Marshal(payload) - publishSSE(modelKey, b) -} - func sseModelEventNameForJob(j *RecordJob) string { if j == nil { return "" @@ -364,37 +379,6 @@ func initSSE() { } } }() - - // Room state snapshot: 1 SSE event per second for known chaturbate models - go func() { - t := time.NewTicker(1 * time.Second) - defer t.Stop() - - lastByModel := map[string]string{} - - for range t.C { - events := visibleRoomStateEventsJSON() - nextByModel := make(map[string]string, len(events)) - - for _, ev := range events { - if len(ev.Data) == 0 || ev.EventName == "" { - continue - } - - key := ev.EventName - payloadKey := string(ev.Data) - nextByModel[key] = payloadKey - - if prev, ok := lastByModel[key]; ok && prev == payloadKey { - continue - } - - publishSSE(ev.EventName, ev.Data) - } - - lastByModel = nextByModel - } - }() } func publishSSE(eventName string, data []byte) { diff --git a/backend/web/dist/assets/index-C6R3TW-y.css b/backend/web/dist/assets/index-C6R3TW-y.css deleted file mode 100644 index 0a277d4..0000000 --- a/backend/web/dist/assets/index-C6R3TW-y.css +++ /dev/null @@ -1 +0,0 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-900:oklch(37.8% .077 168.94);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-100:oklch(95.1% .026 236.824);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-sky-700:oklch(50% .134 242.749);--color-sky-800:oklch(44.3% .11 240.79);--color-sky-900:oklch(39.1% .09 240.876);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-fuchsia-900:oklch(40.1% .17 325.612);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-900:oklch(41% .159 10.272);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-gray-950:oklch(13% .028 261.692);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.-inset-10{inset:calc(var(--spacing)*-10)}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-x-2{inset-inline:calc(var(--spacing)*2)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.-top-28{top:calc(var(--spacing)*-28)}.-top-\[9999px\]{top:-9999px}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-12{top:calc(var(--spacing)*12)}.top-\[56px\]{top:56px}.top-auto{top:auto}.-right-1{right:calc(var(--spacing)*-1)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-\[-6rem\]{right:-6rem}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-bottom-28{bottom:calc(var(--spacing)*-28)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-3{bottom:calc(var(--spacing)*3)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-\[6px\]{bottom:6px}.bottom-\[19px\]{bottom:19px}.bottom-auto{bottom:auto}.-left-1{left:calc(var(--spacing)*-1)}.-left-\[9999px\]{left:-9999px}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.isolate{isolation:isolate}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[5\]{z-index:5}.z-\[6\]{z-index:6}.z-\[15\]{z-index:15}.z-\[60\]{z-index:60}.z-\[80\]{z-index:80}.z-\[9999\]{z-index:9999}.z-\[2147483647\]{z-index:2147483647}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-start-1{grid-column-start:1}.row-start-1{grid-row-start:1}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.-my-1{margin-block:calc(var(--spacing)*-1)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-10{margin-top:calc(var(--spacing)*10)}.-mr-0\.5{margin-right:calc(var(--spacing)*-.5)}.mr-2{margin-right:calc(var(--spacing)*2)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.-ml-0\.5{margin-left:calc(var(--spacing)*-.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-1\.5{margin-left:calc(var(--spacing)*1.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-auto{margin-left:auto}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-\[3\/4\]{aspect-ratio:3/4}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-video{aspect-ratio:var(--aspect-video)}.size-1\.5{width:calc(var(--spacing)*1.5);height:calc(var(--spacing)*1.5)}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.size-5\.5{width:calc(var(--spacing)*5.5);height:calc(var(--spacing)*5.5)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-28{height:calc(var(--spacing)*28)}.h-40{height:calc(var(--spacing)*40)}.h-44{height:calc(var(--spacing)*44)}.h-80{height:calc(var(--spacing)*80)}.h-\[60px\]{height:60px}.h-\[64px\]{height:64px}.h-\[220px\]{height:220px}.h-full{height:100%}.max-h-0{max-height:calc(var(--spacing)*0)}.max-h-28{max-height:calc(var(--spacing)*28)}.max-h-\[40vh\]{max-height:40vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[720px\]{max-height:720px}.max-h-\[calc\(100vh-3rem\)\]{max-height:calc(100vh - 3rem)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[24px\]{min-height:24px}.min-h-\[72px\]{min-height:72px}.min-h-\[100dvh\]{min-height:100dvh}.min-h-\[112px\]{min-height:112px}.min-h-\[118px\]{min-height:118px}.min-h-full{min-height:100%}.w-1{width:calc(var(--spacing)*1)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-11{width:calc(var(--spacing)*11)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-40{width:calc(var(--spacing)*40)}.w-44{width:calc(var(--spacing)*44)}.w-52{width:calc(var(--spacing)*52)}.w-\[2px\]{width:2px}.w-\[22rem\]{width:22rem}.w-\[46rem\]{width:46rem}.w-\[52rem\]{width:52rem}.w-\[64px\]{width:64px}.w-\[90px\]{width:90px}.w-\[92px\]{width:92px}.w-\[96px\]{width:96px}.w-\[110px\]{width:110px}.w-\[112px\]{width:112px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[170px\]{width:170px}.w-\[260px\]{width:260px}.w-\[320px\]{width:320px}.w-\[360px\]{width:360px}.w-\[420px\]{width:420px}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[11rem\]{max-width:11rem}.max-w-\[170px\]{max-width:170px}.max-w-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.max-w-\[260px\]{max-width:260px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.max-w-\[560px\]{max-width:560px}.max-w-\[calc\(100\%-24px\)\]{max-width:calc(100% - 24px)}.max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[2\.25rem\]{min-width:2.25rem}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.min-w-\[300px\]{min-width:300px}.min-w-\[980px\]{min-width:980px}.min-w-full{min-width:100%}.min-w-max{min-width:max-content}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-left{transform-origin:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing)*5);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-2{--tw-translate-y:calc(var(--spacing)*-2);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing)*-3);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-2{--tw-translate-y:calc(var(--spacing)*2);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-\[0\.98\]{scale:.98}.scale-\[0\.995\]{scale:.995}.scale-\[1\.03\]{scale:1.03}.-rotate-12{rotate:-12deg}.rotate-0{rotate:none}.rotate-12{rotate:12deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-nesw-resize{cursor:nesw-resize}.cursor-not-allowed{cursor:not-allowed}.cursor-ns-resize{cursor:ns-resize}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.cursor-zoom-in{cursor:zoom-in}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[auto\,minmax\(0\,1fr\)\]{grid-template-columns:auto,minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-1\.5{column-gap:calc(var(--spacing)*1.5)}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-3{column-gap:calc(var(--spacing)*3)}.gap-x-8{column-gap:calc(var(--spacing)*8)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px*var(--tw-space-x-reverse));margin-inline-end:calc(-1px*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-8>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*8)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-2{row-gap:calc(var(--spacing)*2)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.self-center{align-self:center}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-visible{overflow-y:visible}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-l-xl{border-top-left-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-lg{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-b-md{border-bottom-right-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/60{border-color:color-mix(in oklab,var(--color-amber-200)60%,transparent)}}.border-amber-200\/80{border-color:#fee685cc}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/80{border-color:color-mix(in oklab,var(--color-amber-200)80%,transparent)}}.border-black\/5{border-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.border-black\/5{border-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.border-emerald-200\/80{border-color:#a4f4cfcc}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/80{border-color:color-mix(in oklab,var(--color-emerald-200)80%,transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-200\/60{border-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.border-gray-200\/60{border-color:color-mix(in oklab,var(--color-gray-200)60%,transparent)}}.border-gray-200\/70{border-color:#e5e7ebb3}@supports (color:color-mix(in lab,red,red)){.border-gray-200\/70{border-color:color-mix(in oklab,var(--color-gray-200)70%,transparent)}}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-500{border-color:var(--color-indigo-500)}.border-red-200{border-color:var(--color-red-200)}.border-rose-200\/60{border-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/60{border-color:color-mix(in oklab,var(--color-rose-200)60%,transparent)}}.border-rose-200\/80{border-color:#ffccd3cc}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/80{border-color:color-mix(in oklab,var(--color-rose-200)80%,transparent)}}.border-sky-200\/80{border-color:#b8e6fecc}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/80{border-color:color-mix(in oklab,var(--color-sky-200)80%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\/40{border-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.border-white\/70{border-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.border-white\/70{border-color:color-mix(in oklab,var(--color-white)70%,transparent)}}.border-t-transparent{border-top-color:#0000}.\!bg-amber-500{background-color:var(--color-amber-500)!important}.\!bg-blue-600{background-color:var(--color-blue-600)!important}.\!bg-emerald-600{background-color:var(--color-emerald-600)!important}.\!bg-indigo-600{background-color:var(--color-indigo-600)!important}.\!bg-red-600{background-color:var(--color-red-600)!important}.bg-\[\#12202c\]{background-color:#12202c}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-50\/70{background-color:#fffbebb3}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/70{background-color:color-mix(in oklab,var(--color-amber-50)70%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500)15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-amber-500\/25{background-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/25{background-color:color-mix(in oklab,var(--color-amber-500)25%,transparent)}}.bg-amber-500\/30{background-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/30{background-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.bg-amber-500\/70{background-color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/70{background-color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.bg-amber-500\/90{background-color:#f99c00e6}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/90{background-color:color-mix(in oklab,var(--color-amber-500)90%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/35{background-color:#00000059}@supports (color:color-mix(in lab,red,red)){.bg-black\/35{background-color:color-mix(in oklab,var(--color-black)35%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab,red,red)){.bg-black\/45{background-color:color-mix(in oklab,var(--color-black)45%,transparent)}}.bg-black\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\/55{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black)70%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\/60{background-color:#ecfdf599}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/60{background-color:color-mix(in oklab,var(--color-emerald-50)60%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500)15%,transparent)}}.bg-emerald-500\/25{background-color:#00bb7f40}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/25{background-color:color-mix(in oklab,var(--color-emerald-500)25%,transparent)}}.bg-emerald-500\/70{background-color:#00bb7fb3}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/70{background-color:color-mix(in oklab,var(--color-emerald-500)70%,transparent)}}.bg-fuchsia-500\/15{background-color:#e12afb26}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-500\/15{background-color:color-mix(in oklab,var(--color-fuchsia-500)15%,transparent)}}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/70{background-color:#f9fafbb3}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/70{background-color:color-mix(in oklab,var(--color-gray-50)70%,transparent)}}.bg-gray-50\/90{background-color:#f9fafbe6}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/90{background-color:color-mix(in oklab,var(--color-gray-50)90%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-100\/70{background-color:#f3f4f6b3}@supports (color:color-mix(in lab,red,red)){.bg-gray-100\/70{background-color:color-mix(in oklab,var(--color-gray-100)70%,transparent)}}.bg-gray-100\/80{background-color:#f3f4f6cc}@supports (color:color-mix(in lab,red,red)){.bg-gray-100\/80{background-color:color-mix(in oklab,var(--color-gray-100)80%,transparent)}}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-200\/70{background-color:#e5e7ebb3}@supports (color:color-mix(in lab,red,red)){.bg-gray-200\/70{background-color:color-mix(in oklab,var(--color-gray-200)70%,transparent)}}.bg-gray-500\/10{background-color:#6a72821a}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/10{background-color:color-mix(in oklab,var(--color-gray-500)10%,transparent)}}.bg-gray-500\/75{background-color:#6a7282bf}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/75{background-color:color-mix(in oklab,var(--color-gray-500)75%,transparent)}}.bg-gray-900\/5{background-color:#1018280d}@supports (color:color-mix(in lab,red,red)){.bg-gray-900\/5{background-color:color-mix(in oklab,var(--color-gray-900)5%,transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.bg-indigo-500\/90{background-color:#625fffe6}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/90{background-color:color-mix(in oklab,var(--color-indigo-500)90%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-indigo-600\/70{background-color:#4f39f6b3}@supports (color:color-mix(in lab,red,red)){.bg-indigo-600\/70{background-color:color-mix(in oklab,var(--color-indigo-600)70%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-50\/60{background-color:#fef2f299}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/60{background-color:color-mix(in oklab,var(--color-red-50)60%,transparent)}}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600\/90{background-color:#e40014e6}@supports (color:color-mix(in lab,red,red)){.bg-red-600\/90{background-color:color-mix(in oklab,var(--color-red-600)90%,transparent)}}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-50\/70{background-color:#fff1f2b3}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/70{background-color:color-mix(in oklab,var(--color-rose-50)70%,transparent)}}.bg-rose-500{background-color:var(--color-rose-500)}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/10{background-color:color-mix(in oklab,var(--color-rose-500)10%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-rose-500\/25{background-color:#ff235740}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/25{background-color:color-mix(in oklab,var(--color-rose-500)25%,transparent)}}.bg-rose-500\/70{background-color:#ff2357b3}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/70{background-color:color-mix(in oklab,var(--color-rose-500)70%,transparent)}}.bg-sky-50{background-color:var(--color-sky-50)}.bg-sky-100{background-color:var(--color-sky-100)}.bg-sky-500{background-color:var(--color-sky-500)}.bg-sky-500\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-sky-500)10%,transparent)}}.bg-sky-500\/25{background-color:#00a5ef40}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/25{background-color:color-mix(in oklab,var(--color-sky-500)25%,transparent)}}.bg-sky-500\/70{background-color:#00a5efb3}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/70{background-color:color-mix(in oklab,var(--color-sky-500)70%,transparent)}}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500)15%,transparent)}}.bg-slate-800\/70{background-color:#1d293db3}@supports (color:color-mix(in lab,red,red)){.bg-slate-800\/70{background-color:color-mix(in oklab,var(--color-slate-800)70%,transparent)}}.bg-slate-900\/80{background-color:#0f172bcc}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/80{background-color:color-mix(in oklab,var(--color-slate-900)80%,transparent)}}.bg-slate-950{background-color:var(--color-slate-950)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/8{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.bg-white\/8{background-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/12{background-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.bg-white\/12{background-color:color-mix(in oklab,var(--color-white)12%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.bg-white\/35{background-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.bg-white\/50{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.bg-white\/50{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.bg-white\/70{background-color:color-mix(in oklab,var(--color-white)70%,transparent)}}.bg-white\/75{background-color:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.bg-white\/75{background-color:color-mix(in oklab,var(--color-white)75%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.bg-white\/95{background-color:color-mix(in oklab,var(--color-white)95%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\/20{--tw-gradient-from:#0003}@supports (color:color-mix(in lab,red,red)){.from-black\/20{--tw-gradient-from:color-mix(in oklab,var(--color-black)20%,transparent)}}.from-black\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/35{--tw-gradient-from:#00000059}@supports (color:color-mix(in lab,red,red)){.from-black\/35{--tw-gradient-from:color-mix(in oklab,var(--color-black)35%,transparent)}}.from-black\/35{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/40{--tw-gradient-from:#0006}@supports (color:color-mix(in lab,red,red)){.from-black\/40{--tw-gradient-from:color-mix(in oklab,var(--color-black)40%,transparent)}}.from-black\/40{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/55{--tw-gradient-from:#0000008c}@supports (color:color-mix(in lab,red,red)){.from-black\/55{--tw-gradient-from:color-mix(in oklab,var(--color-black)55%,transparent)}}.from-black\/55{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/65{--tw-gradient-from:#000000a6}@supports (color:color-mix(in lab,red,red)){.from-black\/65{--tw-gradient-from:color-mix(in oklab,var(--color-black)65%,transparent)}}.from-black\/65{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-indigo-500\/10{--tw-gradient-from:#625fff1a}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/10{--tw-gradient-from:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.from-indigo-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/8{--tw-gradient-from:#ffffff14}@supports (color:color-mix(in lab,red,red)){.from-white\/8{--tw-gradient-from:color-mix(in oklab,var(--color-white)8%,transparent)}}.from-white\/8{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/70{--tw-gradient-from:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.from-white\/70{--tw-gradient-from:color-mix(in oklab,var(--color-white)70%,transparent)}}.from-white\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-black\/0{--tw-gradient-via:#0000}@supports (color:color-mix(in lab,red,red)){.via-black\/0{--tw-gradient-via:color-mix(in oklab,var(--color-black)0%,transparent)}}.via-black\/0{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-black\/20{--tw-gradient-via:#0003}@supports (color:color-mix(in lab,red,red)){.via-black\/20{--tw-gradient-via:color-mix(in oklab,var(--color-black)20%,transparent)}}.via-black\/20{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/20{--tw-gradient-via:#fff3}@supports (color:color-mix(in lab,red,red)){.via-white\/20{--tw-gradient-via:color-mix(in oklab,var(--color-white)20%,transparent)}}.via-white\/20{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-black\/0{--tw-gradient-to:#0000}@supports (color:color-mix(in lab,red,red)){.to-black\/0{--tw-gradient-to:color-mix(in oklab,var(--color-black)0%,transparent)}}.to-black\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-sky-500\/10{--tw-gradient-to:#00a5ef1a}@supports (color:color-mix(in lab,red,red)){.to-sky-500\/10{--tw-gradient-to:color-mix(in oklab,var(--color-sky-500)10%,transparent)}}.to-sky-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white\/60{--tw-gradient-to:#fff9}@supports (color:color-mix(in lab,red,red)){.to-white\/60{--tw-gradient-to:color-mix(in oklab,var(--color-white)60%,transparent)}}.to-white\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-gray-500{fill:var(--color-gray-500)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-bottom{object-position:bottom}.object-center{object-position:center}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-0\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-\[7px\]{padding-block:7px}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-0\.5{padding-top:calc(var(--spacing)*.5)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-12{padding-right:calc(var(--spacing)*12)}.pr-18{padding-right:calc(var(--spacing)*18)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\/6{font-size:var(--text-sm);line-height:calc(var(--spacing)*6)}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-white{color:var(--color-white)!important}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-900{color:var(--color-emerald-900)}.text-fuchsia-900{color:var(--color-fuchsia-900)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\/90{color:#1e2939e6}@supports (color:color-mix(in lab,red,red)){.text-gray-800\/90{color:color-mix(in oklab,var(--color-gray-800)90%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-200{color:var(--color-indigo-200)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-indigo-900{color:var(--color-indigo-900)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-900{color:var(--color-rose-900)}.text-rose-900\/80{color:#8b0836cc}@supports (color:color-mix(in lab,red,red)){.text-rose-900\/80{color:color-mix(in oklab,var(--color-rose-900)80%,transparent)}}.text-sky-200{color:var(--color-sky-200)}.text-sky-600{color:var(--color-sky-600)}.text-sky-700{color:var(--color-sky-700)}.text-sky-800{color:var(--color-sky-800)}.text-sky-900{color:var(--color-sky-900)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-500{color:var(--color-slate-500)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white)50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.text-white\/75{color:color-mix(in oklab,var(--color-white)75%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white)85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white)90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white)95%,transparent)}}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.35\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-amber-200{--tw-ring-color:var(--color-amber-200)}.ring-amber-200\/30{--tw-ring-color:#fee6854d}@supports (color:color-mix(in lab,red,red)){.ring-amber-200\/30{--tw-ring-color:color-mix(in oklab,var(--color-amber-200)30%,transparent)}}.ring-amber-500\/30{--tw-ring-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.ring-amber-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.ring-black\/5{--tw-ring-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.ring-black\/5{--tw-ring-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.ring-black\/10{--tw-ring-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.ring-black\/10{--tw-ring-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.ring-emerald-200{--tw-ring-color:var(--color-emerald-200)}.ring-emerald-200\/30{--tw-ring-color:#a4f4cf4d}@supports (color:color-mix(in lab,red,red)){.ring-emerald-200\/30{--tw-ring-color:color-mix(in oklab,var(--color-emerald-200)30%,transparent)}}.ring-emerald-300{--tw-ring-color:var(--color-emerald-300)}.ring-emerald-500\/30{--tw-ring-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.ring-emerald-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.ring-fuchsia-500\/30{--tw-ring-color:#e12afb4d}@supports (color:color-mix(in lab,red,red)){.ring-fuchsia-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-fuchsia-500)30%,transparent)}}.ring-gray-200{--tw-ring-color:var(--color-gray-200)}.ring-gray-200\/60{--tw-ring-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.ring-gray-200\/60{--tw-ring-color:color-mix(in oklab,var(--color-gray-200)60%,transparent)}}.ring-gray-300{--tw-ring-color:var(--color-gray-300)}.ring-gray-900\/5{--tw-ring-color:#1018280d}@supports (color:color-mix(in lab,red,red)){.ring-gray-900\/5{--tw-ring-color:color-mix(in oklab,var(--color-gray-900)5%,transparent)}}.ring-gray-900\/10{--tw-ring-color:#1018281a}@supports (color:color-mix(in lab,red,red)){.ring-gray-900\/10{--tw-ring-color:color-mix(in oklab,var(--color-gray-900)10%,transparent)}}.ring-green-200{--tw-ring-color:var(--color-green-200)}.ring-indigo-100{--tw-ring-color:var(--color-indigo-100)}.ring-indigo-200{--tw-ring-color:var(--color-indigo-200)}.ring-red-200{--tw-ring-color:var(--color-red-200)}.ring-red-300{--tw-ring-color:var(--color-red-300)}.ring-rose-200\/30{--tw-ring-color:#ffccd34d}@supports (color:color-mix(in lab,red,red)){.ring-rose-200\/30{--tw-ring-color:color-mix(in oklab,var(--color-rose-200)30%,transparent)}}.ring-sky-200{--tw-ring-color:var(--color-sky-200)}.ring-sky-200\/30{--tw-ring-color:#b8e6fe4d}@supports (color:color-mix(in lab,red,red)){.ring-sky-200\/30{--tw-ring-color:color-mix(in oklab,var(--color-sky-200)30%,transparent)}}.ring-slate-500\/30{--tw-ring-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.ring-slate-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-slate-500)30%,transparent)}}.ring-white{--tw-ring-color:var(--color-white)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.ring-white\/15{--tw-ring-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.ring-white\/15{--tw-ring-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.ring-white\/40{--tw-ring-color:#fff6}@supports (color:color-mix(in lab,red,red)){.ring-white\/40{--tw-ring-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.inset-ring-gray-300{--tw-inset-ring-color:var(--color-gray-300)}.inset-ring-gray-900\/5{--tw-inset-ring-color:#1018280d}@supports (color:color-mix(in lab,red,red)){.inset-ring-gray-900\/5{--tw-inset-ring-color:color-mix(in oklab,var(--color-gray-900)5%,transparent)}}.outline-1{outline-style:var(--tw-outline-style);outline-width:1px}.-outline-offset-1{outline-offset:-1px}.outline-offset-2{outline-offset:2px}.outline-black\/5{outline-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.outline-black\/5{outline-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.outline-gray-300{outline-color:var(--color-gray-300)}.outline-indigo-600{outline-color:var(--color-indigo-600)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-\[1\.5px\]{--tw-blur:blur(1.5px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-md{--tw-blur:blur(var(--blur-md));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-90{--tw-brightness:brightness(90%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#000000e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.saturate-90{--tw-saturate:saturate(90%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.saturate-100{--tw-saturate:saturate(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-\[2px\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[box-shadow\,transform\,background-color\]{transition-property:box-shadow,transform,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[filter\,transform\,opacity\]{transition-property:filter,transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,top\,width\,height\]{transition-property:left,top,width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[max-height\,opacity\]{transition-property:max-height,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,opacity\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-160{--tw-duration:.16s;transition-duration:.16s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-250{--tw-duration:.25s;transition-duration:.25s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-\[cubic-bezier\(\.2\,\.9\,\.2\,1\)\]{--tw-ease:cubic-bezier(.2,.9,.2,1);transition-timing-function:cubic-bezier(.2,.9,.2,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\[filter\,transform\]{will-change:filter,transform}.will-change-\[transform\,opacity\]{will-change:transform,opacity}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[text-shadow\:_0_1px_0_rgba\(0\,0\,0\,0\.95\)\,_1px_0_0_rgba\(0\,0\,0\,0\.95\)\,_-1px_0_0_rgba\(0\,0\,0\,0\.95\)\,_0_-1px_0_rgba\(0\,0\,0\,0\.95\)\,_1px_1px_0_rgba\(0\,0\,0\,0\.8\)\,_-1px_1px_0_rgba\(0\,0\,0\,0\.8\)\,_1px_-1px_0_rgba\(0\,0\,0\,0\.8\)\,_-1px_-1px_0_rgba\(0\,0\,0\,0\.8\)\]{text-shadow:0 1px #000000f2,1px 0 #000000f2,-1px 0 #000000f2,0 -1px #000000f2,1px 1px #000c,-1px 1px #000c,1px -1px #000c,-1px -1px #000c}.\[text-shadow\:_0_1px_2px_rgba\(0\,0\,0\,0\.9\)\]{text-shadow:0 1px 2px #000000e6}.ring-inset{--tw-ring-inset:inset}.group-focus-within\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}.group-focus-within\/thumb\:opacity-0:is(:where(.group\/thumb):focus-within *){opacity:0}@media(hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:h-1:is(:where(.group):hover *){height:calc(var(--spacing)*1)}.group-hover\:translate-x-\[1px\]:is(:where(.group):hover *){--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:scale-\[1\.02\]:is(:where(.group):hover *){scale:1.02}.group-hover\:overflow-visible:is(:where(.group):hover *){overflow:visible}.group-hover\:rounded-full:is(:where(.group):hover *){border-radius:3.40282e38px}.group-hover\:text-gray-500:is(:where(.group):hover *){color:var(--color-gray-500)}.group-hover\:text-indigo-500:is(:where(.group):hover *){color:var(--color-indigo-500)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\/thumb\:opacity-0:is(:where(.group\/thumb):hover *){opacity:0}}.group-focus-visible\:visible:is(:where(.group):focus-visible *){visibility:visible}.file\:mr-4::file-selector-button{margin-right:calc(var(--spacing)*4)}.file\:rounded-md::file-selector-button{border-radius:var(--radius-md)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-gray-100::file-selector-button{background-color:var(--color-gray-100)}.file\:px-3::file-selector-button{padding-inline:calc(var(--spacing)*3)}.file\:py-2::file-selector-button{padding-block:calc(var(--spacing)*2)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-semibold::file-selector-button{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.file\:text-gray-900::file-selector-button{color:var(--color-gray-900)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:top-0:before{content:var(--tw-content);top:calc(var(--spacing)*0)}.before\:bottom-0:before{content:var(--tw-content);bottom:calc(var(--spacing)*0)}.before\:left-0:before{content:var(--tw-content);left:calc(var(--spacing)*0)}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-gray-300:before{content:var(--tw-content);background-color:var(--color-gray-300)}.even\:bg-gray-50:nth-child(2n){background-color:var(--color-gray-50)}@media(hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:-translate-y-\[1px\]:hover{--tw-translate-y: -1px ;translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:scale-\[1\.03\]:hover{scale:1.03}.hover\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\:border-indigo-200:hover{border-color:var(--color-indigo-200)}.hover\:border-transparent:hover{border-color:#0000}.hover\:\!bg-amber-600:hover{background-color:var(--color-amber-600)!important}.hover\:\!bg-blue-700:hover{background-color:var(--color-blue-700)!important}.hover\:\!bg-emerald-700:hover{background-color:var(--color-emerald-700)!important}.hover\:\!bg-indigo-700:hover{background-color:var(--color-indigo-700)!important}.hover\:\!bg-red-700:hover{background-color:var(--color-red-700)!important}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-amber-500\/30:hover{background-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/30:hover{background-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.hover\:bg-black\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\:bg-emerald-100:hover{background-color:var(--color-emerald-100)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-50\/80:hover{background-color:#f9fafbcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-50\/80:hover{background-color:color-mix(in oklab,var(--color-gray-50)80%,transparent)}}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-100\/70:hover{background-color:#f3f4f6b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-100\/70:hover{background-color:color-mix(in oklab,var(--color-gray-100)70%,transparent)}}.hover\:bg-gray-200\/70:hover{background-color:#e5e7ebb3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-200\/70:hover{background-color:color-mix(in oklab,var(--color-gray-200)70%,transparent)}}.hover\:bg-gray-200\/80:hover{background-color:#e5e7ebcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-200\/80:hover{background-color:color-mix(in oklab,var(--color-gray-200)80%,transparent)}}.hover\:bg-indigo-100:hover{background-color:var(--color-indigo-100)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-500\/30:hover{background-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-500\/30:hover{background-color:color-mix(in oklab,var(--color-indigo-500)30%,transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-rose-500\/30:hover{background-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-rose-500\/30:hover{background-color:color-mix(in oklab,var(--color-rose-500)30%,transparent)}}.hover\:bg-sky-100:hover{background-color:var(--color-sky-100)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab,var(--color-white)90%,transparent)}}.hover\:text-gray-500:hover{color:var(--color-gray-500)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-inherit:hover{color:inherit}.hover\:text-red-900:hover{color:var(--color-red-900)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:ring-black\/10:hover{--tw-ring-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.hover\:ring-black\/10:hover{--tw-ring-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.hover\:file\:bg-gray-200:hover::file-selector-button{background-color:var(--color-gray-200)}}.focus\:z-10:focus{z-index:10}.focus\:z-20:focus{z-index:20}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\:-outline-offset-2:focus{outline-offset:-2px}.focus\:outline-offset-0:focus{outline-offset:0px}.focus\:outline-indigo-600:focus{outline-color:var(--color-indigo-600)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-blue-500\/60:focus-visible{--tw-ring-color:#3080ff99}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-blue-500\/60:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)60%,transparent)}}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-color:var(--color-indigo-500)}.focus-visible\:ring-indigo-500\/60:focus-visible{--tw-ring-color:#625fff99}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/60:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)60%,transparent)}}.focus-visible\:ring-indigo-500\/70:focus-visible{--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/70:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)70%,transparent)}}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-white:focus-visible{--tw-ring-offset-color:var(--color-white)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-amber-500:focus-visible{outline-color:var(--color-amber-500)}.focus-visible\:outline-blue-600:focus-visible{outline-color:var(--color-blue-600)}.focus-visible\:outline-emerald-600:focus-visible{outline-color:var(--color-emerald-600)}.focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.focus-visible\:outline-indigo-600:focus-visible{outline-color:var(--color-indigo-600)}.focus-visible\:outline-red-600:focus-visible{outline-color:var(--color-red-600)}.focus-visible\:outline-white\/70:focus-visible{outline-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.focus-visible\:outline-white\/70:focus-visible{outline-color:color-mix(in oklab,var(--color-white)70%,transparent)}}.active\:translate-y-0:active{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:scale-\[0\.998\]:active{scale:.998}.active\:cursor-grabbing:active{cursor:grabbing}.active\:bg-gray-200\/80:active{background-color:#e5e7ebcc}@supports (color:color-mix(in lab,red,red)){.active\:bg-gray-200\/80:active{background-color:color-mix(in oklab,var(--color-gray-200)80%,transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-focus-visible\:outline-2:has(:focus-visible){outline-style:var(--tw-outline-style);outline-width:2px}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-\[backdrop-filter\]\:bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.supports-\[backdrop-filter\]\:bg-white\/25{background-color:color-mix(in oklab,var(--color-white)25%,transparent)}}.supports-\[backdrop-filter\]\:bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.supports-\[backdrop-filter\]\:bg-white\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@media(min-width:40rem){.sm\:sticky{position:sticky}.sm\:top-0{top:calc(var(--spacing)*0)}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-8{grid-column:span 8/span 8}.sm\:col-span-9{grid-column:span 9/span 9}.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:ml-16{margin-left:calc(var(--spacing)*16)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:inline-flex{display:inline-flex}.sm\:aspect-\[21\/9\]{aspect-ratio:21/9}.sm\:size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.sm\:h-9{height:calc(var(--spacing)*9)}.sm\:h-10{height:calc(var(--spacing)*10)}.sm\:h-14{height:calc(var(--spacing)*14)}.sm\:h-52{height:calc(var(--spacing)*52)}.sm\:max-h-\[calc\(100vh-4rem\)\]{max-height:calc(100vh - 4rem)}.sm\:w-10{width:calc(var(--spacing)*10)}.sm\:w-14{width:calc(var(--spacing)*14)}.sm\:w-16{width:calc(var(--spacing)*16)}.sm\:w-\[72px\]{width:72px}.sm\:w-\[260px\]{width:260px}.sm\:w-auto{width:auto}.sm\:min-w-\[220px\]{min-width:220px}.sm\:flex-1{flex:1}.sm\:flex-auto{flex:auto}.sm\:flex-none{flex:none}.sm\:-translate-y-2{--tw-translate-y:calc(var(--spacing)*-2);translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:-translate-y-3{--tw-translate-y:calc(var(--spacing)*-3);translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.sm\:scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.sm\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:items-start{align-items:flex-start}.sm\:items-stretch{align-items:stretch}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:justify-start{justify-content:flex-start}.sm\:gap-3{gap:calc(var(--spacing)*3)}.sm\:gap-4{gap:calc(var(--spacing)*4)}:where(.sm\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.sm\:border-gray-200\/70{border-color:#e5e7ebb3}@supports (color:color-mix(in lab,red,red)){.sm\:border-gray-200\/70{border-color:color-mix(in oklab,var(--color-gray-200)70%,transparent)}}.sm\:p-3{padding:calc(var(--spacing)*3)}.sm\:p-4{padding:calc(var(--spacing)*4)}.sm\:p-6{padding:calc(var(--spacing)*6)}.sm\:px-3{padding-inline:calc(var(--spacing)*3)}.sm\:px-3\.5{padding-inline:calc(var(--spacing)*3.5)}.sm\:px-4{padding-inline:calc(var(--spacing)*4)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:py-3\.5{padding-block:calc(var(--spacing)*3.5)}.sm\:py-4{padding-block:calc(var(--spacing)*4)}.sm\:py-6{padding-block:calc(var(--spacing)*6)}.sm\:pt-2{padding-top:calc(var(--spacing)*2)}.sm\:pt-4{padding-top:calc(var(--spacing)*4)}.sm\:pt-6{padding-top:calc(var(--spacing)*6)}.sm\:pr-2\.5{padding-right:calc(var(--spacing)*2.5)}.sm\:pr-3{padding-right:calc(var(--spacing)*3)}.sm\:pr-14{padding-right:calc(var(--spacing)*14)}.sm\:pb-6{padding-bottom:calc(var(--spacing)*6)}.sm\:pl-3\.5{padding-left:calc(var(--spacing)*3.5)}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}}@media(min-width:48rem){.md\:inset-x-auto{inset-inline:auto}.md\:right-auto{right:auto}.md\:bottom-4{bottom:calc(var(--spacing)*4)}.md\:left-1\/2{left:50%}.md\:inline-block{display:inline-block}.md\:w-\[min\(760px\,calc\(100vw-32px\)\)\]{width:min(760px,100vw - 32px)}.md\:-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-80{width:calc(var(--spacing)*80)}.lg\:w-\[320px\]{width:320px}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(prefers-color-scheme:dark){:where(.dark\:divide-white\/10>:not(:last-child)){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){:where(.dark\:divide-white\/10>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:border-amber-400\/20{border-color:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-400\/20{border-color:color-mix(in oklab,var(--color-amber-400)20%,transparent)}}.dark\:border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.dark\:border-emerald-400\/20{border-color:#00d29433}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/20{border-color:color-mix(in oklab,var(--color-emerald-400)20%,transparent)}}.dark\:border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.dark\:border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.dark\:border-indigo-400{border-color:var(--color-indigo-400)}.dark\:border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.dark\:border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500)30%,transparent)}}.dark\:border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.dark\:border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.dark\:border-rose-400\/20{border-color:#ff667f33}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-400\/20{border-color:color-mix(in oklab,var(--color-rose-400)20%,transparent)}}.dark\:border-sky-400\/20{border-color:#00bcfe33}@supports (color:color-mix(in lab,red,red)){.dark\:border-sky-400\/20{border-color:color-mix(in oklab,var(--color-sky-400)20%,transparent)}}.dark\:border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.dark\:border-white\/60{border-color:#fff9}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/60{border-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.dark\:border-t-transparent{border-top-color:#0000}.dark\:\!bg-amber-500{background-color:var(--color-amber-500)!important}.dark\:\!bg-blue-500{background-color:var(--color-blue-500)!important}.dark\:\!bg-emerald-500{background-color:var(--color-emerald-500)!important}.dark\:\!bg-indigo-500{background-color:var(--color-indigo-500)!important}.dark\:\!bg-red-500{background-color:var(--color-red-500)!important}.dark\:bg-amber-400{background-color:var(--color-amber-400)}.dark\:bg-amber-400\/10{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-400\/10{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.dark\:bg-amber-400\/70{background-color:#fcbb00b3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-400\/70{background-color:color-mix(in oklab,var(--color-amber-400)70%,transparent)}}.dark\:bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.dark\:bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.dark\:bg-black\/8{background-color:#00000014}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/8{background-color:color-mix(in oklab,var(--color-black)8%,transparent)}}.dark\:bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.dark\:bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.dark\:bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/45{background-color:color-mix(in oklab,var(--color-black)45%,transparent)}}.dark\:bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.dark\:bg-emerald-400{background-color:var(--color-emerald-400)}.dark\:bg-emerald-400\/10{background-color:#00d2941a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-400\/10{background-color:color-mix(in oklab,var(--color-emerald-400)10%,transparent)}}.dark\:bg-emerald-400\/70{background-color:#00d294b3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-400\/70{background-color:color-mix(in oklab,var(--color-emerald-400)70%,transparent)}}.dark\:bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.dark\:bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.dark\:bg-fuchsia-400\/10{background-color:#ec6cff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-fuchsia-400\/10{background-color:color-mix(in oklab,var(--color-fuchsia-400)10%,transparent)}}.dark\:bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark\:bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-800\/50{background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.dark\:bg-gray-800\/70{background-color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-800\/70{background-color:color-mix(in oklab,var(--color-gray-800)70%,transparent)}}.dark\:bg-gray-800\/95{background-color:#1e2939f2}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-800\/95{background-color:color-mix(in oklab,var(--color-gray-800)95%,transparent)}}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:bg-gray-900\/40{background-color:#10182866}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/40{background-color:color-mix(in oklab,var(--color-gray-900)40%,transparent)}}.dark\:bg-gray-900\/50{background-color:#10182880}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/50{background-color:color-mix(in oklab,var(--color-gray-900)50%,transparent)}}.dark\:bg-gray-900\/60{background-color:#10182899}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/60{background-color:color-mix(in oklab,var(--color-gray-900)60%,transparent)}}.dark\:bg-gray-900\/70{background-color:#101828b3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/70{background-color:color-mix(in oklab,var(--color-gray-900)70%,transparent)}}.dark\:bg-gray-900\/95{background-color:#101828f2}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/95{background-color:color-mix(in oklab,var(--color-gray-900)95%,transparent)}}.dark\:bg-gray-950{background-color:var(--color-gray-950)}.dark\:bg-gray-950\/35{background-color:#03071259}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-950\/35{background-color:color-mix(in oklab,var(--color-gray-950)35%,transparent)}}.dark\:bg-gray-950\/40{background-color:#03071266}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-950\/40{background-color:color-mix(in oklab,var(--color-gray-950)40%,transparent)}}.dark\:bg-gray-950\/60{background-color:#03071299}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-950\/60{background-color:color-mix(in oklab,var(--color-gray-950)60%,transparent)}}.dark\:bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.dark\:bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.dark\:bg-indigo-400{background-color:var(--color-indigo-400)}.dark\:bg-indigo-400\/10{background-color:#7d87ff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-400\/10{background-color:color-mix(in oklab,var(--color-indigo-400)10%,transparent)}}.dark\:bg-indigo-500{background-color:var(--color-indigo-500)}.dark\:bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.dark\:bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.dark\:bg-indigo-500\/40{background-color:#625fff66}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-500\/40{background-color:color-mix(in oklab,var(--color-indigo-500)40%,transparent)}}.dark\:bg-indigo-500\/70{background-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-500\/70{background-color:color-mix(in oklab,var(--color-indigo-500)70%,transparent)}}.dark\:bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.dark\:bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.dark\:bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.dark\:bg-rose-400{background-color:var(--color-rose-400)}.dark\:bg-rose-400\/10{background-color:#ff667f1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-400\/10{background-color:color-mix(in oklab,var(--color-rose-400)10%,transparent)}}.dark\:bg-rose-400\/70{background-color:#ff667fb3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-400\/70{background-color:color-mix(in oklab,var(--color-rose-400)70%,transparent)}}.dark\:bg-sky-400{background-color:var(--color-sky-400)}.dark\:bg-sky-400\/10{background-color:#00bcfe1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-400\/10{background-color:color-mix(in oklab,var(--color-sky-400)10%,transparent)}}.dark\:bg-sky-400\/20{background-color:#00bcfe33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-400\/20{background-color:color-mix(in oklab,var(--color-sky-400)20%,transparent)}}.dark\:bg-sky-400\/70{background-color:#00bcfeb3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-400\/70{background-color:color-mix(in oklab,var(--color-sky-400)70%,transparent)}}.dark\:bg-sky-500\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-sky-500)10%,transparent)}}.dark\:bg-slate-400\/10{background-color:#90a1b91a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-slate-400\/10{background-color:color-mix(in oklab,var(--color-slate-400)10%,transparent)}}.dark\:bg-slate-900{background-color:var(--color-slate-900)}.dark\:bg-transparent{background-color:#0000}.dark\:bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.dark\:bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.dark\:bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/35{background-color:color-mix(in oklab,var(--color-white)35%,transparent)}}.dark\:bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.dark\:from-white\/10{--tw-gradient-from:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:from-white\/10{--tw-gradient-from:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:from-white\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:to-white\/5{--tw-gradient-to:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:to-white\/5{--tw-gradient-to:color-mix(in oklab,var(--color-white)5%,transparent)}}.dark\:to-white\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark\:fill-gray-400{fill:var(--color-gray-400)}.dark\:text-amber-200{color:var(--color-amber-200)}.dark\:text-amber-300{color:var(--color-amber-300)}.dark\:text-amber-400{color:var(--color-amber-400)}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-emerald-200{color:var(--color-emerald-200)}.dark\:text-emerald-300{color:var(--color-emerald-300)}.dark\:text-emerald-400{color:var(--color-emerald-400)}.dark\:text-fuchsia-200{color:var(--color-fuchsia-200)}.dark\:text-gray-100{color:var(--color-gray-100)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-300{color:var(--color-gray-300)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-gray-500{color:var(--color-gray-500)}.dark\:text-gray-600{color:var(--color-gray-600)}.dark\:text-green-200{color:var(--color-green-200)}.dark\:text-green-300{color:var(--color-green-300)}.dark\:text-indigo-100{color:var(--color-indigo-100)}.dark\:text-indigo-200{color:var(--color-indigo-200)}.dark\:text-indigo-300{color:var(--color-indigo-300)}.dark\:text-indigo-400{color:var(--color-indigo-400)}.dark\:text-indigo-500{color:var(--color-indigo-500)}.dark\:text-red-200{color:var(--color-red-200)}.dark\:text-red-300{color:var(--color-red-300)}.dark\:text-red-400{color:var(--color-red-400)}.dark\:text-rose-200{color:var(--color-rose-200)}.dark\:text-rose-200\/80{color:#ffccd3cc}@supports (color:color-mix(in lab,red,red)){.dark\:text-rose-200\/80{color:color-mix(in oklab,var(--color-rose-200)80%,transparent)}}.dark\:text-rose-300{color:var(--color-rose-300)}.dark\:text-rose-400{color:var(--color-rose-400)}.dark\:text-sky-100{color:var(--color-sky-100)}.dark\:text-sky-200{color:var(--color-sky-200)}.dark\:text-sky-300{color:var(--color-sky-300)}.dark\:text-sky-400{color:var(--color-sky-400)}.dark\:text-slate-200{color:var(--color-slate-200)}.dark\:text-white{color:var(--color-white)}.dark\:text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.dark\:text-white\/30{color:color-mix(in oklab,var(--color-white)30%,transparent)}}.dark\:text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.dark\:text-white\/90{color:color-mix(in oklab,var(--color-white)90%,transparent)}}.dark\:\[color-scheme\:dark\]{color-scheme:dark}.dark\:shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:ring-amber-400\/20{--tw-ring-color:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.dark\:ring-amber-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-amber-400)20%,transparent)}}.dark\:ring-amber-400\/25{--tw-ring-color:#fcbb0040}@supports (color:color-mix(in lab,red,red)){.dark\:ring-amber-400\/25{--tw-ring-color:color-mix(in oklab,var(--color-amber-400)25%,transparent)}}.dark\:ring-emerald-400\/20{--tw-ring-color:#00d29433}@supports (color:color-mix(in lab,red,red)){.dark\:ring-emerald-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-emerald-400)20%,transparent)}}.dark\:ring-emerald-400\/25{--tw-ring-color:#00d29440}@supports (color:color-mix(in lab,red,red)){.dark\:ring-emerald-400\/25{--tw-ring-color:color-mix(in oklab,var(--color-emerald-400)25%,transparent)}}.dark\:ring-emerald-500\/30{--tw-ring-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.dark\:ring-emerald-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.dark\:ring-fuchsia-400\/25{--tw-ring-color:#ec6cff40}@supports (color:color-mix(in lab,red,red)){.dark\:ring-fuchsia-400\/25{--tw-ring-color:color-mix(in oklab,var(--color-fuchsia-400)25%,transparent)}}.dark\:ring-gray-700{--tw-ring-color:var(--color-gray-700)}.dark\:ring-gray-950{--tw-ring-color:var(--color-gray-950)}.dark\:ring-green-400\/30{--tw-ring-color:#05df724d}@supports (color:color-mix(in lab,red,red)){.dark\:ring-green-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-green-400)30%,transparent)}}.dark\:ring-indigo-400\/20{--tw-ring-color:#7d87ff33}@supports (color:color-mix(in lab,red,red)){.dark\:ring-indigo-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-indigo-400)20%,transparent)}}.dark\:ring-indigo-500\/20{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.dark\:ring-indigo-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.dark\:ring-red-400\/25{--tw-ring-color:#ff656840}@supports (color:color-mix(in lab,red,red)){.dark\:ring-red-400\/25{--tw-ring-color:color-mix(in oklab,var(--color-red-400)25%,transparent)}}.dark\:ring-red-400\/30{--tw-ring-color:#ff65684d}@supports (color:color-mix(in lab,red,red)){.dark\:ring-red-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-red-400)30%,transparent)}}.dark\:ring-red-500\/30{--tw-ring-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.dark\:ring-red-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.dark\:ring-sky-400\/20{--tw-ring-color:#00bcfe33}@supports (color:color-mix(in lab,red,red)){.dark\:ring-sky-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-sky-400)20%,transparent)}}.dark\:ring-slate-400\/25{--tw-ring-color:#90a1b940}@supports (color:color-mix(in lab,red,red)){.dark\:ring-slate-400\/25{--tw-ring-color:color-mix(in oklab,var(--color-slate-400)25%,transparent)}}.dark\:ring-white\/5{--tw-ring-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:ring-white\/5{--tw-ring-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.dark\:ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:ring-white\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:ring-white\/15{--tw-ring-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.dark\:ring-white\/15{--tw-ring-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.dark\:inset-ring-gray-700{--tw-inset-ring-color:var(--color-gray-700)}.dark\:inset-ring-white\/5{--tw-inset-ring-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:inset-ring-white\/5{--tw-inset-ring-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.dark\:inset-ring-white\/10{--tw-inset-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:inset-ring-white\/10{--tw-inset-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:outline{outline-style:var(--tw-outline-style);outline-width:1px}.dark\:-outline-offset-1{outline-offset:-1px}.dark\:outline-indigo-500{outline-color:var(--color-indigo-500)}.dark\:outline-white\/10{outline-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:outline-white\/10{outline-color:color-mix(in oklab,var(--color-white)10%,transparent)}}:is(.dark\:\*\:bg-gray-800>*){background-color:var(--color-gray-800)}@media(hover:hover){.dark\:group-hover\:text-gray-400:is(:where(.group):hover *){color:var(--color-gray-400)}.dark\:group-hover\:text-indigo-400:is(:where(.group):hover *){color:var(--color-indigo-400)}}.dark\:file\:bg-white\/10::file-selector-button{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:file\:bg-white\/10::file-selector-button{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:file\:text-white::file-selector-button{color:var(--color-white)}.dark\:before\:bg-gray-700:before{content:var(--tw-content);background-color:var(--color-gray-700)}.dark\:even\:bg-gray-800\/50:nth-child(2n){background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:even\:bg-gray-800\/50:nth-child(2n){background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}@media(hover:hover){.dark\:hover\:border-indigo-400\/30:hover{border-color:#7d87ff4d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:border-indigo-400\/30:hover{border-color:color-mix(in oklab,var(--color-indigo-400)30%,transparent)}}.dark\:hover\:border-white\/20:hover{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:border-white\/20:hover{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.dark\:hover\:\!bg-amber-400:hover{background-color:var(--color-amber-400)!important}.dark\:hover\:\!bg-blue-400:hover{background-color:var(--color-blue-400)!important}.dark\:hover\:\!bg-emerald-400:hover{background-color:var(--color-emerald-400)!important}.dark\:hover\:\!bg-indigo-400:hover{background-color:var(--color-indigo-400)!important}.dark\:hover\:\!bg-red-400:hover{background-color:var(--color-red-400)!important}.dark\:hover\:bg-amber-500\/30:hover{background-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-amber-500\/30:hover{background-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.dark\:hover\:bg-black\/55:hover{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/55:hover{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.dark\:hover\:bg-black\/60:hover{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/60:hover{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.dark\:hover\:bg-blue-500\/30:hover{background-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-blue-500\/30:hover{background-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.dark\:hover\:bg-emerald-500\/30:hover{background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-emerald-500\/30:hover{background-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.dark\:hover\:bg-indigo-500\/20:hover{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-indigo-500\/20:hover{background-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.dark\:hover\:bg-indigo-500\/30:hover{background-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-indigo-500\/30:hover{background-color:color-mix(in oklab,var(--color-indigo-500)30%,transparent)}}.dark\:hover\:bg-indigo-500\/50:hover{background-color:#625fff80}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-indigo-500\/50:hover{background-color:color-mix(in oklab,var(--color-indigo-500)50%,transparent)}}.dark\:hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.dark\:hover\:bg-red-500\/30:hover{background-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-red-500\/30:hover{background-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.dark\:hover\:bg-sky-400\/20:hover{background-color:#00bcfe33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-sky-400\/20:hover{background-color:color-mix(in oklab,var(--color-sky-400)20%,transparent)}}.dark\:hover\:bg-slate-800\/90:hover{background-color:#1d293de6}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-slate-800\/90:hover{background-color:color-mix(in oklab,var(--color-slate-800)90%,transparent)}}.dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.dark\:hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.dark\:hover\:bg-white\/\[0\.09\]:hover{background-color:#ffffff17}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/\[0\.09\]:hover{background-color:color-mix(in oklab,var(--color-white)9%,transparent)}}.dark\:hover\:text-gray-200:hover{color:var(--color-gray-200)}.dark\:hover\:text-gray-300:hover{color:var(--color-gray-300)}.dark\:hover\:text-gray-400:hover{color:var(--color-gray-400)}.dark\:hover\:text-red-200:hover{color:var(--color-red-200)}.dark\:hover\:text-white:hover{color:var(--color-white)}.dark\:hover\:shadow-none:hover{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:hover\:ring-white\/10:hover{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:ring-white\/10:hover{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.dark\:hover\:file\:bg-white\/20:hover::file-selector-button{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:file\:bg-white\/20:hover::file-selector-button{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}}.dark\:focus\:outline-indigo-500:focus{outline-color:var(--color-indigo-500)}.dark\:focus-visible\:ring-indigo-400:focus-visible{--tw-ring-color:var(--color-indigo-400)}.dark\:focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:#fff6}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.dark\:focus-visible\:ring-offset-gray-950:focus-visible{--tw-ring-offset-color:var(--color-gray-950)}.dark\:focus-visible\:ring-offset-slate-900:focus-visible{--tw-ring-offset-color:var(--color-slate-900)}.dark\:focus-visible\:outline-amber-500:focus-visible{outline-color:var(--color-amber-500)}.dark\:focus-visible\:outline-blue-500:focus-visible{outline-color:var(--color-blue-500)}.dark\:focus-visible\:outline-emerald-500:focus-visible{outline-color:var(--color-emerald-500)}.dark\:focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.dark\:focus-visible\:outline-red-500:focus-visible{outline-color:var(--color-red-500)}.dark\:active\:bg-white\/15:active{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.dark\:active\:bg-white\/15:active{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.dark\:supports-\[backdrop-filter\]\:bg-gray-950\/25{background-color:#03071240}@supports (color:color-mix(in lab,red,red)){.dark\:supports-\[backdrop-filter\]\:bg-gray-950\/25{background-color:color-mix(in oklab,var(--color-gray-950)25%,transparent)}}.dark\:supports-\[backdrop-filter\]\:bg-gray-950\/40{background-color:#03071266}@supports (color:color-mix(in lab,red,red)){.dark\:supports-\[backdrop-filter\]\:bg-gray-950\/40{background-color:color-mix(in oklab,var(--color-gray-950)40%,transparent)}}}}@media(min-width:40rem){@media(prefers-color-scheme:dark){.sm\:dark\:border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.sm\:dark\:border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}}}.\[\&_button\]\:h-7 button{height:calc(var(--spacing)*7)}.\[\&_button\]\:w-7 button{width:calc(var(--spacing)*7)}.\[\&_button\]\:min-w-0 button{min-width:calc(var(--spacing)*0)}.\[\&_button\]\:border-0 button{border-style:var(--tw-border-style);border-width:0}.\[\&_button\]\:bg-transparent button{background-color:#0000}.\[\&_button\]\:p-0 button{padding:calc(var(--spacing)*0)}.\[\&_button\]\:shadow-none button{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.\[\&_button_svg\]\:drop-shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.9\)\] button svg{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#000000e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.\[\&_button\:hover\]\:bg-white\/10 button:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.\[\&_button\:hover\]\:bg-white\/10 button:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\>button\]\:min-w-0>button{min-width:calc(var(--spacing)*0)}.\[\&\>button\]\:flex-1>button{flex:1}}:root{color-scheme:light dark;color:#ffffffde;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#242424;font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;font-weight:400;line-height:1.5}.video-js{position:relative}.video-js .vjs-control-bar{z-index:60;position:relative}.video-js .vjs-menu-button-popup .vjs-menu,.video-js .vjs-volume-panel .vjs-volume-control{z-index:9999!important}.vjs-mini .video-js .vjs-current-time,.vjs-mini .video-js .vjs-time-divider,.vjs-mini .video-js .vjs-duration{opacity:1!important;visibility:visible!important;display:flex!important}.vjs-mini .video-js .vjs-current-time-display,.vjs-mini .video-js .vjs-duration-display{display:inline!important}.video-js .vjs-time-control{width:auto!important;min-width:0!important;padding-left:.35em!important;padding-right:.35em!important}.video-js .vjs-time-divider{padding-left:.15em!important;padding-right:.15em!important}.video-js .vjs-time-divider>div{padding:0!important}.video-js .vjs-current-time-display,.video-js .vjs-duration-display{font-variant-numeric:tabular-nums;font-size:.95em}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;inset:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid white;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid white}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;inset:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;inset:0 0 3em;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset: 10px){.video-js .vjs-text-track-display>div{inset:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:#32323280;cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:#323232e6}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none} diff --git a/backend/web/dist/assets/index-z2cKWgjr.js b/backend/web/dist/assets/index-z2cKWgjr.js deleted file mode 100644 index 9b02107..0000000 --- a/backend/web/dist/assets/index-z2cKWgjr.js +++ /dev/null @@ -1,449 +0,0 @@ -function QE(n,e){for(var t=0;ti[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function t(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=t(a);fetch(a.href,l)}})();var bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ru(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function ZE(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function i(){var a=!1;try{a=this instanceof i}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var a=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:function(){return n[i]}})}),t}var y0={exports:{}},Lc={};var i1;function JE(){if(i1)return Lc;i1=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var h in a)h!=="key"&&(l[h]=a[h])}else l=a;return a=l.ref,{$$typeof:n,type:i,key:u,ref:a!==void 0?a:null,props:l}}return Lc.Fragment=e,Lc.jsx=t,Lc.jsxs=t,Lc}var r1;function eC(){return r1||(r1=1,y0.exports=JE()),y0.exports}var c=eC(),b0={exports:{}},kn={};var s1;function tC(){if(s1)return kn;s1=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),A=Symbol.iterator;function C(L){return L===null||typeof L!="object"?null:(L=A&&L[A]||L["@@iterator"],typeof L=="function"?L:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,B={};function V(L,pe,we){this.props=L,this.context=pe,this.refs=B,this.updater=we||j}V.prototype.isReactComponent={},V.prototype.setState=function(L,pe){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,pe,"setState")},V.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function W(){}W.prototype=V.prototype;function H(L,pe,we){this.props=L,this.context=pe,this.refs=B,this.updater=we||j}var ie=H.prototype=new W;ie.constructor=H,k(ie,V.prototype),ie.isPureReactComponent=!0;var Y=Array.isArray;function G(){}var O={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function E(L,pe,we){var Be=we.ref;return{$$typeof:n,type:L,key:pe,ref:Be!==void 0?Be:null,props:we}}function R(L,pe){return E(L.type,pe,L.props)}function ee(L){return typeof L=="object"&&L!==null&&L.$$typeof===n}function q(L){var pe={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(we){return pe[we]})}var Q=/\/+/g;function ue(L,pe){return typeof L=="object"&&L!==null&&L.key!=null?q(""+L.key):pe.toString(36)}function se(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(G,G):(L.status="pending",L.then(function(pe){L.status==="pending"&&(L.status="fulfilled",L.value=pe)},function(pe){L.status==="pending"&&(L.status="rejected",L.reason=pe)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function $(L,pe,we,Be,Ve){var Oe=typeof L;(Oe==="undefined"||Oe==="boolean")&&(L=null);var Te=!1;if(L===null)Te=!0;else switch(Oe){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(L.$$typeof){case n:case e:Te=!0;break;case w:return Te=L._init,$(Te(L._payload),pe,we,Be,Ve)}}if(Te)return Ve=Ve(L),Te=Be===""?"."+ue(L,0):Be,Y(Ve)?(we="",Te!=null&&(we=Te.replace(Q,"$&/")+"/"),$(Ve,pe,we,"",function(xe){return xe})):Ve!=null&&(ee(Ve)&&(Ve=R(Ve,we+(Ve.key==null||L&&L.key===Ve.key?"":(""+Ve.key).replace(Q,"$&/")+"/")+Te)),pe.push(Ve)),1;Te=0;var _t=Be===""?".":Be+":";if(Y(L))for(var dt=0;dt>>1,de=$[le];if(0>>1;lea(we,X))Bea(Ve,we)?($[le]=Ve,$[Be]=X,le=Be):($[le]=we,$[pe]=X,le=pe);else if(Bea(Ve,X))$[le]=Ve,$[Be]=X,le=Be;else break e}}return F}function a($,F){var X=$.sortIndex-F.sortIndex;return X!==0?X:$.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,h=u.now();n.unstable_now=function(){return u.now()-h}}var f=[],g=[],w=1,S=null,A=3,C=!1,j=!1,k=!1,B=!1,V=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function ie($){for(var F=t(g);F!==null;){if(F.callback===null)i(g);else if(F.startTime<=$)i(g),F.sortIndex=F.expirationTime,e(f,F);else break;F=t(g)}}function Y($){if(k=!1,ie($),!j)if(t(f)!==null)j=!0,G||(G=!0,q());else{var F=t(g);F!==null&&se(Y,F.startTime-$)}}var G=!1,O=-1,re=5,E=-1;function R(){return B?!0:!(n.unstable_now()-E$&&R());){var le=S.callback;if(typeof le=="function"){S.callback=null,A=S.priorityLevel;var de=le(S.expirationTime<=$);if($=n.unstable_now(),typeof de=="function"){S.callback=de,ie($),F=!0;break t}S===t(f)&&i(f),ie($)}else i(f);S=t(f)}if(S!==null)F=!0;else{var L=t(g);L!==null&&se(Y,L.startTime-$),F=!1}}break e}finally{S=null,A=X,C=!1}F=void 0}}finally{F?q():G=!1}}}var q;if(typeof H=="function")q=function(){H(ee)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ue=Q.port2;Q.port1.onmessage=ee,q=function(){ue.postMessage(null)}}else q=function(){V(ee,0)};function se($,F){O=V(function(){$(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return A},n.unstable_next=function($){switch(A){case 1:case 2:case 3:var F=3;break;default:F=A}var X=A;A=F;try{return $()}finally{A=X}},n.unstable_requestPaint=function(){B=!0},n.unstable_runWithPriority=function($,F){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var X=A;A=$;try{return F()}finally{A=X}},n.unstable_scheduleCallback=function($,F,X){var le=n.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0le?($.sortIndex=X,e(g,$),t(f)===null&&$===t(g)&&(k?(W(O),O=-1):k=!0,se(Y,X-le))):($.sortIndex=de,e(f,$),j||C||(j=!0,G||(G=!0,q()))),$},n.unstable_shouldYield=R,n.unstable_wrapCallback=function($){var F=A;return function(){var X=A;A=F;try{return $.apply(this,arguments)}finally{A=X}}}})(_0)),_0}var u1;function iC(){return u1||(u1=1,x0.exports=nC()),x0.exports}var w0={exports:{}},kr={};var c1;function rC(){if(c1)return kr;c1=1;var n=Qf();function e(f){var g="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),w0.exports=rC(),w0.exports}var h1;function sC(){if(h1)return Ic;h1=1;var n=iC(),e=Qf(),t=Z_();function i(r){var s="https://react.dev/errors/"+r;if(1de||(r.current=le[de],le[de]=null,de--)}function we(r,s){de++,le[de]=r.current,r.current=s}var Be=L(null),Ve=L(null),Oe=L(null),Te=L(null);function _t(r,s){switch(we(Oe,s),we(Ve,r),we(Be,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?Ex(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=Ex(s),r=Cx(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}pe(Be),we(Be,r)}function dt(){pe(Be),pe(Ve),pe(Oe)}function xe(r){r.memoizedState!==null&&we(Te,r);var s=Be.current,o=Cx(s,r.type);s!==o&&(we(Ve,r),we(Be,o))}function Ne(r){Ve.current===r&&(pe(Be),pe(Ve)),Te.current===r&&(pe(Te),Mc._currentValue=X)}var Se,Ie;function $e(r){if(Se===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);Se=s&&s[1]||"",Ie=-1)":-1y||be[d]!==ze[y]){var rt=` -`+be[d].replace(" at new "," at ");return r.displayName&&rt.includes("")&&(rt=rt.replace("",r.displayName)),rt}while(1<=d&&0<=y);break}}}finally{Ct=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?$e(o):""}function gt(r,s){switch(r.tag){case 26:case 27:case 5:return $e(r.type);case 16:return $e("Lazy");case 13:return r.child!==s&&s!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return st(r.type,!1);case 11:return st(r.type.render,!1);case 1:return st(r.type,!0);case 31:return $e("Activity");default:return""}}function He(r){try{var s="",o=null;do s+=gt(r,o),o=r,r=r.return;while(r);return s}catch(d){return` -Error generating stack: `+d.message+` -`+d.stack}}var We=Object.prototype.hasOwnProperty,Je=n.unstable_scheduleCallback,et=n.unstable_cancelCallback,mt=n.unstable_shouldYield,Mt=n.unstable_requestPaint,fe=n.unstable_now,qe=n.unstable_getCurrentPriorityLevel,Le=n.unstable_ImmediatePriority,Ce=n.unstable_UserBlockingPriority,Pe=n.unstable_NormalPriority,Qe=n.unstable_LowPriority,At=n.unstable_IdlePriority,Xt=n.log,kt=n.unstable_setDisableYieldValue,mn=null,It=null;function $t(r){if(typeof Xt=="function"&&kt(r),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(mn,r)}catch{}}var Ot=Math.clz32?Math.clz32:Pn,en=Math.log,Sn=Math.LN2;function Pn(r){return r>>>=0,r===0?32:31-(en(r)/Sn|0)|0}var St=256,Tn=262144,tt=4194304;function D(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function P(r,s,o){var d=r.pendingLanes;if(d===0)return 0;var y=0,b=r.suspendedLanes,M=r.pingedLanes;r=r.warmLanes;var z=d&134217727;return z!==0?(d=z&~b,d!==0?y=D(d):(M&=z,M!==0?y=D(M):o||(o=z&~r,o!==0&&(y=D(o))))):(z=d&~b,z!==0?y=D(z):M!==0?y=D(M):o||(o=d&~r,o!==0&&(y=D(o)))),y===0?0:s!==0&&s!==y&&(s&b)===0&&(b=y&-y,o=s&-s,b>=o||b===32&&(o&4194048)!==0)?s:y}function ne(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Re(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var r=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),r}function yt(r){for(var s=[],o=0;31>o;o++)s.push(r);return s}function tn(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function un(r,s,o,d,y,b){var M=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var z=r.entanglements,be=r.expirationTimes,ze=r.hiddenUpdates;for(o=M&~o;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Kt=/[\n"\\]/g;function sn(r){return r.replace(Kt,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Mn(r,s,o,d,y,b,M,z){r.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?r.type=M:r.removeAttribute("type"),s!=null?M==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+Ht(s)):r.value!==""+Ht(s)&&(r.value=""+Ht(s)):M!=="submit"&&M!=="reset"||r.removeAttribute("value"),s!=null?nr(r,M,Ht(s)):o!=null?nr(r,M,Ht(o)):d!=null&&r.removeAttribute("value"),y==null&&b!=null&&(r.defaultChecked=!!b),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?r.name=""+Ht(z):r.removeAttribute("name")}function Yn(r,s,o,d,y,b,M,z){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(r.type=b),s!=null||o!=null){if(!(b!=="submit"&&b!=="reset"||s!=null)){wt(r);return}o=o!=null?""+Ht(o):"",s=s!=null?""+Ht(s):o,z||s===r.value||(r.value=s),r.defaultValue=s}d=d??y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=z?r.checked:!!d,r.defaultChecked=!!d,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(r.name=M),wt(r)}function nr(r,s,o){s==="number"&&Gt(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Wn(r,s,o,d){if(r=r.options,s){s={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ce=!1;if(Z)try{var ve={};Object.defineProperty(ve,"passive",{get:function(){ce=!0}}),window.addEventListener("test",ve,ve),window.removeEventListener("test",ve,ve)}catch{ce=!1}var Me=null,I=null,U=null;function te(){if(U)return U;var r,s=I,o=s.length,d,y="value"in Me?Me.value:Me.textContent,b=y.length;for(r=0;r=Lo),Id=" ",zu=!1;function kl(r,s){switch(r){case"keyup":return Lm.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bd(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ua=!1;function Im(r,s){switch(r){case"compositionend":return Bd(s);case"keypress":return s.which!==32?null:(zu=!0,Id);case"textInput":return r=s.data,r===Id&&zu?null:r;default:return null}}function Hu(r,s){if(Ua)return r==="compositionend"||!Fa&&kl(r,s)?(r=te(),U=I=Me=null,Ua=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:o,offset:s-r};r=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ha(o)}}function ha(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?ha(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function El(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Gt(r.document);s instanceof r.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)r=s.contentWindow;else break;s=Gt(r.document)}return s}function Wu(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var Hm=Z&&"documentMode"in document&&11>=document.documentMode,$a=null,Xu=null,qa=null,Cl=!1;function Yu(r,s,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Cl||$a==null||$a!==Gt(d)||(d=$a,"selectionStart"in d&&Wu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),qa&&zs(qa,d)||(qa=d,d=Dh(Xu,"onSelect"),0>=M,y-=M,ts=1<<32-Ot(s)+y|o<Dn?(Vn=an,an=null):Vn=an.sibling;var ei=Ke(je,an,Ue[Dn],ot);if(ei===null){an===null&&(an=Vn);break}r&&an&&ei.alternate===null&&s(je,an),Ee=b(ei,Ee,Dn),Jn===null?dn=ei:Jn.sibling=ei,Jn=ei,an=Vn}if(Dn===Ue.length)return o(je,an),Un&&Ln(je,Dn),dn;if(an===null){for(;DnDn?(Vn=an,an=null):Vn=an.sibling;var go=Ke(je,an,ei.value,ot);if(go===null){an===null&&(an=Vn);break}r&&an&&go.alternate===null&&s(je,an),Ee=b(go,Ee,Dn),Jn===null?dn=go:Jn.sibling=go,Jn=go,an=Vn}if(ei.done)return o(je,an),Un&&Ln(je,Dn),dn;if(an===null){for(;!ei.done;Dn++,ei=Ue.next())ei=ct(je,ei.value,ot),ei!==null&&(Ee=b(ei,Ee,Dn),Jn===null?dn=ei:Jn.sibling=ei,Jn=ei);return Un&&Ln(je,Dn),dn}for(an=d(an);!ei.done;Dn++,ei=Ue.next())ei=Ye(an,je,Dn,ei.value,ot),ei!==null&&(r&&ei.alternate!==null&&an.delete(ei.key===null?Dn:ei.key),Ee=b(ei,Ee,Dn),Jn===null?dn=ei:Jn.sibling=ei,Jn=ei);return r&&an.forEach(function(YE){return s(je,YE)}),Un&&Ln(je,Dn),dn}function gi(je,Ee,Ue,ot){if(typeof Ue=="object"&&Ue!==null&&Ue.type===k&&Ue.key===null&&(Ue=Ue.props.children),typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case C:e:{for(var dn=Ue.key;Ee!==null;){if(Ee.key===dn){if(dn=Ue.type,dn===k){if(Ee.tag===7){o(je,Ee.sibling),ot=y(Ee,Ue.props.children),ot.return=je,je=ot;break e}}else if(Ee.elementType===dn||typeof dn=="object"&&dn!==null&&dn.$$typeof===re&&Go(dn)===Ee.type){o(je,Ee.sibling),ot=y(Ee,Ue.props),lc(ot,Ue),ot.return=je,je=ot;break e}o(je,Ee);break}else s(je,Ee);Ee=Ee.sibling}Ue.type===k?(ot=$s(Ue.props.children,je.mode,ot,Ue.key),ot.return=je,je=ot):(ot=ic(Ue.type,Ue.key,Ue.props,null,je.mode,ot),lc(ot,Ue),ot.return=je,je=ot)}return M(je);case j:e:{for(dn=Ue.key;Ee!==null;){if(Ee.key===dn)if(Ee.tag===4&&Ee.stateNode.containerInfo===Ue.containerInfo&&Ee.stateNode.implementation===Ue.implementation){o(je,Ee.sibling),ot=y(Ee,Ue.children||[]),ot.return=je,je=ot;break e}else{o(je,Ee);break}else s(je,Ee);Ee=Ee.sibling}ot=Xa(Ue,je.mode,ot),ot.return=je,je=ot}return M(je);case re:return Ue=Go(Ue),gi(je,Ee,Ue,ot)}if(se(Ue))return nn(je,Ee,Ue,ot);if(q(Ue)){if(dn=q(Ue),typeof dn!="function")throw Error(i(150));return Ue=dn.call(Ue),yn(je,Ee,Ue,ot)}if(typeof Ue.then=="function")return gi(je,Ee,eh(Ue),ot);if(Ue.$$typeof===H)return gi(je,Ee,_n(je,Ue),ot);th(je,Ue)}return typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint"?(Ue=""+Ue,Ee!==null&&Ee.tag===6?(o(je,Ee.sibling),ot=y(Ee,Ue),ot.return=je,je=ot):(o(je,Ee),ot=zo(Ue,je.mode,ot),ot.return=je,je=ot),M(je)):o(je,Ee)}return function(je,Ee,Ue,ot){try{oc=0;var dn=gi(je,Ee,Ue,ot);return jl=null,dn}catch(an){if(an===Rl||an===Zd)throw an;var Jn=$i(29,an,null,je.mode);return Jn.lanes=ot,Jn.return=je,Jn}}}var Wo=yb(!0),bb=yb(!1),Za=!1;function Km(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wm(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ja(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function eo(r,s,o){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ri&2)!==0){var y=d.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),d.pending=s,s=Dl(r),Kd(r,null,o),s}return Nl(r,d,s,o),Dl(r)}function uc(r,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var d=s.lanes;d&=r.pendingLanes,o|=d,s.lanes=o,cn(r,o)}}function Xm(r,s){var o=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var y=null,b=null;if(o=o.firstBaseUpdate,o!==null){do{var M={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};b===null?y=b=M:b=b.next=M,o=o.next}while(o!==null);b===null?y=b=s:b=b.next=s}else y=b=s;o={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=s:r.next=s,o.lastBaseUpdate=s}var Ym=!1;function cc(){if(Ym){var r=fr;if(r!==null)throw r}}function dc(r,s,o,d){Ym=!1;var y=r.updateQueue;Za=!1;var b=y.firstBaseUpdate,M=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var be=z,ze=be.next;be.next=null,M===null?b=ze:M.next=ze,M=be;var rt=r.alternate;rt!==null&&(rt=rt.updateQueue,z=rt.lastBaseUpdate,z!==M&&(z===null?rt.firstBaseUpdate=ze:z.next=ze,rt.lastBaseUpdate=be))}if(b!==null){var ct=y.baseState;M=0,rt=ze=be=null,z=b;do{var Ke=z.lane&-536870913,Ye=Ke!==z.lane;if(Ye?(qn&Ke)===Ke:(d&Ke)===Ke){Ke!==0&&Ke===ms&&(Ym=!0),rt!==null&&(rt=rt.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var nn=r,yn=z;Ke=s;var gi=o;switch(yn.tag){case 1:if(nn=yn.payload,typeof nn=="function"){ct=nn.call(gi,ct,Ke);break e}ct=nn;break e;case 3:nn.flags=nn.flags&-65537|128;case 0:if(nn=yn.payload,Ke=typeof nn=="function"?nn.call(gi,ct,Ke):nn,Ke==null)break e;ct=S({},ct,Ke);break e;case 2:Za=!0}}Ke=z.callback,Ke!==null&&(r.flags|=64,Ye&&(r.flags|=8192),Ye=y.callbacks,Ye===null?y.callbacks=[Ke]:Ye.push(Ke))}else Ye={lane:Ke,tag:z.tag,payload:z.payload,callback:z.callback,next:null},rt===null?(ze=rt=Ye,be=ct):rt=rt.next=Ye,M|=Ke;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;Ye=z,z=Ye.next,Ye.next=null,y.lastBaseUpdate=Ye,y.shared.pending=null}}while(!0);rt===null&&(be=ct),y.baseState=be,y.firstBaseUpdate=ze,y.lastBaseUpdate=rt,b===null&&(y.shared.lanes=0),so|=M,r.lanes=M,r.memoizedState=ct}}function vb(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function xb(r,s){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;rb?b:8;var M=$.T,z={};$.T=z,pp(r,!1,s,o);try{var be=y(),ze=$.S;if(ze!==null&&ze(z,be),be!==null&&typeof be=="object"&&typeof be.then=="function"){var rt=Fk(be,d);mc(r,s,rt,as(r))}else mc(r,s,d,as(r))}catch(ct){mc(r,s,{then:function(){},status:"rejected",reason:ct},as())}finally{F.p=b,M!==null&&z.types!==null&&(M.types=z.types),$.T=M}}function Vk(){}function fp(r,s,o,d){if(r.tag!==5)throw Error(i(476));var y=Zb(r).queue;Qb(r,y,s,X,o===null?Vk:function(){return Jb(r),o(d)})}function Zb(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:X},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:o},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Jb(r){var s=Zb(r);s.next===null&&(s=r.alternate.memoizedState),mc(r,s.next.queue,{},as())}function mp(){return Vt(Mc)}function ev(){return Ji().memoizedState}function tv(){return Ji().memoizedState}function Gk(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var o=as();r=Ja(o);var d=eo(s,r,o);d!==null&&(qr(d,s,o),uc(d,s,o)),s={cache:pa()},r.payload=s;return}s=s.return}}function Kk(r,s,o){var d=as();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},dh(r)?iv(s,o):(o=tc(r,s,o,d),o!==null&&(qr(o,r,d),rv(o,s,d)))}function nv(r,s,o){var d=as();mc(r,s,o,d)}function mc(r,s,o,d){var y={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(dh(r))iv(s,y);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var M=s.lastRenderedState,z=b(M,o);if(y.hasEagerState=!0,y.eagerState=z,Sr(z,M))return Nl(r,s,y,0),xi===null&&Al(),!1}catch{}if(o=tc(r,s,y,d),o!==null)return qr(o,r,d),rv(o,s,d),!0}return!1}function pp(r,s,o,d){if(d={lane:2,revertLane:Kp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},dh(r)){if(s)throw Error(i(479))}else s=tc(r,o,d,2),s!==null&&qr(s,r,2)}function dh(r){var s=r.alternate;return r===An||s!==null&&s===An}function iv(r,s){Ll=rh=!0;var o=r.pending;o===null?s.next=s:(s.next=o.next,o.next=s),r.pending=s}function rv(r,s,o){if((o&4194048)!==0){var d=s.lanes;d&=r.pendingLanes,o|=d,s.lanes=o,cn(r,o)}}var pc={readContext:Vt,use:oh,useCallback:qi,useContext:qi,useEffect:qi,useImperativeHandle:qi,useLayoutEffect:qi,useInsertionEffect:qi,useMemo:qi,useReducer:qi,useRef:qi,useState:qi,useDebugValue:qi,useDeferredValue:qi,useTransition:qi,useSyncExternalStore:qi,useId:qi,useHostTransitionStatus:qi,useFormState:qi,useActionState:qi,useOptimistic:qi,useMemoCache:qi,useCacheRefresh:qi};pc.useEffectEvent=qi;var sv={readContext:Vt,use:oh,useCallback:function(r,s){return Dr().memoizedState=[r,s===void 0?null:s],r},useContext:Vt,useEffect:Hb,useImperativeHandle:function(r,s,o){o=o!=null?o.concat([r]):null,uh(4194308,4,Gb.bind(null,s,r),o)},useLayoutEffect:function(r,s){return uh(4194308,4,r,s)},useInsertionEffect:function(r,s){uh(4,2,r,s)},useMemo:function(r,s){var o=Dr();s=s===void 0?null:s;var d=r();if(Xo){$t(!0);try{r()}finally{$t(!1)}}return o.memoizedState=[d,s],d},useReducer:function(r,s,o){var d=Dr();if(o!==void 0){var y=o(s);if(Xo){$t(!0);try{o(s)}finally{$t(!1)}}}else y=s;return d.memoizedState=d.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},d.queue=r,r=r.dispatch=Kk.bind(null,An,r),[d.memoizedState,r]},useRef:function(r){var s=Dr();return r={current:r},s.memoizedState=r},useState:function(r){r=lp(r);var s=r.queue,o=nv.bind(null,An,s);return s.dispatch=o,[r.memoizedState,o]},useDebugValue:dp,useDeferredValue:function(r,s){var o=Dr();return hp(o,r,s)},useTransition:function(){var r=lp(!1);return r=Qb.bind(null,An,r.queue,!0,!1),Dr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,o){var d=An,y=Dr();if(Un){if(o===void 0)throw Error(i(407));o=o()}else{if(o=s(),xi===null)throw Error(i(349));(qn&127)!==0||Eb(d,s,o)}y.memoizedState=o;var b={value:o,getSnapshot:s};return y.queue=b,Hb(Ab.bind(null,d,b,r),[r]),d.flags|=2048,Bl(9,{destroy:void 0},Cb.bind(null,d,b,o,s),null),o},useId:function(){var r=Dr(),s=xi.identifierPrefix;if(Un){var o=br,d=ts;o=(d&~(1<<32-Ot(d)-1)).toString(32)+o,s="_"+s+"R_"+o,o=sh++,0<\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?M.createElement("select",{is:d.is}):M.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?M.createElement(y,{is:d.is}):M.createElement(y)}}b[Zt]=s,b[zt]=d;e:for(M=s.child;M!==null;){if(M.tag===5||M.tag===6)b.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===s)break e;for(;M.sibling===null;){if(M.return===null||M.return===s)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}s.stateNode=b;e:switch(xr(b,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&va(s)}}return Ai(s),Np(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,o),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==d&&va(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(i(166));if(r=Oe.current,p(s)){if(r=s.stateNode,o=s.memoizedProps,d=null,y=rr,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}r[Zt]=s,r=!!(r.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||Tx(r.nodeValue,o)),r||Ks(s,!0)}else r=Mh(r).createTextNode(d),r[Zt]=s,s.stateNode=r}return Ai(s),null;case 31:if(o=s.memoizedState,r===null||r.memoizedState!==null){if(d=p(s),o!==null){if(r===null){if(!d)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Zt]=s}else v(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ai(s),r=!1}else o=_(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return s.flags&256?(is(s),s):(is(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Ai(s),null;case 13:if(d=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=p(s),d!==null&&d.dehydrated!==null){if(r===null){if(!y)throw Error(i(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Zt]=s}else v(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ai(s),y=!1}else y=_(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(is(s),s):(is(s),null)}return is(s),(s.flags&128)!==0?(s.lanes=o,s):(o=d!==null,r=r!==null&&r.memoizedState!==null,o&&(d=s.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==y&&(d.flags|=2048)),o!==r&&o&&(s.child.flags|=8192),gh(s,s.updateQueue),Ai(s),null);case 4:return dt(),r===null&&Qp(s.stateNode.containerInfo),Ai(s),null;case 10:return oe(s.type),Ai(s),null;case 19:if(pe(Zi),d=s.memoizedState,d===null)return Ai(s),null;if(y=(s.flags&128)!==0,b=d.rendering,b===null)if(y)yc(d,!1);else{if(Vi!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(b=ih(r),b!==null){for(s.flags|=128,yc(d,!1),r=b.updateQueue,s.updateQueue=r,gh(s,r),s.subtreeFlags=0,r=o,o=s.child;o!==null;)Wd(o,r),o=o.sibling;return we(Zi,Zi.current&1|2),Un&&Ln(s,d.treeForkCount),s.child}r=r.sibling}d.tail!==null&&fe()>_h&&(s.flags|=128,y=!0,yc(d,!1),s.lanes=4194304)}else{if(!y)if(r=ih(b),r!==null){if(s.flags|=128,y=!0,r=r.updateQueue,s.updateQueue=r,gh(s,r),yc(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!Un)return Ai(s),null}else 2*fe()-d.renderingStartTime>_h&&o!==536870912&&(s.flags|=128,y=!0,yc(d,!1),s.lanes=4194304);d.isBackwards?(b.sibling=s.child,s.child=b):(r=d.last,r!==null?r.sibling=b:s.child=b,d.last=b)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=fe(),r.sibling=null,o=Zi.current,we(Zi,y?o&1|2:o&1),Un&&Ln(s,d.treeForkCount),r):(Ai(s),null);case 22:case 23:return is(s),Zm(),d=s.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(o&536870912)!==0&&(s.flags&128)===0&&(Ai(s),s.subtreeFlags&6&&(s.flags|=8192)):Ai(s),o=s.updateQueue,o!==null&&gh(s,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==o&&(s.flags|=2048),r!==null&&pe(Vo),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),oe(ki),Ai(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function Zk(r,s){switch(Pr(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return oe(ki),dt(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Ne(s),null;case 31:if(s.memoizedState!==null){if(is(s),s.alternate===null)throw Error(i(340));v()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(is(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));v()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return pe(Zi),null;case 4:return dt(),null;case 10:return oe(s.type),null;case 22:case 23:return is(s),Zm(),r!==null&&pe(Vo),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return oe(ki),null;case 25:return null;default:return null}}function Nv(r,s){switch(Pr(s),s.tag){case 3:oe(ki),dt();break;case 26:case 27:case 5:Ne(s);break;case 4:dt();break;case 31:s.memoizedState!==null&&is(s);break;case 13:is(s);break;case 19:pe(Zi);break;case 10:oe(s.type);break;case 22:case 23:is(s),Zm(),r!==null&&pe(Vo);break;case 24:oe(ki)}}function bc(r,s){try{var o=s.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var y=d.next;o=y;do{if((o.tag&r)===r){d=void 0;var b=o.create,M=o.inst;d=b(),M.destroy=d}o=o.next}while(o!==y)}}catch(z){ci(s,s.return,z)}}function io(r,s,o){try{var d=s.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var b=y.next;d=b;do{if((d.tag&r)===r){var M=d.inst,z=M.destroy;if(z!==void 0){M.destroy=void 0,y=s;var be=o,ze=z;try{ze()}catch(rt){ci(y,be,rt)}}}d=d.next}while(d!==b)}}catch(rt){ci(s,s.return,rt)}}function Dv(r){var s=r.updateQueue;if(s!==null){var o=r.stateNode;try{xb(s,o)}catch(d){ci(r,r.return,d)}}}function Mv(r,s,o){o.props=Yo(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(d){ci(r,s,d)}}function vc(r,s){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof o=="function"?r.refCleanup=o(d):o.current=d}}catch(y){ci(r,s,y)}}function Ys(r,s){var o=r.ref,d=r.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(y){ci(r,s,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(y){ci(r,s,y)}else o.current=null}function Rv(r){var s=r.type,o=r.memoizedProps,d=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(y){ci(r,r.return,y)}}function Dp(r,s,o){try{var d=r.stateNode;xE(d,r.type,o,s),d[zt]=s}catch(y){ci(r,r.return,y)}}function jv(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&co(r.type)||r.tag===4}function Mp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||jv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&co(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Rp(r,s,o){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(r),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=hi));else if(d!==4&&(d===27&&co(r.type)&&(o=r.stateNode,s=null),r=r.child,r!==null))for(Rp(r,s,o),r=r.sibling;r!==null;)Rp(r,s,o),r=r.sibling}function yh(r,s,o){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?o.insertBefore(r,s):o.appendChild(r);else if(d!==4&&(d===27&&co(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(yh(r,s,o),r=r.sibling;r!==null;)yh(r,s,o),r=r.sibling}function Ov(r){var s=r.stateNode,o=r.memoizedProps;try{for(var d=r.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);xr(s,d,o),s[Zt]=r,s[zt]=o}catch(b){ci(r,r.return,b)}}var xa=!1,or=!1,jp=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,mr=null;function Jk(r,s){if(r=r.containerInfo,e0=Ph,r=El(r),Wu(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var y=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{o.nodeType,b.nodeType}catch{o=null;break e}var M=0,z=-1,be=-1,ze=0,rt=0,ct=r,Ke=null;t:for(;;){for(var Ye;ct!==o||y!==0&&ct.nodeType!==3||(z=M+y),ct!==b||d!==0&&ct.nodeType!==3||(be=M+d),ct.nodeType===3&&(M+=ct.nodeValue.length),(Ye=ct.firstChild)!==null;)Ke=ct,ct=Ye;for(;;){if(ct===r)break t;if(Ke===o&&++ze===y&&(z=M),Ke===b&&++rt===d&&(be=M),(Ye=ct.nextSibling)!==null)break;ct=Ke,Ke=ct.parentNode}ct=Ye}o=z===-1||be===-1?null:{start:z,end:be}}else o=null}o=o||{start:0,end:0}}else o=null;for(t0={focusedElem:r,selectionRange:o},Ph=!1,mr=s;mr!==null;)if(s=mr,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,mr=r;else for(;mr!==null;){switch(s=mr,b=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(o=0;o title"))),xr(b,d,o),b[Zt]=r,rn(b),d=b;break e;case"link":var M=zx("link","href",y).get(d+(o.href||""));if(M){for(var z=0;zgi&&(M=gi,gi=yn,yn=M);var je=Ri(z,yn),Ee=Ri(z,gi);if(je&&Ee&&(Ye.rangeCount!==1||Ye.anchorNode!==je.node||Ye.anchorOffset!==je.offset||Ye.focusNode!==Ee.node||Ye.focusOffset!==Ee.offset)){var Ue=ct.createRange();Ue.setStart(je.node,je.offset),Ye.removeAllRanges(),yn>gi?(Ye.addRange(Ue),Ye.extend(Ee.node,Ee.offset)):(Ue.setEnd(Ee.node,Ee.offset),Ye.addRange(Ue))}}}}for(ct=[],Ye=z;Ye=Ye.parentNode;)Ye.nodeType===1&&ct.push({element:Ye,left:Ye.scrollLeft,top:Ye.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;zo?32:o,$.T=null,o=Up,Up=null;var b=oo,M=ka;if(dr=0,Hl=oo=null,ka=0,(ri&6)!==0)throw Error(i(331));var z=ri;if(ri|=4,Gv(b.current),$v(b,b.current,M,o),ri=z,kc(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(mn,b)}catch{}return!0}finally{F.p=y,$.T=d,cx(r,s)}}function hx(r,s,o){s=Ir(o,s),s=vp(r.stateNode,s,2),r=eo(r,s,2),r!==null&&(tn(r,2),Qs(r))}function ci(r,s,o){if(r.tag===3)hx(r,r,o);else for(;s!==null;){if(s.tag===3){hx(s,r,o);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ao===null||!ao.has(d))){r=Ir(o,r),o=fv(2),d=eo(s,o,2),d!==null&&(mv(o,d,s,r),tn(d,2),Qs(d));break}}s=s.return}}function qp(r,s,o){var d=r.pingCache;if(d===null){d=r.pingCache=new nE;var y=new Set;d.set(s,y)}else y=d.get(s),y===void 0&&(y=new Set,d.set(s,y));y.has(o)||(Ip=!0,y.add(o),r=oE.bind(null,r,s,o),s.then(r,r))}function oE(r,s,o){var d=r.pingCache;d!==null&&d.delete(s),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,xi===r&&(qn&o)===o&&(Vi===4||Vi===3&&(qn&62914560)===qn&&300>fe()-xh?(ri&2)===0&&$l(r,0):Bp|=o,zl===qn&&(zl=0)),Qs(r)}function fx(r,s){s===0&&(s=Ge()),r=ma(r,s),r!==null&&(tn(r,s),Qs(r))}function lE(r){var s=r.memoizedState,o=0;s!==null&&(o=s.retryLane),fx(r,o)}function uE(r,s){var o=0;switch(r.tag){case 31:case 13:var d=r.stateNode,y=r.memoizedState;y!==null&&(o=y.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(i(314))}d!==null&&d.delete(s),fx(r,o)}function cE(r,s){return Je(r,s)}var Ch=null,Vl=null,Vp=!1,Ah=!1,Gp=!1,uo=0;function Qs(r){r!==Vl&&r.next===null&&(Vl===null?Ch=Vl=r:Vl=Vl.next=r),Ah=!0,Vp||(Vp=!0,hE())}function kc(r,s){if(!Gp&&Ah){Gp=!0;do for(var o=!1,d=Ch;d!==null;){if(r!==0){var y=d.pendingLanes;if(y===0)var b=0;else{var M=d.suspendedLanes,z=d.pingedLanes;b=(1<<31-Ot(42|r)+1)-1,b&=y&~(M&~z),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(o=!0,yx(d,b))}else b=qn,b=P(d,d===xi?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||ne(d,b)||(o=!0,yx(d,b));d=d.next}while(o);Gp=!1}}function dE(){mx()}function mx(){Ah=Vp=!1;var r=0;uo!==0&&wE()&&(r=uo);for(var s=fe(),o=null,d=Ch;d!==null;){var y=d.next,b=px(d,s);b===0?(d.next=null,o===null?Ch=y:o.next=y,y===null&&(Vl=o)):(o=d,(r!==0||(b&3)!==0)&&(Ah=!0)),d=y}dr!==0&&dr!==5||kc(r),uo!==0&&(uo=0)}function px(r,s){for(var o=r.suspendedLanes,d=r.pingedLanes,y=r.expirationTimes,b=r.pendingLanes&-62914561;0z)break;var rt=be.transferSize,ct=be.initiatorType;rt&&kx(ct)&&(be=be.responseEnd,M+=rt*(be"u"?null:document;function Bx(r,s,o){var d=Gl;if(d&&typeof s=="string"&&s){var y=sn(s);y='link[rel="'+r+'"][href="'+y+'"]',typeof o=="string"&&(y+='[crossorigin="'+o+'"]'),Ix.has(y)||(Ix.add(y),r={rel:r,crossOrigin:o,href:s},d.querySelector(y)===null&&(s=d.createElement("link"),xr(s,"link",r),rn(s),d.head.appendChild(s)))}}function ME(r){Ea.D(r),Bx("dns-prefetch",r,null)}function RE(r,s){Ea.C(r,s),Bx("preconnect",r,s)}function jE(r,s,o){Ea.L(r,s,o);var d=Gl;if(d&&r&&s){var y='link[rel="preload"][as="'+sn(s)+'"]';s==="image"&&o&&o.imageSrcSet?(y+='[imagesrcset="'+sn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(y+='[imagesizes="'+sn(o.imageSizes)+'"]')):y+='[href="'+sn(r)+'"]';var b=y;switch(s){case"style":b=Kl(r);break;case"script":b=Wl(r)}ys.has(b)||(r=S({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:r,as:s},o),ys.set(b,r),d.querySelector(y)!==null||s==="style"&&d.querySelector(Nc(b))||s==="script"&&d.querySelector(Dc(b))||(s=d.createElement("link"),xr(s,"link",r),rn(s),d.head.appendChild(s)))}}function OE(r,s){Ea.m(r,s);var o=Gl;if(o&&r){var d=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+sn(d)+'"][href="'+sn(r)+'"]',b=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Wl(r)}if(!ys.has(b)&&(r=S({rel:"modulepreload",href:r},s),ys.set(b,r),o.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Dc(b)))return}d=o.createElement("link"),xr(d,"link",r),rn(d),o.head.appendChild(d)}}}function LE(r,s,o){Ea.S(r,s,o);var d=Gl;if(d&&r){var y=Kn(d).hoistableStyles,b=Kl(r);s=s||"default";var M=y.get(b);if(!M){var z={loading:0,preload:null};if(M=d.querySelector(Nc(b)))z.loading=5;else{r=S({rel:"stylesheet",href:r,"data-precedence":s},o),(o=ys.get(b))&&l0(r,o);var be=M=d.createElement("link");rn(be),xr(be,"link",r),be._p=new Promise(function(ze,rt){be.onload=ze,be.onerror=rt}),be.addEventListener("load",function(){z.loading|=1}),be.addEventListener("error",function(){z.loading|=2}),z.loading|=4,jh(M,s,d)}M={type:"stylesheet",instance:M,count:1,state:z},y.set(b,M)}}}function IE(r,s){Ea.X(r,s);var o=Gl;if(o&&r){var d=Kn(o).hoistableScripts,y=Wl(r),b=d.get(y);b||(b=o.querySelector(Dc(y)),b||(r=S({src:r,async:!0},s),(s=ys.get(y))&&u0(r,s),b=o.createElement("script"),rn(b),xr(b,"link",r),o.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function BE(r,s){Ea.M(r,s);var o=Gl;if(o&&r){var d=Kn(o).hoistableScripts,y=Wl(r),b=d.get(y);b||(b=o.querySelector(Dc(y)),b||(r=S({src:r,async:!0,type:"module"},s),(s=ys.get(y))&&u0(r,s),b=o.createElement("script"),rn(b),xr(b,"link",r),o.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function Px(r,s,o,d){var y=(y=Oe.current)?Rh(y):null;if(!y)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=Kl(o.href),o=Kn(y).hoistableStyles,d=o.get(s),d||(d={type:"style",instance:null,count:0,state:null},o.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=Kl(o.href);var b=Kn(y).hoistableStyles,M=b.get(r);if(M||(y=y.ownerDocument||y,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(r,M),(b=y.querySelector(Nc(r)))&&!b._p&&(M.instance=b,M.state.loading=5),ys.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ys.set(r,o),b||PE(y,r,o,M.state))),s&&d===null)throw Error(i(528,""));return M}if(s&&d!==null)throw Error(i(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wl(o),o=Kn(y).hoistableScripts,d=o.get(s),d||(d={type:"script",instance:null,count:0,state:null},o.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Kl(r){return'href="'+sn(r)+'"'}function Nc(r){return'link[rel="stylesheet"]['+r+"]"}function Fx(r){return S({},r,{"data-precedence":r.precedence,precedence:null})}function PE(r,s,o,d){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=r.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),xr(s,"link",o),rn(s),r.head.appendChild(s))}function Wl(r){return'[src="'+sn(r)+'"]'}function Dc(r){return"script[async]"+r}function Ux(r,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var d=r.querySelector('style[data-href~="'+sn(o.href)+'"]');if(d)return s.instance=d,rn(d),d;var y=S({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),rn(d),xr(d,"style",y),jh(d,o.precedence,r),s.instance=d;case"stylesheet":y=Kl(o.href);var b=r.querySelector(Nc(y));if(b)return s.state.loading|=4,s.instance=b,rn(b),b;d=Fx(o),(y=ys.get(y))&&l0(d,y),b=(r.ownerDocument||r).createElement("link"),rn(b);var M=b;return M._p=new Promise(function(z,be){M.onload=z,M.onerror=be}),xr(b,"link",d),s.state.loading|=4,jh(b,o.precedence,r),s.instance=b;case"script":return b=Wl(o.src),(y=r.querySelector(Dc(b)))?(s.instance=y,rn(y),y):(d=o,(y=ys.get(b))&&(d=S({},o),u0(d,y)),r=r.ownerDocument||r,y=r.createElement("script"),rn(y),xr(y,"link",d),r.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,jh(d,o.precedence,r));return s.instance}function jh(r,s,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,b=y,M=0;M title"):null)}function FE(r,s,o){if(o===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function $x(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function UE(r,s,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var y=Kl(d.href),b=s.querySelector(Nc(y));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=Lh.bind(r),s.then(r,r)),o.state.loading|=4,o.instance=b,rn(b);return}b=s.ownerDocument||s,d=Fx(d),(y=ys.get(y))&&l0(d,y),b=b.createElement("link"),rn(b);var M=b;M._p=new Promise(function(z,be){M.onload=z,M.onerror=be}),xr(b,"link",d),o.instance=b}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=Lh.bind(r),s.addEventListener("load",o),s.addEventListener("error",o))}}var c0=0;function zE(r,s){return r.stylesheets&&r.count===0&&Bh(r,r.stylesheets),0c0?50:800)+s);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function Lh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bh(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ih=null;function Bh(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ih=new Map,s.forEach(HE,r),Ih=null,Lh.call(r))}function HE(r,s){if(!(s.state.loading&4)){var o=Ih.get(r);if(o)var d=o.get(null);else{o=new Map,Ih.set(r,o);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),v0.exports=sC(),v0.exports}var J_=aC();function oC(...n){return n.filter(Boolean).join(" ")}const lC="inline-flex items-center justify-center font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",uC={sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},cC={xs:"px-2 py-1 text-xs",sm:"px-2.5 py-1.5 text-sm",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-sm"},dC={indigo:{primary:"!bg-indigo-600 !text-white shadow-sm hover:!bg-indigo-700 focus-visible:outline-indigo-600 dark:!bg-indigo-500 dark:hover:!bg-indigo-400 dark:focus-visible:outline-indigo-500",secondary:"bg-white text-gray-900 shadow-xs inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20",soft:"bg-indigo-50 text-indigo-600 shadow-xs hover:bg-indigo-100 dark:bg-indigo-500/20 dark:text-indigo-400 dark:shadow-none dark:hover:bg-indigo-500/30"},blue:{primary:"!bg-blue-600 !text-white shadow-sm hover:!bg-blue-700 focus-visible:outline-blue-600 dark:!bg-blue-500 dark:hover:!bg-blue-400 dark:focus-visible:outline-blue-500",secondary:"bg-white text-gray-900 shadow-xs inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20",soft:"bg-blue-50 text-blue-600 shadow-xs hover:bg-blue-100 dark:bg-blue-500/20 dark:text-blue-400 dark:shadow-none dark:hover:bg-blue-500/30"},emerald:{primary:"!bg-emerald-600 !text-white shadow-sm hover:!bg-emerald-700 focus-visible:outline-emerald-600 dark:!bg-emerald-500 dark:hover:!bg-emerald-400 dark:focus-visible:outline-emerald-500",secondary:"bg-white text-gray-900 shadow-xs inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20",soft:"bg-emerald-50 text-emerald-700 shadow-xs hover:bg-emerald-100 dark:bg-emerald-500/20 dark:text-emerald-400 dark:shadow-none dark:hover:bg-emerald-500/30"},red:{primary:"!bg-red-600 !text-white shadow-sm hover:!bg-red-700 focus-visible:outline-red-600 dark:!bg-red-500 dark:hover:!bg-red-400 dark:focus-visible:outline-red-500",secondary:"bg-white text-gray-900 shadow-xs inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20",soft:"bg-red-50 text-red-700 shadow-xs hover:bg-red-100 dark:bg-red-500/20 dark:text-red-400 dark:shadow-none dark:hover:bg-red-500/30"},amber:{primary:"!bg-amber-500 !text-white shadow-sm hover:!bg-amber-600 focus-visible:outline-amber-500 dark:!bg-amber-500 dark:hover:!bg-amber-400 dark:focus-visible:outline-amber-500",secondary:"bg-white text-gray-900 shadow-xs inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20",soft:"bg-amber-50 text-amber-800 shadow-xs hover:bg-amber-100 dark:bg-amber-500/20 dark:text-amber-300 dark:shadow-none dark:hover:bg-amber-500/30"}};function hC(){return c.jsxs("svg",{viewBox:"0 0 24 24",className:"size-4 animate-spin","aria-hidden":"true",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"4",opacity:"0.25"}),c.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",fill:"none",stroke:"currentColor",strokeWidth:"4",opacity:"0.9"})]})}function hn({children:n,variant:e="primary",color:t="indigo",size:i="md",rounded:a="md",leadingIcon:l,trailingIcon:u,isLoading:h=!1,disabled:f,className:g,type:w="button",...S}){const A=l||u||h?"gap-x-1.5":"";return c.jsxs("button",{type:w,disabled:f||h,className:oC(lC,uC[a],cC[i],dC[t][e],A,g),...S,children:[h?c.jsx("span",{className:"-ml-0.5",children:c.jsx(hC,{})}):l&&c.jsx("span",{className:"-ml-0.5",children:l}),c.jsx("span",{children:n}),u&&!h&&c.jsx("span",{className:"-mr-0.5",children:u})]})}function ew(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var a=n.length;for(e=0;ee in n?fC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,S0=(n,e,t)=>(mC(n,typeof e!="symbol"?e+"":e,t),t);let pC=class{constructor(){S0(this,"current",this.detect()),S0(this,"handoffState","pending"),S0(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},aa=new pC;function vd(n){var e;return aa.isServer?null:n==null?document:(e=n?.ownerDocument)!=null?e:document}function Ag(n){var e,t;return aa.isServer?null:n==null?document:(t=(e=n?.getRootNode)==null?void 0:e.call(n))!=null?t:document}function tw(n){var e,t;return(t=(e=Ag(n))==null?void 0:e.activeElement)!=null?t:null}function gC(n){return tw(n)===n}function Zf(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function Ba(){let n=[],e={addEventListener(t,i,a,l){return t.addEventListener(i,a,l),e.add(()=>t.removeEventListener(i,a,l))},requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return Zf(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,i,a){let l=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:a}),this.add(()=>{Object.assign(t.style,{[i]:l})})},group(t){let i=Ba();return t(i),this.add(()=>i.dispose())},add(t){return n.includes(t)||n.push(t),()=>{let i=n.indexOf(t);if(i>=0)for(let a of n.splice(i,1))a()}},dispose(){for(let t of n.splice(0))t()}};return e}function Jf(){let[n]=m.useState(Ba);return m.useEffect(()=>()=>n.dispose(),[n]),n}let Yr=(n,e)=>{aa.isServer?m.useEffect(n,e):m.useLayoutEffect(n,e)};function _l(n){let e=m.useRef(n);return Yr(()=>{e.current=n},[n]),e}let wi=function(n){let e=_l(n);return fn.useCallback((...t)=>e.current(...t),[e])};function xd(n){return m.useMemo(()=>n,Object.values(n))}let yC=m.createContext(void 0);function bC(){return m.useContext(yC)}function Ng(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function La(n,e,...t){if(n in e){let a=e[n];return typeof a=="function"?a(...t):a}let i=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,La),i}var vf=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(vf||{}),Eo=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(Eo||{});function Es(){let n=xC();return m.useCallback(e=>vC({mergeRefs:n,...e}),[n])}function vC({ourProps:n,theirProps:e,slot:t,defaultTag:i,features:a,visible:l=!0,name:u,mergeRefs:h}){h=h??_C;let f=nw(e,n);if(l)return Vh(f,t,i,u,h);let g=a??0;if(g&2){let{static:w=!1,...S}=f;if(w)return Vh(S,t,i,u,h)}if(g&1){let{unmount:w=!0,...S}=f;return La(w?0:1,{0(){return null},1(){return Vh({...S,hidden:!0,style:{display:"none"}},t,i,u,h)}})}return Vh(f,t,i,u,h)}function Vh(n,e={},t,i,a){let{as:l=t,children:u,refName:h="ref",...f}=T0(n,["unmount","static"]),g=n.ref!==void 0?{[h]:n.ref}:{},w=typeof u=="function"?u(e):u;"className"in f&&f.className&&typeof f.className=="function"&&(f.className=f.className(e)),f["aria-labelledby"]&&f["aria-labelledby"]===f.id&&(f["aria-labelledby"]=void 0);let S={};if(e){let A=!1,C=[];for(let[j,k]of Object.entries(e))typeof k=="boolean"&&(A=!0),k===!0&&C.push(j.replace(/([A-Z])/g,B=>`-${B.toLowerCase()}`));if(A){S["data-headlessui-state"]=C.join(" ");for(let j of C)S[`data-${j}`]=""}}if(Qc(l)&&(Object.keys(il(f)).length>0||Object.keys(il(S)).length>0))if(!m.isValidElement(w)||Array.isArray(w)&&w.length>1||SC(w)){if(Object.keys(il(f)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(il(f)).concat(Object.keys(il(S))).map(A=>` - ${A}`).join(` -`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(A=>` - ${A}`).join(` -`)].join(` -`))}else{let A=w.props,C=A?.className,j=typeof C=="function"?(...V)=>Ng(C(...V),f.className):Ng(C,f.className),k=j?{className:j}:{},B=nw(w.props,il(T0(f,["ref"])));for(let V in S)V in B&&delete S[V];return m.cloneElement(w,Object.assign({},B,S,g,{ref:a(wC(w),g.ref)},k))}return m.createElement(l,Object.assign({},T0(f,["ref"]),!Qc(l)&&g,!Qc(l)&&S),w)}function xC(){let n=m.useRef([]),e=m.useCallback(t=>{for(let i of n.current)i!=null&&(typeof i=="function"?i(t):i.current=t)},[]);return(...t)=>{if(!t.every(i=>i==null))return n.current=t,e}}function _C(...n){return n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function nw(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let i of n)for(let a in i)a.startsWith("on")&&typeof i[a]=="function"?(t[a]!=null||(t[a]=[]),t[a].push(i[a])):e[a]=i[a];if(e.disabled||e["aria-disabled"])for(let i in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(i)&&(t[i]=[a=>{var l;return(l=a?.preventDefault)==null?void 0:l.call(a)}]);for(let i in t)Object.assign(e,{[i](a,...l){let u=t[i];for(let h of u){if((a instanceof Event||a?.nativeEvent instanceof Event)&&a.defaultPrevented)return;h(a,...l)}}});return e}function Zr(n){var e;return Object.assign(m.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function il(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function T0(n,e=[]){let t=Object.assign({},n);for(let i of e)i in t&&delete t[i];return t}function wC(n){return fn.version.split(".")[0]>="19"?n.props.ref:n.ref}function Qc(n){return n===m.Fragment||n===Symbol.for("react.fragment")}function SC(n){return Qc(n.type)}let TC="span";var xf=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(xf||{});function kC(n,e){var t;let{features:i=1,...a}=n,l={ref:e,"aria-hidden":(i&2)===2?!0:(t=a["aria-hidden"])!=null?t:void 0,hidden:(i&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(i&4)===4&&(i&2)!==2&&{display:"none"}}};return Es()({ourProps:l,theirProps:a,slot:{},defaultTag:TC,name:"Hidden"})}let Dg=Zr(kC);function EC(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function Ao(n){return EC(n)&&"tagName"in n}function gl(n){return Ao(n)&&"accessKey"in n}function Co(n){return Ao(n)&&"tabIndex"in n}function CC(n){return Ao(n)&&"style"in n}function AC(n){return gl(n)&&n.nodeName==="IFRAME"}function NC(n){return gl(n)&&n.nodeName==="INPUT"}let iw=Symbol();function DC(n,e=!0){return Object.assign(n,{[iw]:e})}function ca(...n){let e=m.useRef(n);m.useEffect(()=>{e.current=n},[n]);let t=wi(i=>{for(let a of e.current)a!=null&&(typeof a=="function"?a(i):a.current=i)});return n.every(i=>i==null||i?.[iw])?void 0:t}let my=m.createContext(null);my.displayName="DescriptionContext";function rw(){let n=m.useContext(my);if(n===null){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,rw),e}return n}function MC(){let[n,e]=m.useState([]);return[n.length>0?n.join(" "):void 0,m.useMemo(()=>function(t){let i=wi(l=>(e(u=>[...u,l]),()=>e(u=>{let h=u.slice(),f=h.indexOf(l);return f!==-1&&h.splice(f,1),h}))),a=m.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props,value:t.value}),[i,t.slot,t.name,t.props,t.value]);return fn.createElement(my.Provider,{value:a},t.children)},[e])]}let RC="p";function jC(n,e){let t=m.useId(),i=bC(),{id:a=`headlessui-description-${t}`,...l}=n,u=rw(),h=ca(e);Yr(()=>u.register(a),[a,u.register]);let f=xd({...u.slot,disabled:i||!1}),g={ref:h,...u.props,id:a};return Es()({ourProps:g,theirProps:l,slot:f,defaultTag:RC,name:u.name||"Description"})}let OC=Zr(jC),LC=Object.assign(OC,{});var sw=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(sw||{});let IC=m.createContext(()=>{});function BC({value:n,children:e}){return fn.createElement(IC.Provider,{value:n},e)}let aw=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};var PC=Object.defineProperty,FC=(n,e,t)=>e in n?PC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,UC=(n,e,t)=>(FC(n,e+"",t),t),ow=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},bs=(n,e,t)=>(ow(n,e,"read from private field"),t?t.call(n):e.get(n)),k0=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},m1=(n,e,t,i)=>(ow(n,e,"write to private field"),e.set(n,t),t),Js,Vc,Gc;let zC=class{constructor(e){k0(this,Js,{}),k0(this,Vc,new aw(()=>new Set)),k0(this,Gc,new Set),UC(this,"disposables",Ba()),m1(this,Js,e),aa.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return bs(this,Js)}subscribe(e,t){if(aa.isServer)return()=>{};let i={selector:e,callback:t,current:e(bs(this,Js))};return bs(this,Gc).add(i),this.disposables.add(()=>{bs(this,Gc).delete(i)})}on(e,t){return aa.isServer?()=>{}:(bs(this,Vc).get(e).add(t),this.disposables.add(()=>{bs(this,Vc).get(e).delete(t)}))}send(e){let t=this.reduce(bs(this,Js),e);if(t!==bs(this,Js)){m1(this,Js,t);for(let i of bs(this,Gc)){let a=i.selector(bs(this,Js));lw(i.current,a)||(i.current=a,i.callback(a))}for(let i of bs(this,Vc).get(e.type))i(bs(this,Js),e)}}};Js=new WeakMap,Vc=new WeakMap,Gc=new WeakMap;function lw(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null?!1:Array.isArray(n)&&Array.isArray(e)?n.length!==e.length?!1:E0(n[Symbol.iterator](),e[Symbol.iterator]()):n instanceof Map&&e instanceof Map||n instanceof Set&&e instanceof Set?n.size!==e.size?!1:E0(n.entries(),e.entries()):p1(n)&&p1(e)?E0(Object.entries(n)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function E0(n,e){do{let t=n.next(),i=e.next();if(t.done&&i.done)return!0;if(t.done||i.done||!Object.is(t.value,i.value))return!1}while(!0)}function p1(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let e=Object.getPrototypeOf(n);return e===null||Object.getPrototypeOf(e)===null}var HC=Object.defineProperty,$C=(n,e,t)=>e in n?HC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,g1=(n,e,t)=>($C(n,typeof e!="symbol"?e+"":e,t),t),qC=(n=>(n[n.Push=0]="Push",n[n.Pop=1]="Pop",n))(qC||{});let VC={0(n,e){let t=e.id,i=n.stack,a=n.stack.indexOf(t);if(a!==-1){let l=n.stack.slice();return l.splice(a,1),l.push(t),i=l,{...n,stack:i}}return{...n,stack:[...n.stack,t]}},1(n,e){let t=e.id,i=n.stack.indexOf(t);if(i===-1)return n;let a=n.stack.slice();return a.splice(i,1),{...n,stack:a}}},GC=class uw extends zC{constructor(){super(...arguments),g1(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),g1(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new uw({stack:[]})}reduce(e,t){return La(t.type,VC,e,t)}};const cw=new aw(()=>GC.new());var C0={exports:{}},A0={};var y1;function KC(){if(y1)return A0;y1=1;var n=Qf();function e(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,a=n.useRef,l=n.useEffect,u=n.useMemo,h=n.useDebugValue;return A0.useSyncExternalStoreWithSelector=function(f,g,w,S,A){var C=a(null);if(C.current===null){var j={hasValue:!1,value:null};C.current=j}else j=C.current;C=u(function(){function B(Y){if(!V){if(V=!0,W=Y,Y=S(Y),A!==void 0&&j.hasValue){var G=j.value;if(A(G,Y))return H=G}return H=Y}if(G=H,t(W,Y))return G;var O=S(Y);return A!==void 0&&A(G,O)?(W=Y,G):(W=Y,H=O)}var V=!1,W,H,ie=w===void 0?null:w;return[function(){return B(g())},ie===null?void 0:function(){return B(ie())}]},[g,w,S,A]);var k=i(f,C[0],C[1]);return l(function(){j.hasValue=!0,j.value=k},[k]),h(k),k},A0}var b1;function WC(){return b1||(b1=1,C0.exports=KC()),C0.exports}var XC=WC();function dw(n,e,t=lw){return XC.useSyncExternalStoreWithSelector(wi(i=>n.subscribe(YC,i)),wi(()=>n.state),wi(()=>n.state),wi(e),t)}function YC(n){return n}function _d(n,e){let t=m.useId(),i=cw.get(e),[a,l]=dw(i,m.useCallback(u=>[i.selectors.isTop(u,t),i.selectors.inStack(u,t)],[i,t]));return Yr(()=>{if(n)return i.actions.push(t),()=>i.actions.pop(t)},[i,n,t]),n?l?a:!0:!1}let Mg=new Map,Zc=new Map;function v1(n){var e;let t=(e=Zc.get(n))!=null?e:0;return Zc.set(n,t+1),t!==0?()=>x1(n):(Mg.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>x1(n))}function x1(n){var e;let t=(e=Zc.get(n))!=null?e:1;if(t===1?Zc.delete(n):Zc.set(n,t-1),t!==1)return;let i=Mg.get(n);i&&(i["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",i["aria-hidden"]),n.inert=i.inert,Mg.delete(n))}function QC(n,{allowed:e,disallowed:t}={}){let i=_d(n,"inert-others");Yr(()=>{var a,l;if(!i)return;let u=Ba();for(let f of(a=t?.())!=null?a:[])f&&u.add(v1(f));let h=(l=e?.())!=null?l:[];for(let f of h){if(!f)continue;let g=vd(f);if(!g)continue;let w=f.parentElement;for(;w&&w!==g.body;){for(let S of w.children)h.some(A=>S.contains(A))||u.add(v1(S));w=w.parentElement}}return u.dispose},[i,e,t])}function ZC(n,e,t){let i=_l(a=>{let l=a.getBoundingClientRect();l.x===0&&l.y===0&&l.width===0&&l.height===0&&t()});m.useEffect(()=>{if(!n)return;let a=e===null?null:gl(e)?e:e.current;if(!a)return;let l=Ba();if(typeof ResizeObserver<"u"){let u=new ResizeObserver(()=>i.current(a));u.observe(a),l.add(()=>u.disconnect())}if(typeof IntersectionObserver<"u"){let u=new IntersectionObserver(()=>i.current(a));u.observe(a),l.add(()=>u.disconnect())}return()=>l.dispose()},[e,i,n])}let _f=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(","),JC=["[data-autofocus]"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var Da=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(Da||{}),Rg=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(Rg||{}),e5=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(e5||{});function t5(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(_f)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function n5(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(JC)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var hw=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(hw||{});function i5(n,e=0){var t;return n===((t=vd(n))==null?void 0:t.body)?!1:La(e,{0(){return n.matches(_f)},1(){let i=n;for(;i!==null;){if(i.matches(_f))return!0;i=i.parentElement}return!1}})}var r5=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(r5||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ja(n){n?.focus({preventScroll:!0})}let s5=["textarea","input"].join(",");function a5(n){var e,t;return(t=(e=n?.matches)==null?void 0:e.call(n,s5))!=null?t:!1}function o5(n,e=t=>t){return n.slice().sort((t,i)=>{let a=e(t),l=e(i);if(a===null||l===null)return 0;let u=a.compareDocumentPosition(l);return u&Node.DOCUMENT_POSITION_FOLLOWING?-1:u&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Jc(n,e,{sorted:t=!0,relativeTo:i=null,skipElements:a=[]}={}){let l=Array.isArray(n)?n.length>0?Ag(n[0]):document:Ag(n),u=Array.isArray(n)?t?o5(n):n:e&64?n5(n):t5(n);a.length>0&&u.length>1&&(u=u.filter(C=>!a.some(j=>j!=null&&"current"in j?j?.current===C:j===C))),i=i??l?.activeElement;let h=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,u.indexOf(i))-1;if(e&4)return Math.max(0,u.indexOf(i))+1;if(e&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),g=e&32?{preventScroll:!0}:{},w=0,S=u.length,A;do{if(w>=S||w+S<=0)return 0;let C=f+w;if(e&16)C=(C+S)%S;else{if(C<0)return 3;if(C>=S)return 1}A=u[C],A?.focus(g),w+=h}while(A!==tw(A));return e&6&&a5(A)&&A.select(),2}function fw(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function l5(){return/Android/gi.test(window.navigator.userAgent)}function _1(){return fw()||l5()}function Gh(n,e,t,i){let a=_l(t);m.useEffect(()=>{if(!n)return;function l(u){a.current(u)}return document.addEventListener(e,l,i),()=>document.removeEventListener(e,l,i)},[n,e,i])}function mw(n,e,t,i){let a=_l(t);m.useEffect(()=>{if(!n)return;function l(u){a.current(u)}return window.addEventListener(e,l,i),()=>window.removeEventListener(e,l,i)},[n,e,i])}const w1=30;function u5(n,e,t){let i=_l(t),a=m.useCallback(function(h,f){if(h.defaultPrevented)return;let g=f(h);if(g===null||!g.getRootNode().contains(g)||!g.isConnected)return;let w=(function S(A){return typeof A=="function"?S(A()):Array.isArray(A)||A instanceof Set?A:[A]})(e);for(let S of w)if(S!==null&&(S.contains(g)||h.composed&&h.composedPath().includes(S)))return;return!i5(g,hw.Loose)&&g.tabIndex!==-1&&h.preventDefault(),i.current(h,g)},[i,e]),l=m.useRef(null);Gh(n,"pointerdown",h=>{var f,g;_1()||(l.current=((g=(f=h.composedPath)==null?void 0:f.call(h))==null?void 0:g[0])||h.target)},!0),Gh(n,"pointerup",h=>{if(_1()||!l.current)return;let f=l.current;return l.current=null,a(h,()=>f)},!0);let u=m.useRef({x:0,y:0});Gh(n,"touchstart",h=>{u.current.x=h.touches[0].clientX,u.current.y=h.touches[0].clientY},!0),Gh(n,"touchend",h=>{let f={x:h.changedTouches[0].clientX,y:h.changedTouches[0].clientY};if(!(Math.abs(f.x-u.current.x)>=w1||Math.abs(f.y-u.current.y)>=w1))return a(h,()=>Co(h.target)?h.target:null)},!0),mw(n,"blur",h=>a(h,()=>AC(window.document.activeElement)?window.document.activeElement:null),!0)}function py(...n){return m.useMemo(()=>vd(...n),[...n])}function pw(n,e,t,i){let a=_l(t);m.useEffect(()=>{n=n??window;function l(u){a.current(u)}return n.addEventListener(e,l,i),()=>n.removeEventListener(e,l,i)},[n,e,i])}function c5(n){return m.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function d5(n,e){let t=n(),i=new Set;return{getSnapshot(){return t},subscribe(a){return i.add(a),()=>i.delete(a)},dispatch(a,...l){let u=e[a].call(t,...l);u&&(t=u,i.forEach(h=>h()))}}}function h5(){let n;return{before({doc:e}){var t;let i=e.documentElement,a=(t=e.defaultView)!=null?t:window;n=Math.max(0,a.innerWidth-i.clientWidth)},after({doc:e,d:t}){let i=e.documentElement,a=Math.max(0,i.clientWidth-i.offsetWidth),l=Math.max(0,n-a);t.style(i,"paddingRight",`${l}px`)}}}function f5(){return fw()?{before({doc:n,d:e,meta:t}){function i(a){for(let l of t().containers)for(let u of l())if(u.contains(a))return!0;return!1}e.microTask(()=>{var a;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let h=Ba();h.style(n.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>h.dispose()))}let l=(a=window.scrollY)!=null?a:window.pageYOffset,u=null;e.addEventListener(n,"click",h=>{if(Co(h.target))try{let f=h.target.closest("a");if(!f)return;let{hash:g}=new URL(f.href),w=n.querySelector(g);Co(w)&&!i(w)&&(u=w)}catch{}},!0),e.group(h=>{e.addEventListener(n,"touchstart",f=>{if(h.dispose(),Co(f.target)&&CC(f.target))if(i(f.target)){let g=f.target;for(;g.parentElement&&i(g.parentElement);)g=g.parentElement;h.style(g,"overscrollBehavior","contain")}else h.style(f.target,"touchAction","none")})}),e.addEventListener(n,"touchmove",h=>{if(Co(h.target)){if(NC(h.target))return;if(i(h.target)){let f=h.target;for(;f.parentElement&&f.dataset.headlessuiPortal!==""&&!(f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth);)f=f.parentElement;f.dataset.headlessuiPortal===""&&h.preventDefault()}else h.preventDefault()}},{passive:!1}),e.add(()=>{var h;let f=(h=window.scrollY)!=null?h:window.pageYOffset;l!==f&&window.scrollTo(0,l),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function m5(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function S1(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let ll=d5(()=>new Map,{PUSH(n,e){var t;let i=(t=this.get(n))!=null?t:{doc:n,count:0,d:Ba(),meta:new Set,computedMeta:{}};return i.count++,i.meta.add(e),i.computedMeta=S1(i.meta),this.set(n,i),this},POP(n,e){let t=this.get(n);return t&&(t.count--,t.meta.delete(e),t.computedMeta=S1(t.meta)),this},SCROLL_PREVENT(n){let e={doc:n.doc,d:n.d,meta(){return n.computedMeta}},t=[f5(),h5(),m5()];t.forEach(({before:i})=>i?.(e)),t.forEach(({after:i})=>i?.(e))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});ll.subscribe(()=>{let n=ll.getSnapshot(),e=new Map;for(let[t]of n)e.set(t,t.documentElement.style.overflow);for(let t of n.values()){let i=e.get(t.doc)==="hidden",a=t.count!==0;(a&&!i||!a&&i)&&ll.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&ll.dispatch("TEARDOWN",t)}});function p5(n,e,t=()=>({containers:[]})){let i=c5(ll),a=e?i.get(e):void 0,l=a?a.count>0:!1;return Yr(()=>{if(!(!e||!n))return ll.dispatch("PUSH",e,t),()=>ll.dispatch("POP",e,t)},[n,e]),l}function g5(n,e,t=()=>[document.body]){let i=_d(n,"scroll-lock");p5(i,e,a=>{var l;return{containers:[...(l=a.containers)!=null?l:[],t]}})}function y5(n=0){let[e,t]=m.useState(n),i=m.useCallback(f=>t(f),[]),a=m.useCallback(f=>t(g=>g|f),[]),l=m.useCallback(f=>(e&f)===f,[e]),u=m.useCallback(f=>t(g=>g&~f),[]),h=m.useCallback(f=>t(g=>g^f),[]);return{flags:e,setFlag:i,addFlag:a,hasFlag:l,removeFlag:u,toggleFlag:h}}var b5={},T1,k1;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((T1=process==null?void 0:b5)==null?void 0:T1.NODE_ENV)==="test"&&typeof((k1=Element?.prototype)==null?void 0:k1.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` -`)),[]});var v5=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(v5||{});function x5(n){let e={};for(let t in n)n[t]===!0&&(e[`data-${t}`]="");return e}function _5(n,e,t,i){let[a,l]=m.useState(t),{hasFlag:u,addFlag:h,removeFlag:f}=y5(n&&a?3:0),g=m.useRef(!1),w=m.useRef(!1),S=Jf();return Yr(()=>{var A;if(n){if(t&&l(!0),!e){t&&h(3);return}return(A=i?.start)==null||A.call(i,t),w5(e,{inFlight:g,prepare(){w.current?w.current=!1:w.current=g.current,g.current=!0,!w.current&&(t?(h(3),f(4)):(h(4),f(2)))},run(){w.current?t?(f(3),h(4)):(f(4),h(3)):t?f(1):h(1)},done(){var C;w.current&&k5(e)||(g.current=!1,f(7),t||l(!1),(C=i?.end)==null||C.call(i,t))}})}},[n,t,e,S]),n?[a,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function w5(n,{prepare:e,run:t,done:i,inFlight:a}){let l=Ba();return T5(n,{prepare:e,inFlight:a}),l.nextFrame(()=>{t(),l.requestAnimationFrame(()=>{l.add(S5(n,i))})}),l.dispose}function S5(n,e){var t,i;let a=Ba();if(!n)return a.dispose;let l=!1;a.add(()=>{l=!0});let u=(i=(t=n.getAnimations)==null?void 0:t.call(n).filter(h=>h instanceof CSSTransition))!=null?i:[];return u.length===0?(e(),a.dispose):(Promise.allSettled(u.map(h=>h.finished)).then(()=>{l||e()}),a.dispose)}function T5(n,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let i=n.style.transition;n.style.transition="none",t(),n.offsetHeight,n.style.transition=i}function k5(n){var e,t;return((t=(e=n.getAnimations)==null?void 0:e.call(n))!=null?t:[]).some(i=>i instanceof CSSTransition&&i.playState!=="finished")}function gy(n,e){let t=m.useRef([]),i=wi(n);m.useEffect(()=>{let a=[...t.current];for(let[l,u]of e.entries())if(t.current[l]!==u){let h=i(e,a);return t.current=e,h}},[i,...e])}let em=m.createContext(null);em.displayName="OpenClosedContext";var Ls=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Ls||{});function tm(){return m.useContext(em)}function E5({value:n,children:e}){return fn.createElement(em.Provider,{value:n},e)}function C5({children:n}){return fn.createElement(em.Provider,{value:null},n)}function A5(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let ko=[];A5(()=>{function n(e){if(!Co(e.target)||e.target===document.body||ko[0]===e.target)return;let t=e.target;t=t.closest(_f),ko.unshift(t??e.target),ko=ko.filter(i=>i!=null&&i.isConnected),ko.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function gw(n){let e=wi(n),t=m.useRef(!1);m.useEffect(()=>(t.current=!1,()=>{t.current=!0,Zf(()=>{t.current&&e()})}),[e])}let yw=m.createContext(!1);function N5(){return m.useContext(yw)}function E1(n){return fn.createElement(yw.Provider,{value:n.force},n.children)}function D5(n){let e=N5(),t=m.useContext(vw),[i,a]=m.useState(()=>{var l;if(!e&&t!==null)return(l=t.current)!=null?l:null;if(aa.isServer)return null;let u=n?.getElementById("headlessui-portal-root");if(u)return u;if(n===null)return null;let h=n.createElement("div");return h.setAttribute("id","headlessui-portal-root"),n.body.appendChild(h)});return m.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),m.useEffect(()=>{e||t!==null&&a(t.current)},[t,a,e]),i}let bw=m.Fragment,M5=Zr(function(n,e){let{ownerDocument:t=null,...i}=n,a=m.useRef(null),l=ca(DC(A=>{a.current=A}),e),u=py(a.current),h=t??u,f=D5(h),g=m.useContext(jg),w=Jf(),S=Es();return gw(()=>{var A;f&&f.childNodes.length<=0&&((A=f.parentElement)==null||A.removeChild(f))}),f?vu.createPortal(fn.createElement("div",{"data-headlessui-portal":"",ref:A=>{w.dispose(),g&&A&&w.add(g.register(A))}},S({ourProps:{ref:l},theirProps:i,slot:{},defaultTag:bw,name:"Portal"})),f):null});function R5(n,e){let t=ca(e),{enabled:i=!0,ownerDocument:a,...l}=n,u=Es();return i?fn.createElement(M5,{...l,ownerDocument:a,ref:t}):u({ourProps:{ref:t},theirProps:l,slot:{},defaultTag:bw,name:"Portal"})}let j5=m.Fragment,vw=m.createContext(null);function O5(n,e){let{target:t,...i}=n,a={ref:ca(e)},l=Es();return fn.createElement(vw.Provider,{value:t},l({ourProps:a,theirProps:i,defaultTag:j5,name:"Popover.Group"}))}let jg=m.createContext(null);function L5(){let n=m.useContext(jg),e=m.useRef([]),t=wi(l=>(e.current.push(l),n&&n.register(l),()=>i(l))),i=wi(l=>{let u=e.current.indexOf(l);u!==-1&&e.current.splice(u,1),n&&n.unregister(l)}),a=m.useMemo(()=>({register:t,unregister:i,portals:e}),[t,i,e]);return[e,m.useMemo(()=>function({children:l}){return fn.createElement(jg.Provider,{value:a},l)},[a])]}let I5=Zr(R5),xw=Zr(O5),B5=Object.assign(I5,{Group:xw});function P5(n,e=typeof document<"u"?document.defaultView:null,t){let i=_d(n,"escape");pw(e,"keydown",a=>{i&&(a.defaultPrevented||a.key===sw.Escape&&t(a))})}function F5(){var n;let[e]=m.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[t,i]=m.useState((n=e?.matches)!=null?n:!1);return Yr(()=>{if(!e)return;function a(l){i(l.matches)}return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[e]),t}function U5({defaultContainers:n=[],portals:e,mainTreeNode:t}={}){let i=wi(()=>{var a,l;let u=vd(t),h=[];for(let f of n)f!==null&&(Ao(f)?h.push(f):"current"in f&&Ao(f.current)&&h.push(f.current));if(e!=null&&e.current)for(let f of e.current)h.push(f);for(let f of(a=u?.querySelectorAll("html > *, body > *"))!=null?a:[])f!==document.body&&f!==document.head&&Ao(f)&&f.id!=="headlessui-portal-root"&&(t&&(f.contains(t)||f.contains((l=t?.getRootNode())==null?void 0:l.host))||h.some(g=>f.contains(g))||h.push(f));return h});return{resolveContainers:i,contains:wi(a=>i().some(l=>l.contains(a)))}}let _w=m.createContext(null);function C1({children:n,node:e}){let[t,i]=m.useState(null),a=ww(e??t);return fn.createElement(_w.Provider,{value:a},n,a===null&&fn.createElement(Dg,{features:xf.Hidden,ref:l=>{var u,h;if(l){for(let f of(h=(u=vd(l))==null?void 0:u.querySelectorAll("html > *, body > *"))!=null?h:[])if(f!==document.body&&f!==document.head&&Ao(f)&&f!=null&&f.contains(l)){i(f);break}}}}))}function ww(n=null){var e;return(e=m.useContext(_w))!=null?e:n}function z5(){let n=typeof document>"u";return"useSyncExternalStore"in o1?(e=>e.useSyncExternalStore)(o1)(()=>()=>{},()=>!1,()=>!n):!1}function nm(){let n=z5(),[e,t]=m.useState(aa.isHandoffComplete);return e&&aa.isHandoffComplete===!1&&t(!1),m.useEffect(()=>{e!==!0&&t(!0)},[e]),m.useEffect(()=>aa.handoff(),[]),n?!1:e}function yy(){let n=m.useRef(!1);return Yr(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var Kc=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Kc||{});function H5(){let n=m.useRef(0);return mw(!0,"keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function Sw(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let e=new Set;for(let t of n.current)Ao(t.current)&&e.add(t.current);return e}let $5="div";var al=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(al||{});function q5(n,e){let t=m.useRef(null),i=ca(t,e),{initialFocus:a,initialFocusFallback:l,containers:u,features:h=15,...f}=n;nm()||(h=0);let g=py(t.current);W5(h,{ownerDocument:g});let w=X5(h,{ownerDocument:g,container:t,initialFocus:a,initialFocusFallback:l});Y5(h,{ownerDocument:g,container:t,containers:u,previousActiveElement:w});let S=H5(),A=wi(W=>{if(!gl(t.current))return;let H=t.current;(ie=>ie())(()=>{La(S.current,{[Kc.Forwards]:()=>{Jc(H,Da.First,{skipElements:[W.relatedTarget,l]})},[Kc.Backwards]:()=>{Jc(H,Da.Last,{skipElements:[W.relatedTarget,l]})}})})}),C=_d(!!(h&2),"focus-trap#tab-lock"),j=Jf(),k=m.useRef(!1),B={ref:i,onKeyDown(W){W.key=="Tab"&&(k.current=!0,j.requestAnimationFrame(()=>{k.current=!1}))},onBlur(W){if(!(h&4))return;let H=Sw(u);gl(t.current)&&H.add(t.current);let ie=W.relatedTarget;Co(ie)&&ie.dataset.headlessuiFocusGuard!=="true"&&(Tw(H,ie)||(k.current?Jc(t.current,La(S.current,{[Kc.Forwards]:()=>Da.Next,[Kc.Backwards]:()=>Da.Previous})|Da.WrapAround,{relativeTo:W.target}):Co(W.target)&&ja(W.target)))}},V=Es();return fn.createElement(fn.Fragment,null,C&&fn.createElement(Dg,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:A,features:xf.Focusable}),V({ourProps:B,theirProps:f,defaultTag:$5,name:"FocusTrap"}),C&&fn.createElement(Dg,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:A,features:xf.Focusable}))}let V5=Zr(q5),G5=Object.assign(V5,{features:al});function K5(n=!0){let e=m.useRef(ko.slice());return gy(([t],[i])=>{i===!0&&t===!1&&Zf(()=>{e.current.splice(0)}),i===!1&&t===!0&&(e.current=ko.slice())},[n,ko,e]),wi(()=>{var t;return(t=e.current.find(i=>i!=null&&i.isConnected))!=null?t:null})}function W5(n,{ownerDocument:e}){let t=!!(n&8),i=K5(t);gy(()=>{t||gC(e?.body)&&ja(i())},[t]),gw(()=>{t&&ja(i())})}function X5(n,{ownerDocument:e,container:t,initialFocus:i,initialFocusFallback:a}){let l=m.useRef(null),u=_d(!!(n&1),"focus-trap#initial-focus"),h=yy();return gy(()=>{if(n===0)return;if(!u){a!=null&&a.current&&ja(a.current);return}let f=t.current;f&&Zf(()=>{if(!h.current)return;let g=e?.activeElement;if(i!=null&&i.current){if(i?.current===g){l.current=g;return}}else if(f.contains(g)){l.current=g;return}if(i!=null&&i.current)ja(i.current);else{if(n&16){if(Jc(f,Da.First|Da.AutoFocus)!==Rg.Error)return}else if(Jc(f,Da.First)!==Rg.Error)return;if(a!=null&&a.current&&(ja(a.current),e?.activeElement===a.current))return;console.warn("There are no focusable elements inside the ")}l.current=e?.activeElement})},[a,u,n]),l}function Y5(n,{ownerDocument:e,container:t,containers:i,previousActiveElement:a}){let l=yy(),u=!!(n&4);pw(e?.defaultView,"focus",h=>{if(!u||!l.current)return;let f=Sw(i);gl(t.current)&&f.add(t.current);let g=a.current;if(!g)return;let w=h.target;gl(w)?Tw(f,w)?(a.current=w,ja(w)):(h.preventDefault(),h.stopPropagation(),ja(g)):ja(a.current)},!0)}function Tw(n,e){for(let t of n)if(t.contains(e))return!0;return!1}function kw(n){var e;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||!Qc((e=n.as)!=null?e:Cw)||fn.Children.count(n.children)===1}let im=m.createContext(null);im.displayName="TransitionContext";var Q5=(n=>(n.Visible="visible",n.Hidden="hidden",n))(Q5||{});function Z5(){let n=m.useContext(im);if(n===null)throw new Error("A is used but it is missing a parent or .");return n}function J5(){let n=m.useContext(rm);if(n===null)throw new Error("A is used but it is missing a parent or .");return n}let rm=m.createContext(null);rm.displayName="NestingContext";function sm(n){return"children"in n?sm(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Ew(n,e){let t=_l(n),i=m.useRef([]),a=yy(),l=Jf(),u=wi((C,j=Eo.Hidden)=>{let k=i.current.findIndex(({el:B})=>B===C);k!==-1&&(La(j,{[Eo.Unmount](){i.current.splice(k,1)},[Eo.Hidden](){i.current[k].state="hidden"}}),l.microTask(()=>{var B;!sm(i)&&a.current&&((B=t.current)==null||B.call(t))}))}),h=wi(C=>{let j=i.current.find(({el:k})=>k===C);return j?j.state!=="visible"&&(j.state="visible"):i.current.push({el:C,state:"visible"}),()=>u(C,Eo.Unmount)}),f=m.useRef([]),g=m.useRef(Promise.resolve()),w=m.useRef({enter:[],leave:[]}),S=wi((C,j,k)=>{f.current.splice(0),e&&(e.chains.current[j]=e.chains.current[j].filter(([B])=>B!==C)),e?.chains.current[j].push([C,new Promise(B=>{f.current.push(B)})]),e?.chains.current[j].push([C,new Promise(B=>{Promise.all(w.current[j].map(([V,W])=>W)).then(()=>B())})]),j==="enter"?g.current=g.current.then(()=>e?.wait.current).then(()=>k(j)):k(j)}),A=wi((C,j,k)=>{Promise.all(w.current[j].splice(0).map(([B,V])=>V)).then(()=>{var B;(B=f.current.shift())==null||B()}).then(()=>k(j))});return m.useMemo(()=>({children:i,register:h,unregister:u,onStart:S,onStop:A,wait:g,chains:w}),[h,u,i,S,A,w,g])}let Cw=m.Fragment,Aw=vf.RenderStrategy;function eA(n,e){var t,i;let{transition:a=!0,beforeEnter:l,afterEnter:u,beforeLeave:h,afterLeave:f,enter:g,enterFrom:w,enterTo:S,entered:A,leave:C,leaveFrom:j,leaveTo:k,...B}=n,[V,W]=m.useState(null),H=m.useRef(null),ie=kw(n),Y=ca(...ie?[H,e,W]:e===null?[]:[e]),G=(t=B.unmount)==null||t?Eo.Unmount:Eo.Hidden,{show:O,appear:re,initial:E}=Z5(),[R,ee]=m.useState(O?"visible":"hidden"),q=J5(),{register:Q,unregister:ue}=q;Yr(()=>Q(H),[Q,H]),Yr(()=>{if(G===Eo.Hidden&&H.current){if(O&&R!=="visible"){ee("visible");return}return La(R,{hidden:()=>ue(H),visible:()=>Q(H)})}},[R,H,Q,ue,O,G]);let se=nm();Yr(()=>{if(ie&&se&&R==="visible"&&H.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[H,R,se,ie]);let $=E&&!re,F=re&&O&&E,X=m.useRef(!1),le=Ew(()=>{X.current||(ee("hidden"),ue(H))},q),de=wi(Te=>{X.current=!0;let _t=Te?"enter":"leave";le.onStart(H,_t,dt=>{dt==="enter"?l?.():dt==="leave"&&h?.()})}),L=wi(Te=>{let _t=Te?"enter":"leave";X.current=!1,le.onStop(H,_t,dt=>{dt==="enter"?u?.():dt==="leave"&&f?.()}),_t==="leave"&&!sm(le)&&(ee("hidden"),ue(H))});m.useEffect(()=>{ie&&a||(de(O),L(O))},[O,ie,a]);let pe=!(!a||!ie||!se||$),[,we]=_5(pe,V,O,{start:de,end:L}),Be=il({ref:Y,className:((i=Ng(B.className,F&&g,F&&w,we.enter&&g,we.enter&&we.closed&&w,we.enter&&!we.closed&&S,we.leave&&C,we.leave&&!we.closed&&j,we.leave&&we.closed&&k,!we.transition&&O&&A))==null?void 0:i.trim())||void 0,...x5(we)}),Ve=0;R==="visible"&&(Ve|=Ls.Open),R==="hidden"&&(Ve|=Ls.Closed),O&&R==="hidden"&&(Ve|=Ls.Opening),!O&&R==="visible"&&(Ve|=Ls.Closing);let Oe=Es();return fn.createElement(rm.Provider,{value:le},fn.createElement(E5,{value:Ve},Oe({ourProps:Be,theirProps:B,defaultTag:Cw,features:Aw,visible:R==="visible",name:"Transition.Child"})))}function tA(n,e){let{show:t,appear:i=!1,unmount:a=!0,...l}=n,u=m.useRef(null),h=kw(n),f=ca(...h?[u,e]:e===null?[]:[e]);nm();let g=tm();if(t===void 0&&g!==null&&(t=(g&Ls.Open)===Ls.Open),t===void 0)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[w,S]=m.useState(t?"visible":"hidden"),A=Ew(()=>{t||S("hidden")}),[C,j]=m.useState(!0),k=m.useRef([t]);Yr(()=>{C!==!1&&k.current[k.current.length-1]!==t&&(k.current.push(t),j(!1))},[k,t]);let B=m.useMemo(()=>({show:t,appear:i,initial:C}),[t,i,C]);Yr(()=>{t?S("visible"):!sm(A)&&u.current!==null&&S("hidden")},[t,A]);let V={unmount:a},W=wi(()=>{var Y;C&&j(!1),(Y=n.beforeEnter)==null||Y.call(n)}),H=wi(()=>{var Y;C&&j(!1),(Y=n.beforeLeave)==null||Y.call(n)}),ie=Es();return fn.createElement(rm.Provider,{value:A},fn.createElement(im.Provider,{value:B},ie({ourProps:{...V,as:m.Fragment,children:fn.createElement(Nw,{ref:f,...V,...l,beforeEnter:W,beforeLeave:H})},theirProps:{},defaultTag:m.Fragment,features:Aw,visible:w==="visible",name:"Transition"})))}function nA(n,e){let t=m.useContext(im)!==null,i=tm()!==null;return fn.createElement(fn.Fragment,null,!t&&i?fn.createElement(Og,{ref:e,...n}):fn.createElement(Nw,{ref:e,...n}))}let Og=Zr(tA),Nw=Zr(eA),by=Zr(nA),ed=Object.assign(Og,{Child:by,Root:Og});var iA=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(iA||{}),rA=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(rA||{});let sA={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},vy=m.createContext(null);vy.displayName="DialogContext";function am(n){let e=m.useContext(vy);if(e===null){let t=new Error(`<${n} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,am),t}return e}function aA(n,e){return La(e.type,sA,n,e)}let A1=Zr(function(n,e){let t=m.useId(),{id:i=`headlessui-dialog-${t}`,open:a,onClose:l,initialFocus:u,role:h="dialog",autoFocus:f=!0,__demoMode:g=!1,unmount:w=!1,...S}=n,A=m.useRef(!1);h=(function(){return h==="dialog"||h==="alertdialog"?h:(A.current||(A.current=!0,console.warn(`Invalid role [${h}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let C=tm();a===void 0&&C!==null&&(a=(C&Ls.Open)===Ls.Open);let j=m.useRef(null),k=ca(j,e),B=py(j.current),V=a?0:1,[W,H]=m.useReducer(aA,{titleId:null,descriptionId:null,panelRef:m.createRef()}),ie=wi(()=>l(!1)),Y=wi(we=>H({type:0,id:we})),G=nm()?V===0:!1,[O,re]=L5(),E={get current(){var we;return(we=W.panelRef.current)!=null?we:j.current}},R=ww(),{resolveContainers:ee}=U5({mainTreeNode:R,portals:O,defaultContainers:[E]}),q=C!==null?(C&Ls.Closing)===Ls.Closing:!1;QC(g||q?!1:G,{allowed:wi(()=>{var we,Be;return[(Be=(we=j.current)==null?void 0:we.closest("[data-headlessui-portal]"))!=null?Be:null]}),disallowed:wi(()=>{var we;return[(we=R?.closest("body > *:not(#headlessui-portal-root)"))!=null?we:null]})});let Q=cw.get(null);Yr(()=>{if(G)return Q.actions.push(i),()=>Q.actions.pop(i)},[Q,i,G]);let ue=dw(Q,m.useCallback(we=>Q.selectors.isTop(we,i),[Q,i]));u5(ue,ee,we=>{we.preventDefault(),ie()}),P5(ue,B?.defaultView,we=>{we.preventDefault(),we.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),ie()}),g5(g||q?!1:G,B,ee),ZC(G,j,ie);let[se,$]=MC(),F=m.useMemo(()=>[{dialogState:V,close:ie,setTitleId:Y,unmount:w},W],[V,ie,Y,w,W]),X=xd({open:V===0}),le={ref:k,id:i,role:h,tabIndex:-1,"aria-modal":g?void 0:V===0?!0:void 0,"aria-labelledby":W.titleId,"aria-describedby":se,unmount:w},de=!F5(),L=al.None;G&&!g&&(L|=al.RestoreFocus,L|=al.TabLock,f&&(L|=al.AutoFocus),de&&(L|=al.InitialFocus));let pe=Es();return fn.createElement(C5,null,fn.createElement(E1,{force:!0},fn.createElement(B5,null,fn.createElement(vy.Provider,{value:F},fn.createElement(xw,{target:j},fn.createElement(E1,{force:!1},fn.createElement($,{slot:X},fn.createElement(re,null,fn.createElement(G5,{initialFocus:u,initialFocusFallback:j,containers:ee,features:L},fn.createElement(BC,{value:ie},pe({ourProps:le,theirProps:S,slot:X,defaultTag:oA,features:lA,visible:V===0,name:"Dialog"})))))))))))}),oA="div",lA=vf.RenderStrategy|vf.Static;function uA(n,e){let{transition:t=!1,open:i,...a}=n,l=tm(),u=n.hasOwnProperty("open")||l!==null,h=n.hasOwnProperty("onClose");if(!u&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!u)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!h)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!l&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(i!==void 0||t)&&!a.static?fn.createElement(C1,null,fn.createElement(ed,{show:i,transition:t,unmount:a.unmount},fn.createElement(A1,{ref:e,...a}))):fn.createElement(C1,null,fn.createElement(A1,{ref:e,open:i,...a}))}let cA="div";function dA(n,e){let t=m.useId(),{id:i=`headlessui-dialog-panel-${t}`,transition:a=!1,...l}=n,[{dialogState:u,unmount:h},f]=am("Dialog.Panel"),g=ca(e,f.panelRef),w=xd({open:u===0}),S=wi(B=>{B.stopPropagation()}),A={ref:g,id:i,onClick:S},C=a?by:m.Fragment,j=a?{unmount:h}:{},k=Es();return fn.createElement(C,{...j},k({ourProps:A,theirProps:l,slot:w,defaultTag:cA,name:"Dialog.Panel"}))}let hA="div";function fA(n,e){let{transition:t=!1,...i}=n,[{dialogState:a,unmount:l}]=am("Dialog.Backdrop"),u=xd({open:a===0}),h={ref:e,"aria-hidden":!0},f=t?by:m.Fragment,g=t?{unmount:l}:{},w=Es();return fn.createElement(f,{...g},w({ourProps:h,theirProps:i,slot:u,defaultTag:hA,name:"Dialog.Backdrop"}))}let mA="h2";function pA(n,e){let t=m.useId(),{id:i=`headlessui-dialog-title-${t}`,...a}=n,[{dialogState:l,setTitleId:u}]=am("Dialog.Title"),h=ca(e);m.useEffect(()=>(u(i),()=>u(null)),[i,u]);let f=xd({open:l===0}),g={ref:h,id:i};return Es()({ourProps:g,theirProps:a,slot:f,defaultTag:mA,name:"Dialog.Title"})}let gA=Zr(uA),yA=Zr(dA);Zr(fA);let bA=Zr(pA),lu=Object.assign(gA,{Panel:yA,Title:bA,Description:LC});function vA({open:n,onClose:e,onApply:t,initialCookies:i}){const[a,l]=m.useState(""),[u,h]=m.useState(""),[f,g]=m.useState([]),w=m.useRef(!1);m.useEffect(()=>{n&&!w.current&&(l(""),h(""),g(i??[])),w.current=n},[n,i]);function S(){const j=a.trim(),k=u.trim();!j||!k||(g(B=>[...B.filter(W=>W.name!==j),{name:j,value:k}]),l(""),h(""))}function A(j){g(k=>k.filter(B=>B.name!==j))}function C(){t(f),e()}return c.jsxs(lu,{open:n,onClose:e,className:"relative z-50",children:[c.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":"true"}),c.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:c.jsxs(lu.Panel,{className:"w-full max-w-lg rounded-lg bg-white dark:bg-gray-800 p-6 shadow-xl dark:outline dark:-outline-offset-1 dark:outline-white/10",children:[c.jsx(lu.Title,{className:"text-base font-semibold text-gray-900 dark:text-white",children:"Zusätzliche Cookies"}),c.jsxs("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-3 gap-2",children:[c.jsx("input",{value:a,onChange:j=>l(j.target.value),placeholder:"Name (z. B. cf_clearance)",className:"col-span-1 truncate rounded-md px-3 py-2 text-sm bg-white text-gray-900 dark:bg-white/10 dark:text-white"}),c.jsx("input",{value:u,onChange:j=>h(j.target.value),placeholder:"Wert",className:"col-span-1 truncate sm:col-span-2 rounded-md px-3 py-2 text-sm bg-white text-gray-900 dark:bg-white/10 dark:text-white"})]}),c.jsx("div",{className:"mt-2",children:c.jsx(hn,{size:"sm",variant:"secondary",onClick:S,disabled:!a.trim()||!u.trim(),children:"Hinzufügen"})}),c.jsx("div",{className:"mt-4",children:f.length===0?c.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Noch keine Cookies hinzugefügt."}):c.jsxs("table",{className:"min-w-full text-sm border divide-y dark:divide-white/10",children:[c.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Name"}),c.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Wert"}),c.jsx("th",{className:"px-3 py-2"})]})}),c.jsx("tbody",{className:"divide-y dark:divide-white/10",children:f.map(j=>c.jsxs("tr",{children:[c.jsx("td",{className:"px-3 py-2 font-mono",children:j.name}),c.jsx("td",{className:"px-3 py-2 truncate max-w-[240px]",children:j.value}),c.jsx("td",{className:"px-3 py-2 text-right",children:c.jsx("button",{onClick:()=>A(j.name),className:"text-xs text-red-600 hover:underline dark:text-red-400",children:"Entfernen"})})]},j.name))})]})}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx(hn,{variant:"secondary",onClick:e,children:"Abbrechen"}),c.jsx(hn,{variant:"primary",onClick:C,children:"Übernehmen"})]})]})})]})}function xA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const _A=m.forwardRef(xA);function Lg({tabs:n,value:e,onChange:t,className:i,ariaLabel:a="Ansicht auswählen",variant:l="underline",hideCountUntilMd:u=!1}){if(!n?.length)return null;const h=n.find(A=>A.id===e)??n[0],f=gn("col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-2 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 dark:text-gray-100 dark:outline-white/10 dark:*:bg-gray-800 dark:focus:outline-indigo-500",l==="pillsBrand"?"dark:bg-gray-800/50":"dark:bg-white/5"),g=A=>gn(A?"bg-indigo-100 text-indigo-600 dark:bg-indigo-500/20 dark:text-indigo-400":"bg-gray-100 text-gray-900 dark:bg-white/10 dark:text-gray-300",u?"ml-3 hidden rounded-full px-2.5 py-0.5 text-xs font-medium md:inline-block":"ml-3 rounded-full px-2.5 py-0.5 text-xs font-medium"),w=(A,C)=>C.count===void 0?null:c.jsx("span",{className:g(A),children:C.count}),S=()=>{switch(l){case"underline":case"underlineIcons":return c.jsx("div",{className:"border-b border-gray-200 dark:border-white/10",children:c.jsx("nav",{"aria-label":a,className:"-mb-px flex space-x-8",children:n.map(A=>{const C=A.id===h.id,j=!!A.disabled;return c.jsxs("button",{type:"button",onClick:()=>!j&&t(A.id),disabled:j,"aria-current":C?"page":void 0,className:gn(C?"border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-white/20 dark:hover:text-gray-200",l==="underlineIcons"?"group inline-flex items-center border-b-2 px-1 py-4 text-sm font-medium":"flex items-center border-b-2 px-1 py-4 text-sm font-medium whitespace-nowrap",j&&"cursor-not-allowed opacity-50 hover:border-transparent hover:text-gray-500 dark:hover:text-gray-400"),children:[l==="underlineIcons"&&A.icon?c.jsx(A.icon,{"aria-hidden":"true",className:gn(C?"text-indigo-500 dark:text-indigo-400":"text-gray-400 group-hover:text-gray-500 dark:text-gray-500 dark:group-hover:text-gray-400","mr-2 -ml-0.5 size-5")}):null,c.jsx("span",{children:A.label}),w(C,A)]},A.id)})})});case"pills":case"pillsGray":case"pillsBrand":{const A=l==="pills"?"bg-gray-100 text-gray-700 dark:bg-white/10 dark:text-gray-200":l==="pillsGray"?"bg-gray-200 text-gray-800 dark:bg-white/10 dark:text-white":"bg-indigo-100 text-indigo-700 dark:bg-indigo-500/20 dark:text-indigo-300",C=l==="pills"?"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200":l==="pillsGray"?"text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-white":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200";return c.jsx("nav",{"aria-label":a,className:"flex space-x-4",children:n.map(j=>{const k=j.id===h.id,B=!!j.disabled;return c.jsxs("button",{type:"button",onClick:()=>!B&&t(j.id),disabled:B,"aria-current":k?"page":void 0,className:gn(k?A:C,"inline-flex items-center rounded-md px-3 py-2 text-sm font-medium",B&&"cursor-not-allowed opacity-50 hover:text-inherit"),children:[c.jsx("span",{children:j.label}),j.count!==void 0?c.jsx("span",{className:gn(k?"ml-2 bg-white/70 text-gray-900 dark:bg-white/10 dark:text-white":"ml-2 bg-gray-100 text-gray-900 dark:bg-white/10 dark:text-gray-300","rounded-full px-2 py-0.5 text-xs font-medium"),children:j.count}):null]},j.id)})})}case"fullWidthUnderline":return c.jsx("div",{className:"border-b border-gray-200 dark:border-white/10",children:c.jsx("nav",{"aria-label":a,className:"-mb-px flex",children:n.map(A=>{const C=A.id===h.id,j=!!A.disabled;return c.jsx("button",{type:"button",onClick:()=>!j&&t(A.id),disabled:j,"aria-current":C?"page":void 0,className:gn(C?"border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-white/20 dark:hover:text-gray-300","flex-1 border-b-2 px-1 py-4 text-center text-sm font-medium",j&&"cursor-not-allowed opacity-50 hover:border-transparent hover:text-gray-500 dark:hover:text-gray-400"),children:A.label},A.id)})})});case"barUnderline":return c.jsx("nav",{"aria-label":a,className:"isolate flex divide-x divide-gray-200 rounded-lg bg-white shadow-sm dark:divide-white/10 dark:bg-gray-800/50 dark:shadow-none dark:outline dark:-outline-offset-1 dark:outline-white/10",children:n.map((A,C)=>{const j=A.id===h.id,k=!!A.disabled;return c.jsxs("button",{type:"button",onClick:()=>!k&&t(A.id),disabled:k,"aria-current":j?"page":void 0,className:gn(j?"text-gray-900 dark:text-white":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white",C===0?"rounded-l-lg":"",C===n.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 overflow-hidden px-4 py-4 text-center text-sm font-medium hover:bg-gray-50 focus:z-10 dark:hover:bg-white/5",k&&"cursor-not-allowed opacity-50 hover:bg-transparent hover:text-gray-500 dark:hover:text-gray-400"),children:[c.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center justify-center",children:[c.jsx("span",{className:"min-w-0 truncate whitespace-nowrap",title:A.label,children:A.label}),A.count!==void 0?c.jsx("span",{className:"ml-2 shrink-0 tabular-nums min-w-[2.25rem] rounded-full bg-white/70 px-2 py-0.5 text-center text-xs font-medium text-gray-900 dark:bg-white/10 dark:text-white",children:A.count}):null]}),c.jsx("span",{"aria-hidden":"true",className:gn(j?"bg-indigo-500 dark:bg-indigo-400":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},A.id)})});case"simple":return c.jsx("nav",{className:"flex border-b border-gray-200 py-4 dark:border-white/10","aria-label":a,children:c.jsx("ul",{role:"list",className:"flex min-w-full flex-none gap-x-8 px-2 text-sm/6 font-semibold text-gray-500 dark:text-gray-400",children:n.map(A=>{const C=A.id===h.id,j=!!A.disabled;return c.jsx("li",{children:c.jsx("button",{type:"button",onClick:()=>!j&&t(A.id),disabled:j,"aria-current":C?"page":void 0,className:gn(C?"text-indigo-600 dark:text-indigo-400":"hover:text-gray-700 dark:hover:text-white",j&&"cursor-not-allowed opacity-50 hover:text-inherit"),children:A.label})},A.id)})})});default:return null}};return c.jsxs("div",{className:i,children:[c.jsxs("div",{className:"grid grid-cols-1 sm:hidden",children:[c.jsx("select",{value:h.id,onChange:A=>t(A.target.value),"aria-label":a,className:f,children:n.map(A=>c.jsx("option",{value:A.id,children:A.label},A.id))}),c.jsx(_A,{"aria-hidden":"true",className:"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end fill-gray-500 dark:fill-gray-400"})]}),c.jsx("div",{className:"hidden sm:block",children:S()})]})}function Is({header:n,footer:e,grayBody:t=!1,grayFooter:i=!1,edgeToEdgeMobile:a=!1,well:l=!1,noBodyPadding:u=!1,className:h,bodyClassName:f,children:g}){const w=l;return c.jsxs("div",{className:gn("overflow-hidden",a?"sm:rounded-lg":"rounded-lg",w?"bg-gray-50 dark:bg-gray-800 shadow-none":"bg-white shadow-sm dark:bg-gray-800 dark:shadow-none dark:outline dark:-outline-offset-1 dark:outline-white/10",h),children:[n&&c.jsx("div",{className:"shrink-0 px-4 py-5 sm:px-6 border-b border-gray-200 dark:border-white/10",children:n}),c.jsx("div",{className:gn("min-h-0",u?"p-0":"px-4 py-5 sm:p-6",t&&"bg-gray-50 dark:bg-gray-800",f),children:g}),e&&c.jsx("div",{className:gn("shrink-0 px-4 py-4 sm:px-6",i&&"bg-gray-50 dark:bg-gray-800/50","border-t border-gray-200 dark:border-white/10"),children:e})]})}function Ig({checked:n,onChange:e,id:t,name:i,disabled:a,required:l,ariaLabel:u,ariaLabelledby:h,ariaDescribedby:f,size:g="default",variant:w="simple",className:S}){const A=j=>{a||e(j.target.checked)},C=gn("absolute inset-0 size-full appearance-none focus:outline-hidden",a&&"cursor-not-allowed");return g==="short"?c.jsxs("div",{className:gn("group relative inline-flex h-5 w-10 shrink-0 items-center justify-center rounded-full outline-offset-2 outline-indigo-600 has-focus-visible:outline-2 dark:outline-indigo-500",a&&"opacity-60",S),children:[c.jsx("span",{className:gn("absolute mx-auto h-4 w-9 rounded-full bg-gray-200 inset-ring inset-ring-gray-900/5 transition-colors duration-200 ease-in-out dark:bg-gray-800/50 dark:inset-ring-white/10",n&&"bg-indigo-600 dark:bg-indigo-500")}),c.jsx("span",{className:gn("absolute left-0 size-5 rounded-full border border-gray-300 bg-white shadow-xs transition-transform duration-200 ease-in-out dark:shadow-none",n&&"translate-x-5")}),c.jsx("input",{id:t,name:i,type:"checkbox",checked:n,onChange:A,disabled:a,required:l,"aria-label":u,"aria-labelledby":h,"aria-describedby":f,className:C})]}):c.jsxs("div",{className:gn("group relative inline-flex w-11 shrink-0 rounded-full bg-gray-200 p-0.5 inset-ring inset-ring-gray-900/5 outline-offset-2 outline-indigo-600 transition-colors duration-200 ease-in-out has-focus-visible:outline-2 dark:bg-white/5 dark:inset-ring-white/10 dark:outline-indigo-500",n&&"bg-indigo-600 dark:bg-indigo-500",a&&"opacity-60",S),children:[w==="icon"?c.jsxs("span",{className:gn("relative size-5 rounded-full bg-white shadow-xs ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out",n&&"translate-x-5"),children:[c.jsx("span",{"aria-hidden":"true",className:gn("absolute inset-0 flex size-full items-center justify-center transition-opacity ease-in",n?"opacity-0 duration-100":"opacity-100 duration-200"),children:c.jsx("svg",{fill:"none",viewBox:"0 0 12 12",className:"size-3 text-gray-400 dark:text-gray-600",children:c.jsx("path",{d:"M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}),c.jsx("span",{"aria-hidden":"true",className:gn("absolute inset-0 flex size-full items-center justify-center transition-opacity ease-out",n?"opacity-100 duration-200":"opacity-0 duration-100"),children:c.jsx("svg",{fill:"currentColor",viewBox:"0 0 12 12",className:"size-3 text-indigo-600 dark:text-indigo-500",children:c.jsx("path",{d:"M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"})})})]}):c.jsx("span",{className:gn("size-5 rounded-full bg-white shadow-xs ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out",n&&"translate-x-5")}),c.jsx("input",{id:t,name:i,type:"checkbox",checked:n,onChange:A,disabled:a,required:l,"aria-label":u,"aria-labelledby":h,"aria-describedby":f,className:C})]})}function Na({label:n,description:e,labelPosition:t="left",id:i,className:a,...l}){const u=m.useId(),h=i??`sw-${u}`,f=`${h}-label`,g=`${h}-desc`;return t==="right"?c.jsxs("div",{className:gn("flex items-center justify-between gap-3",a),children:[c.jsx(Ig,{...l,id:h,ariaLabelledby:f,ariaDescribedby:e?g:void 0}),c.jsxs("div",{className:"text-sm",children:[c.jsx("label",{id:f,htmlFor:h,className:"font-medium text-gray-900 dark:text-white",children:n})," ",e?c.jsx("span",{id:g,className:"text-gray-500 dark:text-gray-400",children:e}):null]})]}):c.jsxs("div",{className:gn("flex items-center justify-between",a),children:[c.jsxs("span",{className:"flex grow flex-col",children:[c.jsx("label",{id:f,htmlFor:h,className:"text-sm/6 font-medium text-gray-900 dark:text-white",children:n}),e?c.jsx("span",{id:g,className:"text-sm text-gray-500 dark:text-gray-400",children:e}):null]}),c.jsx(Ig,{...l,id:h,ariaLabelledby:f,ariaDescribedby:e?g:void 0})]})}const xu=new Map;let N1=!1;function wA(){N1||(N1=!0,document.addEventListener("visibilitychange",()=>{if(document.hidden)for(const n of xu.values())n.es&&(n.es.close(),n.es=null,n.dispatchers.clear());else for(const n of xu.values())n.refs>0&&!n.es&&Dw(n)}))}function Dw(n){if(!n.es&&!document.hidden){n.es=new EventSource(n.url);for(const[e,t]of n.listeners.entries()){const i=a=>{let l=null;try{l=JSON.parse(String(a.data??"null"))}catch{return}for(const u of t)u(l)};n.dispatchers.set(e,i),n.es.addEventListener(e,i)}n.es.onerror=()=>{}}}function SA(n){n.es&&(n.es.close(),n.es=null,n.dispatchers.clear())}function TA(n){let e=xu.get(n);return e||(e={url:n,es:null,refs:0,listeners:new Map,dispatchers:new Map},xu.set(n,e)),e}function Mw(n,e,t){wA();const i=TA(n);let a=i.listeners.get(e);if(a||(a=new Set,i.listeners.set(e,a)),a.add(t),i.refs+=1,i.es){if(!i.dispatchers.has(e)){const l=u=>{let h=null;try{h=JSON.parse(String(u.data??"null"))}catch{return}for(const f of i.listeners.get(e)??[])f(h)};i.dispatchers.set(e,l),i.es.addEventListener(e,l)}}else Dw(i);return()=>{const l=xu.get(n);if(!l)return;const u=l.listeners.get(e);u&&(u.delete(t),u.size===0&&l.listeners.delete(e)),l.refs=Math.max(0,l.refs-1),l.refs===0&&(SA(l),xu.delete(n))}}async function kA(n,e){const t=await fetch(n,{cache:"no-store",...e,headers:{"Content-Type":"application/json",...e?.headers||{}}});let i=null;try{i=await t.json()}catch{}if(!t.ok){const a=i&&(i.error||i.message)||t.statusText;throw new Error(a)}return i}function D1({startUrl:n,stopUrl:e,sseUrl:t,onTrigger:i,title:a="Task",description:l="Startet eine Hintergrundaufgabe. Fortschritt & Abbrechen oben in der Taskliste.",startLabel:u="Start",startingLabel:h="Starte…",disabled:f=!1,busy:g=!1,onFinished:w,onStart:S,onProgress:A,onDone:C,onCancelled:j,onError:k}){const[B,V]=m.useState(null),[W,H]=m.useState(!1),[ie,Y]=m.useState(null),G=m.useRef(null),O=m.useRef(!1),re=m.useRef(!1),E=m.useRef(!1),R=m.useRef(!1),ee=m.useRef(""),q=m.useRef(A),Q=m.useRef(k);m.useEffect(()=>{q.current=A},[A]),m.useEffect(()=>{Q.current=k},[k]);async function ue(){if(e&&!E.current){E.current=!0;try{await fetch(e,{method:"DELETE",cache:"no-store"})}catch{}finally{E.current=!1}}}function se(){if(G.current)return G.current;const le=new AbortController;G.current=le;const de=()=>{re.current=!0,ue()};return le.signal.addEventListener("abort",de,{once:!0}),le}function $(le){O.current||(O.current=!0,S?.(le))}m.useEffect(()=>{const le=R.current,de=!!B?.running;if(R.current=de,le&&!de){const L=String(B?.error??"").trim();G.current=null,O.current=!1,re.current||L==="abgebrochen"?(re.current=!1,j?.()):L||C?.(),w?.()}},[B?.running,B?.error,w,C,j]),m.useEffect(()=>{if(!t)return;const le=Mw(t,"state",de=>{if(V(de),de?.running){const pe=se();$(pe),q.current?.({done:de?.done??0,total:de?.total??0,currentFile:de?.currentFile??""})}const L=String(de?.error??"").trim();L&&L!=="abgebrochen"&&L!==ee.current&&(ee.current=L,Q.current?.(L))});return()=>le()},[t]);async function F(){if(g||B?.running)return;if(Y(null),H(!0),re.current=!1,ee.current="",i){try{await i()}catch(de){const L=de?.message??String(de);Y(L),k?.(L)}finally{H(!1)}return}if(!n){const de="Task ist nicht konfiguriert (startUrl fehlt).";Y(de),k?.(de),H(!1);return}const le=se();try{const de=await kA(n,{method:"POST"});V(de),$(le),de?.running&&A?.({done:de?.done??0,total:de?.total??0,currentFile:de?.currentFile??""})}catch(de){G.current=null,O.current=!1;const L=de?.message??String(de);Y(L),k?.(L)}finally{H(!1)}}const X=!!B?.running;return c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:a}),c.jsx("div",{className:"mt-0.5 text-xs text-gray-600 dark:text-gray-300",children:l}),ie?c.jsx("div",{className:"mt-2 text-xs text-red-700 dark:text-red-200",children:ie}):null]}),c.jsx("div",{className:"shrink-0",children:c.jsx(hn,{variant:"primary",onClick:F,disabled:f||g||W||X,children:W||g?h:u})})]})}function EA(n,e){const t=Number(n??0),i=Number(e??0);return!i||i<=0?0:Math.max(0,Math.min(100,Math.round(t/i*100)))}function CA({tasks:n,onCancel:e}){const t=(n||[]).filter(i=>i.status!=="idle");return c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-gray-950/40",children:[c.jsx("div",{className:"flex items-start justify-between gap-3",children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Hintergrundaufgaben"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Laufende Hintergrundaufgaben (z.B. Assets/Previews)."})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[t.length===0?c.jsx("div",{className:"rounded-xl border border-gray-200 bg-white px-3 py-2 text-sm text-gray-600 dark:border-white/10 dark:bg-white/5 dark:text-gray-300",children:"Keine laufenden Aufgaben."}):null,t.map(i=>{const a=EA(i.done,i.total),l=i.status==="running",u=l&&(i.total??0)>0,h=(i.title??"").trim(),f=(i.text??"").trim();return c.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white px-3 py-2 dark:border-white/10 dark:bg-white/5 transition-opacity duration-500 "+(i.fading?"opacity-0":"opacity-100"),children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"shrink-0",children:l&&i.cancellable&&e?c.jsx("button",{type:"button",onClick:()=>e?.(i.id),className:`inline-flex h-7 w-7 items-center justify-center rounded-md\r - text-red-700 hover:bg-red-50 hover:text-red-900\r - dark:text-red-300 dark:hover:bg-red-500/10 dark:hover:text-red-200`,title:"Abbrechen","aria-label":"Task abbrechen",children:"✕"}):i.status==="done"?c.jsx("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-green-700 dark:text-green-300",title:"Fertig","aria-label":"Fertig",children:"✓"}):c.jsx("span",{className:"inline-block h-7 w-7"})}),c.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:[c.jsxs("div",{className:"min-w-0 truncate text-sm font-semibold text-gray-900 dark:text-white",children:[h||"Aufgabe",f?c.jsxs("span",{className:"font-normal text-gray-600 dark:text-gray-300",children:[" · ",f]}):null]}),i.status==="done"?c.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-green-100 px-2 py-0.5 text-[11px] font-semibold text-green-800 ring-1 ring-inset ring-green-200 dark:bg-green-500/20 dark:text-green-200 dark:ring-green-400/30",children:"fertig"}):i.status==="cancelled"?c.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-semibold text-gray-700 ring-1 ring-inset ring-gray-200 dark:bg-white/10 dark:text-gray-200 dark:ring-white/10",children:"abgebrochen"}):i.status==="error"?c.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-red-100 px-2 py-0.5 text-[11px] font-semibold text-red-800 ring-1 ring-inset ring-red-200 dark:bg-red-500/20 dark:text-red-200 dark:ring-red-400/30",children:"fehler"}):null,c.jsx("div",{className:"flex-1"}),u?c.jsxs("div",{className:"shrink-0 flex items-center gap-3 text-xs text-gray-600 dark:text-gray-300",children:[c.jsxs("span",{className:"tabular-nums",children:[i.done??0,"/",i.total??0]}),c.jsxs("span",{className:"tabular-nums",children:[a,"%"]}),c.jsx("div",{className:"hidden sm:block h-2 w-40 overflow-hidden rounded-full bg-gray-200 dark:bg-white/10",children:c.jsx("div",{className:"h-full bg-indigo-500",style:{width:`${a}%`}})})]}):null]})]}),i.status==="error"&&i.err?c.jsx("div",{className:"mt-2 text-xs text-red-700 dark:text-red-200",children:i.err}):null]},i.id)})]})]})}function AA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"}))}const NA=m.forwardRef(AA);function DA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const M1=m.forwardRef(DA);function MA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const RA=m.forwardRef(MA);function jA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const Kh=m.forwardRef(jA);function OA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}const LA=m.forwardRef(OA);function IA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const BA=m.forwardRef(IA);function PA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0 1 20.25 6v12A2.25 2.25 0 0 1 18 20.25H6A2.25 2.25 0 0 1 3.75 18V6A2.25 2.25 0 0 1 6 3.75h1.5m9 0h-9"}))}const R1=m.forwardRef(PA);function FA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"}))}const N0=m.forwardRef(FA);function UA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const zA=m.forwardRef(UA);function HA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const $A=m.forwardRef(HA);function qA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const VA=m.forwardRef(qA);function GA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const KA=m.forwardRef(GA);function WA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const wf=m.forwardRef(WA);function XA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z"}),m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z"}))}const j1=m.forwardRef(XA);function YA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"}))}const td=m.forwardRef(YA);function QA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Zm6-10.125a1.875 1.875 0 1 1-3.75 0 1.875 1.875 0 0 1 3.75 0Zm1.294 6.336a6.721 6.721 0 0 1-3.17.789 6.721 6.721 0 0 1-3.168-.789 3.376 3.376 0 0 1 6.338 0Z"}))}const ZA=m.forwardRef(QA);function JA({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const eN=m.forwardRef(JA);function tN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m10.5 21 5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 0 1 6-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 0 1-3.827-5.802"}))}const nN=m.forwardRef(tN);function iN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))}const rN=m.forwardRef(iN);function sN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const O1=m.forwardRef(sN);function aN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}))}const oN=m.forwardRef(aN);function lN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const uN=m.forwardRef(lN);function cN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"}))}const dN=m.forwardRef(cN);function hN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const D0=m.forwardRef(hN);function fN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const mN=m.forwardRef(fN);function pN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const Sf=m.forwardRef(pN);function gN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"}))}const yN=m.forwardRef(gN);function bN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const L1=m.forwardRef(bN);function vN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const I1=m.forwardRef(vN);function xN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const _N=m.forwardRef(xN);function wN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const Tf=m.forwardRef(wN);function _r(...n){return n.filter(Boolean).join(" ")}function kf({open:n,onClose:e,title:t,titleRight:i,children:a,footer:l,icon:u,width:h="max-w-lg",layout:f="single",left:g,leftWidthClass:w="lg:w-80",scroll:S,bodyClassName:A,leftClassName:C,rightClassName:j,rightHeader:k,rightBodyClassName:B,mobileCollapsedImageSrc:V,mobileCollapsedImageAlt:W}){const H=S??(f==="split"?"right":"body"),ie=m.useRef(null),[Y,G]=m.useState(!1);return m.useEffect(()=>{if(!n)return;const O=document.documentElement,re=document.body,E=O.style.overflow,R=re.style.overflow,ee=re.style.paddingRight,q=window.innerWidth-O.clientWidth;return O.style.overflow="hidden",re.style.overflow="hidden",q>0&&(re.style.paddingRight=`${q}px`),()=>{O.style.overflow=E,re.style.overflow=R,re.style.paddingRight=ee}},[n]),m.useEffect(()=>{n&&G(!1)},[n]),m.useEffect(()=>{if(!n)return;const O=ie.current;if(!O)return;const re=72,E=()=>{const R=O.scrollTop||0;G(ee=>{const q=R>re;return ee===q?ee:q})};return E(),O.addEventListener("scroll",E,{passive:!0}),()=>O.removeEventListener("scroll",E)},[n]),c.jsx(ed,{show:n,as:m.Fragment,children:c.jsxs(lu,{open:n,as:"div",className:"relative z-50",onClose:e,children:[c.jsx(ed.Child,{as:m.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:c.jsx("div",{className:"fixed inset-0 bg-gray-500/75 dark:bg-gray-900/50"})}),c.jsx("div",{className:"fixed inset-0 z-50 overflow-hidden px-4 py-6 sm:px-6",children:c.jsx("div",{className:"min-h-full flex items-start justify-center sm:items-center",children:c.jsx(ed.Child,{as:m.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:c.jsxs(lu.Panel,{className:_r("relative w-full rounded-lg bg-white text-left shadow-xl transition-all","max-h-[calc(100vh-3rem)] sm:max-h-[calc(100vh-4rem)]","flex flex-col min-h-0","dark:bg-gray-800 dark:outline dark:-outline-offset-1 dark:outline-white/10",h),children:[u?c.jsx("div",{className:"mx-auto mb-4 mt-6 flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-500/10",children:u}):null,c.jsxs("div",{className:_r("shrink-0 px-4 pt-4 sm:px-6 sm:pt-6 items-start justify-between gap-3",f==="split"?"hidden lg:flex":"flex"),children:[c.jsx("div",{className:"min-w-0 flex-1",children:t?c.jsx(lu.Title,{className:"hidden sm:block text-base font-semibold text-gray-900 dark:text-white truncate",children:t}):null}),c.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[i?c.jsx("div",{className:"hidden sm:block",children:i}):null,c.jsx("button",{type:"button",onClick:e,className:_r("inline-flex shrink-0 items-center justify-center rounded-lg p-1.5","text-gray-500 hover:text-gray-900 hover:bg-black/5","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600","dark:text-gray-400 dark:hover:text-white dark:hover:bg-white/10 dark:focus-visible:outline-indigo-500"),"aria-label":"Schließen",title:"Schließen",children:c.jsx(Tf,{className:"size-5"})})]})]}),f==="single"?c.jsx("div",{className:_r("flex-1 min-h-0 h-full",H==="body"?"overflow-y-auto overscroll-contain":"overflow-hidden",j),children:a}):c.jsxs("div",{className:_r("px-2 pb-4 pt-3 sm:px-4 sm:pb-6 sm:pt-4","flex-1 min-h-0","overflow-hidden","flex flex-col",A),children:[c.jsxs("div",{ref:ie,className:_r("lg:hidden flex-1 min-h-0 relative",H==="right"||H==="body"?"overflow-y-auto overscroll-contain":"overflow-hidden"),children:[c.jsxs("div",{className:_r("sticky top-0 z-50","bg-white/95 backdrop-blur dark:bg-gray-800/95","border-b border-gray-200/70 dark:border-white/10"),children:[c.jsxs("div",{className:_r("flex items-center justify-between gap-3 px-3",Y?"py-2":"py-3"),children:[c.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-1",children:[V?c.jsx("img",{src:V,alt:W||t||"",className:_r("shrink-0 rounded-lg object-cover ring-1 ring-black/5 dark:ring-white/10",Y?"size-8":"size-10"),loading:"lazy",decoding:"async"}):null,c.jsx("div",{className:"min-w-0 flex-1",children:t?c.jsx("div",{className:_r("truncate font-semibold text-gray-900 dark:text-white",Y?"text-sm":"text-base"),children:t}):null})]}),c.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[i?c.jsx("div",{children:i}):null,c.jsx("button",{type:"button",onClick:e,className:_r("inline-flex shrink-0 items-center justify-center rounded-lg p-1.5","text-gray-500 hover:text-gray-900 hover:bg-black/5","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600","dark:text-gray-400 dark:hover:text-white dark:hover:bg-white/10 dark:focus-visible:outline-indigo-500"),"aria-label":"Schließen",title:"Schließen",children:c.jsx(Tf,{className:"size-5"})})]})]}),k?c.jsx("div",{children:k}):null]}),g?c.jsx("div",{className:_r("lg:hidden px-2 pb-2",C),children:g}):null,c.jsx("div",{className:_r("px-2 pt-0 min-h-0",j),children:c.jsx("div",{className:_r("min-h-0",B),children:a})})]}),c.jsxs("div",{className:"hidden lg:flex flex-1 min-h-0 gap-3",children:[c.jsx("div",{className:_r("min-h-0",w,"shrink-0","overflow-hidden",C),children:g}),c.jsxs("div",{className:_r("flex-1 min-h-0 flex flex-col",j),children:[k?c.jsx("div",{className:"shrink-0",children:k}):null,c.jsx("div",{className:_r("flex-1 min-h-0",H==="right"?"overflow-y-auto overscroll-contain":"overflow-hidden",B),children:a})]})]})]}),l?c.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-gray-200/70 dark:border-white/10 flex justify-end gap-3",children:l}):null]})})})})]})})}function Rw(n,e){const t=Number(n);return Number.isFinite(t)&&t>0?Math.floor(t):e}function SN(n){const e=(n.user||"").trim()||"postgres",t=(n.host||"").trim()||"127.0.0.1",i=Rw(n.port,5432),a=(n.db||"").trim()||"postgres",l=(n.sslmode||"").trim()||"disable";return`postgres://${encodeURIComponent(e)}@${t}:${i}/${encodeURIComponent(a)}?sslmode=${encodeURIComponent(l)}`}function TN({open:n,onClose:e,initialUrl:t,initialHasPassword:i,onApply:a}){const[l,u]=m.useState("127.0.0.1"),[h,f]=m.useState(5432),[g,w]=m.useState("nsfwapp"),[S,A]=m.useState("postgres"),[C,j]=m.useState(""),[k,B]=m.useState("disable"),V=m.useMemo(()=>SN({user:S,host:l,port:h,db:g,sslmode:k}),[S,l,h,g,k]),W=c.jsxs(c.Fragment,{children:[c.jsx(hn,{variant:"secondary",onClick:e,children:"Abbrechen"}),c.jsx(hn,{variant:"primary",onClick:()=>{a({databaseUrl:V,dbPassword:C}),e()},children:"Übernehmen"})]});return c.jsx(kf,{open:n,onClose:e,title:"Postgres URL erstellen",width:"max-w-2xl",footer:W,children:c.jsxs("div",{className:"px-4 pb-4 sm:px-6 sm:pb-6 space-y-4",children:[c.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:["Passwort wird ",c.jsx("span",{className:"font-semibold",children:"verschlüsselt"})," gespeichert (nicht in der URL).",t?c.jsx(c.Fragment,{children:c.jsxs("div",{className:"mt-1",children:["Aktuelle URL: ",c.jsx("code",{className:"break-all",children:t})]})}):null,i?c.jsx("div",{className:"mt-1",children:"Passwort: ✅ gespeichert"}):null]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Host"}),c.jsx("input",{value:l,onChange:H=>u(H.target.value),className:`sm:col-span-9 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`,placeholder:"127.0.0.1"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Port"}),c.jsx("input",{type:"number",min:1,max:65535,value:h,onChange:H=>f(Rw(H.target.value,5432)),className:`sm:col-span-9 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Datenbank"}),c.jsx("input",{value:g,onChange:H=>w(H.target.value),className:`sm:col-span-9 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`,placeholder:"nsfwapp"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"User"}),c.jsx("input",{value:S,onChange:H=>A(H.target.value),className:`sm:col-span-9 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`,placeholder:"postgres"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Passwort"}),c.jsx("input",{value:C,onChange:H=>j(H.target.value),type:"password",className:`sm:col-span-9 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`,placeholder:"••••••••"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"SSL"}),c.jsxs("select",{value:k,onChange:H=>B(H.target.value),className:`sm:col-span-9 h-10 rounded-lg px-3 text-sm bg-white text-gray-900 ring-1 ring-gray-200 shadow-sm\r - dark:border-white/10 dark:bg-gray-900 dark:text-gray-100 dark:[color-scheme:dark]`,children:[c.jsx("option",{value:"disable",children:"disable"}),c.jsx("option",{value:"require",children:"require"}),c.jsx("option",{value:"verify-full",children:"verify-full"})]})]}),c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700 dark:border-white/10 dark:bg-white/5 dark:text-gray-200",children:[c.jsx("div",{className:"font-semibold mb-1",children:"Vorschau"}),c.jsx("code",{className:"break-all",children:V})]})]})})}function kN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const jw=m.forwardRef(kN);function EN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),m.createElement("path",{fillRule:"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",clipRule:"evenodd"}))}const yl=m.forwardRef(EN);function CN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M12.963 2.286a.75.75 0 0 0-1.071-.136 9.742 9.742 0 0 0-3.539 6.176 7.547 7.547 0 0 1-1.705-1.715.75.75 0 0 0-1.152-.082A9 9 0 1 0 15.68 4.534a7.46 7.46 0 0 1-2.717-2.248ZM15.75 14.25a3.75 3.75 0 1 1-7.313-1.172c.628.465 1.35.81 2.133 1a5.99 5.99 0 0 1 1.925-3.546 3.75 3.75 0 0 1 3.255 3.718Z",clipRule:"evenodd"}))}const Bg=m.forwardRef(CN);function AN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{d:"M7.493 18.5c-.425 0-.82-.236-.975-.632A7.48 7.48 0 0 1 6 15.125c0-1.75.599-3.358 1.602-4.634.151-.192.373-.309.6-.397.473-.183.89-.514 1.212-.924a9.042 9.042 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75A.75.75 0 0 1 15 2a2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H14.23c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23h-.777ZM2.331 10.727a11.969 11.969 0 0 0-.831 4.398 12 12 0 0 0 .52 3.507C2.28 19.482 3.105 20 3.994 20H4.9c.445 0 .72-.498.523-.898a8.963 8.963 0 0 1-.924-3.977c0-1.708.476-3.305 1.302-4.666.245-.403-.028-.959-.5-.959H4.25c-.832 0-1.612.453-1.918 1.227Z"}))}const NN=m.forwardRef(AN);function DN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{d:"m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z"}))}const bl=m.forwardRef(DN);function MN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z",clipRule:"evenodd"}))}const RN=m.forwardRef(MN);function jN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z",clipRule:"evenodd"}))}const ON=m.forwardRef(jN);function LN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M5.636 4.575a.75.75 0 0 1 0 1.061 9 9 0 0 0 0 12.728.75.75 0 1 1-1.06 1.06c-4.101-4.1-4.101-10.748 0-14.849a.75.75 0 0 1 1.06 0Zm12.728 0a.75.75 0 0 1 1.06 0c4.101 4.1 4.101 10.75 0 14.85a.75.75 0 1 1-1.06-1.061 9 9 0 0 0 0-12.728.75.75 0 0 1 0-1.06ZM7.757 6.697a.75.75 0 0 1 0 1.06 6 6 0 0 0 0 8.486.75.75 0 0 1-1.06 1.06 7.5 7.5 0 0 1 0-10.606.75.75 0 0 1 1.06 0Zm8.486 0a.75.75 0 0 1 1.06 0 7.5 7.5 0 0 1 0 10.606.75.75 0 0 1-1.06-1.06 6 6 0 0 0 0-8.486.75.75 0 0 1 0-1.06ZM9.879 8.818a.75.75 0 0 1 0 1.06 3 3 0 0 0 0 4.243.75.75 0 1 1-1.061 1.061 4.5 4.5 0 0 1 0-6.364.75.75 0 0 1 1.06 0Zm4.242 0a.75.75 0 0 1 1.061 0 4.5 4.5 0 0 1 0 6.364.75.75 0 0 1-1.06-1.06 3 3 0 0 0 0-4.243.75.75 0 0 1 0-1.061ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z",clipRule:"evenodd"}))}const IN=m.forwardRef(LN);function BN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",clipRule:"evenodd"}))}const _u=m.forwardRef(BN);function PN({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const FN=m.forwardRef(PN),er={databaseUrl:"",hasDbPassword:!1,recordDir:"records",doneDir:"records/done",ffmpegPath:"",autoAddToDownloadList:!0,useChaturbateApi:!1,useMyFreeCamsWatcher:!1,autoDeleteSmallDownloads:!0,autoDeleteSmallDownloadsBelowMB:200,blurPreviews:!1,teaserPlayback:"hover",teaserAudio:!1,lowDiskPauseBelowGB:5,enableNotifications:!0};function UN(n,e=52){const t=String(n??"").trim();return t?t.length<=e?t:"…"+t.slice(-(e-1)):""}function zN({onAssetsGenerated:n}){const[e,t]=m.useState(er),[i,a]=m.useState(!1),[l,u]=m.useState(0),h=m.useRef(null),[f,g]=m.useState(!1),[w,S]=m.useState(null),[A,C]=m.useState(null),[j,k]=m.useState(null),[B,V]=m.useState(null),W=m.useRef(null),[H,ie]=m.useState(!1),[Y,G]=m.useState(""),[O,re]=m.useState(""),E=Date.now(),R=l>E,q=i?"saving":R?"success":!!j&&!i&&!R?"error":"idle",Q=q==="saving"?{text:"Speichern…",color:"blue",icon:null,isLoading:!0}:q==="success"?{text:"Gespeichert",color:"emerald",icon:c.jsx(jw,{className:"size-4"}),isLoading:!1}:q==="error"?{text:"Fehler",color:"red",icon:c.jsx(FN,{className:"size-4"}),isLoading:!1}:{text:"Speichern",color:"indigo",icon:null,isLoading:!1},[ue,se]=m.useState({id:"generate-assets",status:"idle",title:"Assets generieren",text:"",cancellable:!0,fading:!1}),[$,F]=m.useState({id:"cleanup",status:"idle",title:"Aufräumen",text:"",cancellable:!1,fading:!1}),X=Number(e.lowDiskPauseBelowGB??er.lowDiskPauseBelowGB??5),le=B?.pauseGB??X,de=B?.resumeGB??X+3;m.useEffect(()=>()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null)},[]),m.useEffect(()=>{let Oe=!0;return fetch("/api/settings",{cache:"no-store"}).then(async Te=>{if(!Te.ok)throw new Error(await Te.text());return Te.json()}).then(Te=>{Oe&&(t({databaseUrl:String(Te.databaseUrl??""),hasDbPassword:!!(Te.hasDbPassword??!1),recordDir:(Te.recordDir||er.recordDir).toString(),doneDir:(Te.doneDir||er.doneDir).toString(),ffmpegPath:String(Te.ffmpegPath??er.ffmpegPath??""),autoAddToDownloadList:Te.autoAddToDownloadList??er.autoAddToDownloadList,autoStartAddedDownloads:Te.autoStartAddedDownloads??er.autoStartAddedDownloads,useChaturbateApi:Te.useChaturbateApi??er.useChaturbateApi,useMyFreeCamsWatcher:Te.useMyFreeCamsWatcher??er.useMyFreeCamsWatcher,autoDeleteSmallDownloads:Te.autoDeleteSmallDownloads??er.autoDeleteSmallDownloads,autoDeleteSmallDownloadsBelowMB:Te.autoDeleteSmallDownloadsBelowMB??er.autoDeleteSmallDownloadsBelowMB,blurPreviews:Te.blurPreviews??er.blurPreviews,teaserPlayback:Te.teaserPlayback??er.teaserPlayback,teaserAudio:Te.teaserAudio??er.teaserAudio,lowDiskPauseBelowGB:Te.lowDiskPauseBelowGB??er.lowDiskPauseBelowGB,enableNotifications:Te.enableNotifications??er.enableNotifications}),G(String(Te.databaseUrl??"").trim()))}).catch(()=>{}),()=>{Oe=!1}},[]),m.useEffect(()=>{let Oe=!0;const Te=async()=>{try{const dt=await fetch("/api/status/disk",{cache:"no-store"});if(!dt.ok)return;const xe=await dt.json();Oe&&V(xe)}catch{}};Te();const _t=window.setInterval(Te,5e3);return()=>{Oe=!1,window.clearInterval(_t)}},[]);async function L(Oe){k(null),C(null),S(Oe);try{window.focus();const Te=await fetch(`/api/settings/browse?target=${Oe}`,{cache:"no-store"});if(Te.status===204)return;if(!Te.ok){const xe=await Te.text().catch(()=>"");throw new Error(xe||`HTTP ${Te.status}`)}const dt=((await Te.json()).path??"").trim();if(!dt)return;t(xe=>Oe==="record"?{...xe,recordDir:dt}:Oe==="done"?{...xe,doneDir:dt}:{...xe,ffmpegPath:dt})}catch(Te){k(Te?.message??String(Te))}finally{S(null)}}async function pe(){k(null),C(null);const Oe=e.recordDir.trim(),Te=e.doneDir.trim(),_t=(e.ffmpegPath??"").trim(),dt=String(e.databaseUrl??"").trim(),xe=!!(O||"").trim();if(!Oe||!Te){k("Bitte Aufnahme-Ordner und Ziel-Ordner angeben.");return}const Ne=!!e.autoAddToDownloadList,Se=Ne?!!e.autoStartAddedDownloads:!1,Ie=!!e.useChaturbateApi,$e=!!e.useMyFreeCamsWatcher,Ct=!!e.autoDeleteSmallDownloads,st=Math.max(0,Math.min(1e5,Math.floor(Number(e.autoDeleteSmallDownloadsBelowMB??er.autoDeleteSmallDownloadsBelowMB)))),gt=!!e.blurPreviews,He=e.teaserPlayback==="still"||e.teaserPlayback==="all"||e.teaserPlayback==="hover"?e.teaserPlayback:er.teaserPlayback,We=!!e.teaserAudio,Je=Math.max(1,Math.floor(Number(e.lowDiskPauseBelowGB??er.lowDiskPauseBelowGB))),et=!!e.enableNotifications;a(!0);try{const mt=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({databaseUrl:dt,dbPassword:O||void 0,recordDir:Oe,doneDir:Te,ffmpegPath:_t,autoAddToDownloadList:Ne,autoStartAddedDownloads:Se,useChaturbateApi:Ie,useMyFreeCamsWatcher:$e,autoDeleteSmallDownloads:Ct,autoDeleteSmallDownloadsBelowMB:st,blurPreviews:gt,teaserPlayback:He,teaserAudio:We,lowDiskPauseBelowGB:Je,enableNotifications:et})});if(!mt.ok){const qe=await mt.text().catch(()=>"");throw new Error(qe||`HTTP ${mt.status}`)}C("✅ Gespeichert.");const Mt=Date.now()+2500;u(Mt),h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{u(0),h.current=null},2500),window.dispatchEvent(new CustomEvent("recorder-settings-updated")),(dt!==Y||xe)&&(window.dispatchEvent(new CustomEvent("models-db-changed",{detail:{databaseUrl:dt}})),G(dt),re(""))}catch(mt){u(0),h.current!=null&&(window.clearTimeout(h.current),h.current=null),k(mt?.message??String(mt))}finally{a(!1)}}function we(Oe,Te=3500,_t=500){window.setTimeout(()=>{Oe(dt=>({...dt,fading:!0})),window.setTimeout(()=>{Oe(dt=>({...dt,status:"idle",text:"",err:void 0,done:0,total:0,fading:!1}))},_t)},Te)}async function Be(){k(null),C(null);const Oe=Number(e.autoDeleteSmallDownloadsBelowMB??er.autoDeleteSmallDownloadsBelowMB??0),Te=(e.doneDir||er.doneDir).trim();if(!Te){k("doneDir ist leer.");return}if(!Oe||Oe<=0){k("Mindestgröße ist 0 – es würde nichts gelöscht.");return}if(window.confirm(`Aufräumen: -• Löscht Dateien in "${Te}" < ${Oe} MB (Ordner "keep" wird übersprungen) -• Entfernt verwaiste Previews/Thumbs/Generated-Assets ohne passende Datei - -Fortfahren?`)){g(!0),F(dt=>({...dt,status:"running",title:"Aufräumen",text:"Räume auf…",err:void 0,done:0,total:1,fading:!1}));try{const dt=await fetch("/api/settings/cleanup",{method:"POST",headers:{"Content-Type":"application/json"},cache:"no-store"});if(!dt.ok){const Ct=await dt.text().catch(()=>"");throw new Error(Ct||`HTTP ${dt.status}`)}const xe=await dt.json(),Ne=Number(xe.scannedFiles??0),Se=Number(xe.orphanIdsRemoved??0),Ie=Number(xe.generatedOrphansRemoved??0),$e=Se+Ie;F(Ct=>({...Ct,status:"done",done:1,total:1,title:"Aufräumen",text:`geprüft: ${Ne} · Orphans: ${$e}`})),we(F)}catch(dt){const xe=dt?.message??String(dt);k(xe),F(Ne=>({...Ne,status:"error",text:"Fehler beim Aufräumen.",err:xe})),we(F)}finally{g(!1)}}}async function Ve(){const Oe=W.current;if(W.current=null,se(Te=>({...Te,status:"cancelled",text:"Abgebrochen."})),Oe){Oe.abort();return}try{await fetch("/api/tasks/generate-assets",{method:"DELETE",cache:"no-store"})}catch{}}return c.jsx(Is,{header:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-base font-semibold text-gray-900 dark:text-white",children:"Einstellungen"}),c.jsx("div",{className:"mt-0.5 text-xs text-gray-600 dark:text-gray-300",children:"Recorder-Konfiguration, Automatisierung und Tasks."})]}),c.jsxs("div",{className:"flex items-start gap-2",children:[q!=="success"?c.jsx("div",{className:"hidden sm:flex min-w-0 max-w-[520px] items-stretch",children:j?c.jsx("div",{className:`\r - inline-flex items-center\r - px-3 py-[7px] text-sm\r - rounded-md border border-red-200 bg-red-50 text-red-700\r - dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200\r - `,children:j}):A?c.jsx("div",{className:`\r - inline-flex items-center\r - px-3 py-[7px] text-sm\r - rounded-md border border-green-200 bg-green-50 text-green-700\r - dark:border-green-500/30 dark:bg-green-500/10 dark:text-green-200\r - `,children:A}):null}):null,c.jsx(hn,{variant:"primary",color:Q.color,onClick:pe,disabled:i,className:"shrink-0",size:"md",isLoading:Q.isLoading,leadingIcon:Q.icon,children:Q.text})]})]}),grayBody:!0,children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(CA,{tasks:[ue,$],onCancel:Oe=>{Oe==="generate-assets"&&Ve()}}),q!=="success"?c.jsxs("div",{className:"sm:hidden",children:[j&&c.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200",children:j}),A&&c.jsx("div",{className:"rounded-lg border border-green-200 bg-green-50 px-3 py-2 text-sm text-green-700 dark:border-green-500/30 dark:bg-green-500/10 dark:text-green-200",children:A})]}):null,c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-gray-950/40",children:[c.jsx("div",{className:"flex items-start justify-between gap-4",children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Aufgaben"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Hintergrundaufgaben wie z.B. Asset/Preview-Generierung."})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsx(D1,{title:"Assets-Generator",description:"Erzeugt fehlende Assets (thumb/preview/meta). Fortschritt & Abbrechen oben in der Taskliste.",startLabel:"Start",startingLabel:"Starte…",startUrl:"/api/tasks/generate-assets",stopUrl:"/api/tasks/generate-assets",sseUrl:"/api/events/stream",onFinished:n,onStart:Oe=>{W.current=Oe,se(Te=>({...Te,status:"running",title:"Assets generieren",text:"",done:0,total:0,err:void 0,fading:!1}))},onProgress:Oe=>{const Te=UN(Oe.currentFile);se(_t=>({..._t,status:"running",title:"Assets generieren",text:Te||"",done:Oe.done,total:Oe.total}))},onDone:()=>{W.current=null,se(Oe=>({...Oe,status:"done",title:"Assets generieren"})),we(se)},onCancelled:()=>{W.current=null,se(Oe=>({...Oe,status:"cancelled",title:"Assets generieren",text:"Abgebrochen."})),we(se)},onError:Oe=>{W.current=null,se(Te=>({...Te,status:"error",title:"Assets generieren",text:"Fehler beim Generieren.",err:Oe})),we(se)}}),c.jsx(D1,{title:"Aufräumen",description:'Löscht Dateien im doneDir kleiner als die Mindestgröße (Ordner "keep" wird übersprungen) und entfernt verwaiste Assets.',startLabel:"Aufräumen",startingLabel:"Läuft…",onTrigger:Be,busy:f,disabled:i||!e.autoDeleteSmallDownloads,onError:Oe=>{k(Oe)}})]})]}),c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-gray-950/40",children:[c.jsxs("div",{className:"mb-3",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Pfad-Einstellungen"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Aufnahme- und Zielverzeichnisse sowie optionaler ffmpeg-Pfad."})]}),c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-gray-950/40",children:[c.jsxs("div",{className:"mb-3",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Datenbank"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Postgres Verbindung. Passwort wird verschlüsselt gespeichert."})]}),c.jsx("div",{className:"space-y-3",children:c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Database URL"}),c.jsxs("div",{className:"sm:col-span-9 flex gap-2",children:[c.jsx("input",{value:String(e.databaseUrl??""),onChange:Oe=>t(Te=>({...Te,databaseUrl:Oe.target.value})),placeholder:"postgres://user@host:5432/db?sslmode=disable",className:`min-w-0 flex-1 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`}),c.jsx(hn,{variant:"secondary",onClick:()=>ie(!0),disabled:i,children:"URL erstellen…"})]})]})})]}),c.jsx(TN,{open:H,onClose:()=>ie(!1),initialUrl:String(e.databaseUrl??""),initialHasPassword:!!e.hasDbPassword,onApply:({databaseUrl:Oe,dbPassword:Te})=>{t(_t=>({..._t,databaseUrl:Oe})),re(Te||"")}}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Aufnahme-Ordner"}),c.jsxs("div",{className:"sm:col-span-9 flex gap-2",children:[c.jsx("input",{value:e.recordDir,onChange:Oe=>t(Te=>({...Te,recordDir:Oe.target.value})),placeholder:"records (oder absolut: C:\\records / /mnt/data/records)",className:`min-w-0 flex-1 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`}),c.jsx(hn,{variant:"secondary",onClick:()=>L("record"),disabled:i||w!==null,children:"Durchsuchen..."})]})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"Fertige Downloads nach"}),c.jsxs("div",{className:"sm:col-span-9 flex gap-2",children:[c.jsx("input",{value:e.doneDir,onChange:Oe=>t(Te=>({...Te,doneDir:Oe.target.value})),placeholder:"records/done",className:`min-w-0 flex-1 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`}),c.jsx(hn,{variant:"secondary",onClick:()=>L("done"),disabled:i||w!==null,children:"Durchsuchen..."})]})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center",children:[c.jsx("label",{className:"text-sm font-medium text-gray-900 dark:text-gray-200 sm:col-span-3",children:"ffmpeg.exe"}),c.jsxs("div",{className:"sm:col-span-9 flex gap-2",children:[c.jsx("input",{value:e.ffmpegPath??"",onChange:Oe=>t(Te=>({...Te,ffmpegPath:Oe.target.value})),placeholder:"Leer = automatisch (FFMPEG_PATH / ffmpeg im PATH)",className:`min-w-0 flex-1 rounded-lg px-3 py-2 text-sm bg-white text-gray-900 ring-1 ring-gray-200\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:bg-white/10 dark:text-white dark:ring-white/10`}),c.jsx(hn,{variant:"secondary",onClick:()=>L("ffmpeg"),disabled:i||w!==null,children:"Durchsuchen..."})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-gray-950/40",children:[c.jsxs("div",{className:"mb-3",children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Automatisierung & Anzeige"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Verhalten beim Hinzufügen/Starten sowie Anzeigeoptionen."})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(Na,{checked:!!e.autoAddToDownloadList,onChange:Oe=>t(Te=>({...Te,autoAddToDownloadList:Oe,autoStartAddedDownloads:Oe?Te.autoStartAddedDownloads:!1})),label:"Automatisch zur Downloadliste hinzufügen",description:"Neue Links/Modelle werden automatisch in die Downloadliste übernommen."}),c.jsx(Na,{checked:!!e.autoStartAddedDownloads,onChange:Oe=>t(Te=>({...Te,autoStartAddedDownloads:Oe})),disabled:!e.autoAddToDownloadList,label:"Hinzugefügte Downloads automatisch starten",description:"Wenn ein Download hinzugefügt wurde, startet er direkt (sofern möglich)."}),c.jsx(Na,{checked:!!e.useChaturbateApi,onChange:Oe=>t(Te=>({...Te,useChaturbateApi:Oe})),label:"Chaturbate API",description:"Wenn aktiv, pollt das Backend alle paar Sekunden die Online-Rooms API und cached die aktuell online Models."}),c.jsx(Na,{checked:!!e.useMyFreeCamsWatcher,onChange:Oe=>t(Te=>({...Te,useMyFreeCamsWatcher:Oe})),label:"MyFreeCams Auto-Check (watched)",description:"Geht watched MyFreeCams-Models einzeln durch und startet einen Download. Wenn keine Output-Datei entsteht, ist der Stream nicht öffentlich (offline/away/private) und der Job wird wieder entfernt."}),c.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50 p-3 dark:border-white/10 dark:bg-white/5",children:[c.jsx(Na,{checked:!!e.autoDeleteSmallDownloads,onChange:Oe=>t(Te=>({...Te,autoDeleteSmallDownloads:Oe,autoDeleteSmallDownloadsBelowMB:Te.autoDeleteSmallDownloadsBelowMB??50})),label:"Kleine Downloads automatisch löschen",description:"Löscht fertige Downloads automatisch, wenn die Datei kleiner als die eingestellte Mindestgröße ist."}),c.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center "+(e.autoDeleteSmallDownloads?"":"opacity-50 pointer-events-none"),children:[c.jsxs("div",{className:"sm:col-span-4",children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-200",children:"Mindestgröße"}),c.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Alles darunter wird gelöscht."})]}),c.jsx("div",{className:"sm:col-span-8",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx("input",{type:"number",min:0,step:1,value:e.autoDeleteSmallDownloadsBelowMB??50,onChange:Oe=>t(Te=>({...Te,autoDeleteSmallDownloadsBelowMB:Number(Oe.target.value||0)})),className:`h-9 w-32 rounded-md border border-gray-200 bg-white px-3 text-sm text-gray-900 shadow-sm\r - dark:border-white/10 dark:bg-gray-900 dark:text-gray-100`}),c.jsx("span",{className:"shrink-0 text-xs text-gray-600 dark:text-gray-300",children:"MB"})]})})]})]}),c.jsx(Na,{checked:!!e.blurPreviews,onChange:Oe=>t(Te=>({...Te,blurPreviews:Oe})),label:"Vorschaubilder blurren",description:"Weichzeichnet Vorschaubilder/Teaser (praktisch auf mobilen Geräten oder im öffentlichen Umfeld)."}),c.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-12 sm:items-center",children:[c.jsxs("div",{className:"sm:col-span-4",children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-200",children:"Teaser abspielen"}),c.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Standbild spart Leistung. „Bei Hover (Standard)“: Desktop spielt bei Hover ab, Mobile im Viewport. „Alle“ kann viel CPU ziehen."})]}),c.jsxs("div",{className:"sm:col-span-8",children:[c.jsx("label",{className:"sr-only",htmlFor:"teaserPlayback",children:"Teaser abspielen"}),c.jsxs("select",{id:"teaserPlayback",value:e.teaserPlayback??"hover",onChange:Oe=>t(Te=>({...Te,teaserPlayback:Oe.target.value})),className:`h-9 w-full rounded-md border border-gray-200 bg-white px-3 text-sm text-gray-900 shadow-sm\r - dark:border-white/10 dark:bg-gray-900 dark:text-gray-100 dark:[color-scheme:dark]`,children:[c.jsx("option",{value:"still",children:"Standbild"}),c.jsx("option",{value:"hover",children:"Bei Hover (Standard)"}),c.jsx("option",{value:"all",children:"Alle"})]})]})]}),c.jsx(Na,{checked:!!e.teaserAudio,onChange:Oe=>t(Te=>({...Te,teaserAudio:Oe})),label:"Teaser mit Ton",description:"Wenn aktiv, werden Vorschau/Teaser nicht stumm geschaltet."}),c.jsx(Na,{checked:!!e.enableNotifications,onChange:Oe=>t(Te=>({...Te,enableNotifications:Oe})),label:"Benachrichtigungen",description:"Wenn aktiv, zeigt das Frontend Toasts (z.B. wenn watched Models online/live gehen oder wenn ein queued Model wieder public wird)."}),c.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50 p-3 dark:border-white/10 dark:bg-white/5",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Speicherplatz-Notbremse"}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:"Aktiviert automatisch Stop + Autostart-Block bei wenig freiem Speicher (Resume bei +3 GB)."})]}),c.jsx("span",{className:"inline-flex items-center rounded-full px-2 py-1 text-[11px] font-medium "+(B?.emergency?"bg-red-100 text-red-800 dark:bg-red-500/20 dark:text-red-200":"bg-green-100 text-green-800 dark:bg-green-500/20 dark:text-green-200"),title:B?.emergency?"Notfallbremse greift gerade":"OK",children:B?.emergency?"AKTIV":"OK"})]}),c.jsxs("div",{className:"mt-3 text-sm text-gray-900 dark:text-gray-200",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Schwelle:"})," ","Pause unter ",c.jsx("span",{className:"tabular-nums",children:le})," GB"," · ","Resume ab"," ",c.jsx("span",{className:"tabular-nums",children:de})," ","GB"]}),c.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-300",children:B?`Frei: ${B.freeBytesHuman}${B.recordPath?` (Pfad: ${B.recordPath})`:""}`:"Status wird geladen…"}),B?.emergency&&c.jsx("div",{className:"mt-2 text-xs text-red-700 dark:text-red-200",children:"Notfallbremse greift: laufende Downloads werden gestoppt und Autostart bleibt gesperrt, bis wieder genug frei ist."})]})]})]})]})]})})}function M0(...n){return n.filter(Boolean).join(" ")}const HN={sm:{btn:"px-2.5 py-1.5 text-sm",icon:"size-5",iconOnly:"h-9 w-9"},md:{btn:"px-3 py-2 text-sm",icon:"size-5",iconOnly:"h-10 w-10"},lg:{btn:"px-3.5 py-2.5 text-sm",icon:"size-5",iconOnly:"h-11 w-11"}};function Pg({items:n,value:e,onChange:t,size:i="md",className:a,ariaLabel:l="Optionen"}){const u=HN[i];return c.jsx("span",{className:M0("isolate inline-flex rounded-md shadow-xs dark:shadow-none ring-1 ring-gray-300 dark:ring-gray-700 overflow-hidden",a),role:"group","aria-label":l,children:n.map((h,f)=>{const g=h.id===e,w=f===0,S=f===n.length-1,A=!h.label&&!!h.icon;return c.jsxs("button",{type:"button",disabled:h.disabled,onClick:()=>t(h.id),"aria-pressed":g,className:M0("relative inline-flex items-center justify-center font-semibold leading-none focus:z-10 transition-colors",!w&&"before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-gray-300 dark:before:bg-gray-700",w&&"rounded-l-md",S&&"rounded-r-md",g?"bg-indigo-100 text-indigo-800 hover:bg-indigo-200 dark:bg-indigo-500/40 dark:text-indigo-100 dark:hover:bg-indigo-500/50":"bg-white text-gray-900 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:hover:bg-white/20","disabled:opacity-50 disabled:cursor-not-allowed",A?`p-0 ${u.iconOnly}`:u.btn),title:typeof h.label=="string"?h.label:h.srLabel,children:[A&&h.srLabel?c.jsx("span",{className:"sr-only",children:h.srLabel}):null,h.icon?c.jsx("span",{className:M0("shrink-0",A?"":"-ml-0.5",g?"text-indigo-600 dark:text-indigo-200":"text-gray-400 dark:text-gray-500"),children:h.icon}):null,h.label?c.jsx("span",{className:h.icon?"ml-1.5":"",children:h.label}):null]},h.id)})})}function $N(...n){return n.filter(Boolean).join(" ")}function qN(){if(typeof document>"u")return null;const n="__swipecard_hot_fx_layer__";let e=document.getElementById(n);return e||(e=document.createElement("div"),e.id=n,e.style.position="fixed",e.style.inset="0",e.style.pointerEvents="none",e.style.zIndex="2147483647",e.style.contain="layout style paint",document.body.appendChild(e)),e}const VN=m.forwardRef(function({children:e,enabled:t=!0,disabled:i=!1,onTap:a,onSwipeLeft:l,onSwipeRight:u,className:h,thresholdPx:f=140,thresholdRatio:g=.28,ignoreFromBottomPx:w=72,ignoreSelector:S="[data-swipe-ignore]",snapMs:A=180,commitMs:C=180,tapIgnoreSelector:j="button,a,input,textarea,select,video[controls],video[controls] *,[data-tap-ignore]",onDoubleTap:k,hotTargetSelector:B="[data-hot-target]",doubleTapMs:V=360,doubleTapMaxMovePx:W=48},H){const ie=m.useRef(null),Y=m.useRef(!1),G=m.useRef(0),O=m.useRef(null),re=m.useRef(0),E=m.useRef(null),R=m.useRef(null),ee=m.useRef(null),q=m.useRef({id:null,x:0,y:0,dragging:!1,captured:!1,tapIgnored:!1,noSwipe:!1}),[Q,ue]=m.useState(0),[se,$]=m.useState(null),[F,X]=m.useState(0),le=m.useCallback(()=>{O.current!=null&&(cancelAnimationFrame(O.current),O.current=null),G.current=0,ie.current&&(ie.current.style.touchAction="pan-y"),X(A),ue(0),$(null),window.setTimeout(()=>X(0),A)},[A]),de=m.useCallback(async(Ne,Se)=>{O.current!=null&&(cancelAnimationFrame(O.current),O.current=null),ie.current&&(ie.current.style.touchAction="pan-y");const $e=ie.current?.offsetWidth||360;X(C),$(Ne==="right"?"right":"left");const Ct=Ne==="right"?$e+40:-($e+40);G.current=Ct,ue(Ct);let st;Se?st=Promise.resolve(Ne==="right"?u():l()).catch(()=>!1):st=Promise.resolve(!0);const gt=new Promise(We=>{window.setTimeout(We,C)}),[,He]=await Promise.all([gt,st]);return He===!1?(X(A),$(null),ue(0),window.setTimeout(()=>X(0),A),!1):!0},[C,l,u,A]),L=m.useCallback(()=>{R.current!=null&&(window.clearTimeout(R.current),R.current=null)},[]),pe=m.useCallback(()=>{O.current!=null&&(cancelAnimationFrame(O.current),O.current=null),G.current=0,X(0),ue(0),$(null);try{const Ne=ie.current;Ne&&(Ne.style.touchAction="pan-y")}catch{}},[]),we=m.useCallback((Ne,Se)=>{const Ie=E.current,$e=ie.current;if(!Ie||!$e)return;const Ct=qN();if(!Ct)return;let st=typeof Ne=="number"?Ne:window.innerWidth/2,gt=typeof Se=="number"?Se:window.innerHeight/2;const He=B?E.current?.querySelector(B)??$e.querySelector(B):null;let We=st,Je=gt;if(He){const mn=He.getBoundingClientRect();We=mn.left+mn.width/2,Je=mn.top+mn.height/2}const et=We-st,mt=Je-gt,Mt=document.createElement("div");Mt.style.position="absolute",Mt.style.left=`${st}px`,Mt.style.top=`${gt}px`,Mt.style.transform="translate(-50%, -50%)",Mt.style.pointerEvents="none",Mt.style.willChange="transform, opacity",Mt.style.zIndex="2147483647",Mt.style.lineHeight="1",Mt.style.userSelect="none",Mt.style.filter="drop-shadow(0 10px 16px rgba(0,0,0,0.22))";const fe=document.createElement("div");fe.style.width="30px",fe.style.height="30px",fe.style.color="#f59e0b",fe.style.display="block",Mt.appendChild(fe),Ct.appendChild(Mt);const qe=J_.createRoot(fe);qe.render(c.jsx(Bg,{className:"w-full h-full","aria-hidden":"true"})),Mt.getBoundingClientRect();const Le=200,Ce=500,Pe=400,Qe=Le+Ce+Pe,At=Le/Qe,Xt=(Le+Ce)/Qe,kt=Mt.animate([{transform:"translate(-50%, -50%) scale(0.15)",opacity:0,offset:0},{transform:"translate(-50%, -50%) scale(1.25)",opacity:1,offset:At*.55},{transform:"translate(-50%, -50%) scale(1.00)",opacity:1,offset:At},{transform:"translate(-50%, -50%) scale(1.00)",opacity:1,offset:Xt},{transform:`translate(calc(-50% + ${et}px), calc(-50% + ${mt}px)) scale(0.85)`,opacity:.95,offset:Xt+(1-Xt)*.75},{transform:`translate(calc(-50% + ${et}px), calc(-50% + ${mt}px)) scale(0.55)`,opacity:0,offset:1}],{duration:Qe,easing:"cubic-bezier(0.2, 0.9, 0.2, 1)",fill:"forwards"});He&&window.setTimeout(()=>{try{He.animate([{transform:"translateZ(0) scale(1)",filter:"brightness(1)"},{transform:"translateZ(0) scale(1.10)",filter:"brightness(1.25)",offset:.35},{transform:"translateZ(0) scale(1)",filter:"brightness(1)"}],{duration:260,easing:"cubic-bezier(0.2, 0.9, 0.2, 1)"})}catch{}},Le+Ce+Math.round(Pe*.75)),kt.onfinish=()=>{try{qe.unmount()}catch{}Mt.remove()}},[B]);m.useEffect(()=>()=>{R.current!=null&&window.clearTimeout(R.current)},[]),m.useImperativeHandle(H,()=>({swipeLeft:Ne=>de("left",Ne?.runAction??!0),swipeRight:Ne=>de("right",Ne?.runAction??!0),reset:()=>le()}),[de,le]);const Be=Math.abs(Q),Ve=Q===0?null:Q>0?"right":"left",Oe=re.current||Math.min(f,(ie.current?.offsetWidth||360)*g),Te=Math.max(0,Math.min(1,Be/Math.max(1,Oe))),_t=Math.max(0,Math.min(1,Be/Math.max(1,Oe*1.35))),dt=Math.max(-6,Math.min(6,Q/28)),xe=Q===0?1:.995;return c.jsx("div",{ref:E,className:$N("relative isolate overflow-visible rounded-lg",h),children:c.jsx("div",{ref:ie,className:"relative",style:{transform:Q!==0?`translate3d(${Q}px,0,0) rotate(${dt}deg) scale(${xe})`:void 0,transition:F?`transform ${F}ms ease`:void 0,touchAction:"pan-y",willChange:Q!==0?"transform":void 0,borderRadius:Q!==0?"12px":void 0,filter:Q!==0?`saturate(${1+Te*.08}) brightness(${1+Te*.02})`:void 0},onPointerDown:Ne=>{if(!t||i)return;const Se=Ne.target;let Ie=!!(j&&Se?.closest?.(j));if(S&&Se?.closest?.(S))return;let $e=!1;const Ct=Ne.currentTarget,gt=Array.from(Ct.querySelectorAll("video")).find(mt=>mt.controls);if(gt){const mt=gt.getBoundingClientRect();if(Ne.clientX>=mt.left&&Ne.clientX<=mt.right&&Ne.clientY>=mt.top&&Ne.clientY<=mt.bottom)if(mt.bottom-Ne.clientY<=72)$e=!0,Ie=!0;else{const Ce=Ne.clientX-mt.left,Pe=mt.right-Ne.clientX;Ce<=64||Pe<=64||($e=!0,Ie=!0)}}const We=Ne.currentTarget.getBoundingClientRect().bottom-Ne.clientY;w&&We<=w&&($e=!0),q.current={id:Ne.pointerId,x:Ne.clientX,y:Ne.clientY,dragging:!1,captured:!1,tapIgnored:Ie,noSwipe:$e};const et=ie.current?.offsetWidth||360;re.current=Math.min(f,et*g),G.current=0},onPointerMove:Ne=>{if(!t||i||q.current.id!==Ne.pointerId||q.current.noSwipe)return;const Se=Ne.clientX-q.current.x,Ie=Ne.clientY-q.current.y;if(!q.current.dragging){if(Math.abs(Ie)>Math.abs(Se)&&Math.abs(Ie)>8){q.current.id=null;return}if(Math.abs(Se)<12)return;q.current.dragging=!0,Ne.currentTarget.style.touchAction="none",X(0);try{Ne.currentTarget.setPointerCapture(Ne.pointerId),q.current.captured=!0}catch{q.current.captured=!1}}const $e=(He,We)=>{const Je=We*.9,et=Math.abs(He);if(et<=Je)return He;const mt=et-Je,Mt=Je+mt*.25;return Math.sign(He)*Mt},Ct=ie.current?.offsetWidth||360;G.current=$e(Se,Ct),O.current==null&&(O.current=requestAnimationFrame(()=>{O.current=null,ue(G.current)}));const st=re.current,gt=Se>st?"right":Se<-st?"left":null;$(He=>{if(He===gt)return He;if(gt)try{navigator.vibrate?.(10)}catch{}return gt})},onPointerUp:Ne=>{if(!t||i||q.current.id!==Ne.pointerId)return;const Se=re.current||Math.min(f,(ie.current?.offsetWidth||360)*g),Ie=q.current.dragging,$e=q.current.captured,Ct=q.current.tapIgnored;if(q.current.id=null,q.current.dragging=!1,q.current.captured=!1,$e)try{Ne.currentTarget.releasePointerCapture(Ne.pointerId)}catch{}if(Ne.currentTarget.style.touchAction="pan-y",!Ie){const gt=Date.now(),He=ee.current,We=He&&Math.hypot(Ne.clientX-He.x,Ne.clientY-He.y)<=W;if(!!k&&He&>-He.t<=V&&We){if(ee.current=null,L(),Y.current)return;Y.current=!0;try{we(Ne.clientX,Ne.clientY)}catch{}requestAnimationFrame(()=>{(async()=>{try{await k?.()}finally{Y.current=!1}})()});return}if(Ct){ee.current={t:gt,x:Ne.clientX,y:Ne.clientY},L(),R.current=window.setTimeout(()=>{R.current=null,ee.current=null},k?V:0);return}pe(),ee.current={t:gt,x:Ne.clientX,y:Ne.clientY},L(),R.current=window.setTimeout(()=>{R.current=null,ee.current=null,a?.()},k?V:0);return}const st=G.current;O.current!=null&&(cancelAnimationFrame(O.current),O.current=null),st>Se?de("right",!0):st<-Se?de("left",!0):le(),G.current=0},onPointerCancel:Ne=>{if(!(!t||i)){if(q.current.captured&&q.current.id!=null)try{Ne.currentTarget.releasePointerCapture(q.current.id)}catch{}q.current={id:null,x:0,y:0,dragging:!1,captured:!1,tapIgnored:!1,noSwipe:!1},O.current!=null&&(cancelAnimationFrame(O.current),O.current=null),G.current=0;try{Ne.currentTarget.style.touchAction="pan-y"}catch{}le()}},children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"relative z-10",children:e}),c.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none rounded-lg transition-opacity duration-100",style:{opacity:Q===0?0:.12+_t*.18,background:Ve==="right"?"linear-gradient(90deg, rgba(16,185,129,0.16) 0%, rgba(16,185,129,0.04) 45%, rgba(0,0,0,0) 100%)":Ve==="left"?"linear-gradient(270deg, rgba(244,63,94,0.16) 0%, rgba(244,63,94,0.04) 45%, rgba(0,0,0,0) 100%)":"transparent"}}),c.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none rounded-lg transition-opacity duration-100",style:{opacity:se?1:0,boxShadow:se==="right"?"inset 0 0 0 1px rgba(16,185,129,0.45), inset 0 0 32px rgba(16,185,129,0.10)":se==="left"?"inset 0 0 0 1px rgba(244,63,94,0.45), inset 0 0 32px rgba(244,63,94,0.10)":"none"}})]})})})});function Ow({children:n,content:e}){const t=m.useRef(null),i=m.useRef(null),[a,l]=m.useState(!1),[u,h]=m.useState(null),f=m.useRef(null),g=()=>{f.current!==null&&(window.clearTimeout(f.current),f.current=null)},w=()=>{g(),f.current=window.setTimeout(()=>{l(!1),f.current=null},150)},S=()=>{g(),l(!0)},A=()=>{w()},C=()=>{g(),l(!1)},j=()=>{const B=t.current,V=i.current;if(!B||!V)return;const W=8,H=8,ie=B.getBoundingClientRect(),Y=V.getBoundingClientRect();let G=ie.bottom+W;if(G+Y.height>window.innerHeight-H){const E=ie.top-Y.height-W;E>=H?G=E:G=Math.max(H,window.innerHeight-Y.height-H)}let re=ie.left;re+Y.width>window.innerWidth-H&&(re=window.innerWidth-Y.width-H),re=Math.max(H,re),h({left:re,top:G})};m.useLayoutEffect(()=>{if(!a)return;const B=requestAnimationFrame(()=>j());return()=>cancelAnimationFrame(B)},[a]),m.useEffect(()=>{if(!a)return;const B=()=>requestAnimationFrame(()=>j());return window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[a]),m.useEffect(()=>()=>g(),[]);const k=()=>typeof e=="function"?e(a,{close:C}):e;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:t,className:"inline-flex",onMouseEnter:S,onMouseLeave:A,children:n}),a&&vu.createPortal(c.jsx("div",{ref:i,className:"fixed z-50",style:{left:u?.left??-9999,top:u?.top??-9999,visibility:u?"visible":"hidden"},onMouseEnter:S,onMouseLeave:A,children:c.jsx(Is,{className:"shadow-lg ring-1 ring-black/10 dark:ring-white/10 max-w-[calc(100vw-16px)]",noBodyPadding:!0,children:k()})}),document.body)]})}const Ef=!0,GN=!1;function cd(n,e){if(!n)return;const t=e?.muted??Ef;n.muted=t,n.defaultMuted=t,n.playsInline=!0,n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","")}function B1(n){return(n||"").split(/[\\/]/).pop()||""}function wu({job:n,getFileName:e,durationSeconds:t,onDuration:i,onResolution:a,animated:l=!1,animatedMode:u="frames",animatedTrigger:h="always",autoTickMs:f=15e3,thumbStepSec:g,thumbSpread:w,thumbSamples:S,clipSeconds:A=.75,clipCount:C=12,variant:j="thumb",className:k,showPopover:B=!0,blur:V=!1,inlineVideo:W=!1,inlineNonce:H=0,inlineControls:ie=!1,inlineLoop:Y=!0,assetNonce:G=0,muted:O=Ef,popoverMuted:re=Ef,noGenerateTeaser:E,alwaysLoadStill:R=!1,teaserPreloadEnabled:ee=!1,teaserPreloadRootMargin:q="700px 0px",scrubProgressRatio:Q,preferScrubProgress:ue=!1}){const se=B1(n.output||"")||e(n.output||""),$=V?"blur-md":"",F=m.useMemo(()=>{const De=n?.meta;if(!De)return null;if(typeof De=="string")try{return JSON.parse(De)}catch{return null}return De},[n]),[X,le]=m.useState(null),de=m.useRef(new Set),L=m.useMemo(()=>!F&&!X?null:F?X?{...F,...X}:F:X,[F,X]),pe=m.useMemo(()=>{let De=L?.previewClips;if(typeof De=="string"){const wt=De.trim();if(wt.length>0)try{const Nt=JSON.parse(wt);return Array.isArray(Nt)&&Nt.length>0,!0}catch{return!0}}if(Array.isArray(De)&&De.length>0)return!0;const vt=L?.preview?.clips;return!!(Array.isArray(vt)&&vt.length>0)},[L]),[we,Be]=m.useState(0),Ve=m.useMemo(()=>{let De=L?.previewClips;if(typeof De=="string")try{De=JSON.parse(De)}catch{De=null}!Array.isArray(De)&&Array.isArray(L?.preview?.clips)&&(De=L.preview.clips);const vt=De;if(!Array.isArray(vt)||vt.length===0)return null;let wt=0;const Nt=[];for(const Gt of vt){const Kt=Number(Gt?.startSeconds),sn=Number(Gt?.durationSeconds);if(!Number.isFinite(Kt)||Kt<0||!Number.isFinite(sn)||sn<=0)continue;const Mn=wt,Yn=wt+sn;Nt.push({start:Kt,dur:sn,cumStart:Mn,cumEnd:Yn}),wt=Yn}return Nt.length?Nt:null},[L]),Oe=m.useMemo(()=>Ve?Ve.map(De=>`${De.start.toFixed(3)}:${De.dur.toFixed(3)}`).join("|"):"",[Ve]),Te=(typeof F?.videoWidth=="number"&&Number.isFinite(F.videoWidth)&&F.videoWidth>0?F.videoWidth:void 0)??(typeof n.videoWidth=="number"&&Number.isFinite(n.videoWidth)&&n.videoWidth>0?n.videoWidth:void 0),_t=(typeof F?.videoHeight=="number"&&Number.isFinite(F.videoHeight)&&F.videoHeight>0?F.videoHeight:void 0)??(typeof n.videoHeight=="number"&&Number.isFinite(n.videoHeight)&&n.videoHeight>0?n.videoHeight:void 0),dt=(typeof F?.fileSize=="number"&&Number.isFinite(F.fileSize)&&F.fileSize>0?F.fileSize:void 0)??(typeof n.sizeBytes=="number"&&Number.isFinite(n.sizeBytes)&&n.sizeBytes>0?n.sizeBytes:void 0),xe=(typeof F?.fps=="number"&&Number.isFinite(F.fps)&&F.fps>0?F.fps:void 0)??(typeof n.fps=="number"&&Number.isFinite(n.fps)&&n.fps>0?n.fps:void 0),Ne=(typeof L?.durationSeconds=="number"&&Number.isFinite(L.durationSeconds)&&L.durationSeconds>0?L.durationSeconds:void 0)??(typeof n.durationSeconds=="number"&&Number.isFinite(n.durationSeconds)&&n.durationSeconds>0?n.durationSeconds:void 0)??(typeof t=="number"&&Number.isFinite(t)&&t>0?t:void 0),Se=typeof Ne=="number"&&Number.isFinite(Ne)&&Ne>0?Ne>1440*60?Ne/1e3:Ne:void 0,Ie=typeof Se=="number"&&Number.isFinite(Se)&&Se>0,$e=typeof Te=="number"&&typeof _t=="number"&&Number.isFinite(Te)&&Number.isFinite(_t)&&Te>0&&_t>0,Ct={muted:O,playsInline:!0,preload:"metadata"},[st,gt]=m.useState(!0),[He,We]=m.useState(!0),[Je,et]=m.useState(!1),[mt,Mt]=m.useState(!1),[fe,qe]=m.useState(!0),Le=m.useRef(""),Ce=m.useRef(""),Pe=m.useRef(null),[Qe,At]=m.useState(!1),[Xt,kt]=m.useState(!1),[mn,It]=m.useState(!1),[$t,Ot]=m.useState(0),[en,Sn]=m.useState(!1),Pn=W===!0||W==="always"?"always":W==="hover"?"hover":"never",St=Pn==="hover"||l&&(u==="clips"||u==="teaser")&&h==="hover",Tn=De=>De.startsWith("HOT ")?De.slice(4):De,tt=m.useMemo(()=>{const De=B1(n.output||"")||e(n.output||"");if(!De)return"";const vt=De.replace(/\.[^.]+$/,"");return Tn(vt).trim()},[n.output,e]),D=m.useMemo(()=>se?`/api/record/video?file=${encodeURIComponent(se)}`:"",[se]),P=j==="fill"?"w-full h-full":"w-20 h-16",ne=m.useRef(null),Re=m.useRef(null),Ge=m.useRef(null),yt=m.useRef({inline:null,teaser:null,clips:null}),tn=(De,vt)=>{vt&&yt.current[De]!==vt&&(yt.current[De]=vt,Be(wt=>wt+1))},[un,vn]=m.useState(0),[,cn]=m.useState(0),Cn=De=>De<0?0:De>1?1:De,xn=(De,vt,wt=A,Nt=!1)=>{if(!De)return{ratio:0,globalSec:0,vvDur:0};const Gt=Number(De.duration);if(!(Number.isFinite(Gt)&&Gt>0))return{ratio:0,globalSec:0,vvDur:0};const sn=Number(De.currentTime);if(!Number.isFinite(sn)||sn<0)return{ratio:0,globalSec:0,vvDur:Gt};const Mn=Ve;let Yn=0;if(Nt&&Array.isArray(Mn)&&Mn.length>0){const Wn=Mn[Mn.length-1];if(sn>=Wn.cumEnd)Yn=typeof vt=="number"&&Number.isFinite(vt)&&vt>0?vt:Wn.start+Wn.dur;else{let Wi=0,Hi=Mn.length-1,bi=0;for(;Wi<=Hi;){const ii=Wi+Hi>>1,Mi=Mn[ii];if(sn=Mi.cumEnd)Wi=ii+1;else{bi=ii;break}}return Yn=Mn[bi].start,{ratio:Mn.length>0?Cn(bi/Mn.length):0,globalSec:Math.max(0,Yn),vvDur:Gt}}}return Number.isFinite(wt)&&wt>0?Yn=Math.floor(sn/wt)*wt:Yn=sn,{ratio:Cn(Math.min(Yn,Gt)/Gt),globalSec:Math.max(0,Yn),vvDur:Gt}},on=De=>{if(De){try{De.pause()}catch{}try{De.removeAttribute("src"),De.src="",De.load()}catch{}}};m.useEffect(()=>{Mt(!1),qe(!0),le(null),Le.current="",Ce.current="",et(!1)},[tt,G,E]),m.useEffect(()=>{const De=vt=>{const wt=String(vt?.detail?.file??"");!wt||wt!==se||(on(ne.current),on(Re.current),on(Ge.current))};return window.addEventListener("player:release",De),window.addEventListener("player:close",De),()=>{window.removeEventListener("player:release",De),window.removeEventListener("player:close",De)}},[se]),m.useEffect(()=>{const De=Pe.current;if(!De)return;const vt=new IntersectionObserver(wt=>{const Nt=!!wt[0]?.isIntersecting;At(Nt),Nt&&It(!0)},{threshold:.01,rootMargin:"0px"});return vt.observe(De),()=>vt.disconnect()},[]),m.useEffect(()=>{const De=Pe.current;if(!De)return;if(!ee){kt(Qe);return}let vt=!0;const wt=new IntersectionObserver(Nt=>{Nt[0]?.isIntersecting&&(kt(!0),vt&&(vt=!1,wt.disconnect()))},{threshold:0,rootMargin:q});return wt.observe(De),()=>wt.disconnect()},[ee,q,Qe]),m.useEffect(()=>{if(!l||u!=="frames"||!Qe||document.hidden)return;const De=window.setInterval(()=>Ot(vt=>vt+1),f);return()=>window.clearInterval(De)},[l,u,Qe,f]);const Rn=m.useMemo(()=>{if(!l||u!=="frames"||!Ie)return null;const De=Se,vt=Math.max(.25,g??3);if(w){const Gt=Math.max(4,Math.min(S??16,Math.floor(De))),Kt=$t%Gt,sn=Math.max(.1,De-vt),Mn=Math.min(.25,sn*.02),Yn=Kt/Gt*sn+Mn;return Math.min(De-.05,Math.max(.05,Yn))}const wt=Math.max(De-.1,vt),Nt=$t*vt%wt;return Math.min(De-.05,Math.max(.05,Nt))},[l,u,Ie,Se,$t,g,w,S]),qt=G??0,Bt=m.useMemo(()=>tt?Rn==null?`/api/preview?id=${encodeURIComponent(tt)}&v=${qt}`:`/api/preview?id=${encodeURIComponent(tt)}&t=${Rn}&v=${qt}`:"",[tt,Rn,qt]),Zt=m.useMemo(()=>{if(!tt)return"";const De=E?"&noGenerate=1":"";return`/api/generated/teaser?id=${encodeURIComponent(tt)}${De}&v=${qt}`},[tt,qt,E]),zt=Pn!=="never"&&Qe&&He&&(Pn==="always"||Pn==="hover"&&en),Pt=l&&Qe&&!document.hidden&&He&&!zt&&(h==="always"||en)&&(u==="teaser"&&fe&&!!Zt||u==="clips"&&Ie),Nn=Ie&&typeof Se=="number"?Se:void 0,Ft=R||Qe||mn||St&&en,Qn=Xt||Qe||mn||St&&en;m.useEffect(()=>{let De=!1;if(i&&Ie){const vt=Number(Se),wt=`${se}|dur|${vt}`;Le.current!==wt&&(Le.current=wt,i(n,vt),De=!0)}if(a&&$e){const vt=Number(Te),wt=Number(_t),Nt=`${se}|res|${vt}x${wt}`;Ce.current!==Nt&&(Ce.current=Nt,a(n,vt,wt),De=!0)}De&&et(!0)},[se,n,i,a,Ie,$e,Se,Te,_t]),m.useEffect(()=>{if(!tt||!se||!l||u!=="teaser"||!Qn||pe||de.current.has(se))return;let De=!1;const vt=new AbortController,wt=async Nt=>{try{const Gt=await fetch(Nt,{signal:vt.signal,cache:"no-store",credentials:"include"});return Gt.ok?await Gt.json():null}catch{return null}};return(async()=>{const Nt=await wt(`/api/record/done/meta?file=${encodeURIComponent(se)}`);De||(de.current.add(se),Nt&&le(Nt))})(),()=>{De=!0,vt.abort()}},[tt,se,l,u,Qn,pe]);const Xn=De=>{et(!0);const vt=De.currentTarget;if(i&&!Ie){const wt=Number(vt.duration);if(Number.isFinite(wt)&&wt>0){const Nt=`${se}|dur|${wt}`;Le.current!==Nt&&(Le.current=Nt,i(n,wt))}}if(a&&!$e){const wt=Number(vt.videoWidth),Nt=Number(vt.videoHeight);if(Number.isFinite(wt)&&Number.isFinite(Nt)&&wt>0&&Nt>0){const Gt=`${se}|res|${wt}x${Nt}`;Ce.current!==Gt&&(Ce.current=Gt,a(n,wt,Nt))}}};if(m.useEffect(()=>{gt(!0),We(!0),yt.current.inline=null,yt.current.teaser=null,yt.current.clips=null},[tt,G]),!D)return c.jsx("div",{className:[P,"rounded bg-gray-100 dark:bg-white/5"].join(" ")});const Gn=Qn,ln=l&&u==="teaser"&&fe&&!!Zt&&!zt&&Qn,Zn=zt?ne:!zt&&Pt&&u==="teaser"?Re:!zt&&Pt&&u==="clips"?Ge:null,ti=!!Zn&&Qe,jn=zt?"inline":Pt&&u==="teaser"?"teaser":"clips",Kn=l&&u==="frames"&&Ie&&typeof Rn=="number"&&Number.isFinite(Rn)&&Rn>=0,rn=Kn?Cn(Rn/Se):0,Di=!zt&&ue&&typeof Q=="number"&&Number.isFinite(Q),oi=Di?Cn(Q):ti?un:Kn?rn:0,di=!zt&&(Di||(ti||Kn)),Ci=m.useMemo(()=>{if(!Ie)return null;const De=Se;if(!(De>0))return null;let wt=L?.previewClips;if(typeof wt=="string")try{wt=JSON.parse(wt)}catch{wt=null}if(!Array.isArray(wt)||wt.length===0)return null;const Nt=wt.map(Gt=>({start:Number(Gt?.startSeconds),dur:Number(Gt?.durationSeconds)})).filter(Gt=>Number.isFinite(Gt.start)&&Gt.start>=0&&Number.isFinite(Gt.dur)&&Gt.dur>0);return Nt.length?Nt.map(Gt=>{const Kt=Cn(Gt.start/De),sn=Cn(Gt.dur/De);return{left:Kt,width:sn,start:Gt.start,dur:Gt.dur}}):null},[L,Ie,Se]),Fn=m.useMemo(()=>{if(!l)return[];if(u!=="clips")return[];if(!Ie)return[];const De=Se,vt=Math.max(.25,A),wt=Math.max(8,Math.min(C??S??12,Math.floor(De))),Nt=Math.max(.1,De-vt),Gt=Math.min(.25,Nt*.02),Kt=[];for(let sn=0;snFn.map(De=>De.toFixed(2)).join(","),[Fn]),$n=m.useRef(0),_e=m.useRef(0);m.useEffect(()=>{const De=Re.current;if(!De)return;if(!(Pt&&u==="teaser")){try{De.pause()}catch{}return}cd(De,{muted:O});const wt=De.play?.();wt&&typeof wt.catch=="function"&&wt.catch(()=>{})},[Pt,u,Zt,O]),m.useEffect(()=>{if(!ti){vn(0),cn(0);return}const De=Zn?.current??null;if(!De){vn(0),cn(0);return}let vt=!1,wt=null;const Nt=()=>{if(vt||!De.isConnected)return;const sn=jn==="teaser"&&Array.isArray(Ve)&&Ve.length>0,Mn=xn(De,Nn,A,sn);vn(Mn.ratio),cn(Mn.globalSec)};Nt(),wt=window.setInterval(Nt,100);const Gt=()=>Nt(),Kt=()=>Nt();return De.addEventListener("loadedmetadata",Gt),De.addEventListener("durationchange",Gt),De.addEventListener("timeupdate",Kt),()=>{vt=!0,wt!=null&&window.clearInterval(wt),De.removeEventListener("loadedmetadata",Gt),De.removeEventListener("durationchange",Gt),De.removeEventListener("timeupdate",Kt)}},[ti,Zn,Nn,Oe,jn,Ve,we]),m.useEffect(()=>{zt&&cd(ne.current,{muted:O})},[zt,O]),m.useEffect(()=>{const De=Ge.current;if(!De)return;if(!(Pt&&u==="clips")){Pt||De.pause();return}if(!Fn.length)return;$n.current=$n.current%Fn.length,_e.current=Fn[$n.current];const vt=()=>{try{De.currentTime=_e.current}catch{}const Gt=De.play();Gt&&typeof Gt.catch=="function"&&Gt.catch(()=>{})},wt=()=>vt(),Nt=()=>{if(Fn.length&&De.currentTime-_e.current>=A){$n.current=($n.current+1)%Fn.length,_e.current=Fn[$n.current];try{De.currentTime=_e.current+.01}catch{}}};return De.addEventListener("loadedmetadata",wt),De.addEventListener("timeupdate",Nt),De.readyState>=1&&vt(),()=>{De.removeEventListener("loadedmetadata",wt),De.removeEventListener("timeupdate",Nt),De.pause()}},[Pt,u,On,A,Fn]);const nt=(Xt||Qe)&&(i||a)&&!Je&&!zt&&(i&&!Ie||a&&!$e),ht=!!Ci&&(jn==="teaser"||!zt&&Di&&u==="teaser"),Ht=c.jsxs("div",{ref:Pe,className:["group bg-gray-100 dark:bg-white/5 overflow-hidden relative",P,k??""].join(" "),onMouseEnter:St?()=>Sn(!0):void 0,onMouseLeave:St?()=>Sn(!1):void 0,onFocus:St?()=>Sn(!0):void 0,onBlur:St?()=>Sn(!1):void 0,"data-duration":Ie?String(Se):void 0,"data-res":$e?`${Te}x${_t}`:void 0,"data-size":typeof dt=="number"?String(dt):void 0,"data-fps":typeof xe=="number"?String(xe):void 0,children:[Ft&&Bt&&st?c.jsx("img",{src:Bt,loading:R?"eager":"lazy",decoding:"async",alt:se,className:["absolute inset-0 w-full h-full object-cover",$].filter(Boolean).join(" "),onError:()=>gt(!1)}):c.jsx("div",{className:"absolute inset-0 bg-black/10 dark:bg-white/10"}),zt?m.createElement("video",{...Ct,ref:De=>{ne.current=De,tn("inline",De)},key:`inline-${tt}-${H}`,src:D,className:["absolute inset-0 w-full h-full object-cover",$,ie?"pointer-events-auto":"pointer-events-none"].filter(Boolean).join(" "),autoPlay:!0,muted:O,controls:ie,loop:Y,poster:Gn&&Bt||void 0,onLoadedMetadata:Xn,onError:()=>We(!1)}):null,!zt&&ln&&!(Pt&&u==="teaser")?c.jsx("video",{src:Zt,className:"hidden",muted:!0,playsInline:!0,preload:"auto",onLoadedData:()=>Mt(!0),onCanPlay:()=>Mt(!0),onError:()=>{qe(!1),Mt(!1)}},`teaser-prewarm-${tt}`):null,!zt&&Pt&&u==="teaser"?c.jsx("video",{ref:De=>{Re.current=De,tn("teaser",De)},src:Zt,className:["absolute inset-0 w-full h-full object-cover pointer-events-none",$,mt?"opacity-100":"opacity-0","transition-opacity duration-150"].filter(Boolean).join(" "),muted:O,playsInline:!0,autoPlay:!0,loop:!0,preload:mt?"auto":"metadata",poster:Gn&&Bt||void 0,onLoadedData:()=>Mt(!0),onPlaying:()=>Mt(!0),onError:()=>{qe(!1),Mt(!1)}},`teaser-mp4-${tt}`):null,!zt&&Pt&&u==="clips"?c.jsx("video",{ref:De=>{Ge.current=De,tn("clips",De)},src:D,className:["absolute inset-0 w-full h-full object-cover pointer-events-none",$].filter(Boolean).join(" "),muted:O,playsInline:!0,preload:"metadata",poster:Gn&&Bt||void 0,onError:()=>We(!1)},`clips-${tt}-${On}`):null,di?c.jsxs("div",{"aria-hidden":"true",className:["absolute left-0 right-0 bottom-0 z-40 pointer-events-none","h-0.5 group-hover:h-1","transition-[height] duration-150 ease-out","rounded-none group-hover:rounded-full","bg-black/35 dark:bg-white/10","overflow-hidden group-hover:overflow-visible"].join(" "),children:[ht?c.jsx("div",{className:"absolute inset-0",children:Ci.map((De,vt)=>c.jsx("div",{className:"absolute top-0 bottom-0 bg-white/15 dark:bg-white/20",style:{left:`${De.left*100}%`,width:`${De.width*100}%`}},`seg-${vt}-${De.left.toFixed(6)}-${De.width.toFixed(6)}`))}):null,c.jsx("div",{className:["absolute inset-0 origin-left",jn==="teaser"?"":"transition-transform duration-150 ease-out"].join(" "),style:{transform:`scaleX(${Cn(oi)})`,background:"rgba(99,102,241,0.95)"}})]}):null,nt?c.jsx("video",{src:D,preload:"metadata",muted:O,playsInline:!0,className:"hidden",onLoadedMetadata:Xn}):null]});return B?c.jsx(Ow,{content:De=>De&&c.jsx("div",{className:"w-[420px]",children:c.jsx("div",{className:"aspect-video",children:c.jsx("video",{src:D,className:["w-full h-full bg-black",$].filter(Boolean).join(" "),muted:re,playsInline:!0,preload:"metadata",controls:!0,autoPlay:!0,loop:!0,onClick:vt=>vt.stopPropagation(),onMouseDown:vt=>vt.stopPropagation()})})}),children:Ht}):Ht}function Bn(...n){return n.filter(Boolean).join(" ")}const KN=n=>(n||"").replaceAll("\\","/").trim().split("/").pop()||"",WN=n=>n.startsWith("HOT ")?n.slice(4):n,XN=/^(.*?)_\d{1,2}_\d{1,2}_\d{4}__\d{1,2}-\d{2}-\d{2}/;function YN(n){const t=WN(KN(n||"")).replace(/\.[^.]+$/,""),i=t.match(XN);if(i?.[1]?.trim())return i[1].trim();const a=t.lastIndexOf("_");return a>0?t.slice(0,a):t||null}function Bs({job:n,variant:e="overlay",collapseToMenu:t=!1,inlineCount:i,busy:a=!1,compact:l=!1,isHot:u=!1,isFavorite:h=!1,isLiked:f=!1,isWatching:g=!1,onToggleFavorite:w,onToggleLike:S,onToggleHot:A,onKeep:C,onDelete:j,onToggleWatch:k,onAddToDownloads:B,order:V,className:W}){const H=e==="overlay"?l?"p-1.5":"p-2":"p-1.5",ie=l?"size-4":"size-5",Y="h-full w-full",G=e==="table"?`inline-flex items-center justify-center rounded-md ${H} hover:bg-gray-100/70 dark:hover:bg-white/5 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/60 disabled:opacity-50 disabled:cursor-not-allowed transition-transform active:scale-95`:`inline-flex items-center justify-center rounded-md bg-white/75 ${H} text-gray-900 backdrop-blur ring-1 ring-black/10 hover:bg-white/90 dark:bg-black/40 dark:text-white dark:ring-white/10 dark:hover:bg-black/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/60 dark:focus-visible:ring-white/40 disabled:opacity-50 disabled:cursor-not-allowed transition-transform active:scale-95`,O=e==="table"?{favOn:"text-amber-600 dark:text-amber-300",likeOn:"text-rose-600 dark:text-rose-300",hotOn:"text-amber-600 dark:text-amber-300",off:"text-gray-500 dark:text-gray-300",keep:"text-emerald-600 dark:text-emerald-300",del:"text-red-600 dark:text-red-300",watchOn:"text-sky-600 dark:text-sky-300"}:{favOn:"text-amber-600 dark:text-amber-300",likeOn:"text-rose-600 dark:text-rose-300",hotOn:"text-amber-600 dark:text-amber-300",off:"text-gray-800/90 dark:text-white/90",keep:"text-emerald-600 dark:text-emerald-200",del:"text-red-600 dark:text-red-300",watchOn:"text-sky-600 dark:text-sky-200"},re=V??["watch","favorite","like","hot","keep","delete","details"],E=tt=>re.includes(tt),R=String(n?.sourceUrl??"").trim(),ee=YN(n.output||""),q=ee?`Mehr zu ${ee} anzeigen`:"Mehr anzeigen",Q=E("favorite"),ue=E("like"),se=E("hot"),$=E("watch"),F=E("keep"),X=E("delete"),le=E("details")&&!!ee,de=E("add"),[L,pe]=m.useState("idle"),we=m.useRef(null);m.useEffect(()=>()=>{we.current&&window.clearTimeout(we.current)},[]);const Be=()=>{pe("ok"),we.current&&window.clearTimeout(we.current),we.current=window.setTimeout(()=>pe("idle"),800)},Ve=async()=>{if(a||L==="busy"||!B&&!!!R)return!1;pe("busy");try{let D=!0;return B?D=await B(n)!==!1:R?(window.dispatchEvent(new CustomEvent("downloads:add-url",{detail:{url:R}})),D=!0):D=!1,D?Be():pe("idle"),D}catch{return pe("idle"),!1}},[Oe,Te]=m.useState(0),[_t,dt]=m.useState(4),xe=tt=>D=>{D.preventDefault(),D.stopPropagation(),!(a||!tt)&&Promise.resolve(tt(n)).catch(()=>{})},Ne=le?c.jsxs("button",{type:"button",className:Bn(G),title:q,"aria-label":q,disabled:a,onClick:tt=>{tt.preventDefault(),tt.stopPropagation(),!a&&window.dispatchEvent(new CustomEvent("open-model-details",{detail:{modelKey:ee}}))},children:[c.jsx("span",{className:Bn("inline-flex items-center justify-center",ie),children:c.jsx(O1,{className:Bn(Y,O.off)})}),c.jsx("span",{className:"sr-only",children:q})]}):null,Se=de?c.jsxs("button",{type:"button",className:Bn(G),title:R?"URL zu Downloads hinzufügen":"Keine URL vorhanden","aria-label":"Zu Downloads hinzufügen",disabled:a||L==="busy"||!B&&!R,onClick:async tt=>{tt.preventDefault(),tt.stopPropagation(),await Ve()},children:[c.jsx("span",{className:Bn("inline-flex items-center justify-center",ie),children:L==="ok"?c.jsx(jw,{className:Bn(Y,"text-emerald-600 dark:text-emerald-300")}):c.jsx(M1,{className:Bn(Y,O.off)})}),c.jsx("span",{className:"sr-only",children:"Zu Downloads"})]}):null,Ie=Q?c.jsx("button",{type:"button",className:G,title:h?"Favorit entfernen":"Als Favorit markieren","aria-label":h?"Favorit entfernen":"Als Favorit markieren","aria-pressed":h,disabled:a||!w,onClick:xe(w),children:c.jsxs("span",{className:Bn("relative inline-block",ie),children:[c.jsx(Sf,{className:Bn("absolute inset-0 transition-all duration-200 ease-out motion-reduce:transition-none",h?"opacity-0 scale-75 rotate-12":"opacity-100 scale-100 rotate-0",Y,O.off)}),c.jsx(_u,{className:Bn("absolute inset-0 transition-all duration-200 ease-out motion-reduce:transition-none",h?"opacity-100 scale-110 rotate-0":"opacity-0 scale-75 -rotate-12",Y,O.favOn)})]})}):null,$e=ue?c.jsx("button",{type:"button",className:G,title:f?"Gefällt mir entfernen":"Als Gefällt mir markieren","aria-label":f?"Gefällt mir entfernen":"Als Gefällt mir markieren","aria-pressed":f,disabled:a||!S,onClick:xe(S),children:c.jsxs("span",{className:Bn("relative inline-block",ie),children:[c.jsx(td,{className:Bn("absolute inset-0 transition-all duration-200 ease-out motion-reduce:transition-none",f?"opacity-0 scale-75 rotate-12":"opacity-100 scale-100 rotate-0",Y,O.off)}),c.jsx(bl,{className:Bn("absolute inset-0 transition-all duration-200 ease-out motion-reduce:transition-none",f?"opacity-100 scale-110 rotate-0":"opacity-0 scale-75 -rotate-12",Y,O.likeOn)})]})}):null,Ct=se?c.jsx("button",{type:"button","data-hot-target":!0,className:G,title:u?"HOT entfernen":"Als HOT markieren","aria-label":u?"HOT entfernen":"Als HOT markieren","aria-pressed":u,disabled:a||!A,onClick:xe(A),children:c.jsxs("span",{className:Bn("relative inline-block",ie),children:[c.jsx(j1,{className:Bn("absolute inset-0 transition-all duration-200 ease-out",u?"opacity-0 scale-75 rotate-12":"opacity-100 scale-100 rotate-0",Y,O.off)}),c.jsx(Bg,{className:Bn("absolute inset-0 transition-all duration-200 ease-out",u?"opacity-100 scale-110 rotate-0":"opacity-0 scale-75 -rotate-12",Y,O.hotOn)})]})}):null,st=$?c.jsx("button",{type:"button",className:G,title:g?"Watched entfernen":"Als Watched markieren","aria-label":g?"Watched entfernen":"Als Watched markieren","aria-pressed":g,disabled:a||!k,onClick:xe(k),children:c.jsxs("span",{className:Bn("relative inline-block",ie),children:[c.jsx(wf,{className:Bn("absolute inset-0 transition-all duration-200 ease-out",g?"opacity-0 scale-75 rotate-12":"opacity-100 scale-100 rotate-0",Y,O.off)}),c.jsx(yl,{className:Bn("absolute inset-0 transition-all duration-200 ease-out",g?"opacity-100 scale-110 rotate-0":"opacity-0 scale-75 -rotate-12",Y,O.watchOn)})]})}):null,gt=F?c.jsx("button",{type:"button",className:G,title:"Behalten (nach keep verschieben)","aria-label":"Behalten",disabled:a||!C,onClick:xe(C),children:c.jsx("span",{className:Bn("inline-flex items-center justify-center",ie),children:c.jsx(R1,{className:Bn(Y,O.keep)})})}):null,He=X?c.jsx("button",{type:"button",className:G,title:"Löschen","aria-label":"Löschen",disabled:a||!j,onClick:xe(j),children:c.jsx("span",{className:Bn("inline-flex items-center justify-center",ie),children:c.jsx(L1,{className:Bn(Y,O.del)})})}):null,We={details:Ne,add:Se,favorite:Ie,like:$e,watch:st,hot:Ct,keep:gt,delete:He},Je=t,et=re.filter(tt=>!!We[tt]),mt=Je&&typeof i!="number",qe=(l?16:20)+(e==="overlay"?l?6:8:6)*2,Le=l?2:3,Ce=m.useMemo(()=>{if(!mt)return i??Le;const tt=Oe||0;if(tt<=0)return Math.min(et.length,Le);for(let D=et.length;D>=0;D--)if(D*qe+qe+(D>0?D*_t:0)<=tt)return D;return 0},[mt,i,Le,Oe,et.length,qe,_t]),Pe=Je?et.slice(0,Ce):et,Qe=Je?et.slice(Ce):[],[At,Xt]=m.useState(!1),kt=m.useRef(null);m.useLayoutEffect(()=>{const tt=kt.current;if(!tt||typeof window>"u")return;const D=()=>{const ne=kt.current;if(!ne)return;const Re=Math.floor(ne.getBoundingClientRect().width||0);Re>0&&Te(Re);const Ge=window.getComputedStyle(ne),yt=Ge.columnGap||Ge.gap||"0",tn=parseFloat(yt);Number.isFinite(tn)&&tn>=0&&dt(tn)};D();const P=new ResizeObserver(()=>D());return P.observe(tt),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D),P.disconnect()}},[]);const mn=m.useRef(null),It=m.useRef(null),$t=208,Ot=4,en=8,[Sn,Pn]=m.useState(null);m.useEffect(()=>{if(!At)return;const tt=P=>{P.key==="Escape"&&Xt(!1)},D=P=>{const ne=kt.current,Re=It.current,Ge=P.target;ne&&ne.contains(Ge)||Re&&Re.contains(Ge)||Xt(!1)};return window.addEventListener("keydown",tt),window.addEventListener("mousedown",D),()=>{window.removeEventListener("keydown",tt),window.removeEventListener("mousedown",D)}},[At]),m.useLayoutEffect(()=>{if(!At){Pn(null);return}const tt=()=>{const D=mn.current;if(!D)return;const P=D.getBoundingClientRect(),ne=window.innerWidth,Re=window.innerHeight;let Ge=P.right-$t;Ge=Math.max(en,Math.min(Ge,ne-$t-en));let yt=P.bottom+Ot;yt=Math.max(en,Math.min(yt,Re-en));const tn=Math.max(120,Re-yt-en);Pn({top:yt,left:Ge,maxH:tn})};return tt(),window.addEventListener("resize",tt),window.addEventListener("scroll",tt,!0),()=>{window.removeEventListener("resize",tt),window.removeEventListener("scroll",tt,!0)}},[At]);const St=()=>{ee&&window.dispatchEvent(new CustomEvent("open-model-details",{detail:{modelKey:ee}}))},Tn=tt=>tt==="details"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a,onClick:D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),St()},children:[c.jsx(O1,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:"Details"})]},"details"):tt==="add"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!B&&!R,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await Ve()},children:[c.jsx(M1,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:"Zu Downloads"})]},"add"):tt==="favorite"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!w,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await w?.(n)},children:[h?c.jsx(_u,{className:Bn("size-4",O.favOn)}):c.jsx(Sf,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:h?"Favorit entfernen":"Als Favorit markieren"})]},"favorite"):tt==="like"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!S,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await S?.(n)},children:[f?c.jsx(bl,{className:Bn("size-4",O.favOn)}):c.jsx(td,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:f?"Gefällt mir entfernen":"Gefällt mir"})]},"like"):tt==="watch"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!k,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await k?.(n)},children:[g?c.jsx(yl,{className:Bn("size-4",O.favOn)}):c.jsx(wf,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:g?"Watched entfernen":"Watched"})]},"watch"):tt==="hot"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!A,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await A?.(n)},children:[u?c.jsx(Bg,{className:Bn("size-4",O.favOn)}):c.jsx(j1,{className:Bn("size-4",O.off)}),c.jsx("span",{className:"truncate",children:u?"HOT entfernen":"Als HOT markieren"})]},"hot"):tt==="keep"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!C,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await C?.(n)},children:[c.jsx(R1,{className:Bn("size-4",O.keep)}),c.jsx("span",{className:"truncate",children:"Behalten"})]},"keep"):tt==="delete"?c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-gray-100/70 dark:hover:bg-white/5 disabled:opacity-50",disabled:a||!j,onClick:async D=>{D.preventDefault(),D.stopPropagation(),Xt(!1),await j?.(n)},children:[c.jsx(L1,{className:Bn("size-4",O.del)}),c.jsx("span",{className:"truncate",children:"Löschen"})]},"delete"):null;return c.jsxs("div",{ref:kt,className:Bn("relative flex items-center flex-nowrap",W??"gap-2"),children:[Pe.map(tt=>{const D=We[tt];return D?c.jsx(m.Fragment,{children:D},tt):null}),Je&&Qe.length>0?c.jsxs("div",{className:"relative",children:[c.jsx("button",{ref:mn,type:"button",className:G,"aria-label":"Mehr",title:"Mehr","aria-haspopup":"menu","aria-expanded":At,disabled:a,onClick:tt=>{tt.preventDefault(),tt.stopPropagation(),!a&&Xt(D=>!D)},children:c.jsx("span",{className:Bn("inline-flex items-center justify-center",ie),children:c.jsx(VA,{className:Bn(Y,O.off)})})}),At&&Sn&&typeof document<"u"?vu.createPortal(c.jsx("div",{ref:It,role:"menu",className:"rounded-md bg-white/95 dark:bg-gray-900/95 shadow-lg ring-1 ring-black/10 dark:ring-white/10 p-1 z-[9999] overflow-auto",style:{position:"fixed",top:Sn.top,left:Sn.left,width:$t,maxHeight:Sn.maxH},onClick:tt=>tt.stopPropagation(),children:Qe.map(Tn)}),document.body):null]}):null]})}function ws({tag:n,children:e,title:t,active:i,onClick:a,maxWidthClassName:l="max-w-[11rem]",className:u,stopPropagation:h=!0}){const f=n??(typeof e=="string"||typeof e=="number"?String(e):""),g=gn("inline-flex shrink-0 items-center truncate rounded-md px-2 py-0.5 text-xs",l,"bg-sky-50 text-sky-700 dark:bg-sky-500/10 dark:text-sky-200"),A=gn(g,i?"bg-sky-100 text-sky-800 dark:bg-sky-400/20 dark:text-sky-100":"",a?"cursor-pointer hover:bg-sky-100 dark:hover:bg-sky-400/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500":"",u),C=k=>k.stopPropagation(),j=h?{onPointerDown:C,onMouseDown:C}:{};return a?c.jsx("button",{type:"button",className:A,title:t??f,"aria-pressed":!!i,...j,onClick:k=>{h&&(k.preventDefault(),k.stopPropagation()),f&&a(f)},children:e??n}):c.jsx("span",{className:A,title:t??f,...j,onClick:h?C:void 0,children:e??n})}function dd({rowKey:n,tags:e,activeTagSet:t,lower:i,onToggleTagFilter:a,maxVisible:l,maxWidthClassName:u,gapPx:h=6,className:f}){const[g,w]=m.useState(!1),S=m.useRef(null),A=m.useRef(null),C=m.useRef(null);m.useEffect(()=>w(!1),[n]),m.useEffect(()=>{if(!g)return;const O=re=>{re.key==="Escape"&&w(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[g]);const j=m.useMemo(()=>typeof l=="number"&&l>0?l:Number.POSITIVE_INFINITY,[l]),k=m.useMemo(()=>[...e].sort((O,re)=>O.localeCompare(re,void 0,{sensitivity:"base"})),[e]),[B,V]=m.useState(()=>{const O=Math.min(k.length,j);return Math.min(O,6)}),W=m.useCallback(()=>{const O=S.current,re=A.current;if(!O||!re)return;const E=Math.floor(O.getBoundingClientRect().width);if(E<=0)return;const R=Math.min(k.length,j);if(R<=0){V(0);return}const q=Array.from(re.children).map(F=>F.offsetWidth).slice(0,R),Q=C.current?.offsetWidth??0,ue=2,se=F=>{let X=0,le=0;for(let de=0;de0?h:0);if(X+L<=F-ue)X+=L,le++;else break}return le};let $=se(E);if($0?Q+h:0,X=Math.max(0,E-F);$=se(X),$=Math.max(0,$)}V(Math.max(0,Math.min($,R)))},[k,j,h]);m.useLayoutEffect(()=>{W()},[W,k.join("\0"),u,j]),m.useEffect(()=>{const O=S.current;if(!O)return;const re=new ResizeObserver(()=>W());return re.observe(O),()=>re.disconnect()},[W]);const H=Math.min(k.length,j),ie=k.slice(0,Math.min(B,H)),Y=O=>O.stopPropagation(),G=k.length-ie.length;return c.jsxs(c.Fragment,{children:[g?null:c.jsxs("div",{ref:S,className:["mt-2 h-6 flex items-center gap-1.5",f].filter(Boolean).join(" "),onClick:Y,onMouseDown:Y,onPointerDown:Y,children:[c.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:c.jsx("div",{className:"flex flex-nowrap items-center gap-1.5",children:ie.length>0?ie.map(O=>c.jsx(ws,{tag:O,active:t.has(i(O)),onClick:a,maxWidthClassName:u},O)):c.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:"—"})})}),G>0?c.jsxs("button",{type:"button",className:["inline-flex shrink-0 items-center truncate rounded-md px-2 py-0.5 text-xs","cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500","bg-gray-100 text-gray-700 hover:bg-gray-200/70","dark:bg-white/10 dark:text-gray-200 dark:hover:bg-white/20"].join(" "),onClick:O=>{O.preventDefault(),O.stopPropagation(),w(!0)},title:"Alle Tags anzeigen","aria-haspopup":"dialog","aria-expanded":!1,children:["+",G]}):null]}),g?c.jsxs("div",{className:["absolute inset-0 z-30","bg-white/60 dark:bg-gray-950","px-3 py-3","pointer-events-auto"].join(" "),onClick:Y,onMouseDown:Y,onPointerDown:Y,role:"dialog","aria-label":"Tags",children:[c.jsx("button",{type:"button",className:`\r - absolute right-2 top-2 z-10\r - rounded-md bg-gray-100/80 px-2 py-1 text-xs font-semibold text-gray-700\r - hover:bg-gray-200/80\r - dark:bg-white/10 dark:text-gray-200 dark:hover:bg-white/20\r - `,onClick:()=>w(!1),"aria-label":"Schließen",title:"Schließen",children:"✕"}),c.jsx("div",{className:"h-full overflow-auto pr-1",children:c.jsx("div",{className:"flex flex-wrap gap-1.5",children:k.map(O=>c.jsx(ws,{tag:O,active:t.has(i(O)),onClick:a,maxWidthClassName:u},O))})})]}):null,c.jsxs("div",{className:"absolute -left-[9999px] -top-[9999px] opacity-0 pointer-events-none",children:[c.jsx("div",{ref:A,className:"flex flex-nowrap items-center gap-1.5",children:k.slice(0,H).map(O=>c.jsx(ws,{tag:O,active:t.has(i(O)),onClick:a,maxWidthClassName:u},O))}),c.jsx("button",{ref:C,type:"button",className:"inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-200",children:"+99"})]})]})}function P1(n,e,t){return Math.max(e,Math.min(t,n))}function QN(n){const e=Math.max(0,Math.floor(n)),t=Math.floor(e/60),i=e%60;return`${t}:${String(i).padStart(2,"0")}`}function xy({imageCount:n,activeIndex:e,onActiveIndexChange:t,onIndexClick:i,className:a,stepSeconds:l=0}){const u=m.useRef(null),h=m.useRef(null),f=m.useRef(void 0),g=m.useCallback(()=>{h.current=null,t(f.current)},[t]),w=m.useCallback(Y=>{f.current=Y,h.current==null&&(h.current=window.requestAnimationFrame(g))},[g]);m.useEffect(()=>()=>{h.current!=null&&(window.cancelAnimationFrame(h.current),h.current=null)},[]);const S=m.useCallback(Y=>{if(!u.current||n<1)return;const G=u.current.getBoundingClientRect();if(G.width<=0)return;const O=Y-G.left,re=P1(O/G.width,0,.999999);return P1(Math.floor(re*n),0,n-1)},[n]),A=m.useCallback(Y=>{const G=S(Y.clientX);w(G)},[S,w]),C=m.useCallback(Y=>{const G=S(Y.clientX);w(G)},[S,w]),j=m.useCallback(()=>{w(void 0)},[w]),k=m.useCallback(Y=>{Y.stopPropagation();const G=S(Y.clientX);w(G);try{Y.currentTarget.setPointerCapture?.(Y.pointerId)}catch{}},[S,w]),B=m.useCallback(Y=>{if(Y.stopPropagation(),!i)return;const G=S(Y.clientX);typeof G=="number"&&i(G)},[S,i]);if(!n||n<1)return null;const V=typeof e=="number"?(e+.5)/n*100:void 0,W=typeof e=="number"?l>0?QN(e*l):`${e+1}/${n}`:"",H=typeof e=="number",ie=typeof V=="number"?{left:`clamp(24px, ${V}%, calc(100% - 24px))`,transform:"translateX(-50%)"}:void 0;return c.jsxs("div",{ref:u,className:["relative h-7 w-full select-none touch-none cursor-col-resize","opacity-0 transition-opacity duration-150","pointer-events-none","group-hover:opacity-100 group-focus-within:opacity-100","group-hover:pointer-events-auto group-focus-within:pointer-events-auto",a].filter(Boolean).join(" "),onPointerMove:A,onPointerEnter:C,onPointerLeave:j,onPointerDown:k,onMouseDown:Y=>Y.stopPropagation(),onClick:B,title:H?W:`Preview scrubber (${n})`,role:"slider","aria-label":"Preview scrubber","aria-valuemin":1,"aria-valuemax":n,"aria-valuenow":typeof e=="number"?e+1:void 0,children:[c.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-4 bg-white/35 ring-1 ring-white/40 backdrop-blur-[1px]",children:typeof V=="number"?c.jsx("div",{className:"absolute inset-y-0 w-[2px] bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.35)]",style:{left:`${V}%`,transform:"translateX(-50%)"}}):null}),c.jsx("div",{className:["pointer-events-none absolute bottom-[19px] z-10","rounded bg-black/70 px-1.5 py-0.5","text-[11px] leading-none text-white whitespace-nowrap","transition-opacity duration-100",H?"opacity-100":"opacity-0","[text-shadow:_0_1px_2px_rgba(0,0,0,0.9)]"].join(" "),style:ie,children:W})]})}const Lw=/^HOT[ \u00A0]+/i,Iw=n=>String(n||"").replaceAll(" "," "),uu=n=>Lw.test(Iw(n)),Wr=n=>Iw(n).replace(Lw,"");function hd(n){if(!n)return"";const e=Math.round(Number(n.w)),t=Math.round(Number(n.h));if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return"";const i=Math.min(e,t),a=Math.max(12,Math.round(i*.02)),l=u=>Math.abs(i-u)<=a;return l(4320)?"8K":l(2160)||i>=2e3?"4K":l(1440)?"1440p":l(1080)?"1080p":l(720)?"720p":l(480)?"480p":l(360)?"360p":l(240)?"240p":`${i}p`}const ZN=n=>{const e=String(n??"").trim();if(!e)return[];const t=e.split(/[\n,;|]+/g).map(l=>l.trim()).filter(Boolean),i=new Set,a=[];for(const l of t){const u=l.toLowerCase();i.has(u)||(i.add(u),a.push(l))}return a};function JN(...n){for(const e of n)if(typeof e=="string"){const t=e.trim();if(t)return t}}function R0(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return n>1440*60?n/1e3:n}function F1(n,e,t){return Math.max(e,Math.min(t,n))}const e3=5;function t3(n){if(n<=1)return[1,1];const e=16/9;let t=1,i=n,a=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;for(let u=1;u<=n;u++){const h=Math.max(1,Math.ceil(n/u)),f=u*h-n,g=u/h,w=Math.abs(g-e);(f{if(!e)return;const u=requestAnimationFrame(()=>{a(!0)});return()=>cancelAnimationFrame(u)},[e]);const l=["relative will-change-[filter,transform] transition-[filter,transform,opacity] duration-180 ease-out",n?"blur-[1.5px] saturate-90 scale-[0.995]":i?"blur-0 saturate-100 scale-100":"blur-[1.5px] saturate-90 scale-[0.995]"].filter(Boolean).join(" ");return c.jsx("div",{className:l,children:t})}function i3({animateOnMount:n,children:e}){const[t,i]=m.useState(!n);return m.useEffect(()=>{if(!n)return;const a=requestAnimationFrame(()=>{i(!0)});return()=>cancelAnimationFrame(a)},[n]),c.jsx("div",{className:"will-change-[transform,opacity] transition-[transform,opacity] duration-160 ease-out motion-reduce:transition-none",style:{transform:t?"translateY(0px) scale(1) translateZ(0)":"translateY(-15px) scale(0.97) translateZ(0)",opacity:t?1:.92,transformOrigin:"top center"},children:e})}function r3({rows:n,isSmall:e,isLoading:t,teaserPlayback:i,teaserAudio:a,hoverTeaserKey:l,blurPreviews:u,durations:h,teaserKey:f,inlinePlay:g,deletingKeys:w,keepingKeys:S,removingKeys:A,swipeRefs:C,assetNonce:j,handleScrubberClickIndex:k,keyFor:B,baseName:V,modelNameFromOutput:W,runtimeOf:H,sizeBytesOf:ie,formatBytes:Y,lower:G,onHoverPreviewKeyChange:O,onOpenPlayer:re,openPlayer:E,startInlineAt:R,startInline:ee,tryAutoplayInline:q,registerTeaserHost:Q,handleDuration:ue,deleteVideo:se,keepVideo:$,modelsByKey:F,activeTagSet:X,onToggleTagFilter:le,onToggleHot:de,onToggleFavorite:L,onToggleLike:pe,onToggleWatch:we,enqueueDeleteVideo:Be,enqueueKeepVideo:Ve,enqueueToggleHot:Oe}){const Te=m.useCallback(Le=>{const Ce=Le?.meta;if(!Ce)return null;if(typeof Ce=="string")try{return JSON.parse(Ce)}catch{return null}return Ce},[]),_t=m.useCallback(Le=>{const Ce=Te(Le),Pe=(typeof Ce?.videoWidth=="number"&&Number.isFinite(Ce.videoWidth)?Ce.videoWidth:0)||(typeof Le.videoWidth=="number"&&Number.isFinite(Le.videoWidth)?Le.videoWidth:0),Qe=(typeof Ce?.videoHeight=="number"&&Number.isFinite(Ce.videoHeight)?Ce.videoHeight:0)||(typeof Le.videoHeight=="number"&&Number.isFinite(Le.videoHeight)?Le.videoHeight:0);return Pe>0&&Qe>0?{w:Pe,h:Qe}:null},[Te]),dt=m.useCallback(Le=>{const Ce=Te(Le);let Pe=Ce?.previewSprite??Ce?.preview?.sprite??Ce?.sprite??Le?.previewSprite??Le?.preview?.sprite??null;if(typeof Pe=="string")try{Pe=JSON.parse(Pe)}catch{Pe=null}const Qe=Number(Pe?.count??Pe?.frames??Pe?.imageCount),At=Number(Pe?.stepSeconds??Pe?.step??Pe?.intervalSeconds);if(Number.isFinite(Qe)&&Qe>=2)return{count:Math.max(2,Math.floor(Qe)),stepSeconds:Number.isFinite(At)&&At>0?At:5};const Xt=B(Le),kt=h[Xt]??(typeof Le?.durationSeconds=="number"?Le.durationSeconds:void 0);return typeof kt=="number"&&Number.isFinite(kt)&&kt>1?{count:Math.max(2,Math.min(240,Math.floor(kt/5)+1)),stepSeconds:5}:null},[Te,B,h]),[xe,Ne]=m.useState({}),[Se,Ie]=m.useState({}),[$e,Ct]=m.useState(null),st=m.useCallback((Le,Ce)=>{Ne(Pe=>{if(Ce===void 0){if(!(Le in Pe))return Pe;const Qe={...Pe};return delete Qe[Le],Qe}return Pe[Le]===Ce?Pe:{...Pe,[Le]:Ce}})},[]),gt=m.useCallback(Le=>{st(Le,void 0)},[st]),He=m.useCallback((Le,Ce)=>{Ie(Pe=>{if(Ce===void 0){if(!(Le in Pe))return Pe;const Qe={...Pe};return delete Qe[Le],Qe}return Pe[Le]===Ce?Pe:{...Pe,[Le]:Ce}})},[]),We=(Le,Ce)=>{const Pe=B(Le),Qe=g?.key===Pe,At=Ce?.disableInline?!1:Qe,kt=!(!Ce?.forceStill&&!!a&&(At||l===Pe)),mn=At?g?.nonce??0:0,It=!!Ce?.forceLoadStill,$t=Ce?.forceStill?!1:Ce?.mobileStackTopOnlyVideo?i!=="still":i==="all"?!0:i==="hover"?f===Pe:!1,Ot=w.has(Pe)||S.has(Pe)||A.has(Pe),en=W(Le.output),Sn=V(Le.output||""),Pn=Wr(Sn.replace(/\.[^.]+$/,"")).trim(),St=G(en),Tn=F[St],tt=Te(Le),D=dt(Le),P=xe[Pe],ne=Se[Pe]===!0,Re=JN(tt?.previewSprite?.path,tt?.previewSpritePath,Tn?.previewScrubberPath,Pn?`/api/preview-sprite/${encodeURIComponent(Pn)}`:void 0),Ge=Re?Re.replace(/\/+$/,""):void 0,yt=tt?.previewSprite?.stepSeconds??tt?.previewSpriteStepSeconds,tn=typeof yt=="number"&&Number.isFinite(yt)&&yt>0?yt:D?.stepSeconds&&D.stepSeconds>0?D.stepSeconds:e3,un=R0(tt?.durationSeconds)??R0(Le?.durationSeconds)??R0(h[Pe]),vn=typeof un=="number"&&un>0?Math.max(1,Math.min(200,Math.floor(un/tn)+1)):void 0,cn=tt?.previewSprite?.count??tt?.previewSpriteCount??Tn?.previewScrubberCount??vn,Cn=tt?.previewSprite?.cols??tt?.previewSpriteCols,xn=tt?.previewSprite?.rows??tt?.previewSpriteRows,on=typeof cn=="number"&&Number.isFinite(cn)?Math.max(0,Math.floor(cn)):0,[Rn,qt]=on>1?t3(on):[0,0],Bt=Number(Cn),Zt=Number(xn),zt=Number.isFinite(Bt)&&Number.isFinite(Zt)&&Bt>0&&Zt>0&&!(on>1&&Bt===1&&Zt===1)&&(on<=1||Bt*Zt>=on),Pt=zt?Math.floor(Bt):Rn,Nn=zt?Math.floor(Zt):qt,Ft=(typeof tt?.updatedAtUnix=="number"&&Number.isFinite(tt.updatedAtUnix)?tt.updatedAtUnix:void 0)??(typeof tt?.fileModUnix=="number"&&Number.isFinite(tt.fileModUnix)?tt.fileModUnix:void 0)??j??0,Qn=Ge&&Ft?`${Ge}?v=${encodeURIComponent(String(Ft))}`:Ge||void 0,Xn=!!Qn&&on>1,Gn=Xn&&Pt>0&&Nn>0,ln=Xn?on:0,Zn=Xn?tn:0,ti=typeof P=="number"&&ln>1?F1(P/(ln-1),0,1):void 0,jn=Gn&&typeof P=="number"?(()=>{const ht=F1(P,0,Math.max(0,on-1)),Ht=ht%Pt,De=Math.floor(ht/Pt),vt=Pt<=1?0:Ht/(Pt-1)*100,wt=Nn<=1?0:De/(Nn-1)*100;return{backgroundImage:`url("${Qn}")`,backgroundRepeat:"no-repeat",backgroundSize:`${Pt*100}% ${Nn*100}%`,backgroundPosition:`${vt}% ${wt}%`}})():void 0,Kn=uu(Sn),rn=!!Tn?.favorite,Di=Tn?.liked===!0,oi=!!Tn?.watching,ni=ZN(Tn?.tags),di=H(Le),Ci=Y(ie(Le)),Fn=_t(Le),On=hd(Fn),$n=`inline-prev-${encodeURIComponent(Pe)}`,_e=["group relative rounded-lg overflow-hidden outline-1 outline-black/5 dark:-outline-offset-1 dark:outline-white/10","bg-white dark:bg-gray-900/40","transition-all duration-200",!e&&"hover:-translate-y-0.5 hover:shadow-md dark:hover:shadow-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",Ot&&"pointer-events-none opacity-70",w.has(Pe)&&"ring-1 ring-red-300 bg-red-50/60 dark:bg-red-500/10 dark:ring-red-500/30",S.has(Pe)&&"ring-1 ring-emerald-300 bg-emerald-50/60 dark:bg-emerald-500/10 dark:ring-emerald-500/30",A.has(Pe)&&"opacity-0 translate-y-2 scale-[0.98]"].filter(Boolean).join(" "),nt=c.jsx("div",{role:"button",tabIndex:0,className:_e,onClick:e?void 0:()=>E(Le),onKeyDown:ht=>{(ht.key==="Enter"||ht.key===" ")&&(ht.preventDefault(),re(Le))},children:c.jsx(n3,{blurred:Ce?.blur,animateUnblurOnMount:Ce?.animateUnblurOnMount,children:c.jsxs(Is,{noBodyPadding:!0,className:"overflow-hidden bg-transparent",children:[c.jsx("div",{id:$n,ref:Ce?.disableInline||Ce?.isDecorative?void 0:Q(Pe),className:"group/thumb relative aspect-video rounded-t-lg bg-black/5 dark:bg-white/5",onMouseEnter:e||Ce?.disablePreviewHover?void 0:()=>{Ct(Pe),O?.(Pe)},onMouseLeave:()=>{!e&&!Ce?.disablePreviewHover&&O?.(null),Ct(ht=>ht===Pe?null:ht),gt(Pe),He(Pe,!1)},onClick:ht=>{ht.preventDefault(),ht.stopPropagation(),!(e||Ce?.disableInline)&&ee(Pe)},children:c.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-t-lg",children:[At?null:c.jsx("div",{className:"pointer-events-none absolute right-2 bottom-2 z-10 transition-opacity duration-150 group-hover/thumb:opacity-0 group-focus-within/thumb:opacity-0 "+(At?"opacity-0":"opacity-100"),children:c.jsxs("div",{className:"flex items-center gap-1.5 text-right text-[11px] font-semibold leading-none text-white [text-shadow:_0_1px_0_rgba(0,0,0,0.95),_1px_0_0_rgba(0,0,0,0.95),_-1px_0_0_rgba(0,0,0,0.95),_0_-1px_0_rgba(0,0,0,0.95),_1px_1px_0_rgba(0,0,0,0.8),_-1px_1px_0_rgba(0,0,0,0.8),_1px_-1px_0_rgba(0,0,0,0.8),_-1px_-1px_0_rgba(0,0,0,0.8)]",title:[di,Fn?`${Fn.w}×${Fn.h}`:On||"",Ci].filter(Boolean).join(" • "),children:[c.jsx("span",{children:di}),On?c.jsx("span",{"aria-hidden":"true",children:"•"}):null,On?c.jsx("span",{children:On}):null,c.jsx("span",{"aria-hidden":"true",children:"•"}),c.jsx("span",{children:Ci})]})}),c.jsx(wu,{job:Le,getFileName:ht=>Wr(V(ht)),className:"h-full w-full",variant:"fill",durationSeconds:h[Pe]??Le?.durationSeconds,onDuration:ue,showPopover:!1,blur:At?!1:!!u,animated:$t,animatedMode:"teaser",animatedTrigger:"always",inlineVideo:!Ce?.disableInline&&At?"always":!1,inlineNonce:mn,inlineControls:At,inlineLoop:!1,muted:kt,popoverMuted:kt,assetNonce:j??0,alwaysLoadStill:It,teaserPreloadEnabled:Ce?.mobileStackTopOnlyVideo||Ce?.preloadTeaserWhenStill?!0:!e,teaserPreloadRootMargin:Ce?.preloadTeaserWhenStill?"1200px 0px":e?"900px 0px":"700px 0px",scrubProgressRatio:ti,preferScrubProgress:ne&&typeof P=="number"}),Gn&&Qn?c.jsx("img",{src:Qn,alt:"",className:"hidden",loading:"lazy",decoding:"async","aria-hidden":"true"}):null,Gn&&jn&&!At?c.jsx("div",{className:"absolute inset-x-0 top-0 bottom-[6px] z-[5]","aria-hidden":"true",children:c.jsx("div",{className:"h-full w-full",style:jn})}):null,!Ce?.isDecorative&&!Ce?.disableScrubber&&!At&&ln>1&&$e===Pe?c.jsx("div",{className:"absolute inset-x-0 bottom-0 z-30 pointer-events-none opacity-100 transition-opacity duration-150",onClick:ht=>ht.stopPropagation(),onMouseDown:ht=>ht.stopPropagation(),onMouseEnter:()=>He(Pe,!0),onMouseLeave:()=>{He(Pe,!1),st(Pe,void 0)},children:c.jsx(xy,{className:"pointer-events-auto px-1",imageCount:ln,activeIndex:P,onActiveIndexChange:ht=>st(Pe,ht),onIndexClick:ht=>{if(e||Ce?.disableInline){k(Le,ht,ln);return}const Ht=Zn>0?ht*Zn:0;if(R){R(Pe,Ht,$n),requestAnimationFrame(()=>{q($n)||requestAnimationFrame(()=>q($n))});return}ee(Pe),requestAnimationFrame(()=>{q($n)||requestAnimationFrame(()=>q($n))})},stepSeconds:Zn})}):null]})}),c.jsxs("div",{className:"relative min-h-[112px] overflow-hidden px-4 py-3 border-t border-black/5 dark:border-white/10 bg-white dark:bg-gray-900",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:en}),c.jsxs("div",{className:"mt-0.5 flex items-start gap-2 min-w-0",children:[Kn?c.jsx("span",{className:"shrink-0 self-start rounded bg-amber-500/15 px-1.5 py-0.5 text-[11px] leading-none font-semibold text-amber-800 dark:text-amber-300",children:"HOT"}):null,c.jsx("span",{className:"min-w-0 truncate text-xs text-gray-500 dark:text-gray-400",children:Wr(Sn)||"—"})]})]}),c.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 pt-0.5",children:[oi?c.jsx(yl,{className:"size-4 text-sky-600 dark:text-sky-300"}):null,Di?c.jsx(bl,{className:"size-4 text-rose-600 dark:text-rose-300"}):null,rn?c.jsx(_u,{className:"size-4 text-amber-600 dark:text-amber-300"}):null]})]}),c.jsx("div",{className:"mt-2",onClick:ht=>ht.stopPropagation(),onMouseDown:ht=>ht.stopPropagation(),children:c.jsx("div",{className:"w-full",children:c.jsx("div",{className:"w-full rounded-md bg-gray-50/70 p-1 ring-1 ring-black/5 dark:bg-white/5 dark:ring-white/10",children:c.jsx(Bs,{job:Le,variant:"table",busy:Ot,collapseToMenu:!0,compact:!1,isHot:Kn,isFavorite:rn,isLiked:Di,isWatching:oi,onToggleWatch:we,onToggleFavorite:L,onToggleLike:pe,onToggleHot:de,onKeep:$,onDelete:se,order:["watch","favorite","like","hot","keep","delete","details","add"],className:"w-full gap-1.5"})})})}),c.jsx("div",{className:"mt-2",onClick:ht=>ht.stopPropagation(),onMouseDown:ht=>ht.stopPropagation(),children:c.jsx(dd,{rowKey:Pe,tags:ni,activeTagSet:X,lower:G,onToggleTagFilter:le})})]})]})})});return{k:Pe,j:Le,busy:Ot,isHot:Kn,inlineDomId:$n,cardInner:nt}},Je=3,et=e?n.slice(0,Je):[],Mt=e?n.slice(Je,Je+4):[],fe=15,qe=Math.min(et.length,Je)-1;return c.jsxs("div",{className:"relative",children:[e?c.jsx("div",{className:"relative overflow-y-visible touch-pan-y",style:{overflowX:"clip"},children:n.length===0?null:c.jsxs("div",{className:"relative mx-auto w-full max-w-[560px] overflow-y-visible",style:{overflowX:"clip"},children:[c.jsx("div",{className:"relative overflow-visible",style:{paddingTop:qe>0?`${qe}px`:void 0},children:(()=>{const Le=et,Ce=Le[0],Pe=Le.slice(1);return c.jsxs(c.Fragment,{children:[Pe.map((Qe,At)=>{const Xt=At+1,{k:kt,cardInner:mn}=We(Qe,{forceStill:!0,disableInline:!0,disablePreviewHover:!0,isDecorative:!0,forceLoadStill:!0,blur:!0,preloadTeaserWhenStill:!0}),It=Xt,$t=-(It*fe),Ot=1-It*.03,en=1-It*.14;return c.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none will-change-[transform,opacity] transition-[transform,opacity] duration-220 ease-out motion-reduce:transition-none",style:{zIndex:20-It,transform:`translateY(${$t}px) scale(${Ot}) translateZ(0)`,opacity:en,transformOrigin:"top center"},"aria-hidden":"true",children:c.jsxs("div",{className:"relative",children:[mn,c.jsx("div",{className:"absolute inset-0 rounded-lg bg-white/8 dark:bg-black/8"})]})},kt)}).reverse(),Ce?(()=>{const Qe=Ce,{k:At,busy:Xt,isHot:kt,cardInner:mn,inlineDomId:It}=We(Qe,{forceLoadStill:!0,mobileStackTopOnlyVideo:!0,disableScrubber:!0,animateUnblurOnMount:!0});return c.jsx("div",{className:"relative touch-pan-y",style:{zIndex:30},children:c.jsx(i3,{animateOnMount:!0,children:c.jsx(VN,{ref:$t=>{$t?C.current.set(At,$t):C.current.delete(At)},enabled:!0,disabled:Xt,ignoreFromBottomPx:110,doubleTapMs:360,doubleTapMaxMovePx:48,onDoubleTap:async()=>{if(!kt){if(Oe){Oe(Qe);return}await de?.(Qe)}},onTap:()=>{ee(At),requestAnimationFrame(()=>{q(It)||requestAnimationFrame(()=>q(It))})},onSwipeLeft:()=>Be?Be(Qe):se(Qe),onSwipeRight:()=>Ve?Ve(Qe):$(Qe),children:mn})})},At)})():null]})})()}),Mt.length>0?c.jsx("div",{className:"sr-only","aria-hidden":"true",children:Mt.map(Le=>{const Ce=B(Le);return c.jsx("div",{className:"relative aspect-video",children:c.jsx(wu,{job:Le,getFileName:V,className:"h-full w-full",showPopover:!1,blur:!!u,animated:!1,teaserPreloadEnabled:!0,teaserPreloadRootMargin:"1200px 0px",animatedMode:"teaser",animatedTrigger:"always",inlineVideo:!1,inlineControls:!1,inlineLoop:!1,muted:!0,popoverMuted:!0,assetNonce:j??0,alwaysLoadStill:!0})},`preload-still-${Ce}`)})}):null]})}):c.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n.map(Le=>{const{k:Ce,cardInner:Pe}=We(Le);return c.jsx(m.Fragment,{children:Pe},Ce)})}),t&&n.length===0?c.jsx("div",{className:"absolute inset-0 z-20 grid place-items-center rounded-lg bg-white/50 backdrop-blur-[2px] dark:bg-gray-950/40",children:c.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white/80 px-3 py-2 shadow-sm dark:border-white/10 dark:bg-gray-900/70",children:[c.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-transparent dark:border-white/20 dark:border-t-transparent"}),c.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-100",children:"Lade…"})]})}):null]})}function s3({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const a3=m.forwardRef(s3);function o3({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const l3=m.forwardRef(o3);function u3({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const c3=m.forwardRef(u3);function d3({title:n,titleId:e,...t},i){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),n?m.createElement("title",{id:e},n):null,m.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const U1=m.forwardRef(d3);function Vr(...n){return n.filter(Boolean).join(" ")}function z1(n){return n==="center"?"text-center":n==="right"?"text-right":"text-left"}function h3(n){return n==="center"?"justify-center":n==="right"?"justify-end":"justify-start"}function H1(n,e){const t=n===0,i=n===e-1;return t||i?"pl-2 pr-2":"px-2"}function $1(n){return n==null?{isNull:!0,kind:"string",value:""}:n instanceof Date?{isNull:!1,kind:"number",value:n.getTime()}:typeof n=="number"?{isNull:!1,kind:"number",value:n}:typeof n=="boolean"?{isNull:!1,kind:"number",value:n?1:0}:typeof n=="bigint"?{isNull:!1,kind:"number",value:Number(n)}:{isNull:!1,kind:"string",value:String(n).toLocaleLowerCase()}}function nd({columns:n,rows:e,getRowKey:t,title:i,description:a,actions:l,fullWidth:u=!1,card:h=!0,striped:f=!1,stickyHeader:g=!1,compact:w=!1,isLoading:S=!1,emptyLabel:A="Keine Daten vorhanden.",className:C,rowClassName:j,onRowClick:k,onRowContextMenu:B,sort:V,onSortChange:W,defaultSort:H=null}){const ie=w?"py-2":"py-4",Y=w?"py-3":"py-3.5",G=V!==void 0,[O,re]=m.useState(H),E=G?V:O,R=m.useCallback(q=>{G||re(q),W?.(q)},[G,W]),ee=m.useMemo(()=>{if(!E)return e;const q=n.find(se=>se.key===E.key);if(!q)return e;const Q=E.direction==="asc"?1:-1,ue=e.map((se,$)=>({r:se,i:$}));return ue.sort((se,$)=>{let F=0;if(q.sortFn)F=q.sortFn(se.r,$.r);else{const X=q.sortValue?q.sortValue(se.r):se.r?.[q.key],le=q.sortValue?q.sortValue($.r):$.r?.[q.key],de=$1(X),L=$1(le);de.isNull&&!L.isNull?F=1:!de.isNull&&L.isNull?F=-1:de.kind==="number"&&L.kind==="number"?F=de.valueL.value?1:0:F=String(de.value).localeCompare(String(L.value),void 0,{numeric:!0})}return F===0?se.i-$.i:F*Q}),ue.map(se=>se.r)},[e,n,E]);return c.jsxs("div",{className:Vr(u?"":"px-4 sm:px-6 lg:px-8",C),children:[(i||a||l)&&c.jsxs("div",{className:"sm:flex sm:items-center",children:[c.jsxs("div",{className:"sm:flex-auto",children:[i&&c.jsx("h1",{className:"text-base font-semibold text-gray-900 dark:text-white",children:i}),a&&c.jsx("p",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300",children:a})]}),l&&c.jsx("div",{className:"mt-4 sm:mt-0 sm:ml-16 sm:flex-none",children:l})]}),c.jsx("div",{className:Vr(i||a||l?"mt-8":""),children:c.jsx("div",{className:"flow-root",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsx("div",{className:Vr("inline-block min-w-full align-middle",u?"":"sm:px-6 lg:px-8"),children:c.jsx("div",{className:Vr(h&&"overflow-hidden shadow-sm outline-1 outline-black/5 rounded-lg dark:shadow-none dark:-outline-offset-1 dark:outline-white/10"),children:c.jsxs("table",{className:"relative min-w-full divide-y divide-gray-200 dark:divide-white/10",children:[c.jsx("thead",{className:Vr(h&&"bg-gray-50/90 dark:bg-gray-800/70",g&&"sticky top-0 z-10 backdrop-blur-sm shadow-sm"),children:c.jsx("tr",{children:n.map((q,Q)=>{const ue=H1(Q,n.length),se=!!E&&E.key===q.key,$=se?E.direction:void 0,F=q.sortable&&!q.srOnlyHeader?se?$==="asc"?"ascending":"descending":"none":void 0,X=()=>{if(!(!q.sortable||q.srOnlyHeader))return R(se?$==="asc"?{key:q.key,direction:"desc"}:null:{key:q.key,direction:"asc"})};return c.jsx("th",{scope:"col","aria-sort":F,className:Vr(Y,ue,"text-xs font-semibold tracking-wide text-gray-700 dark:text-gray-200 whitespace-nowrap",z1(q.align),q.widthClassName,q.headerClassName),children:q.srOnlyHeader?c.jsx("span",{className:"sr-only",children:q.header}):q.sortable?c.jsxs("button",{type:"button",onClick:X,className:Vr("group inline-flex w-full items-center gap-2 select-none rounded-md px-1.5 py-1 -my-1 hover:bg-gray-100/70 dark:hover:bg-white/5",h3(q.align)),children:[c.jsx("span",{children:q.header}),c.jsx("span",{className:Vr("flex-none rounded-sm text-gray-400 dark:text-gray-500",se?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white":"invisible group-hover:visible group-focus-visible:visible"),children:c.jsx(a3,{"aria-hidden":"true",className:Vr("size-5 transition-transform",se&&$==="asc"&&"rotate-180")})})]}):q.header},q.key)})})}),c.jsx("tbody",{className:Vr("divide-y divide-gray-200 dark:divide-white/10",h?"bg-white dark:bg-gray-800/50":"bg-white dark:bg-gray-900"),children:S?c.jsx("tr",{children:c.jsx("td",{colSpan:n.length,className:Vr(ie,"px-2 text-sm text-gray-500 dark:text-gray-400"),children:"Lädt…"})}):ee.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:n.length,className:Vr(ie,"px-2 text-sm text-gray-500 dark:text-gray-400"),children:A})}):ee.map((q,Q)=>{const ue=t?t(q,Q):String(Q);return c.jsx("tr",{className:Vr(f&&"even:bg-gray-50 dark:even:bg-gray-800/50",k&&"cursor-pointer",k&&"hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",j?.(q,Q)),onClick:()=>k?.(q),onContextMenu:B?se=>{se.preventDefault(),B(q,se)}:void 0,children:n.map((se,$)=>{const F=H1($,n.length),X=se.cell?.(q,Q)??se.accessor?.(q)??q?.[se.key];return c.jsx("td",{className:Vr(ie,F,"text-sm whitespace-nowrap",z1(se.align),se.className,se.key===n[0]?.key?"font-medium text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:X},se.key)})},ue)})})]})})})})})})]})}function f3({rows:n,isLoading:e,keyFor:t,baseName:i,lower:a,modelNameFromOutput:l,runtimeOf:u,sizeBytesOf:h,formatBytes:f,resolutions:g,durations:w,canHover:S,teaserAudio:A,hoverTeaserKey:C,setHoverTeaserKey:j,teaserPlayback:k="hover",teaserKey:B,registerTeaserHost:V,handleDuration:W,handleResolution:H,blurPreviews:ie,assetNonce:Y,deletingKeys:G,keepingKeys:O,removingKeys:re,modelsByKey:E,activeTagSet:R,onToggleTagFilter:ee,onOpenPlayer:q,onSortModeChange:Q,page:ue,onPageChange:se,onToggleHot:$,onToggleFavorite:F,onToggleLike:X,onToggleWatch:le,deleteVideo:de,keepVideo:L,enqueueDeleteVideo:pe,enqueueKeepVideo:we,enqueueToggleHot:Be}){const[Ve,Oe]=m.useState(null),Te=m.useCallback(He=>{const We=He?.durationSeconds;if(typeof We=="number"&&Number.isFinite(We)&&We>0)return We;const Je=Date.parse(String(He?.startedAt||"")),et=Date.parse(String(He?.endedAt||""));if(Number.isFinite(Je)&&Number.isFinite(et)&&et>Je){const mt=(et-Je)/1e3;if(mt>=1&&mt<=1440*60)return mt}return Number.POSITIVE_INFINITY},[]),_t=m.useCallback(He=>{const We=String(He??"").trim();if(!We)return[];const Je=We.split(/[\n,;|]+/g).map(Mt=>Mt.trim()).filter(Boolean),et=new Set,mt=[];for(const Mt of Je){const fe=Mt.toLowerCase();et.has(fe)||(et.add(fe),mt.push(Mt))}return mt.sort((Mt,fe)=>Mt.localeCompare(fe,void 0,{sensitivity:"base"})),mt},[]),dt=m.useCallback(He=>{const We=He?.meta;if(!We)return null;if(typeof We=="string")try{return JSON.parse(We)}catch{return null}return We},[]),xe=m.useCallback(He=>{const We=dt(He);let Je=We?.previewSprite??We?.preview?.sprite??null;if(typeof Je=="string")try{Je=JSON.parse(Je)}catch{Je=null}const et=Number(Je?.count),mt=Number(Je?.stepSeconds);return!Number.isFinite(et)||et<2?null:{count:Math.max(2,Math.floor(et)),stepSeconds:Number.isFinite(mt)&&mt>0?mt:5}},[dt]),[Ne,Se]=m.useState({}),Ie=m.useCallback((He,We)=>{Se(Je=>Je[He]===We?Je:{...Je,[He]:We})},[]),$e=m.useMemo(()=>[{key:"preview",header:"Vorschau",widthClassName:"w-[140px]",cell:He=>{const We=t(He),et=!(!!A&&C===We),mt=xe(He),Mt=Ne[We],fe=i(He.output||""),qe=Wr(fe.replace(/\.[^.]+$/,"")).trim(),Le=mt&&typeof Mt=="number"?Math.max(0,Mt*mt.stepSeconds):void 0,Ce=qe&&typeof Le=="number"?`/api/preview?id=${encodeURIComponent(qe)}&t=${Le.toFixed(3)}&v=${Y??0}`:"";return c.jsxs("div",{ref:V(We),className:"group relative py-1",onClick:Pe=>Pe.stopPropagation(),onMouseDown:Pe=>Pe.stopPropagation(),onMouseEnter:()=>{S&&j(We)},onMouseLeave:()=>{S&&j(null),Ie(We,void 0)},children:[c.jsx(wu,{job:He,getFileName:i,durationSeconds:w[We],muted:et,popoverMuted:et,onDuration:W,onResolution:H,className:"w-28 h-16 rounded-md ring-1 ring-black/5 dark:ring-white/10",showPopover:!1,blur:ie,animated:k==="all"?!0:k==="hover"?B===We:!1,animatedMode:"teaser",animatedTrigger:"always",assetNonce:Y}),mt&&typeof Mt=="number"&&Ce?c.jsx("img",{src:Ce,alt:"","aria-hidden":"true",className:"pointer-events-none absolute left-0 top-1 z-[15] h-16 w-28 rounded-md object-cover ring-1 ring-black/5 dark:ring-white/10",draggable:!1}):null]})}},{key:"Model",header:"Model",sortable:!0,sortValue:He=>{const We=i(He.output||""),Je=uu(We),et=l(He.output),mt=Wr(We);return`${et} ${Je?"HOT":""} ${mt}`.trim()},cell:He=>{const We=i(He.output||""),Je=uu(We),et=Wr(We),mt=l(He.output),Mt=a(l(He.output)),fe=_t(E[Mt]?.tags);return c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:mt}),c.jsxs("div",{className:"mt-0.5 min-w-0 text-xs text-gray-500 dark:text-gray-400",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"truncate",title:et,children:et||"—"}),(()=>{const qe=t(He),Le=g[qe]??null,Ce=hd(Le);return Ce?c.jsx("span",{className:`shrink-0 rounded-md bg-gray-100 px-1.5 py-0.5 text-[11px] font-semibold text-gray-700 ring-1 ring-inset ring-gray-200\r - dark:bg-white/5 dark:text-gray-200 dark:ring-white/10`,title:Le?`${Le.w}×${Le.h}`:"Auflösung",children:Ce}):null})(),Je?c.jsx("span",{className:"shrink-0 rounded-md bg-amber-500/15 px-1.5 py-0.5 text-[11px] font-semibold text-amber-800 dark:text-amber-300",children:"HOT"}):null]}),fe.length>0?c.jsx("div",{className:"mt-1",onClick:qe=>qe.stopPropagation(),onMouseDown:qe=>qe.stopPropagation(),children:c.jsx(dd,{rowKey:t(He),tags:fe,activeTagSet:R,lower:a,onToggleTagFilter:ee,maxWidthClassName:"max-w-[11rem]"})}):null]})]})}},{key:"completedAt",header:"Fertiggestellt am",sortable:!0,widthClassName:"w-[150px]",sortValue:He=>{const We=Date.parse(String(He.endedAt||""));return Number.isFinite(We)?We:Number.NEGATIVE_INFINITY},cell:He=>{const We=Date.parse(String(He.endedAt||""));if(!Number.isFinite(We))return c.jsx("span",{className:"text-xs text-gray-400",children:"—"});const Je=new Date(We),et=Je.toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}),mt=Je.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"});return c.jsxs("time",{dateTime:Je.toISOString(),title:`${et} ${mt}`,className:"tabular-nums whitespace-nowrap text-sm text-gray-900 dark:text-white",children:[c.jsx("span",{className:"font-medium",children:et}),c.jsx("span",{className:"mx-1 text-gray-400 dark:text-gray-600",children:"·"}),c.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:mt})]})}},{key:"runtime",header:"Dauer",align:"right",sortable:!0,sortValue:He=>Te(He),cell:He=>c.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:u(He)})},{key:"size",header:"Größe",align:"right",sortable:!0,sortValue:He=>{const We=h(He);return typeof We=="number"?We:Number.NEGATIVE_INFINITY},cell:He=>c.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:f(h(He))})},{key:"actions",header:"Aktionen",align:"right",srOnlyHeader:!0,cell:He=>{const We=t(He),Je=G.has(We)||O.has(We)||re.has(We),et=i(He.output||""),mt=uu(et),Mt=a(l(He.output)),fe=E[Mt],qe=!!fe?.favorite,Le=fe?.liked===!0,Ce=!!fe?.watching;return c.jsx(Bs,{job:He,variant:"table",busy:Je,isHot:mt,isFavorite:qe,isLiked:Le,isWatching:Ce,onToggleWatch:le,onToggleFavorite:F,onToggleLike:X,onToggleHot:$?async Pe=>{if(!(Be&&Be(Pe)))return $(Pe)}:void 0,onKeep:async Pe=>we&&we(Pe)?!0:L(Pe),onDelete:async Pe=>pe&&pe(Pe)?!0:de(Pe),order:["watch","favorite","like","hot","details","add","keep","delete"],className:"flex items-center justify-end gap-1"})}}],[t,i,w,A,C,V,S,j,W,H,ie,k,B,Y,a,l,E,R,ee,g,G,O,re,xe,Ne,Ie,le,F,X,$,L,de,h,f,u,_t,Te]),Ct=m.useCallback(He=>{if(!He)return"completed_desc";const We=He,Je=String(We.key??We.columnKey??We.id??""),et=String(We.dir??We.direction??We.order??"").toLowerCase(),mt=et==="asc"||et==="1"||et==="true";return Je==="completedAt"?mt?"completed_asc":"completed_desc":Je==="runtime"?mt?"duration_asc":"duration_desc":Je==="size"?mt?"size_asc":"size_desc":Je==="Model"||Je==="video"?mt?"file_asc":"file_desc":mt?"completed_asc":"completed_desc"},[]),st=m.useCallback(He=>{Oe(He),Q(Ct(He)),ue!==1&&se(1)},[Q,Ct,ue,se]),gt=m.useCallback(He=>{const We=t(He);return["transition-all duration-300",(G.has(We)||re.has(We))&&"bg-red-50/60 dark:bg-red-500/10 pointer-events-none",G.has(We)&&"animate-pulse",(O.has(We)||re.has(We))&&"pointer-events-none",O.has(We)&&"bg-emerald-50/60 dark:bg-emerald-500/10 animate-pulse",re.has(We)&&"opacity-0"].filter(Boolean).join(" ")},[t,G,O,re]);return c.jsxs("div",{className:"relative",children:[c.jsx(nd,{rows:n,columns:$e,getRowKey:He=>t(He),striped:!0,fullWidth:!0,stickyHeader:!0,compact:!1,card:!0,sort:Ve,onSortChange:st,onRowClick:q,rowClassName:gt}),e&&n.length===0?c.jsx("div",{className:"absolute inset-0 z-20 grid place-items-center rounded-lg bg-white/50 backdrop-blur-[2px] dark:bg-gray-950/40",children:c.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white/80 px-3 py-2 shadow-sm dark:border-white/10 dark:bg-gray-900/70",children:[c.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-transparent dark:border-white/20 dark:border-t-transparent"}),c.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-100",children:"Lade…"})]})}):null]})}function q1(...n){for(const e of n)if(typeof e=="string"){const t=e.trim();if(t)return t}}function m3(n){if(!n)return null;if(typeof n=="string")try{return JSON.parse(n)}catch{return null}return typeof n=="object"?n:null}function j0(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return n>1440*60?n/1e3:n}function V1(n,e,t){return Math.max(e,Math.min(t,n))}const p3=5;function g3(n){if(n<=1)return[1,1];const e=16/9;let t=1,i=n,a=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;for(let u=1;u<=n;u++){const h=Math.max(1,Math.ceil(n/u)),f=u*h-n,g=u/h,w=Math.abs(g-e);(fIe=>{if(!de){ie(Se)(null);return}ie(Se)(Ie)},[ie,de]),pe=Se=>{const Ie=String(Se??"").trim();if(!Ie)return[];const $e=Ie.split(/[\n,;|]+/g).map(gt=>gt.trim()).filter(Boolean),Ct=new Set,st=[];for(const gt of $e){const He=gt.toLowerCase();Ct.has(He)||(Ct.add(He),st.push(gt))}return st},we=m.useCallback(Se=>{const Ie=(typeof Se?.meta?.videoWidth=="number"&&Number.isFinite(Se.meta.videoWidth)?Se.meta.videoWidth:0)||(typeof Se?.videoWidth=="number"&&Number.isFinite(Se.videoWidth)?Se.videoWidth:0),$e=(typeof Se?.meta?.videoHeight=="number"&&Number.isFinite(Se.meta.videoHeight)?Se.meta.videoHeight:0)||(typeof Se?.videoHeight=="number"&&Number.isFinite(Se.videoHeight)?Se.videoHeight:0);return Ie>0&&$e>0?{w:Ie,h:$e}:null},[]),[Be,Ve]=m.useState(null),[Oe,Te]=m.useState({}),[_t,dt]=m.useState(null),xe=m.useCallback((Se,Ie)=>{Te($e=>{if(Ie===void 0){if(!(Se in $e))return $e;const Ct={...$e};return delete Ct[Se],Ct}return $e[Se]===Ie?$e:{...$e,[Se]:Ie}})},[]),Ne=m.useCallback(Se=>{xe(Se,void 0)},[xe]);return c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:n.map(Se=>{const Ie=w(Se),Ct=!(!!l&&u===Ie),st=A(Se.output),gt=R(st),He=ee[gt],We=!!He?.favorite,Je=He?.liked===!0,et=!!He?.watching,mt=pe(He?.tags),Mt=S(Se.output||""),fe=uu(Mt),qe=Wr(Mt),Le=C(Se),Ce=k(j(Se)),Pe=we(Se),Qe=hd(Pe),At=B.has(Ie)||V.has(Ie)||W.has(Ie),Xt=H.has(Ie),kt=q1(He?.image,He?.imageUrl,Se?.meta?.modelImage,Se?.meta?.modelImageUrl),It=Wr(S(Se.output||"")).replace(/\.[^.]+$/,"").trim(),$t=m3(Se?.meta),Ot=q1($t?.previewSprite?.path,$t?.previewSpritePath,He?.previewScrubberPath,It?`/api/preview-sprite/${encodeURIComponent(It)}`:void 0),en=Ot?Ot.replace(/\/+$/,""):void 0,Sn=$t?.previewSprite?.stepSeconds??$t?.previewSpriteStepSeconds,Pn=typeof Sn=="number"&&Number.isFinite(Sn)&&Sn>0?Sn:p3,St=j0($t?.durationSeconds)??j0(Se?.durationSeconds)??j0(i[Ie]),Tn=typeof St=="number"&&St>0?Math.max(1,Math.min(200,Math.floor(St/Pn)+1)):void 0,tt=$t?.previewSprite?.count??$t?.previewSpriteCount??He?.previewScrubberCount??Tn,D=$t?.previewSprite?.cols??$t?.previewSpriteCols,P=$t?.previewSprite?.rows??$t?.previewSpriteRows,ne=typeof tt=="number"&&Number.isFinite(tt)?Math.max(0,Math.floor(tt)):0,[Re,Ge]=ne>1?g3(ne):[0,0],yt=typeof D=="number"&&Number.isFinite(D)?Math.max(0,Math.floor(D)):Re,tn=typeof P=="number"&&Number.isFinite(P)?Math.max(0,Math.floor(P)):Ge,un=(typeof $t?.updatedAtUnix=="number"&&Number.isFinite($t.updatedAtUnix)?$t.updatedAtUnix:void 0)??(typeof $t?.fileModUnix=="number"&&Number.isFinite($t.fileModUnix)?$t.fileModUnix:void 0)??0,vn=en&&un?`${en}?v=${encodeURIComponent(String(un))}`:en||void 0,cn=!!vn&&ne>1,Cn=cn&&yt>0&&tn>0,xn=cn?ne:0,on=cn?Pn:0,Rn=cn,qt=Oe[Ie],Bt=typeof qt=="number"&&xn>1?V1(qt/(xn-1),0,1):void 0,Zt=Cn&&typeof qt=="number"?(()=>{const Ft=V1(qt,0,Math.max(0,ne-1)),Qn=Ft%yt,Xn=Math.floor(Ft/yt),Gn=yt<=1?0:Qn/(yt-1)*100,ln=tn<=1?0:Xn/(tn-1)*100;return{backgroundImage:`url("${vn}")`,backgroundRepeat:"no-repeat",backgroundSize:`${yt*100}% ${tn*100}%`,backgroundPosition:`${Gn}% ${ln}%`}})():void 0,zt=Be===Ie&&!!kt,Pt=!zt&&!!Zt,Nn=zt||Pt;return c.jsxs("div",{role:"button",tabIndex:0,className:["group relative rounded-lg overflow-hidden outline-1 outline-black/5 dark:-outline-offset-1 dark:outline-white/10","bg-white dark:bg-gray-900/40","transition-all duration-200","hover:-translate-y-0.5 hover:shadow-md dark:hover:shadow-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",At&&"pointer-events-none opacity-70",B.has(Ie)&&"ring-1 ring-red-300 bg-red-50/60 dark:bg-red-500/10 dark:ring-red-500/30",W.has(Ie)&&"opacity-0 translate-y-2 scale-[0.98]",Xt&&"hidden"].filter(Boolean).join(" "),onClick:()=>G(Se),onKeyDown:Ft=>{(Ft.key==="Enter"||Ft.key===" ")&&G(Se)},children:[c.jsx("div",{className:"group/thumb relative aspect-video rounded-t-lg bg-black/5 dark:bg-white/5",ref:L(Ie),onMouseEnter:()=>{dt(Ie),Y?.(Ie)},onMouseLeave:()=>{dt(Ft=>Ft===Ie?null:Ft),Y?.(null),Ne(Ie),Ve(Ft=>Ft===Ie?null:Ft)},children:c.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-t-lg",children:[c.jsx("div",{className:"absolute inset-0",children:c.jsx(wu,{job:Se,getFileName:Ft=>Wr(S(Ft)),durationSeconds:i[Ie]??Se?.durationSeconds,onDuration:f,variant:"fill",showPopover:!1,blur:t,animated:Nn?!1:a==="all"?!0:a==="hover"?h===Ie:!1,animatedMode:"teaser",animatedTrigger:"always",muted:Ct,popoverMuted:Ct,scrubProgressRatio:Bt,preferScrubProgress:typeof qt=="number"})}),Cn&&vn?c.jsx("img",{src:vn,alt:"",className:"hidden",loading:"lazy",decoding:"async","aria-hidden":"true"}):null,Pt&&Zt?c.jsx("div",{className:"absolute inset-x-0 top-0 bottom-[6px] z-[5]","aria-hidden":"true",children:c.jsx("div",{className:"h-full w-full",style:Zt})}):null,zt&&kt?c.jsxs("div",{className:"absolute inset-0 z-[6]",children:[c.jsx("img",{src:kt,alt:st?`${st} preview`:"Model preview",className:"h-full w-full object-cover",draggable:!1}),c.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/65 to-transparent px-2 py-1.5",children:c.jsx("div",{className:"text-[10px] font-semibold tracking-wide text-white/95",children:"MODEL PREVIEW"})})]}):null,Rn&&_t===Ie?c.jsx("div",{className:"absolute inset-x-0 bottom-0 z-30 pointer-events-none opacity-100 transition-opacity duration-150",onClick:Ft=>Ft.stopPropagation(),onMouseDown:Ft=>Ft.stopPropagation(),children:c.jsx(xy,{className:"pointer-events-auto px-1",imageCount:xn,activeIndex:qt,onActiveIndexChange:Ft=>xe(Ie,Ft),onIndexClick:Ft=>{xe(Ie,Ft),g(Se,Ft,xn)},stepSeconds:on})}):null,c.jsx("div",{className:"pointer-events-none absolute right-2 bottom-2 z-10 transition-opacity duration-150 group-hover/thumb:opacity-0 group-focus-within/thumb:opacity-0",children:c.jsxs("div",{className:"flex items-center gap-1.5 text-right text-[11px] font-semibold leading-none text-white [text-shadow:_0_1px_0_rgba(0,0,0,0.95),_1px_0_0_rgba(0,0,0,0.95),_-1px_0_0_rgba(0,0,0,0.95),_0_-1px_0_rgba(0,0,0,0.95),_1px_1px_0_rgba(0,0,0,0.8),_-1px_1px_0_rgba(0,0,0,0.8),_1px_-1px_0_rgba(0,0,0,0.8),_-1px_-1px_0_rgba(0,0,0,0.8)]",title:[Le,Pe?`${Pe.w}×${Pe.h}`:Qe||"",Ce].filter(Boolean).join(" • "),children:[c.jsx("span",{children:Le}),Qe?c.jsx("span",{"aria-hidden":"true",children:"•"}):null,Qe?c.jsx("span",{children:Qe}):null,c.jsx("span",{"aria-hidden":"true",children:"•"}),c.jsx("span",{children:Ce})]})})]})}),c.jsxs("div",{className:"relative min-h-[118px] px-4 py-3 rounded-b-lg border-t border-black/5 dark:border-white/10 bg-white dark:bg-gray-900",children:[c.jsx("div",{className:"min-w-0",children:c.jsxs("div",{className:"mt-0.5 flex items-start gap-2 min-w-0",children:[fe?c.jsx("span",{className:"shrink-0 self-start rounded bg-amber-500/15 px-1.5 py-0.5 text-[11px] leading-none font-semibold text-amber-800 dark:text-amber-300",children:"HOT"}):null,c.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-gray-900 dark:text-white",title:Wr(qe)||"—",children:Wr(qe)||"—"})]})}),c.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[c.jsx("div",{className:"min-w-0",children:c.jsx("span",{className:["block truncate text-xs text-gray-500 dark:text-gray-400",kt?"cursor-zoom-in hover:text-gray-700 dark:hover:text-gray-200":""].filter(Boolean).join(" "),title:kt?`${st} (Hover: Model-Preview)`:st,onMouseEnter:Ft=>{Ft.stopPropagation(),kt&&Ve(Ie)},onMouseLeave:Ft=>{Ft.stopPropagation(),Ve(Qn=>Qn===Ie?null:Qn)},onMouseDown:Ft=>Ft.stopPropagation(),onClick:Ft=>Ft.stopPropagation(),children:st||"—"})}),c.jsxs("div",{className:"shrink-0 flex items-center gap-1.5",children:[et?c.jsx(yl,{className:"size-4 text-sky-600 dark:text-sky-300"}):null,Je?c.jsx(bl,{className:"size-4 text-rose-600 dark:text-rose-300"}):null,We?c.jsx(_u,{className:"size-4 text-amber-600 dark:text-amber-300"}):null]})]}),c.jsx("div",{className:"mt-2",onClick:Ft=>Ft.stopPropagation(),onMouseDown:Ft=>Ft.stopPropagation(),children:c.jsx("div",{className:"w-full",children:c.jsx("div",{className:"w-full rounded-md bg-gray-50/70 p-1 ring-1 ring-black/5 dark:bg-white/5 dark:ring-white/10",children:c.jsx(Bs,{job:Se,variant:"table",busy:At,collapseToMenu:!0,compact:!0,isHot:fe,isFavorite:We,isLiked:Je,isWatching:et,onToggleWatch:$,onToggleFavorite:ue,onToggleLike:se,onToggleHot:async Ft=>{if(!(le&&le(Ft)))return E(Ft)},onKeep:async Ft=>X&&X(Ft)?!0:re(Ft),onDelete:async Ft=>F&&F(Ft)?!0:O(Ft),order:["watch","favorite","like","hot","keep","delete","details","add"],className:"w-full gap-1.5"})})})}),c.jsx("div",{className:"mt-2",onClick:Ft=>Ft.stopPropagation(),onMouseDown:Ft=>Ft.stopPropagation(),children:c.jsx(dd,{rowKey:Ie,tags:mt,activeTagSet:q,lower:R,onToggleTagFilter:Q})})]})]},Ie)})}),e&&n.length===0?c.jsx("div",{className:"absolute inset-0 z-20 grid place-items-center rounded-lg bg-white/50 backdrop-blur-[2px] dark:bg-gray-950/40",children:c.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white/80 px-3 py-2 shadow-sm dark:border-white/10 dark:bg-gray-900/70",children:[c.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-transparent dark:border-white/20 dark:border-t-transparent"}),c.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-100",children:"Lade…"})]})}):null]})}function G1(n,e,t){return Math.max(e,Math.min(t,n))}function O0(n,e){const t=[];for(let i=n;i<=e;i++)t.push(i);return t}function b3(n,e,t,i){if(n<=1)return[1];const a=1,l=n,u=O0(a,Math.min(t,l)),h=O0(Math.max(l-t+1,t+1),l),f=Math.max(Math.min(e-i,l-t-i*2-1),t+1),g=Math.min(Math.max(e+i,t+i*2+2),l-t),w=[];w.push(...u),f>t+1?w.push("ellipsis"):t+1t&&w.push(l-t),w.push(...h);const S=new Set;return w.filter(A=>{const C=String(A);return S.has(C)?!1:(S.add(C),!0)})}function v3({active:n,disabled:e,rounded:t,onClick:i,children:a,title:l}){const u=t==="l"?"rounded-l-md":t==="r"?"rounded-r-md":"";return c.jsx("button",{type:"button",disabled:e,onClick:e?void 0:i,title:l,className:gn("relative inline-flex items-center px-4 py-2 text-sm font-semibold focus:z-20 focus:outline-offset-0",u,e?"opacity-50 cursor-not-allowed":"cursor-pointer",n?"z-10 bg-indigo-600 text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:focus-visible:outline-indigo-500":"text-gray-900 inset-ring inset-ring-gray-300 hover:bg-gray-50 dark:text-gray-200 dark:inset-ring-gray-700 dark:hover:bg-white/5"),"aria-current":n?"page":void 0,children:a})}function Cf({page:n,pageSize:e,totalItems:t,onPageChange:i,siblingCount:a=1,boundaryCount:l=1,showSummary:u=!0,className:h,ariaLabel:f="Pagination",prevLabel:g="Previous",nextLabel:w="Next"}){const S=Math.max(1,Math.ceil((t||0)/Math.max(1,e||1))),A=G1(n||1,1,S);if(S<=1)return null;const C=t===0?0:(A-1)*e+1,j=Math.min(A*e,t),k=b3(S,A,l,a),B=V=>i(G1(V,1,S));return c.jsxs("div",{className:gn("flex items-center justify-between bg-transparent dark:border-white/10",h),children:[c.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[c.jsx("button",{type:"button",onClick:()=>B(A-1),disabled:A<=1,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10",children:g}),c.jsx("button",{type:"button",onClick:()=>B(A+1),disabled:A>=S,className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10",children:w})]}),c.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[c.jsx("div",{children:u?c.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300 px-2",children:["Showing ",c.jsx("span",{className:"font-medium",children:C})," to"," ",c.jsx("span",{className:"font-medium",children:j})," of"," ",c.jsx("span",{className:"font-medium",children:t})," results"]}):null}),c.jsx("div",{children:c.jsxs("nav",{"aria-label":f,className:"isolate inline-flex -space-x-px rounded-md shadow-xs dark:shadow-none",children:[c.jsxs("button",{type:"button",onClick:()=>B(A-1),disabled:A<=1,className:"relative inline-flex items-center rounded-l-md px-2 py-2 text-gray-400 inset-ring inset-ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0 disabled:opacity-50 disabled:cursor-not-allowed dark:inset-ring-gray-700 dark:hover:bg-white/5",children:[c.jsx("span",{className:"sr-only",children:g}),c.jsx(l3,{"aria-hidden":"true",className:"size-5"})]}),k.map((V,W)=>V==="ellipsis"?c.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-700 inset-ring inset-ring-gray-300 dark:text-gray-400 dark:inset-ring-gray-700",children:"…"},`e-${W}`):c.jsx(v3,{active:V===A,onClick:()=>B(V),rounded:"none",children:V},V)),c.jsxs("button",{type:"button",onClick:()=>B(A+1),disabled:A>=S,className:"relative inline-flex items-center rounded-r-md px-2 py-2 text-gray-400 inset-ring inset-ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0 disabled:opacity-50 disabled:cursor-not-allowed dark:inset-ring-gray-700 dark:hover:bg-white/5",children:[c.jsx("span",{className:"sr-only",children:w}),c.jsx(c3,{"aria-hidden":"true",className:"size-5"})]})]})})]})]})}const Bw=m.createContext(null),L0=220;function x3(n){switch(n){case"success":return{Icon:zA,cls:"text-emerald-600 dark:text-emerald-400"};case"error":return{Icon:_N,cls:"text-rose-600 dark:text-rose-400"};case"warning":return{Icon:KA,cls:"text-amber-600 dark:text-amber-400"};default:return{Icon:eN,cls:"text-sky-600 dark:text-sky-400"}}}function _3(n){switch(n){case"success":return"border-emerald-200/80 dark:border-emerald-400/20";case"error":return"border-rose-200/80 dark:border-rose-400/20";case"warning":return"border-amber-200/80 dark:border-amber-400/20";default:return"border-sky-200/80 dark:border-sky-400/20"}}function w3(n){switch(n){case"success":return{line:"bg-emerald-500 dark:bg-emerald-400",progressTrack:"bg-emerald-500/10 dark:bg-emerald-400/10",progressFill:"bg-emerald-500/70 dark:bg-emerald-400/70",iconBg:"bg-emerald-50 dark:bg-emerald-400/10"};case"error":return{line:"bg-rose-500 dark:bg-rose-400",progressTrack:"bg-rose-500/10 dark:bg-rose-400/10",progressFill:"bg-rose-500/70 dark:bg-rose-400/70",iconBg:"bg-rose-50 dark:bg-rose-400/10"};case"warning":return{line:"bg-amber-500 dark:bg-amber-400",progressTrack:"bg-amber-500/10 dark:bg-amber-400/10",progressFill:"bg-amber-500/70 dark:bg-amber-400/70",iconBg:"bg-amber-50 dark:bg-amber-400/10"};default:return{line:"bg-sky-500 dark:bg-sky-400",progressTrack:"bg-sky-500/10 dark:bg-sky-400/10",progressFill:"bg-sky-500/70 dark:bg-sky-400/70",iconBg:"bg-sky-50 dark:bg-sky-400/10"}}}function S3(n){switch(n){case"success":return"Erfolg";case"error":return"Fehler";case"warning":return"Hinweis";default:return"Info"}}function T3(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function k3({children:n,maxToasts:e=3,defaultDurationMs:t=3500,position:i="bottom-right"}){const[a,l]=m.useState([]),[u,h]=m.useState(!0),f=m.useRef({}),g=m.useRef({}),w=m.useRef({}),S=m.useRef({}),A=m.useRef({}),C=m.useCallback(E=>{const R=f.current[E];R&&(window.clearTimeout(R),delete f.current[E]);const ee=g.current[E];ee&&(window.clearTimeout(ee),delete g.current[E]),delete w.current[E],delete S.current[E],delete A.current[E]},[]),j=m.useCallback(async()=>{try{const E=await fetch("/api/settings",{cache:"no-store"});if(!E.ok)return;const R=await E.json();h(!!(R?.enableNotifications??!0))}catch{}},[]);m.useEffect(()=>{j();const E=()=>j();return window.addEventListener("recorder-settings-updated",E),()=>window.removeEventListener("recorder-settings-updated",E)},[j]),m.useEffect(()=>{u||(l(R=>R.map(ee=>ee.type==="error"?ee:{...ee,open:!1})),a.filter(R=>R.type!=="error").map(R=>R.id).forEach(R=>{C(R),g.current[R]=window.setTimeout(()=>{l(ee=>ee.filter(q=>q.id!==R)),delete g.current[R]},L0)}))},[u]);const k=m.useCallback(E=>{l(R=>R.map(ee=>ee.id===E?{...ee,open:!1}:ee)),C(E),g.current[E]=window.setTimeout(()=>{l(R=>R.filter(ee=>ee.id!==E)),delete g.current[E]},L0)},[C]),B=m.useCallback(()=>{l(E=>E.map(R=>({...R,open:!1}))),Object.keys(f.current).forEach(E=>{window.clearTimeout(f.current[E]),delete f.current[E]}),Object.keys(g.current).forEach(E=>{window.clearTimeout(g.current[E]),delete g.current[E]}),window.setTimeout(()=>l([]),L0)},[]),V=m.useCallback((E,R)=>{if(!R||R<=0)return;const ee=f.current[E];ee&&(window.clearTimeout(ee),delete f.current[E]),w.current[E]=Date.now(),S.current[E]=R,A.current[E]=!1,f.current[E]=window.setTimeout(()=>{k(E),delete f.current[E],delete w.current[E],delete S.current[E],delete A.current[E]},R)},[k]),W=m.useCallback(E=>{if(!u&&E.type!=="error")return"";const R=T3(),ee=E.durationMs??t;return l(q=>{const Q=[{...E,id:R,durationMs:ee,open:!0},...q],ue=Math.max(1,e),se=Q.slice(0,ue);return Q.slice(ue).forEach(F=>C(F.id)),se}),ee&&ee>0&&V(R,ee),R},[t,e,u,C,V]),H=m.useCallback(E=>{if(A.current[E])return;const R=f.current[E];if(!R)return;window.clearTimeout(R),delete f.current[E];const ee=w.current[E]??Date.now(),q=S.current[E]??0,Q=Date.now()-ee,ue=Math.max(0,q-Q);S.current[E]=ue,A.current[E]=!0},[]),ie=m.useCallback(E=>{if(!A.current[E])return;const R=S.current[E]??0;if(R<=0){k(E);return}A.current[E]=!1,w.current[E]=Date.now(),f.current[E]=window.setTimeout(()=>{k(E),delete f.current[E],delete w.current[E],delete S.current[E],delete A.current[E]},R)},[k]);m.useEffect(()=>()=>{Object.values(f.current).forEach(E=>window.clearTimeout(E)),Object.values(g.current).forEach(E=>window.clearTimeout(E))},[]);const Y=m.useMemo(()=>({push:W,remove:k,clear:B}),[W,k,B]),G=i==="top-right"||i==="top-left"?"items-start sm:items-start sm:justify-start":"items-end sm:items-end sm:justify-end",O=i.endsWith("left")?"sm:items-start":"sm:items-end",re=i.startsWith("top")?"top-0 bottom-auto":"bottom-0 top-auto";return c.jsxs(Bw.Provider,{value:Y,children:[n,c.jsx("style",{children:` - @keyframes toast-progress { - from { transform: scaleX(1); } - to { transform: scaleX(0); } - } - - .toast-progress-bar { - animation-name: toast-progress; - animation-timing-function: linear; - animation-fill-mode: forwards; - transform-origin: left center; - will-change: transform; - } - `}),c.jsx("div",{"aria-live":"assertive",className:["pointer-events-none fixed z-[80] inset-x-0",re].join(" "),children:c.jsx("div",{className:["flex w-full px-3 py-4 sm:px-6 sm:py-6",G].join(" "),children:c.jsx("div",{className:["flex w-full flex-col gap-2.5 sm:gap-3",O].join(" "),children:a.map(E=>{const{Icon:R,cls:ee}=x3(E.type),q=w3(E.type),Q=(E.title||"").trim()||S3(E.type),ue=(E.message||"").trim(),se=(E.imageUrl||"").trim(),$=(E.imageAlt||Q).trim(),F=typeof E.onClick=="function";return c.jsx(ed,{appear:!0,show:E.open,enter:"transform transition ease-out duration-250",enterFrom:"opacity-0 -translate-y-3 sm:-translate-y-2",enterTo:"opacity-100 translate-y-0",leave:"transform transition ease-in duration-200",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-2 sm:-translate-y-3",children:c.jsx("div",{role:F?"button":"status",className:["pointer-events-auto relative w-[22rem] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl","border bg-white dark:bg-slate-900","shadow-sm","ring-1 ring-black/5 dark:ring-white/5",F?"cursor-pointer transition-[box-shadow,transform,background-color] duration-150 hover:bg-gray-50 dark:hover:bg-slate-800/90 hover:shadow-lg hover:ring-black/10 dark:hover:ring-white/10 active:scale-[0.998]":"",_3(E.type)].join(" "),onMouseEnter:()=>H(E.id),onMouseLeave:()=>ie(E.id),onFocus:()=>H(E.id),onBlur:()=>ie(E.id),onClick:()=>{E.onClick&&(E.onClick(),E.closeOnClick!==!1&&k(E.id))},onKeyDown:X=>{E.onClick&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),E.onClick(),E.closeOnClick!==!1&&k(E.id))},tabIndex:F?0:void 0,"aria-label":F?`${Q} öffnen`:void 0,children:se?c.jsxs("div",{className:"relative pr-12 sm:pr-14",children:[c.jsxs("div",{className:"flex items-stretch",children:[c.jsx("div",{className:"shrink-0",children:c.jsx("img",{src:se,alt:$,loading:"lazy",referrerPolicy:"no-referrer",className:["h-full min-h-[72px] w-16 sm:w-[72px]","object-cover object-center","rounded-l-xl","border-r border-black/5 dark:border-white/10","bg-gray-100 dark:bg-white/5"].join(" ")})}),c.jsxs("div",{className:"min-w-0 flex-1 py-3 pl-3 pr-2 sm:py-3.5 sm:pl-3.5 sm:pr-3",children:[c.jsx("p",{className:"truncate text-sm font-semibold leading-5 text-gray-900 dark:text-white",children:Q}),ue?c.jsx("p",{className:"mt-0.5 text-sm leading-5 text-gray-600 dark:text-gray-300 break-words",children:ue}):null]})]}),c.jsxs("button",{type:"button",onClick:X=>{X.stopPropagation(),k(E.id)},title:"Schließen",className:["absolute right-2 top-1/2 -translate-y-1/2","inline-flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-full","text-gray-400 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white","hover:bg-gray-100 dark:hover:bg-white/10","active:scale-[0.98] active:bg-gray-200/80 dark:active:bg-white/15","transition","focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2","dark:focus-visible:ring-indigo-400 dark:focus-visible:ring-offset-slate-900"].join(" "),children:[c.jsx("span",{className:"sr-only",children:"Schließen"}),c.jsx(U1,{"aria-hidden":"true",className:"size-5.5 sm:size-6"})]})]}):c.jsxs("div",{className:"relative pr-12 py-2.5 sm:pr-14",children:[c.jsxs("div",{className:"flex items-center gap-3 px-3 sm:px-3.5",children:[c.jsx("div",{className:"shrink-0",children:c.jsx("div",{className:["inline-flex h-12 w-12 sm:h-14 sm:w-14 items-center justify-center rounded-full",q.iconBg,"ring-1 ring-black/5 dark:ring-white/10"].join(" "),children:c.jsx(R,{className:["size-5.5 sm:size-6",ee].join(" "),"aria-hidden":"true"})})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-sm font-semibold leading-5 text-gray-900 dark:text-white",children:Q}),ue?c.jsx("p",{className:"mt-0.5 text-sm leading-5 text-gray-600 dark:text-gray-300 break-words",children:ue}):null]})]}),c.jsxs("button",{type:"button",onClick:X=>{X.stopPropagation(),k(E.id)},title:"Schließen",className:["absolute right-2 top-1/2 -translate-y-1/2","inline-flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-full","text-gray-400 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white","hover:bg-gray-100 dark:hover:bg-white/10","active:scale-[0.98] active:bg-gray-200/80 dark:active:bg-white/15","transition","focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2","dark:focus-visible:ring-indigo-400 dark:focus-visible:ring-offset-slate-900"].join(" "),children:[c.jsx("span",{className:"sr-only",children:"Schließen"}),c.jsx(U1,{"aria-hidden":"true",className:"size-5.5 sm:size-6"})]})]})})},E.id)})})})})]})}function E3(){const n=m.useContext(Bw);if(!n)throw new Error("useToast must be used within ");return n}function Pw(){const{push:n,remove:e,clear:t}=E3(),i=a=>(l,u,h)=>n({type:a,title:l,message:u,...h});return{push:n,remove:e,clear:t,success:i("success"),error:i("error"),info:i("info"),warning:i("warning")}}function C3(n){return typeof n=="number"?n:n==="xs"?12:n==="sm"?16:n==="lg"?28:20}function K1(...n){return n.filter(Boolean).join(" ")}function W1({size:n="md",className:e,label:t,srLabel:i="Lädt…",center:a=!1}){const l=C3(n);return c.jsxs("span",{className:K1("inline-flex items-center gap-2",a&&"justify-center w-full"),role:"status","aria-live":"polite",children:[c.jsxs("svg",{width:l,height:l,viewBox:"0 0 24 24",className:K1("animate-spin text-gray-500",e),"aria-hidden":"true",children:[c.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),c.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",d:"M21 12a9 9 0 0 0-9-9",opacity:"0.95"})]}),t?c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-200",children:t}):c.jsx("span",{className:"sr-only",children:i})]})}const _y=n=>(n||"").replaceAll("\\","/"),hr=n=>{const t=_y(n).split("/");return t[t.length-1]||""},_i=n=>{const e=n?.id;return e!=null&&String(e).trim()!==""?String(e):hr(n.output||"")||String(n?.output||"")},A3=n=>{const e=_y(String(n??""));return e.includes("/.trash/")||e.endsWith("/.trash")};function X1(n){if(!Number.isFinite(n)||n<=0)return"—";const e=Math.floor(n/1e3),t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t>0?`${t}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function I0(n){if(typeof n!="number"||!Number.isFinite(n)||n<=0)return"—";const e=["B","KB","MB","GB","TB"];let t=n,i=0;for(;t>=1024&&i=100?0:t>=10?1:2;return`${t.toFixed(a)} ${e[i]}`}function Y1(n){const[e,t]=m.useState(!1);return m.useEffect(()=>{const i=window.matchMedia(n),a=()=>t(i.matches);return a(),i.addEventListener?i.addEventListener("change",a):i.addListener(a),()=>{i.removeEventListener?i.removeEventListener("change",a):i.removeListener(a)}},[n]),e}const Bc=n=>{const e=hr(n||""),t=Wr(e);if(!t)return"—";const i=t.replace(/\.[^.]+$/,""),a=i.match(/^(.*?)_\d{1,2}_\d{1,2}_\d{4}__\d{1,2}-\d{2}-\d{2}$/);if(a?.[1])return a[1];const l=i.lastIndexOf("_");return l>0?i.slice(0,l):i},os=n=>(n||"").trim().toLowerCase(),N3=n=>{const e=String(n??"").trim();if(!e)return[];const t=e.split(/[\n,;|]+/g).map(l=>l.trim()).filter(Boolean),i=new Set,a=[];for(const l of t){const u=l.toLowerCase();i.has(u)||(i.add(u),a.push(l))}return a.sort((l,u)=>l.localeCompare(u,void 0,{sensitivity:"base"})),a},B0=n=>{const e=n,t=e.sizeBytes??e.fileSizeBytes??e.bytes??e.size??null;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null};function Q1(n){return new Promise(e=>window.setTimeout(e,n))}function D3(n){return n instanceof Error?n.message||String(n):String(n??"")}function Z1(n){const e=D3(n).toLowerCase();return e.includes("wird gerade verwendet")||e.includes("wird gerade abgespielt")||e.includes("sharing violation")||e.includes("used by another process")||e.includes("file in use")||e.includes("409")}async function P0(n,e){const t=await fetch(n,e);if(!t.ok){const a=(await t.text().catch(()=>"")||`HTTP ${t.status}`).trim();throw new Error(a)}return t}function M3(){const n=m.useRef([]),e=m.useRef(!1),t=m.useRef(!1),i=m.useRef(new Set),a=m.useCallback(()=>{if(t.current)return;t.current=!0;const f=()=>{t.current=!1,l()};typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(f,{timeout:250}):setTimeout(f,0)},[]),l=m.useCallback(async()=>{if(!e.current){e.current=!0;try{for(;n.current.length>0;){const f=n.current.shift();if(f){try{await f.run()}finally{i.current.delete(f.id)}await new Promise(g=>setTimeout(g,0))}}}finally{e.current=!1,n.current.length>0&&a()}}},[a]),u=m.useCallback((f,g)=>!f||i.current.has(f)?!1:(i.current.add(f),n.current.push({id:f,run:g}),a(),!0),[a]),h=m.useCallback(f=>i.current.has(f),[]);return{enqueue:u,isQueued:h}}function R3({jobs:n,doneJobs:e,blurPreviews:t,teaserPlayback:i,teaserAudio:a,onOpenPlayer:l,onDeleteJob:u,onToggleHot:h,onToggleFavorite:f,onToggleLike:g,onToggleWatch:w,onKeepJob:S,doneTotal:A,page:C,pageSize:j,onPageChange:k,assetNonce:B,sortMode:V,onSortModeChange:W,modelsByKey:H,loadMode:ie="paged"}){const Y=ie==="all",G=i??"hover",O=Y1("(hover: hover) and (pointer: fine)"),re=Pw(),E=M3(),R=m.useRef(new Map),[ee,q]=m.useState(null),[Q,ue]=m.useState(null),se=m.useRef(null),$=m.useRef(new WeakMap),[F,X]=m.useState(()=>new Set),[le,de]=m.useState(()=>new Set),[L,pe]=m.useState(!1),we=m.useRef(!1),Be=m.useRef(!1),Ve=m.useRef(0),Oe="finishedDownloads_lastUndo_v1",[Te,_t]=m.useState(()=>{if(typeof window>"u")return null;try{const Z=localStorage.getItem(Oe);if(!Z)return null;const ce=JSON.parse(Z);if(!ce||ce.v!==1||!ce.action)return null;const ve=Date.now()-Number(ce.ts||0);return!Number.isFinite(ve)||ve<0||ve>1800*1e3?(localStorage.removeItem(Oe),null):ce.action}catch{return null}}),[dt,xe]=m.useState(!1);m.useEffect(()=>{try{if(!Te){localStorage.removeItem(Oe);return}const Z={v:1,action:Te,ts:Date.now()};localStorage.setItem(Oe,JSON.stringify(Z))}catch{}},[Te]);const[Ne,Se]=m.useState({}),[Ie,$e]=m.useState(null),[Ct,st]=m.useState(null),[gt,He]=m.useState(0),We=m.useRef(null),Je=m.useRef({pending:0,t:0,timer:0}),et=m.useCallback(Z=>{!Z||!Number.isFinite(Z)||(Je.current.pending+=Z,!Je.current.timer&&(Je.current.timer=window.setTimeout(()=>{Je.current.timer=0;const ce=Je.current.pending;Je.current.pending=0,ce&&window.dispatchEvent(new CustomEvent("finished-downloads:count-hint",{detail:{delta:ce}}))},120)))},[]),mt="finishedDownloads_view",Mt="finishedDownloads_includeKeep_v2",fe="finishedDownloads_mobileOptionsOpen_v1",[qe,Le]=m.useState("table"),[Ce,Pe]=m.useState(!1),[Qe,At]=m.useState(!1),Xt=m.useRef(new Map),[kt,mn]=m.useState([]),It=m.useMemo(()=>new Set(kt.map(os)),[kt]),$t=m.useMemo(()=>{const Z={},ce={};for(const[ve,Me]of Object.entries(H??{})){const I=os(ve),U=N3(Me?.tags);Z[I]=U,ce[I]=new Set(U.map(os))}return{tagsByModelKey:Z,tagSetByModelKey:ce}},[H]),[Ot,en]=m.useState(""),Sn=m.useDeferredValue(Ot),Pn=m.useMemo(()=>os(Sn).split(/\s+/g).map(Z=>Z.trim()).filter(Boolean),[Sn]),St=m.useCallback(()=>en(""),[]),Tn=m.useCallback(Z=>{const ce=os(Z);mn(ve=>ve.some(I=>os(I)===ce)?ve.filter(I=>os(I)!==ce):[...ve,Z])},[]),D=It.size>0||Pn.some(Z=>Z.length>=2),P=D||Y,ne=m.useCallback(async Z=>{const ce=Ie==null;ce&&pe(!0);try{const ve=await fetch(`/api/record/done?all=1&sort=${encodeURIComponent(V)}&withCount=1${Ce?"&includeKeep=1":""}`,{cache:"no-store",signal:Z});if(!ve.ok)return;const Me=await ve.json().catch(()=>null),I=Array.isArray(Me?.items)?Me.items:[],U=Number(Me?.count??Me?.totalCount??I.length);$e(I),st(Number.isFinite(U)?U:I.length)}finally{ce&&pe(!1)}},[V,Ce]),Re=m.useCallback(()=>mn([]),[]);m.useEffect(()=>{try{const Z=localStorage.getItem("finishedDownloads_pendingTags");if(!Z)return;const ce=JSON.parse(Z),ve=Array.isArray(ce)?ce.map(Me=>String(Me||"").trim()).filter(Boolean):[];if(ve.length===0)return;vu.flushSync(()=>mn(ve)),C!==1&&k(1)}catch{}finally{try{localStorage.removeItem("finishedDownloads_pendingTags")}catch{}}},[]);const Ge=m.useCallback(()=>{We.current==null&&(We.current=window.setTimeout(()=>{We.current=null,He(Z=>Z+1)},80))},[C,j,V,Ce]);m.useEffect(()=>{if(!P)return;const Z=new AbortController,ce=window.setTimeout(()=>{ne(Z.signal).catch(()=>{})},250);return()=>{window.clearTimeout(ce),Z.abort()}},[P,ne]),m.useEffect(()=>{if(gt===0)return;const Z=new AbortController;let ce=!0,ve=!1;const Me=++Ve.current,I=()=>{ve||(ve=!0,Ve.current===Me&&(we.current=!1,Be.current&&(Be.current=!1,Ge())))};return Ve.current===Me&&(we.current=!0),P?((async()=>{try{await ne(Z.signal),ce&&(Rn.current=0)}catch{}finally{ce&&I()}})(),()=>{ce=!1,Z.abort(),I()}):(pe(!0),(async()=>{try{const U=await fetch(`/api/record/done?page=${C}&pageSize=${j}&sort=${encodeURIComponent(V)}&withCount=1${Ce?"&includeKeep=1":""}`,{cache:"no-store",signal:Z.signal});if(!ce||Z.signal.aborted)return;const te=U.ok;if(U.ok){const ye=await U.json().catch(()=>null);if(!ce||Z.signal.aborted)return;const ge=Array.isArray(ye?.items)?ye.items:Array.isArray(ye)?ye:[];$e(ge);const at=Number(ye?.count??ye?.totalCount??ge.length),lt=Number.isFinite(at)&&at>=0?at:0;st(lt);const ut=Math.max(1,Math.ceil(lt/j));if(C>ut){k(ut),$e(null);return}}if(te)Rn.current=0;else if(ce&&!Z.signal.aborted&&Rn.current<2){Rn.current+=1;const ye=Rn.current;window.setTimeout(()=>{Z.signal.aborted||He(ge=>ge+1)},400*ye)}}catch{}finally{ce&&(pe(!1),I())}})(),()=>{ce=!1,Z.abort(),I()})},[gt,P,ne,C,j,V,Ce,k]),m.useEffect(()=>{P||($e(null),st(null))},[C,j,V,Ce,P]),m.useEffect(()=>{if(!Ce){D||($e(null),st(null));return}if(D)return;const Z=new AbortController;return(async()=>{try{const ce=await fetch(`/api/record/done?page=${C}&pageSize=${j}&sort=${encodeURIComponent(V)}&withCount=1&includeKeep=1`,{cache:"no-store",signal:Z.signal});if(!ce.ok)return;const ve=await ce.json().catch(()=>null),Me=Array.isArray(ve?.items)?ve.items:[],I=Number(ve?.count??ve?.totalCount??Me.length);$e(Me),st(Number.isFinite(I)?I:Me.length)}catch{}})(),()=>Z.abort()},[Ce,D,C,j,V]),m.useEffect(()=>{try{const Z=localStorage.getItem(mt);Le(Z==="table"||Z==="cards"||Z==="gallery"?Z:window.matchMedia("(max-width: 639px)").matches?"cards":"table")}catch{Le("table")}},[]),m.useEffect(()=>{try{localStorage.setItem(mt,qe)}catch{}},[qe]),m.useEffect(()=>{try{const Z=localStorage.getItem(Mt);Pe(Z==="1"||Z==="true"||Z==="yes")}catch{Pe(!1)}},[]),m.useEffect(()=>{try{localStorage.setItem(Mt,Ce?"1":"0")}catch{}},[Ce]),m.useEffect(()=>{try{const Z=localStorage.getItem(fe);At(Z==="1"||Z==="true"||Z==="yes")}catch{At(!1)}},[]),m.useEffect(()=>{try{localStorage.setItem(fe,Qe?"1":"0")}catch{}},[Qe]);const[yt,tn]=m.useState({}),un=m.useRef({}),vn=m.useRef(null),[cn,Cn]=m.useState({}),xn=m.useRef({}),on=m.useRef(null),Rn=m.useRef(0);m.useEffect(()=>{xn.current=cn},[cn]);const qt=m.useCallback(()=>{on.current==null&&(on.current=window.setTimeout(()=>{on.current=null,Cn({...xn.current})},200))},[]);m.useEffect(()=>()=>{on.current!=null&&(window.clearTimeout(on.current),on.current=null)},[]),m.useEffect(()=>{un.current=yt},[yt]);const Bt=m.useCallback(()=>{vn.current==null&&(vn.current=window.setTimeout(()=>{vn.current=null,tn({...un.current})},200))},[]);m.useEffect(()=>()=>{vn.current!=null&&(window.clearTimeout(vn.current),vn.current=null)},[]);const[Zt,zt]=m.useState(null),Pt=!a,Nn=m.useCallback(Z=>{const ve=document.getElementById(Z)?.querySelector("video");if(!ve)return!1;cd(ve,{muted:Pt});const Me=ve.play?.();return Me&&typeof Me.catch=="function"&&Me.catch(()=>{}),!0},[Pt]),Ft=m.useCallback(Z=>{zt(ce=>ce?.key===Z?{key:Z,nonce:ce.nonce+1}:{key:Z,nonce:1})},[]),Qn=m.useCallback((Z,ce,ve)=>{const Me=Number.isFinite(ce)&&ce>0?ce:0;zt(U=>U?.key===Z?{key:Z,nonce:U.nonce+1}:{key:Z,nonce:1});const I=U=>{const ye=document.getElementById(ve)?.querySelector("video");if(!ye){U>0&&requestAnimationFrame(()=>I(U-1));return}cd(ye,{muted:Pt});const ge=()=>{try{const Dt=Number(ye.duration),Yt=Number.isFinite(Dt)&&Dt>0?Math.max(0,Dt-.05):Me;ye.currentTime=Math.max(0,Math.min(Me,Yt))}catch{}const ut=ye.play?.();ut&&typeof ut.catch=="function"&&ut.catch(()=>{})};if(ye.readyState>=1){ge();return}const at=()=>{ye.removeEventListener("loadedmetadata",at),ge()};ye.addEventListener("loadedmetadata",at,{once:!0});const lt=ye.play?.();lt&&typeof lt.catch=="function"&<.catch(()=>{})};requestAnimationFrame(()=>I(8))},[Pt]),Xn=m.useCallback(Z=>{zt(null),l(Z)},[l]),Gn=m.useCallback((Z,ce)=>{const ve=Number.isFinite(ce)&&ce>=0?ce:0;zt(null),l(Z,ve)},[l]),ln=m.useCallback((Z,ce,ve)=>{const Me=Number.isFinite(ce)?Math.floor(ce):0,I=Number.isFinite(ve)?Math.floor(ve):0;if(I<=0){Xn(Z);return}const U=_i(Z),te=yt[U]??Z?.durationSeconds??0;if(!Number.isFinite(te)||te<=0){Xn(Z);return}const ye=Math.max(0,Math.min(Me,I-1)),ge=te/I,at=ye*ge;Gn(Z,at)},[yt,_i,Xn,Gn]),Zn=m.useCallback((Z,ce)=>{de(ve=>{const Me=new Set(ve);return ce?Me.add(Z):Me.delete(Z),Me})},[]),ti=m.useCallback(Z=>{X(ce=>{const ve=new Set(ce);return ve.add(Z),ve})},[]),[jn,Kn]=m.useState(()=>new Set),rn=m.useCallback((Z,ce)=>{Kn(ve=>{const Me=new Set(ve);return ce?Me.add(Z):Me.delete(Z),Me})},[]),[Di,oi]=m.useState(()=>new Set),ni=m.useRef(new Map);m.useEffect(()=>()=>{for(const Z of ni.current.values())window.clearTimeout(Z);ni.current.clear()},[]);const di=m.useCallback((Z,ce)=>{oi(ve=>{const Me=new Set(ve);return ce?Me.add(Z):Me.delete(Z),Me})},[]),Ci=m.useCallback(Z=>{const ce=ni.current.get(Z);ce!=null&&(window.clearTimeout(ce),ni.current.delete(Z))},[]),Fn=m.useCallback(Z=>{Ci(Z),X(ce=>{const ve=new Set(ce);return ve.delete(Z),ve}),oi(ce=>{const ve=new Set(ce);return ve.delete(Z),ve}),de(ce=>{const ve=new Set(ce);return ve.delete(Z),ve}),Kn(ce=>{const ve=new Set(ce);return ve.delete(Z),ve})},[Ci]),On=m.useCallback(Z=>{di(Z,!0),Ci(Z);const ce=window.setTimeout(()=>{ni.current.delete(Z),ti(Z),di(Z,!1)},320);ni.current.set(Z,ce)},[ti,di,Ci]),$n=m.useCallback(async(Z,ce)=>{window.dispatchEvent(new CustomEvent("player:release",{detail:{file:Z}})),ce?.close&&window.dispatchEvent(new CustomEvent("player:close",{detail:{file:Z}})),await new Promise(ve=>requestAnimationFrame(()=>ve())),window.dispatchEvent(new CustomEvent("player:release",{detail:{file:Z}})),await new Promise(ve=>window.setTimeout(ve,260))},[]),_e=m.useCallback(async(Z,ce,ve)=>{const Me=Math.max(1,ve?.attempts??4),I=Math.max(50,ve?.baseDelayMs??220);let U;for(let te=1;te<=Me;te++)try{return await $n(Z,{close:ve?.close??!0}),te>1?await Q1(I*te):await Q1(80),await ce()}catch(ye){if(U=ye,!Z1(ye)||te>=Me)throw ye;continue}throw U instanceof Error?U:new Error(String(U??"Unbekannter Fehler"))},[$n]),nt=m.useCallback(async Z=>{const{file:ce,rowKey:ve,setBusy:Me,isBusyNow:I,optimisticRemove:U,alreadyRemoved:te,run:ye,onSuccess:ge,onError:at,labels:lt}=Z;if(!ce)return re.error(lt.invalidTitle,lt.invalidBody),{ok:!1};if(I?.())return{ok:!1};Me?.(!0);try{U&&!te&&On(ve);const ut=await ye();return await ge?.(ut),{ok:!0,result:ut}}catch(ut){if(U&&Fn(ve),await at?.(ut),Z1(ut))re.error(lt.inUseTitle,`${ce} wird noch verwendet (Player/Preview). Bitte kurz warten und erneut versuchen.`);else{const Dt=ut?.message?` — ${String(ut.message)}`:"";re.error(lt.failTitle,`${lt.failPrefix??ce}${Dt}`)}return{ok:!1}}finally{Me?.(!1)}},[re,On,Fn]),ht=m.useCallback(async(Z,ce)=>{const ve=hr(Z.output||""),Me=_i(Z);return(await nt({kind:"delete",job:Z,file:ve,rowKey:Me,setBusy:U=>Zn(Me,U),isBusyNow:()=>le.has(Me),optimisticRemove:!0,alreadyRemoved:ce?.alreadyRemoved,labels:{invalidTitle:"Löschen nicht möglich",invalidBody:"Kein Dateiname gefunden – kann nicht löschen.",inUseTitle:"Löschen fehlgeschlagen",failTitle:"Löschen fehlgeschlagen",failPrefix:ve},run:async()=>u?await _e(ve,async()=>await u(Z),{close:!0,attempts:4,baseDelayMs:220}):await(await _e(ve,async()=>await P0(`/api/record/delete?file=${encodeURIComponent(ve)}`,{method:"POST"}),{close:!0,attempts:4,baseDelayMs:220})).json().catch(()=>null),onSuccess:async U=>{if(u){const ge=typeof U?.undoToken=="string"?U.undoToken:"";_t(ge?{kind:"delete",undoToken:ge,originalFile:ve,rowKey:Me}:null);return}const te=U?.from==="keep"?"keep":"done",ye=typeof U?.undoToken=="string"?U.undoToken:"";_t(ye?{kind:"delete",undoToken:ye,originalFile:ve,rowKey:Me,from:te}:null),Ge(),et(-1)}})).ok},[hr,_i,le,Zn,u,_e,nt,Ge,et]),Ht=m.useCallback(async(Z,ce)=>{const ve=hr(Z.output||""),Me=_i(Z);return(await nt({kind:"keep",job:Z,file:ve,rowKey:Me,setBusy:U=>rn(Me,U),isBusyNow:()=>jn.has(Me)||le.has(Me),optimisticRemove:!0,alreadyRemoved:ce?.alreadyRemoved,labels:{invalidTitle:"Keep nicht möglich",invalidBody:"Kein Dateiname gefunden – kann nicht behalten.",inUseTitle:"Keep fehlgeschlagen",failTitle:"Keep fehlgeschlagen",failPrefix:ve},run:async()=>S?await _e(ve,async()=>await S(Z),{close:!0,attempts:4,baseDelayMs:220}):await(await _e(ve,async()=>await P0(`/api/record/keep?file=${encodeURIComponent(ve)}`,{method:"POST"}),{close:!0,attempts:4,baseDelayMs:220})).json().catch(()=>null),onSuccess:async U=>{const te=typeof U?.newFile=="string"&&U.newFile?U.newFile:ve;_t({kind:"keep",keptFile:te,originalFile:ve,rowKey:Me}),Ge(),et(Ce?0:-1)}})).ok},[hr,_i,rn,jn,le,_e,nt,Ge,et,Ce]),De=m.useCallback((Z,ce)=>{!Z||!ce||Z===ce||Se(ve=>{const Me={...ve};for(const[I,U]of Object.entries(Me))(I===Z||I===ce||U===Z||U===ce)&&delete Me[I];return Me[Z]=ce,Me})},[]),vt=m.useCallback((Z,ce)=>{!Z&&!ce||Se(ve=>{const Me={...ve};for(const[I,U]of Object.entries(Me))(I===Z||I===ce||U===Z||U===ce)&&delete Me[I];return Me})},[]),wt=m.useCallback(async()=>{if(!Te||dt)return;xe(!0);const Z=ce=>{X(ve=>{const Me=new Set(ve);return Me.delete(ce),Me}),de(ve=>{const Me=new Set(ve);return Me.delete(ce),Me}),Kn(ve=>{const Me=new Set(ve);return Me.delete(ce),Me}),oi(ve=>{const Me=new Set(ve);return Me.delete(ce),Me})};try{if(Te.kind==="delete"){const ce=await fetch(`/api/record/restore?token=${encodeURIComponent(Te.undoToken)}`,{method:"POST"});if(!ce.ok){const U=await ce.text().catch(()=>"");throw new Error(U||`HTTP ${ce.status}`)}const ve=await ce.json().catch(()=>null),Me=String(ve?.restoredFile||Te.originalFile);Te.rowKey&&Z(Te.rowKey),Z(Te.originalFile),Z(Me);const I=Te.from==="keep"&&!Ce?0:1;et(I),Ge(),_t(null);return}if(Te.kind==="keep"){const ce=await fetch(`/api/record/unkeep?file=${encodeURIComponent(Te.keptFile)}`,{method:"POST"});if(!ce.ok){const I=await ce.text().catch(()=>"");throw new Error(I||`HTTP ${ce.status}`)}const ve=await ce.json().catch(()=>null),Me=String(ve?.newFile||Te.originalFile);Te.rowKey&&Z(Te.rowKey),Z(Te.originalFile),Z(Me),et(1),Ge(),_t(null);return}if(Te.kind==="hot"){const ce=await fetch(`/api/record/toggle-hot?file=${encodeURIComponent(Te.currentFile)}`,{method:"POST"});if(!ce.ok){const U=await ce.text().catch(()=>"");throw new Error(U||`HTTP ${ce.status}`)}const ve=await ce.json().catch(()=>null),Me=String(ve?.oldFile||Te.currentFile),I=String(ve?.newFile||"");I&&De(Me,I),Ge(),_t(null);return}}catch(ce){re.error("Undo fehlgeschlagen",String(ce?.message||ce))}finally{xe(!1)}},[Te,dt,re,Ge,Ce,et,De]),[Nt,Gt]=m.useState(()=>new Set),Kt=m.useCallback((Z,ce)=>{Gt(ve=>{const Me=new Set(ve);return ce?Me.add(Z):Me.delete(Z),Me})},[]),sn=m.useCallback(async Z=>{const ce=hr(Z.output||""),ve=_i(Z),Me=te=>uu(te)?Wr(te):`HOT ${te}`,I=ce,U=Me(I);await nt({kind:"rename",job:Z,file:ce,rowKey:ve,setBusy:te=>Kt(ve,te),isBusyNow:()=>Nt.has(ve),optimisticRemove:!1,labels:{invalidTitle:"HOT nicht möglich",invalidBody:"Kein Dateiname gefunden – kann nicht HOT togglen.",inUseTitle:"HOT umbenennen fehlgeschlagen",failTitle:"HOT umbenennen fehlgeschlagen",failPrefix:I},run:async()=>(De(I,U),h?await h(Z):await(await _e(I,async()=>await P0(`/api/record/toggle-hot?file=${encodeURIComponent(I)}`,{method:"POST"}),{close:!0,attempts:4,baseDelayMs:220})).json().catch(()=>null)),onSuccess:async te=>{const ye=typeof te?.oldFile=="string"&&te.oldFile?te.oldFile:I,ge=typeof te?.newFile=="string"&&te.newFile?te.newFile:U;ye&&ge&&ye!==ge&&De(ye,ge),_t({kind:"hot",currentFile:ge}),(!h||V==="file_asc"||V==="file_desc")&&Ge()},onError:async()=>{vt(I,U),_t(null)}})},[hr,_i,Nt,Kt,nt,De,vt,h,_e,Ge,V]),Mn=m.useCallback(Z=>{const ce=_i(Z),ve=hr(Z.output||"");if(!ce||!ve||le.has(ce)||jn.has(ce))return!1;Zn(ce,!0),On(ce);const Me=`delete:${ce}`,I=E.enqueue(Me,async()=>{await ht(Z,{alreadyRemoved:!0})});return I||Fn(ce),I},[E,_i,hr,le,jn,Zn,ht]),Yn=m.useCallback(Z=>{const ce=_i(Z),ve=hr(Z.output||"");if(!ce||!ve||jn.has(ce)||le.has(ce))return!1;rn(ce,!0),On(ce);const Me=`keep:${ce}`,I=E.enqueue(Me,async()=>{await Ht(Z,{alreadyRemoved:!0})});return I||Fn(ce),I},[E,_i,hr,jn,le,rn,Ht]),nr=m.useCallback(Z=>{const ce=_i(Z);if(!ce||Nt.has(ce))return!1;const ve=`hot:${ce}`;return E.enqueue(ve,async()=>{await sn(Z)})},[E,_i,sn,Nt]),Wn=m.useCallback(Z=>{const ce=_y(Z.output||""),ve=hr(ce),Me=Ne[ve];if(!Me)return Z;const I=ce.lastIndexOf("/"),U=I>=0?ce.slice(0,I+1):"";return{...Z,output:U+Me}},[Ne]),Wi=Ie??e,Hi=Ct??A,Si=m.useMemo(()=>{const Z=new Map;for(const ve of Wi){const Me=Wn(ve);Z.set(_i(Me),Me)}for(const ve of n){const Me=Wn(ve),I=_i(Me);Z.has(I)&&Z.set(I,{...Z.get(I),...Me})}return Array.from(Z.values()).filter(ve=>F.has(_i(ve))||A3(ve.output)?!1:ve.status==="finished"||ve.status==="failed"||ve.status==="stopped")},[n,Wi,F,Wn]),Xi=m.useRef(new Map);m.useEffect(()=>{const Z=new Map;for(const ce of Si){const ve=hr(ce.output||"");ve&&Z.set(ve,_i(ce))}Xi.current=Z},[Si]),m.useEffect(()=>{const Z=ce=>{const ve=ce.detail;if(!ve?.file)return;const Me=Xi.current.get(ve.file)||ve.file;if(ve.phase==="start"){Zn(Me,!0),On(Me);return}if(ve.phase==="error"){Fn(Me),Xt.current.get(Me)?.reset();return}if(ve.phase==="success"){Zn(Me,!1);return}};return window.addEventListener("finished-downloads:delete",Z),()=>window.removeEventListener("finished-downloads:delete",Z)},[On,Zn,Ge,Fn]),m.useEffect(()=>{const Z=()=>{if(we.current){Be.current||(Be.current=!0);return}We.current==null&&Ge()};return window.addEventListener("finished-downloads:reload",Z),()=>window.removeEventListener("finished-downloads:reload",Z)},[Ge]),m.useEffect(()=>{const Z=ce=>{const ve=ce.detail,Me=String(ve?.oldFile??"").trim(),I=String(ve?.newFile??"").trim();!Me||!I||Me===I||De(Me,I)};return window.addEventListener("finished-downloads:rename",Z),()=>window.removeEventListener("finished-downloads:rename",Z)},[De]);const ii=m.useMemo(()=>{const Z=Si.filter(ve=>!F.has(_i(ve))),ce=Pn.length?Z.filter(ve=>{const Me=hr(ve.output||""),I=Bc(ve.output),U=os(I),te=$t.tagsByModelKey[U]??[],ye=os([Me,Wr(Me),I,ve.id,te.join(" ")].join(" "));for(const ge of Pn)if(!ye.includes(ge))return!1;return!0}):Z;return It.size===0?ce:ce.filter(ve=>{const Me=os(Bc(ve.output)),I=$t.tagSetByModelKey[Me];if(!I||I.size===0)return!1;for(const U of It)if(!I.has(U))return!1;return!0})},[Si,F,It,$t,Pn]),Mi=P?ii.length:Hi,Ti=m.useMemo(()=>{if(!P)return ii;const Z=(C-1)*j,ce=Z+j;return ii.slice(Math.max(0,Z),Math.max(0,ce))},[P,ii,C,j]),Bi=!P&&Mi===0,ir=D&&ii.length===0,hi=Y&&ii.length===0,Yi=L&&(Bi||hi||ir);m.useEffect(()=>{if(!D)return;const Z=Math.max(1,Math.ceil(ii.length/j));C>Z&&k(Z)},[D,ii.length,C,j,k]),m.useEffect(()=>{if(!(G==="hover"&&!O&&(qe==="cards"||qe==="gallery"||qe==="table"))){q(null),se.current?.disconnect(),se.current=null;return}if(qe==="cards"&&Zt?.key){q(Zt.key);return}se.current?.disconnect();const ce=new IntersectionObserver(ve=>{let Me=null,I=0;for(const U of ve){if(!U.isIntersecting)continue;const te=$.current.get(U.target);te&&U.intersectionRatio>I&&(I=U.intersectionRatio,Me=te)}Me&&q(U=>U===Me?U:Me)},{threshold:[0,.15,.3,.5,.7,.9],rootMargin:"0px"});se.current=ce;for(const[ve,Me]of R.current)$.current.set(Me,ve),ce.observe(Me);return()=>{ce.disconnect(),se.current===ce&&(se.current=null)}},[qe,G,O,Zt?.key]);const Pi=Z=>{const ce=_i(Z),ve=yt[ce]??Z?.durationSeconds;if(typeof ve=="number"&&Number.isFinite(ve)&&ve>0)return X1(ve*1e3);const Me=Date.parse(String(Z.startedAt||"")),I=Date.parse(String(Z.endedAt||""));return Number.isFinite(Me)&&Number.isFinite(I)&&I>Me?X1(I-Me):"—"},ae=m.useCallback(Z=>ce=>{const ve=R.current.get(Z);ve&&se.current&&se.current.unobserve(ve),ce?(R.current.set(Z,ce),$.current.set(ce,Z),se.current?.observe(ce)):R.current.delete(Z)},[]),ke=m.useCallback((Z,ce)=>{if(!Number.isFinite(ce)||ce<=0)return;const ve=_i(Z),Me=un.current[ve];typeof Me=="number"&&Math.abs(Me-ce)<.5||(un.current={...un.current,[ve]:ce},Bt())},[Bt]),pt=m.useCallback((Z,ce,ve)=>{if(!Number.isFinite(ce)||!Number.isFinite(ve)||ce<=0||ve<=0)return;const Me=_i(Z),I=xn.current[Me];I&&I.w===ce&&I.h===ve||(xn.current={...xn.current,[Me]:{w:ce,h:ve}},qt())},[qt]),xt=Y1("(max-width: 639px)"),Rt="mt-10",Et="mb-2";return m.useEffect(()=>{if(!xt||qe!=="cards")return;const Z=Ti[0];if(!Z){q(null);return}const ce=_i(Z);q(Me=>Me===ce?Me:null);const ve=window.setTimeout(()=>{q(Me=>Me===ce?Me:ce)},140);return()=>window.clearTimeout(ve)},[xt,qe,Ti,_i]),m.useEffect(()=>{xt||(Xt.current=new Map)},[xt]),m.useEffect(()=>{Bi&&C!==1&&k(1)},[Bi,C,k]),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sticky top-[56px] z-20",children:c.jsxs("div",{className:`\r - rounded-xl border border-gray-200/70 bg-white/80 shadow-sm\r - backdrop-blur supports-[backdrop-filter]:bg-white/60\r - dark:border-white/10 dark:bg-gray-950/60 dark:supports-[backdrop-filter]:bg-gray-950/40\r - `,children:[c.jsxs("div",{className:"flex items-center gap-3 p-3",children:[c.jsxs("div",{className:"hidden sm:flex items-center gap-2 min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:"Abgeschlossene Downloads"}),c.jsx("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-900 dark:bg-white/10 dark:text-gray-200",children:Mi})]}),c.jsxs("div",{className:"sm:hidden flex items-center gap-2 min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-gray-900 dark:text-white",children:"Abgeschlossene Downloads"}),c.jsx("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-900 dark:bg-white/10 dark:text-gray-200",children:Mi})]}),c.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[L?c.jsx(W1,{size:"lg",className:"text-indigo-500",srLabel:"Lade Downloads…"}):null,c.jsxs("div",{className:"hidden sm:flex items-center gap-2 min-w-0 flex-1",children:[c.jsx("input",{value:Ot,onChange:Z=>en(Z.target.value),placeholder:"Suchen…",className:`\r - h-9 w-full max-w-[420px] rounded-md border border-gray-200 bg-white px-3 text-sm text-gray-900 shadow-sm\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:border-white/10 dark:bg-gray-900 dark:text-gray-100 dark:[color-scheme:dark]\r - `}),(Ot||"").trim()!==""?c.jsx(hn,{size:"sm",variant:"soft",onClick:St,children:"Leeren"}):null]}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(Na,{label:"Behaltene Downloads anzeigen",checked:Ce,onChange:Z=>{C!==1&&k(1),Pe(Z)}})}),qe!=="table"&&c.jsxs("div",{className:"hidden sm:block",children:[c.jsx("label",{className:"sr-only",htmlFor:"finished-sort",children:"Sortierung"}),c.jsxs("select",{id:"finished-sort",value:V,onChange:Z=>{const ce=Z.target.value;W(ce),C!==1&&k(1)},className:`\r - h-9 rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-900 shadow-sm\r - dark:border-white/10 dark:bg-gray-900 dark:text-gray-100 dark:[color-scheme:dark]\r - `,children:[c.jsx("option",{value:"completed_desc",children:"Fertiggestellt am ↓"}),c.jsx("option",{value:"completed_asc",children:"Fertiggestellt am ↑"}),c.jsx("option",{value:"file_asc",children:"Modelname A→Z"}),c.jsx("option",{value:"file_desc",children:"Modelname Z→A"}),c.jsx("option",{value:"duration_desc",children:"Dauer ↓"}),c.jsx("option",{value:"duration_asc",children:"Dauer ↑"}),c.jsx("option",{value:"size_desc",children:"Größe ↓"}),c.jsx("option",{value:"size_asc",children:"Größe ↑"})]})]}),c.jsx(hn,{size:"md",variant:"soft",disabled:!Te||dt,onClick:wt,title:Te?`Letzte Aktion rückgängig machen (${Te.kind})`:"Keine Aktion zum Rückgängig machen",children:"Undo"}),c.jsx(Pg,{value:qe,onChange:Z=>Le(Z),size:xt?"sm":"md",ariaLabel:"Ansicht",items:[{id:"table",icon:c.jsx(yN,{className:xt?"size-4":"size-5"}),label:xt?void 0:"Tabelle",srLabel:"Tabelle"},{id:"cards",icon:c.jsx(dN,{className:xt?"size-4":"size-5"}),label:xt?void 0:"Cards",srLabel:"Cards"},{id:"gallery",icon:c.jsx(mN,{className:xt?"size-4":"size-5"}),label:xt?void 0:"Galerie",srLabel:"Galerie"}]}),c.jsxs("button",{type:"button",className:`sm:hidden relative inline-flex items-center justify-center rounded-md border border-gray-200 bg-white p-2 shadow-sm\r - hover:bg-gray-50 dark:border-white/10 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-white/10`,onClick:()=>At(Z=>!Z),"aria-expanded":Qe,"aria-controls":"finished-mobile-options","aria-label":"Filter & Optionen",children:[c.jsx(NA,{className:"size-5"}),D||Ce?c.jsx("span",{className:"absolute -top-1 -right-1 h-2.5 w-2.5 rounded-full bg-indigo-500 ring-2 ring-white dark:ring-gray-950"}):null]})]})]}),kt.length>0?c.jsxs("div",{className:"hidden sm:flex items-center gap-2 border-t border-gray-200/60 dark:border-white/10 px-3 py-2",children:[c.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:"Tag-Filter"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[kt.map(Z=>c.jsx(ws,{tag:Z,active:!0,onClick:Tn},Z)),c.jsx(hn,{className:`\r - ml-1 inline-flex items-center rounded-md px-2 py-1 text-xs font-medium\r - text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-white/10\r - `,size:"sm",variant:"soft",onClick:Re,children:"Zurücksetzen"})]})]}):null,c.jsxs("div",{id:"finished-mobile-options",className:["sm:hidden overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out",Qe?"max-h-[720px] opacity-100":"max-h-0 opacity-0"].join(" "),children:[c.jsx("div",{className:"border-t border-gray-200/60 dark:border-white/10 p-3",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"rounded-lg border border-gray-200/70 bg-white/70 p-2 shadow-sm dark:border-white/10 dark:bg-gray-900/60",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:Ot,onChange:Z=>en(Z.target.value),placeholder:"Suchen…",className:`\r - h-10 w-full rounded-md border border-gray-200 bg-white px-3 text-sm text-gray-900\r - focus:outline-none focus:ring-2 focus:ring-indigo-500\r - dark:border-white/10 dark:bg-gray-950/60 dark:text-gray-100 dark:[color-scheme:dark]\r - `}),(Ot||"").trim()!==""?c.jsx(hn,{size:"sm",variant:"soft",onClick:St,children:"Clear"}):null]})}),c.jsx("div",{className:"rounded-lg border border-gray-200/70 bg-white/70 px-3 py-2 shadow-sm dark:border-white/10 dark:bg-gray-900/60",children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Keep anzeigen"}),c.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Behaltene Downloads in der Liste"})]}),c.jsx(Ig,{checked:Ce,onChange:Z=>{C!==1&&k(1),Pe(Z)},ariaLabel:"Behaltene Downloads anzeigen",size:"default"})]})}),qe!=="table"?c.jsxs("div",{className:"rounded-lg border border-gray-200/70 bg-white/70 px-3 py-2 shadow-sm dark:border-white/10 dark:bg-gray-900/60",children:[c.jsx("div",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 mb-1",children:"Sortierung"}),c.jsxs("select",{id:"finished-sort-mobile",value:V,onChange:Z=>{const ce=Z.target.value;W(ce),C!==1&&k(1)},className:`\r - w-full h-10 rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-900 shadow-sm\r - dark:border-white/10 dark:bg-gray-950/60 dark:text-gray-100 dark:[color-scheme:dark]\r - `,children:[c.jsx("option",{value:"completed_desc",children:"Fertiggestellt am ↓"}),c.jsx("option",{value:"completed_asc",children:"Fertiggestellt am ↑"}),c.jsx("option",{value:"file_asc",children:"Modelname A→Z"}),c.jsx("option",{value:"file_desc",children:"Modelname Z→A"}),c.jsx("option",{value:"duration_desc",children:"Dauer ↓"}),c.jsx("option",{value:"duration_asc",children:"Dauer ↑"}),c.jsx("option",{value:"size_desc",children:"Größe ↓"}),c.jsx("option",{value:"size_asc",children:"Größe ↑"})]})]}):null]})}),kt.length>0?c.jsx("div",{className:"border-t border-gray-200/60 dark:border-white/10 px-3 py-2",children:c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:"Tag-Filter"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[kt.map(Z=>c.jsx(ws,{tag:Z,active:!0,onClick:Tn},Z)),c.jsx(hn,{className:`\r - ml-1 inline-flex items-center rounded-md px-2 py-1 text-xs font-medium\r - text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-white/10\r - `,size:"sm",variant:"soft",onClick:Re,children:"Zurücksetzen"})]})]})}):null]})]})}),Yi?c.jsx(Is,{grayBody:!0,children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Lade Downloads…"}),c.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Bitte warte einen Moment."})]}),c.jsx(W1,{size:"lg",className:"text-indigo-500",srLabel:"Lade Downloads…"})]})}):Bi||hi?c.jsx(Is,{grayBody:!0,children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-xl bg-white/70 ring-1 ring-gray-200 dark:bg-white/5 dark:ring-white/10",children:c.jsx("span",{className:"text-lg",children:"📁"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Keine abgeschlossenen Downloads"}),c.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Im Zielordner ist aktuell nichts vorhanden."})]})]})}):ir?c.jsxs(Is,{grayBody:!0,children:[c.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Keine Treffer für die aktuellen Filter."}),kt.length>0||(Ot||"").trim()!==""?c.jsxs("div",{className:"mt-2 flex flex-wrap gap-3",children:[kt.length>0?c.jsx("button",{type:"button",className:"text-sm font-medium text-gray-700 hover:underline dark:text-gray-200",onClick:Re,children:"Tag-Filter zurücksetzen"}):null,(Ot||"").trim()!==""?c.jsx("button",{type:"button",className:"text-sm font-medium text-gray-700 hover:underline dark:text-gray-200",onClick:St,children:"Suche zurücksetzen"}):null]}):null]}):c.jsxs(c.Fragment,{children:[qe==="cards"&&c.jsx("div",{className:xt?`${Rt} ${Et}`:"",children:c.jsx(r3,{rows:Ti,isSmall:xt,isLoading:L,blurPreviews:t,durations:yt,teaserKey:ee,teaserPlayback:G,teaserAudio:a,hoverTeaserKey:Q,inlinePlay:Zt,deletingKeys:le,keepingKeys:jn,removingKeys:Di,swipeRefs:Xt,keyFor:_i,baseName:hr,modelNameFromOutput:Bc,runtimeOf:Pi,sizeBytesOf:B0,formatBytes:I0,lower:os,onOpenPlayer:l,openPlayer:Xn,onOpenPlayerAt:Gn,handleScrubberClickIndex:ln,startInlineAt:Qn,startInline:Ft,tryAutoplayInline:Nn,registerTeaserHost:ae,handleDuration:ke,deleteVideo:ht,keepVideo:Ht,releasePlayingFile:$n,modelsByKey:H,onToggleHot:sn,onToggleFavorite:f,onToggleLike:g,onToggleWatch:w,activeTagSet:It,onToggleTagFilter:Tn,onHoverPreviewKeyChange:ue,assetNonce:B??0,enqueueDeleteVideo:Mn,enqueueKeepVideo:Yn,enqueueToggleHot:nr})}),qe==="table"&&c.jsx(f3,{rows:Ti,isLoading:L,keyFor:_i,baseName:hr,lower:os,modelNameFromOutput:Bc,runtimeOf:Pi,sizeBytesOf:B0,formatBytes:I0,resolutions:cn,durations:yt,canHover:O,teaserAudio:a,hoverTeaserKey:Q,setHoverTeaserKey:ue,teaserPlayback:G,teaserKey:ee,registerTeaserHost:ae,handleDuration:ke,handleResolution:pt,blurPreviews:t,assetNonce:B,deletingKeys:le,keepingKeys:jn,removingKeys:Di,modelsByKey:H,activeTagSet:It,onToggleTagFilter:Tn,onOpenPlayer:l,handleScrubberClickIndex:ln,onSortModeChange:W,page:C,onPageChange:k,onToggleHot:sn,onToggleFavorite:f,onToggleLike:g,onToggleWatch:w,deleteVideo:ht,keepVideo:Ht,enqueueDeleteVideo:Mn,enqueueKeepVideo:Yn,enqueueToggleHot:nr}),qe==="gallery"&&c.jsx(y3,{rows:Ti,isLoading:L,blurPreviews:t,durations:yt,handleDuration:ke,teaserKey:ee,teaserPlayback:G,teaserAudio:a,hoverTeaserKey:Q,keyFor:_i,baseName:hr,modelNameFromOutput:Bc,runtimeOf:Pi,sizeBytesOf:B0,formatBytes:I0,deletingKeys:le,keepingKeys:jn,removingKeys:Di,deletedKeys:F,registerTeaserHost:ae,onOpenPlayer:l,handleScrubberClickIndex:ln,deleteVideo:ht,keepVideo:Ht,onToggleHot:sn,lower:os,modelsByKey:H,onToggleFavorite:f,onToggleLike:g,onToggleWatch:w,activeTagSet:It,onToggleTagFilter:Tn,onHoverPreviewKeyChange:ue,enqueueDeleteVideo:Mn,enqueueKeepVideo:Yn,enqueueToggleHot:nr}),c.jsx(Cf,{page:C,pageSize:j,totalItems:Mi,onPageChange:Z=>{vu.flushSync(()=>{zt(null),q(null),ue(null)});for(const ce of Ti){const ve=hr(ce.output||"");ve&&(window.dispatchEvent(new CustomEvent("player:release",{detail:{file:ve}})),window.dispatchEvent(new CustomEvent("player:close",{detail:{file:ve}})))}window.scrollTo({top:0,behavior:"auto"}),k(Z)},showSummary:!1,prevLabel:"Zurück",nextLabel:"Weiter",className:"mt-4"})]})]})}var F0,J1;function om(){if(J1)return F0;J1=1;var n;return typeof window<"u"?n=window:typeof bf<"u"?n=bf:typeof self<"u"?n=self:n={},F0=n,F0}var j3=om();const he=Ru(j3),O3={},L3=Object.freeze(Object.defineProperty({__proto__:null,default:O3},Symbol.toStringTag,{value:"Module"})),I3=ZE(L3);var U0,e2;function Fw(){if(e2)return U0;e2=1;var n=typeof bf<"u"?bf:typeof window<"u"?window:{},e=I3,t;return typeof document<"u"?t=document:(t=n["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=n["__GLOBAL_DOCUMENT_CACHE@4"]=e)),U0=t,U0}var B3=Fw();const Tt=Ru(B3);var Wh={exports:{}},z0={exports:{}},t2;function P3(){return t2||(t2=1,(function(n){function e(){return n.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(a,l){if(a){if(typeof a=="string")return t(a,l);var u=Object.prototype.toString.call(a).slice(8,-1);if(u==="Object"&&a.constructor&&(u=a.constructor.name),u==="Map"||u==="Set")return Array.from(a);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return t(a,l)}}function t(a,l){(l==null||l>a.length)&&(l=a.length);for(var u=0,h=new Array(l);u=400&&h.statusCode<=599){var g=f;if(l)if(n.TextDecoder){var w=t(h.headers&&h.headers["content-type"]);try{g=new TextDecoder(w).decode(f)}catch{}}else g=String.fromCharCode.apply(null,new Uint8Array(f));a({cause:g});return}a(null,f)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(a,l){var u=l.split("="),h=u[0],f=u[1];return h.trim()==="charset"?f.trim():a},"utf-8")}return V0=e,V0}var a2;function $3(){if(a2)return Wh.exports;a2=1;var n=om(),e=P3(),t=F3(),i=U3(),a=z3();g.httpHandler=H3(),g.requestInterceptorsStorage=new i,g.responseInterceptorsStorage=new i,g.retryManager=new a;var l=function(j){var k={};return j&&j.trim().split(` -`).forEach(function(B){var V=B.indexOf(":"),W=B.slice(0,V).trim().toLowerCase(),H=B.slice(V+1).trim();typeof k[W]>"u"?k[W]=H:Array.isArray(k[W])?k[W].push(H):k[W]=[k[W],H]}),k};Wh.exports=g,Wh.exports.default=g,g.XMLHttpRequest=n.XMLHttpRequest||A,g.XDomainRequest="withCredentials"in new g.XMLHttpRequest?g.XMLHttpRequest:n.XDomainRequest,u(["get","put","post","patch","head","delete"],function(C){g[C==="delete"?"del":C]=function(j,k,B){return k=f(j,k,B),k.method=C.toUpperCase(),w(k)}});function u(C,j){for(var k=0;k"u")throw new Error("callback argument missing");if(C.requestType&&g.requestInterceptorsStorage.getIsEnabled()){var j={uri:C.uri||C.url,headers:C.headers||{},body:C.body,metadata:C.metadata||{},retry:C.retry,timeout:C.timeout},k=g.requestInterceptorsStorage.execute(C.requestType,j);C.uri=k.uri,C.headers=k.headers,C.body=k.body,C.metadata=k.metadata,C.retry=k.retry,C.timeout=k.timeout}var B=!1,V=function(X,le,de){B||(B=!0,C.callback(X,le,de))};function W(){G.readyState===4&&!g.responseInterceptorsStorage.getIsEnabled()&&setTimeout(Y,0)}function H(){var F=void 0;if(G.response?F=G.response:F=G.responseText||S(G),ue)try{F=JSON.parse(F)}catch{}return F}function ie(F){if(clearTimeout(se),clearTimeout(C.retryTimeout),F instanceof Error||(F=new Error(""+(F||"Unknown XMLHttpRequest Error"))),F.statusCode=0,!re&&g.retryManager.getIsEnabled()&&C.retry&&C.retry.shouldRetry()){C.retryTimeout=setTimeout(function(){C.retry.moveToNextAttempt(),C.xhr=G,w(C)},C.retry.getCurrentFuzzedDelay());return}if(C.requestType&&g.responseInterceptorsStorage.getIsEnabled()){var X={headers:$.headers||{},body:$.body,responseUrl:G.responseURL,responseType:G.responseType},le=g.responseInterceptorsStorage.execute(C.requestType,X);$.body=le.body,$.headers=le.headers}return V(F,$)}function Y(){if(!re){var F;clearTimeout(se),clearTimeout(C.retryTimeout),C.useXDR&&G.status===void 0?F=200:F=G.status===1223?204:G.status;var X=$,le=null;if(F!==0?(X={body:H(),statusCode:F,method:R,headers:{},url:E,rawRequest:G},G.getAllResponseHeaders&&(X.headers=l(G.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),C.requestType&&g.responseInterceptorsStorage.getIsEnabled()){var de={headers:X.headers||{},body:X.body,responseUrl:G.responseURL,responseType:G.responseType},L=g.responseInterceptorsStorage.execute(C.requestType,de);X.body=L.body,X.headers=L.headers}return V(le,X,X.body)}}var G=C.xhr||null;G||(C.cors||C.useXDR?G=new g.XDomainRequest:G=new g.XMLHttpRequest);var O,re,E=G.url=C.uri||C.url,R=G.method=C.method||"GET",ee=C.body||C.data,q=G.headers=C.headers||{},Q=!!C.sync,ue=!1,se,$={body:void 0,headers:{},statusCode:0,method:R,url:E,rawRequest:G};if("json"in C&&C.json!==!1&&(ue=!0,q.accept||q.Accept||(q.Accept="application/json"),R!=="GET"&&R!=="HEAD"&&(q["content-type"]||q["Content-Type"]||(q["Content-Type"]="application/json"),ee=JSON.stringify(C.json===!0?ee:C.json))),G.onreadystatechange=W,G.onload=Y,G.onerror=ie,G.onprogress=function(){},G.onabort=function(){re=!0,clearTimeout(C.retryTimeout)},G.ontimeout=ie,G.open(R,E,!Q,C.username,C.password),Q||(G.withCredentials=!!C.withCredentials),!Q&&C.timeout>0&&(se=setTimeout(function(){if(!re){re=!0,G.abort("timeout");var F=new Error("XMLHttpRequest timeout");F.code="ETIMEDOUT",ie(F)}},C.timeout)),G.setRequestHeader)for(O in q)q.hasOwnProperty(O)&&G.setRequestHeader(O,q[O]);else if(C.headers&&!h(C.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in C&&(G.responseType=C.responseType),"beforeSend"in C&&typeof C.beforeSend=="function"&&C.beforeSend(G),G.send(ee||null),G}function S(C){try{if(C.responseType==="document")return C.responseXML;var j=C.responseXML&&C.responseXML.documentElement.nodeName==="parsererror";if(C.responseType===""&&!j)return C.responseXML}catch{}return null}function A(){}return Wh.exports}var q3=$3();const Uw=Ru(q3);var G0={exports:{}},K0,o2;function V3(){if(o2)return K0;o2=1;var n=Fw(),e=Object.create||(function(){function E(){}return function(R){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return E.prototype=R,new E}})();function t(E,R){this.name="ParsingError",this.code=E.code,this.message=R||E.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(E){function R(q,Q,ue,se){return(q|0)*3600+(Q|0)*60+(ue|0)+(se|0)/1e3}var ee=E.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return ee?ee[3]?R(ee[1],ee[2],ee[3].replace(":",""),ee[4]):ee[1]>59?R(ee[1],ee[2],0,ee[4]):R(0,ee[1],ee[2],ee[4]):null}function a(){this.values=e(null)}a.prototype={set:function(E,R){!this.get(E)&&R!==""&&(this.values[E]=R)},get:function(E,R,ee){return ee?this.has(E)?this.values[E]:R[ee]:this.has(E)?this.values[E]:R},has:function(E){return E in this.values},alt:function(E,R,ee){for(var q=0;q=0&&R<=100)?(this.set(E,R),!0):!1}};function l(E,R,ee,q){var Q=q?E.split(q):[E];for(var ue in Q)if(typeof Q[ue]=="string"){var se=Q[ue].split(ee);if(se.length===2){var $=se[0].trim(),F=se[1].trim();R($,F)}}}function u(E,R,ee){var q=E;function Q(){var $=i(E);if($===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+q);return E=E.replace(/^[^\sa-zA-Z-]+/,""),$}function ue($,F){var X=new a;l($,function(le,de){switch(le){case"region":for(var L=ee.length-1;L>=0;L--)if(ee[L].id===de){X.set(le,ee[L].region);break}break;case"vertical":X.alt(le,de,["rl","lr"]);break;case"line":var pe=de.split(","),we=pe[0];X.integer(le,we),X.percent(le,we)&&X.set("snapToLines",!1),X.alt(le,we,["auto"]),pe.length===2&&X.alt("lineAlign",pe[1],["start","center","end"]);break;case"position":pe=de.split(","),X.percent(le,pe[0]),pe.length===2&&X.alt("positionAlign",pe[1],["start","center","end"]);break;case"size":X.percent(le,de);break;case"align":X.alt(le,de,["start","center","end","left","right"]);break}},/:/,/\s/),F.region=X.get("region",null),F.vertical=X.get("vertical","");try{F.line=X.get("line","auto")}catch{}F.lineAlign=X.get("lineAlign","start"),F.snapToLines=X.get("snapToLines",!0),F.size=X.get("size",100);try{F.align=X.get("align","center")}catch{F.align=X.get("align","middle")}try{F.position=X.get("position","auto")}catch{F.position=X.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},F.align)}F.positionAlign=X.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},F.align)}function se(){E=E.replace(/^\s+/,"")}if(se(),R.startTime=Q(),se(),E.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+q);E=E.substr(3),se(),R.endTime=Q(),se(),ue(E,R)}var h=n.createElement&&n.createElement("textarea"),f={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},g={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},w={v:"title",lang:"lang"},S={rt:"ruby"};function A(E,R){function ee(){if(!R)return null;function we(Ve){return R=R.substr(Ve.length),Ve}var Be=R.match(/^([^<]*)(<[^>]*>?)?/);return we(Be[1]?Be[1]:Be[2])}function q(we){return h.innerHTML=we,we=h.textContent,h.textContent="",we}function Q(we,Be){return!S[Be.localName]||S[Be.localName]===we.localName}function ue(we,Be){var Ve=f[we];if(!Ve)return null;var Oe=E.document.createElement(Ve),Te=w[we];return Te&&Be&&(Oe[Te]=Be.trim()),Oe}for(var se=E.document.createElement("div"),$=se,F,X=[];(F=ee())!==null;){if(F[0]==="<"){if(F[1]==="/"){X.length&&X[X.length-1]===F.substr(2).replace(">","")&&(X.pop(),$=$.parentNode);continue}var le=i(F.substr(1,F.length-2)),de;if(le){de=E.document.createProcessingInstruction("timestamp",le),$.appendChild(de);continue}var L=F.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!L||(de=ue(L[1],L[3]),!de)||!Q($,de))continue;if(L[2]){var pe=L[2].split(".");pe.forEach(function(we){var Be=/^bg_/.test(we),Ve=Be?we.slice(3):we;if(g.hasOwnProperty(Ve)){var Oe=Be?"background-color":"color",Te=g[Ve];de.style[Oe]=Te}}),de.className=pe.join(" ")}X.push(L[1]),$.appendChild(de),$=de;continue}$.appendChild(E.document.createTextNode(q(F)))}return se}var C=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function j(E){for(var R=0;R=ee[0]&&E<=ee[1])return!0}return!1}function k(E){var R=[],ee="",q;if(!E||!E.childNodes)return"ltr";function Q($,F){for(var X=F.childNodes.length-1;X>=0;X--)$.push(F.childNodes[X])}function ue($){if(!$||!$.length)return null;var F=$.pop(),X=F.textContent||F.innerText;if(X){var le=X.match(/^.*(\n|\r)/);return le?($.length=0,le[0]):X}if(F.tagName==="ruby")return ue($);if(F.childNodes)return Q($,F),ue($)}for(Q(R,E);ee=ue(R);)for(var se=0;se=0&&E.line<=100))return E.line;if(!E.track||!E.track.textTrackList||!E.track.textTrackList.mediaElement)return-1;for(var R=E.track,ee=R.textTrackList,q=0,Q=0;QE.left&&this.topE.top},H.prototype.overlapsAny=function(E){for(var R=0;R=E.top&&this.bottom<=E.bottom&&this.left>=E.left&&this.right<=E.right},H.prototype.overlapsOppositeAxis=function(E,R){switch(R){case"+x":return this.leftE.right;case"+y":return this.topE.bottom}},H.prototype.intersectPercentage=function(E){var R=Math.max(0,Math.min(this.right,E.right)-Math.max(this.left,E.left)),ee=Math.max(0,Math.min(this.bottom,E.bottom)-Math.max(this.top,E.top)),q=R*ee;return q/(this.height*this.width)},H.prototype.toCSSCompatValues=function(E){return{top:this.top-E.top,bottom:E.bottom-this.bottom,left:this.left-E.left,right:E.right-this.right,height:this.height,width:this.width}},H.getSimpleBoxPosition=function(E){var R=E.div?E.div.offsetHeight:E.tagName?E.offsetHeight:0,ee=E.div?E.div.offsetWidth:E.tagName?E.offsetWidth:0,q=E.div?E.div.offsetTop:E.tagName?E.offsetTop:0;E=E.div?E.div.getBoundingClientRect():E.tagName?E.getBoundingClientRect():E;var Q={left:E.left,right:E.right,top:E.top||q,height:E.height||R,bottom:E.bottom||q+(E.height||R),width:E.width||ee};return Q};function ie(E,R,ee,q){function Q(Ve,Oe){for(var Te,_t=new H(Ve),dt=1,xe=0;xeNe&&(Te=new H(Ve),dt=Ne),Ve=new H(_t)}return Te||_t}var ue=new H(R),se=R.cue,$=B(se),F=[];if(se.snapToLines){var X;switch(se.vertical){case"":F=["+y","-y"],X="height";break;case"rl":F=["+x","-x"],X="width";break;case"lr":F=["-x","+x"],X="width";break}var le=ue.lineHeight,de=le*Math.round($),L=ee[X]+le,pe=F[0];Math.abs(de)>L&&(de=de<0?-1:1,de*=Math.ceil(L/le)*le),$<0&&(de+=se.vertical===""?ee.height:ee.width,F=F.reverse()),ue.move(pe,de)}else{var we=ue.lineHeight/ee.height*100;switch(se.lineAlign){case"center":$-=we/2;break;case"end":$-=we;break}switch(se.vertical){case"":R.applyStyles({top:R.formatStyle($,"%")});break;case"rl":R.applyStyles({left:R.formatStyle($,"%")});break;case"lr":R.applyStyles({right:R.formatStyle($,"%")});break}F=["+y","-x","+x","-y"],ue=new H(R)}var Be=Q(ue,F);R.move(Be.toCSSCompatValues(ee))}function Y(){}Y.StringDecoder=function(){return{decode:function(E){if(!E)return"";if(typeof E!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(E))}}},Y.convertCueToDOMTree=function(E,R){return!E||!R?null:A(E,R)};var G=.05,O="sans-serif",re="1.5%";return Y.processCues=function(E,R,ee){if(!E||!R||!ee)return null;for(;ee.firstChild;)ee.removeChild(ee.firstChild);var q=E.document.createElement("div");q.style.position="absolute",q.style.left="0",q.style.right="0",q.style.top="0",q.style.bottom="0",q.style.margin=re,ee.appendChild(q);function Q(le){for(var de=0;de")===-1){R.cue.id=se;continue}case"CUE":try{u(se,R.cue,R.regionList)}catch(le){R.reportOrThrowError(le),R.cue=null,R.state="BADCUE";continue}R.state="CUETEXT";continue;case"CUETEXT":var X=se.indexOf("-->")!==-1;if(!se||X&&(F=!0)){R.oncue&&R.oncue(R.cue),R.cue=null,R.state="ID";continue}R.cue.text&&(R.cue.text+=` -`),R.cue.text+=se.replace(/\u2028/g,` -`).replace(/u2029/g,` -`);continue;case"BADCUE":se||(R.state="ID");continue}}}catch(le){R.reportOrThrowError(le),R.state==="CUETEXT"&&R.cue&&R.oncue&&R.oncue(R.cue),R.cue=null,R.state=R.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var E=this;try{if(E.buffer+=E.decoder.decode(),(E.cue||E.state==="HEADER")&&(E.buffer+=` - -`,E.parse()),E.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(R){E.reportOrThrowError(R)}return E.onflush&&E.onflush(),this}},K0=Y,K0}var W0,l2;function G3(){if(l2)return W0;l2=1;var n="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(u){if(typeof u!="string")return!1;var h=e[u.toLowerCase()];return h?u.toLowerCase():!1}function a(u){if(typeof u!="string")return!1;var h=t[u.toLowerCase()];return h?u.toLowerCase():!1}function l(u,h,f){this.hasBeenReset=!1;var g="",w=!1,S=u,A=h,C=f,j=null,k="",B=!0,V="auto",W="start",H="auto",ie="auto",Y=100,G="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return g},set:function(O){g=""+O}},pauseOnExit:{enumerable:!0,get:function(){return w},set:function(O){w=!!O}},startTime:{enumerable:!0,get:function(){return S},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");S=O,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return A},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");A=O,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return C},set:function(O){C=""+O,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return j},set:function(O){j=O,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return k},set:function(O){var re=i(O);if(re===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");k=re,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return B},set:function(O){B=!!O,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return V},set:function(O){if(typeof O!="number"&&O!==n)throw new SyntaxError("Line: an invalid number or illegal string was specified.");V=O,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return W},set:function(O){var re=a(O);re?(W=re,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return H},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");H=O,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return ie},set:function(O){var re=a(O);re?(ie=re,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return Y},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");Y=O,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return G},set:function(O){var re=a(O);if(!re)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");G=re,this.hasBeenReset=!0}}}),this.displayState=void 0}return l.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},W0=l,W0}var X0,u2;function K3(){if(u2)return X0;u2=1;var n={"":!0,up:!0};function e(a){if(typeof a!="string")return!1;var l=n[a.toLowerCase()];return l?a.toLowerCase():!1}function t(a){return typeof a=="number"&&a>=0&&a<=100}function i(){var a=100,l=3,u=0,h=100,f=0,g=100,w="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(S){if(!t(S))throw new Error("Width must be between 0 and 100.");a=S}},lines:{enumerable:!0,get:function(){return l},set:function(S){if(typeof S!="number")throw new TypeError("Lines must be set to a number.");l=S}},regionAnchorY:{enumerable:!0,get:function(){return h},set:function(S){if(!t(S))throw new Error("RegionAnchorX must be between 0 and 100.");h=S}},regionAnchorX:{enumerable:!0,get:function(){return u},set:function(S){if(!t(S))throw new Error("RegionAnchorY must be between 0 and 100.");u=S}},viewportAnchorY:{enumerable:!0,get:function(){return g},set:function(S){if(!t(S))throw new Error("ViewportAnchorY must be between 0 and 100.");g=S}},viewportAnchorX:{enumerable:!0,get:function(){return f},set:function(S){if(!t(S))throw new Error("ViewportAnchorX must be between 0 and 100.");f=S}},scroll:{enumerable:!0,get:function(){return w},set:function(S){var A=e(S);A===!1?console.warn("Scroll: an invalid or illegal string was specified."):w=A}}})}return X0=i,X0}var c2;function W3(){if(c2)return G0.exports;c2=1;var n=om(),e=G0.exports={WebVTT:V3(),VTTCue:G3(),VTTRegion:K3()};n.vttjs=e,n.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,a=n.VTTCue,l=n.VTTRegion;return e.shim=function(){n.VTTCue=t,n.VTTRegion=i},e.restore=function(){n.VTTCue=a,n.VTTRegion=l},n.VTTCue||e.shim(),G0.exports}var X3=W3();const d2=Ru(X3);function tr(){return tr=Object.assign?Object.assign.bind():function(n){for(var e=1;e-1},e.trigger=function(i){var a=this.listeners[i];if(a)if(arguments.length===2)for(var l=a.length,u=0;u-1;t=this.buffer.indexOf(` -`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Z3=" ",Y0=function(n){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(n||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},J3=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Mr=function(n){const e={};if(!n)return e;const t=n.split(J3());let i=t.length,a;for(;i--;)t[i]!==""&&(a=/([^=]*)=(.*)/.exec(t[i]).slice(1),a[0]=a[0].replace(/^\s+|\s+$/g,""),a[1]=a[1].replace(/^\s+|\s+$/g,""),a[1]=a[1].replace(/^['"](.*)['"]$/g,"$1"),e[a[0]]=a[1]);return e},f2=n=>{const e=n.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class eD extends wy{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((l,u)=>{const h=u(e);return h===e?l:l.concat([h])},[e]).forEach(l=>{for(let u=0;ul),this.customParsers.push(l=>{if(e.exec(l))return this.trigger("data",{type:"custom",data:i(l),customType:t,segment:a}),!0})}addTagMapper({expression:e,map:t}){const i=a=>e.test(a)?t(a):a;this.tagMappers.push(i)}}const tD=n=>n.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),yo=function(n){const e={};return Object.keys(n).forEach(function(t){e[tD(t)]=n[t]}),e},Q0=function(n){const{serverControl:e,targetDuration:t,partTargetDuration:i}=n;if(!e)return;const a="#EXT-X-SERVER-CONTROL",l="holdBack",u="partHoldBack",h=t&&t*3,f=i&&i*2;t&&!e.hasOwnProperty(l)&&(e[l]=h,this.trigger("info",{message:`${a} defaulting HOLD-BACK to targetDuration * 3 (${h}).`})),h&&e[l]{a.uri||!a.parts&&!a.preloadHints||(!a.map&&l&&(a.map=l),!a.key&&u&&(a.key=u),!a.timeline&&typeof S=="number"&&(a.timeline=S),this.manifest.preloadSegment=a)}),this.parseStream.on("data",function(k){let B,V;if(t.manifest.definitions){for(const W in t.manifest.definitions)if(k.uri&&(k.uri=k.uri.replace(`{$${W}}`,t.manifest.definitions[W])),k.attributes)for(const H in k.attributes)typeof k.attributes[H]=="string"&&(k.attributes[H]=k.attributes[H].replace(`{$${W}}`,t.manifest.definitions[W]))}({tag(){({version(){k.version&&(this.manifest.version=k.version)},"allow-cache"(){this.manifest.allowCache=k.allowed,"allowed"in k||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const W={};"length"in k&&(a.byterange=W,W.length=k.length,"offset"in k||(k.offset=A)),"offset"in k&&(a.byterange=W,W.offset=k.offset),A=W.offset+W.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),k.title&&(a.title=k.title),k.duration>0&&(a.duration=k.duration),k.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!k.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(k.attributes.METHOD==="NONE"){u=null;return}if(!k.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(k.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:k.attributes};return}if(k.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:k.attributes.URI};return}if(k.attributes.KEYFORMAT===w){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(k.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(k.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),k.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(k.attributes.KEYID&&k.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:k.attributes.KEYFORMAT,keyId:k.attributes.KEYID.substring(2)},pssh:zw(k.attributes.URI.split(",")[1])};return}k.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:k.attributes.METHOD||"AES-128",uri:k.attributes.URI},typeof k.attributes.IV<"u"&&(u.iv=k.attributes.IV)},"media-sequence"(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+k.number});return}this.manifest.mediaSequence=k.number},"discontinuity-sequence"(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+k.number});return}this.manifest.discontinuitySequence=k.number,S=k.number},"playlist-type"(){if(!/VOD|EVENT/.test(k.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+k.playlist});return}this.manifest.playlistType=k.playlistType},map(){l={},k.uri&&(l.uri=k.uri),k.byterange&&(l.byterange=k.byterange),u&&(l.key=u)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||g,!k.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),tr(a.attributes,k.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||g,!(k.attributes&&k.attributes.TYPE&&k.attributes["GROUP-ID"]&&k.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const W=this.manifest.mediaGroups[k.attributes.TYPE];W[k.attributes["GROUP-ID"]]=W[k.attributes["GROUP-ID"]]||{},B=W[k.attributes["GROUP-ID"]],V={default:/yes/i.test(k.attributes.DEFAULT)},V.default?V.autoselect=!0:V.autoselect=/yes/i.test(k.attributes.AUTOSELECT),k.attributes.LANGUAGE&&(V.language=k.attributes.LANGUAGE),k.attributes.URI&&(V.uri=k.attributes.URI),k.attributes["INSTREAM-ID"]&&(V.instreamId=k.attributes["INSTREAM-ID"]),k.attributes.CHARACTERISTICS&&(V.characteristics=k.attributes.CHARACTERISTICS),k.attributes.FORCED&&(V.forced=/yes/i.test(k.attributes.FORCED)),B[k.attributes.NAME]=V},discontinuity(){S+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=k.dateTimeString,this.manifest.dateTimeObject=k.dateTimeObject),a.dateTimeString=k.dateTimeString,a.dateTimeObject=k.dateTimeObject;const{lastProgramDateTime:W}=this;this.lastProgramDateTime=new Date(k.dateTimeString).getTime(),W===null&&this.manifest.segments.reduceRight((H,ie)=>(ie.programDateTime=H-ie.duration*1e3,ie.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(k.duration)||k.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+k.duration});return}this.manifest.targetDuration=k.duration,Q0.call(this,this.manifest)},start(){if(!k.attributes||isNaN(k.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:k.attributes["TIME-OFFSET"],precise:k.attributes.PRECISE}},"cue-out"(){a.cueOut=k.data},"cue-out-cont"(){a.cueOutCont=k.data},"cue-in"(){a.cueIn=k.data},skip(){this.manifest.skip=yo(k.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",k.attributes,["SKIPPED-SEGMENTS"])},part(){h=!0;const W=this.manifest.segments.length,H=yo(k.attributes);a.parts=a.parts||[],a.parts.push(H),H.byterange&&(H.byterange.hasOwnProperty("offset")||(H.byterange.offset=C),C=H.byterange.offset+H.byterange.length);const ie=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${ie} for segment #${W}`,k.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((Y,G)=>{Y.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${G} lacks required attribute(s): LAST-PART`})})},"server-control"(){const W=this.manifest.serverControl=yo(k.attributes);W.hasOwnProperty("canBlockReload")||(W.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Q0.call(this,this.manifest),W.canSkipDateranges&&!W.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const W=this.manifest.segments.length,H=yo(k.attributes),ie=H.type&&H.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(H),H.byterange&&(H.byterange.hasOwnProperty("offset")||(H.byterange.offset=ie?C:0,ie&&(C=H.byterange.offset+H.byterange.length)));const Y=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${Y} for segment #${W}`,k.attributes,["TYPE","URI"]),!!H.type)for(let G=0;GG.id===H.id);this.manifest.dateRanges[Y]=tr(this.manifest.dateRanges[Y],H),j[H.id]=tr(j[H.id],H),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=yo(k.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",k.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const W=(H,ie)=>{if(H in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${H}`});return}this.manifest.definitions[H]=ie};if("QUERYPARAM"in k.attributes){if("NAME"in k.attributes||"IMPORT"in k.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const H=this.params.get(k.attributes.QUERYPARAM);if(!H){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${k.attributes.QUERYPARAM}`});return}W(k.attributes.QUERYPARAM,decodeURIComponent(H));return}if("NAME"in k.attributes){if("IMPORT"in k.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in k.attributes)||typeof k.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${k.attributes.NAME}`});return}W(k.attributes.NAME,k.attributes.VALUE);return}if("IMPORT"in k.attributes){if(!this.mainDefinitions[k.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${k.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}W(k.attributes.IMPORT,this.mainDefinitions[k.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:k.attributes,uri:k.uri,timeline:S}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",k.attributes,["BANDWIDTH","URI"])}}[k.tagType]||f).call(t)},uri(){a.uri=k.uri,i.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),u&&(a.key=u),a.timeline=S,l&&(a.map=l),C=0,this.lastProgramDateTime!==null&&(a.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=a.duration*1e3),a={}},comment(){},custom(){k.segment?(a.custom=a.custom||{},a.custom[k.customType]=k.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[k.customType]=k.data)}})[k.type].call(t)})}requiredCompatibilityversion(e,t){(eS&&(w-=S,w-=S,w-=wr(2))}return Number(w)},fD=function(e,t){var i={},a=i.le,l=a===void 0?!1:a;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=wr(e);for(var u=cD(e),h=new Uint8Array(new ArrayBuffer(u)),f=0;f=t.length&&g.call(t,function(w,S){var A=f[S]?f[S]&e[u+S]:e[u+S];return w===A})},pD=function(e,t,i){t.forEach(function(a){for(var l in e.mediaGroups[a])for(var u in e.mediaGroups[a][l]){var h=e.mediaGroups[a][l][u];i(h,a,l,u)}})},Pc={},Ca={},Jo={},g2;function um(){if(g2)return Jo;g2=1;function n(l,u,h){if(h===void 0&&(h=Array.prototype),l&&typeof h.find=="function")return h.find.call(l,u);for(var f=0;f=0&&D=0){for(var Ge=P.length-1;Re0},lookupPrefix:function(D){for(var P=this;P;){var ne=P._nsMap;if(ne){for(var Re in ne)if(Object.prototype.hasOwnProperty.call(ne,Re)&&ne[Re]===D)return Re}P=P.nodeType==A?P.ownerDocument:P.parentNode}return null},lookupNamespaceURI:function(D){for(var P=this;P;){var ne=P._nsMap;if(ne&&Object.prototype.hasOwnProperty.call(ne,D))return ne[D];P=P.nodeType==A?P.ownerDocument:P.parentNode}return null},isDefaultNamespace:function(D){var P=this.lookupPrefix(D);return P==null}};function pe(D){return D=="<"&&"<"||D==">"&&">"||D=="&"&&"&"||D=='"'&&"""||"&#"+D.charCodeAt()+";"}f(w,L),f(w,L.prototype);function we(D,P){if(P(D))return!0;if(D=D.firstChild)do if(we(D,P))return!0;while(D=D.nextSibling)}function Be(){this.ownerDocument=this}function Ve(D,P,ne){D&&D._inc++;var Re=ne.namespaceURI;Re===t.XMLNS&&(P._nsMap[ne.prefix?ne.localName:""]=ne.value)}function Oe(D,P,ne,Re){D&&D._inc++;var Ge=ne.namespaceURI;Ge===t.XMLNS&&delete P._nsMap[ne.prefix?ne.localName:""]}function Te(D,P,ne){if(D&&D._inc){D._inc++;var Re=P.childNodes;if(ne)Re[Re.length++]=ne;else{for(var Ge=P.firstChild,yt=0;Ge;)Re[yt++]=Ge,Ge=Ge.nextSibling;Re.length=yt,delete Re[Re.length]}}}function _t(D,P){var ne=P.previousSibling,Re=P.nextSibling;return ne?ne.nextSibling=Re:D.firstChild=Re,Re?Re.previousSibling=ne:D.lastChild=ne,P.parentNode=null,P.previousSibling=null,P.nextSibling=null,Te(D.ownerDocument,D),P}function dt(D){return D&&(D.nodeType===L.DOCUMENT_NODE||D.nodeType===L.DOCUMENT_FRAGMENT_NODE||D.nodeType===L.ELEMENT_NODE)}function xe(D){return D&&(Se(D)||Ie(D)||Ne(D)||D.nodeType===L.DOCUMENT_FRAGMENT_NODE||D.nodeType===L.COMMENT_NODE||D.nodeType===L.PROCESSING_INSTRUCTION_NODE)}function Ne(D){return D&&D.nodeType===L.DOCUMENT_TYPE_NODE}function Se(D){return D&&D.nodeType===L.ELEMENT_NODE}function Ie(D){return D&&D.nodeType===L.TEXT_NODE}function $e(D,P){var ne=D.childNodes||[];if(e(ne,Se)||Ne(P))return!1;var Re=e(ne,Ne);return!(P&&Re&&ne.indexOf(Re)>ne.indexOf(P))}function Ct(D,P){var ne=D.childNodes||[];function Re(yt){return Se(yt)&&yt!==P}if(e(ne,Re))return!1;var Ge=e(ne,Ne);return!(P&&Ge&&ne.indexOf(Ge)>ne.indexOf(P))}function st(D,P,ne){if(!dt(D))throw new q(E,"Unexpected parent node type "+D.nodeType);if(ne&&ne.parentNode!==D)throw new q(R,"child not in parent");if(!xe(P)||Ne(P)&&D.nodeType!==L.DOCUMENT_NODE)throw new q(E,"Unexpected node type "+P.nodeType+" for parent node type "+D.nodeType)}function gt(D,P,ne){var Re=D.childNodes||[],Ge=P.childNodes||[];if(P.nodeType===L.DOCUMENT_FRAGMENT_NODE){var yt=Ge.filter(Se);if(yt.length>1||e(Ge,Ie))throw new q(E,"More than one element or text in fragment");if(yt.length===1&&!$e(D,ne))throw new q(E,"Element in fragment can not be inserted before doctype")}if(Se(P)&&!$e(D,ne))throw new q(E,"Only one element can be added and only after doctype");if(Ne(P)){if(e(Re,Ne))throw new q(E,"Only one doctype is allowed");var tn=e(Re,Se);if(ne&&Re.indexOf(tn)1||e(Ge,Ie))throw new q(E,"More than one element or text in fragment");if(yt.length===1&&!Ct(D,ne))throw new q(E,"Element in fragment can not be inserted before doctype")}if(Se(P)&&!Ct(D,ne))throw new q(E,"Only one element can be added and only after doctype");if(Ne(P)){let vn=function(cn){return Ne(cn)&&cn!==ne};var un=vn;if(e(Re,vn))throw new q(E,"Only one doctype is allowed");var tn=e(Re,Se);if(ne&&Re.indexOf(tn)0&&we(ne.documentElement,function(Ge){if(Ge!==ne&&Ge.nodeType===S){var yt=Ge.getAttribute("class");if(yt){var tn=D===yt;if(!tn){var un=u(yt);tn=P.every(h(un))}tn&&Re.push(Ge)}}}),Re})},createElement:function(D){var P=new mt;P.ownerDocument=this,P.nodeName=D,P.tagName=D,P.localName=D,P.childNodes=new Q;var ne=P.attributes=new $;return ne._ownerElement=P,P},createDocumentFragment:function(){var D=new kt;return D.ownerDocument=this,D.childNodes=new Q,D},createTextNode:function(D){var P=new qe;return P.ownerDocument=this,P.appendData(D),P},createComment:function(D){var P=new Le;return P.ownerDocument=this,P.appendData(D),P},createCDATASection:function(D){var P=new Ce;return P.ownerDocument=this,P.appendData(D),P},createProcessingInstruction:function(D,P){var ne=new mn;return ne.ownerDocument=this,ne.tagName=ne.nodeName=ne.target=D,ne.nodeValue=ne.data=P,ne},createAttribute:function(D){var P=new Mt;return P.ownerDocument=this,P.name=D,P.nodeName=D,P.localName=D,P.specified=!0,P},createEntityReference:function(D){var P=new Xt;return P.ownerDocument=this,P.nodeName=D,P},createElementNS:function(D,P){var ne=new mt,Re=P.split(":"),Ge=ne.attributes=new $;return ne.childNodes=new Q,ne.ownerDocument=this,ne.nodeName=P,ne.tagName=P,ne.namespaceURI=D,Re.length==2?(ne.prefix=Re[0],ne.localName=Re[1]):ne.localName=P,Ge._ownerElement=ne,ne},createAttributeNS:function(D,P){var ne=new Mt,Re=P.split(":");return ne.ownerDocument=this,ne.nodeName=P,ne.name=P,ne.namespaceURI=D,ne.specified=!0,Re.length==2?(ne.prefix=Re[0],ne.localName=Re[1]):ne.localName=P,ne}},g(Be,L);function mt(){this._nsMap={}}mt.prototype={nodeType:S,hasAttribute:function(D){return this.getAttributeNode(D)!=null},getAttribute:function(D){var P=this.getAttributeNode(D);return P&&P.value||""},getAttributeNode:function(D){return this.attributes.getNamedItem(D)},setAttribute:function(D,P){var ne=this.ownerDocument.createAttribute(D);ne.value=ne.nodeValue=""+P,this.setAttributeNode(ne)},removeAttribute:function(D){var P=this.getAttributeNode(D);P&&this.removeAttributeNode(P)},appendChild:function(D){return D.nodeType===Y?this.insertBefore(D,null):et(this,D)},setAttributeNode:function(D){return this.attributes.setNamedItem(D)},setAttributeNodeNS:function(D){return this.attributes.setNamedItemNS(D)},removeAttributeNode:function(D){return this.attributes.removeNamedItem(D.nodeName)},removeAttributeNS:function(D,P){var ne=this.getAttributeNodeNS(D,P);ne&&this.removeAttributeNode(ne)},hasAttributeNS:function(D,P){return this.getAttributeNodeNS(D,P)!=null},getAttributeNS:function(D,P){var ne=this.getAttributeNodeNS(D,P);return ne&&ne.value||""},setAttributeNS:function(D,P,ne){var Re=this.ownerDocument.createAttributeNS(D,P);Re.value=Re.nodeValue=""+ne,this.setAttributeNode(Re)},getAttributeNodeNS:function(D,P){return this.attributes.getNamedItemNS(D,P)},getElementsByTagName:function(D){return new ue(this,function(P){var ne=[];return we(P,function(Re){Re!==P&&Re.nodeType==S&&(D==="*"||Re.tagName==D)&&ne.push(Re)}),ne})},getElementsByTagNameNS:function(D,P){return new ue(this,function(ne){var Re=[];return we(ne,function(Ge){Ge!==ne&&Ge.nodeType===S&&(D==="*"||Ge.namespaceURI===D)&&(P==="*"||Ge.localName==P)&&Re.push(Ge)}),Re})}},Be.prototype.getElementsByTagName=mt.prototype.getElementsByTagName,Be.prototype.getElementsByTagNameNS=mt.prototype.getElementsByTagNameNS,g(mt,L);function Mt(){}Mt.prototype.nodeType=A,g(Mt,L);function fe(){}fe.prototype={data:"",substringData:function(D,P){return this.data.substring(D,D+P)},appendData:function(D){D=this.data+D,this.nodeValue=this.data=D,this.length=D.length},insertData:function(D,P){this.replaceData(D,0,P)},appendChild:function(D){throw new Error(re[E])},deleteData:function(D,P){this.replaceData(D,P,"")},replaceData:function(D,P,ne){var Re=this.data.substring(0,D),Ge=this.data.substring(D+P);ne=Re+ne+Ge,this.nodeValue=this.data=ne,this.length=ne.length}},g(fe,L);function qe(){}qe.prototype={nodeName:"#text",nodeType:C,splitText:function(D){var P=this.data,ne=P.substring(D);P=P.substring(0,D),this.data=this.nodeValue=P,this.length=P.length;var Re=this.ownerDocument.createTextNode(ne);return this.parentNode&&this.parentNode.insertBefore(Re,this.nextSibling),Re}},g(qe,fe);function Le(){}Le.prototype={nodeName:"#comment",nodeType:W},g(Le,fe);function Ce(){}Ce.prototype={nodeName:"#cdata-section",nodeType:j},g(Ce,fe);function Pe(){}Pe.prototype.nodeType=ie,g(Pe,L);function Qe(){}Qe.prototype.nodeType=G,g(Qe,L);function At(){}At.prototype.nodeType=B,g(At,L);function Xt(){}Xt.prototype.nodeType=k,g(Xt,L);function kt(){}kt.prototype.nodeName="#document-fragment",kt.prototype.nodeType=Y,g(kt,L);function mn(){}mn.prototype.nodeType=V,g(mn,L);function It(){}It.prototype.serializeToString=function(D,P,ne){return $t.call(D,P,ne)},L.prototype.toString=$t;function $t(D,P){var ne=[],Re=this.nodeType==9&&this.documentElement||this,Ge=Re.prefix,yt=Re.namespaceURI;if(yt&&Ge==null){var Ge=Re.lookupPrefix(yt);if(Ge==null)var tn=[{namespace:yt,prefix:null}]}return Sn(this,ne,D,P,tn),ne.join("")}function Ot(D,P,ne){var Re=D.prefix||"",Ge=D.namespaceURI;if(!Ge||Re==="xml"&&Ge===t.XML||Ge===t.XMLNS)return!1;for(var yt=ne.length;yt--;){var tn=ne[yt];if(tn.prefix===Re)return tn.namespace!==Ge}return!0}function en(D,P,ne){D.push(" ",P,'="',ne.replace(/[<>&"\t\n\r]/g,pe),'"')}function Sn(D,P,ne,Re,Ge){if(Ge||(Ge=[]),Re)if(D=Re(D),D){if(typeof D=="string"){P.push(D);return}}else return;switch(D.nodeType){case S:var yt=D.attributes,tn=yt.length,zt=D.firstChild,un=D.tagName;ne=t.isHTML(D.namespaceURI)||ne;var vn=un;if(!ne&&!D.prefix&&D.namespaceURI){for(var cn,Cn=0;Cn=0;xn--){var on=Ge[xn];if(on.prefix===""&&on.namespace===D.namespaceURI){cn=on.namespace;break}}if(cn!==D.namespaceURI)for(var xn=Ge.length-1;xn>=0;xn--){var on=Ge[xn];if(on.namespace===D.namespaceURI){on.prefix&&(vn=on.prefix+":"+un);break}}}P.push("<",vn);for(var Rn=0;Rn"),ne&&/^script$/i.test(un))for(;zt;)zt.data?P.push(zt.data):Sn(zt,P,ne,Re,Ge.slice()),zt=zt.nextSibling;else for(;zt;)Sn(zt,P,ne,Re,Ge.slice()),zt=zt.nextSibling;P.push("")}else P.push("/>");return;case H:case Y:for(var zt=D.firstChild;zt;)Sn(zt,P,ne,Re,Ge.slice()),zt=zt.nextSibling;return;case A:return en(P,D.name,D.value);case C:return P.push(D.data.replace(/[<&>]/g,pe));case j:return P.push("");case W:return P.push("");case ie:var Pt=D.publicId,Nn=D.systemId;if(P.push("");else if(Nn&&Nn!=".")P.push(" SYSTEM ",Nn,">");else{var Ft=D.internalSubset;Ft&&P.push(" [",Ft,"]"),P.push(">")}return;case V:return P.push("");case k:return P.push("&",D.nodeName,";");default:P.push("??",D.nodeName)}}function Pn(D,P,ne){var Re;switch(P.nodeType){case S:Re=P.cloneNode(!1),Re.ownerDocument=D;case Y:break;case A:ne=!0;break}if(Re||(Re=P.cloneNode(!1)),Re.ownerDocument=D,Re.parentNode=null,ne)for(var Ge=P.firstChild;Ge;)Re.appendChild(Pn(D,Ge,ne)),Ge=Ge.nextSibling;return Re}function St(D,P,ne){var Re=new P.constructor;for(var Ge in P)if(Object.prototype.hasOwnProperty.call(P,Ge)){var yt=P[Ge];typeof yt!="object"&&yt!=Re[Ge]&&(Re[Ge]=yt)}switch(P.childNodes&&(Re.childNodes=new Q),Re.ownerDocument=D,Re.nodeType){case S:var tn=P.attributes,un=Re.attributes=new $,vn=tn.length;un._ownerElement=Re;for(var cn=0;cn",lt:"<",quot:'"'}),n.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),n.entityMap=n.HTML_ENTITIES})(J0)),J0}var Xh={},v2;function yD(){if(v2)return Xh;v2=1;var n=um().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),a=0,l=1,u=2,h=3,f=4,g=5,w=6,S=7;function A(E,R){this.message=E,this.locator=R,Error.captureStackTrace&&Error.captureStackTrace(this,A)}A.prototype=new Error,A.prototype.name=A.name;function C(){}C.prototype={parse:function(E,R,ee){var q=this.domBuilder;q.startDocument(),ie(R,R={}),j(E,R,ee,q,this.errorHandler),q.endDocument()}};function j(E,R,ee,q,Q){function ue(et){if(et>65535){et-=65536;var mt=55296+(et>>10),Mt=56320+(et&1023);return String.fromCharCode(mt,Mt)}else return String.fromCharCode(et)}function se(et){var mt=et.slice(1,-1);return Object.hasOwnProperty.call(ee,mt)?ee[mt]:mt.charAt(0)==="#"?ue(parseInt(mt.substr(1).replace("x","0x"))):(Q.error("entity not found:"+et),et)}function $(et){if(et>Be){var mt=E.substring(Be,et).replace(/&#?\w+;/g,se);L&&F(Be),q.characters(mt,0,et-Be),Be=et}}function F(et,mt){for(;et>=le&&(mt=de.exec(E));)X=mt.index,le=X+mt[0].length,L.lineNumber++;L.columnNumber=et-X+1}for(var X=0,le=0,de=/.*(?:\r\n?|\n)|.*$/g,L=q.locator,pe=[{currentNSMap:R}],we={},Be=0;;){try{var Ve=E.indexOf("<",Be);if(Ve<0){if(!E.substr(Be).match(/^\s*$/)){var Oe=q.doc,Te=Oe.createTextNode(E.substr(Be));Oe.appendChild(Te),q.currentElement=Te}return}switch(Ve>Be&&$(Ve),E.charAt(Ve+1)){case"/":var st=E.indexOf(">",Ve+3),_t=E.substring(Ve+2,st).replace(/[ \t\n\r]+$/g,""),dt=pe.pop();st<0?(_t=E.substring(Ve+2).replace(/[\s<].*/,""),Q.error("end tag name: "+_t+" is not complete:"+dt.tagName),st=Ve+1+_t.length):_t.match(/\sBe?Be=st:$(Math.max(Ve,Be)+1)}}function k(E,R){return R.lineNumber=E.lineNumber,R.columnNumber=E.columnNumber,R}function B(E,R,ee,q,Q,ue){function se(L,pe,we){ee.attributeNames.hasOwnProperty(L)&&ue.fatalError("Attribute "+L+" redefined"),ee.addValue(L,pe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,Q),we)}for(var $,F,X=++R,le=a;;){var de=E.charAt(X);switch(de){case"=":if(le===l)$=E.slice(R,X),le=h;else if(le===u)le=h;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(le===h||le===l)if(le===l&&(ue.warning('attribute value must after "="'),$=E.slice(R,X)),R=X+1,X=E.indexOf(de,R),X>0)F=E.slice(R,X),se($,F,R-1),le=g;else throw new Error("attribute value no end '"+de+"' match");else if(le==f)F=E.slice(R,X),se($,F,R),ue.warning('attribute "'+$+'" missed start quot('+de+")!!"),R=X+1,le=g;else throw new Error('attribute value must after "="');break;case"/":switch(le){case a:ee.setTagName(E.slice(R,X));case g:case w:case S:le=S,ee.closed=!0;case f:case l:break;case u:ee.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ue.error("unexpected end of input"),le==a&&ee.setTagName(E.slice(R,X)),X;case">":switch(le){case a:ee.setTagName(E.slice(R,X));case g:case w:case S:break;case f:case l:F=E.slice(R,X),F.slice(-1)==="/"&&(ee.closed=!0,F=F.slice(0,-1));case u:le===u&&(F=$),le==f?(ue.warning('attribute "'+F+'" missed quot(")!'),se($,F,R)):((!n.isHTML(q[""])||!F.match(/^(?:disabled|checked|selected)$/i))&&ue.warning('attribute "'+F+'" missed value!! "'+F+'" instead!!'),se(F,F,R));break;case h:throw new Error("attribute value missed!!")}return X;case"€":de=" ";default:if(de<=" ")switch(le){case a:ee.setTagName(E.slice(R,X)),le=w;break;case l:$=E.slice(R,X),le=u;break;case f:var F=E.slice(R,X);ue.warning('attribute "'+F+'" missed quot(")!!'),se($,F,R);case g:le=w;break}else switch(le){case u:ee.tagName,(!n.isHTML(q[""])||!$.match(/^(?:disabled|checked|selected)$/i))&&ue.warning('attribute "'+$+'" missed value!! "'+$+'" instead2!!'),se($,$,R),R=X,le=l;break;case g:ue.warning('attribute space is required"'+$+'"!!');case w:le=l,R=X;break;case h:le=f,R=X;break;case S:throw new Error("elements closed character '/' and '>' must be connected to")}}X++}}function V(E,R,ee){for(var q=E.tagName,Q=null,de=E.length;de--;){var ue=E[de],se=ue.qName,$=ue.value,L=se.indexOf(":");if(L>0)var F=ue.prefix=se.slice(0,L),X=se.slice(L+1),le=F==="xmlns"&&X;else X=se,F=null,le=se==="xmlns"&&"";ue.localName=X,le!==!1&&(Q==null&&(Q={},ie(ee,ee={})),ee[le]=Q[le]=$,ue.uri=n.XMLNS,R.startPrefixMapping(le,$))}for(var de=E.length;de--;){ue=E[de];var F=ue.prefix;F&&(F==="xml"&&(ue.uri=n.XML),F!=="xmlns"&&(ue.uri=ee[F||""]))}var L=q.indexOf(":");L>0?(F=E.prefix=q.slice(0,L),X=E.localName=q.slice(L+1)):(F=null,X=E.localName=q);var pe=E.uri=ee[F||""];if(R.startElement(pe,X,q,E),E.closed){if(R.endElement(pe,X,q),Q)for(F in Q)Object.prototype.hasOwnProperty.call(Q,F)&&R.endPrefixMapping(F)}else return E.currentNSMap=ee,E.localNSMap=Q,!0}function W(E,R,ee,q,Q){if(/^(?:script|textarea)$/i.test(ee)){var ue=E.indexOf("",R),se=E.substring(R+1,ue);if(/[&<]/.test(se))return/^script$/i.test(ee)?(Q.characters(se,0,se.length),ue):(se=se.replace(/&#?\w+;/g,q),Q.characters(se,0,se.length),ue)}return R+1}function H(E,R,ee,q){var Q=q[ee];return Q==null&&(Q=E.lastIndexOf(""),Q",R+4);return ue>R?(ee.comment(E,R+4,ue-R-4),ue+3):(q.error("Unclosed comment"),-1)}else return-1;default:if(E.substr(R+3,6)=="CDATA["){var ue=E.indexOf("]]>",R+9);return ee.startCDATA(),ee.characters(E,R+9,ue-R-9),ee.endCDATA(),ue+3}var se=re(E,R),$=se.length;if($>1&&/!doctype/i.test(se[0][0])){var F=se[1][0],X=!1,le=!1;$>3&&(/^public$/i.test(se[2][0])?(X=se[3][0],le=$>4&&se[4][0]):/^system$/i.test(se[2][0])&&(le=se[3][0]));var de=se[$-1];return ee.startDTD(F,X,le),ee.endDTD(),de.index+de[0].length}}return-1}function G(E,R,ee){var q=E.indexOf("?>",R);if(q){var Q=E.substring(R,q).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Q?(Q[0].length,ee.processingInstruction(Q[1],Q[2]),q+2):-1}return-1}function O(){this.attributeNames={}}O.prototype={setTagName:function(E){if(!i.test(E))throw new Error("invalid tagName:"+E);this.tagName=E},addValue:function(E,R,ee){if(!i.test(E))throw new Error("invalid attribute:"+E);this.attributeNames[E]=this.length,this[this.length++]={qName:E,value:R,offset:ee}},length:0,getLocalName:function(E){return this[E].localName},getLocator:function(E){return this[E].locator},getQName:function(E){return this[E].qName},getURI:function(E){return this[E].uri},getValue:function(E){return this[E].value}};function re(E,R){var ee,q=[],Q=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Q.lastIndex=R,Q.exec(E);ee=Q.exec(E);)if(q.push(ee),ee[1])return q}return Xh.XMLReader=C,Xh.ParseError=A,Xh}var x2;function bD(){if(x2)return Fc;x2=1;var n=um(),e=Kw(),t=gD(),i=yD(),a=e.DOMImplementation,l=n.NAMESPACE,u=i.ParseError,h=i.XMLReader;function f(B){return B.replace(/\r[\n\u0085]/g,` -`).replace(/[\r\u0085\u2028]/g,` -`)}function g(B){this.options=B||{locator:{}}}g.prototype.parseFromString=function(B,V){var W=this.options,H=new h,ie=W.domBuilder||new S,Y=W.errorHandler,G=W.locator,O=W.xmlns||{},re=/\/x?html?$/.test(V),E=re?t.HTML_ENTITIES:t.XML_ENTITIES;G&&ie.setDocumentLocator(G),H.errorHandler=w(Y,ie,G),H.domBuilder=W.domBuilder||ie,re&&(O[""]=l.HTML),O.xml=O.xml||l.XML;var R=W.normalizeLineEndings||f;return B&&typeof B=="string"?H.parse(R(B),O,E):H.errorHandler.error("invalid doc source"),ie.doc};function w(B,V,W){if(!B){if(V instanceof S)return V;B=V}var H={},ie=B instanceof Function;W=W||{};function Y(G){var O=B[G];!O&&ie&&(O=B.length==2?function(re){B(G,re)}:B),H[G]=O&&function(re){O("[xmldom "+G+"] "+re+C(W))}||function(){}}return Y("warning"),Y("error"),Y("fatalError"),H}function S(){this.cdata=!1}function A(B,V){V.lineNumber=B.lineNumber,V.columnNumber=B.columnNumber}S.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(B,V,W,H){var ie=this.doc,Y=ie.createElementNS(B,W||V),G=H.length;k(this,Y),this.currentElement=Y,this.locator&&A(this.locator,Y);for(var O=0;O=V+W||V?new java.lang.String(B,V,W)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){S.prototype[B]=function(){return null}});function k(B,V){B.currentElement?B.currentElement.appendChild(V):B.doc.appendChild(V)}return Fc.__DOMHandler=S,Fc.normalizeLineEndings=f,Fc.DOMParser=g,Fc}var _2;function vD(){if(_2)return Pc;_2=1;var n=Kw();return Pc.DOMImplementation=n.DOMImplementation,Pc.XMLSerializer=n.XMLSerializer,Pc.DOMParser=bD().DOMParser,Pc}var xD=vD();const w2=n=>!!n&&typeof n=="object",gr=(...n)=>n.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):w2(e[i])&&w2(t[i])?e[i]=gr(e[i],t[i]):e[i]=t[i]}),e),{}),Ww=n=>Object.keys(n).map(e=>n[e]),_D=(n,e)=>{const t=[];for(let i=n;in.reduce((e,t)=>e.concat(t),[]),Xw=n=>{if(!n.length)return[];const e=[];for(let t=0;tn.reduce((t,i,a)=>(i[e]&&t.push(a),t),[]),SD=(n,e)=>Ww(n.reduce((t,i)=>(i.forEach(a=>{t[e(a)]=a}),t),{}));var ku={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const fd=({baseUrl:n="",source:e="",range:t="",indexRange:i=""})=>{const a={uri:e,resolvedUri:lm(n||"",e)};if(t||i){const u=(t||i).split("-");let h=he.BigInt?he.BigInt(u[0]):parseInt(u[0],10),f=he.BigInt?he.BigInt(u[1]):parseInt(u[1],10);h{let e;return typeof n.offset=="bigint"||typeof n.length=="bigint"?e=he.BigInt(n.offset)+he.BigInt(n.length)-he.BigInt(1):e=n.offset+n.length-1,`${n.offset}-${e}`},S2=n=>(n&&typeof n!="number"&&(n=parseInt(n,10)),isNaN(n)?null:n),kD={static(n){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:a}=n,l=S2(n.endNumber),u=e/t;return typeof l=="number"?{start:0,end:l}:typeof a=="number"?{start:0,end:a/u}:{start:0,end:i/u}},dynamic(n){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:a=1,duration:l,periodStart:u=0,minimumUpdatePeriod:h=0,timeShiftBufferDepth:f=1/0}=n,g=S2(n.endNumber),w=(e+t)/1e3,S=i+u,C=w+h-S,j=Math.ceil(C*a/l),k=Math.floor((w-S-f)*a/l),B=Math.floor((w-S)*a/l);return{start:Math.max(0,k),end:typeof g=="number"?g:Math.min(j,B)}}},ED=n=>e=>{const{duration:t,timescale:i=1,periodStart:a,startNumber:l=1}=n;return{number:l+e,duration:t/i,timeline:a,time:e*t}},Sy=n=>{const{type:e,duration:t,timescale:i=1,periodDuration:a,sourceDuration:l}=n,{start:u,end:h}=kD[e](n),f=_D(u,h).map(ED(n));if(e==="static"){const g=f.length-1,w=typeof a=="number"?a:l;f[g].duration=w-t/i*g}return f},Yw=n=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:a="",periodStart:l,presentationTime:u,number:h=0,duration:f}=n;if(!e)throw new Error(ku.NO_BASE_URL);const g=fd({baseUrl:e,source:t.sourceURL,range:t.range}),w=fd({baseUrl:e,source:e,indexRange:a});if(w.map=g,f){const S=Sy(n);S.length&&(w.duration=S[0].duration,w.timeline=S[0].timeline)}else i&&(w.duration=i,w.timeline=l);return w.presentationTime=u||l,w.number=h,[w]},Ty=(n,e,t)=>{const i=n.sidx.map?n.sidx.map:null,a=n.sidx.duration,l=n.timeline||0,u=n.sidx.byterange,h=u.offset+u.length,f=e.timescale,g=e.references.filter(B=>B.referenceType!==1),w=[],S=n.endList?"static":"dynamic",A=n.sidx.timeline;let C=A,j=n.mediaSequence||0,k;typeof e.firstOffset=="bigint"?k=he.BigInt(h)+e.firstOffset:k=h+e.firstOffset;for(let B=0;BSD(n,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),ND=(n,e)=>{for(let t=0;t{let e=[];return pD(n,CD,(t,i,a,l)=>{e=e.concat(t.playlists||[])}),e},k2=({playlist:n,mediaSequence:e})=>{n.mediaSequence=e,n.segments.forEach((t,i)=>{t.number=n.mediaSequence+i})},DD=({oldPlaylists:n,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:f}){return f===i.timeline});const a=ND(n,i.attributes.NAME);if(!a||i.sidx)return;const l=i.segments[0],u=a.segments.findIndex(function(f){return Math.abs(f.presentationTime-l.presentationTime)a.timeline||a.segments.length&&i.timeline>a.segments[a.segments.length-1].timeline)&&i.discontinuitySequence--;return}a.segments[u].discontinuity&&!l.discontinuity&&(l.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),k2({playlist:i,mediaSequence:a.segments[u].number})})},MD=({oldManifest:n,newManifest:e})=>{const t=n.playlists.concat(T2(n)),i=e.playlists.concat(T2(e));return e.timelineStarts=Qw([n.timelineStarts,e.timelineStarts]),DD({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},cm=n=>n&&n.uri+"-"+TD(n.byterange),eg=n=>{const e=n.reduce(function(i,a){return i[a.attributes.baseUrl]||(i[a.attributes.baseUrl]=[]),i[a.attributes.baseUrl].push(a),i},{});let t=[];return Object.values(e).forEach(i=>{const a=Ww(i.reduce((l,u)=>{const h=u.attributes.id+(u.attributes.lang||"");return l[h]?(u.segments&&(u.segments[0]&&(u.segments[0].discontinuity=!0),l[h].segments.push(...u.segments)),u.attributes.contentProtection&&(l[h].attributes.contentProtection=u.attributes.contentProtection)):(l[h]=u,l[h].attributes.timelineStarts=[]),l[h].attributes.timelineStarts.push({start:u.attributes.periodStart,timeline:u.attributes.periodStart}),l},{}));t=t.concat(a)}),t.map(i=>(i.discontinuityStarts=wD(i.segments||[],"discontinuity"),i))},ky=(n,e)=>{const t=cm(n.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ty(n,i,n.sidx.resolvedUri),n},RD=(n,e={})=>{if(!Object.keys(e).length)return n;for(const t in n)n[t]=ky(n[t],e);return n},jD=({attributes:n,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:a,discontinuityStarts:l},u)=>{const h={attributes:{NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs,"PROGRAM-ID":1},uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,discontinuitySequence:a,discontinuityStarts:l,timelineStarts:n.timelineStarts,mediaSequence:i,segments:e};return n.contentProtection&&(h.contentProtection=n.contentProtection),n.serviceLocation&&(h.attributes.serviceLocation=n.serviceLocation),t&&(h.sidx=t),u&&(h.attributes.AUDIO="audio",h.attributes.SUBTITLES="subs"),h},OD=({attributes:n,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:a})=>{typeof e>"u"&&(e=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);const l={NAME:n.id,BANDWIDTH:n.bandwidth,"PROGRAM-ID":1};n.codecs&&(l.CODECS=n.codecs);const u={attributes:l,uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:i,discontinuitySequence:a,mediaSequence:t,segments:e};return n.serviceLocation&&(u.attributes.serviceLocation=n.serviceLocation),u},LD=(n,e={},t=!1)=>{let i;const a=n.reduce((l,u)=>{const h=u.attributes.role&&u.attributes.role.value||"",f=u.attributes.lang||"";let g=u.attributes.label||"main";if(f&&!u.attributes.label){const S=h?` (${h})`:"";g=`${u.attributes.lang}${S}`}l[g]||(l[g]={language:f,autoselect:!0,default:h==="main",playlists:[],uri:""});const w=ky(jD(u,t),e);return l[g].playlists.push(w),typeof i>"u"&&h==="main"&&(i=u,i.default=!0),l},{});if(!i){const l=Object.keys(a)[0];a[l].default=!0}return a},ID=(n,e={})=>n.reduce((t,i)=>{const a=i.attributes.label||i.attributes.lang||"text",l=i.attributes.lang||"und";return t[a]||(t[a]={language:l,default:!1,autoselect:!1,playlists:[],uri:""}),t[a].playlists.push(ky(OD(i),e)),t},{}),BD=n=>n.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:a,language:l}=i;e[l]={autoselect:!1,default:!1,instreamId:a,language:l},i.hasOwnProperty("aspectRatio")&&(e[l].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[l].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[l]["3D"]=i["3D"])}),e),{}),PD=({attributes:n,segments:e,sidx:t,discontinuityStarts:i})=>{const a={attributes:{NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth,"PROGRAM-ID":1},uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,discontinuityStarts:i,timelineStarts:n.timelineStarts,segments:e};return n.frameRate&&(a.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(a.contentProtection=n.contentProtection),n.serviceLocation&&(a.attributes.serviceLocation=n.serviceLocation),t&&(a.sidx=t),a},FD=({attributes:n})=>n.mimeType==="video/mp4"||n.mimeType==="video/webm"||n.contentType==="video",UD=({attributes:n})=>n.mimeType==="audio/mp4"||n.mimeType==="audio/webm"||n.contentType==="audio",zD=({attributes:n})=>n.mimeType==="text/vtt"||n.contentType==="text",HD=(n,e)=>{n.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,a)=>{i.number=a})})},E2=n=>n?Object.keys(n).reduce((e,t)=>{const i=n[t];return e.concat(i.playlists)},[]):[],$D=({dashPlaylists:n,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:a,eventStream:l})=>{if(!n.length)return{};const{sourceDuration:u,type:h,suggestedPresentationDelay:f,minimumUpdatePeriod:g}=n[0].attributes,w=eg(n.filter(FD)).map(PD),S=eg(n.filter(UD)),A=eg(n.filter(zD)),C=n.map(ie=>ie.attributes.captionServices).filter(Boolean),j={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:u,playlists:RD(w,i)};g>=0&&(j.minimumUpdatePeriod=g*1e3),e&&(j.locations=e),t&&(j.contentSteering=t),h==="dynamic"&&(j.suggestedPresentationDelay=f),l&&l.length>0&&(j.eventStream=l);const k=j.playlists.length===0,B=S.length?LD(S,i,k):null,V=A.length?ID(A,i):null,W=w.concat(E2(B),E2(V)),H=W.map(({timelineStarts:ie})=>ie);return j.timelineStarts=Qw(H),HD(W,j.timelineStarts),B&&(j.mediaGroups.AUDIO.audio=B),V&&(j.mediaGroups.SUBTITLES.subs=V),C.length&&(j.mediaGroups["CLOSED-CAPTIONS"].cc=BD(C)),a?MD({oldManifest:a,newManifest:j}):j},qD=(n,e,t)=>{const{NOW:i,clientOffset:a,availabilityStartTime:l,timescale:u=1,periodStart:h=0,minimumUpdatePeriod:f=0}=n,g=(i+a)/1e3,w=l+h,A=g+f-w;return Math.ceil((A*u-e)/t)},Zw=(n,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:a="",sourceDuration:l,timescale:u=1,startNumber:h=1,periodStart:f}=n,g=[];let w=-1;for(let S=0;Sw&&(w=k);let B;if(j<0){const H=S+1;H===e.length?t==="dynamic"&&i>0&&a.indexOf("$Number$")>0?B=qD(n,w,C):B=(l*u-w)/C:B=(e[H].t-w)/C}else B=j+1;const V=h+g.length+B;let W=h+g.length;for(;W(e,t,i,a)=>{if(e==="$$")return"$";if(typeof n[t]>"u")return e;const l=""+n[t];return t==="RepresentationID"||(i?a=parseInt(a,10):a=1,l.length>=a)?l:`${new Array(a-l.length+1).join("0")}${l}`},C2=(n,e)=>n.replace(VD,GD(e)),KD=(n,e)=>!n.duration&&!e?[{number:n.startNumber||1,duration:n.sourceDuration,time:0,timeline:n.periodStart}]:n.duration?Sy(n):Zw(n,e),WD=(n,e)=>{const t={RepresentationID:n.id,Bandwidth:n.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=n,a=fd({baseUrl:n.baseUrl,source:C2(i.sourceURL,t),range:i.range});return KD(n,e).map(u=>{t.Number=u.number,t.Time=u.time;const h=C2(n.media||"",t),f=n.timescale||1,g=n.presentationTimeOffset||0,w=n.periodStart+(u.time-g)/f;return{uri:h,timeline:u.timeline,duration:u.duration,resolvedUri:lm(n.baseUrl||"",h),map:a,number:u.number,presentationTime:w}})},XD=(n,e)=>{const{baseUrl:t,initialization:i={}}=n,a=fd({baseUrl:t,source:i.sourceURL,range:i.range}),l=fd({baseUrl:t,source:e.media,range:e.mediaRange});return l.map=a,l},YD=(n,e)=>{const{duration:t,segmentUrls:i=[],periodStart:a}=n;if(!t&&!e||t&&e)throw new Error(ku.SEGMENT_TIME_UNSPECIFIED);const l=i.map(f=>XD(n,f));let u;return t&&(u=Sy(n)),e&&(u=Zw(n,e)),u.map((f,g)=>{if(l[g]){const w=l[g],S=n.timescale||1,A=n.presentationTimeOffset||0;return w.timeline=f.timeline,w.duration=f.duration,w.number=f.number,w.presentationTime=a+(f.time-A)/S,w}}).filter(f=>f)},QD=({attributes:n,segmentInfo:e})=>{let t,i;e.template?(i=WD,t=gr(n,e.template)):e.base?(i=Yw,t=gr(n,e.base)):e.list&&(i=YD,t=gr(n,e.list));const a={attributes:n};if(!i)return a;const l=i(t,e.segmentTimeline);if(t.duration){const{duration:u,timescale:h=1}=t;t.duration=u/h}else l.length?t.duration=l.reduce((u,h)=>Math.max(u,Math.ceil(h.duration)),0):t.duration=0;return a.attributes=t,a.segments=l,e.base&&t.indexRange&&(a.sidx=l[0],a.segments=[]),a},ZD=n=>n.map(QD),Li=(n,e)=>Xw(n.childNodes).filter(({tagName:t})=>t===e),wd=n=>n.textContent.trim(),JD=n=>parseFloat(n.split("/").reduce((e,t)=>e/t)),Yl=n=>{const h=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(n);if(!h)return 0;const[f,g,w,S,A,C]=h.slice(1);return parseFloat(f||0)*31536e3+parseFloat(g||0)*2592e3+parseFloat(w||0)*86400+parseFloat(S||0)*3600+parseFloat(A||0)*60+parseFloat(C||0)},e4=n=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(n)&&(n+="Z"),Date.parse(n)),A2={mediaPresentationDuration(n){return Yl(n)},availabilityStartTime(n){return e4(n)/1e3},minimumUpdatePeriod(n){return Yl(n)},suggestedPresentationDelay(n){return Yl(n)},type(n){return n},timeShiftBufferDepth(n){return Yl(n)},start(n){return Yl(n)},width(n){return parseInt(n,10)},height(n){return parseInt(n,10)},bandwidth(n){return parseInt(n,10)},frameRate(n){return JD(n)},startNumber(n){return parseInt(n,10)},timescale(n){return parseInt(n,10)},presentationTimeOffset(n){return parseInt(n,10)},duration(n){const e=parseInt(n,10);return isNaN(e)?Yl(n):e},d(n){return parseInt(n,10)},t(n){return parseInt(n,10)},r(n){return parseInt(n,10)},presentationTime(n){return parseInt(n,10)},DEFAULT(n){return n}},ur=n=>n&&n.attributes?Xw(n.attributes).reduce((e,t)=>{const i=A2[t.name]||A2.DEFAULT;return e[t.name]=i(t.value),e},{}):{},t4={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},dm=(n,e)=>e.length?Tu(n.map(function(t){return e.map(function(i){const a=wd(i),l=lm(t.baseUrl,a),u=gr(ur(i),{baseUrl:l});return l!==a&&!u.serviceLocation&&t.serviceLocation&&(u.serviceLocation=t.serviceLocation),u})})):n,Ey=n=>{const e=Li(n,"SegmentTemplate")[0],t=Li(n,"SegmentList")[0],i=t&&Li(t,"SegmentURL").map(S=>gr({tag:"SegmentURL"},ur(S))),a=Li(n,"SegmentBase")[0],l=t||e,u=l&&Li(l,"SegmentTimeline")[0],h=t||a||e,f=h&&Li(h,"Initialization")[0],g=e&&ur(e);g&&f?g.initialization=f&&ur(f):g&&g.initialization&&(g.initialization={sourceURL:g.initialization});const w={template:g,segmentTimeline:u&&Li(u,"S").map(S=>ur(S)),list:t&&gr(ur(t),{segmentUrls:i,initialization:ur(f)}),base:a&&gr(ur(a),{initialization:ur(f)})};return Object.keys(w).forEach(S=>{w[S]||delete w[S]}),w},n4=(n,e,t)=>i=>{const a=Li(i,"BaseURL"),l=dm(e,a),u=gr(n,ur(i)),h=Ey(i);return l.map(f=>({segmentInfo:gr(t,h),attributes:gr(u,f)}))},i4=n=>n.reduce((e,t)=>{const i=ur(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const a=t4[i.schemeIdUri];if(a){e[a]={attributes:i};const l=Li(t,"cenc:pssh")[0];if(l){const u=wd(l);e[a].pssh=u&&zw(u)}}return e},{}),r4=n=>{if(n.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof n.value!="string"?[]:n.value.split(";")).map(t=>{let i,a;return a=t,/^CC\d=/.test(t)?[i,a]=t.split("="):/^CC\d$/.test(t)&&(i=t),{channel:i,language:a}});if(n.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof n.value!="string"?[]:n.value.split(";")).map(t=>{const i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[a,l=""]=t.split("=");i.channel=a,i.language=t,l.split(",").forEach(u=>{const[h,f]=u.split(":");h==="lang"?i.language=f:h==="er"?i.easyReader=Number(f):h==="war"?i.aspectRatio=Number(f):h==="3D"&&(i["3D"]=Number(f))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},s4=n=>Tu(Li(n.node,"EventStream").map(e=>{const t=ur(e),i=t.schemeIdUri;return Li(e,"Event").map(a=>{const l=ur(a),u=l.presentationTime||0,h=t.timescale||1,f=l.duration||0,g=u/h+n.attributes.start;return{schemeIdUri:i,value:t.value,id:l.id,start:g,end:g+f/h,messageData:wd(a)||l.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),a4=(n,e,t)=>i=>{const a=ur(i),l=dm(e,Li(i,"BaseURL")),u=Li(i,"Role")[0],h={role:ur(u)};let f=gr(n,a,h);const g=Li(i,"Accessibility")[0],w=r4(ur(g));w&&(f=gr(f,{captionServices:w}));const S=Li(i,"Label")[0];if(S&&S.childNodes.length){const B=S.childNodes[0].nodeValue.trim();f=gr(f,{label:B})}const A=i4(Li(i,"ContentProtection"));Object.keys(A).length&&(f=gr(f,{contentProtection:A}));const C=Ey(i),j=Li(i,"Representation"),k=gr(t,C);return Tu(j.map(n4(f,l,k)))},o4=(n,e)=>(t,i)=>{const a=dm(e,Li(t.node,"BaseURL")),l=gr(n,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(l.periodDuration=t.attributes.duration);const u=Li(t.node,"AdaptationSet"),h=Ey(t.node);return Tu(u.map(a4(l,a,h)))},l4=(n,e)=>{if(n.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!n.length)return null;const t=gr({serverURL:wd(n[0])},ur(n[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},u4=({attributes:n,priorPeriodAttributes:e,mpdType:t})=>typeof n.start=="number"?n.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,c4=(n,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:a=0,eventHandler:l=function(){}}=e,u=Li(n,"Period");if(!u.length)throw new Error(ku.INVALID_NUMBER_OF_PERIOD);const h=Li(n,"Location"),f=ur(n),g=dm([{baseUrl:t}],Li(n,"BaseURL")),w=Li(n,"ContentSteering");f.type=f.type||"static",f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=i,f.clientOffset=a,h.length&&(f.locations=h.map(wd));const S=[];return u.forEach((A,C)=>{const j=ur(A),k=S[C-1];j.start=u4({attributes:j,priorPeriodAttributes:k?k.attributes:null,mpdType:f.type}),S.push({node:A,attributes:j})}),{locations:f.locations,contentSteeringInfo:l4(w,l),representationInfo:Tu(S.map(o4(f,g))),eventStream:Tu(S.map(s4))}},Jw=n=>{if(n==="")throw new Error(ku.DASH_EMPTY_MANIFEST);const e=new xD.DOMParser;let t,i;try{t=e.parseFromString(n,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(ku.DASH_INVALID_XML);return i},d4=n=>{const e=Li(n,"UTCTiming")[0];if(!e)return null;const t=ur(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(ku.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},h4=(n,e={})=>{const t=c4(Jw(n),e),i=ZD(t.representationInfo);return $D({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},f4=n=>d4(Jw(n));var tg,N2;function m4(){if(N2)return tg;N2=1;var n=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),a;return i.getBigUint64?(a=i.getBigUint64(0),a0;l+=12,u--)a.references.push({referenceType:(t[l]&128)>>>7,referencedSize:i.getUint32(l)&2147483647,subsegmentDuration:i.getUint32(l+4),startsWithSap:!!(t[l+8]&128),sapType:(t[l+8]&112)>>>4,sapDeltaTime:i.getUint32(l+8)&268435455});return a};return ng=e,ng}var g4=p4();const y4=Ru(g4);var b4=pn([73,68,51]),v4=function(e,t){t===void 0&&(t=0),e=pn(e);var i=e[t+5],a=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],l=(i&16)>>4;return l?a+20:a+10},Wc=function n(e,t){return t===void 0&&(t=0),e=pn(e),e.length-t<10||!Oi(e,b4,{offset:t})?t:(t+=v4(e,t),n(e,t))},M2=function(e){return typeof e=="string"?Gw(e):e},x4=function(e){return Array.isArray(e)?e.map(function(t){return M2(t)}):[M2(e)]},_4=function n(e,t,i){i===void 0&&(i=!1),t=x4(t),e=pn(e);var a=[];if(!t.length)return a;for(var l=0;l>>0,h=e.subarray(l+4,l+8);if(u===0)break;var f=l+u;if(f>e.length){if(i)break;f=e.length}var g=e.subarray(l+8,f);Oi(h,t[0])&&(t.length===1?a.push(g):a.push.apply(a,n(g,t.slice(1),i))),l=f}return a},Yh={EBML:pn([26,69,223,163]),DocType:pn([66,130]),Segment:pn([24,83,128,103]),SegmentInfo:pn([21,73,169,102]),Tracks:pn([22,84,174,107]),Track:pn([174]),TrackNumber:pn([215]),DefaultDuration:pn([35,227,131]),TrackEntry:pn([174]),TrackType:pn([131]),FlagDefault:pn([136]),CodecID:pn([134]),CodecPrivate:pn([99,162]),VideoTrack:pn([224]),AudioTrack:pn([225]),Cluster:pn([31,67,182,117]),Timestamp:pn([231]),TimestampScale:pn([42,215,177]),BlockGroup:pn([160]),BlockDuration:pn([155]),Block:pn([161]),SimpleBlock:pn([163])},Ug=[128,64,32,16,8,4,2,1],w4=function(e){for(var t=1,i=0;i=t.length)return t.length;var a=Af(t,i,!1);if(Oi(e.bytes,a.bytes))return i;var l=Af(t,i+a.length);return n(e,t,i+l.length+l.value+a.length)},j2=function n(e,t){t=S4(t),e=pn(e);var i=[];if(!t.length)return i;for(var a=0;ae.length?e.length:h+u.value,g=e.subarray(h,f);Oi(t[0],l.bytes)&&(t.length===1?i.push(g):i=i.concat(n(g,t.slice(1))));var w=l.length+u.length+g.length;a+=w}return i},k4=pn([0,0,0,1]),E4=pn([0,0,1]),C4=pn([0,0,3]),A4=function(e){for(var t=[],i=1;i>1&63),i.indexOf(g)!==-1&&(u=l+f),l+=f+(t==="h264"?1:2)}return e.subarray(0,0)},N4=function(e,t,i){return eS(e,"h264",t,i)},D4=function(e,t,i){return eS(e,"h265",t,i)},Rr={webm:pn([119,101,98,109]),matroska:pn([109,97,116,114,111,115,107,97]),flac:pn([102,76,97,67]),ogg:pn([79,103,103,83]),ac3:pn([11,119]),riff:pn([82,73,70,70]),avi:pn([65,86,73]),wav:pn([87,65,86,69]),"3gp":pn([102,116,121,112,51,103]),mp4:pn([102,116,121,112]),fmp4:pn([115,116,121,112]),mov:pn([102,116,121,112,113,116]),moov:pn([109,111,111,118]),moof:pn([109,111,111,102])},Eu={aac:function(e){var t=Wc(e);return Oi(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Wc(e);return Oi(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=j2(e,[Yh.EBML,Yh.DocType])[0];return Oi(t,Rr.webm)},mkv:function(e){var t=j2(e,[Yh.EBML,Yh.DocType])[0];return Oi(t,Rr.matroska)},mp4:function(e){if(Eu["3gp"](e)||Eu.mov(e))return!1;if(Oi(e,Rr.mp4,{offset:4})||Oi(e,Rr.fmp4,{offset:4})||Oi(e,Rr.moof,{offset:4})||Oi(e,Rr.moov,{offset:4}))return!0},mov:function(e){return Oi(e,Rr.mov,{offset:4})},"3gp":function(e){return Oi(e,Rr["3gp"],{offset:4})},ac3:function(e){var t=Wc(e);return Oi(e,Rr.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},ig,O2;function j4(){if(O2)return ig;O2=1;var n=9e4,e,t,i,a,l,u,h;return e=function(f){return f*n},t=function(f,g){return f*g},i=function(f){return f/n},a=function(f,g){return f/g},l=function(f,g){return e(a(f,g))},u=function(f,g){return t(i(f),g)},h=function(f,g,w){return i(w?f:f-g)},ig={ONE_SECOND_IN_TS:n,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:a,audioTsToVideoTs:l,videoTsToAudioTs:u,metadataTsToSeconds:h},ig}var ul=j4();var Hg="8.23.4";const Ma={},No=function(n,e){return Ma[n]=Ma[n]||[],e&&(Ma[n]=Ma[n].concat(e)),Ma[n]},O4=function(n,e){No(n,e)},tS=function(n,e){const t=No(n).indexOf(e);return t<=-1?!1:(Ma[n]=Ma[n].slice(),Ma[n].splice(t,1),!0)},L4=function(n,e){No(n,[].concat(e).map(t=>{const i=(...a)=>(tS(n,i),t(...a));return i}))},Nf={prefixed:!0},ff=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],L2=ff[0];let Xc;for(let n=0;n(i,a,l)=>{const u=e.levels[a],h=new RegExp(`^(${u})$`);let f=n;if(i!=="log"&&l.unshift(i.toUpperCase()+":"),t&&(f=`%c${n}`,l.unshift(t)),l.unshift(f+":"),Gr){Gr.push([].concat(l));const w=Gr.length-1e3;Gr.splice(0,w>0?w:0)}if(!he.console)return;let g=he.console[i];!g&&i==="debug"&&(g=he.console.info||he.console.log),!(!g||!u||!h.test(i))&&g[Array.isArray(l)?"apply":"call"](he.console,l)};function $g(n,e=":",t=""){let i="info",a;function l(...u){a("log",i,u)}return a=I4(n,l,t),l.createLogger=(u,h,f)=>{const g=h!==void 0?h:e,w=f!==void 0?f:t,S=`${n} ${g} ${u}`;return $g(S,g,w)},l.createNewLogger=(u,h,f)=>$g(u,h,f),l.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},l.level=u=>{if(typeof u=="string"){if(!l.levels.hasOwnProperty(u))throw new Error(`"${u}" in not a valid log level`);i=u}return i},l.history=()=>Gr?[].concat(Gr):[],l.history.filter=u=>(Gr||[]).filter(h=>new RegExp(`.*${u}.*`).test(h[0])),l.history.clear=()=>{Gr&&(Gr.length=0)},l.history.disable=()=>{Gr!==null&&(Gr.length=0,Gr=null)},l.history.enable=()=>{Gr===null&&(Gr=[])},l.error=(...u)=>a("error",i,u),l.warn=(...u)=>a("warn",i,u),l.debug=(...u)=>a("debug",i,u),l}const In=$g("VIDEOJS"),nS=In.createLogger,B4=Object.prototype.toString,iS=function(n){return oa(n)?Object.keys(n):[]};function cu(n,e){iS(n).forEach(t=>e(n[t],t))}function rS(n,e,t=0){return iS(n).reduce((i,a)=>e(i,n[a],a),t)}function oa(n){return!!n&&typeof n=="object"}function Cu(n){return oa(n)&&B4.call(n)==="[object Object]"&&n.constructor===Object}function yi(...n){const e={};return n.forEach(t=>{t&&cu(t,(i,a)=>{if(!Cu(i)){e[a]=i;return}Cu(e[a])||(e[a]={}),e[a]=yi(e[a],i)})}),e}function sS(n={}){const e=[];for(const t in n)if(n.hasOwnProperty(t)){const i=n[t];e.push(i)}return e}function hm(n,e,t,i=!0){const a=u=>Object.defineProperty(n,e,{value:u,enumerable:!0,writable:!0}),l={configurable:!0,enumerable:!0,get(){const u=t();return a(u),u}};return i&&(l.set=a),Object.defineProperty(n,e,l)}var P4=Object.freeze({__proto__:null,each:cu,reduce:rS,isObject:oa,isPlain:Cu,merge:yi,values:sS,defineLazyProperty:hm});let Ay=!1,aS=null,Fs=!1,oS,lS=!1,du=!1,hu=!1,la=!1,Ny=null,fm=null;const F4=!!(he.cast&&he.cast.framework&&he.cast.framework.CastReceiverContext);let uS=null,Df=!1,mm=!1,Mf=!1,pm=!1,Rf=!1,jf=!1,Of=!1;const md=!!(ju()&&("ontouchstart"in he||he.navigator.maxTouchPoints||he.DocumentTouch&&he.document instanceof he.DocumentTouch)),bo=he.navigator&&he.navigator.userAgentData;bo&&bo.platform&&bo.brands&&(Fs=bo.platform==="Android",du=!!bo.brands.find(n=>n.brand==="Microsoft Edge"),hu=!!bo.brands.find(n=>n.brand==="Chromium"),la=!du&&hu,Ny=fm=(bo.brands.find(n=>n.brand==="Chromium")||{}).version||null,mm=bo.platform==="Windows");if(!hu){const n=he.navigator&&he.navigator.userAgent||"";Ay=/iPod/i.test(n),aS=(function(){const e=n.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),Fs=/Android/i.test(n),oS=(function(){const e=n.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null})(),lS=/Firefox/i.test(n),du=/Edg/i.test(n),hu=/Chrome/i.test(n)||/CriOS/i.test(n),la=!du&&hu,Ny=fm=(function(){const e=n.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),uS=(function(){const e=/MSIE\s(\d+)\.\d/.exec(n);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(n)&&/rv:11.0/.test(n)&&(t=11),t})(),Rf=/Tizen/i.test(n),jf=/Web0S/i.test(n),Of=Rf||jf,Df=/Safari/i.test(n)&&!la&&!Fs&&!du&&!Of,mm=/Windows/i.test(n),Mf=/iPad/i.test(n)||Df&&md&&!/iPhone/i.test(n),pm=/iPhone/i.test(n)&&!Mf}const Er=pm||Mf||Ay,gm=(Df||Er)&&!la;var cS=Object.freeze({__proto__:null,get IS_IPOD(){return Ay},get IOS_VERSION(){return aS},get IS_ANDROID(){return Fs},get ANDROID_VERSION(){return oS},get IS_FIREFOX(){return lS},get IS_EDGE(){return du},get IS_CHROMIUM(){return hu},get IS_CHROME(){return la},get CHROMIUM_VERSION(){return Ny},get CHROME_VERSION(){return fm},IS_CHROMECAST_RECEIVER:F4,get IE_VERSION(){return uS},get IS_SAFARI(){return Df},get IS_WINDOWS(){return mm},get IS_IPAD(){return Mf},get IS_IPHONE(){return pm},get IS_TIZEN(){return Rf},get IS_WEBOS(){return jf},get IS_SMART_TV(){return Of},TOUCH_ENABLED:md,IS_IOS:Er,IS_ANY_SAFARI:gm});function I2(n){return typeof n=="string"&&!!n.trim()}function U4(n){if(n.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ju(){return Tt===he.document}function Ou(n){return oa(n)&&n.nodeType===1}function dS(){try{return he.parent!==he.self}catch{return!0}}function hS(n){return function(e,t){if(!I2(e))return Tt[n](null);I2(t)&&(t=Tt.querySelector(t));const i=Ou(t)?t:Tt;return i[n]&&i[n](e)}}function bn(n="div",e={},t={},i){const a=Tt.createElement(n);return Object.getOwnPropertyNames(e).forEach(function(l){const u=e[l];l==="textContent"?Mo(a,u):(a[l]!==u||l==="tabIndex")&&(a[l]=u)}),Object.getOwnPropertyNames(t).forEach(function(l){a.setAttribute(l,t[l])}),i&&Dy(a,i),a}function Mo(n,e){return typeof n.textContent>"u"?n.innerText=e:n.textContent=e,n}function qg(n,e){e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}function rd(n,e){return U4(e),n.classList.contains(e)}function hl(n,...e){return n.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),n}function ym(n,...e){return n?(n.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),n):(In.warn("removeClass was called with an element that doesn't exist"),null)}function fS(n,e,t){return typeof t=="function"&&(t=t(n,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>n.classList.toggle(i,t)),n}function mS(n,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?n.removeAttribute(t):n.setAttribute(t,i===!0?"":i)})}function wo(n){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(n&&n.attributes&&n.attributes.length>0){const i=n.attributes;for(let a=i.length-1;a>=0;a--){const l=i[a].name;let u=i[a].value;t.includes(l)&&(u=u!==null),e[l]=u}}return e}function pS(n,e){return n.getAttribute(e)}function Au(n,e,t){n.setAttribute(e,t)}function bm(n,e){n.removeAttribute(e)}function gS(){Tt.body.focus(),Tt.onselectstart=function(){return!1}}function yS(){Tt.onselectstart=function(){return!0}}function Nu(n){if(n&&n.getBoundingClientRect&&n.parentNode){const e=n.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Du(n,"height"))),t.width||(t.width=parseFloat(Du(n,"width"))),t}}function pd(n){if(!n||n&&!n.offsetParent)return{left:0,top:0,width:0,height:0};const e=n.offsetWidth,t=n.offsetHeight;let i=0,a=0;for(;n.offsetParent&&n!==Tt[Nf.fullscreenElement];)i+=n.offsetLeft,a+=n.offsetTop,n=n.offsetParent;return{left:i,top:a,width:e,height:t}}function vm(n,e){const t={x:0,y:0};if(Er){let w=n;for(;w&&w.nodeName.toLowerCase()!=="html";){const S=Du(w,"transform");if(/^matrix/.test(S)){const A=S.slice(7,-1).split(/,\s/).map(Number);t.x+=A[4],t.y+=A[5]}else if(/^matrix3d/.test(S)){const A=S.slice(9,-1).split(/,\s/).map(Number);t.x+=A[12],t.y+=A[13]}if(w.assignedSlot&&w.assignedSlot.parentElement&&he.WebKitCSSMatrix){const A=he.getComputedStyle(w.assignedSlot.parentElement).transform,C=new he.WebKitCSSMatrix(A);t.x+=C.m41,t.y+=C.m42}w=w.parentNode||w.host}}const i={},a=pd(e.target),l=pd(n),u=l.width,h=l.height;let f=e.offsetY-(l.top-a.top),g=e.offsetX-(l.left-a.left);return e.changedTouches&&(g=e.changedTouches[0].pageX-l.left,f=e.changedTouches[0].pageY+l.top,Er&&(g-=t.x,f-=t.y)),i.y=1-Math.max(0,Math.min(1,f/h)),i.x=Math.max(0,Math.min(1,g/u)),i}function bS(n){return oa(n)&&n.nodeType===3}function xm(n){for(;n.firstChild;)n.removeChild(n.firstChild);return n}function vS(n){return typeof n=="function"&&(n=n()),(Array.isArray(n)?n:[n]).map(e=>{if(typeof e=="function"&&(e=e()),Ou(e)||bS(e))return e;if(typeof e=="string"&&/\S/.test(e))return Tt.createTextNode(e)}).filter(e=>e)}function Dy(n,e){return vS(e).forEach(t=>n.appendChild(t)),n}function xS(n,e){return Dy(xm(n),e)}function gd(n){return n.button===void 0&&n.buttons===void 0||n.button===0&&n.buttons===void 0||n.type==="mouseup"&&n.button===0&&n.buttons===0||n.type==="mousedown"&&n.button===0&&n.buttons===0?!0:!(n.button!==0||n.buttons!==1)}const Do=hS("querySelector"),_S=hS("querySelectorAll");function Du(n,e){if(!n||!e)return"";if(typeof he.getComputedStyle=="function"){let t;try{t=he.getComputedStyle(n)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function wS(n){[...Tt.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(a=>a.cssText).join(""),i=Tt.createElement("style");i.textContent=t,n.document.head.appendChild(i)}catch{const i=Tt.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,n.document.head.appendChild(i)}})}var SS=Object.freeze({__proto__:null,isReal:ju,isEl:Ou,isInFrame:dS,createEl:bn,textContent:Mo,prependTo:qg,hasClass:rd,addClass:hl,removeClass:ym,toggleClass:fS,setAttributes:mS,getAttributes:wo,getAttribute:pS,setAttribute:Au,removeAttribute:bm,blockTextSelection:gS,unblockTextSelection:yS,getBoundingClientRect:Nu,findPosition:pd,getPointerPosition:vm,isTextNode:bS,emptyEl:xm,normalizeContent:vS,appendContent:Dy,insertContent:xS,isSingleLeftClick:gd,$:Do,$$:_S,computedStyle:Du,copyStyleSheetsToWindow:wS});let TS=!1,Vg;const z4=function(){if(Vg.options.autoSetup===!1)return;const n=Array.prototype.slice.call(Tt.getElementsByTagName("video")),e=Array.prototype.slice.call(Tt.getElementsByTagName("audio")),t=Array.prototype.slice.call(Tt.getElementsByTagName("video-js")),i=n.concat(e,t);if(i&&i.length>0)for(let a=0,l=i.length;a-1&&(a={passive:!0}),n.addEventListener(e,i.dispatcher,a)}else n.attachEvent&&n.attachEvent("on"+e,i.dispatcher)}function Cr(n,e,t){if(!Or.has(n))return;const i=Or.get(n);if(!i.handlers)return;if(Array.isArray(e))return My(Cr,n,e,t);const a=function(u,h){i.handlers[h]=[],B2(u,h)};if(e===void 0){for(const u in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},u)&&a(n,u);return}const l=i.handlers[e];if(l){if(!t){a(n,e);return}if(t.guid)for(let u=0;u=e&&(n(...a),t=l)}},CS=function(n,e,t,i=he){let a;const l=()=>{i.clearTimeout(a),a=null},u=function(){const h=this,f=arguments;let g=function(){a=null,g=null,t||n.apply(h,f)};!a&&t&&n.apply(h,f),i.clearTimeout(a),a=i.setTimeout(g,e)};return u.cancel=l,u};var K4=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ks,bind_:Ei,throttle:ua,debounce:CS});let Uc;class hs{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},ds(this,e,t),this.addEventListener=i}off(e,t){Cr(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},wm(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ry(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=_m(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Lu(this,e)}queueTrigger(e){Uc||(Uc=new Map);const t=e.type||e;let i=Uc.get(this);i||(i=new Map,Uc.set(this,i));const a=i.get(t);i.delete(t),he.clearTimeout(a);const l=he.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,Uc.delete(this)),this.trigger(e)},0);i.set(t,l)}}hs.prototype.allowedEvents_={};hs.prototype.addEventListener=hs.prototype.on;hs.prototype.removeEventListener=hs.prototype.off;hs.prototype.dispatchEvent=hs.prototype.trigger;const Sm=n=>typeof n.name=="function"?n.name():typeof n.name=="string"?n.name:n.name_?n.name_:n.constructor&&n.constructor.name?n.constructor.name:typeof n,Oa=n=>n instanceof hs||!!n.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof n[e]=="function"),W4=(n,e)=>{Oa(n)?e():(n.eventedCallbacks||(n.eventedCallbacks=[]),n.eventedCallbacks.push(e))},Wg=n=>typeof n=="string"&&/\S/.test(n)||Array.isArray(n)&&!!n.length,Lf=(n,e,t)=>{if(!n||!n.nodeName&&!Oa(n))throw new Error(`Invalid target for ${Sm(e)}#${t}; must be a DOM node or evented object.`)},AS=(n,e,t)=>{if(!Wg(n))throw new Error(`Invalid event type for ${Sm(e)}#${t}; must be a non-empty string or array.`)},NS=(n,e,t)=>{if(typeof n!="function")throw new Error(`Invalid listener for ${Sm(e)}#${t}; must be a function.`)},rg=(n,e,t)=>{const i=e.length<3||e[0]===n||e[0]===n.eventBusEl_;let a,l,u;return i?(a=n.eventBusEl_,e.length>=3&&e.shift(),[l,u]=e):(a=e[0],l=e[1],u=e[2]),Lf(a,n,t),AS(l,n,t),NS(u,n,t),u=Ei(n,u),{isTargetingSelf:i,target:a,type:l,listener:u}},el=(n,e,t,i)=>{Lf(n,n,e),n.nodeName?G4[e](n,t,i):n[e](t,i)},X4={on(...n){const{isTargetingSelf:e,target:t,type:i,listener:a}=rg(this,n,"on");if(el(t,"on",i,a),!e){const l=()=>this.off(t,i,a);l.guid=a.guid;const u=()=>this.off("dispose",l);u.guid=a.guid,el(this,"on","dispose",l),el(t,"on","dispose",u)}},one(...n){const{isTargetingSelf:e,target:t,type:i,listener:a}=rg(this,n,"one");if(e)el(t,"one",i,a);else{const l=(...u)=>{this.off(t,i,l),a.apply(null,u)};l.guid=a.guid,el(t,"one",i,l)}},any(...n){const{isTargetingSelf:e,target:t,type:i,listener:a}=rg(this,n,"any");if(e)el(t,"any",i,a);else{const l=(...u)=>{this.off(t,i,l),a.apply(null,u)};l.guid=a.guid,el(t,"any",i,l)}},off(n,e,t){if(!n||Wg(n))Cr(this.eventBusEl_,n,e);else{const i=n,a=e;Lf(i,this,"off"),AS(a,this,"off"),NS(t,this,"off"),t=Ei(this,t),this.off("dispose",t),i.nodeName?(Cr(i,a,t),Cr(i,"dispose",t)):Oa(i)&&(i.off(a,t),i.off("dispose",t))}},trigger(n,e){Lf(this.eventBusEl_,this,"trigger");const t=n&&typeof n!="string"?n.type:n;if(!Wg(t))throw new Error(`Invalid event type for ${Sm(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Lu(this.eventBusEl_,n,e)}};function jy(n,e={}){const{eventBusKey:t}=e;if(t){if(!n[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);n.eventBusEl_=n[t]}else n.eventBusEl_=bn("span",{className:"vjs-event-bus"});return Object.assign(n,X4),n.eventedCallbacks&&n.eventedCallbacks.forEach(i=>{i()}),n.on("dispose",()=>{n.off(),[n,n.el_,n.eventBusEl_].forEach(function(i){i&&Or.has(i)&&Or.delete(i)}),he.setTimeout(()=>{n.eventBusEl_=null},0)}),n}const Y4={state:{},setState(n){typeof n=="function"&&(n=n());let e;return cu(n,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&Oa(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function DS(n,e){return Object.assign(n,Y4),n.state=Object.assign({},n.state,e),typeof n.handleStateChanged=="function"&&Oa(n)&&n.on("statechanged",n.handleStateChanged),n}const sd=function(n){return typeof n!="string"?n:n.replace(/./,e=>e.toLowerCase())},Ki=function(n){return typeof n!="string"?n:n.replace(/./,e=>e.toUpperCase())},MS=function(n,e){return Ki(n)===Ki(e)};var Q4=Object.freeze({__proto__:null,toLowerCase:sd,toTitleCase:Ki,titleCaseEquals:MS});class Ze{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=yi({},this.options_),t=this.options_=yi(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const a=e&&e.id&&e.id()||"no_player";this.id_=`${a}_component_${Ts()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(a=>this.addClass(a)),["on","off","one","any","trigger"].forEach(a=>{this[a]=void 0}),t.evented!==!1&&(jy(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),DS(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=yi(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return bn(e,t,i)}localize(e,t,i=e){const a=this.player_.language&&this.player_.language(),l=this.player_.languages&&this.player_.languages(),u=l&&l[a],h=a&&a.split("-")[0],f=l&&l[h];let g=i;return u&&u[e]?g=u[e]:f&&f[e]&&(g=f[e]),t&&(g=g.replace(/\{(\d+)\}/g,function(w,S){const A=t[S-1];let C=A;return typeof A>"u"&&(C=w),C})),g}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,a)=>i.concat(a),[]);let t=this;for(let i=0;i=0;a--)if(this.children_[a]===e){t=!0,this.children_.splice(a,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ki(e.name())]=null,this.childNameIndex_[sd(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=u=>{const h=u.name;let f=u.opts;if(t[h]!==void 0&&(f=t[h]),f===!1)return;f===!0&&(f={}),f.playerOptions=this.options_.playerOptions;const g=this.addChild(h,f);g&&(this[h]=g)};let a;const l=Ze.getComponent("Tech");Array.isArray(e)?a=e:a=Object.keys(e),a.concat(Object.keys(this.options_).filter(function(u){return!a.some(function(h){return typeof h=="string"?u===h:u===h.name})})).map(u=>{let h,f;return typeof u=="string"?(h=u,f=e[h]||this.options_[h]||{}):(h=u.name,f=u),{name:h,opts:f}}).filter(u=>{const h=Ze.getComponent(u.opts.componentClass||Ki(u.name));return h&&!l.isTech(h)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Do(e,t||this.contentEl())}$$(e,t){return _S(e,t||this.contentEl())}hasClass(e){return rd(this.el_,e)}addClass(...e){hl(this.el_,...e)}removeClass(...e){ym(this.el_,...e)}toggleClass(e,t){fS(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return pS(this.el_,e)}setAttribute(e,t){Au(this.el_,e,t)}removeAttribute(e){bm(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const a=this.el_.style[e],l=a.indexOf("px");return parseInt(l!==-1?a.slice(0,l):this.el_["offset"+Ki(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Du(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Ki(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,a=200;let l;this.on("touchstart",function(h){h.touches.length===1&&(t={pageX:h.touches[0].pageX,pageY:h.touches[0].pageY},e=he.performance.now(),l=!0)}),this.on("touchmove",function(h){if(h.touches.length>1)l=!1;else if(t){const f=h.touches[0].pageX-t.pageX,g=h.touches[0].pageY-t.pageY;Math.sqrt(f*f+g*g)>i&&(l=!1)}});const u=function(){l=!1};this.on("touchleave",u),this.on("touchcancel",u),this.on("touchend",function(h){t=null,l===!0&&he.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),he.clearTimeout(e)),e}setInterval(e,t){e=Ei(this,e),this.clearTimersOnDispose_();const i=he.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),he.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Ei(this,e),t=he.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Ei(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),he.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,a)=>this[t](a))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(l){const u=he.getComputedStyle(l,null),h=u.getPropertyValue("visibility");return u.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(h)}function i(l){return!(!t(l.parentElement)||!t(l)||l.style.opacity==="0"||he.getComputedStyle(l).height==="0px"||he.getComputedStyle(l).width==="0px")}function a(l){if(l.offsetWidth+l.offsetHeight+l.getBoundingClientRect().height+l.getBoundingClientRect().width===0)return!1;const u={x:l.getBoundingClientRect().left+l.offsetWidth/2,y:l.getBoundingClientRect().top+l.offsetHeight/2};if(u.x<0||u.x>(Tt.documentElement.clientWidth||he.innerWidth)||u.y<0||u.y>(Tt.documentElement.clientHeight||he.innerHeight))return!1;let h=Tt.elementFromPoint(u.x,u.y);for(;h;){if(h===l)return!0;if(h.parentNode)h=h.parentNode;else return!1}}return e||(e=this.el()),!!(a(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Ze.getComponent("Tech"),a=i&&i.isTech(t),l=Ze===t||Ze.prototype.isPrototypeOf(t.prototype);if(a||!l){let h;throw a?h="techs must be registered using Tech.registerTech()":h="must be a Component subclass",new Error(`Illegal component, "${e}"; ${h}.`)}e=Ki(e),Ze.components_||(Ze.components_={});const u=Ze.getComponent("Player");if(e==="Player"&&u&&u.players){const h=u.players,f=Object.keys(h);if(h&&f.length>0){for(let g=0;gt)throw new Error(`Failed to execute '${n}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function P2(n,e,t,i){return Z4(n,i,t.length-1),t[i][e]}function sg(n){let e;return n===void 0||n.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:n.length,start:P2.bind(null,"start",0,n),end:P2.bind(null,"end",1,n)},he.Symbol&&he.Symbol.iterator&&(e[he.Symbol.iterator]=()=>(n||[]).values()),e}function Ps(n,e){return Array.isArray(n)?sg(n):n===void 0||e===void 0?sg():sg([[n,e]])}const RS=function(n,e){n=n<0?0:n;let t=Math.floor(n%60),i=Math.floor(n/60%60),a=Math.floor(n/3600);const l=Math.floor(e/60%60),u=Math.floor(e/3600);return(isNaN(n)||n===1/0)&&(a=i=t="-"),a=a>0||u>0?a+":":"",i=((a||l>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,a+i+t};let Oy=RS;function jS(n){Oy=n}function OS(){Oy=RS}function vl(n,e=n){return Oy(n,e)}var J4=Object.freeze({__proto__:null,createTimeRanges:Ps,createTimeRange:Ps,setFormatTime:jS,resetFormatTime:OS,formatTime:vl});function LS(n,e){let t=0,i,a;if(!e)return 0;(!n||!n.length)&&(n=Ps(0,0));for(let l=0;le&&(a=e),t+=a-i;return t/e}function zi(n){if(n instanceof zi)return n;typeof n=="number"?this.code=n:typeof n=="string"?this.message=n:oa(n)&&(typeof n.code=="number"&&(this.code=n.code),Object.assign(this,n)),this.message||(this.message=zi.defaultMessages[this.code]||"")}zi.prototype.code=0;zi.prototype.message="";zi.prototype.status=null;zi.prototype.metadata=null;zi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];zi.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};zi.MEDIA_ERR_CUSTOM=0;zi.prototype.MEDIA_ERR_CUSTOM=0;zi.MEDIA_ERR_ABORTED=1;zi.prototype.MEDIA_ERR_ABORTED=1;zi.MEDIA_ERR_NETWORK=2;zi.prototype.MEDIA_ERR_NETWORK=2;zi.MEDIA_ERR_DECODE=3;zi.prototype.MEDIA_ERR_DECODE=3;zi.MEDIA_ERR_SRC_NOT_SUPPORTED=4;zi.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;zi.MEDIA_ERR_ENCRYPTED=5;zi.prototype.MEDIA_ERR_ENCRYPTED=5;function ad(n){return n!=null&&typeof n.then=="function"}function na(n){ad(n)&&n.then(null,e=>{})}const Xg=function(n){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,a)=>(n[i]&&(t[i]=n[i]),t),{cues:n.cues&&Array.prototype.map.call(n.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},eM=function(n){const e=n.$$("track"),t=Array.prototype.map.call(e,a=>a.track);return Array.prototype.map.call(e,function(a){const l=Xg(a.track);return a.src&&(l.src=a.src),l}).concat(Array.prototype.filter.call(n.textTracks(),function(a){return t.indexOf(a)===-1}).map(Xg))},tM=function(n,e){return n.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(a=>i.addCue(a))}),e.textTracks()};var Yg={textTracksToJson:eM,jsonToTextTracks:tM,trackToJson:Xg};const ag="vjs-modal-dialog";class Iu extends Ze{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=bn("div",{className:`${ag}-content`},{role:"document"}),this.descEl_=bn("p",{className:`${ag}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Mo(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${ag} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const a=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=a,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,a=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),xS(t,e),this.trigger("modalfill"),a?i.insertBefore(t,a):i.appendChild(t);const l=this.getChild("closeButton");l&&i.appendChild(l.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),xm(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=Tt.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let a;for(let l=0;l(t instanceof he.HTMLAnchorElement||t instanceof he.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof he.HTMLInputElement||t instanceof he.HTMLSelectElement||t instanceof he.HTMLTextAreaElement||t instanceof he.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof he.HTMLIFrameElement||t instanceof he.HTMLObjectElement||t instanceof he.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Iu.prototype.options_={pauseOnOpen:!0,temporary:!0};Ze.registerComponent("ModalDialog",Iu);class xl extends hs{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},Oa(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,a=this.length;i=0;t--)if(e[t].enabled){og(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&og(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,og(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const lg=function(n,e){for(let t=0;t=0;t--)if(e[t].selected){lg(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,lg(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Ly extends xl{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class nM{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t0&&(he.console&&he.console.groupCollapsed&&he.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(a=>In.error(a)),he.console&&he.console.groupEnd&&he.console.groupEnd()),t.flush()},z2=function(n,e){const t={uri:n},i=Tm(n);i&&(t.cors=i);const a=e.tech_.crossOrigin()==="use-credentials";a&&(t.withCredentials=a),Uw(t,Ei(this,function(l,u,h){if(l)return In.error(l,u);e.loaded_=!0,typeof he.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],f=>{if(f.type==="vttjserror"){In.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return U2(h,e)}):U2(h,e)}))};class Sd extends Iy{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=yi(e,{kind:sM[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=F2[t.mode]||"disabled";const a=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const l=new If(this.cues_),u=new If(this.activeCues_);let h=!1;this.timeupdateHandler=Ei(this,function(g={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){g.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1),g.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const f=()=>{this.stopTracking()};this.tech_.one("dispose",f),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return a},set(){}},mode:{get(){return i},set(g){F2[g]&&i!==g&&(i=g,!this.preload_&&i!=="disabled"&&this.cues.length===0&&z2(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?l:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return u;const g=this.tech_.currentTime(),w=[];for(let S=0,A=this.cues.length;S=g&&w.push(C)}if(h=!1,w.length!==this.activeCues_.length)h=!0;else for(let S=0;S{t=Ia.LOADED,this.trigger({type:"load",target:this})})}}Ia.prototype.allowedEvents_={load:"load"};Ia.NONE=0;Ia.LOADING=1;Ia.LOADED=2;Ia.ERROR=3;const Ss={audio:{ListClass:IS,TrackClass:FS,capitalName:"Audio"},video:{ListClass:BS,TrackClass:US,capitalName:"Video"},text:{ListClass:Ly,TrackClass:Sd,capitalName:"Text"}};Object.keys(Ss).forEach(function(n){Ss[n].getterName=`${n}Tracks`,Ss[n].privateName=`${n}Tracks_`});const Mu={remoteText:{ListClass:Ly,TrackClass:Sd,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:nM,TrackClass:Ia,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},jr=Object.assign({},Ss,Mu);Mu.names=Object.keys(Mu);Ss.names=Object.keys(Ss);jr.names=[].concat(Mu.names).concat(Ss.names);function oM(n,e,t,i,a={}){const l=n.textTracks();a.kind=e,t&&(a.label=t),i&&(a.language=i),a.tech=n;const u=new jr.text.TrackClass(a);return l.addTrack(u),u}class En extends Ze{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),jr.names.forEach(i=>{const a=jr[i];e&&e[a.getterName]&&(this[a.privateName]=e[a.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new jr.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ei(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ps(0,0)}bufferedPercent(){return LS(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Ss.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let a=i.length;for(;a--;){const l=i[a];t==="text"&&this.removeRemoteTextTrack(l),i.removeTrack(l)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new zi(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ps(0,0):Ps()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Ss.names.forEach(e=>{const t=Ss[e],i=()=>{this.trigger(`${e}trackchange`)},a=this[t.getterName]();a.addEventListener("removetrack",i),a.addEventListener("addtrack",i),this.on("dispose",()=>{a.removeEventListener("removetrack",i),a.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!he.WebVTT)if(Tt.body.contains(this.el())){if(!this.options_["vtt.js"]&&Cu(d2)&&Object.keys(d2).length>0){this.trigger("vttjsloaded");return}const e=Tt.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),he.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=h=>e.addTrack(h.track),a=h=>e.removeTrack(h.track);t.on("addtrack",i),t.on("removetrack",a),this.addWebVttScript_();const l=()=>this.trigger("texttrackchange"),u=()=>{l();for(let h=0;hthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Ts();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return En.canPlayType(e.type)}static isTech(e){return e.prototype instanceof En||e instanceof En||e===En}static registerTech(e,t){if(En.techs_||(En.techs_={}),!En.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!En.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!En.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ki(e),En.techs_[e]=t,En.techs_[sd(e)]=t,e!=="Tech"&&En.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(En.techs_&&En.techs_[e])return En.techs_[e];if(e=Ki(e),he&&he.videojs&&he.videojs[e])return In.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),he.videojs[e]}}}jr.names.forEach(function(n){const e=jr[n];En.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});En.prototype.featuresVolumeControl=!0;En.prototype.featuresMuteControl=!0;En.prototype.featuresFullscreenResize=!1;En.prototype.featuresPlaybackRate=!1;En.prototype.featuresProgressEvents=!1;En.prototype.featuresSourceset=!1;En.prototype.featuresTimeupdateEvents=!1;En.prototype.featuresNativeTextTracks=!1;En.prototype.featuresVideoFrameCallback=!1;En.withSourceHandlers=function(n){n.registerSourceHandler=function(t,i){let a=n.sourceHandlers;a||(a=n.sourceHandlers=[]),i===void 0&&(i=a.length),a.splice(i,0,t)},n.canPlayType=function(t){const i=n.sourceHandlers||[];let a;for(let l=0;lrl(e,fl[e.type],t,n),1)}function cM(n,e){n.forEach(t=>t.setTech&&t.setTech(e))}function dM(n,e,t){return n.reduceRight(Fy(t),e[t]())}function hM(n,e,t,i){return e[t](n.reduce(Fy(t),i))}function H2(n,e,t,i=null){const a="call"+Ki(t),l=n.reduce(Fy(a),i),u=l===Pf,h=u?null:e[t](l);return pM(n,t,h,u),h}const fM={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},mM={setCurrentTime:1,setMuted:1,setVolume:1},$2={play:1,pause:1};function Fy(n){return(e,t)=>e===Pf?Pf:t[n]?t[n](e):e}function pM(n,e,t,i){for(let a=n.length-1;a>=0;a--){const l=n[a];l[e]&&l[e](i,t)}}function gM(n){Bf.hasOwnProperty(n.id())&&delete Bf[n.id()]}function yM(n,e){const t=Bf[n.id()];let i=null;if(t==null)return i=e(n),Bf[n.id()]=[[e,i]],i;for(let a=0;a{if(!e)return"";if(n.cache_.source.src===e&&n.cache_.source.type)return n.cache_.source.type;const t=n.cache_.sources.filter(a=>a.src===e);if(t.length)return t[0].type;const i=n.$$("source");for(let a=0;a - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`;const V2=Rf?10009:jf?461:8,Ql={codes:{play:415,pause:19,ff:417,rw:412,back:V2},names:{415:"play",19:"pause",417:"ff",412:"rw",[V2]:"back"},isEventKey(n,e){return e=e.toLowerCase(),!!(this.names[n.keyCode]&&this.names[n.keyCode]===e)},getEventName(n){if(this.names[n.keyCode])return this.names[n.keyCode];if(this.codes[n.code]){const e=this.codes[n.code];return this.names[e]}return null}},G2=5;class _M extends hs{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(Ql.isEventKey(t,"play")||Ql.isEventKey(t,"pause")||Ql.isEventKey(t,"ff")||Ql.isEventKey(t,"rw")){t.preventDefault();const i=Ql.getEventName(t);this.performMediaAction_(i)}else Ql.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+G2);break;case"rw":this.userSeek_(this.player_.currentTime()-G2);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const a=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(a&&a.name()==="CloseButton"?this.refocusComponent():(this.pause(),a&&a.el()&&(this.lastFocusedComponent_=a)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(a){for(const l of a)l.hasOwnProperty("el_")&&l.getIsFocusable()&&l.getIsAvailableToBeFocused(l.el())&&t.push(l),l.hasOwnProperty("children_")&&l.children_.length>0&&i(l.children_)}return e.children_.forEach(a=>{if(a.hasOwnProperty("el_"))if(a.getIsFocusable&&a.getIsAvailableToBeFocused&&a.getIsFocusable()&&a.getIsAvailableToBeFocused(a.el())){t.push(a);return}else a.hasOwnProperty("children_")&&a.children_.length>0?i(a.children_):a.hasOwnProperty("items")&&a.items.length>0?i(a.items):this.findSuitableDOMChild(a)&&t.push(a);if(a.name_==="ErrorDisplay"&&a.opened_){const l=a.el_.querySelector(".vjs-errors-ok-button-container");l&&l.querySelectorAll("button").forEach((h,f)=>{t.push({name:()=>"ModalButton"+(f+1),el:()=>h,getPositions:()=>{const g=h.getBoundingClientRect(),w={x:g.x,y:g.y,width:g.width,height:g.height,top:g.top,right:g.right,bottom:g.bottom,left:g.left},S={x:g.left+g.width/2,y:g.top+g.height/2,width:0,height:0,top:g.top+g.height/2,right:g.left+g.width/2,bottom:g.top+g.height/2,left:g.left+g.width/2};return{boundingClientRect:w,center:S}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:g=>!0,focus:()=>h.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let a=0;a0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),a=this.focusableComponents.filter(u=>u!==t&&this.isInDirection_(i.boundingClientRect,u.getPositions().boundingClientRect,e)),l=this.findBestCandidate_(i.center,a,e);l?this.focus(l):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let a=1/0,l=null;for(const u of t){const h=u.getPositions().center,f=this.calculateDistance_(e,h,i);f=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&In.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const a=bn(e,t,i);return this.player_.options_.experimentalSvgIcons||a.appendChild(bn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(a),a}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=bn("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Mo(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ze.registerComponent("ClickableComponent",km);class Qg extends km{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return bn("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(bn("picture",{className:"vjs-poster",tabIndex:-1},{},bn("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?na(this.player_.play()):this.player_.pause())}}Qg.prototype.crossorigin=Qg.prototype.crossOrigin;Ze.registerComponent("PosterImage",Qg);const vs="#222",K2="#ccc",SM={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ug(n,e){let t;if(n.length===4)t=n[1]+n[1]+n[2]+n[2]+n[3]+n[3];else if(n.length===7)t=n.slice(1);else throw new Error("Invalid color code provided, "+n+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Zs(n,e,t){try{n.style[e]=t}catch{return}}function W2(n){return n?`${n}px`:""}class TM extends Ze{constructor(e,t,i){super(e,t,i);const a=u=>this.updateDisplay(u),l=u=>{this.updateDisplayOverlay(),this.updateDisplay(u)};e.on("loadstart",u=>this.toggleDisplay(u)),e.on("useractive",a),e.on("userinactive",a),e.on("texttrackchange",a),e.on("loadedmetadata",u=>{this.updateDisplayOverlay(),this.preselectTrack(u)}),e.ready(Ei(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",l),e.on("playerresize",l);const u=he.screen.orientation||he,h=he.screen.orientation?"change":"orientationchange";u.addEventListener(h,l),e.on("dispose",()=>u.removeEventListener(h,l));const f=this.options_.playerOptions.tracks||[];for(let g=0;g0&&h.forEach(w=>{if(w.style.inset){const S=w.style.inset.split(" ");S.length===3&&Object.assign(w.style,{top:S[0],right:S[1],bottom:S[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!he.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,a=this.player_.videoWidth()/this.player_.videoHeight();let l=0,u=0;Math.abs(i-a)>.1&&(i>a?l=Math.round((e-t*a)/2):u=Math.round((t-e/a)/2)),Zs(this.el_,"insetInline",W2(l)),Zs(this.el_,"insetBlock",W2(u))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let a=i.length;for(;a--;){const l=i[a];if(!l)continue;const u=l.displayState;if(t.color&&(u.firstChild.style.color=t.color),t.textOpacity&&Zs(u.firstChild,"color",ug(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(u.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Zs(u.firstChild,"backgroundColor",ug(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Zs(u,"backgroundColor",ug(t.windowColor,t.windowOpacity)):u.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?u.firstChild.style.textShadow=`2px 2px 3px ${vs}, 2px 2px 4px ${vs}, 2px 2px 5px ${vs}`:t.edgeStyle==="raised"?u.firstChild.style.textShadow=`1px 1px ${vs}, 2px 2px ${vs}, 3px 3px ${vs}`:t.edgeStyle==="depressed"?u.firstChild.style.textShadow=`1px 1px ${K2}, 0 1px ${K2}, -1px -1px ${vs}, 0 -1px ${vs}`:t.edgeStyle==="uniform"&&(u.firstChild.style.textShadow=`0 0 4px ${vs}, 0 0 4px ${vs}, 0 0 4px ${vs}, 0 0 4px ${vs}`)),t.fontPercent&&t.fontPercent!==1){const h=he.parseFloat(u.style.fontSize);u.style.fontSize=h*t.fontPercent+"px",u.style.height="auto",u.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=SM[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof he.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){na(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),a=i&&i.getChild("playToggle");if(!a){this.player_.tech(!0).focus();return}const l=()=>a.focus();ad(t)?t.then(l,()=>{}):this.setTimeout(l,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}HS.prototype.controlText_="Play Video";Ze.registerComponent("BigPlayButton",HS);class EM extends Ar{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ze.registerComponent("CloseButton",EM);class $S extends Ar{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?na(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}$S.prototype.controlText_="Play";Ze.registerComponent("PlayToggle",$S);class Bu extends Ze{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=bn("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=bn("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=vl(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,In.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=Tt.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Bu.prototype.labelText_="Time";Bu.prototype.controlText_="Time";Ze.registerComponent("TimeDisplay",Bu);class Uy extends Bu{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Uy.prototype.labelText_="Current Time";Uy.prototype.controlText_="Current Time";Ze.registerComponent("CurrentTimeDisplay",Uy);class zy extends Bu{constructor(e,t){super(e,t);const i=a=>this.updateContent(a);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}zy.prototype.labelText_="Duration";zy.prototype.controlText_="Duration";Ze.registerComponent("DurationDisplay",zy);class CM extends Ze{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}Ze.registerComponent("TimeDivider",CM);class Hy extends Bu{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(bn("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}Hy.prototype.labelText_="Remaining Time";Hy.prototype.controlText_="Remaining Time";Ze.registerComponent("RemainingTimeDisplay",Hy);class AM extends Ze{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=bn("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(bn("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(Tt.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}Ze.registerComponent("LiveDisplay",AM);class qS extends Ar{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=bn("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}qS.prototype.controlText_="Seek to live, currently playing live";Ze.registerComponent("SeekToLive",qS);function Td(n,e,t){return n=Number(n),Math.min(t,Math.max(e,isNaN(n)?e:n))}var NM=Object.freeze({__proto__:null,clamp:Td});class $y extends Ze{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!la&&e.preventDefault(),gS(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;yS(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Td(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=vm(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,a=t&&t.horizontalSeek;i?a&&e.key==="ArrowLeft"||!a&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):a&&e.key==="ArrowRight"||!a&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ze.registerComponent("Slider",$y);const cg=(n,e)=>Td(n/e*100,0,100).toFixed(2)+"%";class DM extends Ze{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=bn("span",{className:"vjs-control-text"}),i=bn("span",{textContent:this.localize("Loaded")}),a=Tt.createTextNode(": ");return this.percentageEl_=bn("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(a),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),a=t&&t.isLive()?t.seekableEnd():this.player_.duration(),l=this.player_.bufferedEnd(),u=this.partEls_,h=cg(l,a);this.percent_!==h&&(this.el_.style.width=h,Mo(this.percentageEl_,h),this.percent_=h);for(let f=0;fi.length;f--)this.el_.removeChild(u[f-1]);u.length=i.length})}}Ze.registerComponent("LoadProgressBar",DM);class MM extends Ze{constructor(e,t){super(e,t),this.update=ua(Ei(this,this.update),ks)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const a=pd(this.el_),l=Nu(this.player_.el()),u=e.width*t;if(!l||!a)return;let h=e.left-l.left+u,f=e.width-u+(l.right-e.right);f||(f=e.width-u,h=u);let g=a.width/2;ha.width&&(g=a.width),g=Math.round(g),this.el_.style.right=`-${g}px`,this.write(i)}write(e){Mo(this.el_,e)}updateTime(e,t,i,a){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let l;const u=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const h=this.player_.liveTracker.liveWindow(),f=h-t*h;l=(f<1?"":"-")+vl(f,h)}else l=vl(i,u);this.update(e,t,l),a&&a()})}}Ze.registerComponent("TimeTooltip",MM);class qy extends Ze{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=ua(Ei(this,this.update),ks)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const a=this.getChild("timeTooltip");if(!a)return;const l=i&&i.target&&typeof i.target.pendingSeekTime=="function"?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,t,l)}}qy.prototype.options_={children:[]};!Er&&!Fs&&qy.prototype.options_.children.push("timeTooltip");Ze.registerComponent("PlayProgressBar",qy);class VS extends Ze{constructor(e,t){super(e,t),this.update=ua(Ei(this,this.update),ks)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}VS.prototype.options_={children:["timeTooltip"]};Ze.registerComponent("MouseTimeDisplay",VS);class Em extends $y{constructor(e,t){t=yi(Em.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(Er||Fs)||e.options_.disableSeekWhileScrubbingOnSTV;(!Er&&!Fs||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Ei(this,this.update),this.update=ua(this.update_,ks),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Tt&&"visibilityState"in Tt&&this.on(Tt,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){Tt.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ks))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(Tt.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),a=this.player_.liveTracker;let l=this.player_.duration();a&&a.isLive()&&(l=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==l)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[vl(i,l),vl(l,l)],"{1} of {2}")),this.currentTime_=i,this.duration_=l),this.bar&&this.bar.update(Nu(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){gd(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!gd(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const a=this.calculateDistance(e),l=this.player_.liveTracker;if(!l||!l.isLive())i=a*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(a>=.99){l.seekToLiveEdge();return}const u=l.seekableStart(),h=l.liveCurrentTime();if(i=u+a*l.liveWindow(),i>=h&&(i=h),i<=u&&(i=u+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?na(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Tt&&"visibilityState"in Tt&&this.off(Tt,"visibilitychange",this.toggleVisibility_),super.dispose()}}Em.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};Ze.registerComponent("SeekBar",Em);class GS extends Ze{constructor(e,t){super(e,t),this.handleMouseMove=ua(Ei(this,this.handleMouseMove),ks),this.throttledHandleMouseSeek=ua(Ei(this,this.handleMouseSeek),ks),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),a=t.getChild("mouseTimeDisplay");if(!i&&!a)return;const l=t.el(),u=pd(l);let h=vm(l,e).x;h=Td(h,0,1),a&&a.update(u,h),i&&i.update(u,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&na(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}GS.prototype.options_={children:["seekBar"]};Ze.registerComponent("ProgressControl",GS);class KS extends Ar{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){Tt.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in he?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof Tt.exitPictureInPicture=="function"&&super.show()}}KS.prototype.controlText_="Picture-in-Picture";Ze.registerComponent("PictureInPictureToggle",KS);class WS extends Ar{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),Tt[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}WS.prototype.controlText_="Fullscreen";Ze.registerComponent("FullscreenToggle",WS);const RM=function(n,e){e.tech_&&!e.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})};class jM extends Ze{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}Ze.registerComponent("VolumeLevel",jM);class OM extends Ze{constructor(e,t){super(e,t),this.update=ua(Ei(this,this.update),ks)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,a){if(!i){const l=Nu(this.el_),u=Nu(this.player_.el()),h=e.width*t;if(!u||!l)return;const f=e.left-u.left+h,g=e.width-h+(u.right-e.right);let w=l.width/2;fl.width&&(w=l.width),this.el_.style.right=`-${w}px`}this.write(`${a}%`)}write(e){Mo(this.el_,e)}updateVolume(e,t,i,a,l){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,a.toFixed(0)),l&&l()})}}Ze.registerComponent("VolumeLevelTooltip",OM);class XS extends Ze{constructor(e,t){super(e,t),this.update=ua(Ei(this,this.update),ks)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const a=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,a,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}XS.prototype.options_={children:["volumeLevelTooltip"]};Ze.registerComponent("MouseVolumeLevelDisplay",XS);class Cm extends $y{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){gd(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),a=Nu(i),l=this.vertical();let u=vm(i,e);u=l?u.y:u.x,u=Td(u,0,1),t.update(a,u,l)}gd(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Cm.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Er&&!Fs&&Cm.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Cm.prototype.playerEvent="volumechange";Ze.registerComponent("VolumeBar",Cm);class YS extends Ze{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Cu(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),RM(this,e),this.throttledHandleMouseMove=ua(Ei(this,this.handleMouseMove),ks),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}YS.prototype.options_={children:["volumeBar"]};Ze.registerComponent("VolumeControl",YS);const LM=function(n,e){e.tech_&&!e.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(e,"loadstart",function(){e.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})};class QS extends Ar{constructor(e,t){super(e,t),LM(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const a=i<.1?.1:i;this.player_.volume(a),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Er&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),ym(this.el_,[0,1,2,3].reduce((i,a)=>i+`${a?" ":""}vjs-vol-${a}`,"")),hl(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}QS.prototype.controlText_="Mute";Ze.registerComponent("MuteToggle",QS);class ZS extends Ze{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Cu(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),ds(Tt,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Cr(Tt,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}ZS.prototype.options_={children:["muteToggle","volumeControl"]};Ze.registerComponent("VolumePanel",ZS);class JS extends Ar{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,a=i&&i.isLive()?i.seekableEnd():this.player_.duration();let l;t+this.skipTime<=a?l=t+this.skipTime:l=a,this.player_.currentTime(l)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}JS.prototype.controlText_="Skip Forward";Ze.registerComponent("SkipForward",JS);class eT extends Ar{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,a=i&&i.isLive()&&i.seekableStart();let l;a&&t-this.skipTime<=a?l=a:t>=this.skipTime?l=t-this.skipTime:l=0,this.player_.currentTime(l)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}eT.prototype.controlText_="Skip Backward";Ze.registerComponent("SkipBackward",eT);class tT extends Ze{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof Ze&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ze&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=bn(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),ds(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||Tt.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(a=>a.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ze.registerComponent("Menu",tT);class Vy extends Ze{constructor(e,t={}){super(e,t),this.menuButton_=new Ar(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Ar.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const a=l=>this.handleClick(l);this.handleMenuKeyUp_=l=>this.handleMenuKeyUp(l),this.on(this.menuButton_,"tap",a),this.on(this.menuButton_,"click",a),this.on(this.menuButton_,"keydown",l=>this.handleKeyDown(l)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),ds(Tt,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",l=>this.handleMouseLeave(l)),this.on("keydown",l=>this.handleSubmenuKeyDown(l))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new tT(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=bn("li",{className:"vjs-menu-title",textContent:Ki(this.options_.title),tabIndex:-1}),i=new Ze(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,h)},u=(...h)=>{this.handleSelectedLanguageChange.apply(this,h)};if(e.on(["loadstart","texttrackchange"],l),a.addEventListener("change",l),a.addEventListener("selectedlanguagechange",u),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],l),a.removeEventListener("change",l),a.removeEventListener("selectedlanguagechange",u)}),a.onchange===void 0){let h;this.on(["tap","click"],function(){if(typeof he.Event!="object")try{h=new he.Event("change")}catch{}h||(h=Tt.createEvent("Event"),h.initEvent("change",!0,!0)),a.dispatchEvent(h)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let a=0;a-1&&u.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let a=0,l=t.length;a-1&&u.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ze.registerComponent("OffTextTrackMenuItem",nT);class Pu extends Gy{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Ed){let i;this.label_&&(i=`${this.label_} off`),e.push(new nT(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let l=0;l-1){const h=new t(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});h.addClass(`vjs-${u.kind}-menu-item`),e.push(h)}}return e}}Ze.registerComponent("TextTrackButton",Pu);class iT extends kd{constructor(e,t){const i=t.track,a=t.cue,l=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=a.text,t.selected=a.startTime<=l&&l{this.items.forEach(a=>{a.selected(this.track_.activeCues[0]===a.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ki(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,a=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Ki(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Yy(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,rT),e}}Zy.prototype.kinds_=["captions","subtitles"];Zy.prototype.controlText_="Subtitles";Ze.registerComponent("SubsCapsButton",Zy);class sT extends kd{constructor(e,t){const i=t.track,a=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const l=(...u)=>{this.handleTracksChange.apply(this,u)};a.addEventListener("change",l),this.on("dispose",()=>{a.removeEventListener("change",l)})}createEl(e,t,i){const a=super.createEl(e,t,i),l=a.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(l.appendChild(bn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(bn("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),a}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;ithis.update(l))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Jy.prototype.contentElType="button";Ze.registerComponent("PlaybackRateMenuItem",Jy);class oT extends Vy{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=bn("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Jy(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}oT.prototype.controlText_="Playback Rate";Ze.registerComponent("PlaybackRateMenuButton",oT);class lT extends Ze{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Ze.registerComponent("Spacer",lT);class IM extends lT{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Ze.registerComponent("CustomControlSpacer",IM);class uT extends Ze{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}uT.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};Ze.registerComponent("ControlBar",uT);class cT extends Iu{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}cT.prototype.options_=Object.assign({},Iu.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});Ze.registerComponent("ErrorDisplay",cT);class dT extends Ze{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),bn("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Ts()}`)+"-"+t[1].replace(/\W+/g,""),a=bn("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return a.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),a}))}}Ze.registerComponent("TextTrackSelect",dT);class ml extends Ze{constructor(e,t={}){super(e,t);const i=bn("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const a=this.options_.selects;for(const l of a){const u=this.options_.selectConfigs[l],h=u.className,f=u.id.replace("%s",this.options_.id_);let g=null;const w=`vjs_select_${Ts()}`;if(this.options_.type==="colors"){g=bn("span",{className:h});const A=bn("label",{id:f,className:"vjs-label",textContent:this.localize(u.label)});A.setAttribute("for",w),g.appendChild(A)}const S=new dT(e,{SelectOptions:u.options,legendId:this.options_.legendId,id:w,labelId:f});this.addChild(S),this.options_.type==="colors"&&(g.appendChild(S.el()),this.el().appendChild(g))}}createEl(){return bn("fieldset",{className:this.options_.className})}}Ze.registerComponent("TextTrackFieldset",ml);class hT extends Ze{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,a=new ml(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a);const l=new ml(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(l);const u=new ml(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(u)}createEl(){return bn("div",{className:"vjs-track-settings-colors"})}}Ze.registerComponent("TextTrackSettingsColors",hT);class fT extends Ze{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,a=new ml(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a);const l=new ml(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(l);const u=new ml(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(u)}createEl(){return bn("div",{className:"vjs-track-settings-font"})}}Ze.registerComponent("TextTrackSettingsFont",fT);class mT extends Ze{constructor(e,t={}){super(e,t);const i=new Ar(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const a=this.localize("Done"),l=new Ar(e,{controlText:a,className:"vjs-done-button"});l.el().classList.remove("vjs-control","vjs-button"),l.el().textContent=a,this.addChild(l)}createEl(){return bn("div",{className:"vjs-track-settings-controls"})}}Ze.registerComponent("TrackSettingsControls",mT);const dg="vjs-text-track-settings",X2=["#000","Black"],Y2=["#00F","Blue"],Q2=["#0FF","Cyan"],Z2=["#0F0","Green"],J2=["#F0F","Magenta"],e_=["#F00","Red"],t_=["#FFF","White"],n_=["#FF0","Yellow"],hg=["1","Opaque"],fg=["0.5","Semi-Transparent"],i_=["0","Transparent"],So={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[X2,t_,e_,Z2,Y2,n_,J2,Q2],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[hg,fg,i_],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[t_,X2,e_,Z2,Y2,n_,J2,Q2],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:n=>n==="1.00"?null:Number(n)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[hg,fg],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[i_,fg,hg],className:"vjs-window-opacity vjs-opacity"}};So.windowColor.options=So.backgroundColor.options;function pT(n,e){if(e&&(n=e(n)),n&&n!=="none")return n}function BM(n,e){const t=n.options[n.options.selectedIndex].value;return pT(t,e)}function PM(n,e,t){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),cu(So,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return rS(So,(e,t,i)=>{const a=BM(this.$(t.selector),t.parser);return a!==void 0&&(e[i]=a),e},{})}setValues(e){cu(So,(t,i)=>{PM(this.$(t.selector),e[i],t.parser)})}setDefaults(){cu(So,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(he.localStorage.getItem(dg))}catch(t){In.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?he.localStorage.setItem(dg,JSON.stringify(e)):he.localStorage.removeItem(dg)}catch(t){In.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}Ze.registerComponent("TextTrackSettings",FM);class UM extends Ze{constructor(e,t){let i=t.ResizeObserver||he.ResizeObserver;t.ResizeObserver===null&&(i=!1);const a=yi({createEl:!i,reportTouchActivity:!1},t);super(e,a),this.ResizeObserver=t.ResizeObserver||he.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=CS(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const l=this.debouncedHandler_;let u=this.unloadListener_=function(){Cr(this,"resize",l),Cr(this,"unload",u),u=null};ds(this.el_.contentWindow,"unload",u),ds(this.el_.contentWindow,"resize",l)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}Ze.registerComponent("ResizeManager",UM);const zM={trackingThreshold:20,liveTolerance:15};class HM extends Ze{constructor(e,t){const i=yi(zM,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=a=>this.handlePlay(a),this.handleFirstTimeupdate_=a=>this.handleFirstTimeupdate(a),this.handleSeeked_=a=>this.handleSeeked(a),this.seekToLiveEdge_=a=>this.seekToLiveEdge(a),this.reset_(),this.on(this.player_,"durationchange",a=>this.handleDurationchange(a)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(he.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const a=this.liveCurrentTime(),l=this.player_.currentTime();let u=this.player_.paused()||this.seekedBehindLive_||Math.abs(a-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||a===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ks),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}Ze.registerComponent("LiveTracker",HM);class $M extends Ze{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:bn("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Ts()}`}),description:bn("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Ts()}`})},bn("div",{className:"vjs-title-bar"},{},sS(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(a=>{const l=this.state[a],u=this.els[a],h=i[a];xm(u),l&&Mo(u,l),t&&(t.removeAttribute(h),l&&t.setAttribute(h,u.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}Ze.registerComponent("TitleBar",$M);const qM={initialDisplay:4e3,position:[],takeFocus:!1};class VM extends Ar{constructor(e,t){t=yi(qM,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=bn("button",{},{type:"button",class:this.buildCSSClass()},bn("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}Ze.registerComponent("TransientButton",VM);const Zg=n=>{const e=n.el();if(e.hasAttribute("src"))return n.triggerSourceset(e.src),!0;const t=n.$$("source"),i=[];let a="";if(!t.length)return!1;for(let l=0;l{let t={};for(let i=0;igT([n.el(),he.HTMLMediaElement.prototype,he.Element.prototype,GM],"innerHTML"),r_=function(n){const e=n.el();if(e.resetSourceWatch_)return;const t={},i=KM(n),a=l=>(...u)=>{const h=l.apply(e,u);return Zg(n),h};["append","appendChild","insertAdjacentHTML"].forEach(l=>{e[l]&&(t[l]=e[l],e[l]=a(t[l]))}),Object.defineProperty(e,"innerHTML",yi(i,{set:a(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(l=>{e[l]=t[l]}),Object.defineProperty(e,"innerHTML",i)},n.one("sourceset",e.resetSourceWatch_)},WM=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?PS(he.Element.prototype.getAttribute.call(this,"src")):""},set(n){return he.Element.prototype.setAttribute.call(this,"src",n),n}}),XM=n=>gT([n.el(),he.HTMLMediaElement.prototype,WM],"src"),YM=function(n){if(!n.featuresSourceset)return;const e=n.el();if(e.resetSourceset_)return;const t=XM(n),i=e.setAttribute,a=e.load;Object.defineProperty(e,"src",yi(t,{set:l=>{const u=t.set.call(e,l);return n.triggerSourceset(e.src),u}})),e.setAttribute=(l,u)=>{const h=i.call(e,l,u);return/src/i.test(l)&&n.triggerSourceset(e.src),h},e.load=()=>{const l=a.call(e);return Zg(n)||(n.triggerSourceset(""),r_(n)),l},e.currentSrc?n.triggerSourceset(e.currentSrc):Zg(n)||r_(n),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=a,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class Wt extends En{constructor(e,t){super(e,t);const i=e.source;let a=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const l=this.el_.childNodes;let u=l.length;const h=[];for(;u--;){const f=l[u];f.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(f),this.remoteTextTracks().addTrack(f.track),this.textTracks().addTrack(f.track),!a&&!this.el_.hasAttribute("crossorigin")&&Tm(f.src)&&(a=!0)):h.push(f))}for(let f=0;f{t=[];for(let l=0;le.removeEventListener("change",i));const a=()=>{for(let l=0;l{e.removeEventListener("change",i),e.removeEventListener("change",a),e.addEventListener("change",a)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",a)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(a=>{this.el()[`${i}Tracks`].removeEventListener(a,this[`${i}TracksListeners_`][a])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Ss[e],i=this.el()[t.getterName],a=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const l={change:h=>{const f={type:"change",target:a,currentTarget:a,srcElement:a};a.trigger(f),e==="text"&&this[Mu.remoteText.getterName]().trigger(f)},addtrack(h){a.addTrack(h.track)},removetrack(h){a.removeTrack(h.track)}},u=function(){const h=[];for(let f=0;f{const f=l[h];i.addEventListener(h,f),this.on("dispose",g=>i.removeEventListener(h,f))}),this.on("loadstart",u),this.on("dispose",h=>this.off("loadstart",u))}proxyNativeTracks_(){Ss.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),Wt.disposeMediaElement(e),e=i}else{e=Tt.createElement("video");const i=this.options_.tag&&wo(this.options_.tag),a=yi({},i);(!md||this.options_.nativeControlsForTouch!==!0)&&delete a.controls,mS(e,Object.assign(a,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Au(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&gm?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){In(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Fs&&la&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)na(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return In.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const a=bn("source",{},i);return this.el_.appendChild(a),!0}removeSourceElement(e){if(!e)return In.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return In.warn(`No matching source element found with src: ${e}`),!1}reset(){Wt.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=Tt.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),he.performance&&(e.creationTime=he.performance.now()),e}}hm(Wt,"TEST_VID",function(){if(!ju())return;const n=Tt.createElement("video"),e=Tt.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",n.appendChild(e),n});Wt.isSupported=function(){try{Wt.TEST_VID.volume=.5}catch{return!1}return!!(Wt.TEST_VID&&Wt.TEST_VID.canPlayType)};Wt.canPlayType=function(n){return Wt.TEST_VID.canPlayType(n)};Wt.canPlaySource=function(n,e){return Wt.canPlayType(n.type)};Wt.canControlVolume=function(){try{const n=Wt.TEST_VID.volume;Wt.TEST_VID.volume=n/2+.1;const e=n!==Wt.TEST_VID.volume;return e&&Er?(he.setTimeout(()=>{Wt&&Wt.prototype&&(Wt.prototype.featuresVolumeControl=n!==Wt.TEST_VID.volume)}),!1):e}catch{return!1}};Wt.canMuteVolume=function(){try{const n=Wt.TEST_VID.muted;return Wt.TEST_VID.muted=!n,Wt.TEST_VID.muted?Au(Wt.TEST_VID,"muted","muted"):bm(Wt.TEST_VID,"muted","muted"),n!==Wt.TEST_VID.muted}catch{return!1}};Wt.canControlPlaybackRate=function(){if(Fs&&la&&fm<58)return!1;try{const n=Wt.TEST_VID.playbackRate;return Wt.TEST_VID.playbackRate=n/2+.1,n!==Wt.TEST_VID.playbackRate}catch{return!1}};Wt.canOverrideAttributes=function(){try{const n=()=>{};Object.defineProperty(Tt.createElement("video"),"src",{get:n,set:n}),Object.defineProperty(Tt.createElement("audio"),"src",{get:n,set:n}),Object.defineProperty(Tt.createElement("video"),"innerHTML",{get:n,set:n}),Object.defineProperty(Tt.createElement("audio"),"innerHTML",{get:n,set:n})}catch{return!1}return!0};Wt.supportsNativeTextTracks=function(){return gm||Er&&la};Wt.supportsNativeVideoTracks=function(){return!!(Wt.TEST_VID&&Wt.TEST_VID.videoTracks)};Wt.supportsNativeAudioTracks=function(){return!!(Wt.TEST_VID&&Wt.TEST_VID.audioTracks)};Wt.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([n,e]){hm(Wt.prototype,n,()=>Wt[e](),!0)});Wt.prototype.featuresVolumeControl=Wt.canControlVolume();Wt.prototype.movingMediaElementInDOM=!Er;Wt.prototype.featuresFullscreenResize=!0;Wt.prototype.featuresProgressEvents=!0;Wt.prototype.featuresTimeupdateEvents=!0;Wt.prototype.featuresVideoFrameCallback=!!(Wt.TEST_VID&&Wt.TEST_VID.requestVideoFrameCallback);Wt.disposeMediaElement=function(n){if(n){for(n.parentNode&&n.parentNode.removeChild(n);n.hasChildNodes();)n.removeChild(n.firstChild);n.removeAttribute("src"),typeof n.load=="function"&&(function(){try{n.load()}catch{}})()}};Wt.resetMediaElement=function(n){if(!n)return;const e=n.querySelectorAll("source");let t=e.length;for(;t--;)n.removeChild(e[t]);n.removeAttribute("src"),typeof n.load=="function"&&(function(){try{n.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(n){Wt.prototype[n]=function(){return this.el_[n]||this.el_.hasAttribute(n)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(n){Wt.prototype["set"+Ki(n)]=function(e){this.el_[n]=e,e?this.el_.setAttribute(n,n):this.el_.removeAttribute(n)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(n){Wt.prototype[n]=function(){return this.el_[n]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(n){Wt.prototype["set"+Ki(n)]=function(e){this.el_[n]=e}});["pause","load","play"].forEach(function(n){Wt.prototype[n]=function(){return this.el_[n]()}});En.withSourceHandlers(Wt);Wt.nativeSourceHandler={};Wt.nativeSourceHandler.canPlayType=function(n){try{return Wt.TEST_VID.canPlayType(n)}catch{return""}};Wt.nativeSourceHandler.canHandleSource=function(n,e){if(n.type)return Wt.nativeSourceHandler.canPlayType(n.type);if(n.src){const t=Py(n.src);return Wt.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Wt.nativeSourceHandler.handleSource=function(n,e,t){e.setSrc(n.src)};Wt.nativeSourceHandler.dispose=function(){};Wt.registerSourceHandler(Wt.nativeSourceHandler);En.registerTech("Html5",Wt);const yT=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],mg={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Jg=["tiny","xsmall","small","medium","large","xlarge","huge"],mf={};Jg.forEach(n=>{const e=n.charAt(0)==="x"?`x-${n.substring(1)}`:n;mf[n]=`vjs-layout-${e}`});const QM={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Ii=class iu extends Ze{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Ts()}`,t=Object.assign(iu.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const u=e.closest("[lang]");u&&(t.language=u.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=u=>this.documentFullscreenChange_(u),this.boundFullWindowOnEscKey_=u=>this.fullWindowOnEscKey(u),this.boundUpdateStyleEl_=u=>this.updateStyleEl_(u),this.boundApplyInitTime_=u=>this.applyInitTime_(u),this.boundUpdateCurrentBreakpoint_=u=>this.updateCurrentBreakpoint_(u),this.boundHandleTechClick_=u=>this.handleTechClick_(u),this.boundHandleTechDoubleClick_=u=>this.handleTechDoubleClick_(u),this.boundHandleTechTouchStart_=u=>this.handleTechTouchStart_(u),this.boundHandleTechTouchMove_=u=>this.handleTechTouchMove_(u),this.boundHandleTechTouchEnd_=u=>this.handleTechTouchEnd_(u),this.boundHandleTechTap_=u=>this.handleTechTap_(u),this.boundUpdatePlayerHeightOnAudioOnlyMode_=u=>this.updatePlayerHeightOnAudioOnlyMode_(u),this.isFullscreen_=!1,this.log=nS(this.id_),this.fsApi_=Nf,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&wo(e),this.language(this.options_.language),t.languages){const u={};Object.getOwnPropertyNames(t.languages).forEach(function(h){u[h.toLowerCase()]=t.languages[h]}),this.languages_=u}else this.languages_=iu.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(u=>{if(typeof this[u]!="function")throw new Error(`plugin "${u}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),jy(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(ds(Tt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const a=yi(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(u=>{this[u](t.plugins[u])}),t.debug&&this.debug(!0),this.options_.playerOptions=a,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const h=new he.DOMParser().parseFromString(xM,"image/svg+xml");if(h.querySelector("parsererror"))In.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const g=h.documentElement;g.style.display="none",this.el_.appendChild(g),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new _M(this),this.addClass("vjs-spatial-navigation-enabled")),md&&this.addClass("vjs-touch-enabled"),Er||this.addClass("vjs-workinghover"),iu.players[this.id_]=this;const l=Hg.split(".")[0];this.addClass(`vjs-v${l}`),this.userActive(!0),this.reportUserActivity(),this.one("play",u=>this.listenForUserActivity_(u)),this.on("keydown",u=>this.handleKeyDown(u)),this.on("languagechange",u=>this.handleLanguagechange(u)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Cr(Tt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Cr(Tt,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),iu.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),gM(this),jr.names.forEach(e=>{const t=jr[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const a=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:a||(t=this.el_=super.createEl("div"));const l=wo(e);if(a){for(t=this.el_=e,e=this.tag=Tt.createElement("video");t.children.length;)e.appendChild(t.firstChild);rd(t,"video-js")||hl(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(f=>{try{e[f]=t[f]}catch{}})}e.setAttribute("tabindex","-1"),l.tabindex="-1",la&&mm&&(e.setAttribute("role","application"),l.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(f){a&&f==="class"||t.setAttribute(f,l[f]),a&&e.setAttribute(f,l[f])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const u=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(f=>cS[f]).map(f=>"vjs-device-"+f.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...u),he.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=kS("vjs-styles-dimensions");const f=Do(".vjs-styles-defaults"),g=Do("head");g.insertBefore(this.styleEl_,f?f.nextSibling:g.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const h=e.getElementsByTagName("a");for(let f=0;f"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){In.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const a=parseFloat(t);if(isNaN(a)){In.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=a,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Oa(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),W4(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(he.VIDEOJS_NO_DYNAMIC_STYLE===!0){const h=typeof this.width_=="number"?this.width_:this.options_.width,f=typeof this.height_=="number"?this.height_:this.options_.height,g=this.tech_&&this.tech_.el();g&&(h>=0&&(g.width=h),f>=0&&(g.height=f));return}let e,t,i,a;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const l=i.split(":"),u=l[1]/l[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/u:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*u,/^[^a-zA-Z]/.test(this.id())?a="dimensions-"+this.id():a=this.id()+"-dimensions",this.addClass(a),ES(this.styleEl_,` - .${a} { - width: ${e}px; - height: ${t}px; - } - - .${a}.vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: ${u*100}%; - } - `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Ki(e),a=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(En.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);const u={source:t,autoplay:l,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${a}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};jr.names.forEach(f=>{const g=jr[f];u[g.getterName]=this[g.privateName]}),Object.assign(u,this.options_[i]),Object.assign(u,this.options_[a]),Object.assign(u,this.options_[e.toLowerCase()]),this.tag&&(u.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(u.startTime=this.cache_.currentTime);const h=En.getTech(e);if(!h)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new h(u),this.tech_.ready(Ei(this,this.handleTechReady_),!0),Yg.jsonToTextTracks(this.textTracksJson_||[],this.tech_),yT.forEach(f=>{this.on(this.tech_,f,g=>this[`handleTech${Ki(f)}_`](g))}),Object.keys(mg).forEach(f=>{this.on(this.tech_,f,g=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${mg[f]}_`].bind(this),event:g});return}this[`handleTech${mg[f]}_`](g)})}),this.on(this.tech_,"loadstart",f=>this.handleTechLoadStart_(f)),this.on(this.tech_,"sourceset",f=>this.handleTechSourceset_(f)),this.on(this.tech_,"waiting",f=>this.handleTechWaiting_(f)),this.on(this.tech_,"ended",f=>this.handleTechEnded_(f)),this.on(this.tech_,"seeking",f=>this.handleTechSeeking_(f)),this.on(this.tech_,"play",f=>this.handleTechPlay_(f)),this.on(this.tech_,"pause",f=>this.handleTechPause_(f)),this.on(this.tech_,"durationchange",f=>this.handleTechDurationChange_(f)),this.on(this.tech_,"fullscreenchange",(f,g)=>this.handleTechFullscreenChange_(f,g)),this.on(this.tech_,"fullscreenerror",(f,g)=>this.handleTechFullscreenError_(f,g)),this.on(this.tech_,"enterpictureinpicture",f=>this.handleTechEnterPictureInPicture_(f)),this.on(this.tech_,"leavepictureinpicture",f=>this.handleTechLeavePictureInPicture_(f)),this.on(this.tech_,"error",f=>this.handleTechError_(f)),this.on(this.tech_,"posterchange",f=>this.handleTechPosterChange_(f)),this.on(this.tech_,"textdata",f=>this.handleTechTextData_(f)),this.on(this.tech_,"ratechange",f=>this.handleTechRateChange_(f)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&qg(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){jr.names.forEach(e=>{const t=jr[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Yg.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&In.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. -See https://github.com/videojs/video.js/issues/2617 for more info. -`),this.tech_}version(){return{"video.js":Hg}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const a=this.muted();this.muted(!0);const l=()=>{this.muted(a)};this.playTerminatedQueue_.push(l);const u=this.play();if(ad(u))return u.catch(h=>{throw l(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${h||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),ad(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!ad(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=vM(this,t)),this.cache_.source=yi({},e,{src:t,type:i});const a=this.cache_.sources.filter(f=>f.src&&f.src===t),l=[],u=this.$$("source"),h=[];for(let f=0;fthis.updateSourceCaches_(l);const i=this.currentSource().src,a=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(a)&&(!this.lastSource_||this.lastSource_.tech!==a&&this.lastSource_.player!==i)&&(t=()=>{}),t(a),e.src||this.tech_.any(["sourceset","loadstart"],l=>{if(l.type==="sourceset")return;const u=this.techGet_("currentSrc");this.lastSource_.tech=u,this.updateSourceCaches_(u)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?na(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),i=>i.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!Tt.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let a=Tt[this.fsApi_.fullscreenElement]===i;!a&&i.matches&&(a=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(a)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in mM)return hM(this.middleware_,this.tech_,e,t);if(e in $2)return H2(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw In(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in fM)return dM(this.middleware_,this.tech_,e);if(e in $2)return H2(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(In(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(In(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(In(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=na){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(gm||Er);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=u=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const a=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),a===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(a)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ps(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Ps(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Ps(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return LS(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,a)=>{function l(){t.off("fullscreenerror",h),t.off("fullscreenchange",u)}function u(){l(),i()}function h(g,w){l(),a(w)}t.one("fullscreenchange",u),t.one("fullscreenerror",h);const f=t.requestFullscreenHelper_(e);f&&(f.then(l,l),f.then(i,a))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function a(){e.off("fullscreenerror",u),e.off("fullscreenchange",l)}function l(){a(),t()}function u(f,g){a(),i(g)}e.one("fullscreenchange",l),e.one("fullscreenerror",u);const h=e.exitFullscreenHelper_();h&&(h.then(a,a),h.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Tt[this.fsApi_.exitFullscreen]();return e&&na(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=Tt.documentElement.style.overflow,ds(Tt,"keydown",this.boundFullWindowOnEscKey_),Tt.documentElement.style.overflow="hidden",hl(Tt.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Cr(Tt,"keydown",this.boundFullWindowOnEscKey_),Tt.documentElement.style.overflow=this.docOrigOverflow,ym(Tt.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&he.documentPictureInPicture){const e=Tt.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(bn("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),he.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(wS(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const a=i.target.querySelector(".video-js");e.parentNode.replaceChild(a,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in Tt&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(he.documentPictureInPicture&&he.documentPictureInPicture.window)return he.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in Tt)return Tt.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(a=>{const l=a.tagName.toLowerCase();if(a.isContentEditable)return!0;const u=["button","checkbox","hidden","radio","reset","submit"];return l==="input"?u.indexOf(a.type)===-1:["textarea"].indexOf(l)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=u=>e.key.toLowerCase()==="f",muteKey:a=u=>e.key.toLowerCase()==="m",playPauseKey:l=u=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const u=Ze.getComponent("FullscreenToggle");Tt[this.fsApi_.fullscreenEnabled]!==!1&&u.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),Ze.getComponent("MuteToggle").prototype.handleClick.call(this,e)):l.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Ze.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,a=this.options_.techOrder;i[h,En.getTech(h)]).filter(([h,f])=>f?f.isSupported():(In.error(`The "${h}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(h,f,g){let w;return h.some(S=>f.some(A=>{if(w=g(S,A),w)return!0})),w};let a;const l=h=>(f,g)=>h(g,f),u=([h,f],g)=>{if(f.canPlaySource(g,this.options_[h.toLowerCase()]))return{source:g,tech:h}};return this.options_.sourceOrder?a=i(e,t,l(u)):a=i(t,e,u),a||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=zS(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),uM(this,i[0],(a,l)=>{if(this.middleware_=l,t||(this.cache_.sources=i),this.updateSourceCaches_(a),this.src_(a)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}cM(l,this.tech_)}),i.length>1){const a=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},l=()=>{this.off("error",a)};this.one("error",a),this.one("playing",l),this.resetRetryOnError_=()=>{this.off("error",a),this.off("playing",l)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?MS(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();na(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Oa(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:a}=this.controlBar||{},{seekBar:l}=i||{};e&&e.updateContent(),t&&t.updateContent(),a&&a.updateContent(),l&&(l.update(),l.loadProgressBar&&l.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(No("beforeerror").forEach(t=>{const i=t(this,e);if(!(oa(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new zi(e),this.addClass("vjs-error"),In.error(`(CODE:${this.error_.code} ${zi.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),No("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const a=Ei(this,this.reportUserActivity),l=function(S){(S.screenX!==t||S.screenY!==i)&&(t=S.screenX,i=S.screenY,a())},u=function(){a(),this.clearInterval(e),e=this.setInterval(a,250)},h=function(S){a(),this.clearInterval(e)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",h),this.on("mouseleave",h);const f=this.getChild("controlBar");f&&!Er&&!Fs&&(f.on("mouseenter",function(S){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),f.on("mouseleave",function(S){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",a),this.on("keyup",a);let g;const w=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);const S=this.options_.inactivityTimeout;S<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},S))};this.setInterval(w,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(a=>{a!==t&&a.el_&&!a.hasClass("vjs-hidden")&&(a.hide(),this.audioOnlyCache_.hiddenChildren.push(a))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Oa(this)&&this.trigger("languagechange"))}languages(){return yi(iu.prototype.options_.languages,this.languages_)}toJSON(){const e=yi(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(S,!1)),this.titleBar&&this.titleBar.update({title:w,description:u||a||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),l=>({kind:l.kind,label:l.label,language:l.language,src:l.src})),a={src:t,textTracks:i};return e&&(a.poster=e,a.artwork=[{src:a.poster,type:Ff(a.poster)}]),a}return yi(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=wo(e),a=i["data-setup"];if(rd(e,"vjs-fill")&&(i.fill=!0),rd(e,"vjs-fluid")&&(i.fluid=!0),a!==null)try{Object.assign(i,JSON.parse(a||"{}"))}catch(l){In.error("data-setup",l)}if(Object.assign(t,i),e.hasChildNodes()){const l=e.childNodes;for(let u=0,h=l.length;utypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};Ii.prototype.videoTracks=()=>{};Ii.prototype.audioTracks=()=>{};Ii.prototype.textTracks=()=>{};Ii.prototype.remoteTextTracks=()=>{};Ii.prototype.remoteTextTrackEls=()=>{};jr.names.forEach(function(n){const e=jr[n];Ii.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ii.prototype.crossorigin=Ii.prototype.crossOrigin;Ii.players={};const zc=he.navigator;Ii.prototype.options_={techOrder:En.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:zc&&(zc.languages&&zc.languages[0]||zc.userLanguage||zc.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};yT.forEach(function(n){Ii.prototype[`handleTech${Ki(n)}_`]=function(){return this.trigger(n)}});Ze.registerComponent("Player",Ii);const Uf="plugin",fu="activePlugins_",su={},zf=n=>su.hasOwnProperty(n),pf=n=>zf(n)?su[n]:void 0,bT=(n,e)=>{n[fu]=n[fu]||{},n[fu][e]=!0},Hf=(n,e,t)=>{const i=(t?"before":"")+"pluginsetup";n.trigger(i,e),n.trigger(i+":"+e.name,e)},ZM=function(n,e){const t=function(){Hf(this,{name:n,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return bT(this,n),Hf(this,{name:n,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},s_=(n,e)=>(e.prototype.name=n,function(...t){Hf(this,{name:n,plugin:e,instance:null},!0);const i=new e(this,...t);return this[n]=()=>i,Hf(this,i.getEventHash()),i});class Qr{constructor(e){if(this.constructor===Qr)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),jy(this),delete this.trigger,DS(this,this.constructor.defaultState),bT(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Lu(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[fu][e]=!1,this.player=this.state=null,t[e]=s_(e,su[e])}static isBasic(e){const t=typeof e=="string"?pf(e):e;return typeof t=="function"&&!Qr.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(zf(e))In.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ii.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return su[e]=t,e!==Uf&&(Qr.isBasic(t)?Ii.prototype[e]=ZM(e,t):Ii.prototype[e]=s_(e,t)),t}static deregisterPlugin(e){if(e===Uf)throw new Error("Cannot de-register base plugin.");zf(e)&&(delete su[e],delete Ii.prototype[e])}static getPlugins(e=Object.keys(su)){let t;return e.forEach(i=>{const a=pf(i);a&&(t=t||{},t[i]=a)}),t}static getPluginVersion(e){const t=pf(e);return t&&t.VERSION||""}}Qr.getPlugin=pf;Qr.BASE_PLUGIN_NAME=Uf;Qr.registerPlugin(Uf,Qr);Ii.prototype.usingPlugin=function(n){return!!this[fu]&&this[fu][n]===!0};Ii.prototype.hasPlugin=function(n){return!!zf(n)};function JM(n,e){let t=!1;return function(...i){return t||In.warn(n),t=!0,e.apply(this,i)}}function Us(n,e,t,i){return JM(`${e} is deprecated and will be removed in ${n}.0; please use ${t} instead.`,i)}var eR={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const vT=n=>n.indexOf("#")===0?n.slice(1):n;function Fe(n,e,t){let i=Fe.getPlayer(n);if(i)return e&&In.warn(`Player "${n}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const a=typeof n=="string"?Do("#"+vT(n)):n;if(!Ou(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");const u=("getRootNode"in a?a.getRootNode()instanceof he.ShadowRoot:!1)?a.getRootNode():a.ownerDocument.body;(!a.ownerDocument.defaultView||!u.contains(a))&&In.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(a.parentNode&&a.parentNode.hasAttribute&&a.parentNode.hasAttribute("data-vjs-player")?a.parentNode:a).cloneNode(!0)),No("beforesetup").forEach(f=>{const g=f(a,yi(e));if(!oa(g)||Array.isArray(g)){In.error("please return an object in beforesetup hooks");return}e=yi(e,g)});const h=Ze.getComponent("Player");return i=new h(a,e,t),No("setup").forEach(f=>f(i)),i}Fe.hooks_=Ma;Fe.hooks=No;Fe.hook=O4;Fe.hookOnce=L4;Fe.removeHook=tS;if(he.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ju()){let n=Do(".vjs-styles-defaults");if(!n){n=kS("vjs-styles-defaults");const e=Do("head");e&&e.insertBefore(n,e.firstChild),ES(n,` - .video-js { - width: 300px; - height: 150px; - } - - .vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: 56.25% - } - `)}}Gg(1,Fe);Fe.VERSION=Hg;Fe.options=Ii.prototype.options_;Fe.getPlayers=()=>Ii.players;Fe.getPlayer=n=>{const e=Ii.players;let t;if(typeof n=="string"){const i=vT(n),a=e[i];if(a)return a;t=Do("#"+i)}else t=n;if(Ou(t)){const{player:i,playerId:a}=t;if(i||e[a])return i||e[a]}};Fe.getAllPlayers=()=>Object.keys(Ii.players).map(n=>Ii.players[n]).filter(Boolean);Fe.players=Ii.players;Fe.getComponent=Ze.getComponent;Fe.registerComponent=(n,e)=>(En.isTech(e)&&In.warn(`The ${n} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ze.registerComponent.call(Ze,n,e));Fe.getTech=En.getTech;Fe.registerTech=En.registerTech;Fe.use=lM;Object.defineProperty(Fe,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(Fe.middleware,"TERMINATOR",{value:Pf,writeable:!1,enumerable:!0});Fe.browser=cS;Fe.obj=P4;Fe.mergeOptions=Us(9,"videojs.mergeOptions","videojs.obj.merge",yi);Fe.defineLazyProperty=Us(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",hm);Fe.bind=Us(9,"videojs.bind","native Function.prototype.bind",Ei);Fe.registerPlugin=Qr.registerPlugin;Fe.deregisterPlugin=Qr.deregisterPlugin;Fe.plugin=(n,e)=>(In.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qr.registerPlugin(n,e));Fe.getPlugins=Qr.getPlugins;Fe.getPlugin=Qr.getPlugin;Fe.getPluginVersion=Qr.getPluginVersion;Fe.addLanguage=function(n,e){return n=(""+n).toLowerCase(),Fe.options.languages=yi(Fe.options.languages,{[n]:e}),Fe.options.languages[n]};Fe.log=In;Fe.createLogger=nS;Fe.time=J4;Fe.createTimeRange=Us(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ps);Fe.createTimeRanges=Us(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ps);Fe.formatTime=Us(9,"videojs.formatTime","videojs.time.formatTime",vl);Fe.setFormatTime=Us(9,"videojs.setFormatTime","videojs.time.setFormatTime",jS);Fe.resetFormatTime=Us(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",OS);Fe.parseUrl=Us(9,"videojs.parseUrl","videojs.url.parseUrl",By);Fe.isCrossOrigin=Us(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Tm);Fe.EventTarget=hs;Fe.any=Ry;Fe.on=ds;Fe.one=wm;Fe.off=Cr;Fe.trigger=Lu;Fe.xhr=Uw;Fe.TrackList=xl;Fe.TextTrack=Sd;Fe.TextTrackList=Ly;Fe.AudioTrack=FS;Fe.AudioTrackList=IS;Fe.VideoTrack=US;Fe.VideoTrackList=BS;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(n=>{Fe[n]=function(){return In.warn(`videojs.${n}() is deprecated; use videojs.dom.${n}() instead`),SS[n].apply(null,arguments)}});Fe.computedStyle=Us(9,"videojs.computedStyle","videojs.dom.computedStyle",Du);Fe.dom=SS;Fe.fn=K4;Fe.num=NM;Fe.str=Q4;Fe.url=aM;Fe.Error=eR;class tR{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}}class $f extends Fe.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new tR(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,a=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ti,n.qualityLevels.VERSION=xT,i},_T=function(n){return nR(this,Fe.obj.merge({},n))};Fe.registerPlugin("qualityLevels",_T);_T.VERSION=xT;const Kr=lm,qf=(n,e)=>e&&e.responseURL&&n!==e.responseURL?e.responseURL:n,Cs=n=>Fe.log.debug?Fe.log.debug.bind(Fe,"VHS:",`${n} >`):function(){};function ai(...n){const e=Fe.obj||Fe;return(e.merge||e.mergeOptions).apply(e,n)}function yr(...n){const e=Fe.time||Fe;return(e.createTimeRanges||e.createTimeRanges).apply(e,n)}function iR(n){if(n.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: -`;for(let t=0;t ${a}. Duration (${a-i}) -`}return e}const ia=1/30,ra=ia*3,wT=function(n,e){const t=[];let i;if(n&&n.length)for(i=0;i=e})},Zh=function(n,e){return wT(n,function(t){return t-ia>=e})},rR=function(n){if(n.length<2)return yr();const e=[];for(let t=1;t{const e=[];if(!n||!n.length)return"";for(let t=0;t "+n.end(t));return e.join(", ")},aR=function(n,e,t=1){return((n.length?n.end(n.length-1):0)-e)/t},cl=n=>{const e=[];for(let t=0;tl)){if(e>a&&e<=l){t+=l-e;continue}t+=l-a}}return t},tb=(n,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=n.partTargetDuration)}),t},ey=n=>(n.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(a,l){e.push({duration:a.duration,segmentIndex:i,partIndex:l,part:a,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),TT=n=>{const e=n.segments&&n.segments.length&&n.segments[n.segments.length-1];return e&&e.parts||[]},kT=({preloadSegment:n})=>{if(!n)return;const{parts:e,preloadHints:t}=n;let i=(t||[]).reduce((a,l)=>a+(l.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},ET=(n,e)=>{if(e.endList)return 0;if(n&&n.suggestedPresentationDelay)return n.suggestedPresentationDelay;const t=TT(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},lR=function(n,e){let t=0,i=e-n.mediaSequence,a=n.segments[i];if(a){if(typeof a.start<"u")return{result:a.start,precise:!0};if(typeof a.end<"u")return{result:a.end-a.duration,precise:!0}}for(;i--;){if(a=n.segments[i],typeof a.end<"u")return{result:t+a.end,precise:!0};if(t+=tb(n,a),typeof a.start<"u")return{result:t+a.start,precise:!0}}return{result:t,precise:!1}},uR=function(n,e){let t=0,i,a=e-n.mediaSequence;for(;a"u"&&(e=n.mediaSequence+n.segments.length),e"u"){if(n.totalDuration)return n.totalDuration;if(!n.endList)return he.Infinity}return CT(n,e,t)},od=function({defaultDuration:n,durationList:e,startIndex:t,endIndex:i}){let a=0;if(t>i&&([t,i]=[i,t]),t<0){for(let l=t;l0)for(let g=f-1;g>=0;g--){const w=h[g];if(u+=w.duration,l){if(u<0)continue}else if(u+ia<=0)continue;return{partIndex:w.partIndex,segmentIndex:w.segmentIndex,startTime:a-od({defaultDuration:n.targetDuration,durationList:h,startIndex:f,endIndex:g})}}return{partIndex:h[0]&&h[0].partIndex||null,segmentIndex:h[0]&&h[0].segmentIndex||0,startTime:e}}if(f<0){for(let g=f;g<0;g++)if(u-=n.targetDuration,u<0)return{partIndex:h[0]&&h[0].partIndex||null,segmentIndex:h[0]&&h[0].segmentIndex||0,startTime:e};f=0}for(let g=f;gia,A=u===0,C=S&&u+ia>=0;if(!((A||C)&&g!==h.length-1)){if(l){if(u>0)continue}else if(u-ia>=0)continue;return{partIndex:w.partIndex,segmentIndex:w.segmentIndex,startTime:a+od({defaultDuration:n.targetDuration,durationList:h,startIndex:f,endIndex:g})}}}return{segmentIndex:h[h.length-1].segmentIndex,partIndex:h[h.length-1].partIndex,startTime:e}},DT=function(n){return n.excludeUntil&&n.excludeUntil>Date.now()},nb=function(n){return n.excludeUntil&&n.excludeUntil===1/0},Am=function(n){const e=DT(n);return!n.disabled&&!e},hR=function(n){return n.disabled},fR=function(n){for(let e=0;e{if(n.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return n.playlists.filter(i=>Am(i)?(i.attributes.BANDWIDTH||0)!n&&!e||!n&&e||n&&!e?!1:!!(n===e||n.id&&e.id&&n.id===e.id||n.resolvedUri&&e.resolvedUri&&n.resolvedUri===e.resolvedUri||n.uri&&e.uri&&n.uri===e.uri),a_=function(n,e){const t=n&&n.mediaGroups&&n.mediaGroups.AUDIO||{};let i=!1;for(const a in t){for(const l in t[a])if(i=e(t[a][l]),i)break;if(i)break}return!!i},Cd=n=>{if(!n||!n.playlists||!n.playlists.length)return a_(n,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e$w(l))||a_(n,l=>ib(t,l))))return!1}return!0};var Xr={liveEdgeDelay:ET,duration:AT,seekable:cR,getMediaInfoForTime:dR,isEnabled:Am,isDisabled:hR,isExcluded:DT,isIncompatible:nb,playlistEnd:NT,isAes:fR,hasAttribute:MT,estimateSegmentRequestTime:mR,isLowestEnabledRendition:ty,isAudioOnly:Cd,playlistMatch:ib,segmentDurationWithParts:tb};const{log:RT}=Fe,mu=(n,e)=>`${n}-${e}`,jT=(n,e,t)=>`placeholder-uri-${n}-${e}-${t}`,pR=({onwarn:n,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:a=[],llhls:l})=>{const u=new nD;n&&u.on("warn",n),e&&u.on("info",e),i.forEach(g=>u.addParser(g)),a.forEach(g=>u.addTagMapper(g)),u.push(t),u.end();const h=u.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(g){h.hasOwnProperty(g)&&delete h[g]}),h.segments&&h.segments.forEach(function(g){["parts","preloadHints"].forEach(function(w){g.hasOwnProperty(w)&&delete g[w]})})),!h.targetDuration){let g=10;h.segments&&h.segments.length&&(g=h.segments.reduce((w,S)=>Math.max(w,S.duration),0)),n&&n({message:`manifest has no targetDuration defaulting to ${g}`}),h.targetDuration=g}const f=TT(h);if(f.length&&!h.partTargetDuration){const g=f.reduce((w,S)=>Math.max(w,S.duration),0);n&&(n({message:`manifest has no partTargetDuration defaulting to ${g}`}),RT.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),h.partTargetDuration=g}return h},Fu=(n,e)=>{n.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(n.mediaGroups[t])for(const i in n.mediaGroups[t])for(const a in n.mediaGroups[t][i]){const l=n.mediaGroups[t][i][a];e(l,t,i,a)}})},OT=({playlist:n,uri:e,id:t})=>{n.id=t,n.playlistErrors_=0,e&&(n.uri=e),n.attributes=n.attributes||{}},gR=n=>{let e=n.playlists.length;for(;e--;){const t=n.playlists[e];OT({playlist:t,id:mu(e,t.uri)}),t.resolvedUri=Kr(n.uri,t.uri),n.playlists[t.id]=t,n.playlists[t.uri]=t,t.attributes.BANDWIDTH||RT.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},yR=n=>{Fu(n,e=>{e.uri&&(e.resolvedUri=Kr(n.uri,e.uri))})},bR=(n,e)=>{const t=mu(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:he.location.href,resolvedUri:he.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},LT=(n,e,t=jT)=>{n.uri=e;for(let a=0;a{if(!a.playlists||!a.playlists.length){if(i&&l==="AUDIO"&&!a.uri)for(let f=0;f(a.set(l.id,l),a),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,a)=>{if(!this.processedDateRanges_.has(a)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const l=e[i.class].push(i);i.classListIndex=l-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const a=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&a[i.classListIndex+1]?i.endTime=a[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,a)=>{i.startDate.getTime(){const a=e.status<200||e.status>299,l=e.status>=400&&e.status<=499,u={uri:e.uri,requestType:n},h=a&&!l||i;if(t&&l)u.error=tr({},t),u.errorType=Fe.Error.NetworkRequestFailed;else if(e.aborted)u.errorType=Fe.Error.NetworkRequestAborted;else if(e.timedout)u.errorType=Fe.Error.NetworkRequestTimeout;else if(h){const f=i?Fe.Error.NetworkBodyParserFailed:Fe.Error.NetworkBadStatus;u.errorType=f,u.status=e.status,u.headers=e.headers}return u},vR=Cs("CodecUtils"),BT=function(n){const e=n.attributes||{};if(e.CODECS)return ea(e.CODECS)},PT=(n,e)=>{const t=e.attributes||{};return n&&n.mediaGroups&&n.mediaGroups.AUDIO&&t.AUDIO&&n.mediaGroups.AUDIO[t.AUDIO]},xR=(n,e)=>{if(!PT(n,e))return!0;const t=e.attributes||{},i=n.mediaGroups.AUDIO[t.AUDIO];for(const a in i)if(!i[a].uri&&!i[a].playlists)return!0;return!1},yd=function(n){const e={};return n.forEach(({mediaType:t,type:i,details:a})=>{e[t]=e[t]||[],e[t].push(Hw(`${i}${a}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){vR(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},l_=function(n){let e=0;return n.audio&&e++,n.video&&e++,e},ld=function(n,e){const t=e.attributes||{},i=yd(BT(e)||[]);if(PT(n,e)&&!i.audio&&!xR(n,e)){const a=yd(rD(n,t.AUDIO)||[]);a.audio&&(i.audio=a.audio)}return i},{EventTarget:_R}=Fe,wR=(n,e)=>{if(e.endList||!e.serverControl)return n;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let a=e.mediaSequence+e.segments.length;if(i){const l=i.parts||[],u=kT(e)-1;u>-1&&u!==l.length-1&&(t._HLS_part=u),(u>-1||l.length)&&a--}t._HLS_msn=a}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new he.URL(n);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(a){t.hasOwnProperty(a)&&i.searchParams.set(a,t[a])}),n=i.toString()}return n},SR=(n,e)=>{if(!n)return e;const t=ai(n,e);if(n.preloadHints&&!e.preloadHints&&delete t.preloadHints,n.parts&&!e.parts)delete t.parts;else if(n.parts&&e.parts)for(let i=0;i{const i=n.slice(),a=e.slice();t=t||0;const l=[];let u;for(let h=0;h{!n.resolvedUri&&n.uri&&(n.resolvedUri=Kr(e,n.uri)),n.key&&!n.key.resolvedUri&&(n.key.resolvedUri=Kr(e,n.key.uri)),n.map&&!n.map.resolvedUri&&(n.map.resolvedUri=Kr(e,n.map.uri)),n.map&&n.map.key&&!n.map.key.resolvedUri&&(n.map.key.resolvedUri=Kr(e,n.map.key.uri)),n.parts&&n.parts.length&&n.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Kr(e,t.uri))}),n.preloadHints&&n.preloadHints.length&&n.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Kr(e,t.uri))})},UT=function(n){const e=n.segments||[],t=n.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;in===e||n.segments&&e.segments&&n.segments.length===e.segments.length&&n.endList===e.endList&&n.mediaSequence===e.mediaSequence&&n.preloadSegment===e.preloadSegment,ny=(n,e,t=zT)=>{const i=ai(n,{}),a=i.playlists[e.id];if(!a||t(a,e))return null;e.segments=UT(e);const l=ai(a,e);if(l.preloadSegment&&!e.preloadSegment&&delete l.preloadSegment,a.segments){if(e.skip){e.segments=e.segments||[];for(let u=0;u{FT(u,l.resolvedUri)});for(let u=0;u{if(u.playlists)for(let w=0;w{const t=n.segments||[],i=t[t.length-1],a=i&&i.parts&&i.parts[i.parts.length-1],l=a&&a.duration||i&&i.duration;return e&&l?l*1e3:(n.partTargetDuration||n.targetDuration||10)*500},u_=(n,e,t)=>{if(!n)return;const i=[];return n.forEach(a=>{if(!a.attributes)return;const{BANDWIDTH:l,RESOLUTION:u,CODECS:h}=a.attributes;i.push({id:a.id,bandwidth:l,resolution:u,codecs:h})}),{type:e,isLive:t,renditions:i}};class ou extends _R{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Cs("PlaylistLoader");const{withCredentials:a=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=a,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const l=t.options_;this.customTagParsers=l&&l.customTagParsers||[],this.customTagMappers=l&&l.customTagMappers||[],this.llhls=l&&l.llhls,this.dateRangesStorage_=new o_,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Kr(this.main.uri,e.uri);this.llhls&&(t=wR(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,a)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:a,id:l}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[l],status:e.status,message:`HLS playlist request error at URL: ${a}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:pl({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=pR({onwarn:({message:a})=>this.logger_(`m3u8-parser warn for ${e}: ${a}`),oninfo:({message:a})=>this.logger_(`m3u8-parser info for ${e}: ${a}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:Fe.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const a=i.attributes||{},{width:l,height:u}=a.RESOLUTION||{};if(l&&u)return!0;const h=BT(i)||[];return!!yd(h).video};e.some(t)&&e.forEach(i=>{t(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:a}){this.request=null,this.state="HAVE_METADATA";const l={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:l});const u=t||this.parseManifest_({url:i,manifestString:e});u.lastRequest=Date.now(),OT({playlist:u,uri:i,id:a});const h=ny(this.main,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,h?(this.main=h,this.media_=this.main.playlists[a]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(iy(this.media(),!!h)),l.parsedPlaylist=u_(this.main.playlists,l.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:l}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),he.clearTimeout(this.mediaUpdateTimeout),he.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new o_,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(he.clearTimeout(this.finalRenditionTimeout),t){const h=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=he.setTimeout(this.media.bind(this,e,!1),h);return}const i=this.state,a=!this.media_||e.id!==this.media_.id,l=this.main.playlists[e.id];if(l&&l.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,a&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(iy(e,!0)),!a)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const u={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:u}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(h,f)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=qf(e.resolvedUri,f),h)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:u}),this.haveMetadata({playlistString:f.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=he.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=he.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=he.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:pl({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=qf(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const a=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=u_(a.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(a)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,LT(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=UT(i),i.segments.forEach(a=>{FT(a,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||he.location.href;this.main=bR(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,a=e.ID;let l=i.playlists.length;for(;l--;){const u=i.playlists[l];if(u.attributes["PATHWAY-ID"]===a){const h=u.resolvedUri,f=u.id;if(t){const g=this.createCloneURI_(u.resolvedUri,e),w=mu(a,g),S=this.createCloneAttributes_(a,u.attributes),A=this.createClonePlaylist_(u,w,e,S);i.playlists[l]=A,i.playlists[w]=A,i.playlists[g]=A}else i.playlists.splice(l,1);delete i.playlists[f],delete i.playlists[h]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,a=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(l=>{if(!(!i.mediaGroups[l]||!i.mediaGroups[l][a])){for(const u in i.mediaGroups[l])if(u===a){for(const h in i.mediaGroups[l][u])i.mediaGroups[l][u][h].playlists.forEach((g,w)=>{const S=i.playlists[g.id],A=S.id,C=S.resolvedUri;delete i.playlists[A],delete i.playlists[C]});delete i.mediaGroups[l][u]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,a=i.playlists.length,l=this.createCloneURI_(t.resolvedUri,e),u=mu(e.ID,l),h=this.createCloneAttributes_(e.ID,t.attributes),f=this.createClonePlaylist_(t,u,e,h);i.playlists[a]=f,i.playlists[u]=f,i.playlists[l]=f,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],a=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(l=>{if(!(!a.mediaGroups[l]||a.mediaGroups[l][t]))for(const u in a.mediaGroups[l]){if(u===i)a.mediaGroups[l][t]={};else continue;for(const h in a.mediaGroups[l][u]){const f=a.mediaGroups[l][u][h];a.mediaGroups[l][t][h]=tr({},f);const g=a.mediaGroups[l][t][h],w=this.createCloneURI_(f.resolvedUri,e);g.resolvedUri=w,g.uri=w,g.playlists=[],f.playlists.forEach((S,A)=>{const C=a.playlists[S.id],j=jT(l,t,h),k=mu(t,j);if(C&&!a.playlists[k]){const B=this.createClonePlaylist_(C,k,e),V=B.resolvedUri;a.playlists[k]=B,a.playlists[V]=B}g.playlists[A]=this.createClonePlaylist_(S,k,e)})}}})}createClonePlaylist_(e,t,i,a){const l=this.createCloneURI_(e.resolvedUri,i),u={resolvedUri:l,uri:l,id:t};return e.segments&&(u.segments=[]),a&&(u.attributes=a),ai(e,u)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const a=t["URI-REPLACEMENT"].PARAMS;for(const l of Object.keys(a))i.searchParams.set(l,a[l]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(a=>{t[a]&&(i[a]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const a=e.contentProtection[i].attributes.keyId;t.add(a.toLowerCase())}return t}}const ry=function(n,e,t,i){const a=n.responseType==="arraybuffer"?n.response:n.responseText;!e&&a&&(n.responseTime=Date.now(),n.roundTripTime=n.responseTime-n.requestTime,n.bytesReceived=a.byteLength||a.length,n.bandwidth||(n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3))),t.headers&&(n.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(n.timedout=!0),!e&&!n.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(n&&(a||n.responseText)))),i(e,n)},kR=(n,e)=>{if(!n||!n.size)return;let t=e;return n.forEach(i=>{t=i(t)}),t},ER=(n,e,t,i)=>{!n||!n.size||n.forEach(a=>{a(e,t,i)})},HT=function(){const n=function e(t,i){t=ai({timeout:45e3},t);const a=e.beforeRequest||Fe.Vhs.xhr.beforeRequest,l=e._requestCallbackSet||Fe.Vhs.xhr._requestCallbackSet||new Set,u=e._responseCallbackSet||Fe.Vhs.xhr._responseCallbackSet;a&&typeof a=="function"&&(Fe.log.warn("beforeRequest is deprecated, use onRequest instead."),l.add(a));const h=Fe.Vhs.xhr.original===!0?Fe.xhr:Fe.Vhs.xhr,f=kR(l,t);l.delete(a);const g=h(f||t,function(S,A){return ER(u,g,S,A),ry(g,S,A,i)}),w=g.abort;return g.abort=function(){return g.aborted=!0,w.apply(g,arguments)},g.uri=t.uri,g.requestType=t.requestType,g.requestTime=Date.now(),g};return n.original=!0,n},CR=function(n){let e;const t=n.offset;return typeof n.offset=="bigint"||typeof n.length=="bigint"?e=he.BigInt(n.offset)+he.BigInt(n.length)-he.BigInt(1):e=n.offset+n.length-1,"bytes="+t+"-"+e},sy=function(n){const e={};return n.byterange&&(e.Range=CR(n.byterange)),e},AR=function(n,e){return n.start(e)+"-"+n.end(e)},NR=function(n,e){const t=n.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},DR=function(n){return n>=32&&n<126?String.fromCharCode(n):"."},$T=function(n){const e={};return Object.keys(n).forEach(t=>{const i=n[t];Vw(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},Vf=function(n){const e=n.byterange||{length:1/0,offset:0};return[e.length,e.offset,n.resolvedUri].join(",")},qT=function(n){return n.resolvedUri},VT=n=>{const e=Array.prototype.slice.call(n),t=16;let i="",a,l;for(let u=0;uVT(n),RR=n=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,a=e.videoTimingInfo.transmuxedPresentationStart+t,l=n-a;return new Date(e.dateTimeObject.getTime()+l*1e3)},LR=n=>n.transmuxedPresentationEnd-n.transmuxedPresentationStart-n.transmuxerPrependedSeconds,IR=(n,e)=>{let t;try{t=new Date(n)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(th?null:(t>new Date(l)&&(i=a),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Xr.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},BR=(n,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let l=0;lt){if(n>t+a.duration*GT)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},PR=(n,e)=>{let t,i;try{t=new Date(n),i=new Date(e)}catch{}const a=t.getTime();return(i.getTime()-a)/1e3},FR=n=>{if(!n.segments||n.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!n||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=BR(e,n);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const a={mediaSeconds:e},l=OR(e,i.segment);return l&&(a.programDateTime=l.toISOString()),t(null,a)},KT=({programTime:n,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:a=!0,tech:l,callback:u})=>{if(!u)throw new Error("seekToProgramTime: callback must be provided");if(typeof n>"u"||!e||!i)return u({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!l.hasStarted_)return u({message:"player must be playing a live stream to start buffering"});if(!FR(e))return u({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const h=IR(n,e);if(!h)return u({message:`${n} was not found in the stream`});const f=h.segment,g=PR(f.dateTimeObject,n);if(h.type==="estimate"){if(t===0)return u({message:`${n} is not buffered yet. Try again`});i(h.estimatedStart+g),l.one("seeked",()=>{KT({programTime:n,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:a,tech:l,callback:u})});return}const w=f.start+g,S=()=>u(null,l.currentTime());l.one("seeked",S),a&&l.pause(),i(w)},gg=(n,e)=>{if(n.readyState===4)return e()},zR=(n,e,t,i)=>{let a=[],l,u=!1;const h=function(S,A,C,j){return A.abort(),u=!0,t(S,A,C,j)},f=function(S,A){if(u)return;if(S)return S.metadata=pl({requestType:i,request:A,error:S}),h(S,A,"",a);const C=A.responseText.substring(a&&a.byteLength||0,A.responseText.length);if(a=mD(a,Gw(C,!0)),l=l||Wc(a),a.length<10||l&&a.lengthh(S,A,"",a));const j=Cy(a);return j==="ts"&&a.length<188?gg(A,()=>h(S,A,"",a)):!j&&a.length<376?gg(A,()=>h(S,A,"",a)):h(null,A,j,a)},w=e({uri:n,beforeSend(S){S.overrideMimeType("text/plain; charset=x-user-defined"),S.addEventListener("progress",function({total:A,loaded:C}){return ry(S,null,{statusCode:S.status},f)})}},function(S,A){return ry(w,S,A,f)});return w},{EventTarget:HR}=Fe,c_=function(n,e){if(!zT(n,e)||n.sidx&&e.sidx&&(n.sidx.offset!==e.sidx.offset||n.sidx.length!==e.sidx.length))return!1;if(!n.sidx&&e.sidx||n.sidx&&!e.sidx||n.segments&&!e.segments||!n.segments&&e.segments)return!1;if(!n.segments&&!e.segments)return!0;for(let t=0;t{const a=i.attributes.NAME||t;return`placeholder-uri-${n}-${e}-${a}`},qR=({mainXml:n,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:a})=>{const l=h4(n,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:a});return LT(l,e,$R),l},VR=(n,e)=>{Fu(n,(t,i,a,l)=>{(!e.mediaGroups[i][a]||!(l in e.mediaGroups[i][a]))&&delete n.mediaGroups[i][a][l]})},GR=(n,e,t)=>{let i=!0,a=ai(n,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let l=0;l{if(l.playlists&&l.playlists.length){const g=l.playlists[0].id,w=ny(a,l.playlists[0],c_);w&&(a=w,f in a.mediaGroups[u][h]||(a.mediaGroups[u][h][f]=l),a.mediaGroups[u][h][f].playlists[0]=a.playlists[g],i=!1)}}),VR(a,e),e.minimumUpdatePeriod!==n.minimumUpdatePeriod&&(i=!1),i?null:a},KR=(n,e)=>(!n.map&&!e.map||!!(n.map&&e.map&&n.map.byterange.offset===e.map.byterange.offset&&n.map.byterange.length===e.map.byterange.length))&&n.uri===e.uri&&n.byterange.offset===e.byterange.offset&&n.byterange.length===e.byterange.length,d_=(n,e)=>{const t={};for(const i in n){const l=n[i].sidx;if(l){const u=cm(l);if(!e[u])break;const h=e[u].sidxInfo;KR(h,l)&&(t[u]=e[u])}}return t},WR=(n,e)=>{let i=d_(n.playlists,e);return Fu(n,(a,l,u,h)=>{if(a.playlists&&a.playlists.length){const f=a.playlists;i=ai(i,d_(f,e))}}),i};class ay extends HR{constructor(e,t,i={},a){super(),this.isPaused_=!0,this.mainPlaylistLoader_=a||this,a||(this.isMain_=!0);const{withCredentials:l=!1}=i;if(this.vhs_=t,this.withCredentials=l,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Cs("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const a=e.sidx&&cm(e.sidx);if(!e.sidx||!a||this.mainPlaylistLoader_.sidxMapping_[a]){he.clearTimeout(this.mediaRequest_),this.mediaRequest_=he.setTimeout(()=>i(!1),0);return}const l=qf(e.sidx.resolvedUri),u=(f,g)=>{if(this.requestErrored_(f,g,t))return;const w=this.mainPlaylistLoader_.sidxMapping_,{requestType:S}=g;let A;try{A=y4(pn(g.response).subarray(8))}catch(C){C.metadata=pl({requestType:S,request:g,parseFailure:!0}),this.requestErrored_(C,g,t);return}return w[a]={sidxInfo:e.sidx,sidx:A},Ty(e,A,e.sidx.resolvedUri),i(!0)},h="dash-sidx";this.request=zR(l,this.vhs_.xhr,(f,g,w,S)=>{if(f)return u(f,g);if(!w||w!=="mp4"){const j=w||"unknown";return u({status:g.status,message:`Unsupported ${j} container type for sidx segment at URL: ${l}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},g)}const{offset:A,length:C}=e.sidx.byterange;if(S.length>=C+A)return u(f,{response:S.subarray(A,A+C),status:g.status,uri:g.uri});this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",requestType:"dash-sidx",headers:sy({byterange:e.sidx.byterange})},u)},h)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},he.clearTimeout(this.minimumUpdatePeriodTimeout_),he.clearTimeout(this.mediaRequest_),he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,a=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,he.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(he.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,he.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=he.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){he.clearTimeout(this.mediaRequest_),this.mediaRequest_=he.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,a)=>{if(i){const{requestType:u}=a;i.metadata=pl({requestType:u,request:a,error:i})}if(this.requestErrored_(i,a)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const l=a.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=a.responseText,a.responseHeaders&&a.responseHeaders.date?this.mainLoaded_=Date.parse(a.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=qf(this.mainPlaylistLoader_.srcUrl,a),l){this.handleMain_(),this.syncClientServerClock_(()=>e(a,l));return}return e(a,l)})}syncClientServerClock_(e){const t=f4(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Kr(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,a)=>{if(!this.request)return;if(i){const{requestType:u}=a;return this.error.metadata=pl({requestType:u,request:a,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let l;t.method==="HEAD"?!a.responseHeaders||!a.responseHeaders.date?l=this.mainLoaded_:l=Date.parse(a.responseHeaders.date):l=Date.parse(a.responseText),this.mainPlaylistLoader_.clientOffset_=l-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){he.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=qR({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(l){this.error=l,this.error.metadata={errorType:Fe.Error.StreamingDashManifestParserError,error:l},this.trigger("error")}e&&(i=GR(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const a=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(a&&a!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=a),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:l,endList:u}=i,h=[];i.playlists.forEach(g=>{h.push({id:g.id,bandwidth:g.attributes.BANDWIDTH,resolution:g.attributes.RESOLUTION,codecs:g.attributes.CODECS})});const f={duration:l,isLive:!u,renditions:h};t.parsedManifest=f,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(he.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=he.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=WR(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const a=()=>{this.media().endList||(this.mediaUpdateTimeout=he.setTimeout(()=>{this.trigger("mediaupdatetimeout"),a()},iy(this.media(),!!i)))};a()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const a=e.contentProtection[i].attributes["cenc:default_KID"];a&&t.add(a.replace(/-/g,"").toLowerCase())}return t}}}var pr={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const XR=n=>{const e=new Uint8Array(new ArrayBuffer(n.length));for(let t=0;t-1):!1},this.trigger=function(v){var _,x,T,N;if(_=p[v],!!_)if(arguments.length===2)for(T=_.length,x=0;x"u")){for(p in Q)Q.hasOwnProperty(p)&&(Q[p]=[p.charCodeAt(0),p.charCodeAt(1),p.charCodeAt(2),p.charCodeAt(3)]);ue=new Uint8Array([105,115,111,109]),$=new Uint8Array([97,118,99,49]),se=new Uint8Array([0,0,0,1]),F=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),X=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),le={video:F,audio:X},pe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),we=new Uint8Array([0,0,0,0,0,0,0,0]),Be=we,Ve=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Oe=we,de=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),h=function(p){var v=[],_=0,x,T,N;for(x=1;x>>1,p.samplingfrequencyindex<<7|p.channelcount<<3,6,1,2]))},w=function(){return h(Q.ftyp,ue,se,ue,$)},G=function(p){return h(Q.hdlr,le[p])},S=function(p){return h(Q.mdat,p)},Y=function(p){var v=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,p.duration>>>24&255,p.duration>>>16&255,p.duration>>>8&255,p.duration&255,85,196,0,0]);return p.samplerate&&(v[12]=p.samplerate>>>24&255,v[13]=p.samplerate>>>16&255,v[14]=p.samplerate>>>8&255,v[15]=p.samplerate&255),h(Q.mdhd,v)},ie=function(p){return h(Q.mdia,Y(p),G(p.type),C(p))},A=function(p){return h(Q.mfhd,new Uint8Array([0,0,0,0,(p&4278190080)>>24,(p&16711680)>>16,(p&65280)>>8,p&255]))},C=function(p){return h(Q.minf,p.type==="video"?h(Q.vmhd,de):h(Q.smhd,L),f(),re(p))},j=function(p,v){for(var _=[],x=v.length;x--;)_[x]=R(v[x]);return h.apply(null,[Q.moof,A(p)].concat(_))},k=function(p){for(var v=p.length,_=[];v--;)_[v]=W(p[v]);return h.apply(null,[Q.moov,V(4294967295)].concat(_).concat(B(p)))},B=function(p){for(var v=p.length,_=[];v--;)_[v]=ee(p[v]);return h.apply(null,[Q.mvex].concat(_))},V=function(p){var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(p&4278190080)>>24,(p&16711680)>>16,(p&65280)>>8,p&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return h(Q.mvhd,v)},O=function(p){var v=p.samples||[],_=new Uint8Array(4+v.length),x,T;for(T=0;T>>8),N.push(x[J].byteLength&255),N=N.concat(Array.prototype.slice.call(x[J]));for(J=0;J>>8),K.push(T[J].byteLength&255),K=K.concat(Array.prototype.slice.call(T[J]));if(oe=[Q.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(_.width&65280)>>8,_.width&255,(_.height&65280)>>8,_.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h(Q.avcC,new Uint8Array([1,_.profileIdc,_.profileCompatibility,_.levelIdc,255].concat([x.length],N,[T.length],K))),h(Q.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],_.sarRatio){var me=_.sarRatio[0],Ae=_.sarRatio[1];oe.push(h(Q.pasp,new Uint8Array([(me&4278190080)>>24,(me&16711680)>>16,(me&65280)>>8,me&255,(Ae&4278190080)>>24,(Ae&16711680)>>16,(Ae&65280)>>8,Ae&255])))}return h.apply(null,oe)},v=function(_){return h(Q.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(_.channelcount&65280)>>8,_.channelcount&255,(_.samplesize&65280)>>8,_.samplesize&255,0,0,0,0,(_.samplerate&65280)>>8,_.samplerate&255,0,0]),g(_))}})(),H=function(p){var v=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,0,(p.duration&4278190080)>>24,(p.duration&16711680)>>16,(p.duration&65280)>>8,p.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(p.width&65280)>>8,p.width&255,0,0,(p.height&65280)>>8,p.height&255,0,0]);return h(Q.tkhd,v)},R=function(p){var v,_,x,T,N,K,J;return v=h(Q.tfhd,new Uint8Array([0,0,0,58,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),K=Math.floor(p.baseMediaDecodeTime/u),J=Math.floor(p.baseMediaDecodeTime%u),_=h(Q.tfdt,new Uint8Array([1,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255])),N=92,p.type==="audio"?(x=q(p,N),h(Q.traf,v,_,x)):(T=O(p),x=q(p,T.length+N),h(Q.traf,v,_,x,T))},W=function(p){return p.duration=p.duration||4294967295,h(Q.trak,H(p),ie(p))},ee=function(p){var v=new Uint8Array([0,0,0,0,(p.id&4278190080)>>24,(p.id&16711680)>>16,(p.id&65280)>>8,p.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return p.type!=="video"&&(v[v.length-1]=0),h(Q.trex,v)},(function(){var p,v,_;_=function(x,T){var N=0,K=0,J=0,oe=0;return x.length&&(x[0].duration!==void 0&&(N=1),x[0].size!==void 0&&(K=2),x[0].flags!==void 0&&(J=4),x[0].compositionTimeOffset!==void 0&&(oe=8)),[0,0,N|K|J|oe,1,(x.length&4278190080)>>>24,(x.length&16711680)>>>16,(x.length&65280)>>>8,x.length&255,(T&4278190080)>>>24,(T&16711680)>>>16,(T&65280)>>>8,T&255]},v=function(x,T){var N,K,J,oe,me,Ae;for(oe=x.samples||[],T+=20+16*oe.length,J=_(oe,T),K=new Uint8Array(J.length+oe.length*16),K.set(J),N=J.length,Ae=0;Ae>>24,K[N++]=(me.duration&16711680)>>>16,K[N++]=(me.duration&65280)>>>8,K[N++]=me.duration&255,K[N++]=(me.size&4278190080)>>>24,K[N++]=(me.size&16711680)>>>16,K[N++]=(me.size&65280)>>>8,K[N++]=me.size&255,K[N++]=me.flags.isLeading<<2|me.flags.dependsOn,K[N++]=me.flags.isDependedOn<<6|me.flags.hasRedundancy<<4|me.flags.paddingValue<<1|me.flags.isNonSyncSample,K[N++]=me.flags.degradationPriority&61440,K[N++]=me.flags.degradationPriority&15,K[N++]=(me.compositionTimeOffset&4278190080)>>>24,K[N++]=(me.compositionTimeOffset&16711680)>>>16,K[N++]=(me.compositionTimeOffset&65280)>>>8,K[N++]=me.compositionTimeOffset&255;return h(Q.trun,K)},p=function(x,T){var N,K,J,oe,me,Ae;for(oe=x.samples||[],T+=20+8*oe.length,J=_(oe,T),N=new Uint8Array(J.length+oe.length*8),N.set(J),K=J.length,Ae=0;Ae>>24,N[K++]=(me.duration&16711680)>>>16,N[K++]=(me.duration&65280)>>>8,N[K++]=me.duration&255,N[K++]=(me.size&4278190080)>>>24,N[K++]=(me.size&16711680)>>>16,N[K++]=(me.size&65280)>>>8,N[K++]=me.size&255;return h(Q.trun,N)},q=function(x,T){return x.type==="audio"?p(x,T):v(x,T)}})();var Te={ftyp:w,mdat:S,moof:j,moov:k,initSegment:function(p){var v=w(),_=k(p),x;return x=new Uint8Array(v.byteLength+_.byteLength),x.set(v),x.set(_,v.byteLength),x}},_t=function(p){var v,_,x=[],T=[];for(T.byteLength=0,T.nalCount=0,T.duration=0,x.byteLength=0,v=0;v1&&(v=p.shift(),p.byteLength-=v.byteLength,p.nalCount-=v.nalCount,p[0][0].dts=v.dts,p[0][0].pts=v.pts,p[0][0].duration+=v.duration),p},Ne=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Se=function(p,v){var _=Ne();return _.dataOffset=v,_.compositionTimeOffset=p.pts-p.dts,_.duration=p.duration,_.size=4*p.length,_.size+=p.byteLength,p.keyFrame&&(_.flags.dependsOn=2,_.flags.isNonSyncSample=0),_},Ie=function(p,v){var _,x,T,N,K,J=v||0,oe=[];for(_=0;_It.ONE_SECOND_IN_TS/2))){for(me=mn()[p.samplerate],me||(me=v[0].data),Ae=0;Ae=_?p:(v.minSegmentDts=1/0,p.filter(function(x){return x.dts>=_?(v.minSegmentDts=Math.min(v.minSegmentDts,x.dts),v.minSegmentPts=v.minSegmentDts,!0):!1}))},Sn=function(p){var v,_,x=[];for(v=0;v=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(p),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Zt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Zt.prototype.addText=function(p){this.rows[this.rowIdx]+=p},Zt.prototype.backspace=function(){if(!this.isEmpty()){var p=this.rows[this.rowIdx];this.rows[this.rowIdx]=p.substr(0,p.length-1)}};var zt=function(p,v,_){this.serviceNum=p,this.text="",this.currentWindow=new Zt(-1),this.windows=[],this.stream=_,typeof v=="string"&&this.createTextDecoder(v)};zt.prototype.init=function(p,v){this.startPts=p;for(var _=0;_<8;_++)this.windows[_]=new Zt(_),typeof v=="function"&&(this.windows[_].beforeRowOverflow=v)},zt.prototype.setCurrentWindow=function(p){this.currentWindow=this.windows[p]},zt.prototype.createTextDecoder=function(p){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(p)}catch(v){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+p+" encoding. "+v})}};var Pt=function(p){p=p||{},Pt.prototype.init.call(this);var v=this,_=p.captionServices||{},x={},T;Object.keys(_).forEach(N=>{T=_[N],/^SERVICE/.test(N)&&(x[N]=T.encoding)}),this.serviceEncodings=x,this.current708Packet=null,this.services={},this.push=function(N){N.type===3?(v.new708Packet(),v.add708Bytes(N)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(N))}};Pt.prototype=new Cn,Pt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Pt.prototype.add708Bytes=function(p){var v=p.ccData,_=v>>>8,x=v&255;this.current708Packet.ptsVals.push(p.pts),this.current708Packet.data.push(_),this.current708Packet.data.push(x)},Pt.prototype.push708Packet=function(){var p=this.current708Packet,v=p.data,_=null,x=null,T=0,N=v[T++];for(p.seq=N>>6,p.sizeCode=N&63;T>5,x=N&31,_===7&&x>0&&(N=v[T++],_=N),this.pushServiceBlock(_,T,x),x>0&&(T+=x-1)},Pt.prototype.pushServiceBlock=function(p,v,_){var x,T=v,N=this.current708Packet.data,K=this.services[p];for(K||(K=this.initService(p,T));T("0"+(Vt&255).toString(16)).slice(-2)).join("")}if(T?(Xe=[J,oe],p++):Xe=[J],v.textDecoder_&&!x)Ae=v.textDecoder_.decode(new Uint8Array(Xe));else if(T){const it=jt(Xe);Ae=String.fromCharCode(parseInt(it,16))}else Ae=qt(K|J);return me.pendingNewLine&&!me.isEmpty()&&me.newLine(this.getPts(p)),me.pendingNewLine=!1,me.addText(Ae),p},Pt.prototype.multiByteCharacter=function(p,v){var _=this.current708Packet.data,x=_[p+1],T=_[p+2];return Bt(x)&&Bt(T)&&(p=this.handleText(++p,v,{isMultiByte:!0})),p},Pt.prototype.setCurrentWindow=function(p,v){var _=this.current708Packet.data,x=_[p],T=x&7;return v.setCurrentWindow(T),p},Pt.prototype.defineWindow=function(p,v){var _=this.current708Packet.data,x=_[p],T=x&7;v.setCurrentWindow(T);var N=v.currentWindow;return x=_[++p],N.visible=(x&32)>>5,N.rowLock=(x&16)>>4,N.columnLock=(x&8)>>3,N.priority=x&7,x=_[++p],N.relativePositioning=(x&128)>>7,N.anchorVertical=x&127,x=_[++p],N.anchorHorizontal=x,x=_[++p],N.anchorPoint=(x&240)>>4,N.rowCount=x&15,x=_[++p],N.columnCount=x&63,x=_[++p],N.windowStyle=(x&56)>>3,N.penStyle=x&7,N.virtualRowCount=N.rowCount+1,p},Pt.prototype.setWindowAttributes=function(p,v){var _=this.current708Packet.data,x=_[p],T=v.currentWindow.winAttr;return x=_[++p],T.fillOpacity=(x&192)>>6,T.fillRed=(x&48)>>4,T.fillGreen=(x&12)>>2,T.fillBlue=x&3,x=_[++p],T.borderType=(x&192)>>6,T.borderRed=(x&48)>>4,T.borderGreen=(x&12)>>2,T.borderBlue=x&3,x=_[++p],T.borderType+=(x&128)>>5,T.wordWrap=(x&64)>>6,T.printDirection=(x&48)>>4,T.scrollDirection=(x&12)>>2,T.justify=x&3,x=_[++p],T.effectSpeed=(x&240)>>4,T.effectDirection=(x&12)>>2,T.displayEffect=x&3,p},Pt.prototype.flushDisplayed=function(p,v){for(var _=[],x=0;x<8;x++)v.windows[x].visible&&!v.windows[x].isEmpty()&&_.push(v.windows[x].getText());v.endPts=p,v.text=_.join(` - -`),this.pushCaption(v),v.startPts=p},Pt.prototype.pushCaption=function(p){p.text!==""&&(this.trigger("data",{startPts:p.startPts,endPts:p.endPts,text:p.text,stream:"cc708_"+p.serviceNum}),p.text="",p.startPts=p.endPts)},Pt.prototype.displayWindows=function(p,v){var _=this.current708Packet.data,x=_[++p],T=this.getPts(p);this.flushDisplayed(T,v);for(var N=0;N<8;N++)x&1<>4,T.offset=(x&12)>>2,T.penSize=x&3,x=_[++p],T.italics=(x&128)>>7,T.underline=(x&64)>>6,T.edgeType=(x&56)>>3,T.fontStyle=x&7,p},Pt.prototype.setPenColor=function(p,v){var _=this.current708Packet.data,x=_[p],T=v.currentWindow.penColor;return x=_[++p],T.fgOpacity=(x&192)>>6,T.fgRed=(x&48)>>4,T.fgGreen=(x&12)>>2,T.fgBlue=x&3,x=_[++p],T.bgOpacity=(x&192)>>6,T.bgRed=(x&48)>>4,T.bgGreen=(x&12)>>2,T.bgBlue=x&3,x=_[++p],T.edgeRed=(x&48)>>4,T.edgeGreen=(x&12)>>2,T.edgeBlue=x&3,p},Pt.prototype.setPenLocation=function(p,v){var _=this.current708Packet.data,x=_[p],T=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,x=_[++p],T.row=x&15,x=_[++p],T.column=x&63,p},Pt.prototype.reset=function(p,v){var _=this.getPts(p);return this.flushDisplayed(_,v),this.initService(v.serviceNum,p)};var Nn={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ft=function(p){return p===null?"":(p=Nn[p]||p,String.fromCharCode(p))},Qn=14,Xn=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Gn=function(){for(var p=[],v=Qn+1;v--;)p.push({text:"",indent:0,offset:0});return p},ln=function(p,v){ln.prototype.init.call(this),this.field_=p||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(_){var x,T,N,K,J;if(x=_.ccData&32639,x===this.lastControlCode_){this.lastControlCode_=null;return}if((x&61440)===4096?this.lastControlCode_=x:x!==this.PADDING_&&(this.lastControlCode_=null),N=x>>>8,K=x&255,x!==this.PADDING_)if(x===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(x===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(_.pts),this.flushDisplayed(_.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=_.pts;else if(x===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(_.pts);else if(x===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(_.pts);else if(x===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(_.pts);else if(x===this.CARRIAGE_RETURN_)this.clearFormatting(_.pts),this.flushDisplayed(_.pts),this.shiftRowsUp_(),this.startPts_=_.pts;else if(x===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(x===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(_.pts),this.displayed_=Gn();else if(x===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Gn();else if(x===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(_.pts),this.displayed_=Gn()),this.mode_="paintOn",this.startPts_=_.pts;else if(this.isSpecialCharacter(N,K))N=(N&3)<<8,J=Ft(N|K),this[this.mode_](_.pts,J),this.column_++;else if(this.isExtCharacter(N,K))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),N=(N&3)<<8,J=Ft(N|K),this[this.mode_](_.pts,J),this.column_++;else if(this.isMidRowCode(N,K))this.clearFormatting(_.pts),this[this.mode_](_.pts," "),this.column_++,(K&14)===14&&this.addFormatting(_.pts,["i"]),(K&1)===1&&this.addFormatting(_.pts,["u"]);else if(this.isOffsetControlCode(N,K)){const me=K&3;this.nonDisplayed_[this.row_].offset=me,this.column_+=me}else if(this.isPAC(N,K)){var oe=Xn.indexOf(x&7968);if(this.mode_==="rollUp"&&(oe-this.rollUpRows_+1<0&&(oe=this.rollUpRows_-1),this.setRollUp(_.pts,oe)),oe!==this.row_&&oe>=0&&oe<=14&&(this.clearFormatting(_.pts),this.row_=oe),K&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(_.pts,["u"]),(x&16)===16){const me=(x&14)>>1;this.column_=me*4,this.nonDisplayed_[this.row_].indent+=me}this.isColorPAC(K)&&(K&14)===14&&this.addFormatting(_.pts,["i"])}else this.isNormalChar(N)&&(K===0&&(K=null),J=Ft(N),J+=Ft(K),this[this.mode_](_.pts,J),this.column_+=J.length)}};ln.prototype=new Cn,ln.prototype.flushDisplayed=function(p){const v=x=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+x+"."})},_=[];this.displayed_.forEach((x,T)=>{if(x&&x.text&&x.text.length){try{x.text=x.text.trim()}catch{v(T)}x.text.length&&_.push({text:x.text,line:T+1,position:10+Math.min(70,x.indent*10)+x.offset*2.5})}else x==null&&v(T)}),_.length&&this.trigger("data",{startPts:this.startPts_,endPts:p,content:_,stream:this.name_})},ln.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Gn(),this.nonDisplayed_=Gn(),this.lastControlCode_=null,this.column_=0,this.row_=Qn,this.rollUpRows_=2,this.formatting_=[]},ln.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},ln.prototype.isSpecialCharacter=function(p,v){return p===this.EXT_&&v>=48&&v<=63},ln.prototype.isExtCharacter=function(p,v){return(p===this.EXT_+1||p===this.EXT_+2)&&v>=32&&v<=63},ln.prototype.isMidRowCode=function(p,v){return p===this.EXT_&&v>=32&&v<=47},ln.prototype.isOffsetControlCode=function(p,v){return p===this.OFFSET_&&v>=33&&v<=35},ln.prototype.isPAC=function(p,v){return p>=this.BASE_&&p=64&&v<=127},ln.prototype.isColorPAC=function(p){return p>=64&&p<=79||p>=96&&p<=127},ln.prototype.isNormalChar=function(p){return p>=32&&p<=127},ln.prototype.setRollUp=function(p,v){if(this.mode_!=="rollUp"&&(this.row_=Qn,this.mode_="rollUp",this.flushDisplayed(p),this.nonDisplayed_=Gn(),this.displayed_=Gn()),v!==void 0&&v!==this.row_)for(var _=0;_"},"");this[this.mode_](p,_)},ln.prototype.clearFormatting=function(p){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(_,x){return _+""},"");this.formatting_=[],this[this.mode_](p,v)}},ln.prototype.popOn=function(p,v){var _=this.nonDisplayed_[this.row_].text;_+=v,this.nonDisplayed_[this.row_].text=_},ln.prototype.rollUp=function(p,v){var _=this.displayed_[this.row_].text;_+=v,this.displayed_[this.row_].text=_},ln.prototype.shiftRowsUp_=function(){var p;for(p=0;pv&&(_=-1);Math.abs(v-p)>rn;)p+=_*Kn;return p},ni=function(p){var v,_;ni.prototype.init.call(this),this.type_=p||Di,this.push=function(x){if(x.type==="metadata"){this.trigger("data",x);return}this.type_!==Di&&x.type!==this.type_||(_===void 0&&(_=x.dts),x.dts=oi(x.dts,_),x.pts=oi(x.pts,_),v=x.dts,this.trigger("data",x))},this.flush=function(){_=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){_=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ni.prototype=new jn;var di={TimestampRolloverStream:ni,handleRollover:oi},Ci=(p,v,_)=>{if(!p)return-1;for(var x=_;x";p.data[0]===$n.Utf8&&(_=On(p.data,0,v),!(_<0)&&(p.mimeType=ht(p.data,v,_),v=_+1,p.pictureType=p.data[v],v++,x=On(p.data,0,v),!(x<0)&&(p.description=nt(p.data,v,x),v=x+1,p.mimeType===T?p.url=ht(p.data,v,p.data.length):p.pictureData=p.data.subarray(v,p.data.length))))},"T*":function(p){p.data[0]===$n.Utf8&&(p.value=nt(p.data,1,p.data.length).replace(/\0*$/,""),p.values=p.value.split("\0"))},TXXX:function(p){var v;p.data[0]===$n.Utf8&&(v=On(p.data,0,1),v!==-1&&(p.description=nt(p.data,1,v),p.value=nt(p.data,v+1,p.data.length).replace(/\0*$/,""),p.data=p.value))},"W*":function(p){p.url=ht(p.data,0,p.data.length).replace(/\0.*$/,"")},WXXX:function(p){var v;p.data[0]===$n.Utf8&&(v=On(p.data,0,1),v!==-1&&(p.description=nt(p.data,1,v),p.url=ht(p.data,v+1,p.data.length).replace(/\0.*$/,"")))},PRIV:function(p){var v;for(v=0;v>>2;Vt*=4,Vt+=it[7]&3,Ae.timeStamp=Vt,J.pts===void 0&&J.dts===void 0&&(J.pts=Ae.timeStamp,J.dts=Ae.timeStamp),this.trigger("timestamp",Ae)}J.frames.push(Ae),oe+=10,oe+=me}while(oe<_);this.trigger("data",J)}}}},sn.prototype=new Nt;var Mn=sn,Yn=t,nr=Zn,Wn=ti,Wi=di.TimestampRolloverStream,Hi,bi,Si,Xi=188,ii=71;Hi=function(){var p=new Uint8Array(Xi),v=0;Hi.prototype.init.call(this),this.push=function(_){var x=0,T=Xi,N;for(v?(N=new Uint8Array(_.byteLength+v),N.set(p.subarray(0,v)),N.set(_,v),v=0):N=_;T>>4>1&&(K+=T[K]+1),N.pid===0)N.type="pat",p(T.subarray(K),N),this.trigger("data",N);else if(N.pid===this.pmtPid)for(N.type="pmt",p(T.subarray(K),N),this.trigger("data",N);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([T,K,N]):this.processPes_(T,K,N)},this.processPes_=function(T,N,K){K.pid===this.programMapTable.video?K.streamType=Wn.H264_STREAM_TYPE:K.pid===this.programMapTable.audio?K.streamType=Wn.ADTS_STREAM_TYPE:K.streamType=this.programMapTable["timed-metadata"][K.pid],K.type="pes",K.data=T.subarray(N),this.trigger("data",K)}},bi.prototype=new Yn,bi.STREAM_TYPES={h264:27,adts:15},Si=function(){var p=this,v=!1,_={data:[],size:0},x={data:[],size:0},T={data:[],size:0},N,K=function(oe,me){var Ae;const Xe=oe[0]<<16|oe[1]<<8|oe[2];me.data=new Uint8Array,Xe===1&&(me.packetLength=6+(oe[4]<<8|oe[5]),me.dataAlignmentIndicator=(oe[6]&4)!==0,Ae=oe[7],Ae&192&&(me.pts=(oe[9]&14)<<27|(oe[10]&255)<<20|(oe[11]&254)<<12|(oe[12]&255)<<5|(oe[13]&254)>>>3,me.pts*=4,me.pts+=(oe[13]&6)>>>1,me.dts=me.pts,Ae&64&&(me.dts=(oe[14]&14)<<27|(oe[15]&255)<<20|(oe[16]&254)<<12|(oe[17]&255)<<5|(oe[18]&254)>>>3,me.dts*=4,me.dts+=(oe[18]&6)>>>1)),me.data=oe.subarray(9+oe[8]))},J=function(oe,me,Ae){var Xe=new Uint8Array(oe.size),jt={type:me},it=0,Vt=0,_n=!1,Qi;if(!(!oe.data.length||oe.size<9)){for(jt.trackId=oe.data[0].pid,it=0;it>5,oe=((v[T+6]&3)+1)*1024,me=oe*hi/Pi[(v[T+2]&60)>>>2],v.byteLength-T>>6&3)+1,channelcount:(v[T+2]&1)<<2|(v[T+3]&192)>>>6,samplerate:Pi[(v[T+2]&60)>>>2],samplingfrequencyindex:(v[T+2]&60)>>>2,samplesize:16,data:v.subarray(T+7+K,T+N)}),_++,T+=N}typeof Ae=="number"&&(this.skipWarn_(Ae,T),Ae=null),v=v.subarray(T)}},this.flush=function(){_=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},Yi.prototype=new ir;var ae=Yi,ke;ke=function(p){var v=p.byteLength,_=0,x=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+x},this.loadWord=function(){var T=p.byteLength-v,N=new Uint8Array(4),K=Math.min(4,v);if(K===0)throw new Error("no bytes available");N.set(p.subarray(T,T+K)),_=new DataView(N.buffer).getUint32(0),x=K*8,v-=K},this.skipBits=function(T){var N;x>T?(_<<=T,x-=T):(T-=x,N=Math.floor(T/8),T-=N*8,v-=N,this.loadWord(),_<<=T,x-=T)},this.readBits=function(T){var N=Math.min(x,T),K=_>>>32-N;return x-=N,x>0?_<<=N:v>0&&this.loadWord(),N=T-N,N>0?K<>>T)!==0)return _<<=T,x-=T,T;return this.loadWord(),T+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var T=this.skipLeadingZeros();return this.readBits(T+1)-1},this.readExpGolomb=function(){var T=this.readUnsignedExpGolomb();return 1&T?1+T>>>1:-1*(T>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var pt=ke,xt=t,Rt=pt,Et,Z,ce;Z=function(){var p=0,v,_;Z.prototype.init.call(this),this.push=function(x){var T;_?(T=new Uint8Array(_.byteLength+x.data.byteLength),T.set(_),T.set(x.data,_.byteLength),_=T):_=x.data;for(var N=_.byteLength;p3&&this.trigger("data",_.subarray(p+3)),_=null,p=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Z.prototype=new xt,ce={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Et=function(){var p=new Z,v,_,x,T,N,K,J;Et.prototype.init.call(this),v=this,this.push=function(oe){oe.type==="video"&&(_=oe.trackId,x=oe.pts,T=oe.dts,p.push(oe))},p.on("data",function(oe){var me={trackId:_,pts:x,dts:T,data:oe,nalUnitTypeCode:oe[0]&31};switch(me.nalUnitTypeCode){case 5:me.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:me.nalUnitType="sei_rbsp",me.escapedRBSP=N(oe.subarray(1));break;case 7:me.nalUnitType="seq_parameter_set_rbsp",me.escapedRBSP=N(oe.subarray(1)),me.config=K(me.escapedRBSP);break;case 8:me.nalUnitType="pic_parameter_set_rbsp";break;case 9:me.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",me)}),p.on("done",function(){v.trigger("done")}),p.on("partialdone",function(){v.trigger("partialdone")}),p.on("reset",function(){v.trigger("reset")}),p.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){p.flush()},this.partialFlush=function(){p.partialFlush()},this.reset=function(){p.reset()},this.endTimeline=function(){p.endTimeline()},J=function(oe,me){var Ae=8,Xe=8,jt,it;for(jt=0;jt>4;return _=_>=0?_:0,T?_+20:_+10},U=function(p,v){return p.length-v<10||p[v]!==73||p[v+1]!==68||p[v+2]!==51?v:(v+=I(p,v),U(p,v))},te=function(p){var v=U(p,0);return p.length>=v+2&&(p[v]&255)===255&&(p[v+1]&240)===240&&(p[v+1]&22)===16},ye=function(p){return p[0]<<21|p[1]<<14|p[2]<<7|p[3]},ge=function(p,v,_){var x,T="";for(x=v;x<_;x++)T+="%"+("00"+p[x].toString(16)).slice(-2);return T},at=function(p,v,_){return unescape(ge(p,v,_))},lt=function(p,v){var _=(p[v+5]&224)>>5,x=p[v+4]<<3,T=p[v+3]&6144;return T|x|_},ut=function(p,v){return p[v]===73&&p[v+1]===68&&p[v+2]===51?"timed-metadata":p[v]&!0&&(p[v+1]&240)===240?"audio":null},Dt=function(p){for(var v=0;v+5>>2]}return null},Yt=function(p){var v,_,x,T;v=10,p[5]&64&&(v+=4,v+=ye(p.subarray(10,14)));do{if(_=ye(p.subarray(v+4,v+8)),_<1)return null;if(T=String.fromCharCode(p[v],p[v+1],p[v+2],p[v+3]),T==="PRIV"){x=p.subarray(v+10,v+_+10);for(var N=0;N>>2;return oe*=4,oe+=J[7]&3,oe}break}}v+=10,v+=_}while(v=3;){if(p[T]===73&&p[T+1]===68&&p[T+2]===51){if(p.length-T<10||(x=bt.parseId3TagSize(p,T),T+x>p.length))break;K={type:"timed-metadata",data:p.subarray(T,T+x)},this.trigger("data",K),T+=x;continue}else if((p[T]&255)===255&&(p[T+1]&240)===240){if(p.length-T<7||(x=bt.parseAdtsSize(p,T),T+x>p.length))break;J={type:"audio",data:p.subarray(T,T+x),pts:v,dts:v},this.trigger("data",J),T+=x;continue}T++}N=p.length-T,N>0?p=p.subarray(T):p=new Uint8Array},this.reset=function(){p=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){p=new Uint8Array,this.trigger("endedtimeline")}},Ut.prototype=new ft;var Jt=Ut,Qt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],wn=Qt,fi=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],fs=fi,Fi=t,Ro=Te,jo=gt,wl=St,Jr=ne,As=Bi,Oo=kt,Ad=ae,Nm=ve.H264Stream,Dm=Jt,Mm=Lt.isLikelyAacData,Uu=kt.ONE_SECOND_IN_TS,Nd=wn,Dd=fs,Sl,Pa,Tl,da,Rm=function(p,v){v.stream=p,this.trigger("log",v)},Md=function(p,v){for(var _=Object.keys(v),x=0;x<_.length;x++){var T=_[x];T==="headOfPipeline"||!v[T].on||v[T].on("log",Rm.bind(p,T))}},Rd=function(p,v){var _;if(p.length!==v.length)return!1;for(_=0;_=-1e4&&Ae<=oe&&(!Xe||me>Ae)&&(Xe=it,me=Ae)));return Xe?Xe.gop:null},this.alignGopsAtStart_=function(J){var oe,me,Ae,Xe,jt,it,Vt,_n;for(jt=J.byteLength,it=J.nalCount,Vt=J.duration,oe=me=0;oeAe.pts){oe++;continue}me++,jt-=Xe.byteLength,it-=Xe.nalCount,Vt-=Xe.duration}return me===0?J:me===J.length?null:(_n=J.slice(me),_n.byteLength=jt,_n.duration=Vt,_n.nalCount=it,_n.pts=_n[0].pts,_n.dts=_n[0].dts,_n)},this.alignGopsAtEnd_=function(J){var oe,me,Ae,Xe,jt,it;for(oe=T.length-1,me=J.length-1,jt=null,it=!1;oe>=0&&me>=0;){if(Ae=T[oe],Xe=J[me],Ae.pts===Xe.pts){it=!0;break}if(Ae.pts>Xe.pts){oe--;continue}oe===T.length-1&&(jt=me),me--}if(!it&&jt===null)return null;var Vt;if(it?Vt=me:Vt=jt,Vt===0)return J;var _n=J.slice(Vt),Qi=_n.reduce(function(Nr,Ws){return Nr.byteLength+=Ws.byteLength,Nr.duration+=Ws.duration,Nr.nalCount+=Ws.nalCount,Nr},{byteLength:0,duration:0,nalCount:0});return _n.byteLength=Qi.byteLength,_n.duration=Qi.duration,_n.nalCount=Qi.nalCount,_n.pts=_n[0].pts,_n.dts=_n[0].dts,_n},this.alignGopsWith=function(J){T=J}},Sl.prototype=new Fi,da=function(p,v){this.numberOfTracks=0,this.metadataStream=v,p=p||{},typeof p.remux<"u"?this.remuxTracks=!!p.remux:this.remuxTracks=!0,typeof p.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=p.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,da.prototype.init.call(this),this.push=function(_){if(_.content||_.text)return this.pendingCaptions.push(_);if(_.frames)return this.pendingMetadata.push(_);this.pendingTracks.push(_.track),this.pendingBytes+=_.boxes.byteLength,_.track.type==="video"&&(this.videoTrack=_.track,this.pendingBoxes.push(_.boxes)),_.track.type==="audio"&&(this.audioTrack=_.track,this.pendingBoxes.unshift(_.boxes))}},da.prototype=new Fi,da.prototype.flush=function(p){var v=0,_={captions:[],captionStreams:{},metadata:[],info:{}},x,T,N,K=0,J;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(K=this.videoTrack.timelineStartInfo.pts,Dd.forEach(function(oe){_.info[oe]=this.videoTrack[oe]},this)):this.audioTrack&&(K=this.audioTrack.timelineStartInfo.pts,Nd.forEach(function(oe){_.info[oe]=this.audioTrack[oe]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?_.type=this.pendingTracks[0].type:_.type="combined",this.emittedTracks+=this.pendingTracks.length,N=Ro.initSegment(this.pendingTracks),_.initSegment=new Uint8Array(N.byteLength),_.initSegment.set(N),_.data=new Uint8Array(this.pendingBytes),J=0;J=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},da.prototype.setRemux=function(p){this.remuxTracks=p},Tl=function(p){var v=this,_=!0,x,T;Tl.prototype.init.call(this),p=p||{},this.baseMediaDecodeTime=p.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="aac",N.metadataStream=new As.MetadataStream,N.aacStream=new Dm,N.audioTimestampRolloverStream=new As.TimestampRolloverStream("audio"),N.timedMetadataTimestampRolloverStream=new As.TimestampRolloverStream("timed-metadata"),N.adtsStream=new Ad,N.coalesceStream=new da(p,N.metadataStream),N.headOfPipeline=N.aacStream,N.aacStream.pipe(N.audioTimestampRolloverStream).pipe(N.adtsStream),N.aacStream.pipe(N.timedMetadataTimestampRolloverStream).pipe(N.metadataStream).pipe(N.coalesceStream),N.metadataStream.on("timestamp",function(K){N.aacStream.setTimestamp(K.timeStamp)}),N.aacStream.on("data",function(K){K.type!=="timed-metadata"&&K.type!=="audio"||N.audioSegmentStream||(T=T||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new Pa(T,p),N.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream),v.trigger("trackinfo",{hasAudio:!!T,hasVideo:!!x}))}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),Md(this,N)},this.setupTsPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="ts",N.metadataStream=new As.MetadataStream,N.packetStream=new As.TransportPacketStream,N.parseStream=new As.TransportParseStream,N.elementaryStream=new As.ElementaryStream,N.timestampRolloverStream=new As.TimestampRolloverStream,N.adtsStream=new Ad,N.h264Stream=new Nm,N.captionStream=new As.CaptionStream(p),N.coalesceStream=new da(p,N.metadataStream),N.headOfPipeline=N.packetStream,N.packetStream.pipe(N.parseStream).pipe(N.elementaryStream).pipe(N.timestampRolloverStream),N.timestampRolloverStream.pipe(N.h264Stream),N.timestampRolloverStream.pipe(N.adtsStream),N.timestampRolloverStream.pipe(N.metadataStream).pipe(N.coalesceStream),N.h264Stream.pipe(N.captionStream).pipe(N.coalesceStream),N.elementaryStream.on("data",function(K){var J;if(K.type==="metadata"){for(J=K.tracks.length;J--;)!x&&K.tracks[J].type==="video"?(x=K.tracks[J],x.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!T&&K.tracks[J].type==="audio"&&(T=K.tracks[J],T.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);x&&!N.videoSegmentStream&&(N.coalesceStream.numberOfTracks++,N.videoSegmentStream=new Sl(x,p),N.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),N.videoSegmentStream.on("timelineStartInfo",function(oe){T&&!p.keepOriginalTimestamps&&(T.timelineStartInfo=oe,N.audioSegmentStream.setEarliestDts(oe.dts-v.baseMediaDecodeTime))}),N.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),N.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),N.videoSegmentStream.on("baseMediaDecodeTime",function(oe){T&&N.audioSegmentStream.setVideoBaseMediaDecodeTime(oe)}),N.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),N.h264Stream.pipe(N.videoSegmentStream).pipe(N.coalesceStream)),T&&!N.audioSegmentStream&&(N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new Pa(T,p),N.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),N.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!T,hasVideo:!!x})}}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("id3Frame",function(K){K.dispatchType=N.metadataStream.dispatchType,v.trigger("id3Frame",K)}),N.coalesceStream.on("caption",this.trigger.bind(this,"caption")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),Md(this,N)},this.setBaseMediaDecodeTime=function(N){var K=this.transmuxPipeline_;p.keepOriginalTimestamps||(this.baseMediaDecodeTime=N),T&&(T.timelineStartInfo.dts=void 0,T.timelineStartInfo.pts=void 0,Jr.clearDtsInfo(T),K.audioTimestampRolloverStream&&K.audioTimestampRolloverStream.discontinuity()),x&&(K.videoSegmentStream&&(K.videoSegmentStream.gopCache_=[]),x.timelineStartInfo.dts=void 0,x.timelineStartInfo.pts=void 0,Jr.clearDtsInfo(x),K.captionStream.reset()),K.timestampRolloverStream&&K.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(N){T&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(N)},this.setRemux=function(N){var K=this.transmuxPipeline_;p.remux=N,K&&K.coalesceStream&&K.coalesceStream.setRemux(N)},this.alignGopsWith=function(N){x&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(N)},this.getLogTrigger_=function(N){var K=this;return function(J){J.stream=N,K.trigger("log",J)}},this.push=function(N){if(_){var K=Mm(N);K&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!K&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),_=!1}this.transmuxPipeline_.headOfPipeline.push(N)},this.flush=function(){_=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Tl.prototype=new Fi;var jm={Transmuxer:Tl},Om=function(p){return p>>>0},Lm=function(p){return("00"+p.toString(16)).slice(-2)},Fa={toUnsigned:Om,toHexString:Lm},Lo=function(p){var v="";return v+=String.fromCharCode(p[0]),v+=String.fromCharCode(p[1]),v+=String.fromCharCode(p[2]),v+=String.fromCharCode(p[3]),v},Od=Lo,Ld=Fa.toUnsigned,Id=Od,zu=function(p,v){var _=[],x,T,N,K,J;if(!v.length)return null;for(x=0;x1?x+T:p.byteLength,N===v[0]&&(v.length===1?_.push(p.subarray(x+8,K)):(J=zu(p.subarray(x+8,K),v.slice(1)),J.length&&(_=_.concat(J)))),x=K;return _},kl=zu,Bd=Fa.toUnsigned,Ua=l.getUint64,Im=function(p){var v={version:p[0],flags:new Uint8Array(p.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=Ua(p.subarray(4)):v.baseMediaDecodeTime=Bd(p[4]<<24|p[5]<<16|p[6]<<8|p[7]),v},Hu=Im,Bm=function(p){var v=new DataView(p.buffer,p.byteOffset,p.byteLength),_={version:p[0],flags:new Uint8Array(p.subarray(1,4)),trackId:v.getUint32(4)},x=_.flags[2]&1,T=_.flags[2]&2,N=_.flags[2]&8,K=_.flags[2]&16,J=_.flags[2]&32,oe=_.flags[0]&65536,me=_.flags[0]&131072,Ae;return Ae=8,x&&(Ae+=4,_.baseDataOffset=v.getUint32(12),Ae+=4),T&&(_.sampleDescriptionIndex=v.getUint32(Ae),Ae+=4),N&&(_.defaultSampleDuration=v.getUint32(Ae),Ae+=4),K&&(_.defaultSampleSize=v.getUint32(Ae),Ae+=4),J&&(_.defaultSampleFlags=v.getUint32(Ae)),oe&&(_.durationIsEmpty=!0),!x&&me&&(_.baseDataOffsetIsMoof=!0),_},$u=Bm,Pd=function(p){return{isLeading:(p[0]&12)>>>2,dependsOn:p[0]&3,isDependedOn:(p[1]&192)>>>6,hasRedundancy:(p[1]&48)>>>4,paddingValue:(p[1]&14)>>>1,isNonSyncSample:p[1]&1,degradationPriority:p[2]<<8|p[3]}},Io=Pd,za=Io,Pm=function(p){var v={version:p[0],flags:new Uint8Array(p.subarray(1,4)),samples:[]},_=new DataView(p.buffer,p.byteOffset,p.byteLength),x=v.flags[2]&1,T=v.flags[2]&4,N=v.flags[1]&1,K=v.flags[1]&2,J=v.flags[1]&4,oe=v.flags[1]&8,me=_.getUint32(4),Ae=8,Xe;for(x&&(v.dataOffset=_.getInt32(Ae),Ae+=4),T&&me&&(Xe={flags:za(p.subarray(Ae,Ae+4))},Ae+=4,N&&(Xe.duration=_.getUint32(Ae),Ae+=4),K&&(Xe.size=_.getUint32(Ae),Ae+=4),oe&&(v.version===1?Xe.compositionTimeOffset=_.getInt32(Ae):Xe.compositionTimeOffset=_.getUint32(Ae),Ae+=4),v.samples.push(Xe),me--);me--;)Xe={},N&&(Xe.duration=_.getUint32(Ae),Ae+=4),K&&(Xe.size=_.getUint32(Ae),Ae+=4),J&&(Xe.flags=za(p.subarray(Ae,Ae+4)),Ae+=4),oe&&(v.version===1?Xe.compositionTimeOffset=_.getInt32(Ae):Xe.compositionTimeOffset=_.getUint32(Ae),Ae+=4),v.samples.push(Xe);return v},Bo=Pm,qu={tfdt:Hu,trun:Bo},Vu={parseTfdt:qu.tfdt,parseTrun:qu.trun},Gu=function(p){for(var v=0,_=String.fromCharCode(p[v]),x="";_!=="\0";)x+=_,v++,_=String.fromCharCode(p[v]);return x+=_,x},Ku={uint8ToCString:Gu},Po=Ku.uint8ToCString,Fd=l.getUint64,Ud=function(p){var v=4,_=p[0],x,T,N,K,J,oe,me,Ae;if(_===0){x=Po(p.subarray(v)),v+=x.length,T=Po(p.subarray(v)),v+=T.length;var Xe=new DataView(p.buffer);N=Xe.getUint32(v),v+=4,J=Xe.getUint32(v),v+=4,oe=Xe.getUint32(v),v+=4,me=Xe.getUint32(v),v+=4}else if(_===1){var Xe=new DataView(p.buffer);N=Xe.getUint32(v),v+=4,K=Fd(p.subarray(v)),v+=8,oe=Xe.getUint32(v),v+=4,me=Xe.getUint32(v),v+=4,x=Po(p.subarray(v)),v+=x.length,T=Po(p.subarray(v)),v+=T.length}Ae=new Uint8Array(p.subarray(v,p.byteLength));var jt={scheme_id_uri:x,value:T,timescale:N||1,presentation_time:K,presentation_time_delta:J,event_duration:oe,id:me,message_data:Ae};return Um(_,jt)?jt:void 0},Fm=function(p,v,_,x){return p||p===0?p/v:x+_/v},Um=function(p,v){var _=v.scheme_id_uri!=="\0",x=p===0&&zd(v.presentation_time_delta)&&_,T=p===1&&zd(v.presentation_time)&&_;return!(p>1)&&x||T},zd=function(p){return p!==void 0||p!==null},zm={parseEmsgBox:Ud,scaleTime:Fm},Fo;typeof window<"u"?Fo=window:typeof n<"u"?Fo=n:typeof self<"u"?Fo=self:Fo={};var Sr=Fo,zs=Fa.toUnsigned,Ha=Fa.toHexString,Ri=kl,ha=Od,El=zm,Wu=$u,Hm=Bo,$a=Hu,Xu=l.getUint64,qa,Cl,Yu,Hs,fa,Uo,Qu,Ns=Sr,Hd=wt.parseId3Frames;qa=function(p){var v={},_=Ri(p,["moov","trak"]);return _.reduce(function(x,T){var N,K,J,oe,me;return N=Ri(T,["tkhd"])[0],!N||(K=N[0],J=K===0?12:20,oe=zs(N[J]<<24|N[J+1]<<16|N[J+2]<<8|N[J+3]),me=Ri(T,["mdia","mdhd"])[0],!me)?null:(K=me[0],J=K===0?12:20,x[oe]=zs(me[J]<<24|me[J+1]<<16|me[J+2]<<8|me[J+3]),x)},v)},Cl=function(p,v){var _;_=Ri(v,["moof","traf"]);var x=_.reduce(function(T,N){var K=Ri(N,["tfhd"])[0],J=zs(K[4]<<24|K[5]<<16|K[6]<<8|K[7]),oe=p[J]||9e4,me=Ri(N,["tfdt"])[0],Ae=new DataView(me.buffer,me.byteOffset,me.byteLength),Xe;me[0]===1?Xe=Xu(me.subarray(4,12)):Xe=Ae.getUint32(4);let jt;return typeof Xe=="bigint"?jt=Xe/Ns.BigInt(oe):typeof Xe=="number"&&!isNaN(Xe)&&(jt=Xe/oe),jt11?(T.codec+=".",T.codec+=Ha(it[9]),T.codec+=Ha(it[10]),T.codec+=Ha(it[11])):T.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(T.codec)?(it=jt.subarray(28),Vt=ha(it.subarray(4,8)),Vt==="esds"&&it.length>20&&it[19]!==0?(T.codec+="."+Ha(it[19]),T.codec+="."+Ha(it[20]>>>2&63).replace(/^0/,"")):T.codec="mp4a.40.2"):T.codec=T.codec.toLowerCase())}var _n=Ri(x,["mdia","mdhd"])[0];_n&&(T.timescale=Uo(_n)),_.push(T)}),_},Qu=function(p,v=0){var _=Ri(p,["emsg"]);return _.map(x=>{var T=El.parseEmsgBox(new Uint8Array(x)),N=Hd(T.message_data);return{cueTime:El.scaleTime(T.presentation_time,T.timescale,T.presentation_time_delta,v),duration:El.scaleTime(T.event_duration,T.timescale),frames:N}})};var Va={findBox:Ri,parseType:ha,timescale:qa,startTime:Cl,compositionStartTime:Yu,videoTrackIds:Hs,tracks:fa,getTimescaleFromMediaHeader:Uo,getEmsgID3:Qu};const{parseTrun:$d}=Vu,{findBox:qd}=Va;var Vd=Sr,$m=function(p){var v=qd(p,["moof","traf"]),_=qd(p,["mdat"]),x=[];return _.forEach(function(T,N){var K=v[N];x.push({mdat:T,traf:K})}),x},Gd=function(p,v,_){var x=v,T=_.defaultSampleDuration||0,N=_.defaultSampleSize||0,K=_.trackId,J=[];return p.forEach(function(oe){var me=$d(oe),Ae=me.samples;Ae.forEach(function(Xe){Xe.duration===void 0&&(Xe.duration=T),Xe.size===void 0&&(Xe.size=N),Xe.trackId=K,Xe.dts=x,Xe.compositionTimeOffset===void 0&&(Xe.compositionTimeOffset=0),typeof x=="bigint"?(Xe.pts=x+Vd.BigInt(Xe.compositionTimeOffset),x+=Vd.BigInt(Xe.duration)):(Xe.pts=x+Xe.compositionTimeOffset,x+=Xe.duration)}),J=J.concat(Ae)}),J},Zu={getMdatTrafPairs:$m,parseSamples:Gd},Ju=cn.discardEmulationPreventionBytes,es=Zn.CaptionStream,Ga=kl,Lr=Hu,Ka=$u,{getMdatTrafPairs:ec,parseSamples:Al}=Zu,Nl=function(p,v){for(var _=p,x=0;x0?Lr(Ae[0]).baseMediaDecodeTime:0,jt=Ga(K,["trun"]),it,Vt;v===me&&jt.length>0&&(it=Al(jt,Xe,oe),Vt=tc(N,it,me),_[me]||(_[me]={seiNals:[],logs:[]}),_[me].seiNals=_[me].seiNals.concat(Vt.seiNals),_[me].logs=_[me].logs.concat(Vt.logs))}),_},Kd=function(p,v,_){var x;if(v===null)return null;x=ma(p,v);var T=x[v]||{};return{seiNals:T.seiNals,logs:T.logs,timescale:_}},Dl=function(){var p=!1,v,_,x,T,N,K;this.isInitialized=function(){return p},this.init=function(J){v=new es,p=!0,K=J?J.isPartial:!1,v.on("data",function(oe){oe.startTime=oe.startPts/T,oe.endTime=oe.endPts/T,N.captions.push(oe),N.captionStreams[oe.stream]=!0}),v.on("log",function(oe){N.logs.push(oe)})},this.isNewInit=function(J,oe){return J&&J.length===0||oe&&typeof oe=="object"&&Object.keys(oe).length===0?!1:x!==J[0]||T!==oe[x]},this.parse=function(J,oe,me){var Ae;if(this.isInitialized()){if(!oe||!me)return null;if(this.isNewInit(oe,me))x=oe[0],T=me[x];else if(x===null||!T)return _.push(J),null}else return null;for(;_.length>0;){var Xe=_.shift();this.parse(Xe,oe,me)}return Ae=Kd(J,x,T),Ae&&Ae.logs&&(N.logs=N.logs.concat(Ae.logs)),Ae===null||!Ae.seiNals?N.logs.length?{logs:N.logs,captions:[],captionStreams:[]}:null:(this.pushNals(Ae.seiNals),this.flushStream(),N)},this.pushNals=function(J){if(!this.isInitialized()||!J||J.length===0)return null;J.forEach(function(oe){v.push(oe)})},this.flushStream=function(){if(!this.isInitialized())return null;K?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){N.captions=[],N.captionStreams={},N.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){_=[],x=null,T=null,N?this.clearParsedCaptions():N={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Wa=Dl;const{parseTfdt:qm}=Vu,$i=kl,{getTimescaleFromMediaHeader:nc}=Va,{parseSamples:Ds,getMdatTrafPairs:Wd}=Zu;var $s=function(){let p=9e4;this.init=function(v){const _=$i(v,["moov","trak","mdia","mdhd"])[0];_&&(p=nc(_))},this.parseSegment=function(v){const _=[],x=Wd(v);let T=0;return x.forEach(function(N){const K=N.mdat,J=N.traf,oe=$i(J,["tfdt"])[0],me=$i(J,["tfhd"])[0],Ae=$i(J,["trun"]);if(oe&&(T=qm(oe).baseMediaDecodeTime),Ae.length&&me){const Xe=Ds(Ae,T,me);let jt=0;Xe.forEach(function(it){const Vt="utf-8",_n=new TextDecoder(Vt),Qi=K.slice(jt,jt+it.size);if($i(Qi,["vtte"])[0]){jt+=it.size;return}$i(Qi,["vttc"]).forEach(function(qo){const ki=$i(qo,["payl"])[0],pa=$i(qo,["sttg"])[0],Ms=it.pts/p,Xs=(it.pts+it.duration)/p;let li,ms;if(ki)try{li=_n.decode(ki)}catch(fr){console.error(fr)}if(pa)try{ms=_n.decode(pa)}catch(fr){console.error(fr)}it.duration&&li&&_.push({cueText:li,start:Ms,end:Xs,settings:ms})}),jt+=it.size})}}),_}},zo=ti,rc=function(p){var v=p[1]&31;return v<<=8,v|=p[2],v},Xa=function(p){return!!(p[1]&64)},Ho=function(p){var v=0;return(p[3]&48)>>>4>1&&(v+=p[4]+1),v},Ir=function(p,v){var _=rc(p);return _===0?"pat":_===v?"pmt":v?"pes":null},Ya=function(p){var v=Xa(p),_=4+Ho(p);return v&&(_+=p[_]+1),(p[_+10]&31)<<8|p[_+11]},Qa=function(p){var v={},_=Xa(p),x=4+Ho(p);if(_&&(x+=p[x]+1),!!(p[x+5]&1)){var T,N,K;T=(p[x+1]&15)<<8|p[x+2],N=3+T-4,K=(p[x+10]&15)<<8|p[x+11];for(var J=12+K;J=p.byteLength)return null;var x=null,T;return T=p[_+7],T&192&&(x={},x.pts=(p[_+9]&14)<<27|(p[_+10]&255)<<20|(p[_+11]&254)<<12|(p[_+12]&255)<<5|(p[_+13]&254)>>>3,x.pts*=4,x.pts+=(p[_+13]&6)>>>1,x.dts=x.pts,T&64&&(x.dts=(p[_+14]&14)<<27|(p[_+15]&255)<<20|(p[_+16]&254)<<12|(p[_+17]&255)<<5|(p[_+18]&254)>>>3,x.dts*=4,x.dts+=(p[_+18]&6)>>>1)),x},Tr=function(p){switch(p){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Br=function(p){for(var v=4+Ho(p),_=p.subarray(v),x=0,T=0,N=!1,K;T<_.byteLength-3;T++)if(_[T+2]===1){x=T+5;break}for(;x<_.byteLength;)switch(_[x]){case 0:if(_[x-1]!==0){x+=2;break}else if(_[x-2]!==0){x++;break}T+3!==x-2&&(K=Tr(_[T+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0));do x++;while(_[x]!==1&&x<_.length);T=x-2,x+=3;break;case 1:if(_[x-1]!==0||_[x-2]!==0){x+=3;break}K=Tr(_[T+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0),T=x-2,x+=3;break;default:x+=3;break}return _=_.subarray(T),x-=T,T=0,_&&_.byteLength>3&&(K=Tr(_[T+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0)),N},qs={parseType:Ir,parsePat:Ya,parsePmt:Qa,parsePayloadUnitStartIndicator:Xa,parsePesType:Ml,parsePesTime:$o,videoPacketContainsKeyFrame:Br},ts=ti,br=di.handleRollover,Ln={};Ln.ts=qs,Ln.aac=Lt;var Vs=kt.ONE_SECOND_IN_TS,cr=188,Pr=71,Xd=function(p,v){for(var _=0,x=cr,T,N;x=0;){if(p[x]===Pr&&(p[T]===Pr||T===p.byteLength)){if(N=p.subarray(x,T),K=Ln.ts.parseType(N,v.pid),K==="pes"&&(J=Ln.ts.parsePesType(N,v.table),oe=Ln.ts.parsePayloadUnitStartIndicator(N),J==="audio"&&oe&&(me=Ln.ts.parsePesTime(N),me&&(me.type="audio",_.audio.push(me),Ae=!0))),Ae)break;x-=cr,T-=cr;continue}x--,T--}},vi=function(p,v,_){for(var x=0,T=cr,N,K,J,oe,me,Ae,Xe,jt,it=!1,Vt={data:[],size:0};T=0;){if(p[x]===Pr&&p[T]===Pr){if(N=p.subarray(x,T),K=Ln.ts.parseType(N,v.pid),K==="pes"&&(J=Ln.ts.parsePesType(N,v.table),oe=Ln.ts.parsePayloadUnitStartIndicator(N),J==="video"&&oe&&(me=Ln.ts.parsePesTime(N),me&&(me.type="video",_.video.push(me),it=!0))),it)break;x-=cr,T-=cr;continue}x--,T--}},Un=function(p,v){if(p.audio&&p.audio.length){var _=v;(typeof _>"u"||isNaN(_))&&(_=p.audio[0].dts),p.audio.forEach(function(N){N.dts=br(N.dts,_),N.pts=br(N.pts,_),N.dtsTime=N.dts/Vs,N.ptsTime=N.pts/Vs})}if(p.video&&p.video.length){var x=v;if((typeof x>"u"||isNaN(x))&&(x=p.video[0].dts),p.video.forEach(function(N){N.dts=br(N.dts,x),N.pts=br(N.pts,x),N.dtsTime=N.dts/Vs,N.ptsTime=N.pts/Vs}),p.firstKeyFrame){var T=p.firstKeyFrame;T.dts=br(T.dts,x),T.pts=br(T.pts,x),T.dtsTime=T.dts/Vs,T.ptsTime=T.pts/Vs}}},Gs=function(p){for(var v=!1,_=0,x=null,T=null,N=0,K=0,J;p.length-K>=3;){var oe=Ln.aac.parseType(p,K);switch(oe){case"timed-metadata":if(p.length-K<10){v=!0;break}if(N=Ln.aac.parseId3TagSize(p,K),N>p.length){v=!0;break}T===null&&(J=p.subarray(K,K+N),T=Ln.aac.parseAacTimestamp(J)),K+=N;break;case"audio":if(p.length-K<7){v=!0;break}if(N=Ln.aac.parseAdtsSize(p,K),N>p.length){v=!0;break}x===null&&(J=p.subarray(K,K+N),x=Ln.aac.parseSampleRate(J)),_++,K+=N;break;default:K++;break}if(v)return null}if(x===null||T===null)return null;var me=Vs/x,Ae={audio:[{type:"audio",dts:T,pts:T},{type:"audio",dts:T+_*1024*me,pts:T+_*1024*me}]};return Ae},Fr=function(p){var v={pid:null,table:null},_={};Xd(p,v);for(var x in v.table)if(v.table.hasOwnProperty(x)){var T=v.table[x];switch(T){case ts.H264_STREAM_TYPE:_.video=[],vi(p,v,_),_.video.length===0&&delete _.video;break;case ts.ADTS_STREAM_TYPE:_.audio=[],rr(p,v,_),_.audio.length===0&&delete _.audio;break}}return _},sc=function(p,v){var _=Ln.aac.isLikelyAacData(p),x;return _?x=Gs(p):x=Fr(p),!x||!x.audio&&!x.video?null:(Un(x,v),x)},Ks={inspect:sc,parseAudioPes_:rr};const Yd=function(p,v){v.on("data",function(_){const x=_.initSegment;_.initSegment={data:x.buffer,byteOffset:x.byteOffset,byteLength:x.byteLength};const T=_.data;_.data=T.buffer,p.postMessage({action:"data",segment:_,byteOffset:T.byteOffset,byteLength:T.byteLength},[_.data])}),v.on("done",function(_){p.postMessage({action:"done"})}),v.on("gopInfo",function(_){p.postMessage({action:"gopInfo",gopInfo:_})}),v.on("videoSegmentTimingInfo",function(_){const x={start:{decode:kt.videoTsToSeconds(_.start.dts),presentation:kt.videoTsToSeconds(_.start.pts)},end:{decode:kt.videoTsToSeconds(_.end.dts),presentation:kt.videoTsToSeconds(_.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(_.baseMediaDecodeTime)};_.prependedContentDuration&&(x.prependedContentDuration=kt.videoTsToSeconds(_.prependedContentDuration)),p.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:x})}),v.on("audioSegmentTimingInfo",function(_){const x={start:{decode:kt.videoTsToSeconds(_.start.dts),presentation:kt.videoTsToSeconds(_.start.pts)},end:{decode:kt.videoTsToSeconds(_.end.dts),presentation:kt.videoTsToSeconds(_.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(_.baseMediaDecodeTime)};_.prependedContentDuration&&(x.prependedContentDuration=kt.videoTsToSeconds(_.prependedContentDuration)),p.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:x})}),v.on("id3Frame",function(_){p.postMessage({action:"id3Frame",id3Frame:_})}),v.on("caption",function(_){p.postMessage({action:"caption",caption:_})}),v.on("trackinfo",function(_){p.postMessage({action:"trackinfo",trackInfo:_})}),v.on("audioTimingInfo",function(_){p.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:kt.videoTsToSeconds(_.start),end:kt.videoTsToSeconds(_.end)}})}),v.on("videoTimingInfo",function(_){p.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:kt.videoTsToSeconds(_.start),end:kt.videoTsToSeconds(_.end)}})}),v.on("log",function(_){p.postMessage({action:"log",log:_})})};class ac{constructor(v,_){this.options=_||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new jm.Transmuxer(this.options),Yd(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new Wa,this.captionParser.init());const _=new Uint8Array(v.data,v.byteOffset,v.byteLength),x=this.captionParser.parse(_,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:x&&x.captions||[],logs:x&&x.logs||[],data:_.buffer},[_.buffer])}initMp4WebVttParser(v){this.webVttParser||(this.webVttParser=new $s);const _=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.webVttParser.init(_)}getMp4WebVttText(v){this.webVttParser||(this.webVttParser=new $s);const _=new Uint8Array(v.data,v.byteOffset,v.byteLength),x=this.webVttParser.parseSegment(_);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:x||[],data:_.buffer},[_.buffer])}probeMp4StartTime({timescales:v,data:_}){const x=Va.startTime(v,_);this.self.postMessage({action:"probeMp4StartTime",startTime:x,data:_},[_.buffer])}probeMp4Tracks({data:v}){const _=Va.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:_,data:v},[v.buffer])}probeEmsgID3({data:v,offset:_}){const x=Va.getEmsgID3(v,_);this.self.postMessage({action:"probeEmsgID3",id3Frames:x,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:_}){const x=typeof _=="number"&&!isNaN(_)?_*kt.ONE_SECOND_IN_TS:void 0,T=Ks.inspect(v,x);let N=null;T&&(N={hasVideo:T.video&&T.video.length===2||!1,hasAudio:T.audio&&T.audio.length===2||!1},N.hasVideo&&(N.videoStart=T.video[0].ptsTime),N.hasAudio&&(N.audioStart=T.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:N,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const _=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(_)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const _=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(kt.secondsToVideoTs(_)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(kt.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(p){if(p.data.action==="init"&&p.data.options){this.messageHandlers=new ac(self,p.data.options);return}this.messageHandlers||(this.messageHandlers=new ac(self)),p.data&&p.data.action&&p.data.action!=="init"&&this.messageHandlers[p.data.action]&&this.messageHandlers[p.data.action](p.data)}}));var ZR=XT(QR);const JR=(n,e,t)=>{const{type:i,initSegment:a,captions:l,captionStreams:u,metadata:h,videoFrameDtsTime:f,videoFramePtsTime:g}=n.data.segment;e.buffer.push({captions:l,captionStreams:u,metadata:h});const w=n.data.segment.boxes||{data:n.data.segment.data},S={type:i,data:new Uint8Array(w.data,w.data.byteOffset,w.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof f<"u"&&(S.videoFrameDtsTime=f),typeof g<"u"&&(S.videoFramePtsTime=g),t(S)},ej=({transmuxedData:n,callback:e})=>{n.buffer=[],e(n)},tj=(n,e)=>{e.gopInfo=n.data.gopInfo},ZT=n=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:a,remux:l,onData:u,onTrackInfo:h,onAudioTimingInfo:f,onVideoTimingInfo:g,onVideoSegmentTimingInfo:w,onAudioSegmentTimingInfo:S,onId3:A,onCaptions:C,onDone:j,onEndedTimeline:k,onTransmuxerLog:B,isEndOfTimeline:V,segment:W,triggerSegmentEventFn:H}=n,ie={buffer:[]};let Y=V;const G=re=>{e.currentTransmux===n&&(re.data.action==="data"&&JR(re,ie,u),re.data.action==="trackinfo"&&h(re.data.trackInfo),re.data.action==="gopInfo"&&tj(re,ie),re.data.action==="audioTimingInfo"&&f(re.data.audioTimingInfo),re.data.action==="videoTimingInfo"&&g(re.data.videoTimingInfo),re.data.action==="videoSegmentTimingInfo"&&w(re.data.videoSegmentTimingInfo),re.data.action==="audioSegmentTimingInfo"&&S(re.data.audioSegmentTimingInfo),re.data.action==="id3Frame"&&A([re.data.id3Frame],re.data.id3Frame.dispatchType),re.data.action==="caption"&&C(re.data.caption),re.data.action==="endedtimeline"&&(Y=!1,k()),re.data.action==="log"&&B(re.data.log),re.data.type==="transmuxed"&&(Y||(e.onmessage=null,ej({transmuxedData:ie,callback:j}),JT(e))))},O=()=>{const re={message:"Received an error message from the transmuxer worker",metadata:{errorType:Fe.Error.StreamingFailedToTransmuxSegment,segmentInfo:ol({segment:W})}};j(null,re)};if(e.onmessage=G,e.onerror=O,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(a)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:a}),typeof l<"u"&&e.postMessage({action:"setRemux",remux:l}),t.byteLength){const re=t instanceof ArrayBuffer?t:t.buffer,E=t instanceof ArrayBuffer?0:t.byteOffset;H({type:"segmenttransmuxingstart",segment:W}),e.postMessage({action:"push",data:re,byteOffset:E,byteLength:t.byteLength},[re])}V&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},JT=n=>{n.currentTransmux=null,n.transmuxQueue.length&&(n.currentTransmux=n.transmuxQueue.shift(),typeof n.currentTransmux=="function"?n.currentTransmux():ZT(n.currentTransmux))},h_=(n,e)=>{n.postMessage({action:e}),JT(n)},ek=(n,e)=>{if(!e.currentTransmux){e.currentTransmux=n,h_(e,n);return}e.transmuxQueue.push(h_.bind(null,e,n))},nj=n=>{ek("reset",n)},ij=n=>{ek("endTimeline",n)},tk=n=>{if(!n.transmuxer.currentTransmux){n.transmuxer.currentTransmux=n,ZT(n);return}n.transmuxer.transmuxQueue.push(n)},rj=n=>{const e=new ZR;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:n}),e};var yg={reset:nj,endTimeline:ij,transmux:tk,createTransmuxer:rj};const pu=function(n){const e=n.transmuxer,t=n.endAction||n.action,i=n.callback,a=tr({},n,{endAction:null,transmuxer:null,callback:null}),l=u=>{u.data.action===t&&(e.removeEventListener("message",l),u.data.data&&(u.data.data=new Uint8Array(u.data.data,n.byteOffset||0,n.byteLength||u.data.data.byteLength),n.data&&(n.data=u.data.data)),i(u.data))};if(e.addEventListener("message",l),n.data){const u=n.data instanceof ArrayBuffer;a.byteOffset=u?0:n.data.byteOffset,a.byteLength=n.data.byteLength;const h=[u?n.data:n.data.buffer];e.postMessage(a,h)}else e.postMessage(a)},sa={FAILURE:2,TIMEOUT:-101,ABORTED:-102},nk="wvtt",oy=n=>{n.forEach(e=>{e.abort()})},sj=n=>({bandwidth:n.bandwidth,bytesReceived:n.bytesReceived||0,roundTripTime:n.roundTripTime||0}),aj=n=>{const e=n.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=n.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},rb=(n,e)=>{const{requestType:t}=e,i=pl({requestType:t,request:e,error:n});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:sa.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:sa.ABORTED,xhr:e,metadata:i}:n?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:sa.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:sa.FAILURE,xhr:e,metadata:i}:null},f_=(n,e,t,i)=>(a,l)=>{const u=l.response,h=rb(a,l);if(h)return t(h,n);if(u.byteLength!==16)return t({status:l.status,message:"Invalid HLS key at URL: "+l.uri,code:sa.FAILURE,xhr:l},n);const f=new DataView(u),g=new Uint32Array([f.getUint32(0),f.getUint32(4),f.getUint32(8),f.getUint32(12)]);for(let S=0;S{e===nk&&n.transmuxer.postMessage({action:"initMp4WebVttParser",data:n.map.bytes})},lj=(n,e,t)=>{e===nk&&pu({action:"getMp4WebVttText",data:n.bytes,transmuxer:n.transmuxer,callback:({data:i,mp4VttCues:a})=>{n.bytes=i,t(null,n,{mp4VttCues:a})}})},ik=(n,e)=>{const t=Cy(n.map.bytes);if(t!=="mp4"){const i=n.map.resolvedUri||n.map.uri,a=t||"unknown";return e({internal:!0,message:`Found unsupported ${a} container for initialization segment at URL: ${i}`,code:sa.FAILURE,metadata:{mediaType:a}})}pu({action:"probeMp4Tracks",data:n.map.bytes,transmuxer:n.transmuxer,callback:({tracks:i,data:a})=>(n.map.bytes=a,i.forEach(function(l){n.map.tracks=n.map.tracks||{},!n.map.tracks[l.type]&&(n.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(n.map.timescales=n.map.timescales||{},n.map.timescales[l.id]=l.timescale),l.type==="text"&&oj(n,l.codec))}),e(null))})},uj=({segment:n,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,a)=>{const l=rb(i,a);if(l)return e(l,n);const u=new Uint8Array(a.response);if(t({type:"segmentloaded",segment:n}),n.map.key)return n.map.encryptedBytes=u,e(null,n);n.map.bytes=u,ik(n,function(h){if(h)return h.xhr=a,h.status=a.status,e(h,n);e(null,n)})},cj=({segment:n,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(a,l)=>{const u=rb(a,l);if(u)return e(u,n);i({type:"segmentloaded",segment:n});const h=t==="arraybuffer"||!l.responseText?l.response:XR(l.responseText.substring(n.lastReachedChar||0));return n.stats=sj(l),n.key?n.encryptedBytes=new Uint8Array(h):n.bytes=new Uint8Array(h),e(null,n)},dj=({segment:n,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})=>{const j=n.map&&n.map.tracks||{},k=!!(j.audio&&j.video);let B=i.bind(null,n,"audio","start");const V=i.bind(null,n,"audio","end");let W=i.bind(null,n,"video","start");const H=i.bind(null,n,"video","end"),ie=()=>tk({bytes:e,transmuxer:n.transmuxer,audioAppendStart:n.audioAppendStart,gopsToAlignWith:n.gopsToAlignWith,remux:k,onData:Y=>{Y.type=Y.type==="combined"?"video":Y.type,w(n,Y)},onTrackInfo:Y=>{t&&(k&&(Y.isMuxed=!0),t(n,Y))},onAudioTimingInfo:Y=>{B&&typeof Y.start<"u"&&(B(Y.start),B=null),V&&typeof Y.end<"u"&&V(Y.end)},onVideoTimingInfo:Y=>{W&&typeof Y.start<"u"&&(W(Y.start),W=null),H&&typeof Y.end<"u"&&H(Y.end)},onVideoSegmentTimingInfo:Y=>{const G={pts:{start:Y.start.presentation,end:Y.end.presentation},dts:{start:Y.start.decode,end:Y.end.decode}};C({type:"segmenttransmuxingtiminginfoavailable",segment:n,timingInfo:G}),a(Y)},onAudioSegmentTimingInfo:Y=>{const G={pts:{start:Y.start.pts,end:Y.end.pts},dts:{start:Y.start.dts,end:Y.end.dts}};C({type:"segmenttransmuxingtiminginfoavailable",segment:n,timingInfo:G}),l(Y)},onId3:(Y,G)=>{u(n,Y,G)},onCaptions:Y=>{h(n,[Y])},isEndOfTimeline:f,onEndedTimeline:()=>{g()},onTransmuxerLog:A,onDone:(Y,G)=>{S&&(Y.type=Y.type==="combined"?"video":Y.type,C({type:"segmenttransmuxingcomplete",segment:n}),S(G,n,Y))},segment:n,triggerSegmentEventFn:C});pu({action:"probeTs",transmuxer:n.transmuxer,data:e,baseStartTime:n.baseStartTime,callback:Y=>{n.bytes=e=Y.data;const G=Y.result;G&&(t(n,{hasAudio:G.hasAudio,hasVideo:G.hasVideo,isMuxed:k}),t=null),ie()}})},rk=({segment:n,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})=>{let j=new Uint8Array(e);if(R4(j)){n.isFmp4=!0;const{tracks:k}=n.map;if(k.text&&(!k.audio||!k.video)){w(n,{data:j,type:"text"}),lj(n,k.text.codec,S);return}const V={isFmp4:!0,hasVideo:!!k.video,hasAudio:!!k.audio};k.audio&&k.audio.codec&&k.audio.codec!=="enca"&&(V.audioCodec=k.audio.codec),k.video&&k.video.codec&&k.video.codec!=="encv"&&(V.videoCodec=k.video.codec),k.video&&k.audio&&(V.isMuxed=!0),t(n,V);const W=(H,ie)=>{w(n,{data:j,type:V.hasAudio&&!V.isMuxed?"audio":"video"}),ie&&ie.length&&u(n,ie),H&&H.length&&h(n,H),S(null,n,{})};pu({action:"probeMp4StartTime",timescales:n.map.timescales,data:j,transmuxer:n.transmuxer,callback:({data:H,startTime:ie})=>{e=H.buffer,n.bytes=j=H,V.hasAudio&&!V.isMuxed&&i(n,"audio","start",ie),V.hasVideo&&i(n,"video","start",ie),pu({action:"probeEmsgID3",data:j,transmuxer:n.transmuxer,offset:ie,callback:({emsgData:Y,id3Frames:G})=>{if(e=Y.buffer,n.bytes=j=Y,!k.video||!Y.byteLength||!n.transmuxer){W(void 0,G);return}pu({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:n.transmuxer,data:j,timescales:n.map.timescales,trackIds:[k.video.id],callback:O=>{e=O.data.buffer,n.bytes=j=O.data,O.logs.forEach(function(re){A(ai(re,{stream:"mp4CaptionParser"}))}),W(O.captions,G)}})}})}});return}if(!n.transmuxer){S(null,n,{});return}if(typeof n.container>"u"&&(n.container=Cy(j)),n.container!=="ts"&&n.container!=="aac"){t(n,{hasAudio:!1,hasVideo:!1}),S(null,n,{});return}dj({segment:n,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})},sk=function({id:n,key:e,encryptedBytes:t,decryptionWorker:i,segment:a,doneFn:l},u){const h=g=>{if(g.data.source===n){i.removeEventListener("message",h);const w=g.data.decrypted;u(new Uint8Array(w.bytes,w.byteOffset,w.byteLength))}};i.onerror=()=>{const g="An error occurred in the decryption worker",w=ol({segment:a}),S={message:g,metadata:{error:new Error(g),errorType:Fe.Error.StreamingFailedToDecryptSegment,segmentInfo:w,keyInfo:{uri:a.key.resolvedUri||a.map.key.resolvedUri}}};l(S,a)},i.addEventListener("message",h);let f;e.bytes.slice?f=e.bytes.slice():f=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage($T({source:n,encrypted:t,key:f,iv:e.iv}),[t.buffer,f.buffer])},hj=({decryptionWorker:n,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})=>{C({type:"segmentdecryptionstart"}),sk({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:n,segment:e,doneFn:S},j=>{e.bytes=j,C({type:"segmentdecryptioncomplete",segment:e}),rk({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})})},fj=({activeXhrs:n,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})=>{let j=0,k=!1;return(B,V)=>{if(!k){if(B)return k=!0,oy(n),S(B,V);if(j+=1,j===n.length){const W=function(){if(V.encryptedBytes)return hj({decryptionWorker:e,segment:V,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C});rk({segment:V,bytes:V.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w,doneFn:S,onTransmuxerLog:A,triggerSegmentEventFn:C})};if(V.endOfAllRequests=Date.now(),V.map&&V.map.encryptedBytes&&!V.map.bytes)return C({type:"segmentdecryptionstart",segment:V}),sk({decryptionWorker:e,id:V.requestId+"-init",encryptedBytes:V.map.encryptedBytes,key:V.map.key,segment:V,doneFn:S},H=>{V.map.bytes=H,C({type:"segmentdecryptioncomplete",segment:V}),ik(V,ie=>{if(ie)return oy(n),S(ie,V);W()})});W()}}}},mj=({loadendState:n,abortFn:e})=>t=>{t.target.aborted&&e&&!n.calledAbortFn&&(e(),n.calledAbortFn=!0)},pj=({segment:n,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:h,isEndOfTimeline:f,endedTimelineFn:g,dataFn:w})=>S=>{if(!S.target.aborted)return n.stats=ai(n.stats,aj(S)),!n.stats.firstBytesReceivedAt&&n.stats.bytesReceived&&(n.stats.firstBytesReceivedAt=Date.now()),e(S,n)},gj=({xhr:n,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:a,progressFn:l,trackInfoFn:u,timingInfoFn:h,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:g,id3Fn:w,captionsFn:S,isEndOfTimeline:A,endedTimelineFn:C,dataFn:j,doneFn:k,onTransmuxerLog:B,triggerSegmentEventFn:V})=>{const W=[],H=fj({activeXhrs:W,decryptionWorker:t,trackInfoFn:u,timingInfoFn:h,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:g,id3Fn:w,captionsFn:S,isEndOfTimeline:A,endedTimelineFn:C,dataFn:j,doneFn:k,onTransmuxerLog:B,triggerSegmentEventFn:V});if(i.key&&!i.key.bytes){const re=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&re.push(i.map.key);const E=ai(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),R=f_(i,re,H,V),ee={uri:i.key.resolvedUri};V({type:"segmentkeyloadstart",segment:i,keyInfo:ee});const q=n(E,R);W.push(q)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const q=ai(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Q=f_(i,[i.map.key],H,V),ue={uri:i.map.key.resolvedUri};V({type:"segmentkeyloadstart",segment:i,keyInfo:ue});const se=n(q,Q);W.push(se)}const E=ai(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:sy(i.map),requestType:"segment-media-initialization"}),R=uj({segment:i,finishProcessingFn:H,triggerSegmentEventFn:V});V({type:"segmentloadstart",segment:i});const ee=n(E,R);W.push(ee)}const ie=ai(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:sy(i),requestType:"segment"}),Y=cj({segment:i,finishProcessingFn:H,responseType:ie.responseType,triggerSegmentEventFn:V});V({type:"segmentloadstart",segment:i});const G=n(ie,Y);G.addEventListener("progress",pj({segment:i,progressFn:l,trackInfoFn:u,timingInfoFn:h,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:g,id3Fn:w,captionsFn:S,isEndOfTimeline:A,endedTimelineFn:C,dataFn:j})),W.push(G);const O={};return W.forEach(re=>{re.addEventListener("loadend",mj({loadendState:O,abortFn:a}))}),()=>oy(W)},Jh=Cs("PlaylistSelector"),m_=function(n){if(!n||!n.playlist)return;const e=n.playlist;return JSON.stringify({id:e.id,bandwidth:n.bandwidth,width:n.width,height:n.height,codecs:e.attributes&&e.attributes.CODECS||""})},gu=function(n,e){if(!n)return"";const t=he.getComputedStyle(n);return t?t[e]:""},yu=function(n,e){const t=n.slice();n.sort(function(i,a){const l=e(i,a);return l===0?t.indexOf(i)-t.indexOf(a):l})},sb=function(n,e){let t,i;return n.attributes.BANDWIDTH&&(t=n.attributes.BANDWIDTH),t=t||he.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||he.Number.MAX_VALUE,t-i},yj=function(n,e){let t,i;return n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(t=n.attributes.RESOLUTION.width),t=t||he.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||he.Number.MAX_VALUE,t===i&&n.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?n.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let ak=function(n){const{main:e,bandwidth:t,playerWidth:i,playerHeight:a,playerObjectFit:l,limitRenditionByPlayerDimensions:u,playlistController:h}=n;if(!e)return;const f={bandwidth:t,width:i,height:a,limitRenditionByPlayerDimensions:u};let g=e.playlists;Xr.isAudioOnly(e)&&(g=h.getAudioTrackPlaylists_(),f.audioOnly=!0);let w=g.map(O=>{let re;const E=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.width,R=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.height;return re=O.attributes&&O.attributes.BANDWIDTH,re=re||he.Number.MAX_VALUE,{bandwidth:re,width:E,height:R,playlist:O}});yu(w,(O,re)=>O.bandwidth-re.bandwidth),w=w.filter(O=>!Xr.isIncompatible(O.playlist));let S=w.filter(O=>Xr.isEnabled(O.playlist));S.length||(S=w.filter(O=>!Xr.isDisabled(O.playlist)));const A=S.filter(O=>O.bandwidth*pr.BANDWIDTH_VARIANCEO.bandwidth===C.bandwidth)[0];if(u===!1){const O=j||S[0]||w[0];if(O&&O.playlist){let re="sortedPlaylistReps";return j&&(re="bandwidthBestRep"),S[0]&&(re="enabledPlaylistReps"),Jh(`choosing ${m_(O)} using ${re} with options`,f),O.playlist}return Jh("could not choose a playlist with options",f),null}const k=A.filter(O=>O.width&&O.height);yu(k,(O,re)=>O.width-re.width);const B=k.filter(O=>O.width===i&&O.height===a);C=B[B.length-1];const V=B.filter(O=>O.bandwidth===C.bandwidth)[0];let W,H,ie;V||(W=k.filter(O=>l==="cover"?O.width>i&&O.height>a:O.width>i||O.height>a),H=W.filter(O=>O.width===W[0].width&&O.height===W[0].height),C=H[H.length-1],ie=H.filter(O=>O.bandwidth===C.bandwidth)[0]);let Y;if(h.leastPixelDiffSelector){const O=k.map(re=>(re.pixelDiff=Math.abs(re.width-i)+Math.abs(re.height-a),re));yu(O,(re,E)=>re.pixelDiff===E.pixelDiff?E.bandwidth-re.bandwidth:re.pixelDiff-E.pixelDiff),Y=O[0]}const G=Y||ie||V||j||S[0]||w[0];if(G&&G.playlist){let O="sortedPlaylistReps";return Y?O="leastPixelDiffRep":ie?O="resolutionPlusOneRep":V?O="resolutionBestRep":j?O="bandwidthBestRep":S[0]&&(O="enabledPlaylistReps"),Jh(`choosing ${m_(G)} using ${O} with options`,f),G.playlist}return Jh("could not choose a playlist with options",f),null};const p_=function(){let n=this.useDevicePixelRatio&&he.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),ak({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(gu(this.tech_.el(),"width"),10)*n,playerHeight:parseInt(gu(this.tech_.el(),"height"),10)*n,playerObjectFit:this.usePlayerObjectFit?gu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},bj=function(n){let e=-1,t=-1;if(n<0||n>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&he.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=n*this.systemBandwidth+(1-n)*e,t=this.systemBandwidth),ak({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(gu(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(gu(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?gu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},vj=function(n){const{main:e,currentTime:t,bandwidth:i,duration:a,segmentDuration:l,timeUntilRebuffer:u,currentTimeline:h,syncController:f}=n,g=e.playlists.filter(j=>!Xr.isIncompatible(j));let w=g.filter(Xr.isEnabled);w.length||(w=g.filter(j=>!Xr.isDisabled(j)));const A=w.filter(Xr.hasAttribute.bind(null,"BANDWIDTH")).map(j=>{const B=f.getSyncPoint(j,a,h,t)?1:2,W=Xr.estimateSegmentRequestTime(l,i,j)*B-u;return{playlist:j,rebufferingImpact:W}}),C=A.filter(j=>j.rebufferingImpact<=0);return yu(C,(j,k)=>sb(k.playlist,j.playlist)),C.length?C[0]:(yu(A,(j,k)=>j.rebufferingImpact-k.rebufferingImpact),A[0]||null)},xj=function(){const n=this.playlists.main.playlists.filter(Xr.isEnabled);return yu(n,(t,i)=>sb(t,i)),n.filter(t=>!!ld(this.playlists.main,t).video)[0]||null},_j=n=>{let e=0,t;return n.bytes&&(t=new Uint8Array(n.bytes),n.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function ok(n){try{return new URL(n).pathname.split("/").slice(-2).join("/")}catch{return""}}const wj=function(n,e,t){if(!n[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const a=e.textTracks().getTrackById(i);if(a)n[t]=a;else{const l=e.options_.vhs&&e.options_.vhs.captionServices||{};let u=t,h=t,f=!1;const g=l[i];g&&(u=g.label,h=g.language,f=g.default),n[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:f,label:u,language:h},!1).track}}},Sj=function({inbandTextTracks:n,captionArray:e,timestampOffset:t}){if(!e)return;const i=he.WebKitDataCue||he.VTTCue;e.forEach(a=>{const l=a.stream;a.content?a.content.forEach(u=>{const h=new i(a.startTime+t,a.endTime+t,u.text);h.line=u.line,h.align="left",h.position=u.position,h.positionAlign="line-left",n[l].addCue(h)}):n[l].addCue(new i(a.startTime+t,a.endTime+t,a.text))})},Tj=function(n){Object.defineProperties(n.frame,{id:{get(){return Fe.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get(){return Fe.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get(){return Fe.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}})},kj=({inbandTextTracks:n,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const a=he.WebKitDataCue||he.VTTCue,l=n.metadataTrack_;if(!l||(e.forEach(w=>{const S=w.cueTime+t;typeof S!="number"||he.isNaN(S)||S<0||!(S<1/0)||!w.frames||!w.frames.length||w.frames.forEach(A=>{const C=new a(S,S,A.value||A.url||A.data||"");C.frame=A,C.value=A,Tj(C),l.addCue(C)})}),!l.cues||!l.cues.length))return;const u=l.cues,h=[];for(let w=0;w{const A=w[S.startTime]||[];return A.push(S),w[S.startTime]=A,w},{}),g=Object.keys(f).sort((w,S)=>Number(w)-Number(S));g.forEach((w,S)=>{const A=f[w],C=isFinite(i)?i:w,j=Number(g[S+1])||C;A.forEach(k=>{k.endTime=j})})},Ej={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Cj=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Aj=({inbandTextTracks:n,dateRanges:e})=>{const t=n.metadataTrack_;if(!t)return;const i=he.WebKitDataCue||he.VTTCue;e.forEach(a=>{for(const l of Object.keys(a)){if(Cj.has(l))continue;const u=new i(a.startTime,a.endTime,"");u.id=a.id,u.type="com.apple.quicktime.HLS",u.value={key:Ej[l],data:a[l]},(l==="scte35Out"||l==="scte35In")&&(u.value.data=new Uint8Array(u.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(u)}a.processDateRange()})},g_=(n,e,t)=>{n.metadataTrack_||(n.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Fe.browser.IS_ANY_SAFARI||(n.metadataTrack_.inBandMetadataTrackDispatchType=e))},Yc=function(n,e,t){let i,a;if(t&&t.cues)for(i=t.cues.length;i--;)a=t.cues[i],a.startTime>=n&&a.endTime<=e&&t.removeCue(a)},Nj=function(n){const e=n.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const a=e[i],l=`${a.startTime}-${a.endTime}-${a.text}`;t[l]?n.removeCue(a):t[l]=a}},Dj=(n,e,t)=>{if(typeof e>"u"||e===null||!n.length)return[];const i=Math.ceil((e-t+3)*ul.ONE_SECOND_IN_TS);let a;for(a=0;ai);a++);return n.slice(a)},Mj=(n,e,t)=>{if(!e.length)return n;if(t)return e.slice();const i=e[0].pts;let a=0;for(a;a=i);a++);return n.slice(0,a).concat(e)},Rj=(n,e,t,i)=>{const a=Math.ceil((e-i)*ul.ONE_SECOND_IN_TS),l=Math.ceil((t-i)*ul.ONE_SECOND_IN_TS),u=n.slice();let h=n.length;for(;h--&&!(n[h].pts<=l););if(h===-1)return u;let f=h+1;for(;f--&&!(n[f].pts<=a););return f=Math.max(f,0),u.splice(f,h-f+1),u},jj=function(n,e){if(!n&&!e||!n&&e||n&&!e)return!1;if(n===e)return!0;const t=Object.keys(n).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let a=0;at))return l}return i.length===0?0:i[i.length-1]},Hc=1,Lj=500,y_=n=>typeof n=="number"&&isFinite(n),ef=1/60,Ij=(n,e,t)=>n!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,Bj=(n,e,t)=>{let i=e-pr.BACK_BUFFER_LENGTH;n.length&&(i=Math.max(i,n.start(0)));const a=e-t;return Math.min(a,i)},Zl=n=>{const{startOfSegment:e,duration:t,segment:i,part:a,playlist:{mediaSequence:l,id:u,segments:h=[]},mediaIndex:f,partIndex:g,timeline:w}=n,S=h.length-1;let A="mediaIndex/partIndex increment";n.getMediaInfoForTime?A=`getMediaInfoForTime (${n.getMediaInfoForTime})`:n.isSyncRequest&&(A="getSyncSegmentCandidate (isSyncRequest)"),n.independent&&(A+=` with independent ${n.independent}`);const C=typeof g=="number",j=n.segment.uri?"segment":"pre-segment",k=C?kT({preloadSegment:i})-1:0;return`${j} [${l+f}/${l+S}]`+(C?` part [${g}/${k}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(C?` part start/end [${a.start} => ${a.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${w}] selected by [${A}] playlist [${u}]`},b_=n=>`${n}TimingInfo`,Pj=({segmentTimeline:n,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:a})=>!a&&n===e?null:n{if(e===t)return!1;if(i==="audio"){const l=n.lastTimelineChange({type:"main"});return!l||l.to!==t}if(i==="main"&&a){const l=n.pendingTimelineChange({type:"audio"});return!(l&&l.to===t)}return!1},Fj=n=>{if(!n)return!1;const e=n.pendingTimelineChange({type:"audio"}),t=n.pendingTimelineChange({type:"main"}),i=e&&t,a=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&a)},Uj=n=>{const e=n.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=n.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=n.pendingSegment_;if(!e)return;if(ly({timelineChangeController:n.timelineChangeController_,currentTimeline:n.currentTimeline_,segmentTimeline:e.timeline,loaderType:n.loaderType_,audioDisabled:n.audioDisabled_})&&Fj(n.timelineChangeController_)){if(Uj(n)){n.timelineChangeController_.trigger("audioTimelineBehind");return}n.timelineChangeController_.trigger("fixBadTimelineChange")}},zj=n=>{let e=0;return["video","audio"].forEach(function(t){const i=n[`${t}TimingInfo`];if(!i)return;const{start:a,end:l}=i;let u;typeof a=="bigint"||typeof l=="bigint"?u=he.BigInt(l)-he.BigInt(a):typeof a=="number"&&typeof l=="number"&&(u=l-a),typeof u<"u"&&u>e&&(e=u)}),typeof e=="bigint"&&en?Math.round(n)>e+ia:!1,Hj=(n,e)=>{if(e!=="hls")return null;const t=zj({audioTimingInfo:n.audioTimingInfo,videoTimingInfo:n.videoTimingInfo});if(!t)return null;const i=n.playlist.targetDuration,a=v_({segmentDuration:t,maxDuration:i*2}),l=v_({segmentDuration:t,maxDuration:i}),u=`Segment with index ${n.mediaIndex} from playlist ${n.playlist.id} has a duration of ${t} when the reported duration is ${n.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return a||l?{severity:a?"warn":"info",message:u}:null},ol=({type:n,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),a=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:n||e.type,uri:e.resolvedUri||e.uri,start:a,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class uy extends Fe.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Cs(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():vo(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(tr({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():vo(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(tr({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():vo(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():vo(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return yg.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&he.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,he.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&yg.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return yr();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:a}=e;if(i&&t&&!this.audioDisabled_&&!a)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Vf(e);let a=this.initSegments_[i];return t&&!a&&e.bytes&&(this.initSegments_[i]=a={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),a||e}segmentKey(e,t=!1){if(!e)return null;const i=qT(e);let a=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!a&&e.bytes&&(this.keyCache_[i]=a={resolvedUri:e.resolvedUri,bytes:e.bytes});const l={resolvedUri:(a||e).resolvedUri};return a&&(l.bytes=a.bytes),l}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,a=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let l=null;if(i&&(i.id?l=i.id:i.uri&&(l=i.uri)),this.logger_(`playlist update [${l} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: -currentTime: ${this.currentTime_()} -bufferedEnd: ${pg(this.buffered_())} -`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const u=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${u}]`),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const h=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!h.parts||!h.parts.length||!h.parts[this.partIndex])){const f=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=f}}a&&(a.mediaIndex-=u,a.mediaIndex<0?(a.mediaIndex=null,a.partIndex=null):(a.mediaIndex>=0&&(a.segment=e.segments[a.mediaIndex]),a.partIndex>=0&&a.segment.parts&&(a.part=a.segment.parts[a.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(he.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&yg.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},a=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let l=1;const u=()=>{l--,l===0&&i()};(a||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,t,u)),(a||this.loaderType_==="main")&&(this.gopBuffer_=Rj(this.gopBuffer_,e,t,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,t,u));for(const h in this.inbandTextTracks_)Yc(e,t,this.inbandTextTracks_[h]);Yc(e,t,this.segmentMetadataTrack_),u()}monitorBuffer_(){this.checkBufferTimeout_&&he.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=he.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&he.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=he.setTimeout(this.monitorBufferTick_.bind(this),Lj)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:ol({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const a=typeof e=="number"&&t.segments[e],l=e+1===t.segments.length,u=!a||!a.parts||i+1===a.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&l&&u}chooseNextRequest_(){const e=this.buffered_(),t=pg(e)||0,i=eb(e,this.currentTime_()),a=!this.hasPlayed_()&&i>=1,l=i>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||a||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const h={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(h.isSyncRequest)h.mediaIndex=Oj(this.currentTimeline_,u,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${h.mediaIndex}`);else if(this.mediaIndex!==null){const A=u[this.mediaIndex],C=typeof this.partIndex=="number"?this.partIndex:-1;h.startOfSegment=A.end?A.end:t,A.parts&&A.parts[C+1]?(h.mediaIndex=this.mediaIndex,h.partIndex=C+1):h.mediaIndex=this.mediaIndex+1}else{let A,C,j;const k=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: -For TargetTime: ${k}. -CurrentTime: ${this.currentTime_()} -BufferedEnd: ${t} -Fetch At Buffer: ${this.fetchAtBuffer_} -`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const B=this.getSyncInfoFromMediaSequenceSync_(k);if(!B){const V="No sync info found while using media sequence sync";return this.error({message:V,metadata:{errorType:Fe.Error.StreamingFailedToSelectNextSegment,error:new Error(V)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${B.start} --> ${B.end})`),A=B.segmentIndex,C=B.partIndex,j=B.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const B=Xr.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:k,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});A=B.segmentIndex,C=B.partIndex,j=B.startTime}h.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${k}`:`currentTime ${k}`,h.mediaIndex=A,h.startOfSegment=j,h.partIndex=C,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${h.mediaIndex} `)}const f=u[h.mediaIndex];let g=f&&typeof h.partIndex=="number"&&f.parts&&f.parts[h.partIndex];if(!f||typeof h.partIndex=="number"&&!g)return null;typeof h.partIndex!="number"&&f.parts&&(h.partIndex=0,g=f.parts[0]);const w=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&g&&!w&&!g.independent)if(h.partIndex===0){const A=u[h.mediaIndex-1],C=A.parts&&A.parts.length&&A.parts[A.parts.length-1];C&&C.independent&&(h.mediaIndex-=1,h.partIndex=A.parts.length-1,h.independent="previous segment")}else f.parts[h.partIndex-1].independent&&(h.partIndex-=1,h.independent="previous part");const S=this.mediaSource_&&this.mediaSource_.readyState==="ended";return h.mediaIndex>=u.length-1&&S&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,h.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(h))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const a=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return a?(a.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),a):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:a,startOfSegment:l,isSyncRequest:u,partIndex:h,forceTimestampOffset:f,getMediaInfoForTime:g}=e,w=i.segments[a],S=typeof h=="number"&&w.parts[h],A={requestId:"segment-loader-"+Math.random(),uri:S&&S.resolvedUri||w.resolvedUri,mediaIndex:a,partIndex:S?h:null,isSyncRequest:u,startOfSegment:l,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:w.timeline,duration:S&&S.duration||w.duration,segment:w,part:S,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:g,independent:t},C=typeof f<"u"?f:this.isPendingTimestampOffset_;A.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:w.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:C});const j=pg(this.sourceUpdater_.audioBuffered());return typeof j=="number"&&(A.audioAppendStart=j-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(A.gopsToAlignWith=Dj(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),A}timestampOffsetForSegment_(e){return Pj(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,a=this.pendingSegment_.duration,l=Xr.estimateSegmentRequestTime(a,i,this.playlist_,e.bytesReceived),u=aR(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(l<=u)return;const h=vj({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:a,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!h)return;const g=l-u-h.rebufferingImpact;let w=.5;u<=ia&&(w=1),!(!h.playlist||h.playlist.uri===this.playlist_.uri||g{l[u.stream]=l[u.stream]||{startTime:1/0,captions:[],endTime:0};const h=l[u.stream];h.startTime=Math.min(h.startTime,u.startTime+a),h.endTime=Math.max(h.endTime,u.endTime+a),h.captions.push(u)}),Object.keys(l).forEach(u=>{const{startTime:h,endTime:f,captions:g}=l[u],w=this.inbandTextTracks_;this.logger_(`adding cues from ${h} -> ${f} for ${u}`),wj(w,this.vhs_.tech_,u),Yc(h,f,w[u]),Sj({captionArray:g,inbandTextTracks:w,timestampOffset:a})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!ly({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:a,isMuxed:l}=t;return!(a&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!l&&!e.audioTimingInfo||ly({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){vo(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[b_(t.type)].start;else{const a=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&a&&a.hasVideo;let u;l&&(u=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:u,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const a=this.chooseNextRequest_();if(a.mediaIndex!==i.mediaIndex||a.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:a}){if(i){const l=Vf(i);if(this.activeInitSegmentId_===l)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=l}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=a,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},a){const l=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();l.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+cl(l).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+cl(u).join(", "));const h=l.length?l.start(0):0,f=l.length?l.end(l.length-1):0,g=u.length?u.start(0):0,w=u.length?u.end(u.length-1):0;if(f-h<=Hc&&w-g<=Hc){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${cl(l).join(", ")}, video buffer: ${cl(u).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const A=this.currentTime_()-Hc;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${A}`),this.remove(0,A,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Hc}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=he.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Hc*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},a){if(a){if(a.code===IT){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",a),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Fe.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:a,bytes:l}){if(!l){const h=[a];let f=a.byteLength;i&&(h.unshift(i),f+=i.byteLength),l=_j({bytes:f,segments:h})}const u={segmentInfo:ol({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:u}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:l}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const a=this.pendingSegment_.segment,l=`${e}TimingInfo`;a[l]||(a[l]={}),a[l].transmuxerPrependedSeconds=i.prependedContentDuration||0,a[l].transmuxedPresentationStart=i.start.presentation,a[l].transmuxedDecodeStart=i.start.decode,a[l].transmuxedPresentationEnd=i.end.presentation,a[l].transmuxedDecodeEnd=i.end.decode,a[l].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:a}=t;if(!a||!a.byteLength||i==="audio"&&this.audioDisabled_)return;const l=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:l,data:a})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){vo(this),this.loadQueue_.push(()=>{const t=tr({},e,{forceTimestampOffset:!0});tr(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),a=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,u=i||a&&l;this.logger_(`Requesting -${ok(e.uri)} -${Zl(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=gj({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:u,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:h,level:f,stream:g})=>{this.logger_(`${Zl(e)} logged from transmuxer stream ${g} as a ${f}: ${h}`)},triggerSegmentEventFn:({type:h,segment:f,keyInfo:g,trackInfo:w,timingInfo:S})=>{const C={segmentInfo:ol({segment:f})};g&&(C.keyInfo=g),w&&(C.trackInfo=w),S&&(C.timingInfo=S),this.trigger({type:h,metadata:C})}})}trimBackBuffer_(e){const t=Bj(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,a=e.segment.key||e.segment.map&&e.segment.map.key,l=e.segment.map&&!e.segment.map.bytes,u={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:a,isMediaInitialization:l},h=e.playlist.segments[e.mediaIndex-1];if(h&&h.timeline===t.timeline&&(h.videoTimingInfo?u.baseStartTime=h.videoTimingInfo.transmuxedDecodeEnd:h.audioTimingInfo&&(u.baseStartTime=h.audioTimingInfo.transmuxedDecodeEnd)),t.key){const f=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);u.key=this.segmentKey(t.key),u.key.iv=f}return t.map&&(u.map=this.initSegmentForMap(t.map)),u}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||g.end!==a+l?a:h.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:a,isMuxed:l}=t,u=this.loaderType_==="main"&&a,h=!this.audioDisabled_&&i&&!l;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}u&&e.waitingOnAppends++,h&&e.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),h&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=Ij(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),a=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;a&&(e.timingInfo.end=typeof a.end=="number"?a.end:a.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const f={segmentInfo:ol({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:f})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Hj(e,this.sourceType_);if(t&&(t.severity==="warn"?Fe.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Zl(e)}`);return}this.logger_(`Appended ${Zl(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,a=e.part,l=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,u=a&&a.end&&this.currentTime_()-a.end>e.playlist.partTargetDuration*3;if(l||u){this.logger_(`bad ${l?"segment":"part"} ${Zl(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},$j=["video","audio"],cy=(n,e)=>{const t=e[`${n}Buffer`];return t&&t.updating||e.queuePending[n]},qj=(n,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),bu("audio",e),bu("video",e));return}if(n!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||cy(n,e))){if(i.type!==n){if(t=qj(n,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[n]=i,i.action(n,e),!i.doneFn){e.queuePending[n]=null,bu(n,e);return}}},uk=(n,e)=>{const t=e[`${n}Buffer`],i=lk(n);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[n]=null,e[`${n}Buffer`]=null)},ta=(n,e)=>n&&e&&Array.prototype.indexOf.call(n.sourceBuffers,e)!==-1,ls={appendBuffer:(n,e,t)=>(i,a)=>{const l=a[`${i}Buffer`];if(ta(a.mediaSource,l)){a.logger_(`Appending segment ${e.mediaIndex}'s ${n.length} bytes to ${i}Buffer`);try{l.appendBuffer(n)}catch(u){a.logger_(`Error with code ${u.code} `+(u.code===IT?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),a.queuePending[i]=null,t(u)}}},remove:(n,e)=>(t,i)=>{const a=i[`${t}Buffer`];if(ta(i.mediaSource,a)){i.logger_(`Removing ${n} to ${e} from ${t}Buffer`);try{a.remove(n,e)}catch{i.logger_(`Remove ${n} to ${e} from ${t}Buffer failed`)}}},timestampOffset:n=>(e,t)=>{const i=t[`${e}Buffer`];ta(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${n}`),i.timestampOffset=n)},callback:n=>(e,t)=>{n()},endOfStream:n=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${n||""})`);try{e.mediaSource.endOfStream(n)}catch(t){Fe.log.warn("Failed to call media source endOfStream",t)}}},duration:n=>e=>{e.logger_(`Setting mediaSource duration to ${n}`);try{e.mediaSource.duration=n}catch(t){Fe.log.warn("Failed to set media source duration",t)}},abort:()=>(n,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${n}Buffer`];if(ta(e.mediaSource,t)){e.logger_(`calling abort on ${n}Buffer`);try{t.abort()}catch(i){Fe.log.warn(`Failed to abort on ${n}Buffer`,i)}}},addSourceBuffer:(n,e)=>t=>{const i=lk(n),a=Su(e);t.logger_(`Adding ${n}Buffer with codec ${e} to mediaSource`);const l=t.mediaSource.addSourceBuffer(a);l.addEventListener("updateend",t[`on${i}UpdateEnd_`]),l.addEventListener("error",t[`on${i}Error_`]),t.codecs[n]=e,t[`${n}Buffer`]=l},removeSourceBuffer:n=>e=>{const t=e[`${n}Buffer`];if(uk(n,e),!!ta(e.mediaSource,t)){e.logger_(`Removing ${n}Buffer with codec ${e.codecs[n]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){Fe.log.warn(`Failed to removeSourceBuffer ${n}Buffer`,i)}}},changeType:n=>(e,t)=>{const i=t[`${e}Buffer`],a=Su(n);if(!ta(t.mediaSource,i))return;const l=n.substring(0,n.indexOf(".")),u=t.codecs[e];if(u.substring(0,u.indexOf("."))===l)return;const f={codecsChangeInfo:{from:u,to:n}};t.trigger({type:"codecschange",metadata:f}),t.logger_(`changing ${e}Buffer codec from ${u} to ${n}`);try{i.changeType(a),t.codecs[e]=n}catch(g){f.errorType=Fe.Error.StreamingCodecsChangeError,f.error=g,g.metadata=f,t.error_=g,t.trigger("error"),Fe.log.warn(`Failed to changeType on ${e}Buffer`,g)}}},us=({type:n,sourceUpdater:e,action:t,doneFn:i,name:a})=>{e.queue.push({type:n,action:t,doneFn:i,name:a}),bu(n,e)},x_=(n,e)=>t=>{const i=e[`${n}Buffered`](),a=iR(i);if(e.logger_(`received "updateend" event for ${n} Source Buffer: `,a),e.queuePending[n]){const l=e.queuePending[n].doneFn;e.queuePending[n]=null,l&&l(e[`${n}Error_`])}bu(n,e)};class ck extends Fe.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>bu("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Cs("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=x_("video",this),this.onAudioUpdateEnd_=x_("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){us({type:"mediaSource",sourceUpdater:this,action:ls.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){us({type:e,sourceUpdater:this,action:ls.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){Fe.log.error("removeSourceBuffer is not supported!");return}us({type:"mediaSource",sourceUpdater:this,action:ls.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!Fe.browser.IS_FIREFOX&&he.MediaSource&&he.MediaSource.prototype&&typeof he.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return he.SourceBuffer&&he.SourceBuffer.prototype&&typeof he.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){Fe.log.error("changeType is not supported!");return}us({type:e,sourceUpdater:this,action:ls.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:a,bytes:l}=e;if(this.processedAppend_=!0,a==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${l.length} until video append`);return}const u=t;if(us({type:a,sourceUpdater:this,action:ls.appendBuffer(l,i||{mediaIndex:-1},u),doneFn:t,name:"appendBuffer"}),a==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const h=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${h.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,h.forEach(f=>{this.appendBuffer.apply(this,f)})}}audioBuffered(){return ta(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:yr()}videoBuffered(){return ta(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:yr()}buffered(){const e=ta(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=ta(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():sR(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Ra){us({type:"mediaSource",sourceUpdater:this,action:ls.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Ra){typeof e!="string"&&(e=void 0),us({type:"mediaSource",sourceUpdater:this,action:ls.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Ra){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}us({type:"audio",sourceUpdater:this,action:ls.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=Ra){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}us({type:"video",sourceUpdater:this,action:ls.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(cy("audio",this)||cy("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(us({type:"audio",sourceUpdater:this,action:ls.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(us({type:"video",sourceUpdater:this,action:ls.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&us({type:"audio",sourceUpdater:this,action:ls.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&us({type:"video",sourceUpdater:this,action:ls.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),$j.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>uk(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const __=n=>decodeURIComponent(escape(String.fromCharCode.apply(null,n))),Vj=n=>{const e=new Uint8Array(n);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},w_=new Uint8Array(` - -`.split("").map(n=>n.charCodeAt(0)));class Gj extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Kj extends uy{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return yr();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return yr([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Vf(e);let a=this.initSegments_[i];if(t&&!a&&e.bytes){const l=w_.byteLength+e.bytes.byteLength,u=new Uint8Array(l);u.set(e.bytes),u.set(w_,e.bytes.byteLength),this.initSegments_[i]=a={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:u}}return a||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Yc(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===sa.TIMEOUT&&this.handleTimeout_(),e.code===sa.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const a=this.pendingSegment_,l=i.mp4VttCues&&i.mp4VttCues.length;l&&(a.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(a.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const u=a.segment;if(u.map&&(u.map.bytes=t.map.bytes),a.bytes=t.bytes,typeof he.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}u.requested=!0;try{this.parseVTTCues_(a)}catch(h){this.stopForError({message:h.message,metadata:{errorType:Fe.Error.StreamingVttParserError,error:h}});return}if(l||this.updateTimeMapping_(a,this.syncController_.timelines[a.timeline],this.playlist_),a.cues.length?a.timingInfo={start:a.cues[0].startTime,end:a.cues[a.cues.length-1].endTime}:a.timingInfo={start:a.startOfSegment,end:a.startOfSegment+a.duration},a.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}a.byteLength=a.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,a.cues.forEach(h=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new he.VTTCue(h.startTime,h.endTime,h.text):h)}),Nj(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",a=t&&t.type==="text";i&&a&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const a=i.start+t,l=i.end+t,u=new he.VTTCue(a,l,i.cueText);i.settings&&i.settings.split(" ").forEach(h=>{const f=h.split(":"),g=f[0],w=f[1];u[g]=isNaN(w)?w:Number(w)}),e.cues.push(u)})}parseVTTCues_(e){let t,i=!1;if(typeof he.WebVTT!="function")throw new Gj;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof he.TextDecoder=="function"?t=new he.TextDecoder("utf8"):(t=he.WebVTT.StringDecoder(),i=!0);const a=new he.WebVTT.Parser(he,he.vttjs,t);if(a.oncue=e.cues.push.bind(e.cues),a.ontimestampmap=u=>{e.timestampmap=u},a.onparsingerror=u=>{Fe.log.warn("Error encountered when parsing cues: "+u.message)},e.segment.map){let u=e.segment.map.bytes;i&&(u=__(u)),a.parse(u)}let l=e.bytes;i&&(l=__(l)),a.parse(l),a.flush()}updateTimeMapping_(e,t,i){const a=e.segment;if(!t)return;if(!e.cues.length){a.empty=!0;return}const{MPEGTS:l,LOCAL:u}=e.timestampmap,f=l/ul.ONE_SECOND_IN_TS-u+t.mapping;if(e.cues.forEach(g=>{const w=g.endTime-g.startTime,S=this.handleRollover_(g.startTime+f,t.time);g.startTime=Math.max(S,0),g.endTime=Math.max(S+w,0)}),!i.syncInfo){const g=e.cues[0].startTime,w=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(g,w-a.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*ul.ONE_SECOND_IN_TS;const a=t*ul.ONE_SECOND_IN_TS;let l;for(a4294967296;)i+=l;return i/ul.ONE_SECOND_IN_TS}}const Wj=function(n,e){const t=n.cues;for(let i=0;i=a.adStartTime&&e<=a.adEndTime)return a}return null},Xj=function(n,e,t=0){if(!n.segments)return;let i=t,a;for(let l=0;l=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class dk{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:a}=e;if(this.isReliable_=this.isReliablePlaylist_(i,a),!!this.isReliable_)return this.updateStorage_(a,i,this.calculateBaseTime_(i,a,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const a of i)if(a.isInRange(e))return a}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const a=new Map;let l=` -`,u=i,h=t;this.start_=u,e.forEach((f,g)=>{const w=this.storage_.get(h),S=u,A=S+f.duration,C=!!(w&&w.segmentSyncInfo&&w.segmentSyncInfo.isAppended),j=new S_({start:S,end:A,appended:C,segmentIndex:g});f.syncInfo=j;let k=u;const B=(f.parts||[]).map((V,W)=>{const H=k,ie=k+V.duration,Y=!!(w&&w.partsSyncInfo&&w.partsSyncInfo[W]&&w.partsSyncInfo[W].isAppended),G=new S_({start:H,end:ie,appended:Y,segmentIndex:g,partIndex:W});return k=ie,l+=`Media Sequence: ${h}.${W} | Range: ${H} --> ${ie} | Appended: ${Y} -`,V.syncInfo=G,G});a.set(h,new Yj(j,B)),l+=`${ok(f.resolvedUri)} | Media Sequence: ${h} | Range: ${S} --> ${A} | Appended: ${C} -`,h++,u=A}),this.end_=u,this.storage_=a,this.diagnostics_=l}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const a=Math.min(...this.storage_.keys());if(et!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(n,e,t,i,a,l)=>{const u=n.getMediaSequenceSync(l);if(!u||!u.isReliable)return null;const h=u.getSyncInfoForTime(a);return h?{time:h.start,partIndex:h.partIndex,segmentIndex:h.segmentIndex}:null}},{name:"ProgramDateTime",run:(n,e,t,i,a)=>{if(!Object.keys(n.timelineToDatetimeMappings).length)return null;let l=null,u=null;const h=ey(e);a=a||0;for(let f=0;f{let l=null,u=null;a=a||0;const h=ey(e);for(let f=0;f=C)&&(u=C,l={time:A,segmentIndex:w.segmentIndex,partIndex:w.partIndex})}}return l}},{name:"Discontinuity",run:(n,e,t,i,a)=>{let l=null;if(a=a||0,e.discontinuityStarts&&e.discontinuityStarts.length){let u=null;for(let h=0;h=S)&&(u=S,l={time:w.time,segmentIndex:f,partIndex:null})}}}return l}},{name:"Playlist",run:(n,e,t,i,a)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class Zj extends Fe.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new dk,i=new T_(t),a=new T_(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:a},this.logger_=Cs("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,a,l){if(t!==1/0)return bg.find(({name:f})=>f==="VOD").run(this,e,t);const u=this.runStrategies_(e,t,i,a,l);if(!u.length)return null;for(const h of u){const{syncPoint:f,strategy:g}=h,{segmentIndex:w,time:S}=f;if(w<0)continue;const A=e.segments[w],C=S,j=C+A.duration;if(this.logger_(`Strategy: ${g}. Current time: ${a}. selected segment: ${w}. Time: [${C} -> ${j}]}`),a>=C&&a0&&(a.time*=-1),Math.abs(a.time+od({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:a.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,a,l){const u=[];for(let h=0;hQj){Fe.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let a=i-1;a>=0;a--){const l=e.segments[a];if(l&&typeof l.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+a,time:l.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),a=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:a.start}));const l=a.dateTimeObject;a.discontinuity&&t&&l&&(this.timelineToDatetimeMappings[a.timeline]=-(l.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const a=e.segment,l=e.part;let u=this.timelines[e.timeline],h,f;if(typeof e.timestampOffset=="number")u={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=u,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${u.time}] [mapping: ${u.mapping}]`)),h=e.startOfSegment,f=t.end+u.mapping;else if(u)h=t.start+u.mapping,f=t.end+u.mapping;else return!1;return l&&(l.start=h,l.end=f),(!a.start||hf){let g;h<0?g=i.start-od({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:l}):g=i.end+od({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[u]={time:g,accuracy:f}}}}dispose(){this.trigger("dispose"),this.off()}}class Jj extends Fe.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const a={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:a})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const e8=YT(QT(function(){var n=(function(){function k(){this.listeners={}}var B=k.prototype;return B.on=function(W,H){this.listeners[W]||(this.listeners[W]=[]),this.listeners[W].push(H)},B.off=function(W,H){if(!this.listeners[W])return!1;var ie=this.listeners[W].indexOf(H);return this.listeners[W]=this.listeners[W].slice(0),this.listeners[W].splice(ie,1),ie>-1},B.trigger=function(W){var H=this.listeners[W];if(H)if(arguments.length===2)for(var ie=H.length,Y=0;Y>7)*283)^ie]=ie;for(Y=G=0;!W[Y];Y^=E||1,G=re[G]||1)for(q=G^G<<1^G<<2^G<<3^G<<4,q=q>>8^q&255^99,W[Y]=q,H[q]=Y,ee=O[R=O[E=O[Y]]],ue=ee*16843009^R*65537^E*257^Y*16843008,Q=O[q]*257^q*16843008,ie=0;ie<4;ie++)B[ie][Y]=Q=Q<<24^Q>>>8,V[ie][q]=ue=ue<<24^ue>>>8;for(ie=0;ie<5;ie++)B[ie]=B[ie].slice(0),V[ie]=V[ie].slice(0);return k};let i=null;class a{constructor(B){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let V,W,H;const ie=this._tables[0][4],Y=this._tables[1],G=B.length;let O=1;if(G!==4&&G!==6&&G!==8)throw new Error("Invalid aes key size");const re=B.slice(0),E=[];for(this._key=[re,E],V=G;V<4*G+28;V++)H=re[V-1],(V%G===0||G===8&&V%G===4)&&(H=ie[H>>>24]<<24^ie[H>>16&255]<<16^ie[H>>8&255]<<8^ie[H&255],V%G===0&&(H=H<<8^H>>>24^O<<24,O=O<<1^(O>>7)*283)),re[V]=re[V-G]^H;for(W=0;V;W++,V--)H=re[W&3?V:V-4],V<=4||W<4?E[W]=H:E[W]=Y[0][ie[H>>>24]]^Y[1][ie[H>>16&255]]^Y[2][ie[H>>8&255]]^Y[3][ie[H&255]]}decrypt(B,V,W,H,ie,Y){const G=this._key[1];let O=B^G[0],re=H^G[1],E=W^G[2],R=V^G[3],ee,q,Q;const ue=G.length/4-2;let se,$=4;const F=this._tables[1],X=F[0],le=F[1],de=F[2],L=F[3],pe=F[4];for(se=0;se>>24]^le[re>>16&255]^de[E>>8&255]^L[R&255]^G[$],q=X[re>>>24]^le[E>>16&255]^de[R>>8&255]^L[O&255]^G[$+1],Q=X[E>>>24]^le[R>>16&255]^de[O>>8&255]^L[re&255]^G[$+2],R=X[R>>>24]^le[O>>16&255]^de[re>>8&255]^L[E&255]^G[$+3],$+=4,O=ee,re=q,E=Q;for(se=0;se<4;se++)ie[(3&-se)+Y]=pe[O>>>24]<<24^pe[re>>16&255]<<16^pe[E>>8&255]<<8^pe[R&255]^G[$++],ee=O,O=re,re=E,E=R,R=ee}}class l extends n{constructor(){super(n),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(B){this.jobs.push(B),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const u=function(k){return k<<24|(k&65280)<<8|(k&16711680)>>8|k>>>24},h=function(k,B,V){const W=new Int32Array(k.buffer,k.byteOffset,k.byteLength>>2),H=new a(Array.prototype.slice.call(B)),ie=new Uint8Array(k.byteLength),Y=new Int32Array(ie.buffer);let G,O,re,E,R,ee,q,Q,ue;for(G=V[0],O=V[1],re=V[2],E=V[3],ue=0;ue{const W=k[V];A(W)?B[V]={bytes:W.buffer,byteOffset:W.byteOffset,byteLength:W.byteLength}:B[V]=W}),B};self.onmessage=function(k){const B=k.data,V=new Uint8Array(B.encrypted.bytes,B.encrypted.byteOffset,B.encrypted.byteLength),W=new Uint32Array(B.key.bytes,B.key.byteOffset,B.key.byteLength/4),H=new Uint32Array(B.iv.bytes,B.iv.byteOffset,B.iv.byteLength/4);new f(V,W,H,function(ie,Y){self.postMessage(j({source:B.source,decrypted:Y}),[Y.buffer])})}}));var t8=XT(e8);const n8=n=>{let e=n.default?"main":"alternative";return n.characteristics&&n.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},hk=(n,e)=>{n.abort(),n.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},dy=(n,e)=>{e.activePlaylistLoader=n,n.load()},i8=(n,e)=>()=>{const{segmentLoaders:{[n]:t,main:i},mediaTypes:{[n]:a}}=e,l=a.activeTrack(),u=a.getActiveGroup(),h=a.activePlaylistLoader,f=a.lastGroup_;if(!(u&&f&&u.id===f.id)&&(a.lastGroup_=u,a.lastTrack_=l,hk(t,a),!(!u||u.isMainPlaylist))){if(!u.playlistLoader){h&&i.resetEverything();return}t.resyncLoader(),dy(u.playlistLoader,a)}},r8=(n,e)=>()=>{const{segmentLoaders:{[n]:t},mediaTypes:{[n]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},s8=(n,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[n]:i,main:a},mediaTypes:{[n]:l}}=e,u=l.activeTrack(),h=l.getActiveGroup(),f=l.activePlaylistLoader,g=l.lastTrack_;if(!(g&&u&&g.id===u.id)&&(l.lastGroup_=h,l.lastTrack_=u,hk(i,l),!!h)){if(h.isMainPlaylist){if(!u||!g||u.id===g.id)return;const w=e.vhs.playlistController_,S=w.selectPlaylist();if(w.media()===S)return;l.logger_(`track change. Switching main audio from ${g.id} to ${u.id}`),t.pause(),a.resetEverything(),w.fastQualityChange_(S);return}if(n==="AUDIO"){if(!h.playlistLoader){a.setAudio(!0),a.resetEverything();return}i.setAudio(!0),a.setAudio(!1)}if(f===h.playlistLoader){dy(h.playlistLoader,l);return}i.track&&i.track(u),i.resetEverything(),dy(h.playlistLoader,l)}},Gf={AUDIO:(n,e)=>()=>{const{mediaTypes:{[n]:t},excludePlaylist:i}=e,a=t.activeTrack(),l=t.activeGroup(),u=(l.filter(f=>f.default)[0]||l[0]).id,h=t.tracks[u];if(a===h){i({error:{message:"Problem encountered loading the default audio track."}});return}Fe.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const f in t.tracks)t.tracks[f].enabled=t.tracks[f]===h;t.onTrackChanged()},SUBTITLES:(n,e)=>()=>{const{mediaTypes:{[n]:t}}=e;Fe.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},k_={AUDIO:(n,e,t)=>{if(!e)return;const{tech:i,requestOptions:a,segmentLoaders:{[n]:l}}=t;e.on("loadedmetadata",()=>{const u=e.media();l.playlist(u,a),(!i.paused()||u.endList&&i.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),a),i.paused()||l.load()}),e.on("error",Gf[n](n,t))},SUBTITLES:(n,e,t)=>{const{tech:i,requestOptions:a,segmentLoaders:{[n]:l},mediaTypes:{[n]:u}}=t;e.on("loadedmetadata",()=>{const h=e.media();l.playlist(h,a),l.track(u.activeTrack()),(!i.paused()||h.endList&&i.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),a),i.paused()||l.load()}),e.on("error",Gf[n](n,t))}},a8={AUDIO:(n,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[n]:a},requestOptions:l,main:{mediaGroups:u},mediaTypes:{[n]:{groups:h,tracks:f,logger_:g}},mainPlaylistLoader:w}=e,S=Cd(w.main);(!u[n]||Object.keys(u[n]).length===0)&&(u[n]={main:{default:{default:!0}}},S&&(u[n].main.default.playlists=w.main.playlists));for(const A in u[n]){h[A]||(h[A]=[]);for(const C in u[n][A]){let j=u[n][A][C],k;if(S?(g(`AUDIO group '${A}' label '${C}' is a main playlist`),j.isMainPlaylist=!0,k=null):i==="vhs-json"&&j.playlists?k=new ou(j.playlists[0],t,l):j.resolvedUri?k=new ou(j.resolvedUri,t,l):j.playlists&&i==="dash"?k=new ay(j.playlists[0],t,l,w):k=null,j=ai({id:C,playlistLoader:k},j),k_[n](n,j.playlistLoader,e),h[A].push(j),typeof f[C]>"u"){const B=new Fe.AudioTrack({id:C,kind:n8(j),enabled:!1,language:j.language,default:j.default,label:C});f[C]=B}}}a.on("error",Gf[n](n,e))},SUBTITLES:(n,e)=>{const{tech:t,vhs:i,sourceType:a,segmentLoaders:{[n]:l},requestOptions:u,main:{mediaGroups:h},mediaTypes:{[n]:{groups:f,tracks:g}},mainPlaylistLoader:w}=e;for(const S in h[n]){f[S]||(f[S]=[]);for(const A in h[n][S]){if(!i.options_.useForcedSubtitles&&h[n][S][A].forced)continue;let C=h[n][S][A],j;if(a==="hls")j=new ou(C.resolvedUri,i,u);else if(a==="dash"){if(!C.playlists.filter(B=>B.excludeUntil!==1/0).length)return;j=new ay(C.playlists[0],i,u,w)}else a==="vhs-json"&&(j=new ou(C.playlists?C.playlists[0]:C.resolvedUri,i,u));if(C=ai({id:A,playlistLoader:j},C),k_[n](n,C.playlistLoader,e),f[S].push(C),typeof g[A]>"u"){const k=t.addRemoteTextTrack({id:A,kind:"subtitles",default:C.default&&C.autoselect,language:C.language,label:A},!1).track;g[A]=k}}}l.on("error",Gf[n](n,e))},"CLOSED-CAPTIONS":(n,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[n]:{groups:a,tracks:l}}}=e;for(const u in i[n]){a[u]||(a[u]=[]);for(const h in i[n][u]){const f=i[n][u][h];if(!/^(?:CC|SERVICE)/.test(f.instreamId))continue;const g=t.options_.vhs&&t.options_.vhs.captionServices||{};let w={label:h,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(g[w.instreamId]&&(w=ai(w,g[w.instreamId])),w.default===void 0&&delete w.default,a[u].push(ai({id:h},f)),typeof l[h]>"u"){const S=t.addRemoteTextTrack({id:w.instreamId,kind:"captions",default:w.default,language:w.language,label:w.label},!1).track;l[h]=S}}}}},fk=(n,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:i,mediaTypes:{[n]:{groups:a}}}=e,l=i.media();if(!l)return null;let u=null;l.attributes[n]&&(u=a[l.attributes[n]]);const h=Object.keys(a);if(!u)if(n==="AUDIO"&&h.length>1&&Cd(e.main))for(let f=0;f"u"?u:t===null||!u?null:u.filter(f=>f.id===t.id)[0]||null},l8={AUDIO:(n,e)=>()=>{const{mediaTypes:{[n]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(n,e)=>()=>{const{mediaTypes:{[n]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},u8=(n,{mediaTypes:e})=>()=>{const t=e[n].activeTrack();return t?e[n].activeGroup(t):null},c8=n=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(g=>{a8[g](g,n)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:a,segmentLoaders:{["AUDIO"]:l,main:u}}=n;["AUDIO","SUBTITLES"].forEach(g=>{e[g].activeGroup=o8(g,n),e[g].activeTrack=l8[g](g,n),e[g].onGroupChanged=i8(g,n),e[g].onGroupChanging=r8(g,n),e[g].onTrackChanged=s8(g,n),e[g].getActiveGroup=u8(g,n)});const h=e.AUDIO.activeGroup();if(h){const g=(h.filter(S=>S.default)[0]||h[0]).id;e.AUDIO.tracks[g].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(u.setAudio(!1),l.setAudio(!0)):u.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(g=>e[g].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(g=>e[g].onGroupChanging())});const f=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",f),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),a.on("dispose",()=>{i.audioTracks().removeEventListener("change",f),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const g in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[g])},d8=()=>{const n={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{n[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ra,activeTrack:Ra,getActiveGroup:Ra,onGroupChanged:Ra,onTrackChanged:Ra,lastTrack_:null,logger_:Cs(`MediaGroups[${e}]`)}}),n};class E_{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Kr(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class h8 extends Fe.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new E_,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Cs("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=Kr(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const a={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:a}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(l,u)=>{if(l){if(u.status===410){this.logger_(`manifest request 410 ${l}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(u.status===429){const g=u.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${l}.`),this.logger_(`content steering will retry in ${g} seconds.`),this.startTTLTimeout_(parseInt(g,10));return}this.logger_(`manifest failed to load ${l}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:a});let h;try{h=JSON.parse(this.request_.responseText)}catch(g){const w={errorType:Fe.Error.StreamingContentSteeringParserError,error:g};this.trigger({type:"error",metadata:w})}this.assignSteeringProperties_(h);const f={contentSteeringInfo:a.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:f}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new he.URL(e),i=new he.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(he.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new he.URL(e),i=this.getPathway(),a=this.getBandwidth_();if(i){const l=`_${this.manifestType_}_pathway`;t.searchParams.set(l,i)}if(a){const l=`_${this.manifestType_}_throughput`;t.searchParams.set(l,a)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const i=(a=>{for(const l of a)if(this.availablePathways_.has(l))return l;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=a=>this.excludedSteeringManifestURLs.has(a);if(this.proxyServerUrl_){const a=this.setProxyServerUrl_(e);if(!t(a))return a}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=he.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){he.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new E_}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Kr(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const f8=(n,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(null,i)},e)}},m8=10;let xo;const p8=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],g8=function(n){return this.audioSegmentLoader_[n]+this.mainSegmentLoader_[n]},y8=function({currentPlaylist:n,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:a,bufferHighWaterLine:l,duration:u,bufferBasedABR:h,log:f}){if(!i)return Fe.log.warn("We received no playlist to switch to. Please check your stream."),!1;const g=`allowing switch ${n&&n.id||"null"} -> ${i.id}`;if(!n)return f(`${g} as current playlist is not set`),!0;if(i.id===n.id)return!1;const w=!!au(e,t).length;if(!n.endList)return!w&&typeof n.partTargetDuration=="number"?(f(`not ${g} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(f(`${g} as current playlist is live`),!0);const S=eb(e,t),A=h?pr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:pr.MAX_BUFFER_LOW_WATER_LINE;if(uj)&&S>=a){let k=`${g} as forwardBuffer >= bufferLowWaterLine (${S} >= ${a})`;return h&&(k+=` and next bandwidth > current bandwidth (${C} > ${j})`),f(k),!0}return f(`not ${g} as no switching criteria met`),!1};class b8 extends Fe.EventTarget{constructor(e){super(),this.fastQualityChange_=f8(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:a,bandwidth:l,externVhs:u,useCueTags:h,playlistExclusionDuration:f,enableLowInitialPlaylist:g,sourceType:w,cacheEncryptionKeys:S,bufferBasedABR:A,leastPixelDiffSelector:C,captionServices:j,experimentalUseMMS:k}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:B}=e;(B===null||typeof B>"u")&&(B=1/0),xo=u,this.bufferBasedABR=!!A,this.leastPixelDiffSelector=!!C,this.withCredentials=i,this.tech_=a,this.vhs_=a.vhs,this.player_=e.player_,this.sourceType_=w,this.useCueTags_=h,this.playlistExclusionDuration=f,this.maxPlaylistRetries=B,this.enableLowInitialPlaylist=g,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:B,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=d8(),k&&he.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new he.ManagedMediaSource,this.usingManagedMediaSource_=!0,Fe.log("Using ManagedMediaSource")):he.MediaSource&&(this.mediaSource=new he.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=yr(),this.hasPlayed_=!1,this.syncController_=new Zj(e),this.segmentMetadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new t8,this.sourceUpdater_=new ck(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Jj,this.keyStatusMap_=new Map;const V={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:j,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:S,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new ay(t,this.vhs_,ai(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ou(t,this.vhs_,ai(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new uy(ai(V,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new uy(ai(V,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Kj(ai(V,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((ie,Y)=>{function G(){a.off("vttjserror",O),ie()}function O(){a.off("vttjsloaded",G),Y()}a.one("vttjsloaded",G),a.one("vttjserror",O),a.addWebVttScript_()})}),e);const W=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new h8(this.vhs_.xhr,W),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),p8.forEach(ie=>{this[ie+"_"]=g8.bind(this,ie)}),this.logger_=Cs("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const H=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(H,()=>{const ie=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-ie,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const a=this.media(),l=a&&(a.id||a.uri),u=e&&(e.id||e.uri);if(l&&l!==u){this.logger_(`switch media ${l} -> ${u} from ${t}`);const h={renditionInfo:{id:u,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:h}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,a=this.contentSteeringController_.getPathway();if(i&&a){const u=(i.length?i[0].playlists:i.playlists).filter(h=>h.attributes.serviceLocation===a);u.length&&this.mediaTypes_[e].activePlaylistLoader.media(u[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=he.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(he.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,a=Object.keys(i);let l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{const h=i.main||a.length&&i[a[0]];for(const f in h)if(h[f].default){l={label:f};break}}if(!l)return t;const u=[];for(const h in i)if(i[h][l.label]){const f=i[h][l.label];if(f.playlists&&f.playlists.length)u.push.apply(u,f.playlists);else if(f.uri)u.push(f);else if(e.playlists.length)for(let g=0;g{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;ty(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),c8({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;ty(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,i=>{this.player_.trigger(tr({},i))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let a=!0;const l=Object.keys(i.AUDIO);for(const u in i.AUDIO)for(const h in i.AUDIO[u])i.AUDIO[u][h].uri||(a=!1);a&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),xo.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),l.length&&Object.keys(i.AUDIO[l[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),a=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),u=this.tech_.buffered();return y8({buffered:u,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:a,bufferHighWaterLine:l,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const a=i.segment.syncInfo.end+.01;this.tech_.setCurrentTime(a)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",i=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:m8}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(i=>{this.mainSegmentLoader_.on(i,a=>{this.player_.trigger(tr({},a))}),this.audioSegmentLoader_.on(i,a=>{this.player_.trigger(tr({},a))}),this.subtitleSegmentLoader_.on(i,a=>{this.player_.trigger(tr({},a))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const a=xo.Playlist.playlistEnd(e,i),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return a-l<=ra;const h=u.end(u.length-1);return h-l<=ra&&a-h<=ra}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const a=this.mainPlaylistLoader_.main.playlists,l=a.filter(Am),u=l.length===1&&l[0]===e;if(a.length===1&&i!==1/0)return Fe.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(u);if(u){if(this.main().contentSteering){const j=this.pathwayAttribute_(e),k=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(j),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(j)},k);return}let C=!1;a.forEach(j=>{if(j===e)return;const k=j.excludeUntil;typeof k<"u"&&k!==1/0&&(C=!0,delete j.excludeUntil)}),C&&(Fe.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let h;e.playlistErrors_>this.maxPlaylistRetries?h=1/0:h=Date.now()+i*1e3,e.excludeUntil=h,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const f=this.selectPlaylist();if(!f){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const g=t.internal?this.logger_:Fe.log.warn,w=t.message?" "+t.message:"";g(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${w} Switching to playlist ${f.id}.`),f.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const S=f.targetDuration/2*1e3||5*1e3,A=typeof f.lastRequest=="number"&&Date.now()-f.lastRequest<=S;return this.switchMedia_(f,"exclude",u||A)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],a=e==="all";(a||e==="main")&&i.push(this.mainPlaylistLoader_);const l=[];(a||e==="audio")&&l.push("AUDIO"),(a||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(u=>{const h=this.mediaTypes_[u]&&this.mediaTypes_[u].activePlaylistLoader;h&&i.push(h)}),["main","audio","subtitle"].forEach(u=>{const h=this[`${u}SegmentLoader_`];h&&(e===u||e==="all")&&i.push(h)}),i.forEach(u=>t.forEach(h=>{typeof u[h]=="function"&&u[h]()}))}setCurrentTime(e){const t=au(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:xo.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const a=this.syncController_.getMediaSequenceSync(t);if(a&&a.isReliable){const h=a.start,f=a.end;if(!isFinite(h)||!isFinite(f))return null;const g=xo.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),w=Math.max(h,f-g);return yr([[h,w]])}const l=this.syncController_.getExpiredTime(i,this.duration());if(l===null)return null;const u=xo.Playlist.seekable(i,l,xo.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return u.length?u:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),a=e.end(0),l=t.start(0),u=t.end(0);return l>a||i>u?e:yr([[Math.max(i,l),Math.min(a,u)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${ST(this.seekable_)}]`);const a={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:a}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const a=this.seekable();if(!a.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(a=>{a.playlistLoader&&a.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=ld(this.main(),t),a={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(a.video=i.video||e.main.videoCodec||aD),e.main.isMuxed&&(a.video+=`,${i.audio||e.main.audioCodec||p2}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||l)&&(a.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||p2,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!a.audio&&!a.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const u=(g,w)=>g?id(w,this.usingManagedMediaSource_):Z0(w),h={};let f;if(["video","audio"].forEach(function(g){if(a.hasOwnProperty(g)&&!u(e[g].isFmp4,a[g])){const w=e[g].isFmp4?"browser":"muxer";h[w]=h[w]||[],h[w].push(a[g]),g==="audio"&&(f=w)}}),l&&f&&t.attributes.AUDIO){const g=t.attributes.AUDIO;this.main().playlists.forEach(w=>{(w.attributes&&w.attributes.AUDIO)===g&&w!==t&&(w.excludeUntil=1/0)}),this.logger_(`excluding audio group ${g} as ${f} does not support codec(s): "${a.audio}"`)}if(Object.keys(h).length){const g=Object.keys(h).reduce((w,S)=>(w&&(w+=", "),w+=`${S} does not support codec(s): "${h[S].join(",")}"`,w),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:g},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const g=[];if(["video","audio"].forEach(w=>{const S=(ea(this.sourceUpdater_.codecs[w]||"")[0]||{}).type,A=(ea(a[w]||"")[0]||{}).type;S&&A&&S.toLowerCase()!==A.toLowerCase()&&g.push(`"${this.sourceUpdater_.codecs[w]}" -> "${a[w]}"`)}),g.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${g.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return a}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const a=e[i];if(t.indexOf(a.id)!==-1)return;t.push(a.id);const l=ld(this.main,a),u=[];l.audio&&!Z0(l.audio)&&!id(l.audio,this.usingManagedMediaSource_)&&u.push(`audio codec ${l.audio}`),l.video&&!Z0(l.video)&&!id(l.video,this.usingManagedMediaSource_)&&u.push(`video codec ${l.video}`),l.text&&l.text==="stpp.ttml.im1t"&&u.push(`text codec ${l.text}`),u.length&&(a.excludeUntil=1/0,this.logger_(`excluding ${a.id} for unsupported: ${u.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,a=yd(ea(e)),l=l_(a),u=a.video&&ea(a.video)[0]||null,h=a.audio&&ea(a.audio)[0]||null;Object.keys(i).forEach(f=>{const g=i[f];if(t.indexOf(g.id)!==-1||g.excludeUntil===1/0)return;t.push(g.id);const w=[],S=ld(this.mainPlaylistLoader_.main,g),A=l_(S);if(!(!S.audio&&!S.video)){if(A!==l&&w.push(`codec count "${A}" !== "${l}"`),!this.sourceUpdater_.canChangeType()){const C=S.video&&ea(S.video)[0]||null,j=S.audio&&ea(S.audio)[0]||null;C&&u&&C.type.toLowerCase()!==u.type.toLowerCase()&&w.push(`video codec "${C.type}" !== "${u.type}"`),j&&h&&j.type.toLowerCase()!==h.type.toLowerCase()&&w.push(`audio codec "${j.type}" !== "${h.type}"`)}w.length&&(g.excludeUntil=1/0,this.logger_(`excluding ${g.id}: ${w.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),Xj(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=pr.GOAL_BUFFER_LENGTH,i=pr.GOAL_BUFFER_LENGTH_RATE,a=Math.max(t,pr.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,a)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=pr.BUFFER_LOW_WATER_LINE,i=pr.BUFFER_LOW_WATER_LINE_RATE,a=Math.max(t,pr.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(t,pr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?l:a)}bufferHighWaterLine(){return pr.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){g_(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Aj({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const a=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();g_(this.inbandTextTracks_,e,this.tech_),kj({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:a,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,i=>{this.trigger(tr({},i))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const l=this.contentSteeringController_.getAvailablePathways(),u=[];for(const h of t.playlists){const f=h.attributes.serviceLocation;if(f&&(u.push(f),!l.has(f)))return!0}return!!(!u.length&&l.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,a=new Set;let l=!1;Object.keys(i).forEach(u=>{const h=i[u],f=this.pathwayAttribute_(h),g=f&&e!==f;h.excludeUntil===1/0&&h.lastExcludeReason_==="content-steering"&&!g&&(delete h.excludeUntil,delete h.lastExcludeReason_,l=!0);const S=!h.excludeUntil&&h.excludeUntil!==1/0;!a.has(h.id)&&g&&S&&(a.add(h.id),h.excludeUntil=1/0,h.lastExcludeReason_="content-steering",this.logger_(`excluding ${h.id} for ${h.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(u=>{const h=this.mediaTypes_[u];if(h.activePlaylistLoader){const f=h.activePlaylistLoader.media_;f&&f.attributes.serviceLocation!==e&&(l=!0)}}),l&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,a=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||a&&a.size){for(const[u,h]of i.entries())a.get(u)||(this.mainPlaylistLoader_.updateOrDeleteClone(h),this.contentSteeringController_.excludePathway(u));for(const[u,h]of a.entries()){const f=i.get(u);if(!f){t.filter(w=>w.attributes["PATHWAY-ID"]===h["BASE-ID"]).forEach(w=>{this.mainPlaylistLoader_.addClonePathway(h,w)}),this.contentSteeringController_.addAvailablePathway(u);continue}this.equalPathwayClones_(f,h)||(this.mainPlaylistLoader_.updateOrDeleteClone(h,!0),this.contentSteeringController_.addAvailablePathway(u))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...a])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,a=t["URI-REPLACEMENT"].PARAMS;for(const l in i)if(i[l]!==a[l])return!1;for(const l in a)if(i[l]!==a[l])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const a=this.mainPlaylistLoader_.getKeyIdSet(i);!a||!a.size||a.forEach(l=>{const u="usable",h=this.keyStatusMap_.has(l)&&this.keyStatusMap_.get(l)===u,f=i.lastExcludeReason_===t&&i.excludeUntil===1/0;h?h&&f&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${l} is ${u}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${l} doesn't exist in the keyStatusMap or is not ${u}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const a=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,l=i.excludeUntil===1/0&&i.lastExcludeReason_===t;a&&l&&(delete i.excludeUntil,Fe.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const l=(typeof e=="string"?e:Vj(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${l} added to the keyStatusMap`),this.keyStatusMap_.set(l,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const v8=(n,e,t)=>i=>{const a=n.main.playlists[e],l=nb(a),u=Am(a);if(typeof i>"u")return u;i?delete a.disabled:a.disabled=!0;const h={renditionInfo:{id:e,bandwidth:a.attributes.BANDWIDTH,resolution:a.attributes.RESOLUTION,codecs:a.attributes.CODECS},cause:"fast-quality"};return i!==u&&!l&&(i?(t(a),n.trigger({type:"renditionenabled",metadata:h})):n.trigger({type:"renditiondisabled",metadata:h})),i};class x8{constructor(e,t,i){const{playlistController_:a}=e,l=a.fastQualityChange_.bind(a);if(t.attributes){const u=t.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=ld(a.main(),t),this.playlist=t,this.id=i,this.enabled=v8(e.playlists,t.id,l)}}const _8=function(n){n.representations=()=>{const e=n.playlistController_.main(),t=Cd(e)?n.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!nb(i)).map((i,a)=>new x8(n,i,i.id)):[]}},C_=["seeking","seeked","pause","playing","error"];class w8 extends Fe.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Cs("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),a=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),u=this.playlistController_,h=["main","subtitle","audio"],f={};h.forEach(w=>{f[w]={reset:()=>this.resetSegmentDownloads_(w),updateend:()=>this.checkSegmentDownloads_(w)},u[`${w}SegmentLoader_`].on("appendsdone",f[w].updateend),u[`${w}SegmentLoader_`].on("playlistupdate",f[w].reset),this.tech_.on(["seeked","seeking"],f[w].reset)});const g=w=>{["main","audio"].forEach(S=>{u[`${S}SegmentLoader_`][w]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),g("off"))},this.clearSeekingAppendCheck_=()=>g("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),g("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(C_,l),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",a),this.tech_.off(C_,l),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),h.forEach(w=>{u[`${w}SegmentLoader_`].off("appendsdone",f[w].updateend),u[`${w}SegmentLoader_`].off("playlistupdate",f[w].reset),this.tech_.off(["seeked","seeking"],f[w].reset)}),this.checkCurrentTimeTimeout_&&he.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&he.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=he.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],a=i.buffered_(),l=oR(this[`${e}Buffered_`],a);if(this[`${e}Buffered_`]=a,l){const u={bufferedRanges:a};t.trigger({type:"bufferedrangeschanged",metadata:u}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:cl(a)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+ra>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(yr([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),a=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let l;if(a&&(l=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const j=t.start(0);l=j+(j===t.end(0)?0:ra)}if(typeof l<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${ST(t)}. Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0;const u=this.playlistController_.sourceUpdater_,h=this.tech_.buffered(),f=u.audioBuffer?u.audioBuffered():null,g=u.videoBuffer?u.videoBuffered():null,w=this.media(),S=w.partTargetDuration?w.partTargetDuration:(w.targetDuration-ia)*2,A=[f,g];for(let j=0;j ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const h=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${h}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(h),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,a=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const u=Zh(a,t);return u.length>0?(this.logger_(`Stopped at ${t} and seeking to ${u.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,a=!1){if(!e.length)return!1;let l=e.end(e.length-1)+ra;const u=!i.endList,h=typeof i.partTargetDuration=="number";return u&&(h||a)&&(l=e.end(e.length-1)+i.targetDuration*3),t>l}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:l,end:u}}return null}}const S8={errorInterval:30,getSource(n){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return n(t)}},mk=function(n,e){let t=0,i=0;const a=ai(S8,e);n.ready(()=>{n.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){i&&n.currentTime(i)},u=function(w){w!=null&&(i=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",l),n.src(w),n.trigger({type:"usage",name:"vhs-error-reload"}),n.play())},h=function(){if(Date.now()-t{Object.defineProperty(Ui,n,{get(){return Fe.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),pr[n]},set(e){if(Fe.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){Fe.log.warn(`value of Vhs.${n} must be greater than or equal to 0`);return}pr[n]=e}})});const gk="videojs-vhs",yk=function(n,e){const t=e.media();let i=-1;for(let a=0;a{n.addQualityLevel(t)}),yk(n,e.playlists)};Ui.canPlaySource=function(){return Fe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const D8=(n,e,t)=>{if(!n)return n;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=yd(ea(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const a=Su(i.video),l=Su(i.audio),u={};for(const h in n)u[h]={},l&&(u[h].audioContentType=l),a&&(u[h].videoContentType=a),e.contentProtection&&e.contentProtection[h]&&e.contentProtection[h].pssh&&(u[h].pssh=e.contentProtection[h].pssh),typeof n[h]=="string"&&(u[h].url=n[h]);return ai(n,u)},M8=(n,e)=>n.reduce((t,i)=>{if(!i.contentProtection)return t;const a=e.reduce((l,u)=>{const h=i.contentProtection[u];return h&&h.pssh&&(l[u]={pssh:h.pssh}),l},{});return Object.keys(a).length&&t.push(a),t},[]),R8=({player:n,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!n.eme.initializeMediaKeys)return Promise.resolve();const a=t?i.concat([t]):i,l=M8(a,Object.keys(e)),u=[],h=[];return l.forEach(f=>{h.push(new Promise((g,w)=>{n.tech_.one("keysessioncreated",g)})),u.push(new Promise((g,w)=>{n.eme.initializeMediaKeys({keySystems:f},S=>{if(S){w(S);return}g()})}))}),Promise.race([Promise.all(u),Promise.race(h)])},j8=({player:n,sourceKeySystems:e,media:t,audioMedia:i})=>{const a=D8(e,t,i);return a?(n.currentSource().keySystems=a,a&&!n.eme?(Fe.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},bk=()=>{if(!he.localStorage)return null;const n=he.localStorage.getItem(gk);if(!n)return null;try{return JSON.parse(n)}catch{return null}},O8=n=>{if(!he.localStorage)return!1;let e=bk();e=e?ai(e,n):n;try{he.localStorage.setItem(gk,JSON.stringify(e))}catch{return!1}return e},L8=n=>n.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(n.substring(n.indexOf(",")+1)):n,vk=(n,e)=>{n._requestCallbackSet||(n._requestCallbackSet=new Set),n._requestCallbackSet.add(e)},xk=(n,e)=>{n._responseCallbackSet||(n._responseCallbackSet=new Set),n._responseCallbackSet.add(e)},_k=(n,e)=>{n._requestCallbackSet&&(n._requestCallbackSet.delete(e),n._requestCallbackSet.size||delete n._requestCallbackSet)},wk=(n,e)=>{n._responseCallbackSet&&(n._responseCallbackSet.delete(e),n._responseCallbackSet.size||delete n._responseCallbackSet)};Ui.supportsNativeHls=(function(){if(!Tt||!Tt.createElement)return!1;const n=Tt.createElement("video");return Fe.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(n.canPlayType(t))}):!1})();Ui.supportsNativeDash=(function(){return!Tt||!Tt.createElement||!Fe.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Tt.createElement("video").canPlayType("application/dash+xml"))})();Ui.supportsTypeNatively=n=>n==="hls"?Ui.supportsNativeHls:n==="dash"?Ui.supportsNativeDash:!1;Ui.isSupported=function(){return Fe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Ui.xhr.onRequest=function(n){vk(Ui.xhr,n)};Ui.xhr.onResponse=function(n){xk(Ui.xhr,n)};Ui.xhr.offRequest=function(n){_k(Ui.xhr,n)};Ui.xhr.offResponse=function(n){wk(Ui.xhr,n)};const I8=Fe.getComponent("Component");class Sk extends I8{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Cs("VhsHandler"),t.options_&&t.options_.playerId){const a=Fe.getPlayer(t.options_.playerId);this.player_=a}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Tt,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],a=>{const l=Tt.fullscreenElement||Tt.webkitFullscreenElement||Tt.mozFullScreenElement||Tt.msFullscreenElement;l&&l.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ai(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=bk();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=pr.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===pr.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=L8(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ui,this.options_.sourceType=qw(t),this.options_.seekTo=l=>{this.tech_.setCurrentTime(l)},this.options_.player_=this.player_,this.playlistController_=new b8(this.options_);const i=ai({liveRangeSafeTimeDelta:ra},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new w8(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const l=Fe.players[this.tech_.options_.playerId];let u=this.playlistController_.error;typeof u=="object"&&!u.code?u.code=3:typeof u=="string"&&(u={message:u,code:3}),l.error(u)});const a=this.options_.bufferBasedABR?Ui.movingAverageBandwidthSelector(.55):Ui.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.playlistController_.selectInitialPlaylist=Ui.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(l){this.playlistController_.selectPlaylist=l.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(l){this.playlistController_.mainSegmentLoader_.throughput.rate=l,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let l=this.playlistController_.mainSegmentLoader_.bandwidth;const u=he.navigator.connection||he.navigator.mozConnection||he.navigator.webkitConnection,h=1e7;if(this.options_.useNetworkInformationApi&&u){const f=u.downlink*1e3*1e3;f>=h&&l>=h?l=Math.max(l,f):l=f}return l},set(l){this.playlistController_.mainSegmentLoader_.bandwidth=l,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const l=1/(this.bandwidth||1);let u;return this.throughput>0?u=1/this.throughput:u=0,Math.floor(1/(l+u))},set(){Fe.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>cl(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>cl(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&O8({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{_8(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=he.URL.createObjectURL(this.playlistController_.mediaSource),(Fe.browser.IS_ANY_SAFARI||Fe.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),R8({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=j8({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=Fe.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{N8(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{yk(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":pk,"mux.js":k8,"mpd-parser":E8,"m3u8-parser":C8,"aes-decrypter":A8}}version(){return this.constructor.version()}canChangeType(){return ck.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&he.URL.revokeObjectURL&&(he.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return UR({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,a=2){return KT({programTime:e,playlist:this.playlistController_.media(),retryCount:a,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{vk(this.xhr,e)},this.xhr.onResponse=e=>{xk(this.xhr,e)},this.xhr.offRequest=e=>{_k(this.xhr,e)},this.xhr.offResponse=e=>{wk(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,a=>{this.player_.trigger(tr({},a))})}),t.forEach(i=>{this.playbackWatcher_.on(i,a=>{this.player_.trigger(tr({},a))})})}}const Kf={name:"videojs-http-streaming",VERSION:pk,canHandleSource(n,e={}){const t=ai(Fe.options,e);return!t.vhs.experimentalUseMMS&&!id("avc1.4d400d,mp4a.40.2",!1)?!1:Kf.canPlayType(n.type,t)},handleSource(n,e,t={}){const i=ai(Fe.options,t);return e.vhs=new Sk(n,e,i),e.vhs.xhr=HT(),e.vhs.setupXhrHooks_(),e.vhs.src(n.src,n.type),e.vhs},canPlayType(n,e){const t=qw(n);if(!t)return"";const i=Kf.getOverrideNative(e);return!Ui.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(n={}){const{vhs:e={}}=n,t=!(Fe.browser.IS_ANY_SAFARI||Fe.browser.IS_IOS),{overrideNative:i=t}=e;return i}},B8=()=>id("avc1.4d400d,mp4a.40.2",!0);B8()&&Fe.getTech("Html5").registerSourceHandler(Kf,0);Fe.VhsHandler=Sk;Fe.VhsSourceHandler=Kf;Fe.Vhs=Ui;Fe.use||Fe.registerComponent("Vhs",Ui);Fe.options.vhs=Fe.options.vhs||{};(!Fe.getPlugin||!Fe.getPlugin("reloadSourceOnError"))&&Fe.registerPlugin("reloadSourceOnError",T8);const P8="",sl=n=>{const e=n.startsWith("/")?n:`/${n}`;return`${P8}${e}`};async function vg(n,e){const t=await fetch(sl(n),{...e,credentials:"include",headers:{...e?.headers??{},"Content-Type":e?.headers?.["Content-Type"]??"application/json"}});return t.status===401&&(location.pathname.startsWith("/login")||(location.href="/login")),t}function ab({src:n,muted:e=Ef,className:t,roomStatus:i}){const a=m.useRef(null),[l,u]=m.useState(!1),[h,f]=m.useState(null),g=S=>{const A=String(S??"").trim().toLowerCase();return A==="private"?"private":A==="hidden"?"hidden":A==="away"?"away":"offline"},w=S=>{switch(S){case"hidden":return"Cam is hidden";case"away":return"Model is away";case"private":return"Private show in progress.";case"offline":return"Model is offline";default:return"Live video unavailable"}};return m.useEffect(()=>{let S=!1,A=null;const C=a.current;if(!C)return;u(!1),f(null),cd(C,{muted:e});const j=()=>{try{C.pause(),C.removeAttribute("src"),C.load()}catch{}};j(),C.src=n,C.load(),C.play().catch(()=>{});let k=Date.now();const B=()=>{k=Date.now()};C.addEventListener("timeupdate",B);let V=0;A=window.setInterval(()=>{if(!S&&!C.paused&&Date.now()-k>12e3){if(V<1){V+=1,j(),C.src=n,C.load(),C.play().catch(()=>{}),k=Date.now();return}u(!0),f(g(i))}},4e3);const W=()=>{u(!0),f(g(i))};return C.addEventListener("error",W),()=>{S=!0,A&&window.clearInterval(A),A=null,C.removeEventListener("timeupdate",B),C.removeEventListener("error",W),j()}},[n,e,i]),l?c.jsx("div",{className:"grid h-full w-full place-items-center bg-black/80 px-4 text-center",children:c.jsx("div",{className:"text-sm font-medium text-white",children:w(h)})}):c.jsx("video",{ref:a,className:t,playsInline:!0,autoPlay:!0,muted:e,preload:"auto",crossOrigin:"anonymous",onClick:()=>{const S=a.current;S&&(S.muted=!1,S.play().catch(()=>{}))}})}const xs=n=>(n||"").replaceAll("\\","/").split("/").pop()||"",ob=n=>n.startsWith("HOT ")?n.slice(4):n,F8=n=>(n||"").trim().toLowerCase(),U8=n=>{const e=String(n??"").trim();if(!e)return[];const t=e.split(/[\n,;|]+/g).map(l=>l.trim()).filter(Boolean),i=new Set,a=[];for(const l of t){const u=l.toLowerCase();i.has(u)||(i.add(u),a.push(l))}return a.sort((l,u)=>l.localeCompare(u,void 0,{sensitivity:"base"})),a};function z8(n){if(!Number.isFinite(n)||n<=0)return"—";const e=Math.floor(n/1e3),t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t>0?`${t}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function H8(n){if(typeof n!="number"||!Number.isFinite(n)||n<=0)return"—";const e=["B","KB","MB","GB","TB"];let t=n,i=0;for(;t>=1024&&i=100?0:t>=10?1:2;return`${t.toFixed(a)} ${e[i]}`}function A_(n){if(!n)return"—";const e=n instanceof Date?n:new Date(n),t=e.getTime();return Number.isFinite(t)?e.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}const tf=(...n)=>{for(const e of n){const t=typeof e=="string"?Number(e):e;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t}return null};function $8(n){if(!n||!Number.isFinite(n))return"—";const e=n>=10?0:2;return`${n.toFixed(e)} fps`}function q8(n){return!n||!Number.isFinite(n)?"—":`${Math.round(n)}p`}function V8(n){const e=xs(n||""),t=ob(e);if(!t)return null;const a=t.replace(/\.[^.]+$/,"").match(/_(\d{1,2})_(\d{1,2})_(\d{4})__(\d{1,2})-(\d{2})-(\d{2})$/);if(!a)return null;const l=Number(a[1]),u=Number(a[2]),h=Number(a[3]),f=Number(a[4]),g=Number(a[5]),w=Number(a[6]);return[l,u,h,f,g,w].every(S=>Number.isFinite(S))?new Date(h,l-1,u,f,g,w):null}const G8=n=>{const e=xs(n||""),t=ob(e);if(!t)return"—";const i=t.replace(/\.[^.]+$/,""),a=i.match(/^(.*?)_\d{1,2}_\d{1,2}_\d{4}__\d{1,2}-\d{2}-\d{2}$/);if(a?.[1])return a[1];const l=i.lastIndexOf("_");return l>0?i.slice(0,l):i},K8=n=>{const e=n,t=e.sizeBytes??e.fileSizeBytes??e.bytes??e.size??null;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null};function Aa(...n){return n.filter(Boolean).join(" ")}function W8(n){const[e,t]=m.useState(!1);return m.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia(n),a=()=>t(i.matches);return a(),i.addEventListener?i.addEventListener("change",a):i.addListener(a),()=>{i.removeEventListener?i.removeEventListener("change",a):i.removeListener(a)}},[n]),e}function X8(n){!n||n.__absTimelineShimInstalled||(n.__absTimelineShimInstalled=!0,n.__origCurrentTime=n.currentTime.bind(n),n.__origDuration=n.duration.bind(n),n.__setRelativeTime=e=>{try{n.__origCurrentTime(Math.max(0,e||0))}catch{}},n.currentTime=function(e){const t=Number(this.__timeOffsetSec??0)||0;if(typeof e=="number"&&Number.isFinite(e)){const a=Math.max(0,e);return typeof this.__serverSeekAbs=="function"?(this.__serverSeekAbs(a),a):this.__origCurrentTime(Math.max(0,a-t))}const i=Number(this.__origCurrentTime()??0)||0;return Math.max(0,t+i)},n.duration=function(){const e=Number(this.__fullDurationSec??0)||0;if(e>0)return e;const t=Number(this.__timeOffsetSec??0)||0,i=Number(this.__origDuration()??0)||0;return Math.max(0,t+i)})}function Y8({job:n,expanded:e,onClose:t,onToggleExpand:i,modelKey:a,modelsByKey:l,isHot:u=!1,isFavorite:h=!1,isLiked:f=!1,isWatching:g=!1,onKeep:w,onDelete:S,onToggleHot:A,onToggleFavorite:C,onToggleLike:j,onToggleWatch:k,onStopJob:B,startMuted:V=GN,startAtSec:W=0}){const H=m.useMemo(()=>xs(n.output?.trim()||"")||n.id,[n.output,n.id]),ie=m.useMemo(()=>xs(n.output?.trim()||""),[n.output]),Y=m.useMemo(()=>xs(n.output?.trim()||""),[n.output]),G=m.useMemo(()=>H8(K8(n)),[n]),O=n,[re,E]=m.useState(()=>Number(n?.meta?.durationSeconds)||Number(n?.durationSeconds)||0),[R,ee]=m.useState(()=>n.status==="running"),[q,Q]=m.useState(()=>({h:0,fps:null})),ue=n.status==="running",[se,$]=m.useState(!1),F=ue&&se,X=m.useMemo(()=>(Y||"").replace(/\.[^.]+$/,""),[Y]),le=m.useMemo(()=>ue?n.id:X||n.id,[ue,n.id,X]);m.useEffect(()=>{if(ue||re>0)return;const ae=xs(n.output?.trim()||"");if(!ae)return;let ke=!0;const pt=new AbortController;return(async()=>{try{const xt=sl(`/api/record/done/meta?file=${encodeURIComponent(ae)}`),Rt=await vg(xt,{signal:pt.signal,cache:"no-store"});if(!Rt.ok)return;const Et=await Rt.json(),Z=Number(Et?.durationSeconds||Et?.meta?.durationSeconds||0)||0;if(!ke||Z<=0)return;E(Z);const ce=et.current;if(ce&&!ce.isDisposed?.())try{ce.__fullDurationSec=Z,ce.trigger?.("durationchange"),ce.trigger?.("timeupdate")}catch{}}catch{}})(),()=>{ke=!1,pt.abort()}},[ue,re,n.output]);const de=ie.startsWith("HOT "),L=m.useMemo(()=>{const ae=(a||"").trim();return ae||G8(n.output)},[a,n.output]),pe=m.useMemo(()=>ob(ie),[ie]),we=m.useMemo(()=>{const ae=Number(re||0)||0;return ae>0?z8(ae*1e3):"—"},[re]),Be=m.useMemo(()=>{const ae=V8(n.output);if(ae)return A_(ae);const ke=O.startedAt??O.endedAt??O.createdAt??O.fileCreatedAt??O.ctime??null,pt=ke?new Date(ke):null;return A_(pt&&Number.isFinite(pt.getTime())?pt:null)},[n.output,O.startedAt,O.endedAt,O.createdAt,O.fileCreatedAt,O.ctime]),Ve=m.useMemo(()=>F8((a||L||"").trim()),[a,L]),Oe=m.useMemo(()=>{const ae=l?.[Ve];return U8(ae?.tags)},[l,Ve]),Te=m.useMemo(()=>sl(`/api/preview?id=${encodeURIComponent(le)}&file=preview.webp`),[le]),_t=m.useMemo(()=>sl(`/api/preview/live?id=${encodeURIComponent(le)}&play=1`),[le]),[dt,xe]=m.useState(Te);m.useEffect(()=>{xe(Te)},[Te]);const Ne=m.useMemo(()=>tf(q.h,O.videoHeight,O.height,O.meta?.height),[q.h,O.videoHeight,O.height,O.meta?.height]),Se=m.useMemo(()=>tf(q.fps,O.fps,O.frameRate,O.meta?.fps,O.meta?.frameRate),[q.fps,O.fps,O.frameRate,O.meta?.fps,O.meta?.frameRate]),[Ie,$e]=m.useState(null),Ct=m.useMemo(()=>q8(Ie??Ne),[Ie,Ne]),st=m.useMemo(()=>$8(Se),[Se]);m.useEffect(()=>{const ae=ke=>ke.key==="Escape"&&t();return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[t]);const gt=m.useMemo(()=>{const ae=`/api/preview?id=${encodeURIComponent(le)}&file=index_hq.m3u8&play=1`;return sl(ue?`${ae}&t=${Date.now()}`:ae)},[le,ue]);m.useEffect(()=>{if(!ue){$(!1);return}let ae=!0;const ke=new AbortController;return $(!1),(async()=>{for(let xt=0;xt<120&&ae&&!ke.signal.aborted;xt++){try{const Rt=await vg(gt,{method:"GET",cache:"no-store",signal:ke.signal,headers:{"cache-control":"no-cache"}});if(Rt.ok){const Et=await Rt.text(),Z=Et.includes("#EXTM3U"),ce=/#EXTINF:/i.test(Et)||/\.ts(\?|$)/i.test(Et)||/\.m4s(\?|$)/i.test(Et);if(Z&&ce){ae&&$(!0);return}}}catch{}await new Promise(Rt=>setTimeout(Rt,500))}})(),()=>{ae=!1,ke.abort()}},[ue,gt]);const He=m.useCallback(ae=>{const ke=new URLSearchParams;return ae.file&&ke.set("file",ae.file),ae.id&&ke.set("id",ae.id),sl(`/api/record/video?${ke.toString()}`)},[]),We=m.useMemo(()=>{if(ue)return{src:"",type:""};if(!R)return{src:"",type:""};const ae=xs(n.output?.trim()||"");if(ae){const ke=ae.toLowerCase().split(".").pop(),pt=ke==="mp4"?"video/mp4":ke==="ts"?"video/mp2t":"application/octet-stream";return{src:He({file:ae}),type:pt}}return{src:He({id:n.id}),type:"video/mp4"}},[ue,R,n.output,n.id,He]),Je=m.useRef(null),et=m.useRef(null),mt=m.useRef(null),[Mt,fe]=m.useState(!1),qe=m.useCallback(()=>{const ae=et.current;if(!ae||ae.isDisposed?.())return;const ke=typeof ae.videoHeight=="function"?ae.videoHeight():0;typeof ke=="number"&&ke>0&&Number.isFinite(ke)&&$e(ke)},[]),Le=m.useCallback(()=>{try{const ae=et.current?.tech?.(!0)?.el?.()||et.current?.el?.()?.querySelector?.("video.vjs-tech")||mt.current;if(!ae||!(ae instanceof HTMLVideoElement))return null;const ke=Number(ae.videoWidth||0),pt=Number(ae.videoHeight||0);if(!Number.isFinite(ke)||!Number.isFinite(pt)||ke<=0||pt<=0)return null;let xt=Gn.current;xt||(xt=document.createElement("canvas"),Gn.current=xt);const Et=Math.min(1,640/ke),Z=Math.max(1,Math.round(ke*Et)),ce=Math.max(1,Math.round(pt*Et));xt.width!==Z&&(xt.width=Z),xt.height!==ce&&(xt.height=ce);const ve=xt.getContext("2d",{alpha:!1});return ve?(ve.drawImage(ae,0,0,Z,ce),xt.toDataURL("image/jpeg",.78)):null}catch{return null}},[]),Ce=m.useMemo(()=>xs(n.output?.trim()||"")||n.id,[n.output,n.id]),Pe=m.useMemo(()=>{const ae=Number(W);return Number.isFinite(ae)&&ae>=0?ae:0},[W]),Qe=m.useRef("");m.useEffect(()=>{if(ue){ee(!0);return}const ae=xs(n.output?.trim()||"");if(!ae){ee(!0);return}let ke=!0;const pt=new AbortController;return ee(!1),(async()=>{for(let xt=0;xt<80&&ke&&!pt.signal.aborted;xt++){try{const Rt=sl(`/api/record/done/meta?file=${encodeURIComponent(ae)}`),Et=await vg(Rt,{signal:pt.signal,cache:"no-store"});if(Et.ok){const Z=await Et.json(),ce=!!Z?.metaExists,ve=Number(Z?.durationSeconds||0)||0,Me=Number(Z?.height||0)||0,I=Number(Z?.fps||0)||0;if(ve>0){E(ve);const U=et.current;if(U&&!U.isDisposed?.())try{U.__fullDurationSec=ve,U.trigger?.("durationchange"),U.trigger?.("timeupdate")}catch{}}if(Me>0&&Q({h:Me,fps:I>0?I:null}),ce){ee(!0);return}}}catch{}await new Promise(Rt=>setTimeout(Rt,250))}ke&&ee(!0)})(),()=>{ke=!1,pt.abort()}},[ue,Ce,n.output]);const[,At]=m.useState(0);m.useEffect(()=>{if(typeof window>"u")return;const ae=window.visualViewport;if(!ae)return;const ke=()=>At(pt=>pt+1);return ke(),ae.addEventListener("resize",ke),ae.addEventListener("scroll",ke),window.addEventListener("resize",ke),window.addEventListener("orientationchange",ke),()=>{ae.removeEventListener("resize",ke),ae.removeEventListener("scroll",ke),window.removeEventListener("resize",ke),window.removeEventListener("orientationchange",ke)}},[]);const[Xt,kt]=m.useState(30),[mn,It]=m.useState(null),$t=!e,Ot=W8("(min-width: 640px)"),en=$t&&Ot,Sn=e||en,Pn="player_window_v1",St=420,Tn=280,tt=12,D=320,P=200;m.useEffect(()=>{if(!Mt)return;const ae=et.current;if(!ae||ae.isDisposed?.())return;const ke=ae.el();if(!ke)return;const pt=ke.querySelector(".vjs-control-bar");if(!pt)return;const xt=()=>{const Et=Math.round(pt.getBoundingClientRect().height||0);Et>0&&kt(Et)};xt();let Rt=null;return typeof ResizeObserver<"u"&&(Rt=new ResizeObserver(xt),Rt.observe(pt)),window.addEventListener("resize",xt),()=>{window.removeEventListener("resize",xt),Rt?.disconnect()}},[Mt,e]),m.useEffect(()=>fe(!0),[]),m.useEffect(()=>{if(!Sn){It(null);return}let ae=document.getElementById("player-root");ae||(ae=document.createElement("div"),ae.id="player-root");let ke=null;if(Ot){const pt=Array.from(document.querySelectorAll("dialog[open]"));ke=pt.length?pt[pt.length-1]:null}ke=ke??document.body,ke.appendChild(ae),ae.style.position="relative",ae.style.zIndex="2147483647",It(ae)},[Ot,Sn]),m.useEffect(()=>{const ae=et.current;if(!ae||ae.isDisposed?.()||ue||(X8(ae),!xs(n.output?.trim()||"")))return;const pt=Number(re||0)||0;return pt>0&&(ae.__fullDurationSec=pt),ae.__serverSeekAbs=xt=>{const Rt=Math.max(0,Number(xt)||0);try{ae.__origCurrentTime?.(Rt);try{ae.trigger?.("timeupdate")}catch{}}catch{try{ae.currentTime?.(Rt)}catch{}}},()=>{try{delete ae.__serverSeekAbs}catch{}}},[n.output,ue]),m.useLayoutEffect(()=>{if(!Mt||!Je.current||et.current||ue||!R)return;const ae=document.createElement("video");ae.className="video-js vjs-big-play-centered w-full h-full",ae.setAttribute("playsinline","true"),Je.current.appendChild(ae),mt.current=ae;const ke=Fe(ae,{autoplay:!0,muted:V,controls:!0,preload:"metadata",playsinline:!0,responsive:!0,fluid:!1,fill:!0,liveui:!1,html5:{vhs:{lowLatencyMode:!0}},inactivityTimeout:0,controlBar:{skipButtons:{backward:10,forward:10},volumePanel:{inline:!1},children:["skipBackward","playToggle","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","spacer","playbackRateMenuButton","fullscreenToggle"]},playbackRates:[.5,1,1.25,1.5,2]});return et.current=ke,ke.one("loadedmetadata",()=>{qe()}),ke.userActive(!0),ke.on("userinactive",()=>ke.userActive(!0)),()=>{try{et.current&&(et.current.dispose(),et.current=null)}finally{mt.current&&(mt.current.remove(),mt.current=null)}}},[Mt,V,ue,R,Ne,qe]),m.useEffect(()=>{const ae=et.current;if(!ae||ae.isDisposed?.())return;const ke=ae.el();ke&&ke.classList.toggle("is-live-download",!!F)},[F]);const ne=m.useCallback(()=>{const ae=et.current;if(!(!ae||ae.isDisposed?.())){try{ae.pause(),ae.reset?.()}catch{}try{ae.src({src:"",type:"video/mp4"}),ae.load?.()}catch{}}},[]),Re=m.useCallback(ae=>{const ke=et.current;if(!ke||ke.isDisposed?.())return;const pt=Math.max(0,Number(ae)||0);try{const xt=Number(ke.duration?.()??0),Rt=Number.isFinite(xt)&&xt>0?Math.max(0,xt-.05):pt;ke.currentTime(Math.min(pt,Rt)),ke.trigger?.("timeupdate")}catch{try{ke.currentTime(pt)}catch{}}},[]);m.useEffect(()=>{if(!Mt)return;if(!ue&&!R){ne();return}const ae=et.current;if(!ae||ae.isDisposed?.())return;const ke=ae.currentTime()||0;if(ae.muted(V),!We.src){try{ae.pause(),ae.reset?.(),ae.error(null)}catch{}return}ae.__timeOffsetSec=0;const pt=Number(re||0)||0;ae.__fullDurationSec=pt;const xt=String(ae.currentSrc?.()||"");if(Qe.current="",xt&&xt===We.src){const Et=ae.play?.();Et&&typeof Et.catch=="function"&&Et.catch(()=>{});return}ae.src({src:We.src,type:We.type});const Rt=()=>{const Et=ae.play?.();Et&&typeof Et.catch=="function"&&Et.catch(()=>{})};ae.one("loadedmetadata",()=>{if(ae.isDisposed?.())return;qe();try{const Z=Number(re||0)||0;Z>0&&(ae.__fullDurationSec=Z)}catch{}try{ae.playbackRate(1)}catch{}const Et=/mpegurl/i.test(We.type);if(ke>0&&!Et)try{const Z=Number(ae.__timeOffsetSec??0)||0,ce=Math.max(0,ke-Z);ae.__setRelativeTime?.(ce)}catch{}try{ae.trigger?.("timeupdate")}catch{}Rt()}),Rt()},[Mt,ue,R,We.src,We.type,V,qe,re,ne]),m.useEffect(()=>{if(!Mt||ue||!R||!We.src)return;const ae=et.current;if(!ae||ae.isDisposed?.())return;if(!(Pe>0)){Qe.current="";return}const ke=`${Ce}|${We.src}|${Pe.toFixed(3)}`;if(Qe.current===ke)return;let pt=!1;const xt=()=>{if(pt)return;const ce=et.current;if(!ce||ce.isDisposed?.())return;const ve=String(ce.currentSrc?.()||"");if(!ve||ve!==We.src)return;const Me=ce.tech?.(!0)?.el?.()||ce.el?.()?.querySelector?.("video.vjs-tech");if(!((Me instanceof HTMLVideoElement?Number(Me.readyState||0):0)<1)){Re(Pe),Qe.current=ke;try{const U=ce.play?.();U&&typeof U.catch=="function"&&U.catch(()=>{})}catch{}}};if(xt(),Qe.current===ke)return;const Rt=()=>xt();ae.one?.("loadedmetadata",Rt),ae.one?.("canplay",Rt),ae.one?.("durationchange",Rt);const Et=window.setTimeout(xt,0),Z=window.setTimeout(xt,120);return()=>{pt=!0,window.clearTimeout(Et),window.clearTimeout(Z);try{ae.off?.("loadedmetadata",Rt)}catch{}try{ae.off?.("canplay",Rt)}catch{}try{ae.off?.("durationchange",Rt)}catch{}}},[Mt,ue,R,We.src,Ce,Pe,Re]),m.useEffect(()=>{if(!Mt)return;const ae=et.current;if(!ae||ae.isDisposed?.())return;const ke=()=>{n.status==="running"&&$(!1)};return ae.on("error",ke),()=>{try{ae.off("error",ke)}catch{}}},[Mt,n.status]),m.useEffect(()=>{const ae=et.current;!ae||ae.isDisposed?.()||queueMicrotask(()=>ae.trigger("resize"))},[e]),m.useEffect(()=>{const ae=ke=>{const xt=(ke.detail?.file??"").trim();if(!xt)return;const Rt=xs(n.output?.trim()||"");Rt&&Rt===xt&&ne()};return window.addEventListener("player:release",ae),()=>window.removeEventListener("player:release",ae)},[n.output,ne]),m.useEffect(()=>{const ae=ke=>{const xt=(ke.detail?.file??"").trim();if(!xt)return;const Rt=xs(n.output?.trim()||"");Rt&&Rt===xt&&(ne(),t())};return window.addEventListener("player:close",ae),()=>window.removeEventListener("player:close",ae)},[n.output,ne,t]);const Ge=()=>{if(typeof window>"u")return{w:0,h:0,ox:0,oy:0,bottomInset:0};const ae=window.visualViewport;if(ae&&Number.isFinite(ae.width)&&Number.isFinite(ae.height)){const Rt=Math.floor(ae.width),Et=Math.floor(ae.height),Z=Math.floor(ae.offsetLeft||0),ce=Math.floor(ae.offsetTop||0),ve=Math.max(0,Math.floor(window.innerHeight-(ae.height+ae.offsetTop)));return{w:Rt,h:Et,ox:Z,oy:ce,bottomInset:ve}}const ke=document.documentElement,pt=ke?.clientWidth||window.innerWidth,xt=ke?.clientHeight||window.innerHeight;return{w:pt,h:xt,ox:0,oy:0,bottomInset:0}},yt=m.useRef(null);m.useEffect(()=>{if(typeof window>"u")return;const{w:ae,h:ke}=Ge();yt.current={w:ae,h:ke}},[]);const tn=m.useCallback(()=>{const ae=n,ke=tf(et.current?.videoWidth?.(),ae.videoWidth,ae.width,ae.meta?.width)??0,pt=tf(Ie,et.current?.videoHeight?.(),ae.videoHeight,ae.height,ae.meta?.height)??0;return ke>0&&pt>0?ke/pt:16/9},[n,Ie]),un=m.useCallback(ae=>{if(typeof window>"u")return ae;const ke=tn(),pt=ue?0:30,{w:xt,h:Rt}=Ge(),Et=xt-tt*2,Z=Math.max(1,Rt-tt*2-pt),ce=Math.max(1,P-pt);let ve=Math.max(D,Math.min(ae.w,Et)),Me=ve/ke;MeZ&&(Me=Z,ve=Me*ke),ve>Et&&(ve=Et,Me=ve/ke);const I=Math.round(Me+pt),U=Math.max(tt,Math.min(ae.x,xt-ve-tt)),te=Math.max(tt,Math.min(ae.y,Rt-I-tt));return{x:U,y:te,w:Math.round(ve),h:I}},[tn,ue]),vn=m.useCallback(()=>{if(typeof window>"u")return{x:tt,y:tt,w:St,h:Tn};try{const Z=window.localStorage.getItem(Pn);if(Z){const ce=JSON.parse(Z);if(typeof ce.x=="number"&&typeof ce.y=="number"&&typeof ce.w=="number"&&typeof ce.h=="number")return un({x:ce.x,y:ce.y,w:ce.w,h:ce.h})}}catch{}const{w:ae,h:ke}=Ge(),pt=St,xt=Tn,Rt=Math.max(tt,ae-pt-tt),Et=Math.max(tt,ke-xt-tt);return un({x:Rt,y:Et,w:pt,h:xt})},[un]),[cn,Cn]=m.useState(()=>vn()),xn=en&&cn.w<380,on=m.useCallback(ae=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Pn,JSON.stringify(ae))}catch{}},[]),Rn=m.useRef(cn);m.useEffect(()=>{Rn.current=cn},[cn]),m.useEffect(()=>{en&&Cn(vn())},[en,vn]),m.useEffect(()=>{if(!en)return;const ae=()=>{const ke=yt.current,{w:pt,h:xt}=Ge();Cn(Rt=>{if(!ke)return un(Rt);const Et=24,Z=Rt.x-tt,ce=ke.w-tt-(Rt.x+Rt.w),ve=ke.h-tt-(Rt.y+Rt.h),Me=Math.abs(Z)<=Et,I=Math.abs(ce)<=Et,U=Math.abs(ve)<=Et;let te=un(Rt);return U&&(te={...te,y:Math.max(tt,xt-te.h-tt)}),I?te={...te,x:Math.max(tt,pt-te.w-tt)}:Me&&(te={...te,x:tt}),un(te)}),yt.current={w:pt,h:xt}};return yt.current=(()=>{const{w:ke,h:pt}=Ge();return{w:ke,h:pt}})(),window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[en,un]);const qt=m.useRef(null);m.useEffect(()=>{const ae=et.current;if(!(!ae||ae.isDisposed?.()))return qt.current!=null&&cancelAnimationFrame(qt.current),qt.current=requestAnimationFrame(()=>{qt.current=null;try{ae.trigger("resize")}catch{}}),()=>{qt.current!=null&&(cancelAnimationFrame(qt.current),qt.current=null)}},[en,cn.w,cn.h]);const[Bt,Zt]=m.useState(!1),[zt,Pt]=m.useState(!1),[Nn,Ft]=m.useState(null),[Qn,Xn]=m.useState(null),Gn=m.useRef(null),ln=m.useRef(null),Zn=m.useRef(null),ti=m.useRef(null),jn=m.useCallback(ae=>{const{w:ke,h:pt}=Ge(),xt=tt,Rt=ke-ae.w-tt,Et=pt-ae.h-tt,ce=ae.x+ae.w/2{const ke=ti.current;if(!ke)return;const pt=ae.clientX-ke.sx,xt=ae.clientY-ke.sy,Rt=ke.start,Et=un({x:Rt.x+pt,y:Rt.y+xt,w:Rt.w,h:Rt.h});Zn.current={x:Et.x,y:Et.y},Ft(jn(Et)),ln.current==null&&(ln.current=requestAnimationFrame(()=>{ln.current=null;const Z=Zn.current;Z&&Cn(ce=>({...ce,x:Z.x,y:Z.y}))}))},[un,jn]),rn=m.useCallback(()=>{ti.current&&(Pt(!1),Ft(null),ln.current!=null&&(cancelAnimationFrame(ln.current),ln.current=null),ti.current=null,window.removeEventListener("pointermove",Kn),window.removeEventListener("pointerup",rn),Cn(ae=>{const ke=jn(un(ae));return queueMicrotask(()=>on(ke)),ke}))},[Kn,jn,un,on]),Di=m.useCallback(ae=>{if(!en||Bt||ae.button!==0)return;ae.preventDefault(),ae.stopPropagation();const ke=Rn.current;ti.current={sx:ae.clientX,sy:ae.clientY,start:ke},Pt(!0);const pt=Le();Xn(pt),Ft(jn(ke)),window.addEventListener("pointermove",Kn),window.addEventListener("pointerup",rn)},[en,Bt,Kn,rn,jn,Le]),oi=m.useRef(null),ni=m.useRef(null),di=m.useRef(null),Ci=m.useCallback(ae=>{const ke=di.current;if(!ke)return;const pt=ae.clientX-ke.sx,xt=ae.clientY-ke.sy,Rt=ke.ratio,Et=ke.dir.includes("w"),Z=ke.dir.includes("e"),ce=ke.dir.includes("n"),ve=ke.dir.includes("s");let Me=ke.start.w,I=ke.start.h,U=ke.start.x,te=ke.start.y;const{w:ye,h:ge}=Ge(),at=24,lt=ke.start.x+ke.start.w,ut=ke.start.y+ke.start.h,Dt=Math.abs(ye-tt-lt)<=at,Yt=Math.abs(ge-tt-ut)<=at,Lt=Jt=>{Jt=Math.max(D,Jt);let Qt=Jt/Rt;return Qt{Jt=Math.max(P,Jt);let Qt=Jt*Rt;return Qt=Math.abs(xt)){const Qt=Z?ke.start.w+pt:ke.start.w-pt,{newW:wn,newH:fi}=Lt(Qt);Me=wn,I=fi}else{const Qt=ve?ke.start.h+xt:ke.start.h-xt,{newW:wn,newH:fi}=ft(Qt);Me=wn,I=fi}Et&&(U=ke.start.x+(ke.start.w-Me)),ce&&(te=ke.start.y+(ke.start.h-I))}else if(Z||Et){const Jt=Z?ke.start.w+pt:ke.start.w-pt,{newW:Qt,newH:wn}=Lt(Jt);Me=Qt,I=wn,Et&&(U=ke.start.x+(ke.start.w-Me)),te=Yt?ke.start.y+(ke.start.h-I):ke.start.y}else if(ce||ve){const Jt=ve?ke.start.h+xt:ke.start.h-xt,{newW:Qt,newH:wn}=ft(Jt);Me=Qt,I=wn,ce&&(te=ke.start.y+(ke.start.h-I)),Dt?U=ke.start.x+(ke.start.w-Me):U=ke.start.x}const Ut=un({x:U,y:te,w:Me,h:I});ni.current=Ut,oi.current==null&&(oi.current=requestAnimationFrame(()=>{oi.current=null;const Jt=ni.current;Jt&&Cn(Jt)}))},[un]),Fn=m.useCallback(()=>{di.current&&(Zt(!1),Ft(null),Xn(null),oi.current!=null&&(cancelAnimationFrame(oi.current),oi.current=null),di.current=null,window.removeEventListener("pointermove",Ci),window.removeEventListener("pointerup",Fn),on(Rn.current))},[Ci,on]),On=m.useCallback(ae=>ke=>{if(!en||ke.button!==0)return;ke.preventDefault(),ke.stopPropagation();const pt=Rn.current;di.current={dir:ae,sx:ke.clientX,sy:ke.clientY,start:pt,ratio:pt.w/pt.h},Zt(!0),window.addEventListener("pointermove",Ci),window.addEventListener("pointerup",Fn)},[en,Ci,Fn]),[$n,_e]=m.useState(!1),[nt,ht]=m.useState(!1);m.useEffect(()=>{const ae=window.matchMedia?.("(hover: hover) and (pointer: fine)"),ke=()=>_e(!!ae?.matches);return ke(),ae?.addEventListener?.("change",ke),()=>ae?.removeEventListener?.("change",ke)},[]);const Ht=en&&(nt||zt||Bt),[De,vt]=m.useState(!1);if(m.useEffect(()=>{n.status!=="running"&&vt(!1)},[n.id,n.status]),!Mt||Sn&&!mn)return null;const wt="inline-flex items-center justify-center rounded-md p-2 transition bg-white/75 text-gray-900 ring-1 ring-black/10 hover:bg-white/90 active:scale-[0.98] dark:bg-black/45 dark:text-white dark:ring-white/10 dark:hover:bg-black/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500",Gt=String(n.phase??"").toLowerCase(),Kt=Gt==="stopping"||Gt==="remuxing"||Gt==="moving",sn=!B||!ue||Kt||De,Mn=c.jsx("div",{className:"flex items-center gap-1 min-w-0",children:ue?c.jsxs(c.Fragment,{children:[c.jsx(hn,{variant:"primary",color:"red",size:"sm",rounded:"md",disabled:sn,title:Kt||De?"Stoppe…":"Stop","aria-label":Kt||De?"Stoppe…":"Stop",onClick:async ae=>{if(ae.preventDefault(),ae.stopPropagation(),!sn)try{vt(!0),await B?.(n.id)}finally{vt(!1)}},className:Aa("shadow-none shrink-0",en&&xn&&"px-2"),children:c.jsx("span",{className:"whitespace-nowrap",children:Kt||De?"Stoppe…":en&&xn?"Stop":"Stoppen"})}),c.jsx(Bs,{job:n,variant:"overlay",collapseToMenu:!0,busy:Kt||De,isFavorite:h,isLiked:f,isWatching:g,onToggleWatch:k?ae=>k(ae):void 0,onToggleFavorite:C?ae=>C(ae):void 0,onToggleLike:j?ae=>j(ae):void 0,order:["watch","favorite","like","details"],className:"gap-1 min-w-0 flex-1"})]}):c.jsx(Bs,{job:n,variant:"overlay",collapseToMenu:!0,isHot:u||de,isFavorite:h,isLiked:f,isWatching:g,onToggleWatch:k?ae=>k(ae):void 0,onToggleFavorite:C?ae=>C(ae):void 0,onToggleLike:j?ae=>j(ae):void 0,onToggleHot:A?async ae=>{ne(),await new Promise(pt=>setTimeout(pt,150)),await A(ae),await new Promise(pt=>setTimeout(pt,0));const ke=et.current;if(ke&&!ke.isDisposed?.()){const pt=ke.play?.();pt&&typeof pt.catch=="function"&&pt.catch(()=>{})}}:void 0,onKeep:w?async ae=>{ne(),t(),await new Promise(ke=>setTimeout(ke,150)),await w(ae)}:void 0,onDelete:S?async ae=>{ne(),t(),await new Promise(ke=>setTimeout(ke,150)),await S(ae)}:void 0,order:["watch","favorite","like","hot","keep","delete","details"],className:"gap-1 min-w-0 flex-1"})}),Yn=e||en,nr=ue?"calc(4px + env(safe-area-inset-bottom))":`calc(${Xt+2}px + env(safe-area-inset-bottom))`,Wn="top-2",Wi=e&&Ot,Hi=c.jsx("div",{className:Aa("relative overflow-visible flex-1 min-h-0"),onMouseEnter:()=>{!en||!$n||ht(!0)},onMouseLeave:()=>{!en||!$n||ht(!1)},children:c.jsxs("div",{className:Aa("relative w-full h-full",en&&"vjs-mini"),style:{"--vjs-controlbar-h":`${Xt}px`},children:[ue?c.jsxs("div",{className:"absolute inset-0 bg-black",children:[c.jsx(ab,{src:_t,muted:V,className:"w-full h-full object-contain object-bottom"}),c.jsxs("div",{className:"absolute right-2 bottom-2 z-[60] pointer-events-none inline-flex items-center gap-1.5 rounded-full bg-red-600/90 px-2 py-1 text-[11px] font-semibold text-white shadow-sm",children:[c.jsx("span",{className:"inline-block size-1.5 rounded-full bg-white animate-pulse"}),"Live"]})]}):c.jsx("div",{ref:Je,className:"absolute inset-0"}),c.jsxs("div",{className:Aa("absolute inset-x-0 z-30 pointer-events-none","top-0"),children:[c.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-black/35 to-transparent"}),c.jsx("div",{className:Aa("absolute inset-x-2",Wn),children:c.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-start gap-2",children:[c.jsx("div",{className:"min-w-0 pointer-events-auto overflow-visible",children:Wi?null:Mn}),en?c.jsxs("button",{type:"button","aria-label":"Player-Fenster verschieben",title:"Ziehen zum Verschieben",onPointerDown:Di,onClick:ae=>{ae.preventDefault(),ae.stopPropagation()},className:Aa(wt,"px-3 gap-1 cursor-grab active:cursor-grabbing select-none",Ht?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none -translate-y-1",zt&&"scale-[0.98] opacity-90"),children:[c.jsx("span",{className:"h-1 w-1 rounded-full bg-black/35 dark:bg-white/35"}),c.jsx("span",{className:"h-1 w-1 rounded-full bg-black/35 dark:bg-white/35"}),c.jsx("span",{className:"h-1 w-1 rounded-full bg-black/35 dark:bg-white/35"})]}):null,c.jsxs("div",{className:"shrink-0 flex items-center gap-1 pointer-events-auto",children:[c.jsx("button",{type:"button",className:wt,onClick:i,"aria-label":e?"Minimieren":"Maximieren",title:e?"Minimieren":"Maximieren",children:e?c.jsx(LA,{className:"h-5 w-5"}):c.jsx(BA,{className:"h-5 w-5"})}),c.jsx("button",{type:"button",className:wt,onClick:t,"aria-label":"Schließen",title:"Schließen",children:c.jsx(Tf,{className:"h-5 w-5"})})]})]})})]}),c.jsxs("div",{className:Aa("player-ui pointer-events-none absolute inset-x-2 z-50","flex items-end justify-between gap-2","transition-all duration-200 ease-out"),style:{bottom:nr},children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-white",children:L}),c.jsx("div",{className:"truncate text-[11px] text-white/80",children:c.jsxs("span",{className:"inline-flex items-center gap-1 min-w-0 align-middle",children:[c.jsx("span",{className:"truncate",children:pe||H}),u||de?c.jsx("span",{className:"shrink-0 rounded bg-amber-500/25 px-1.5 py-0.5 font-semibold text-white",children:"HOT"}):null]})})]}),c.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 text-[11px] text-white",children:[Ct!=="—"?c.jsx("span",{className:"rounded bg-black/40 px-1.5 py-0.5 font-medium",children:Ct}):null,ue?null:c.jsx("span",{className:"rounded bg-black/40 px-1.5 py-0.5 font-medium",children:we}),G!=="—"?c.jsx("span",{className:"rounded bg-black/40 px-1.5 py-0.5 font-medium",children:G}):null]})]})]})}),bi=c.jsx("div",{className:"w-[360px] shrink-0 border-r border-white/10 bg-black/40 text-white",children:c.jsxs("div",{className:"h-full p-4 flex flex-col gap-3 overflow-y-auto",children:[c.jsx("div",{className:"rounded-lg overflow-hidden ring-1 ring-white/10 bg-black/30",children:c.jsx("div",{className:"relative aspect-video",children:c.jsx("img",{src:dt,alt:"",className:"absolute inset-0 h-full w-full object-contain opacity-80",draggable:!1,onError:()=>{}})})}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-lg font-semibold truncate",children:L}),c.jsx("div",{className:"text-xs text-white/70 break-all",children:pe||H})]}),c.jsx("div",{className:"pointer-events-auto",children:c.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[ue?c.jsx(hn,{variant:"primary",color:"red",size:"sm",rounded:"md",disabled:sn,title:Kt||De?"Stoppe…":"Stop","aria-label":Kt||De?"Stoppe…":"Stop",onClick:async ae=>{if(ae.preventDefault(),ae.stopPropagation(),!sn)try{vt(!0),await B?.(n.id)}finally{vt(!1)}},className:"shadow-none",children:Kt||De?"Stoppe…":"Stoppen"}):null,c.jsx(Bs,{job:n,variant:"table",collapseToMenu:!1,busy:Kt||De,isHot:u||de,isFavorite:h,isLiked:f,isWatching:g,onToggleWatch:k?ae=>k(ae):void 0,onToggleFavorite:C?ae=>C(ae):void 0,onToggleLike:j?ae=>j(ae):void 0,onToggleHot:A?async ae=>{ne(),await new Promise(pt=>setTimeout(pt,150)),await A(ae),await new Promise(pt=>setTimeout(pt,0));const ke=et.current;if(ke&&!ke.isDisposed?.()){const pt=ke.play?.();pt&&typeof pt.catch=="function"&&pt.catch(()=>{})}}:void 0,onKeep:w?async ae=>{ne(),t(),await new Promise(ke=>setTimeout(ke,150)),await w(ae)}:void 0,onDelete:S?async ae=>{ne(),t(),await new Promise(ke=>setTimeout(ke,150)),await S(ae)}:void 0,order:ue?["watch","favorite","like","details"]:["watch","favorite","like","hot","details","keep","delete"],className:"flex items-center justify-start gap-1"})]})}),c.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-2 text-sm",children:[c.jsx("div",{className:"text-white/60",children:"Status"}),c.jsx("div",{className:"font-medium",children:n.status}),c.jsx("div",{className:"text-white/60",children:"Auflösung"}),c.jsx("div",{className:"font-medium",children:Ct}),c.jsx("div",{className:"text-white/60",children:"FPS"}),c.jsx("div",{className:"font-medium",children:st}),c.jsx("div",{className:"text-white/60",children:"Laufzeit"}),c.jsx("div",{className:"font-medium",children:we}),c.jsx("div",{className:"text-white/60",children:"Größe"}),c.jsx("div",{className:"font-medium",children:G}),c.jsx("div",{className:"text-white/60",children:"Datum"}),c.jsx("div",{className:"font-medium",children:Be}),c.jsx("div",{className:"col-span-2",children:Oe.length?c.jsx("div",{className:"flex flex-wrap gap-1.5",children:Oe.map(ae=>c.jsx("span",{className:"rounded bg-white/10 px-2 py-0.5 text-xs text-white/90",children:ae},ae))}):c.jsx("span",{className:"text-white/50",children:"—"})})]})]})}),Si=en&&zt&&Nn?c.jsx("div",{className:"pointer-events-none absolute z-0 player-snap-ghost overflow-hidden rounded-lg border-2 border-dashed border-white/70 bg-black/55 shadow-2xl dark:border-white/60",style:{left:Nn.x-cn.x,top:Nn.y-cn.y,width:Nn.w,height:Nn.h},"aria-hidden":"true",children:c.jsxs("div",{className:"absolute inset-0 bg-black",children:[c.jsx("img",{src:Qn||dt,alt:"",className:"absolute inset-0 h-full w-full object-contain opacity-80",draggable:!1,onError:()=>{}}),c.jsx("div",{className:"absolute inset-x-0 top-0 h-14 bg-gradient-to-b from-black/55 to-transparent"}),c.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-1.5 opacity-80",children:[c.jsx("div",{className:"h-8 w-8 rounded-md bg-white/15 ring-1 ring-white/20"}),c.jsx("div",{className:"h-8 w-8 rounded-md bg-white/15 ring-1 ring-white/20"})]}),c.jsxs("div",{className:"absolute top-2 left-2 h-8 rounded-md bg-white/12 px-2 flex items-center gap-1 ring-1 ring-white/15",children:[c.jsx("span",{className:"h-1 w-1 rounded-full bg-white/50"}),c.jsx("span",{className:"h-1 w-1 rounded-full bg-white/50"}),c.jsx("span",{className:"h-1 w-1 rounded-full bg-white/50"})]}),c.jsxs("div",{className:"absolute inset-x-2 bottom-2 flex items-end justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-semibold text-white/95",children:L}),c.jsxs("div",{className:"truncate text-[11px] text-white/75",children:[pe||H,u||de?c.jsx("span",{className:"ml-1.5 rounded bg-amber-500/30 px-1.5 py-0.5 text-white",children:"HOT"}):null]})]}),c.jsxs("div",{className:"shrink-0 flex items-center gap-1 text-[10px] text-white/90",children:[Ct!=="—"?c.jsx("span",{className:"rounded bg-black/45 px-1.5 py-0.5",children:Ct}):null,!ue&&we!=="—"?c.jsx("span",{className:"rounded bg-black/45 px-1.5 py-0.5",children:we}):null]})]}),c.jsx("div",{className:"absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t from-white/8 to-transparent"})]})}):null,Xi=c.jsx(Is,{edgeToEdgeMobile:!0,noBodyPadding:!0,className:Aa("relative z-10 flex flex-col shadow-2xl ring-1 ring-black/10 dark:ring-white/10","w-full",Yn?"h-full":"h-[220px] max-h-[40vh]",e?"rounded-2xl":en?"rounded-lg":"rounded-none"),bodyClassName:"flex flex-col flex-1 min-h-0 p-0",children:c.jsxs("div",{className:"flex flex-1 min-h-0",children:[Wi?bi:null,Hi]})}),{w:ii,h:Mi,ox:Ti,oy:Bi,bottomInset:ir}=Ge(),hi={left:Ti+16,top:Bi+16,width:Math.max(0,ii-32),height:Math.max(0,Mi-32)},Yi=e?hi:en?{left:cn.x,top:cn.y,width:cn.w,height:cn.h}:void 0,Pi=c.jsxs(c.Fragment,{children:[c.jsx("style",{children:` - /* Live-Download: Progress/Seek-Bar ausblenden */ - .is-live-download .vjs-progress-control { - display: none !important; - } - - /* ---------- Video.js Layout-Fix (Finished Player) ---------- - Ziel: - - Video endet immer direkt über der Controlbar - - Aspect Ratio bleibt erhalten - - Resize stabil (kein "Wandern") - */ - - /* Container schwarz, falls Letterboxing sichtbar wird */ - .vjs-mini .video-js, - .vjs-mini .video-js .vjs-tech, - .vjs-mini .video-js .vjs-poster { - background-color: transparent !important; - } - - /* ECHTES Video (