@shumai-one/shumai 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/bin/{chunk-mcj1xpcc.js → chunk-01vx2chc.js} +2 -2
  2. package/bin/chunk-0epkrexd.js +2 -0
  3. package/bin/chunk-0h5239kt.js +2 -0
  4. package/bin/{chunk-jt0ykktx.js → chunk-0jnstdgf.js} +1 -1
  5. package/bin/{chunk-x03jwaga.js → chunk-0njsjy6x.js} +4 -4
  6. package/bin/{chunk-7naa7tpn.js → chunk-13rq2gtr.js} +2 -2
  7. package/bin/chunk-1aqs9sdh.js +3 -0
  8. package/bin/{chunk-m0q2cgfg.js → chunk-22jbsrka.js} +1 -1
  9. package/bin/chunk-2qknebmd.js +1 -0
  10. package/bin/{chunk-a411xhmm.js → chunk-2qzmh3ae.js} +4 -4
  11. package/bin/{chunk-2nhgdqdg.js → chunk-2tt0b8ym.js} +2 -2
  12. package/bin/{chunk-p3f5aevs.js → chunk-2zm7czk6.js} +1 -1
  13. package/bin/{chunk-p4s95471.js → chunk-396tfwdx.js} +1 -1
  14. package/bin/chunk-3mx4trvh.js +10 -0
  15. package/bin/{chunk-b5rhvzv9.js → chunk-45pb3kzz.js} +2 -2
  16. package/bin/{chunk-q83h0hkx.js → chunk-47fmhzwv.js} +2 -2
  17. package/bin/chunk-4awk4xhq.js +2 -0
  18. package/bin/{chunk-2cdxm1cp.js → chunk-4b2x2qba.js} +23 -23
  19. package/bin/{chunk-knj2s8mg.js → chunk-4rjy7ybr.js} +8 -8
  20. package/bin/{chunk-q8w4mbw4.js → chunk-598x693h.js} +2 -2
  21. package/bin/chunk-5c7ztqs7.js +1 -0
  22. package/bin/{chunk-2jj4j8cn.js → chunk-65dh7x4c.js} +2 -2
  23. package/bin/{chunk-hnkcgvcj.js → chunk-66e2vrky.js} +1 -1
  24. package/bin/{chunk-g22wmpk1.js → chunk-6j3beg6n.js} +2 -2
  25. package/bin/{chunk-cgmebxx6.js → chunk-6ke13k69.js} +1 -1
  26. package/bin/{chunk-7sgrtxbt.js → chunk-6rqakmg0.js} +2 -2
  27. package/bin/{chunk-4mws03es.js → chunk-6ty4tfmf.js} +3 -3
  28. package/bin/chunk-7e9ws6dh.js +129 -0
  29. package/bin/chunk-7mdddkfc.js +1 -0
  30. package/bin/{chunk-q2bew2vc.js → chunk-7q4mgd5x.js} +2 -2
  31. package/bin/chunk-7yv7shad.js +1 -0
  32. package/bin/{chunk-qwpkcp8d.js → chunk-81b8rfv7.js} +2 -2
  33. package/bin/{chunk-atfz7g7e.js → chunk-8a7ymmd4.js} +2 -2
  34. package/bin/chunk-8ac9at5y.js +2 -0
  35. package/bin/{chunk-gxepkvt2.js → chunk-8zcfgz9c.js} +1 -1
  36. package/bin/{chunk-mcw198kg.js → chunk-955kf5kc.js} +8 -8
  37. package/bin/{chunk-jzgbxqdg.js → chunk-978rm9a9.js} +2 -2
  38. package/bin/{chunk-jt02kpfc.js → chunk-9qzbrp4d.js} +2 -2
  39. package/bin/{chunk-tekwpkjf.js → chunk-a283dh05.js} +2 -2
  40. package/bin/chunk-aa2a06cc.js +1 -0
  41. package/bin/{chunk-8cjet7pp.js → chunk-ajr1w3vq.js} +6 -6
  42. package/bin/chunk-akafypge.js +218 -0
  43. package/bin/chunk-amk373q2.js +2 -0
  44. package/bin/chunk-apq2gvvp.js +4 -0
  45. package/bin/chunk-av2w1sez.js +2 -0
  46. package/bin/{chunk-5wapd171.js → chunk-b6kmj34z.js} +12 -12
  47. package/bin/chunk-bkzaw9p8.js +1 -0
  48. package/bin/{chunk-zezje74z.js → chunk-bssb9tar.js} +3 -3
  49. package/bin/chunk-bwvj1aqc.js +1 -0
  50. package/bin/chunk-by9esjn7.js +3 -0
  51. package/bin/chunk-bywk8mbc.js +2 -0
  52. package/bin/{chunk-9xhjy897.js → chunk-c61g9hfa.js} +4 -4
  53. package/bin/{chunk-zrszykjf.js → chunk-cdcgjh8k.js} +1 -1
  54. package/bin/{chunk-yk12hydf.js → chunk-d277evce.js} +4 -4
  55. package/bin/{chunk-55h9ze53.js → chunk-d3brvxh7.js} +2 -2
  56. package/bin/{chunk-9t3p4xp6.js → chunk-dcb1nzf1.js} +1 -1
  57. package/bin/{chunk-mzsw9var.js → chunk-dfbzatq9.js} +2 -2
  58. package/bin/chunk-e0bckx12.js +2 -0
  59. package/bin/{chunk-3ckkwdjx.js → chunk-e2p4s2pj.js} +3 -3
  60. package/bin/chunk-e8zzg57c.js +2 -0
  61. package/bin/{chunk-vp3czaeh.js → chunk-edfaqwaq.js} +2 -2
  62. package/bin/chunk-ehgrp0f9.js +1 -0
  63. package/bin/chunk-evs2aaav.js +12 -0
  64. package/bin/{chunk-s9ksftq2.js → chunk-f5bhcjhw.js} +1 -1
  65. package/bin/{chunk-ns33grgx.js → chunk-fb9dedm2.js} +2 -2
  66. package/bin/{chunk-srxp5jav.js → chunk-ff0mh9p3.js} +32 -32
  67. package/bin/chunk-fpfby5tz.js +1 -0
  68. package/bin/{chunk-eyjfhdp9.js → chunk-gd3b5akr.js} +2 -2
  69. package/bin/{chunk-1wfg56z3.js → chunk-gm1fy3hm.js} +5 -5
  70. package/bin/{chunk-9n1w5dw1.js → chunk-gqkjx7rz.js} +3 -3
  71. package/bin/{chunk-1nvd90g2.js → chunk-h7f5370s.js} +1 -1
  72. package/bin/chunk-hcyhsn8e.js +2 -0
  73. package/bin/{chunk-vcrmjtcz.js → chunk-jxm0gzmf.js} +2 -2
  74. package/bin/{chunk-b7bnp021.js → chunk-k3ggy3xk.js} +2 -2
  75. package/bin/{chunk-257dcd2f.js → chunk-k9vjs21p.js} +2 -2
  76. package/bin/chunk-ka40gv72.js +1 -0
  77. package/bin/chunk-km70p970.js +2 -0
  78. package/bin/{chunk-e4yscwen.js → chunk-m6v8rb39.js} +8 -8
  79. package/bin/chunk-m8spagwp.js +4 -0
  80. package/bin/{chunk-y241cxff.js → chunk-mfh7mg5b.js} +1 -1
  81. package/bin/chunk-n0cn0218.js +2 -0
  82. package/bin/chunk-n54ftsdx.js +2 -0
  83. package/bin/{chunk-02fvcrej.js → chunk-n7cvj15k.js} +7 -7
  84. package/bin/chunk-na5fh7er.js +2 -0
  85. package/bin/chunk-neazdbxy.js +1 -0
  86. package/bin/chunk-nk24qw3m.js +1 -0
  87. package/bin/{chunk-73yncv54.js → chunk-nsbbseff.js} +2 -2
  88. package/bin/chunk-nseef85h.js +1 -0
  89. package/bin/chunk-p35ztj2z.js +3 -0
  90. package/bin/chunk-pcjc9ygv.js +2 -0
  91. package/bin/{chunk-167z646e.js → chunk-pemmtd8q.js} +1 -1
  92. package/bin/{chunk-82tps5n1.js → chunk-pzrqnnpg.js} +1 -1
  93. package/bin/{chunk-a74g6h8a.js → chunk-q43m934j.js} +2 -2
  94. package/bin/{chunk-r1xer8gn.js → chunk-q57m34h0.js} +3 -3
  95. package/bin/chunk-q5k72jz9.js +3 -0
  96. package/bin/chunk-q9fsxakd.js +2 -0
  97. package/bin/chunk-qadpe0ct.js +2 -0
  98. package/bin/chunk-qeypjv4f.css +1 -0
  99. package/bin/chunk-qw92z3wf.js +2 -0
  100. package/bin/chunk-r0byfq1t.js +1 -0
  101. package/bin/chunk-r0q88qw3.js +2 -0
  102. package/bin/chunk-rjhczkh3.js +2 -0
  103. package/bin/{chunk-mwktrwtx.js → chunk-s0wxbybf.js} +1 -1
  104. package/bin/{chunk-q5vkxee3.js → chunk-s4hkcw24.js} +2 -2
  105. package/bin/chunk-szta50g1.js +1 -0
  106. package/bin/chunk-t6cb99gp.js +2 -0
  107. package/bin/chunk-tcr080b9.js +1 -0
  108. package/bin/{chunk-yq32evnn.js → chunk-v4nqx084.js} +5 -5
  109. package/bin/{chunk-ympbfzz4.js → chunk-v7jzc3ye.js} +1 -1
  110. package/bin/{chunk-9zsv6d2f.js → chunk-vbe8wred.js} +1 -1
  111. package/bin/{chunk-hpbn0k9n.js → chunk-vf9s8b5t.js} +2 -2
  112. package/bin/{chunk-m9adtgzk.js → chunk-vk3eqr65.js} +1 -1
  113. package/bin/{chunk-hpwv4am3.js → chunk-vm9bbk97.js} +4 -4
  114. package/bin/{chunk-v05rrxp5.js → chunk-w4gqg27w.js} +2 -2
  115. package/bin/{chunk-x8mjh387.js → chunk-w6ym7tsd.js} +4 -4
  116. package/bin/{chunk-hzkjgcre.js → chunk-ways29d1.js} +1 -1
  117. package/bin/chunk-wesg7tg9.js +1 -0
  118. package/bin/chunk-wmrrapwv.js +2 -0
  119. package/bin/chunk-wnwsjgj8.js +2 -0
  120. package/bin/{chunk-hw6czrya.js → chunk-wrb4xq9v.js} +1 -1
  121. package/bin/{chunk-v5cn90cf.js → chunk-wzrzc07t.js} +2 -2
  122. package/bin/chunk-xd1axsdv.js +2 -0
  123. package/bin/{chunk-cwat1jwx.js → chunk-xk0jmx4s.js} +2 -2
  124. package/bin/{chunk-g6sdezec.js → chunk-y545vfn0.js} +1 -1
  125. package/bin/{chunk-fatmqnp1.js → chunk-y6h885fs.js} +1 -1
  126. package/bin/{chunk-cz13a82m.js → chunk-yncmfr39.js} +2 -2
  127. package/bin/{chunk-01052ssf.js → chunk-yxnz4ypt.js} +11 -11
  128. package/bin/chunk-zc1asygg.js +2 -0
  129. package/bin/{chunk-m82tkhaa.js → chunk-zc7wzcvh.js} +7 -7
  130. package/bin/chunk-zdvhh8mk.js +2 -0
  131. package/bin/{chunk-kvhf12b4.js → chunk-zg0b902x.js} +2 -2
  132. package/bin/{chunk-7v7mypc6.js → chunk-zhq7a7hs.js} +2 -2
  133. package/bin/{chunk-f25fe9th.js → chunk-zmnvskn7.js} +11 -11
  134. package/bin/shumai-app.html +1 -1
  135. package/bin/shumai-app.js +470 -389
  136. package/package.json +7 -7
  137. package/prisma/migrations/20261102032402_add_archive_storage/migration.sql +25 -0
  138. package/prisma/schema.prisma +12 -6
  139. package/bin/chunk-0bj887zm.js +0 -2
  140. package/bin/chunk-1ktk6764.js +0 -10
  141. package/bin/chunk-26qn7fek.js +0 -2
  142. package/bin/chunk-2ne2b54t.js +0 -2
  143. package/bin/chunk-2vbeqczj.js +0 -1
  144. package/bin/chunk-37p6bcx2.js +0 -1
  145. package/bin/chunk-3knfx6dm.js +0 -1
  146. package/bin/chunk-3z85zxkn.js +0 -1
  147. package/bin/chunk-54tbfvya.js +0 -2
  148. package/bin/chunk-56kh5fxc.js +0 -1
  149. package/bin/chunk-576nj64j.js +0 -2
  150. package/bin/chunk-6cnqjngz.js +0 -1
  151. package/bin/chunk-7g46e1wy.js +0 -3
  152. package/bin/chunk-84x8p7v5.js +0 -1
  153. package/bin/chunk-88jg9dq5.js +0 -2
  154. package/bin/chunk-8fyg9dy4.js +0 -2
  155. package/bin/chunk-8gtfgkrn.js +0 -2
  156. package/bin/chunk-8mqbztj8.js +0 -2
  157. package/bin/chunk-8qdtvfx3.css +0 -1
  158. package/bin/chunk-8xb6yz11.js +0 -2
  159. package/bin/chunk-8yjsmr7g.js +0 -2
  160. package/bin/chunk-91rb0jpb.js +0 -2
  161. package/bin/chunk-96qpjght.js +0 -2
  162. package/bin/chunk-9f1xk1nt.js +0 -1
  163. package/bin/chunk-9mk9cvbk.js +0 -1
  164. package/bin/chunk-9nw5w8vh.js +0 -1
  165. package/bin/chunk-ah8fjb6f.js +0 -2
  166. package/bin/chunk-cf5axr8c.js +0 -1
  167. package/bin/chunk-dk42gf7v.js +0 -2
  168. package/bin/chunk-e4f56spj.js +0 -4
  169. package/bin/chunk-eb7mzbfm.js +0 -1
  170. package/bin/chunk-er14d498.js +0 -3
  171. package/bin/chunk-f6avg5qe.js +0 -129
  172. package/bin/chunk-fvx9k1dc.js +0 -2
  173. package/bin/chunk-gtf19jc1.js +0 -2
  174. package/bin/chunk-h1n7jqnw.js +0 -1
  175. package/bin/chunk-hfm82066.js +0 -2
  176. package/bin/chunk-j2s311yc.js +0 -3
  177. package/bin/chunk-kj6h5j5a.js +0 -4
  178. package/bin/chunk-km4gn6b6.js +0 -1
  179. package/bin/chunk-ny1kbmxt.js +0 -2
  180. package/bin/chunk-p3j6ydk1.js +0 -1
  181. package/bin/chunk-pk406dgy.js +0 -2
  182. package/bin/chunk-s1e4qy3q.js +0 -14
  183. package/bin/chunk-swtwaaqe.js +0 -1
  184. package/bin/chunk-tagdrg7p.js +0 -1
  185. package/bin/chunk-twtxnzbv.js +0 -2
  186. package/bin/chunk-v5mcjwxy.js +0 -2
  187. package/bin/chunk-vkzasgxw.js +0 -2
  188. package/bin/chunk-x342vzdx.js +0 -2
  189. package/bin/chunk-xc54vhfz.js +0 -2
  190. package/bin/chunk-xvkwbczx.js +0 -3
  191. package/bin/chunk-z1p13dnc.js +0 -2
  192. package/bin/chunk-zarz3sqn.js +0 -211
@@ -0,0 +1,2 @@
1
+ import{G,S,Q,M,w,L,W,a,g,ae,ee,X,Rt,R,j,Wr,V,ys,fo,_r,qe,Be,Dn,qt,Mt,xr,Ue,Ke,U,N,De,cl,Ne,Fe,se,Sn,rr,os,ss,is,hh,Fi,ul,Kl,Ge,kp,Dt,Zd,Bd,Lr,Np,VC,pS,Xl,zh,Kh,Fy,Ly,ec,Yy,lg,bs,Bi,fl,mo,cm,ct,ut,dt,ft,pt,mt,ht,gt,Se,xe,ke,ot,Ce,re,Ie,er,Vt,B,ho,go,Xr,_n,ge,ui,yn,Cm}from"./chunk-akafypge.js";import{fi,pi,un,ff,pf,zs,js,mi,gi}from"./chunk-7e9ws6dh.js";import{hc,cf}from"./chunk-q57m34h0.js";import{Qi}from"./chunk-3mx4trvh.js";var tt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qe=j("pencil",tt);L();L();function Ye({teamId:d,projectId:r,file:n,onSaveField:o,members:C,onCommentSelect:m,hideAnnotationControl:k=!1,readOnly:h=!1,publicFields:A,isPublic:s=!1,shareId:v,currentTime:H,onTyping:Z,selectedCommentId:f,heightPercent:T,onHeightPercentChange:O}){let{canEdit:I}=er(r),{fields:l,setFields:z}=un(),ie=ae(),{ref:me,inView:le}=Vt(),[P,q]=w(null),[Y,fe]=w(!1),[c,J]=w(null),b=M(!1),te=M(0),K=M(T),_e=(e)=>{b.current=!0,te.current=e.clientY,K.current=T,e.target.setPointerCapture?.(e.pointerId)},we=G((e)=>{if(!b.current)return;let x=(te.current-e.clientY)/window.innerHeight*100,ne=Math.min(85,Math.max(10,K.current+x));O(ne)},[O]),Pe=(e)=>{b.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:_}=ee({queryKey:["fields",r],queryFn:async()=>{let e=await R.api.projects[":projectId"].fields.$get({param:{projectId:r}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!r&&!A}),y=zs(n);S(()=>{if(A)z(A,r);else if(_)z(_,r)},[_,A,r,z]);let{data:ce,fetchNextPage:E,hasNextPage:he}=Rt({queryKey:s?["shares",v,"files",n?.id,"comments"]:["files",n?.id,"comments"],queryFn:async({pageParam:e})=>{if(s){let i=localStorage.getItem(`share_pwd_${v}`)||"",x=await R.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:v,fileId:n.id},query:{after:e}},{headers:{"x-share-password":i}});if(!x.ok)throw Error("Failed to fetch comments");return await x.json()}else{let i=await R.api.files[":fileId"].comments.$get({param:{fileId:n.id},query:{after:e}});if(!i.ok)throw Error("Failed to fetch comments");return await i.json()}},enabled:!!n?.id&&(!s||!!v),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:be}=X({mutationFn:async({text:e,attachmentIds:i,annotations:x,replyToId:ne,second:ue})=>{if(s){let oe=localStorage.getItem(`share_pwd_${v}`)||"",Me=await R.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:v,fileId:n.id},json:{message:e,attachmentIds:i,replyToId:ne??void 0,annotations:x,second:ue??void 0}},{headers:{"x-share-password":oe}});if(!Me.ok)throw Error("Failed to create comment");return await Me.json()}else{let oe=await R.api.files[":fileId"].comments.$post({param:{fileId:n.id},json:{message:e,attachmentIds:i,replyToId:ne??void 0,annotations:x,second:ue??void 0}});if(!oe.ok)throw Error("Failed to create comment");return await oe.json()}},onSuccess:()=>{ie.invalidateQueries({queryKey:s?["shares",v,"files",n?.id,"comments"]:["files",n?.id,"comments"]})},onError:()=>{B.error(pS?.()||"Failed to post comment")}}),ve=ce?.pages?.[0]?.pageInfo?.total??ce?.pages.reduce((e,i)=>e+(i.data?.length||0),0)??0;S(()=>{if(le&&he)E()},[le,E,he]);let F=Q(()=>(n?.fieldValues||[]).reduce((e,i)=>(e[i.fieldId]=i,e),{}),[n?.fieldValues]),de=Q(()=>[...l].sort((e,i)=>{let x=e.config?.name?.toLowerCase()||"",ne=i.config?.name?.toLowerCase()||"";if(x<ne)return-1;if(x>ne)return 1;return 0}),[l]),ye=ce?.pages.flatMap((e)=>e.data??[])??[],Re=(e,i,x=[],ne,ue)=>{if(!e.trim()&&i.length===0&&x.length===0)return;let oe=ne||P?.id||null;if(s)if(!localStorage.getItem(`guest_user_id_${v}`))J({text:e,attachmentIds:i,annotations:x,replyToId:oe,second:ue}),fe(!0);else be({text:e,attachmentIds:i,annotations:x,replyToId:oe,second:ue});else be({text:e,attachmentIds:i,annotations:x,replyToId:oe,second:ue});q(null)},Ae=()=>{if(c)be({...c}),J(null),q(null)},Te=(e)=>{let i=C.find((x)=>x.id===e);if(i)return i;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=T<=15;return g("div",{style:{height:`${T}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[a("div",{onPointerDown:_e,onPointerMove:we,onPointerUp:Pe,onPointerCancel:Pe,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:a("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),g(ho,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[g(go,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[g(Xr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[kp()," ",ve>0&&`(${ve})`]}),a(Xr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Xl()})]}),g(_n,{value:"comments",className:U("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:[a("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:g("span",{className:"text-xs font-bold text-foreground",children:[hh?.()||"All comments",ve>0?` (${ve})`:""]})}),a(Ie,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:ye.length===0?a("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Ly()}):g("div",{className:"space-y-3",children:[ye.map((e)=>g("div",{children:[a(hc,{teamId:d,message:e,getUser:Te,onReply:q,hasReplies:!!e.replies?.length,formatTimestamp:y?.commentsConfig?.formatTimestamp,frameRate:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.frameRate||30:void 0,startTimecode:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.startTimecode:void 0,isSelected:f===e.id,onSelect:()=>{m?.(e)},readOnly:h,isPublic:s}),e.replies?.map((i,x)=>a("div",{children:a(hc,{teamId:d,isReply:!0,message:i,getUser:Te,onReply:q,hasReplies:!1,isLastReply:x===(e.replies?.length??0)-1,formatTimestamp:y?.commentsConfig?.formatTimestamp,frameRate:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.frameRate||30:void 0,startTimecode:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.startTimecode:void 0,isSelected:f===i.id,onSelect:()=>{m?.(i)},readOnly:h,isPublic:s})},i.id))]},e.id)),a("div",{ref:me})]})}),(!h||s)&&a("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:a(cf,{isOpen:Y,onClose:()=>fe(!1),onSuccess:Ae,shareId:v||void 0,children:a(Qi,{projectId:r,onSendMessage:Re,replyingTo:P,onCancelReply:()=>q(null),hideAnnotationControl:k,disableMentions:s,currentTime:y?.commentsConfig?.hasTimestamp?H:void 0,formatTimestamp:y?.commentsConfig?.formatTimestamp,frameRate:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.frameRate||30:void 0,startTimecode:y?.commentsConfig?.hasTimestamp?n?.media?.metadata?.startTimecode:void 0,onTyping:Z})})})]}),a(_n,{value:"fields",className:U("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:a(Ie,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:de&&de.length>0?a("div",{className:"space-y-4 pb-6",children:de.map((e)=>g("div",{className:"space-y-1.5",children:[a("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),a("div",{className:"min-h-[32px]",children:a(gi,{fieldId:e.id,config:e.config,value:F[e.id]?.value,onSave:I?(i)=>o(e.id,i):void 0,readOnly:h||e.readOnly||!I})})]},e.id))}):a("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function We({fileName:d,folderName:r,version:n,status:o,versions:C,activeFileId:m,isPublic:k=!1,shareId:h,allowDownload:A=!0,downloadInfo:s,canEdit:v=!1,onBack:H,onPrevFile:Z,onNextFile:f,hasPrevFile:T=!1,hasNextFile:O=!1,onSelectVersion:I,onRename:l,onDelete:z,onArchive:ie,onRestoreArchive:me,onLinkedTasks:le,linkedTaskCount:P=0}){let q=o==="archived"||o==="archiving"||o==="restoring",Y=async(c)=>{try{let J=k&&h?await R.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:h,fileId:m},json:{key:c}}):await R.api.files["download-url"].$post({json:{key:c,assetId:m}});if(!J.ok)return;let{url:b}=await J.json(),te=document.createElement("a");te.href=b,te.download="",document.body.appendChild(te),te.click(),document.body.removeChild(te)}catch{}},fe=(s?.videoTranscodes?.length??0)>0;return g("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[a("div",{className:"flex items-center",children:a(N,{variant:"ghost",size:"icon",onClick:H,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":lg(),children:a(Dn,{className:"h-5 w-5"})})}),g("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[g("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[r&&g(W,{children:[a("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:r}),a("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),C&&C.length>1?g(De,{modal:!1,children:[a(Ne,{asChild:!0,children:g("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[(o==="archived"||o==="restoring")&&a("span",{"data-testid":o==="restoring"?"detail-header-restoring-badge":"detail-header-archived-badge",title:o==="restoring"?fl():ul(),className:"inline-flex items-center shrink-0",children:a(_r,{className:"h-3 w-3 text-muted-foreground"})}),a("span",{className:"truncate max-w-[120px] font-semibold",children:d}),n!==void 0&&g(ge,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",n]}),a(Be,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),g(Fe,{align:"center",className:"w-48 z-40",children:[a(Sn,{className:"text-xs",children:cm()}),C.map((c)=>g(se,{onClick:()=>I?.(c.id),className:U("flex items-center justify-between text-xs cursor-pointer",c.id===m?"bg-accent font-semibold text-accent-foreground":""),children:[g("span",{children:["v",c.version]}),g("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px] flex items-center gap-1",children:[(c.status==="archived"||c.status==="restoring")&&a(_r,{className:"h-2.5 w-2.5 shrink-0 text-muted-foreground"}),a("span",{className:"truncate",children:c.name||d})]})]},c.id))]})]}):g("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[(o==="archived"||o==="restoring")&&a("span",{"data-testid":o==="restoring"?"detail-header-restoring-badge":"detail-header-archived-badge",title:o==="restoring"?fl():ul(),className:"inline-flex items-center shrink-0",children:a(_r,{className:"h-3 w-3 text-muted-foreground"})}),a("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:d}),n!==void 0&&g(ge,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",n]})]}),o==="archiving"&&g(ge,{variant:"secondary","data-testid":"detail-header-archiving-badge",className:"ml-1 gap-0.5 px-1 py-0 text-[10px] shrink-0",children:[a(V,{className:"h-2.5 w-2.5 animate-spin"}),a("span",{children:Kl()})]})]}),(T||O)&&g("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[a(N,{variant:"ghost",size:"icon",disabled:!T,onClick:Z,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Yy(),"aria-label":Yy(),children:a(Dn,{className:"h-3.5 w-3.5"})}),a(N,{variant:"ghost",size:"icon",disabled:!O,onClick:f,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Fy(),"aria-label":Fy(),children:a(qt,{className:"h-3.5 w-3.5"})})]})]}),a("div",{className:"flex items-center gap-1",children:g(De,{modal:!1,children:[a(Ne,{asChild:!0,children:a(N,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":Kh(),children:a(Wr,{className:"h-4 w-4"})})}),g(Fe,{align:"end",className:"w-52 z-40",children:[A&&(fe?g(os,{children:[g(ss,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[a(Mt,{className:"h-3.5 w-3.5"}),a("span",{children:Lr()})]}),a(cl,{children:g(is,{className:"w-48 z-50",children:[a(Sn,{className:"text-xs",children:Lr()}),s?.videoTranscodes?.map((c)=>{let J=ui(c),b=c.hdr?`${J} (HDR)`:J;return g(se,{onClick:()=>Y(c.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[a("span",{children:b}),a("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},c.key||`${J}-${c.hdr?"hdr":"sdr"}`)}),s?.originalKey&&g(W,{children:[a(rr,{}),g(se,{disabled:q,onClick:()=>!q&&Y(s.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[a("span",{children:ec?.()||"Original"}),a("span",{className:"text-[10px] text-muted-foreground",children:d.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):g(se,{onClick:()=>s?.originalKey&&!q&&Y(s.originalKey),disabled:!s?.originalKey||q,className:"flex items-center gap-2 text-xs cursor-pointer",children:[a(Mt,{className:"h-3.5 w-3.5"}),a("span",{children:Lr()})]})),C&&C.length>1&&I&&g(os,{children:[a(ss,{className:"flex items-center gap-2 text-xs cursor-pointer",children:a("span",{children:cm?.()||"Switch version"})}),a(cl,{children:g(is,{className:"w-48 z-50",children:[a(Sn,{className:"text-xs",children:cm?.()||"Switch version"}),C.map((c)=>g(se,{onClick:()=>I(c.id),className:U("flex items-center justify-between text-xs cursor-pointer",c.id===m?"bg-accent font-semibold text-accent-foreground":""),children:[g("span",{children:["v",c.version]}),a("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:c.name||d})]},c.id))]})})]}),le&&g(se,{onClick:le,className:"flex items-center justify-between text-xs cursor-pointer",children:[g("span",{className:"flex items-center gap-2",children:[a(ys,{className:"h-3.5 w-3.5"}),a("span",{children:zh?.()||"Linked Tasks"})]}),P>0&&a("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:P})]}),v&&l&&g(se,{onClick:l,className:"flex items-center gap-2 text-xs cursor-pointer",children:[a(Qe,{className:"h-3.5 w-3.5"}),a("span",{children:bs()})]}),v&&!k&&(!o||o==="processed")&&ie&&g(se,{"data-testid":"detail-header-archive-action",onClick:ie,className:"flex items-center gap-2 text-xs cursor-pointer",children:[a(_r,{className:"h-3.5 w-3.5"}),a("span",{children:Fi()})]}),v&&!k&&o==="archived"&&me&&g(se,{"data-testid":"detail-header-restore-archive-action",onClick:me,className:"flex items-center gap-2 text-xs cursor-pointer",children:[a(fo,{className:"h-3.5 w-3.5"}),a("span",{children:Bi()})]}),v&&z&&g(W,{children:[a(rr,{}),g(se,{onClick:z,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[a(Ue,{className:"h-3.5 w-3.5"}),a("span",{children:Dt()})]})]})]})]})})]})}function ku({projectId:d,teamId:r="",fileId:n,file:o,projectInfo:C,ancestorFolders:m=[],versions:k,activeFileId:h,startTime:A,isPublic:s=!1,shareId:v,allowDownload:H=!0,publicFields:Z,siblingFiles:f=[],onNavigateToFile:T,onNavigateBack:O,onRenameFile:I,onDeleteFile:l,onArchiveFile:z,onRestoreArchiveFile:ie,onSaveField:me,onSelectVersion:le}){let{canEdit:P}=er(d),{members:q}=yn(),Y=M(null),[fe,c]=w(50),[J,b]=w([]),[te,K]=w(0),[_e,we]=w(null),[Pe,_]=w(!1),[y,ce]=w(""),E=M(null),[he,be]=w(!1),[ve,F]=w(!1),[de,ye]=w(!1),[Re,Ae]=w(!1),{data:Te}=ee({queryKey:["teams",r,"kanban","assets",h,"tasks"],queryFn:async()=>{if(!r||!h||s)return{data:[],total:0};let u=await R.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:r,assetId:h}});if(!u.ok)return{data:[],total:0};return await u.json()},enabled:!!r&&!!h&&!s}),Le=Te?.total??Te?.data?.length??0,{prevFile:e,nextFile:i}=Q(()=>{if(!f||f.length===0)return{prevFile:null,nextFile:null};let u=f.findIndex((pe)=>pe.id===n||pe.id===h);if(u===-1)return{prevFile:null,nextFile:null};return{prevFile:u>0?f[u-1]:null,nextFile:u<f.length-1?f[u+1]:null}},[f,n,h]),x=m.length>0?m[0]?.name:C?.name,ue=k?.find((u)=>u.id===h)?.version??(k&&k.length>0?k.length:void 0),oe=Q(()=>({originalKey:o.media?.original?.key,videoTranscodes:o.media?.videoTranscodes?.map((u)=>({key:u.key,width:u.width,height:u.height,resolution:u.resolution,hdr:u.hdr}))}),[o.media]),Me=()=>{b([]),we(null)},Oe=()=>{b([]),we(null)},je=(u)=>{we(u.id||null);let pe=u.annotations;if(pe&&pe.length>0)b(pe);else b([]);if(u.second!==null&&u.second!==void 0)Y.current?.seekTo(u.second),Y.current?.pause();else if(pe&&pe.length>0)Y.current?.pause()},Ve=async(u)=>{if(u?.preventDefault(),!y.trim()||!I)return;try{F(!0),await I(y.trim()),_(!1)}finally{F(!1)}},ze=async()=>{if(!l)return;try{be(!0),await l(),ye(!1)}finally{be(!1)}};return S(()=>{K(0),we(null),b([])},[o?.id]),g("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[a(We,{fileName:o.name,folderName:x,version:ue,status:o.status,versions:k,activeFileId:h,isPublic:s,shareId:v,allowDownload:H,downloadInfo:oe,canEdit:P,onBack:O,hasPrevFile:!!e,hasNextFile:!!i,onPrevFile:()=>e&&T(e.id),onNextFile:()=>i&&T(i.id),onSelectVersion:le,onRename:()=>{ce(o.name),_(!0)},onDelete:()=>ye(!0),onArchive:z,onRestoreArchive:ie,onLinkedTasks:!s?()=>Ae(!0):void 0,linkedTaskCount:Le}),a("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:a(js,{file:o,mediaControllerRef:Y,onPlay:Me,onTimeUpdate:K,onSeek:Oe,annotations:J,startTime:A,shareId:v,allowDownload:H})}),a(Ye,{teamId:r,projectId:d,file:o,onSaveField:me,members:q,onCommentSelect:je,hideAnnotationControl:o.proxyType==="audio",readOnly:s||!P,publicFields:Z,isPublic:s,shareId:v,currentTime:te,onTyping:()=>Y.current?.pause(),selectedCommentId:_e,heightPercent:fe,onHeightPercentChange:c}),!s&&Re&&a(Cm,{teamId:r,assetId:h,assetName:o.name,isOpen:Re,onClose:()=>Ae(!1)}),!s&&a(Se,{open:Pe,onOpenChange:_,children:a(xe,{children:g("form",{onSubmit:Ve,children:[a(ke,{children:a(Ce,{children:bs()})}),a("div",{className:"py-4",children:a(re,{ref:E,value:y,onChange:(u)=>ce(u.target.value),placeholder:Np?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(E.current)mi(E.current)},0)},autoFocus:!0})}),g(ot,{children:[a(N,{type:"button",variant:"outline",onClick:()=>_(!1),children:Ge()}),g(N,{type:"submit",disabled:ve||!y.trim(),children:[ve&&a(V,{className:"mr-2 h-4 w-4 animate-spin"}),mo()]})]})]})})}),!s&&a(ct,{open:de,onOpenChange:ye,children:g(ut,{children:[g(dt,{children:[a(pt,{children:Bd?.()||"Delete Asset?"}),a(mt,{children:Zd?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),g(ft,{children:[a(gt,{children:Ge()}),g(ht,{onClick:ze,disabled:he,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[he&&a(V,{className:"mr-2 h-4 w-4 animate-spin"}),Dt()]})]})]})})]})}L();function Xe({activeState:d,activeAsset:r,previewUrl:n,isFullScreen:o,onTogglePlay:C,onToggleLoop:m,onSeek:k,onVolumeChange:h,onToggleMute:A,onChangePlaybackRate:s,onChangeResolution:v,onZoomIn:H,onZoomOut:Z,onFit:f,onDownload:T,onToggleFullScreen:O,allowDownload:I=!0}){if(d?.kind==="video"&&d.video&&r){let l=d.video,z=l.totalFrames/l.frameRate,ie=l.currentFrame/l.frameRate,me={isPlaying:l.isPlaying,progress:z>0?ie/z*100:0,currentTime:ie,duration:z,volume:l.volume,isMuted:l.isMuted,isLooping:l.isLooping,playbackRate:l.playbackRate,isFullScreen:o,showFrames:!1,currentResolution:l.currentResolution,isCurrentHdr:l.isCurrentHdr,activeAutoResolution:l.activeAutoResolution,isHlsManualSupported:l.isHlsManualSupported,isLoading:l.isLoading},le=n&&!r.media?.videoPreview?{...r,media:{...r.media,videoPreview:{url:n}}}:r;return a(ff,{state:me,zoom:d.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:l.buffered,data:le,resolutions:l.resolutions,togglePlay:C,toggleLoop:m,toggleMute:A,handleVolumeChange:h,changePlaybackRate:s,changeResolution:(P)=>v(P.resolution,P.hdr),handleDownload:(P)=>T(P),toggleFullScreen:O,onZoomChange:(P)=>P>=d.zoom?H():Z(),onZoomReset:f,frameRate:l.frameRate,totalFrames:l.totalFrames,currentFrame:l.currentFrame,seekToFrame:k,allowDownload:I})}if(d?.kind==="image")return a(pf,{zoom:d.zoom,onZoomIn:H,onZoomOut:Z,onFit:f,onDownload:()=>T(),canDownload:!!r?.media?.original?.key&&r.status!=="archived"&&r.status!=="archiving"&&r.status!=="restoring",fullscreen:{isFullScreen:o,onToggle:O},allowDownload:I});return a("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:a("button",{onClick:O,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:o?a(pi,{className:"h-5 w-5"}):a(fi,{className:"h-5 w-5"})})})}function Ze({side:d,fileName:r,version:n,activeVersionId:o,versions:C,isActive:m,onActivate:k,onSwitchVersion:h,onExit:A}){let s=U("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",m?"text-foreground":"text-muted-foreground hover:text-foreground"),v=a("button",{onClick:A,title:VC(),className:s,children:a(Ke,{className:"h-4 w-4"})}),H=g("button",{onClick:k,className:U("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",m?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[a("span",{className:"truncate",children:r}),n!==void 0&&g("span",{className:U("flex-shrink-0 rounded border px-1 py-0 text-xs",m?"border-foreground/40":"border-border"),children:["v",n]})]}),Z=g(De,{children:[a(Ne,{onClick:k,title:cm(),className:s,children:a(Be,{className:"h-4 w-4"})}),a(Fe,{align:d==="left"?"start":"end",className:"w-80 p-1",children:a("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:C.map((f)=>{let T=f.id===o;return g(se,{onClick:()=>h(f.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[g("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",f.version]}),a("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.previewUrl?a("img",{src:f.previewUrl,alt:f.name||void 0,className:"h-full w-full object-cover"}):a(xr,{className:"h-4 w-4 text-muted-foreground"})}),g("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[a("span",{className:"truncate text-sm font-semibold text-foreground",children:f.name}),a("span",{className:"truncate text-xs text-muted-foreground",children:f.creator?.name||"Unknown"})]}),T&&a(qe,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},f.id)})})})]});return a("div",{onMouseDown:k,className:U("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",m?"border-b-2 border-primary":"border-border"),children:d==="left"?g(W,{children:[v,H,Z]}):g(W,{children:[H,Z,a("div",{className:"ml-auto"}),v]})})}function Je(d,r,n){return ee({queryKey:r?["public-share-file",n,d,localStorage.getItem(`share_pwd_${n}`)||""]:["files",d],queryFn:async()=>{if(r){let C=localStorage.getItem(`share_pwd_${n}`)||"",m=await R.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:n,fileId:d}},{headers:{"x-share-password":C}});if(!m.ok)throw Error("Failed to fetch version asset");return await m.json()}let o=await R.api.files[":fileId"].$get({param:{fileId:d}});if(!o.ok)throw Error("Failed to fetch version asset");return await o.json()},enabled:!!d&&(!r||!!n)})}function Ru({isPublic:d=!1,shareId:r,versions:n,leftId:o,rightId:C,activeSide:m,annotations:k,seekRequest:h,onActiveSideChange:A,onSwitchVersion:s,onExit:v,onActiveAssetChange:H,onPlay:Z,onTimeUpdate:f,allowDownload:T=!0}){let O=M(null),I=M(null),l=M(null),[z,ie]=w(null),[me,le]=w(null),[P,q]=w(1),[Y,fe]=w(!1),[c,J]=w(!1),{data:b,isLoading:te}=Je(o,d,r),{data:K,isLoading:_e}=Je(C,d,r),we=zs(b),Pe=zs(K),_=!!b&&!!K&&we.id===Pe.id,y=m==="left"?b:K,ce=m==="left"?z:me,E=G(()=>m==="left"?I.current:l.current,[m]),he=G(()=>m==="left"?l.current:I.current,[m]);S(()=>{H(y??null)},[y,H]),S(()=>{if(!h)return;let t=E();if(t?.seekToSecond(h.second),t?.pause(),_){let p=he();p?.seekToSecond(h.second),p?.pause()}},[h?.nonce]),S(()=>{let t=()=>J(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[]);let be=G((t)=>ie(t),[]),ve=G((t)=>le(t),[]),F=G((t)=>{let p=E();if(p)t(p);if(_){let D=he();if(D)t(D)}},[E,he,_]),de=G(()=>{let t=!ce?.video?.isPlaying;F((p)=>t?p.play():p.pause())},[ce?.video?.isPlaying,F]);S(()=>{let t=(p)=>{let D=document.activeElement;if(D&&(D.tagName==="INPUT"||D.tagName==="TEXTAREA"||D instanceof HTMLElement&&D.isContentEditable))return;let He=p.key===" ",Ee=D&&(D.tagName==="BUTTON"||D.tagName==="A"||D.tagName==="SELECT"||D.tagName==="OPTION"||D.getAttribute("role")==="button"||D.getAttribute("role")==="link"||D.getAttribute("role")==="checkbox"||D.getAttribute("role")==="radio"||D.getAttribute("role")==="menuitem");if(He&&Ee)return;if(p.key===" "||p.key.toLowerCase()==="k")p.preventDefault(),de()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[de]);let ye=G((t)=>F((p)=>p.seekToFrame(t)),[F]),Re=G(()=>E()?.toggleLoop(),[E]),Ae=G((t)=>{q(t),fe(t===0)},[]),Te=G(()=>fe((t)=>!t),[]),Le=G((t)=>F((p)=>p.setPlaybackRate(t)),[F]),e=G((t,p)=>E()?.changeResolution(t,p),[E]),i=G(()=>F((t)=>t.zoomBy(1.2)),[F]),x=G(()=>F((t)=>t.zoomBy(0.8)),[F]),ne=G(()=>F((t)=>t.fit()),[F]),ue=G((t)=>{E()?.download(t)},[E]),oe=G(()=>{let t=O.current;if(!t||typeof t.requestFullscreen!=="function")return;if(!document.fullscreenElement)t.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),Me=G((t,p)=>{if(_)l.current?.panBy(t,p)},[_]),Oe=G((t,p)=>{if(_)I.current?.panBy(t,p)},[_]),je=G(()=>de(),[de]),Ve=G((t)=>n.find((p)=>p.id===t)?.version,[n]),ze=Q(()=>y?.media?.videoPreview?.url,[y?.media?.videoPreview?.url]),u=(t,p)=>{let He=zs(p)?.comparePane;if(!He)return a("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:a("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Ee=m===t;return a(He,{ref:t==="left"?I:l,file:p,shareId:r,isActive:Ee,annotations:Ee?k:[],onStateChange:t==="left"?be:ve,onUserPan:t==="left"?Me:Oe,onActivate:()=>A(t),muted:Ee?Y:!0,volume:P,onPlay:Z,onTimeUpdate:f,onRequestTogglePlay:je},p.id)},pe=!!b&&!!K,et=te||_e;return g("div",{ref:O,className:"flex h-full flex-1 flex-col bg-background",children:[g("div",{className:"flex min-h-0 flex-1",children:[g("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[b&&a(Ze,{side:"left",fileName:b.name,version:Ve(o),activeVersionId:o,versions:n,isActive:m==="left",onActivate:()=>A("left"),onSwitchVersion:(t)=>s("left",t),onExit:v}),a("div",{className:"relative flex min-h-0 flex-1",children:b?u("left",b):a("div",{className:"flex flex-1 items-center justify-center",children:a(V,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),g("div",{className:"flex min-w-0 flex-1 flex-col",children:[K&&a(Ze,{side:"right",fileName:K.name,version:Ve(C),activeVersionId:C,versions:n,isActive:m==="right",onActivate:()=>A("right"),onSwitchVersion:(t)=>s("right",t),onExit:v}),a("div",{className:"relative flex min-h-0 flex-1",children:K?u("right",K):a("div",{className:"flex flex-1 items-center justify-center",children:a(V,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),et&&!pe&&a("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:a(V,{className:"h-8 w-8 animate-spin text-foreground"})}),a(Xe,{activeState:ce,activeAsset:y??null,previewUrl:ze,isFullScreen:c,onTogglePlay:de,onToggleLoop:Re,onSeek:ye,onVolumeChange:Ae,onToggleMute:Te,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:i,onZoomOut:x,onFit:ne,onDownload:ue,onToggleFullScreen:oe,allowDownload:T})]})}
2
+ export{ku,Ru};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xt}from"./chunk-c61g9hfa.js";import{At}from"./chunk-m6v8rb39.js";import{ie}from"./chunk-65dh7x4c.js";var _=ie(Xt()),N=ie(At()),Ed="AWS_ACCESS_KEY_ID",xd="AWS_SECRET_ACCESS_KEY",S="AWS_SESSION_TOKEN",C="AWS_CREDENTIAL_EXPIRATION",A="AWS_CREDENTIAL_SCOPE",p="AWS_ACCOUNT_ID",rp=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[Ed],E=process.env[xd],r=process.env[S],n=process.env[C],s=process.env[A],t=process.env[p];if(o&&E){let c={accessKeyId:o,secretAccessKey:E,...r&&{sessionToken:r},...n&&{expiration:new Date(n)},...s&&{credentialScope:s},...t&&{accountId:t}};return _.setCredentialFeature(c,"CREDENTIALS_ENV_VARS","g"),c}throw new N.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{Ed,xd,rp};