{"version":3,"file":"useActiveClips.mjs","names":[],"sources":["../../../src/hooks/clips/useActiveClips.ts"],"sourcesContent":["import { useTimelineSelector } from '#react/hooks/core/useTimelineSelector';\nimport { useTimelineEngine } from '#react/hooks/core/useTimelineEngine';\nimport { useTimelinePlayheadTime } from '#react/hooks/playback/useTimelinePlayheadTime';\n/**\n * Returns clips that intersect the current playhead time.\n *\n * A clip is active when the playhead is at or after `timelineStart` and before\n * `timelineEnd`. Clips on hidden tracks, muted tracks, and clips marked\n * `disabled` are omitted. The returned array contains clips only; read the\n * timeline state when you also need the containing track id.\n *\n * @returns Active, enabled clips on visible, unmuted tracks at the current playhead time.\n *\n * @example\n * ```tsx\n * const activeClips = useActiveClips();\n *\n * return activeClips.map((clip) => <span key={clip.id}>{clip.label}</span>);\n * ```\n */\nexport function useActiveClips() {\n  const engine = useTimelineEngine();\n  useTimelineSelector((state) => state.tracks, Object.is);\n  const playheadTime = useTimelinePlayheadTime();\n\n  return engine.media.getActiveClips(playheadTime).map(({ clip }) => clip);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,iBAAiB;CAC/B,MAAM,SAAS,kBAAkB;CACjC,qBAAqB,UAAU,MAAM,QAAQ,OAAO,EAAE;CACtD,MAAM,eAAe,wBAAwB;CAE7C,OAAO,OAAO,MAAM,eAAe,YAAY,CAAC,CAAC,KAAK,EAAE,WAAW,IAAI;AACzE"}