@shumai-one/shumai 0.6.1 → 0.6.2

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 (225) hide show
  1. package/bin/chunk-01052ssf.js +32 -0
  2. package/bin/{chunk-w4ydfy9d.js → chunk-02fvcrej.js} +4 -4
  3. package/bin/chunk-0bj887zm.js +2 -0
  4. package/bin/chunk-167z646e.js +2 -0
  5. package/bin/chunk-1ktk6764.js +10 -0
  6. package/bin/{chunk-p1ed0pa6.js → chunk-1nvd90g2.js} +1 -1
  7. package/bin/{chunk-kywdke0y.js → chunk-1wfg56z3.js} +5 -5
  8. package/bin/{chunk-ahgq10a7.js → chunk-257dcd2f.js} +2 -2
  9. package/bin/chunk-26qn7fek.js +2 -0
  10. package/bin/chunk-2cdxm1cp.js +55 -0
  11. package/bin/chunk-2jj4j8cn.js +3 -0
  12. package/bin/chunk-2ne2b54t.js +2 -0
  13. package/bin/{chunk-qqj2m1b1.js → chunk-2nhgdqdg.js} +2 -2
  14. package/bin/chunk-2vbeqczj.js +1 -0
  15. package/bin/chunk-37p6bcx2.js +1 -0
  16. package/bin/chunk-3ckkwdjx.js +13 -0
  17. package/bin/chunk-3knfx6dm.js +1 -0
  18. package/bin/chunk-3z85zxkn.js +1 -0
  19. package/bin/chunk-4mws03es.js +5 -0
  20. package/bin/chunk-54tbfvya.js +2 -0
  21. package/bin/chunk-55h9ze53.js +2 -0
  22. package/bin/chunk-56kh5fxc.js +1 -0
  23. package/bin/chunk-576nj64j.js +2 -0
  24. package/bin/{chunk-dfecgpce.js → chunk-5wapd171.js} +13 -13
  25. package/bin/chunk-6cnqjngz.js +1 -0
  26. package/bin/chunk-73yncv54.js +2 -0
  27. package/bin/chunk-7g46e1wy.js +3 -0
  28. package/bin/{chunk-jq3pq545.js → chunk-7naa7tpn.js} +2 -2
  29. package/bin/{chunk-am6dg0a5.js → chunk-7sgrtxbt.js} +2 -2
  30. package/bin/{chunk-3me1v3z5.js → chunk-7v7mypc6.js} +2 -2
  31. package/bin/chunk-82tps5n1.js +2 -0
  32. package/bin/chunk-84x8p7v5.js +1 -0
  33. package/bin/{chunk-fxtzy5f5.js → chunk-88jg9dq5.js} +2 -2
  34. package/bin/chunk-8cjet7pp.js +12 -0
  35. package/bin/chunk-8fyg9dy4.js +2 -0
  36. package/bin/chunk-8gtfgkrn.js +2 -0
  37. package/bin/chunk-8mqbztj8.js +2 -0
  38. package/bin/chunk-8xb6yz11.js +2 -0
  39. package/bin/chunk-8yjsmr7g.js +2 -0
  40. package/bin/chunk-91rb0jpb.js +2 -0
  41. package/bin/chunk-96qpjght.js +2 -0
  42. package/bin/chunk-9f1xk1nt.js +1 -0
  43. package/bin/chunk-9mk9cvbk.js +1 -0
  44. package/bin/{chunk-r5g84kj4.js → chunk-9n1w5dw1.js} +3 -3
  45. package/bin/chunk-9nw5w8vh.js +1 -0
  46. package/bin/{chunk-3j82q2gj.js → chunk-9t3p4xp6.js} +1 -1
  47. package/bin/chunk-9xhjy897.js +11 -0
  48. package/bin/chunk-9zsv6d2f.js +1 -0
  49. package/bin/chunk-a411xhmm.js +7 -0
  50. package/bin/{chunk-s01p4w8d.js → chunk-a74g6h8a.js} +2 -2
  51. package/bin/chunk-ah8fjb6f.js +2 -0
  52. package/bin/chunk-atfz7g7e.js +2 -0
  53. package/bin/{chunk-swz6v48q.js → chunk-b5rhvzv9.js} +2 -2
  54. package/bin/{chunk-bg6waaf9.js → chunk-b7bnp021.js} +2 -2
  55. package/bin/chunk-cf5axr8c.js +1 -0
  56. package/bin/chunk-cgmebxx6.js +2 -0
  57. package/bin/chunk-cwat1jwx.js +3 -0
  58. package/bin/chunk-cz13a82m.js +3 -0
  59. package/bin/chunk-dk42gf7v.js +2 -0
  60. package/bin/chunk-e4f56spj.js +4 -0
  61. package/bin/chunk-e4yscwen.js +18 -0
  62. package/bin/chunk-eb7mzbfm.js +1 -0
  63. package/bin/chunk-er14d498.js +3 -0
  64. package/bin/{chunk-bs6saf4d.js → chunk-eyjfhdp9.js} +2 -2
  65. package/bin/chunk-f25fe9th.js +393 -0
  66. package/bin/chunk-f6avg5qe.js +129 -0
  67. package/bin/chunk-fatmqnp1.js +2 -0
  68. package/bin/chunk-fvx9k1dc.js +2 -0
  69. package/bin/{chunk-h6f2gyt5.js → chunk-g22wmpk1.js} +2 -2
  70. package/bin/chunk-g6sdezec.js +2 -0
  71. package/bin/chunk-gtf19jc1.js +2 -0
  72. package/bin/chunk-gxepkvt2.js +2 -0
  73. package/bin/chunk-h1n7jqnw.js +1 -0
  74. package/bin/chunk-hfm82066.js +2 -0
  75. package/bin/chunk-hnkcgvcj.js +3 -0
  76. package/bin/{chunk-agcnbjxk.js → chunk-hpbn0k9n.js} +2 -2
  77. package/bin/{chunk-d4hk62q2.js → chunk-hpwv4am3.js} +4 -4
  78. package/bin/{chunk-acmr8v0d.js → chunk-hw6czrya.js} +1 -1
  79. package/bin/{chunk-r9gp9yqw.js → chunk-hzkjgcre.js} +1 -1
  80. package/bin/chunk-j2s311yc.js +3 -0
  81. package/bin/{chunk-6hzktewz.js → chunk-jt02kpfc.js} +2 -2
  82. package/bin/{chunk-c60j1b4w.js → chunk-jt0ykktx.js} +1 -1
  83. package/bin/{chunk-sd6w0z6a.js → chunk-jzgbxqdg.js} +2 -2
  84. package/bin/chunk-kj6h5j5a.js +4 -0
  85. package/bin/chunk-km4gn6b6.js +1 -0
  86. package/bin/chunk-knj2s8mg.js +16 -0
  87. package/bin/{chunk-1eqw2dpx.js → chunk-kvhf12b4.js} +2 -2
  88. package/bin/chunk-m0q2cgfg.js +2 -0
  89. package/bin/chunk-m82tkhaa.js +11 -0
  90. package/bin/chunk-m9adtgzk.js +2 -0
  91. package/bin/{chunk-0tvnfy4k.js → chunk-mcj1xpcc.js} +2 -2
  92. package/bin/chunk-mcw198kg.js +13 -0
  93. package/bin/{chunk-9s0k533c.js → chunk-mwktrwtx.js} +1 -1
  94. package/bin/{chunk-wsprap60.js → chunk-mzsw9var.js} +2 -2
  95. package/bin/chunk-ns33grgx.js +2 -0
  96. package/bin/{chunk-xsfy8hz3.js → chunk-ny1kbmxt.js} +2 -2
  97. package/bin/{chunk-16n160h1.js → chunk-p3f5aevs.js} +1 -1
  98. package/bin/chunk-p3j6ydk1.js +1 -0
  99. package/bin/chunk-p4s95471.js +2 -0
  100. package/bin/chunk-pk406dgy.js +2 -0
  101. package/bin/chunk-q2bew2vc.js +2 -0
  102. package/bin/chunk-q5vkxee3.js +5 -0
  103. package/bin/{chunk-hzv1mhr5.js → chunk-q83h0hkx.js} +2 -2
  104. package/bin/{chunk-fre31bhw.js → chunk-q8w4mbw4.js} +2 -2
  105. package/bin/{chunk-b7qs7hxg.js → chunk-qwpkcp8d.js} +2 -2
  106. package/bin/chunk-r1xer8gn.js +5 -0
  107. package/bin/chunk-s1e4qy3q.js +14 -0
  108. package/bin/{chunk-b9d8xdhb.js → chunk-s9ksftq2.js} +1 -1
  109. package/bin/chunk-srxp5jav.js +42 -0
  110. package/bin/chunk-swtwaaqe.js +1 -0
  111. package/bin/chunk-tagdrg7p.js +1 -0
  112. package/bin/{chunk-d18v5vmp.js → chunk-tekwpkjf.js} +2 -2
  113. package/bin/chunk-twtxnzbv.js +2 -0
  114. package/bin/{chunk-c6f8x05m.js → chunk-v05rrxp5.js} +2 -2
  115. package/bin/{chunk-ht5rht98.js → chunk-v5cn90cf.js} +2 -2
  116. package/bin/chunk-v5mcjwxy.js +2 -0
  117. package/bin/{chunk-jb8vbeb0.js → chunk-vcrmjtcz.js} +2 -2
  118. package/bin/chunk-vkzasgxw.js +2 -0
  119. package/bin/chunk-vp3czaeh.js +7 -0
  120. package/bin/chunk-x03jwaga.js +8 -0
  121. package/bin/chunk-x342vzdx.js +2 -0
  122. package/bin/chunk-x8mjh387.js +5 -0
  123. package/bin/chunk-xc54vhfz.js +2 -0
  124. package/bin/chunk-xvkwbczx.js +3 -0
  125. package/bin/chunk-y241cxff.js +1 -0
  126. package/bin/chunk-yk12hydf.js +7 -0
  127. package/bin/chunk-ympbfzz4.js +2 -0
  128. package/bin/{chunk-n412a1hp.js → chunk-yq32evnn.js} +6 -6
  129. package/bin/chunk-z1p13dnc.js +2 -0
  130. package/bin/chunk-zarz3sqn.js +211 -0
  131. package/bin/chunk-zezje74z.js +4 -0
  132. package/bin/chunk-zrszykjf.js +3 -0
  133. package/bin/shumai-app.html +1 -1
  134. package/bin/shumai-app.js +942 -1015
  135. package/package.json +7 -7
  136. package/prisma/migrations/20261026024507_hash_api_tokens/migration.sql +28 -0
  137. package/prisma/migrations/20261026031904_add_audit_log_via/migration.sql +2 -0
  138. package/prisma/migrations/20261029024626_add_oauth_and_jwks/migration.sql +205 -0
  139. package/prisma/migrations/20261029030321_default_empty_arrays_oauth/migration.sql +25 -0
  140. package/prisma/schema.prisma +186 -1
  141. package/bin/chunk-0502p2k7.js +0 -3
  142. package/bin/chunk-0b0t6y8h.js +0 -11
  143. package/bin/chunk-1vt9ss7d.js +0 -2
  144. package/bin/chunk-23780yj6.js +0 -3
  145. package/bin/chunk-2cpsfc87.js +0 -1
  146. package/bin/chunk-2w0d9veg.js +0 -2
  147. package/bin/chunk-2xp9prpq.js +0 -1
  148. package/bin/chunk-3gqs15zq.js +0 -2
  149. package/bin/chunk-3pw7z25v.js +0 -3
  150. package/bin/chunk-3tx9v8kj.js +0 -2
  151. package/bin/chunk-3wdtp4ht.js +0 -1
  152. package/bin/chunk-57axjy7y.js +0 -1
  153. package/bin/chunk-5aqthcm6.js +0 -5
  154. package/bin/chunk-5gq4q1bb.js +0 -2
  155. package/bin/chunk-5r1br11d.js +0 -2
  156. package/bin/chunk-61hrdg0g.js +0 -1
  157. package/bin/chunk-6aa4xmnw.js +0 -2
  158. package/bin/chunk-6mrgtn78.js +0 -18
  159. package/bin/chunk-6s55r0z9.js +0 -1
  160. package/bin/chunk-6vkfzzvt.js +0 -5
  161. package/bin/chunk-7dprpnm6.js +0 -2
  162. package/bin/chunk-7rycq6wb.js +0 -129
  163. package/bin/chunk-895gzdtp.js +0 -7
  164. package/bin/chunk-8d1p8qpv.js +0 -1
  165. package/bin/chunk-8r3k84dh.js +0 -2
  166. package/bin/chunk-99sarrvt.js +0 -3
  167. package/bin/chunk-b21z62fj.js +0 -1
  168. package/bin/chunk-bv589v2m.js +0 -3
  169. package/bin/chunk-c8kjpmfe.js +0 -2
  170. package/bin/chunk-c9xyejnk.js +0 -2
  171. package/bin/chunk-cb9peqy5.js +0 -2
  172. package/bin/chunk-ckczqmrz.js +0 -5
  173. package/bin/chunk-cr33cs6j.js +0 -2
  174. package/bin/chunk-cxet91kt.js +0 -2
  175. package/bin/chunk-d7e351jd.js +0 -6
  176. package/bin/chunk-ebcfbn00.js +0 -2
  177. package/bin/chunk-f0b4a9y3.js +0 -2
  178. package/bin/chunk-fkn6f4qt.js +0 -4
  179. package/bin/chunk-g78vapcm.js +0 -2
  180. package/bin/chunk-gdpfwxea.js +0 -4
  181. package/bin/chunk-gwqqq0b1.js +0 -32
  182. package/bin/chunk-h3cwf9aw.js +0 -2
  183. package/bin/chunk-h4ty530v.js +0 -16
  184. package/bin/chunk-h58yfx7w.js +0 -2
  185. package/bin/chunk-h9ngpxyd.js +0 -1
  186. package/bin/chunk-hbr17jvr.js +0 -13
  187. package/bin/chunk-hc0xbmtt.js +0 -5
  188. package/bin/chunk-j9t7tvt5.js +0 -2
  189. package/bin/chunk-jvt8q0eg.js +0 -2
  190. package/bin/chunk-jzgtthsj.js +0 -3
  191. package/bin/chunk-jzjhg7ng.js +0 -1
  192. package/bin/chunk-k547syp2.js +0 -2
  193. package/bin/chunk-k7sjpke6.js +0 -2
  194. package/bin/chunk-k8ct1qgv.js +0 -3
  195. package/bin/chunk-k9q4nn8b.js +0 -11
  196. package/bin/chunk-keetdtxb.js +0 -2
  197. package/bin/chunk-kjjw8mbg.js +0 -1
  198. package/bin/chunk-mey80kv9.js +0 -54
  199. package/bin/chunk-nfncawpm.js +0 -12
  200. package/bin/chunk-nvwt8atc.js +0 -1
  201. package/bin/chunk-p1d500sf.js +0 -211
  202. package/bin/chunk-q0vs124k.js +0 -2
  203. package/bin/chunk-q5795f3s.js +0 -2
  204. package/bin/chunk-q5j3b0h5.js +0 -3
  205. package/bin/chunk-qd7pvaxb.js +0 -2
  206. package/bin/chunk-qhpt7170.js +0 -2
  207. package/bin/chunk-qt78vs3g.js +0 -2
  208. package/bin/chunk-ra6mdjr0.js +0 -1
  209. package/bin/chunk-ryfvaz6v.js +0 -3
  210. package/bin/chunk-s22eapcc.js +0 -2
  211. package/bin/chunk-sbg86tch.js +0 -2
  212. package/bin/chunk-sbqy6m8t.js +0 -1
  213. package/bin/chunk-sdp9w627.js +0 -14
  214. package/bin/chunk-sn0nypvd.js +0 -42
  215. package/bin/chunk-sv92vkyh.js +0 -2
  216. package/bin/chunk-t6cn018t.js +0 -3
  217. package/bin/chunk-ts4d1mxf.js +0 -2
  218. package/bin/chunk-wkdkc12e.js +0 -4
  219. package/bin/chunk-xgnvktq6.js +0 -10
  220. package/bin/chunk-xjw3mpvx.js +0 -1
  221. package/bin/chunk-xznq2axj.js +0 -1
  222. package/bin/chunk-y4v08wq7.js +0 -1
  223. package/bin/chunk-yncvy335.js +0 -3
  224. package/bin/chunk-ytzddcj2.js +0 -1
  225. package/bin/chunk-zxqasmvz.js +0 -2
@@ -1,2 +0,0 @@
1
- import{P,m,N,_,u,E,L,t,o,G,Z,B,pt,g,I,Er,O,Fo,Me,ve,an,It,wt,ar,we,Ne,C,S,ge,ra,Ae,_e,K,en,Kt,As,_s,ys,Of,Re,Ad,ht,Kc,Wc,_r,vd,iv,Sv,Fa,ap,hp,Sg,Eg,La,Ug,Tp,Zo,Kn,Qd,nt,ot,st,it,at,lt,ct,ut,de,ce,me,He,ue,z,le,Ft,Nt,M,Ln,Zn,Tr,Gr,ne,Ss,Vr,uf}from"./chunk-p1d500sf.js";import{Es,Cs,Ur,bu,vu,rs,ns,Is,Ms}from"./chunk-7rycq6wb.js";import{Ya,_u}from"./chunk-6vkfzzvt.js";import{Ys}from"./chunk-xgnvktq6.js";var rt=[["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"}]],Ge=I("pencil",rt);E();E();function Ye({teamId:c,projectId:s,file:r,onSaveField:d,members:F,onCommentSelect:v,hideAnnotationControl:R=!1,readOnly:w=!1,publicFields:y,isPublic:p=!1,shareId:k,currentTime:q,onTyping:ee,selectedCommentId:x,heightPercent:V,onHeightPercentChange:Q}){let{canEdit:H}=Ft(s),{fields:i,setFields:X}=Ur(),se=G(),{ref:re,inView:pe}=Nt(),[a,U]=u(null),[Ce,te]=u(!1),[fe,Ee]=u(null),Y=_(!1),Ve=_(0),j=_(V),je=(e)=>{Y.current=!0,Ve.current=e.clientY,j.current=V,e.target.setPointerCapture?.(e.pointerId)},De=P((e)=>{if(!Y.current)return;let b=(Ve.current-e.clientY)/window.innerHeight*100,oe=Math.min(85,Math.max(10,j.current+b));Q(oe)},[Q]),ke=(e)=>{Y.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:J}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await g.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s&&!y}),T=rs(r);m(()=>{if(y)X(y,s);else if(J)X(J,s)},[J,y,s,X]);let{data:he,fetchNextPage:W,hasNextPage:Te}=pt({queryKey:p?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(p){let l=localStorage.getItem(`share_pwd_${k}`)||"",b=await g.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:k,fileId:r.id},query:{after:e}},{headers:{"x-share-password":l}});if(!b.ok)throw Error("Failed to fetch comments");return await b.json()}else{let l=await g.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!l.ok)throw Error("Failed to fetch comments");return await l.json()}},enabled:!!r?.id&&(!p||!!k),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Ie}=B({mutationFn:async({text:e,attachmentIds:l,annotations:b,replyToId:oe,guestUserId:xe,second:be})=>{if(p){let ie=localStorage.getItem(`share_pwd_${k}`)||"",Ue=await g.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:k,fileId:r.id},json:{message:e,attachmentIds:l,replyToId:oe??void 0,annotations:b,second:be??void 0}},{headers:{"x-share-password":ie,...xe?{"x-guest-user-id":xe}:{}}});if(!Ue.ok)throw Error("Failed to create comment");return await Ue.json()}else{let ie=await g.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:l,replyToId:oe??void 0,annotations:b,second:be??void 0}});if(!ie.ok)throw Error("Failed to create comment");return await ie.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:p?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{M.error(Sv?.()||"Failed to post comment")}}),Pe=he?.pages?.[0]?.pageInfo?.total??he?.pages.reduce((e,l)=>e+(l.data?.length||0),0)??0;m(()=>{if(pe&&Te)W()},[pe,W,Te]);let A=N(()=>(r?.fieldValues||[]).reduce((e,l)=>(e[l.fieldId]=l,e),{}),[r?.fieldValues]),ae=N(()=>[...i].sort((e,l)=>{let b=e.config?.name?.toLowerCase()||"",oe=l.config?.name?.toLowerCase()||"";if(b<oe)return-1;if(b>oe)return 1;return 0}),[i]),Le=he?.pages.flatMap((e)=>e.data??[])??[],Be=(e,l,b=[],oe,xe)=>{if(!e.trim()&&l.length===0&&b.length===0)return;let be=oe||a?.id||null;if(p){let ie=localStorage.getItem(`guest_user_id_${k}`);if(!ie)Ee({text:e,attachmentIds:l,annotations:b,replyToId:be,second:xe}),te(!0);else Ie({text:e,attachmentIds:l,annotations:b,replyToId:be,guestUserId:ie,second:xe})}else Ie({text:e,attachmentIds:l,annotations:b,replyToId:be,second:xe});U(null)},Oe=(e)=>{if(fe)Ie({...fe,guestUserId:e}),Ee(null),U(null)},Se=(e)=>{let l=F.find((b)=>b.id===e);if(l)return l;return{id:"unknown",name:"Unknown",role:"unknown"}},Fe=V<=15;return o("div",{style:{height:`${V}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:[t("div",{onPointerDown:je,onPointerMove:De,onPointerUp:ke,onPointerCancel:ke,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:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(Ln,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(Zn,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Tr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[Ad()," ",Pe>0&&`(${Pe})`]}),t(Tr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Fa()})]}),o(Gr,{value:"comments",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Fe&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[Of?.()||"All comments",Pe>0?` (${Pe})`:""]})}),t(le,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Le.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Eg()}):o("div",{className:"space-y-3",children:[Le.map((e)=>o("div",{children:[t(Ya,{teamId:c,message:e,getUser:Se,onReply:U,hasReplies:!!e.replies?.length,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:x===e.id,onSelect:()=>{v?.(e)},readOnly:w,isPublic:p}),e.replies?.map((l,b)=>t("div",{children:t(Ya,{teamId:c,isReply:!0,message:l,getUser:Se,onReply:U,hasReplies:!1,isLastReply:b===(e.replies?.length??0)-1,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:x===l.id,onSelect:()=>{v?.(l)},readOnly:w,isPublic:p})},l.id))]},e.id)),t("div",{ref:re})]})}),(!w||p)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(_u,{isOpen:Ce,onClose:()=>te(!1),onSuccess:Oe,children:t(Ys,{projectId:s,onSendMessage:Be,replyingTo:a,onCancelReply:()=>U(null),hideAnnotationControl:R,disableMentions:p,currentTime:T?.commentsConfig?.hasTimestamp?q:void 0,formatTimestamp:T?.commentsConfig?.formatTimestamp,frameRate:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:T?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:ee})})})]}),t(Gr,{value:"fields",className:C("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Fe&&"hidden"),children:t(le,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:ae&&ae.length>0?t("div",{className:"space-y-4 pb-6",children:ae.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(Ms,{fieldId:e.id,config:e.config,value:A[e.id]?.value,onSave:H?(l)=>d(e.id,l):void 0,readOnly:w||e.readOnly||!H})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function We({fileName:c,folderName:s,version:r,versions:d,activeFileId:F,isPublic:v=!1,shareId:R,allowDownload:w=!0,downloadInfo:y,canEdit:p=!1,onBack:k,onPrevFile:q,onNextFile:ee,hasPrevFile:x=!1,hasNextFile:V=!1,onSelectVersion:Q,onRename:H,onDelete:i,onLinkedTasks:X,linkedTaskCount:se=0}){let re=async(a)=>{try{let U=v&&R?await g.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:R,fileId:F},json:{key:a}}):await g.api.files["download-url"].$post({json:{key:a,assetId:F}});if(!U.ok)return;let{url:Ce}=await U.json(),te=document.createElement("a");te.href=Ce,te.download="",document.body.appendChild(te),te.click(),document.body.removeChild(te)}catch{}},pe=(y?.videoTranscodes?.length??0)>0;return o("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:[t("div",{className:"flex items-center",children:t(S,{variant:"ghost",size:"icon",onClick:k,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":Tp(),children:t(an,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(L,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),d&&d.length>1?o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o("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:[t("span",{className:"truncate max-w-[120px] font-semibold",children:c}),r!==void 0&&o(ne,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(_e,{align:"center",className:"w-48 z-40",children:[t(en,{className:"text-xs",children:Qd()}),d.map((a)=>o(K,{onClick:()=>Q?.(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===F?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:c}),r!==void 0&&o(ne,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(x||V)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(S,{variant:"ghost",size:"icon",disabled:!x,onClick:q,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Ug(),"aria-label":Ug(),children:t(an,{className:"h-3.5 w-3.5"})}),t(S,{variant:"ghost",size:"icon",disabled:!V,onClick:ee,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Sg(),"aria-label":Sg(),children:t(It,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":hp(),children:t(Er,{className:"h-4 w-4"})})}),o(_e,{align:"end",className:"w-52 z-40",children:[w&&(pe?o(As,{children:[o(_s,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(wt,{className:"h-3.5 w-3.5"}),t("span",{children:_r()})]}),t(ra,{children:o(ys,{className:"w-48 z-50",children:[t(en,{className:"text-xs",children:_r()}),y?.videoTranscodes?.map((a)=>{let U=Ss(a),Ce=a.hdr?`${U} (HDR)`:U;return o(K,{onClick:()=>re(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Ce}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},a.key||`${U}-${a.hdr?"hdr":"sdr"}`)}),y?.originalKey&&o(L,{children:[t(Kt,{}),o(K,{onClick:()=>re(y.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:La?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:c.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(K,{onClick:()=>y?.originalKey&&re(y.originalKey),disabled:!y?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(wt,{className:"h-3.5 w-3.5"}),t("span",{children:_r()})]})),d&&d.length>1&&Q&&o(As,{children:[t(_s,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:Qd?.()||"Switch version"})}),t(ra,{children:o(ys,{className:"w-48 z-50",children:[t(en,{className:"text-xs",children:Qd?.()||"Switch version"}),d.map((a)=>o(K,{onClick:()=>Q(a.id),className:C("flex items-center justify-between text-xs cursor-pointer",a.id===F?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})})]}),X&&o(K,{onClick:X,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(Fo,{className:"h-3.5 w-3.5"}),t("span",{children:ap?.()||"Linked Tasks"})]}),se>0&&t("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:se})]}),p&&H&&o(K,{onClick:H,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Ge,{className:"h-3.5 w-3.5"}),t("span",{children:Zo()})]}),p&&i&&o(L,{children:[t(Kt,{}),o(K,{onClick:i,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(we,{className:"h-3.5 w-3.5"}),t("span",{children:ht()})]})]})]})]})})]})}function Vl({projectId:c,teamId:s="",fileId:r,file:d,projectInfo:F,ancestorFolders:v=[],versions:R,activeFileId:w,startTime:y,isPublic:p=!1,shareId:k,allowDownload:q=!0,publicFields:ee,siblingFiles:x=[],onNavigateToFile:V,onNavigateBack:Q,onRenameFile:H,onDeleteFile:i,onSaveField:X,onSelectVersion:se}){let{canEdit:re}=Ft(c),{members:pe}=Vr(),a=_(null),[U,Ce]=u(50),[te,fe]=u([]),[Ee,Y]=u(0),[Ve,j]=u(null),[je,De]=u(!1),[ke,J]=u(""),T=_(null),[he,W]=u(!1),[Te,Ie]=u(!1),[Pe,A]=u(!1),[ae,Le]=u(!1),{data:Be}=Z({queryKey:["teams",s,"kanban","assets",w,"tasks"],queryFn:async()=>{if(!s||!w||p)return{data:[],total:0};let f=await g.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:w}});if(!f.ok)return{data:[],total:0};return await f.json()},enabled:!!s&&!!w&&!p}),Oe=Be?.total??Be?.data?.length??0,{prevFile:Se,nextFile:Fe}=N(()=>{if(!x||x.length===0)return{prevFile:null,nextFile:null};let f=x.findIndex((ye)=>ye.id===r||ye.id===w);if(f===-1)return{prevFile:null,nextFile:null};return{prevFile:f>0?x[f-1]:null,nextFile:f<x.length-1?x[f+1]:null}},[x,r,w]),e=v.length>0?v[0]?.name:F?.name,b=R?.find((f)=>f.id===w)?.version??(R&&R.length>0?R.length:void 0),oe=N(()=>({originalKey:d.media?.original?.key,videoTranscodes:d.media?.videoTranscodes?.map((f)=>({key:f.key,width:f.width,height:f.height,resolution:f.resolution,hdr:f.hdr}))}),[d.media]),xe=()=>{fe([]),j(null)},be=()=>{fe([]),j(null)},ie=(f)=>{j(f.id||null);let ye=f.annotations;if(ye&&ye.length>0)fe(ye);else fe([]);if(f.second!==null&&f.second!==void 0)a.current?.seekTo(f.second),a.current?.pause();else if(ye&&ye.length>0)a.current?.pause()},Ue=async(f)=>{if(f?.preventDefault(),!ke.trim()||!H)return;try{Ie(!0),await H(ke.trim()),De(!1)}finally{Ie(!1)}},qe=async()=>{if(!i)return;try{W(!0),await i(),A(!1)}finally{W(!1)}};return m(()=>{Y(0),j(null),fe([])},[d?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(We,{fileName:d.name,folderName:e,version:b,versions:R,activeFileId:w,isPublic:p,shareId:k,allowDownload:q,downloadInfo:oe,canEdit:re,onBack:Q,hasPrevFile:!!Se,hasNextFile:!!Fe,onPrevFile:()=>Se&&V(Se.id),onNextFile:()=>Fe&&V(Fe.id),onSelectVersion:se,onRename:()=>{J(d.name),De(!0)},onDelete:()=>A(!0),onLinkedTasks:!p?()=>Le(!0):void 0,linkedTaskCount:Oe}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ns,{file:d,mediaControllerRef:a,onPlay:xe,onTimeUpdate:Y,onSeek:be,annotations:te,startTime:y,shareId:k,allowDownload:q})}),t(Ye,{teamId:s,projectId:c,file:d,onSaveField:X,members:pe,onCommentSelect:ie,hideAnnotationControl:d.proxyType==="audio",readOnly:p||!re,publicFields:ee,isPublic:p,shareId:k,currentTime:Ee,onTyping:()=>a.current?.pause(),selectedCommentId:Ve,heightPercent:U,onHeightPercentChange:Ce}),!p&&ae&&t(uf,{teamId:s,assetId:w,assetName:d.name,isOpen:ae,onClose:()=>Le(!1)}),!p&&t(de,{open:je,onOpenChange:De,children:t(ce,{children:o("form",{onSubmit:Ue,children:[t(me,{children:t(ue,{children:Zo()})}),t("div",{className:"py-4",children:t(z,{ref:T,value:ke,onChange:(f)=>J(f.target.value),placeholder:vd?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(T.current)Is(T.current)},0)},autoFocus:!0})}),o(He,{children:[t(S,{type:"button",variant:"outline",onClick:()=>De(!1),children:Re()}),o(S,{type:"submit",disabled:Te||!ke.trim(),children:[Te&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Kn()]})]})]})})}),!p&&t(nt,{open:Pe,onOpenChange:A,children:o(ot,{children:[o(st,{children:[t(at,{children:Wc?.()||"Delete Asset?"}),t(lt,{children:Kc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(it,{children:[t(ut,{children:Re()}),o(ct,{onClick:qe,disabled:he,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[he&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),ht()]})]})]})})]})}E();function Xe({activeState:c,activeAsset:s,previewUrl:r,isFullScreen:d,onTogglePlay:F,onToggleLoop:v,onSeek:R,onVolumeChange:w,onToggleMute:y,onChangePlaybackRate:p,onChangeResolution:k,onZoomIn:q,onZoomOut:ee,onFit:x,onDownload:V,onToggleFullScreen:Q,allowDownload:H=!0}){if(c?.kind==="video"&&c.video&&s){let i=c.video,X=i.totalFrames/i.frameRate,se=i.currentFrame/i.frameRate,re={isPlaying:i.isPlaying,progress:X>0?se/X*100:0,currentTime:se,duration:X,volume:i.volume,isMuted:i.isMuted,isLooping:i.isLooping,playbackRate:i.playbackRate,isFullScreen:d,showFrames:!1,currentResolution:i.currentResolution,isCurrentHdr:i.isCurrentHdr,activeAutoResolution:i.activeAutoResolution,isHlsManualSupported:i.isHlsManualSupported,isLoading:i.isLoading},pe=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(bu,{state:re,zoom:c.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:i.buffered,data:pe,resolutions:i.resolutions,togglePlay:F,toggleLoop:v,toggleMute:y,handleVolumeChange:w,changePlaybackRate:p,changeResolution:(a)=>k(a.resolution,a.hdr),handleDownload:(a)=>V(a),toggleFullScreen:Q,onZoomChange:(a)=>a>=c.zoom?q():ee(),onZoomReset:x,frameRate:i.frameRate,totalFrames:i.totalFrames,currentFrame:i.currentFrame,seekToFrame:R,allowDownload:H})}if(c?.kind==="image")return t(vu,{zoom:c.zoom,onZoomIn:q,onZoomOut:ee,onFit:x,onDownload:()=>V(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:d,onToggle:Q},allowDownload:H});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:Q,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:d?t(Cs,{className:"h-5 w-5"}):t(Es,{className:"h-5 w-5"})})})}function Ze({side:c,fileName:s,version:r,activeVersionId:d,versions:F,isActive:v,onActivate:R,onSwitchVersion:w,onExit:y}){let p=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",v?"text-foreground":"text-muted-foreground hover:text-foreground"),k=t("button",{onClick:y,title:iv(),className:p,children:t(Ne,{className:"h-4 w-4"})}),q=o("button",{onClick:R,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",v?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",v?"border-foreground/40":"border-border"),children:["v",r]})]}),ee=o(ge,{children:[t(Ae,{onClick:R,title:Qd(),className:p,children:t(ve,{className:"h-4 w-4"})}),t(_e,{align:c==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:F.map((x)=>{let V=x.id===d;return o(K,{onClick:()=>w(x.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("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",x.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:x.previewUrl?t("img",{src:x.previewUrl,alt:x.name||void 0,className:"h-full w-full object-cover"}):t(ar,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:x.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:x.creator?.name||"Unknown"})]}),V&&t(Me,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},x.id)})})})]});return t("div",{onMouseDown:R,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",v?"border-b-2 border-primary":"border-border"),children:c==="left"?o(L,{children:[k,q,ee]}):o(L,{children:[q,ee,t("div",{className:"ml-auto"}),k]})})}function Je(c,s,r){return Z({queryKey:s?["public-share-file",r,c,localStorage.getItem(`share_pwd_${r}`)||""]:["files",c],queryFn:async()=>{if(s){let F=localStorage.getItem(`share_pwd_${r}`)||"",v=await g.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:c}},{headers:{"x-share-password":F}});if(!v.ok)throw Error("Failed to fetch version asset");return await v.json()}let d=await g.api.files[":fileId"].$get({param:{fileId:c}});if(!d.ok)throw Error("Failed to fetch version asset");return await d.json()},enabled:!!c&&(!s||!!r)})}function Ql({isPublic:c=!1,shareId:s,versions:r,leftId:d,rightId:F,activeSide:v,annotations:R,seekRequest:w,onActiveSideChange:y,onSwitchVersion:p,onExit:k,onActiveAssetChange:q,onPlay:ee,onTimeUpdate:x,allowDownload:V=!0}){let Q=_(null),H=_(null),i=_(null),[X,se]=u(null),[re,pe]=u(null),[a,U]=u(1),[Ce,te]=u(!1),[fe,Ee]=u(!1),{data:Y,isLoading:Ve}=Je(d,c,s),{data:j,isLoading:je}=Je(F,c,s),De=rs(Y),ke=rs(j),J=!!Y&&!!j&&De.id===ke.id,T=v==="left"?Y:j,he=v==="left"?X:re,W=P(()=>v==="left"?H.current:i.current,[v]),Te=P(()=>v==="left"?i.current:H.current,[v]);m(()=>{q(T??null)},[T,q]),m(()=>{if(!w)return;let n=W();if(n?.seekToSecond(w.second),n?.pause(),J){let h=Te();h?.seekToSecond(w.second),h?.pause()}},[w?.nonce]),m(()=>{let n=()=>Ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Ie=P((n)=>se(n),[]),Pe=P((n)=>pe(n),[]),A=P((n)=>{let h=W();if(h)n(h);if(J){let D=Te();if(D)n(D)}},[W,Te,J]),ae=P(()=>{let n=!he?.video?.isPlaying;A((h)=>n?h.play():h.pause())},[he?.video?.isPlaying,A]);m(()=>{let n=(h)=>{let D=document.activeElement;if(D&&(D.tagName==="INPUT"||D.tagName==="TEXTAREA"||D instanceof HTMLElement&&D.isContentEditable))return;let $e=h.key===" ",ze=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($e&&ze)return;if(h.key===" "||h.key.toLowerCase()==="k")h.preventDefault(),ae()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[ae]);let Le=P((n)=>A((h)=>h.seekToFrame(n)),[A]),Be=P(()=>W()?.toggleLoop(),[W]),Oe=P((n)=>{U(n),te(n===0)},[]),Se=P(()=>te((n)=>!n),[]),Fe=P((n)=>A((h)=>h.setPlaybackRate(n)),[A]),e=P((n,h)=>W()?.changeResolution(n,h),[W]),l=P(()=>A((n)=>n.zoomBy(1.2)),[A]),b=P(()=>A((n)=>n.zoomBy(0.8)),[A]),oe=P(()=>A((n)=>n.fit()),[A]),xe=P((n)=>{W()?.download(n)},[W]),be=P(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),ie=P((n,h)=>{if(J)i.current?.panBy(n,h)},[J]),Ue=P((n,h)=>{if(J)H.current?.panBy(n,h)},[J]),qe=P(()=>ae(),[ae]),f=P((n)=>r.find((h)=>h.id===n)?.version,[r]),ye=N(()=>T?.media?.videoPreview?.url,[T?.media?.videoPreview?.url]),Qe=(n,h)=>{let $e=rs(h)?.comparePane;if(!$e)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let ze=v===n;return t($e,{ref:n==="left"?H:i,file:h,shareId:s,isActive:ze,annotations:ze?R:[],onStateChange:n==="left"?Ie:Pe,onUserPan:n==="left"?ie:Ue,onActivate:()=>y(n),muted:ze?Ce:!0,volume:a,onPlay:ee,onTimeUpdate:x,onRequestTogglePlay:qe},h.id)},et=!!Y&&!!j,tt=Ve||je;return o("div",{ref:Q,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[Y&&t(Ze,{side:"left",fileName:Y.name,version:f(d),activeVersionId:d,versions:r,isActive:v==="left",onActivate:()=>y("left"),onSwitchVersion:(n)=>p("left",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Qe("left",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[j&&t(Ze,{side:"right",fileName:j.name,version:f(F),activeVersionId:F,versions:r,isActive:v==="right",onActivate:()=>y("right"),onSwitchVersion:(n)=>p("right",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:j?Qe("right",j):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),tt&&!et&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),t(Xe,{activeState:he,activeAsset:T??null,previewUrl:ye,isFullScreen:fe,onTogglePlay:ae,onToggleLoop:Be,onSeek:Le,onVolumeChange:Oe,onToggleMute:Se,onChangePlaybackRate:Fe,onChangeResolution:e,onZoomIn:l,onZoomOut:b,onFit:oe,onDownload:xe,onToggleFullScreen:be,allowDownload:V})]})}
2
- export{Vl,Ql};
@@ -1,4 +0,0 @@
1
- import{Dn,E,t,o,Z,g,M0,F0,Uf,wd,sp,qS,pI,zp,dA,oT,rm,nm,Sn,de,ce,me,ue,Et,XA,Fr,uo,Io,fe}from"./chunk-p1d500sf.js";import{ko}from"./chunk-zxqasmvz.js";E();var N=(c)=>c.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:");function Xl({sessionId:c,open:w,onOpenChange:S}){let{data:b,isLoading:D}=Z({queryKey:["agent-sessions",c,"entries"],queryFn:async()=>{if(!c)return[];let s=await g.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:c}});if(!s.ok)throw Error("Failed to fetch session logs");return await s.json()},enabled:w&&!!c});return t(de,{open:w,onOpenChange:S,children:o(ce,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[o(me,{className:"pb-4 border-b border-foreground/15",children:[o(ue,{className:"flex items-center gap-2 text-xl font-bold",children:[t(ko,{className:"w-5 h-5 text-violet-500"}),F0()]}),t(Et,{children:M0()})]}),t("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:D?o("div",{className:"space-y-4",children:[o("div",{className:"flex gap-4",children:[t(fe,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(fe,{className:"h-4 w-1/4"}),t(fe,{className:"h-20 w-full"})]})]}),o("div",{className:"flex gap-4",children:[t(fe,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(fe,{className:"h-4 w-1/4"}),t(fe,{className:"h-12 w-full"})]})]})]}):b&&b.length>0?t("div",{className:"flex flex-col",children:b.map((s)=>{let a=s.entry,v=a?.timestamp||s.timestamp,x="";if(typeof v==="string"||typeof v==="number"){let e=new Date(v);if(!isNaN(e.getTime()))x=Fr(e.toISOString())}if(a&&typeof a==="object"){if(a.type==="custom_message"){if(a.customType==="context")return null;if(a.customType==="shumai_message"){let e=XA(a.details),m=typeof a.content==="string"?a.content:"",p=e?`${m}
2
-
3
- ${e}`.trim():m,k="bg-primary/10 text-primary",y=dA();return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center bg-primary"}),o("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:y}),o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:wd(),children:[wd(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:x})]}),t("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:p})]})]},s.id)}}if(a.type==="message"&&a.message){let e=a.message,m="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",p=String(e.role||"");if(e.role==="user")m="bg-primary/10 text-primary",p=dA();else if(e.role==="assistant")m="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",p=pI();else if(e.role==="toolResult")m=e.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",p=nm({name:String(e.toolName||Sn())});else if(e.role==="thought")m="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",p=zp();let k=(n)=>{let r=n;if(typeof n==="string")try{r=JSON.parse(n)}catch{}if(r&&typeof r==="object"&&!Array.isArray(r))return t("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(r).map(([l,i])=>{let u=i&&typeof i==="object"?JSON.stringify(i,null,2):String(i);return o("div",{className:"text-xs leading-relaxed break-words",children:[o("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[l,":"]})," ",t("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:u})]},l)})});return t("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(n)})},y=()=>{let n=e.content;if(!n)return null;if(typeof n==="string"){if(!n.trim())return null;return t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:N(n)})})}if(Array.isArray(n)){let r=[];if(n.forEach((d,l)=>{if(!d)return;if(typeof d==="string"){if(!d.trim())return;r.push(t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:N(d)})},`str-${l}`));return}if(typeof d==="object"){let i=d,u=i.type;if(u==="text"){let f=i.text;if(typeof f!=="string"||!f.trim())return;r.push(t("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{children:N(f)})},`txt-${l}`));return}if(u==="toolCall"){let f=String(i.name||i.toolName||Sn()),_=i.arguments||i.args;r.push(o("div",{className:"text-xs space-y-2 py-1",children:[o("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[Uf()," ",t("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:f})]}),!!_&&o("div",{className:"space-y-1 pt-3",children:[t("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:rm()}),k(_)]})]},`tool-${l}`));return}if(u==="image"){r.push(t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:sp()},`img-${l}`));return}let h=JSON.stringify(d,null,2);if(h==="{}")return;r.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:h},`other-${l}`))}}),r.length===0)return null;return t("div",{className:"space-y-3 w-full",children:r.map((d,l)=>o(Dn,{children:[l>0&&t(uo,{className:"my-3 opacity-50"}),d]},l))})}return null};return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${e.role==="user"?"bg-primary":e.role==="assistant"?"bg-violet-500":e.role==="toolResult"?e.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),o("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${m}`,children:p}),o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:wd(),children:[wd(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:x})]}),y()]})]},s.id)}}return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),o("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[o("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[o("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",s.id]}),t("div",{className:"text-[10px] text-muted-foreground/60",children:x})]}),t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(s.entry,null,2)})]})]},s.id)})}):o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(ko,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),t("p",{className:"text-sm font-medium",children:qS()}),t("p",{className:"text-xs text-muted-foreground/60 mt-1",children:oT()})]})})]})})}
4
- export{Xl};
@@ -1,2 +0,0 @@
1
- import{t,C}from"./chunk-p1d500sf.js";function hn({className:e,...a}){return t("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t("table",{"data-slot":"table",className:C("w-full caption-bottom text-sm",e),...a})})}function gn({className:e,...a}){return t("thead",{"data-slot":"table-header",className:C("[&_tr]:border-b",e),...a})}function An({className:e,...a}){return t("tbody",{"data-slot":"table-body",className:C("[&_tr:last-child]:border-0",e),...a})}function fr({className:e,...a}){return t("tr",{"data-slot":"table-row",className:C("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...a})}function Ye({className:e,...a}){return t("th",{"data-slot":"table-head",className:C("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function Qe({className:e,...a}){return t("td",{"data-slot":"table-cell",className:C("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}
2
- export{hn,gn,An,fr,Ye,Qe};