import { CheckCircle, ClosedCaptioning, Eye, EyeSlash, ListBullets, PersonSimpleRun, Trash, Waveform, } from "@phosphor-icons/react"; import { useState } from "react"; import { formatTime, getSegmentStartTime } from "../lib/timeline.js"; import { LIVE_PORTRAIT_WEB_MODEL } from "../config/livePortrait.js"; import { probeLivePortraitWebEnvironment } from "../lib/livePortraitWeb.js"; import { normalizeVisualKeyframes } from "../lib/visualEffects.js"; import { HistoryPanel, MyVoicesPanel, VisualEffectsPanel, VoiceSynthesisPanel } from "./panels.jsx"; function CaptionContextPanel({ t, captionSegments, selectedCaptionSegment, selectedSegmentId, setSelectedSegmentId, currentSegmentIndex, captionTargetDuration, updateCaptionSegmentText, toggleCaptionSegmentHidden, deleteCaptionSegment, seekTo, sourceAudioBlob, generateCaptionsFromSourceAudio, isGeneratingCaptions, automaticCaptionProgress, }) { const selectedIndex = Math.max( 0, captionSegments.findIndex((segment) => segment.id === selectedCaptionSegment?.id), ); const selectedStart = captionSegments.length ? getSegmentStartTime(captionSegments, selectedIndex, captionTargetDuration) : 0; return (
{selectedCaptionSegment ? (