PageSourceSearch

https://www.chraft.ai/_next/static/chunks/62365.e8b2953c2d307a56.js

js chraft.ai collected 2026-10-05 11:57:36 UTC 37,065 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[62365],{62365:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ed});var i=n(95155),l=n(12115),s=n(53511),a=n(85921),r=n(50684),c=n(14122),o=n(96548),d=n(42024),u=n(71360),x=n(75426),p=n(66630),m=n(26341),h=n(30999),b=n(27043),f=n(59632),g=n(14757),v=n(12400),j=n(26987),k=n(22513),S=n(12343),w=n(2068),y=n(35130),z=n(70532),N=n(57828),C=n(99708),A=n(35795),I=n(85449),M=n(47650);function D(e){let{menu:t,onClose:n}=e,s=(0,l.useRef)(null),[a,r]=(0,l.useState)({position:"fixed",left:t.x,top:t.y,visibility:"hidden"});return(0,l.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let{width:n,height:i}=e.getBoundingClientRect();r({position:"fixed",visibility:"visible",left:Math.max(8,Math.min(t.x,window.innerWidth-n-8)),top:Math.max(8,Math.min(t.y,window.innerHeight-i-8))})},[t.x,t.y,t.items.length]),(0,l.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())},t=e=>{var t;(null==(t=s.current)?void 0:t.contains(e.target))||n()};return document.addEventListener("keydown",e,!0),document.addEventListener("pointerdown",t,!0),window.addEventListener("blur",n),()=>{document.removeEventListener("keydown",e,!0),document.removeEventListener("pointerdown",t,!0),window.removeEventListener("blur",n)}},[n]),(0,M.createPortal)((0,i.jsx)("div",{ref:s,role:"menu","aria-label":t.label,style:a,className:"z-[10050] min-w-44 overflow-hidden rounded-xl border-0 bg-zinc-800 p-1.5 text-[11px] shadow-2xl shadow-black/60 outline-0",children:t.items.map(e=>(0,i.jsxs)("button",{type:"button",role:"menuitem",disabled:e.disabled,onClick:()=>{n(),e.onSelect()},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-zinc-300 hover:bg-white/10 hover:text-white disabled:pointer-events-none disabled:text-zinc-600",children:[(0,i.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.icon}),e.label]},e.label))}),document.body)}var E=n(14815),_=n(27164);let T="__new_track__",P={video:96,audio:64,subtitle:44},R={video:8,audio:8,subtitle:6},L=e=>P[e]-2*R[e];function F(e){let{project:t,pixels:n,time:s,selected:a,disabled:c,onSelect:o,onEdit:m,onSplit:h,onSplittable:g,onDuplicate:k,onRemoveClip:M,onAddSubtitle:F,onChange:U,onSeek:O,onTrackSelect:B,draggedMedia:K,onMediaDrop:X,onDeleteTrack:Y,onZoom:W}=e,[H,V]=(0,l.useState)(null),Z=(0,j.$7)(t),q=Z.reduce((e,t)=>[...e,e[e.length-1]+P[t.kind]],[0]),$=(null==K?void 0:K.source.kind)||"video",G=(e,n)=>{if(!K||c)return!1;let{source:i,duration:l}=K,s=t,a;if("gap"in e){if(t.tracks.length>=j.Sj)return!1;a=T,s=(0,j.jw)(t,{id:T,name:T,kind:$,muted:!1,hidden:!1,locked:!1},e.gap)}else{a=e.trackId;let n=t.tracks.find(e=>e.id===a);if(!n||n.locked)return!1}return!!s&&(0,j.up)({...s,clips:[...s.clips,{id:"__media_drop_preview__",sourceId:i.id,title:i.title,url:i.url,duration:l,in:0,out:l,trackId:a,start:n,kind:$,volume:1,x:0,y:0,size:1}]})},J=(e,n)=>{let i=e.currentTarget.getBoundingClientRect(),l=e.clientY-i.top,s=l<12?n:l>i.height-12?n+1:-1,{start:a,end:r}=(0,j.s)(t,$);return s>=a&&s<=r?{gap:s}:Z[n]?{trackId:Z[n].id}:{gap:n}},Q=(e,t)=>({onDragOver:i=>{let l;if(!K||c)return;i.preventDefault(),i.stopPropagation();let s=t||J(i,e),a=(0,_.T)(i.clientX,i.currentTarget.getBoundingClientRect().left,n),r=G(s,a);i.dataTransfer.dropEffect=r?"copy":"none",H&&(l=H.target,"gap"in l&&"gap"in s&&l.gap===s.gap||"trackId"in l&&"trackId"in s&&l.trackId===s.trackId)&&H.start===a&&H.valid===r||V({target:s,start:a,valid:r})},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||V(null)},onDrop:i=>{if(!K||c)return;i.preventDefault(),i.stopPropagation();let l=t||J(i,e),s=(0,_.T)(i.clientX,i.currentTarget.getBoundingClientRect().left,n);G(l,s)&&X(l,s),V(null)}}),ee=(e,t)=>K&&H&&(0,i.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute z-50 ".concat(e," overflow-hidden rounded-md px-2 text-[10px] leading-5 ").concat(H.valid?"bg-zinc-600 text-white":"bg-zinc-800 text-zinc-400"),style:{left:H.start*n,width:K.duration*n,...t},children:K.source.title}),et=H&&"gap"in H.target?H.target.gap:-1,en="audio"===$?(0,j.s)(t,$).end:(0,j.s)(t,$).start,ei=(0,l.useRef)(null),el=(0,l.useRef)(null),es=(0,l.useRef)({pixels:n,onZoom:W});es.current={pixels:n,onZoom:W};let ea=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=ei.current;if(!e)return;let t=t=>{let{pixels:n,onZoom:i}=es.current;if(!i)return;let l=t.clientX-e.getBoundingClientRect().left-S.l9;if(l<0||!t.ctrlKey&&(t.shiftKey||Math.abs(t.deltaX)>Math.abs(t.deltaY)))return;t.preventDefault();
1let s=1===t.deltaMode?16*t.deltaY:t.deltaY;ea.current={time:(e.scrollLeft+l)/n,offset:l},i(n*Math.exp(-s*(t.ctrlKey?.01:.0015)))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]),(0,l.useLayoutEffect)(()=>{let e=ea.current,t=ei.current;e&&t&&(ea.current=null,t.scrollLeft=Math.max(0,e.time*n-e.offset))},[n]);let er=(0,l.useRef)(null),[ec,eo]=(0,l.useState)(null),ed=ec||t,eu=Math.max(15,...ed.clips.map(e=>e.start+(0,v.jO)(e)+3)),ex=Math.max(640,eu*n),ep=[1,2,5,10,15,30,60,120,300,600,900,1800,3600].find(e=>e*n>=90)||3600,em=ep*n,eh=(e,n)=>U({...t,tracks:t.tracks.map(t=>t.id===e?{...t,...n}:t)}),[eb,ef]=(0,l.useState)(null),eg=(e,t)=>{e.preventDefault(),e.stopPropagation(),B(t.id),ef({x:e.clientX,y:e.clientY,label:b.S.trackMenu,items:[..."subtitle"===t.kind?[{label:b.S.subtitleAdd,icon:(0,i.jsx)(r.A,{size:13}),disabled:c,onSelect:F}]:[],..."subtitle"===t.kind?[]:[{label:t.muted?b.S.unmute:b.S.mute,icon:t.muted?(0,i.jsx)(w.A,{size:13}):(0,i.jsx)(y.A,{size:13}),disabled:c,onSelect:()=>eh(t.id,{muted:!t.muted})}],..."audio"===t.kind?[]:[{label:"subtitle"===t.kind?t.hidden?b.S.subtitleShow:b.S.subtitleHide:t.hidden?b.S.show:b.S.hide,icon:t.hidden?(0,i.jsx)(z.A,{size:13}):(0,i.jsx)(N.A,{size:13}),disabled:c,onSelect:()=>eh(t.id,{hidden:!t.hidden})}],{label:t.locked?b.S.unlock:b.S.lock,icon:t.locked?(0,i.jsx)(C.A,{size:13}):(0,i.jsx)(A.A,{size:13}),disabled:c,onSelect:()=>eh(t.id,{locked:!t.locked})},{label:b.S.deleteTrack,icon:(0,i.jsx)(u.A,{size:13}),disabled:c||t.locked,onSelect:()=>Y(t.id)}]})},ev=(0,l.useRef)(!1),ej={onPointerDown:e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),ev.current=!0,ek(e.clientX))},onPointerMove:e=>{var t;if(!ev.current)return;ek(e.clientX);let n=null==(t=ei.current)?void 0:t.getBoundingClientRect();n&&ei.current&&(e.clientX>n.right-24?ei.current.scrollLeft+=10:e.clientX<n.left+168&&(ei.current.scrollLeft-=10))},onPointerUp:()=>{ev.current=!1},onPointerCancel:()=>{ev.current=!1}},ek=e=>{var t;let i=null==(t=el.current)?void 0:t.getBoundingClientRect();i&&O(Math.max(0,Math.min(eu,(e-i.left-144)/n)))};return(0,i.jsx)("div",{ref:ei,className:"max-h-52 select-none overflow-auto rounded-xl bg-zinc-950",children:(0,i.jsxs)("div",{ref:el,style:{width:ex+144},className:"relative pb-3",children:[(0,i.jsxs)("div",{className:"sticky top-0 z-[60] flex h-8 bg-zinc-950",children:[(0,i.jsx)("div",{className:"sticky left-0 z-10 w-36 shrink-0 bg-zinc-950"}),(0,i.jsxs)("div",{className:"relative flex-1",children:[(0,i.jsx)("input",{type:"range","aria-label":f.C.playhead,min:"0",max:eu,step:"0.01",value:s,onChange:e=>O(Number(e.target.value)),className:"absolute inset-0 z-10 h-8 w-full opacity-0"}),Array.from({length:Math.ceil(eu/ep)},(e,t)=>{let n;return(0,i.jsxs)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0",style:{left:t*em},children:[(0,i.jsx)("span",{className:"absolute bottom-1.5 left-0 h-1.5 w-px bg-zinc-500"}),(0,i.jsx)("span",{className:"absolute left-1 top-1.5 font-mono text-[10px] tabular-nums text-zinc-400",children:(n=t*ep,"".concat(Math.floor(n/60).toString().padStart(2,"0"),":").concat(Math.floor(n%60).toString().padStart(2,"0")))}),(0,i.jsx)("span",{className:"absolute bottom-1.5 h-0.5 w-0.5 rounded-full bg-zinc-600",style:{left:em/2}})]},t)}),(0,i.jsxs)("div",{"aria-hidden":"true",className:"absolute inset-y-0 z-20 w-3 -translate-x-1/2 cursor-ew-resize touch-none",style:{left:s*n},...ej,children:[(0,i.jsx)("span",{className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-zinc-100"}),(0,i.jsx)("span",{className:"absolute left-1/2 top-0 h-3.5 w-3 -translate-x-1/2 rounded-t-sm bg-zinc-100 [clip-path:polygon(0_0,100%_0,100%_65%,50%_100%,0_65%)]"})]})]})]}),Z.map((e,l)=>(0,i.jsxs)("div",{className:"relative flex",style:{height:P[e.kind]},"data-track-id":e.id,children:[(0,i.jsxs)("div",{className:"sticky left-0 z-40 flex w-36 shrink-0 bg-zinc-900 px-3 ".concat("subtitle"===e.kind?"items-center gap-2":"flex-col justify-center gap-1.5"),onContextMenu:t=>eg(t,e),children:[(0,i.jsx)("input",{"aria-label":"".concat(b.S.name,": ").concat(e.name),value:e.name,maxLength:80,disabled:c,onFocus:()=>B(e.id),onChange:t=>eh(e.id,{name:t.target.value}),className:"w-full min-w-0 flex-1 bg-transparent text-xs text-zinc-300 outline-none"}),(0,i.jsxs)("div",{className:"flex shrink-0 gap-3 text-zinc-300 [&>button:disabled]:text-zinc-600 [&>button:hover:enabled]:text-white",children:["subtitle"!==e.kind&&(0,i.jsx)("button",{disabled:c,title:e.muted?b.S.unmute:b.S.mute,"aria-label":"".concat(e.muted?b.S.unmute:b.S.mute,": ").concat(e.name),onClick:()=>eh(e.id,{muted:!e.muted}),children:e.muted?(0,i.jsx)(w.A,{size:13}):(0,i.jsx)(y.A,{size:13})}),"audio"!==e.kind&&(0,i.jsx)("button",{disabled:c,title:e.hidden?b.S.show:b.S.hide,"aria-label":"".concat("subtitle"===e.kind?e.hidden?b.S.subtitleShow:b.S.subtitleHide:e.hidden?b.S.show:b.S.hide,": ").concat(e.name),onClick:()=>eh(e.id,{hidden:!e.hidden}),children:e.hidden?(0,i.jsx)(z.A,{size:13}):(0,i.jsx)(N.A,{size:13})}),(0,i.jsx)("button",{disabled:c,title:e.locked?b.S.unlock:b.S.lock,"aria-label":"".concat(e.locked?b.S.unlock:b.S.lock,": ").concat(e.name),onClick:()=>eh(e.id,{locked:!e.locked}),children:e.locked?(0,i.jsx)(C.A,{size:13}):(0,i.jsx)(A.A,{size:13})}),(0,i.jsx)("button",{title:e.locked?b.S.locked:b.S.deleteTrack,"aria-label":"".concat(b.S.deleteTrack,": ").concat(e.name),disabled:c||e.locked,onClick:()=>Y(e.id),children:(0,i.jsx)(u.A,{size:13})})]})]}),(0,i.jsxs)("div",{className:"relative flex-1 bg-white/[0.02]",onPointerDown:t=>{t.target===t.currentTarget&&B(e.id)},onContextMenu:t=>eg(t,e),...Q(l),children:[!t.clips.some(t=>t.trackId===e.id)&&(0,i.jsx)("span",{className:"pointer-events-none absolute left-4 top-10 text-[10px] text-zinc-400",children:"subtitle"===e.kind?b.S.subtitleEmpty:f.C.dropMedia}),H&&"trackId"in H.target&&H.target.trackId===e.id&&ee("pt-1",{top:R[e.kind],height:L(e.kind)}),t.clips.filter(t=>t.trackId===e.id).map(l=>{var S;let w=ed.clips.find(e=>e.id===l.id)||l,y=a===w.id;return(0,i.jsxs)("div",{className:"group/clip absolute overflow-hidden ".concat("video"===w.kind?"rounded-lg bg-zinc-800":"audio"===w.kind?"rounded-lg bg-zinc-700":"rounded-md bg-zinc-600"),style:{left:w.start*n,width:(0,v.jO)(w)*n,height:L(w.kind),top:R[w.kind]+q[Z.findIndex(e=>e.id===w.trackId)]-q[Z.findIndex(t=>t.id===e.id)],zIndex:(null==(S=er.current)?void 0:S.clip.id)===w.id?45:1},children:["video"===w.kind?(0,i.jsx)(E.A,{url:w.url,start:w.in,end:w.out,pixels:n,duration:w.duration}):null,(0,i.jsxs)("button",{type:"button","aria-label":"".concat(b.S.move,": ").concat(w.title),title:b.S.editHint,className:"absolute inset-0 w-full touch-none text-left",onClick:()=>o(w.id),onDoubleClick:e=>{e.stopPropagation(),m(w.id)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),m(w.id))},onContextMenu:t=>{var n;return n=!!e.locked,void(t.preventDefault(),t.stopPropagation(),o(w.id),ef({x:t.clientX,y:t.clientY,label:b.S.clipMenu,items:[{label:b.S.edit
1Clip,icon:(0,i.jsx)(p.A,{size:13}),onSelect:()=>m(w.id)},{label:f.C.split,icon:(0,i.jsx)(d.A,{size:13}),disabled:c||!g(w.id),onSelect:()=>h(w.id)},{label:b.S.duplicate,icon:(0,i.jsx)(x.A,{size:13}),disabled:c||n,onSelect:()=>k(w.id)},{label:f.C.remove,icon:(0,i.jsx)(u.A,{size:13}),disabled:c||n,onSelect:()=>M(w.id)}]}))},onPointerDown:n=>{var i;0===n.button&&(o(w.id),c||e.locked||(n.currentTarget.setPointerCapture(n.pointerId),er.current={x:n.clientX,y:n.clientY,scroll:(null==(i=ei.current)?void 0:i.scrollTop)||0,clip:w,side:"move",next:t}))},onPointerMove:e=>{var i;let l=er.current;if(!l||"move"!==l.side)return;let a=null==(i=ei.current)?void 0:i.getBoundingClientRect();a&&ei.current&&(e.clientY>a.bottom-24?ei.current.scrollTop+=10:e.clientY<a.top+24&&(ei.current.scrollTop-=10));let r=Z[(e=>{var t;let n=e-((null==(t=el.current)?void 0:t.getBoundingClientRect().top)||0)-32;return Math.max(0,Math.min(Z.length-1,q.findIndex((e,t)=>t<Z.length&&n<q[t+1])))})(e.clientY)];l.next=(0,j.hQ)(t,l.clip.id,r.id,l.clip.start+(e.clientX-l.x)/n,s,n),eo(l.next)},onPointerUp:()=>{er.current&&U(er.current.next),er.current=null,eo(null)},onPointerCancel:()=>{er.current=null,eo(null)},children:[(0,i.jsxs)("span",{className:"absolute left-2 flex max-w-[calc(100%-16px)] items-center gap-1 text-[10px] font-medium leading-4 text-white ".concat("subtitle"===w.kind?"top-1/2 -translate-y-1/2":"top-1"," ").concat("video"===w.kind?"[text-shadow:0_1px_2px_rgb(0_0_0),0_0_4px_rgb(0_0_0)]":""),children:["subtitle"===w.kind?(0,i.jsx)(r.A,{size:12,className:"shrink-0"}):"audio"===w.kind?(0,i.jsx)(I.A,{size:12,className:"shrink-0"}):null,(0,i.jsx)("span",{className:"truncate",children:w.title})]}),"subtitle"!==w.kind&&(0,i.jsx)("span",{className:"absolute bottom-1 left-2 font-mono text-[10px] leading-4 text-white [text-shadow:0_1px_2px_rgb(0_0_0),0_0_4px_rgb(0_0_0)]",children:(0,v.fU)((0,v.jO)(w))}),(0,i.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-[inherit] border-2 ".concat(y?"border-white":"border-transparent group-hover/clip:border-white/40")})]}),["in","out"].map(l=>(0,i.jsx)("button",{"aria-label":"".concat("in"===l?b.S.trimStart:b.S.trimEnd,": ").concat(w.title),disabled:c||e.locked,className:"absolute top-0 z-10 h-full w-1.5 touch-none cursor-ew-resize ".concat(y?"bg-white":"bg-transparent hover:bg-white/60"," ").concat("in"===l?"left-0":"right-0"),onPointerDown:e=>{var n;0===e.button&&(e.stopPropagation(),o(w.id),e.currentTarget.setPointerCapture(e.pointerId),er.current={x:e.clientX,y:e.clientY,scroll:(null==(n=ei.current)?void 0:n.scrollTop)||0,clip:w,side:l,next:t})},onPointerMove:e=>{let i=er.current;if(!i||"move"===i.side)return;let l=(e.clientX-i.x)/n,s="in"===i.side?Math.max(Math.max(0,i.clip.in-i.clip.start),Math.min(i.clip.out-.1,i.clip.in+l)):Math.min(i.clip.duration,Math.max(i.clip.in+.1,i.clip.out+l)),a={...i.clip,[i.side]:s,start:"in"===i.side?i.clip.start+s-i.clip.in:i.clip.start};i.next={...t,clips:t.clips.map(e=>e.id===a.id?a:e)},eo(i.next)},onPointerUp:()=>{er.current&&U(er.current.next),er.current=null,eo(null)},onPointerCancel:()=>{er.current=null,eo(null)}},l))]},w.id)})]})]},e.id)),Z.length?K&&!c&&(0,i.jsx)("div",{className:"relative ml-36 h-10",...Q(Z.length,{gap:en})}):(0,i.jsxs)("div",{className:"relative flex h-24",children:[(0,i.jsx)("div",{className:"sticky left-0 z-40 w-36 shrink-0 bg-zinc-900"}),(0,i.jsx)("div",{className:"relative flex-1 ".concat(0===et&&(null==H?void 0:H.valid)?"bg-white/[0.06]":""),...Q(0,{gap:0}),children:(0,i.jsx)("span",{className:"pointer-events-none sticky left-4 flex h-full items-center px-4 text-[10px] text-zinc-400",children:b.S.emptyTracks})})]}),Z.length>0&&et>=0&&(0,i.jsxs)("div",{"aria-hidden":"true",className:"pointer-events-none absolute left-36 right-0 z-[35]",style:{top:32+q[Math.min(et,Z.length)]},children:[(0,i.jsx)("div",{className:"absolute inset-x-0 -top-px h-0.5 rounded-full ".concat((null==H?void 0:H.valid)?"bg-primary":"bg-zinc-600")}),ee("-top-2.5 h-5")]}),eb&&(0,i.jsx)(D,{menu:eb,onClose:()=>ef(null)}),(0,i.jsx)("div",{"aria-hidden":"true",className:"group/playhead absolute bottom-2 top-0 z-30 w-3 -translate-x-1/2 cursor-ew-resize touch-none",style:{left:144+s*n},...ej,children:(0,i.jsx)("span",{className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-zinc-100 group-hover/playhead:w-0.5"})})]})})}var U=n(7306),O=n(34832),B=n(31511),K=n(19307),X=n(24033),Y=n(5917);let W=new Set;function H(e){if(W.size)for(let t of(e.preventDefault(),Array.from(W)))t()}function V(e){let{anchor:t,onClose:n,children:i}=e,[s,a]=(0,l.useState)(null);return(0,l.useLayoutEffect)(()=>{let e=()=>{let e=t.current,n=(null==e?void 0:e.closest("[role=dialog]"))||document.body;if(!e)return;let i=e.getBoundingClientRect(),l=n.getBoundingClientRect(),s=window.innerHeight-i.bottom,r=i.top>208||i.top>s,c=Math.max(8,Math.min(i.left,window.innerWidth-i.width-8));a({host:n,style:{position:"absolute",minWidth:i.width,pointerEvents:"auto",left:c-l.left+n.scrollLeft,maxHeight:Math.max(100,(r?i.top:s)-16),...r?{bottom:l.bottom-i.top+8-n.scrollTop}:{top:i.bottom-l.top+8+n.scrollTop}}})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[t]),(0,l.useEffect)(()=>(W.add(n),()=>{W.delete(n)}),[n]),s?(0,M.createPortal)(i(s.style),s.host):null}function Z(e){let{label:t,value:n,onChange:s,options:a,disabled:r}=e,[c,o]=(0,l.useState)(0),d=(0,l.useRef)(null),u=(0,l.useRef)(()=>o(e=>e+1)).current;return(0,l.useEffect)(()=>{var e;
1c&&(null==(e=d.current)||e.focus())},[c]),(0,i.jsx)(K.W,{value:n,onChange:s,disabled:r,children:e=>{var l;let{open:s}=e;return(0,i.jsxs)("div",{className:"relative min-w-16 text-[11px]",children:[(0,i.jsxs)(K.W.Button,{ref:d,"aria-label":t,className:"flex h-8 w-full items-center justify-between gap-3 rounded-lg bg-white/5 px-3 text-zinc-200 outline-0 hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-zinc-400 disabled:text-zinc-600 disabled:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"truncate",children:null==(l=a.find(e=>e.value===n))?void 0:l.label}),(0,i.jsx)(X.A,{size:12,className:"shrink-0 text-zinc-500"})]}),s&&(0,i.jsx)(V,{anchor:d,onClose:u,children:e=>(0,i.jsx)(K.W.Options,{static:!0,style:e,onKeyDownCapture:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),u())},className:"z-[10050] overflow-auto rounded-xl border-0 bg-zinc-800 p-1.5 text-[11px] shadow-2xl shadow-black/60 outline-0",children:a.map(e=>(0,i.jsx)(K.W.Option,{value:e.value,disabled:e.disabled,className:e=>{let{active:t,disabled:n}=e;return"flex cursor-pointer items-center justify-between gap-4 whitespace-nowrap rounded-lg px-3 py-2 ".concat(t?"bg-white/10 text-white":"text-zinc-300"," ").concat(n?"cursor-not-allowed !text-zinc-600":"")},children:t=>{let{selected:n}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{style:e.style,children:e.label}),(0,i.jsx)(Y.A,{size:12,className:n?"text-zinc-200":"invisible"})]})}},e.value))})})]})}},c)}var q=n(76279),$=n(64485);let G={...Object.fromEntries(q.Wm.map(e=>[e,q.cb[e].label])),system:b.S.fontSystem,sans:b.S.fontSans,narrow:b.S.fontNarrow,impact:b.S.fontImpact,casual:b.S.fontCasual,serif:b.S.fontSerif,mono:b.S.fontMono,cjkSans:b.S.fontCjkSans,cjkSerif:b.S.fontCjkSerif,cjkKai:b.S.fontCjkKai},J={none:b.S.animationNone,fade:b.S.animationFade,rise:b.S.animationRise,pop:b.S.animationPop};function Q(e){var t,n;let s,a,r,c,{project:o,clip:d,disabled:u,onPatch:x}=e,[p,m]=(0,l.useState)(""),h=d.subtitle.font||"sans";(0,l.useEffect)(()=>{q.Wm.filter(e=>!q.cb[e].cjk).forEach(e=>(0,q.eg)(e).catch(()=>{}))},[]);let f=[...q.Wm,...(0,q.IB)(h)?[]:[h]].map(e=>({value:e,label:G[e],style:(0,$.$j)(e)})),g=e=>(0,j.up)({...o,clips:o.clips.map(t=>t.id===d.id?{...t,...e}:t)})?(m(""),x(e),!0):(m(b.S.subtitleInvalid),!1),v=(e,t,n,l,s,a)=>(0,i.jsxs)("label",{className:"flex items-center justify-between gap-3 text-xs text-zinc-400",children:[e,(0,i.jsx)("input",{"aria-label":e,type:"number",defaultValue:Number(t.toFixed(2)),min:l,max:s,step:a,disabled:u,onBlur:e=>{let i=Number(e.target.value);(!e.target.value||i<l||i>s||!g(n(i)))&&(e.target.value=String(Number(t.toFixed(2))))},className:"h-8 w-20 rounded-lg bg-white/5 px-2 text-right font-mono text-zinc-200 outline-none focus:bg-white/10 disabled:opacity-30"},"".concat(d.id,":").concat(e,":").concat(t))]});return(0,i.jsxs)("div",{className:"space-y-5",children:[(0,i.jsxs)("label",{className:"block space-y-2 text-xs text-zinc-400",children:[(0,i.jsx)("span",{children:b.S.subtitleText}),(0,i.jsx)("textarea",{"aria-label":b.S.subtitleText,defaultValue:null==(t=d.subtitle)?void 0:t.text,maxLength:280,rows:3,disabled:u,onBlur:e=>{let t=e.target.value.trim();g({title:t,subtitle:{...d.subtitle,text:t}})||(e.target.value=d.subtitle.text)},className:"w-full resize-none rounded-xl bg-white/5 p-3 text-sm leading-6 text-zinc-100 outline-none focus:bg-white/10 disabled:opacity-30"},"".concat(d.id,":").concat(null==(n=d.subtitle)?void 0:n.text))]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[v(b.S.subtitleStart,d.start,e=>({start:e}),0,299.9,.1),v(b.S.subtitleEnd,(0,j.pJ)(d),e=>({out:d.in+e-d.start}),.1,300,.1),v(b.S.subtitleX,100*d.x,e=>({x:e/100}),0,100,1),v(b.S.subtitleY,100*d.y,e=>({y:e/100}),0,100,1),v(b.S.subtitleFont,(0,j.Er)(d.subtitle),e=>({subtitle:{...d.subtitle,fontSize:e/j.tZ}}),j.IZ.min,j.IZ.max,1),(0,i.jsxs)("div",{className:"flex items-center justify-between gap-3 text-xs text-zinc-400",children:[(0,i.jsx)("span",{children:b.S.subtitleFontFamily}),(0,i.jsx)(Z,{label:b.S.subtitleFontFamily,value:h,disabled:u,options:f,onChange:e=>{j.mo.includes(e)&&g({subtitle:{...d.subtitle,font:e}})}})]}),(s=b.S.subtitleAnimation,a=d.subtitle.animation||"none",r=j.VY,c=e=>
1({subtitle:{...d.subtitle,animation:e}}),(0,i.jsxs)("div",{className:"flex items-center justify-between gap-3 text-xs text-zinc-400",children:[(0,i.jsx)("span",{children:s}),(0,i.jsx)(Z,{label:s,value:a,disabled:u,onChange:e=>g(c(e)),options:r.map(e=>({value:e,label:J[e]}))})]}))]}),(0,i.jsx)("div",{className:"flex items-center gap-2",children:[[b.S.subtitleTop,0],[b.S.subtitleCenter,.5],[b.S.subtitleBottom,1]].map(e=>{let[t,n]=e;return(0,i.jsx)("button",{disabled:u,"aria-pressed":d.y===n&&.5===d.x,onClick:()=>g({x:.5,y:Number(n)}),className:"rounded-lg px-3 py-2 text-xs text-zinc-400 hover:bg-white/5 aria-pressed:bg-white/10 aria-pressed:text-zinc-100 disabled:opacity-30",children:t},t)})}),p&&(0,i.jsx)("p",{role:"status",className:"text-xs text-zinc-400",children:p})]})}function ee(e){let{project:t,clip:n,disabled:l,onPatch:s}=e;if("subtitle"===n.kind)return(0,i.jsx)(Q,{project:t,clip:n,disabled:l,onPatch:s},n.id);let a=e=>(0,i.jsxs)("label",{className:"flex items-center justify-between gap-3 text-[10px] text-zinc-400",children:[b.S[e],(0,i.jsx)("input",{"aria-label":b.S[e],type:"number",step:["volume","x","y","size"].includes(e)?"0.05":"0.01",defaultValue:n[e].toFixed(2),disabled:l,onBlur:i=>{let l=Number(i.target.value);if(l===n[e])return;let a={...n,[e]:l};i.target.value&&(0,j.up)({...t,clips:t.clips.map(e=>e.id===n.id?a:e)})?s({[e]:l}):i.target.value=n[e].toFixed(2)},className:"h-7 w-16 rounded-md bg-white/5 px-2 text-right font-mono text-zinc-200 outline-none focus:bg-white/10 disabled:opacity-30"})]},"".concat(n.id,":").concat(e,":").concat(n[e]));return(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-3",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("p",{className:"mb-3 text-[10px] font-medium text-zinc-500",children:b.S.timing}),(0,i.jsxs)("div",{className:"flex items-center justify-between gap-3 text-[10px] text-zinc-400",children:[(0,i.jsx)("span",{children:b.S.track}),(0,i.jsx)(Z,{label:b.S.track,value:n.trackId,disabled:l,onChange:e=>s({trackId:e}),options:t.tracks.filter(e=>e.kind===n.kind).map(e=>({value:e.id,label:e.name,disabled:e.locked}))})]}),a("start"),a("in"),a("out")]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("p",{className:"mb-3 text-[10px] font-medium text-zinc-500",children:b.S.sound}),a("volume")]}),"video"===n.kind&&(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("p",{className:"mb-3 text-[10px] font-medium text-zinc-500",children:b.S.transform}),a("x"),a("y"),a("size"),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("button",{disabled:l,className:"rounded-lg bg-white/5 px-2 py-1.5 text-[10px] text-zinc-300 hover:bg-white/10 disabled:opacity-30",onClick:()=>s({size:.35,x:.62,y:.62}),children:b.S.pip}),(0,i.jsx)("button",{disabled:l,className:"rounded-lg px-2 py-1.5 text-[10px] text-zinc-400 hover:bg-white/5 disabled:opacity-30",onClick:()=>s({size:1,x:0,y:0}),children:b.S.full})]})]})]})}var et=n(35299),en=n(61362);function ei(e){let{exporter:t,pauseClassName:n,buttonClassName:l}=e,a=t.live;if(!a)return null;let r=a.retrying?b.S.renderRetrying:"submitting"===a.stage?b.S.renderSubmitting:"queued"===a.stage?b.S.renderQueued:"".concat(b.S.renderRunning," ").concat(Math.round(a.percent),"%");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{title:b.S.pauseHint,onClick:t.pause,className:n,children:[(0,i.jsx)(s.A,{size:14}),b.S.pauseChecking]}),(0,i.jsxs)("span",{role:"status","aria-live":"polite",title:b.S.renderLocked,className:"".concat(l," cursor-default tabular-nums"),children:[(0,i.jsx)(et.A,{size:14,className:"animate-spin"}),r]})]})}function el(e){let{at:t}=e,[n,s]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!t)return;s(!0);let e=setTimeout(()=>s(!1),6e3);return()=>clearTimeout(e)},[t]),n?(0,i.jsxs)("span",{role:"status",className:"inline-flex items-center gap-1.5 text-[13px] text-zinc-100",children:[(0,i.jsx)(en.A,{size:15,className:"text-zinc-300"}),b.S.renderDone]}):null}let es="z-[10000] bg-black/50 backdrop-blur-none",ea="inline-flex items-center justify-center gap-2 rounded-lg transition-colors disabled:cursor-not-allowed",er="".concat(ea," h-8 px-2.5 text-xs text-zinc-300 hover:bg-white/10 hover:text-white disabled:text-zinc-600 disabled:hover:bg-transparent"),ec="".concat(ea," h-9 px-3.5 text-[13px] text-zinc-300 hover:bg-white/10 hover:text-white"),eo="".concat(ea," h-9 px-4 text-[13px] font-medium bg-zinc-100 text-zinc-950 hover:bg-white disabled:bg-zinc-800 disabled:text-zinc-500");function ed(e){var t,n;let{open:w,onOpenChange:y,project:z,onChange:N,sources:C,exporter:A,onImportMedia:I,onRemoveMedia:M}=e,[D,E]=(0,l.useState)(0),[_,T]=(0,l.useState)(!1),[P,R]=(0,l.useState)(70),[L,K]=(0,l.useState)(""),[X,Y]=(0,l.useState)(""),[W,V]=(0,l.useState)(null),[q,$]=(0,l.useState)(null),[G,J]=(0,l.useState)(!1),[Q,et]=(0,l.useState)(""),[en,ea]=(0,l.useState)(""),[ed,eu]=(0,l.useState)(!1),[ex,ep]=(0,l.useState)(!1),[em,eh]=(0,l.useState)(null),[eb,ef]=(0,l.useState)({past:[],future:[]}
1),eg=(0,j.OT)(z),ev=z.clips.find(e=>e.id===L),ej=A.busy||A.unresolved,ek=ej||(null==(t=z.tracks.find(e=>e.id===(null==ev?void 0:ev.trackId)))?void 0:t.locked),eS=(0,l.useRef)(D);eS.current=D,(0,l.useEffect)(()=>{if(!_||!w)return;let e=performance.now(),t=0,n=i=>{let l=Math.min(eg,eS.current+(i-e)/1e3);e=i,eS.current=l,E(l),l>=eg?T(!1):t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)},[_,w,eg]),(0,l.useEffect)(()=>{w||T(!1)},[w]);let ew=e=>{if(!ej&&JSON.stringify(e)!==JSON.stringify(z)){if(!(0,j.up)(e))return void ea(b.S.collision+" "+b.S.limit);T(!1),ea(""),eu(!1),ef(e=>({past:[...e.past.slice(-49),z],future:[]})),N(e),E(t=>Math.min(t,(0,j.OT)(e)))}},ey=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(ej)return;let t=e?eb.future:eb.past,n=t[t.length-1];n&&(ef(e?{past:[...eb.past,z],future:eb.future.slice(0,-1)}:{past:eb.past.slice(0,-1),future:[...eb.future,z]}),T(!1),eu(!1),ea(""),N(n),E(e=>Math.min(e,(0,j.OT)(n))))},ez=()=>{eg&&(ea(""),!_&&D>=eg&&E(0),T(e=>!e))},eN=e=>{let t=z.clips.find(t=>t.id===e);t&&(K(e),Y(t.trackId),T(!1),eh(t),J(!0))},eC=()=>{J(!1),eh(null)},eA=e=>{var t;return!!(ej||(null==(t=z.tracks.find(t=>{var n;return t.id===(null==(n=z.clips.find(t=>t.id===e))?void 0:n.trackId)}))?void 0:t.locked))},eI=e=>{eA(e)||ew({...z,clips:z.clips.filter(t=>t.id!==e)})},eM=e=>{eA(e)||ew((0,j.aU)(z,e,D,crypto.randomUUID()))},eD=e=>{let t=z.clips.find(t=>t.id===e);if(!t||eA(e))return;if(z.tracks.length>=j.Sj)return void ea(b.S.limit);let n=crypto.randomUUID();ew({...z,tracks:[...z.tracks,{id:n,name:"".concat("video"===t.kind?"V":"subtitle"===t.kind?"S":"A").concat(z.tracks.filter(e=>e.kind===t.kind).length+1),kind:t.kind,muted:!1,hidden:!1,locked:!1}],clips:[...z.clips,{...t,id:crypto.randomUUID(),trackId:n}]})},eE=e=>{let t=z.clips.find(t=>t.id===e);return!!(t&&!eA(e)&&D>t.start+.1&&D<t.start+(0,v.jO)(t)-.1)},e_=()=>{if(ej)return;let e=crypto.randomUUID(),t=(0,j.iC)(z,D,b.S.subtitleDefault,e,crypto.randomUUID());if(t===z)return void ea(b.S.limit+" "+b.S.collision);let n=t.clips.find(t=>t.id===e);ew(t),K(e),Y(n.trackId),eh(n),J(!0)},eT=(0,l.useRef)(null),eP=()=>{var e;return Math.max(200,((null==(e=eT.current)?void 0:e.clientWidth)||1e3)-S.l9-40)},eR=e=>R((0,S.nN)(eP()/Math.max(1,(0,j.OT)(e)))),eL=(e,t,n)=>{var i;if(ej)return;let l=z.tracks.filter(t=>t.kind===e.kind&&!t.locked),s=n?"trackId"in n&&l.find(e=>e.id===n.trackId):l.find(e=>e.id===X)||l.find(e=>e.id===(null==ev?void 0:ev.trackId))||l[0];if(n&&"trackId"in n&&!s)return;let a=z.tracks,r=s?s.id:void 0;if(!r){if(a.length>=j.Sj)return void ea(b.S.limit);let t={id:r=crypto.randomUUID(),name:"".concat("video"===e.kind?"V":"A").concat(a.filter(t=>t.kind===e.kind).length+1),kind:e.kind,muted:!1,hidden:!1,locked:!1},i=n&&"gap"in n?(0,j.jw)(z,t,n.gap):null;a=i?i.tracks:[...a,t]}let c=null!=(i=null==n?void 0:n.start)?i:Math.round(100*D)/100,o={id:crypto.randomUUID(),sourceId:e.id,title:e.title,url:e.url,duration:t,in:0,out:t,trackId:r,start:c,kind:e.kind,volume:1,x:0,y:0,size:1},d={...z,tracks:a,clips:[...z.clips,o]};ew(d),(0,j.up)(d)&&(K(o.id),Y(r),(0,j.OT)(d)*P>eP()&&eR(d)),V(null)};return(0,i.jsx)(h.lG,{open:w,onOpenChange:y,children:(0,i.jsxs)(h.Cf,{className:"nodrag nopan nowheel flex h-[94vh] w-[96vw] max-w-7xl flex-col gap-0 overflow-hidden rounded-2xl border-0 bg-zinc-950 p-0 text-zinc-100",onEscapeKeyDown:H,onKeyDown:e=>{e.stopPropagation();let t=e.target;if(!q&&!Q){if(" "===e.key&&!t.closest("input:not([type=range]),select,textarea,[contenteditable=true],[role=listbox],[role=menu]")){e.preventDefault(),e.repeat||ez();return}t.closest("input,select,textarea,[role=listbox]")||((e.metaKey||e.ctrlKey)&&"z"===e.key.toLowerCase()&&(e.preventDefault(),ey(e.shiftKey)),("Delete"===e.key||"Backspace"===e.key)&&(e.preventDefault(),eI(L)))}},children:[(0,i.jsxs)("header",{className:"flex shrink-0 items-center gap-5 px-5 py-4 pr-12",children:[(0,i.jsx)(h.L3,{className:"text-sm",children:b.S.title}),(0,i.jsx)(h.rr,{className:"text-[10px] text-zinc-500",children:b.S.description})]}),(0,i.jsxs)("div",{className:"grid min-h-0 flex-1 grid-cols-[220px_1fr] sm:grid-cols-[320px_1fr]",children:[(0,i.jsx)(O.A,{sources:C,onImport:I&&(e=>I({...e,kind:e.kind||"video"})),onRemove:M,disabled:ej||z.clips.length>=100,emptyHint:b.S.source,onDrag:V,onInsert:e=>eL({...e.source,kind:e.source.kind||"video"},e.duration),onPreview:e=>{T(!1),$(e)}}),(0,i.jsxs)("div",{className:"flex min-h-0 flex-col px-4 pb-2",children:[(0,i.jsx)("div",{className:"min-h-0 flex-1",children:(0,i.jsx)(U.A,{project:z,time:D,playing:_,disabled:ej,onSelect:e=>{K(e),T(!1)},onSubtitlePosition:(e,t,n)=>{var i;let l=z.clips.find(t=>
1t.id===e);l&&"subtitle"===l.kind&&(null==(i=z.tracks.find(e=>e.id===l.trackId))||!i.locked)&&ew({...z,clips:z.clips.map(i=>i.id===e?{...i,x:t,y:n}:i)})},onSubtitleEdit:eN,onError:()=>{T(!1),ea(b.S.mediaFailed)}})}),(0,i.jsxs)("div",{className:"flex h-10 shrink-0 items-center justify-center gap-4",children:[(0,i.jsx)("button",{className:er,"aria-label":_?f.C.pause:f.C.play,title:"".concat(_?f.C.pause:f.C.play," (Space)"),disabled:!eg,onClick:ez,children:_?(0,i.jsx)(s.A,{size:15}):(0,i.jsx)(a.A,{size:15})}),(0,i.jsxs)("span",{className:"font-mono text-xs text-zinc-400",children:[(0,v.fU)(D)," / ",(0,v.fU)(eg)]}),(0,i.jsx)(Z,{label:b.S.aspect,disabled:ej,value:z.aspect,onChange:e=>ew({...z,aspect:e}),options:k.S8.map(e=>({value:e,label:e}))})]})]})]}),(0,i.jsxs)("section",{ref:eT,className:"mx-3 shrink-0 rounded-2xl bg-zinc-900/60 p-3",children:[(0,i.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-1",children:[(0,i.jsxs)("button",{className:er,disabled:ej||z.clips.length>=100,onClick:e_,children:[(0,i.jsx)(r.A,{size:14}),b.S.subtitleAdd]}),(0,i.jsx)("button",{className:er,"aria-label":f.C.undo,disabled:ej||!eb.past.length,onClick:()=>ey(),children:(0,i.jsx)(c.A,{size:14})}),(0,i.jsx)("button",{className:er,"aria-label":f.C.redo,disabled:ej||!eb.future.length,onClick:()=>ey(!0),children:(0,i.jsx)(o.A,{size:14})}),(0,i.jsx)("button",{className:er,"aria-label":f.C.split,disabled:!eE(L),onClick:()=>eM(L),children:(0,i.jsx)(d.A,{size:14})}),(0,i.jsx)("button",{className:er,"aria-label":f.C.remove,disabled:!ev||ek,onClick:()=>eI(L),children:(0,i.jsx)(u.A,{size:14})}),(0,i.jsx)("button",{className:er,"aria-label":b.S.duplicate,disabled:!ev||ek||z.tracks.length>=j.Sj,onClick:()=>eD(L),children:(0,i.jsx)(x.A,{size:14})}),(0,i.jsx)(S.Ay,{value:P,onChange:R,onFit:()=>eR(z)}),(0,i.jsxs)("button",{className:"".concat(er," ").concat(G?"bg-white/10 text-zinc-100":""),disabled:!ev,"aria-expanded":G&&!!ev,onClick:()=>{G?eC():ev&&eN(ev.id)},children:[(0,i.jsx)(p.A,{size:13}),b.S.settings]})]}),(0,i.jsx)(F,{project:z,pixels:P,time:D,selected:L,disabled:ej,onTrackSelect:Y,onSelect:e=>{var t;K(e),Y((null==(t=z.clips.find(t=>t.id===e))?void 0:t.trackId)||""),T(!1)},onEdit:eN,onSplit:eM,onSplittable:eE,onDuplicate:eD,onRemoveClip:eI,onAddSubtitle:e_,onChange:ew,onSeek:e=>{T(!1),E(Math.min(eg,e))},draggedMedia:W,onZoom:e=>R((0,S.nN)(e)),onMediaDrop:(e,t)=>{W&&eL({...W.source,kind:W.source.kind||"video"},W.duration,{...e,start:t})},onDeleteTrack:e=>{T(!1),z.clips.some(t=>t.trackId===e)?et(e):ew((0,j.$r)(z,e))}})]}),(0,i.jsxs)("footer",{className:"shrink-0 px-5 py-3 text-xs text-zinc-400",children:[(en||A.error)&&(0,i.jsx)("p",{role:"status",className:"mb-2 text-[13px] text-amber-300",children:en||A.error}),(0,i.jsx)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:ed?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[13px] tabular-nums text-zinc-300",title:b.S.exportCost,"aria-label":"".concat(b.S.exportCost,": ").concat((0,g.iR)((0,j.OT)(z))),children:[(0,i.jsx)(m.A,{size:15}),(0,g.iR)((0,j.OT)(z))]}),(0,i.jsx)("button",{className:ec,onClick:()=>eu(!1),children:f.C.cancel}),(0,i.jsx)("button",{autoFocus:!0,className:eo,onClick:()=>{eu(!1),A.start()},children:b.S.confirmExport})]}):ex?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text-[13px] text-zinc-400",children:b.S.discardWarning}),(0,i.jsx)("button",{className:ec,onClick:()=>ep(!1),children:f.C.cancel}),(0,i.jsx)("button",{autoFocus:!0,className:eo,onClick:()=>{A.discard(),ep(!1)},children:f.C.confirmDiscard})]}):A.busy&&A.live?(0,i.jsx)(ei,{exporter:A,pauseClassName:ec,buttonClassName:eo}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(el,{at:A.doneAt}),!A.unresolved&&!0!==A.available&&(0,i.jsx)("span",{children:null===A.available?b.S.checking:b.S.exportUnavailable}),A.unresolved&&!A.busy&&(0,i.jsx)("button",{className:ec,onClick:()=>ep(!0),children:b.S.discard}),(0,i.jsx)("button",{className:eo,disabled:!z.clips.length||!A.unresolved&&!A.available||A.unresolved&&(null==(n=A.state)?void 0:n.phase)!=="querying",onClick:()=>{A.busy?A.pause():A.unresolved?A.start():eu(!0)},children:A.busy?f.C.stop:A.unresolved?b.S.reconnect:f.C.export})]})})]}),(0,i.jsx)(B.A,{source:q,onClose:()=>$(null)}),(0,i.jsx)(h.lG,{open:G&&!!ev,onOpenChange:e=>{e||eC()},children:(0,i.jsxs)(h.Cf,{overlayClassName:es,className:"z-[10001] flex max-h-[85vh] w-[94vw] max-w-2xl flex-col rounded-2xl border-0 bg-zinc-900 p-5 text-zinc-100",onKeyDown:e=>e.stopPropagation(),onEscapeKeyDown:H,children:[(0,i.jsx)(h.L3,{className:"mb-4 pr-8 text-sm",children:b.S.settings}),(0,i.jsx)(h.rr,{className:"sr-only",children:b.S.settingsHint}),(0,i.jsx)("div",{className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1",children:ev&&(0,i.jsx)(ee,{project:z,clip:ev,disabled:ek,onPatch:e=>{ev&&!ek&&ew({...z,clips:z.clips.map(t=>
1t.id===ev.id?{...t,...e}:t)})}})}),(0,i.jsxs)("div",{className:"mt-6 flex shrink-0 items-center justify-end gap-2",children:[(0,i.jsx)("button",{className:ec,title:b.S.revert,disabled:!em||ek,onClick:()=>{em&&!ek&&ew({...z,clips:z.clips.map(e=>e.id===em.id?em:e)}),eC()},children:f.C.cancel}),(0,i.jsx)("button",{className:eo,onClick:eC,children:b.S.done})]})]})}),(0,i.jsx)(h.lG,{open:!!Q,onOpenChange:e=>{e||et("")},children:(0,i.jsxs)(h.Cf,{overlayClassName:es,className:"z-[10001] max-w-sm rounded-2xl border-0 bg-zinc-900 p-6 text-zinc-100",onKeyDown:e=>e.stopPropagation(),children:[(0,i.jsx)(h.L3,{className:"pr-8 text-base",children:b.S.deleteTrackTitle}),(0,i.jsx)(h.rr,{className:"mt-3 text-xs leading-5 text-zinc-400",children:b.S.deleteTrackHint}),(0,i.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,i.jsx)("button",{autoFocus:!0,className:ec,onClick:()=>et(""),children:f.C.cancel}),(0,i.jsx)("button",{className:eo,disabled:ej,onClick:()=>{ew((0,j.$r)(z,Q)),et("")},children:b.S.deleteTrack})]})]})})]})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.