@shumai-one/shumai 0.4.4 → 0.4.5

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 (154) hide show
  1. package/bin/{chunk-jrjnqx78.js → chunk-0z8tgn67.js} +1 -1
  2. package/bin/{chunk-4wy87hwd.js → chunk-18qzk2mm.js} +2 -2
  3. package/bin/{chunk-5nm2jvg5.js → chunk-1b7gg0nx.js} +2 -2
  4. package/bin/{chunk-j1tkmcae.js → chunk-1hnpvtvf.js} +2 -2
  5. package/bin/{chunk-bkr5zm4h.js → chunk-1n1h09e9.js} +1 -1
  6. package/bin/{chunk-fahk9h62.js → chunk-1yv06e0q.js} +2 -2
  7. package/bin/{chunk-071x515q.js → chunk-20ee2pqp.js} +2 -2
  8. package/bin/chunk-20yset6k.js +1 -0
  9. package/bin/{chunk-hm0dkzed.js → chunk-21e4gjvw.js} +2 -2
  10. package/bin/{chunk-fb40xxz3.js → chunk-23bg4h8n.js} +2 -2
  11. package/bin/{chunk-7rhz2gze.js → chunk-2swjkvxv.js} +49 -49
  12. package/bin/{chunk-1t167cvj.js → chunk-2y6teq4s.js} +5 -5
  13. package/bin/chunk-3115qtvj.js +2 -0
  14. package/bin/{chunk-a6gx7f5q.js → chunk-3c0tcbga.js} +1 -1
  15. package/bin/{chunk-dqxeztfa.js → chunk-3mfdp2nh.js} +2 -2
  16. package/bin/chunk-3rwx54z7.js +2 -0
  17. package/bin/{chunk-fpc4p0j8.js → chunk-3x3sf7rp.js} +1 -1
  18. package/bin/{chunk-xarsrs08.js → chunk-3x80f4jk.js} +1 -1
  19. package/bin/{chunk-0qjfahk9.js → chunk-42ygnm34.js} +1 -1
  20. package/bin/{chunk-g3fpmyyn.js → chunk-46wfxyd7.js} +2 -2
  21. package/bin/{chunk-5hg6kcfz.js → chunk-48rbc18e.js} +5 -5
  22. package/bin/{chunk-98715kc3.js → chunk-4k2bej3c.js} +1 -1
  23. package/bin/{chunk-qsr1a0rp.js → chunk-5trfc3xh.js} +1 -1
  24. package/bin/{chunk-fxecgp5k.js → chunk-5xcjnbm9.js} +1 -1
  25. package/bin/chunk-685gzbdg.js +14 -0
  26. package/bin/chunk-6kzm51c7.js +2 -0
  27. package/bin/{chunk-nkdk229f.js → chunk-73evafrq.js} +1 -1
  28. package/bin/{chunk-rhvv1vvk.js → chunk-7sc73pfr.js} +1 -1
  29. package/bin/{chunk-kswvyqq1.js → chunk-7t1r3sj3.js} +1 -1
  30. package/bin/{chunk-xa18z1py.js → chunk-7v7mypc6.js} +2 -2
  31. package/bin/{chunk-2w5xqhjm.js → chunk-813885jm.js} +1 -1
  32. package/bin/{chunk-7pw1550a.js → chunk-8yg9zy53.js} +1 -1
  33. package/bin/chunk-923agf2d.js +1 -0
  34. package/bin/chunk-942ksfnj.js +2 -0
  35. package/bin/chunk-99yzvkq5.js +2 -0
  36. package/bin/{chunk-yfnem6se.js → chunk-9by727gr.js} +1 -1
  37. package/bin/{chunk-rqf7999q.js → chunk-9sr1z8kv.js} +27 -27
  38. package/bin/{chunk-rssgmj7x.js → chunk-a0fggks8.js} +1 -1
  39. package/bin/{chunk-0qaq0sp8.js → chunk-a3j3hyx2.js} +1 -1
  40. package/bin/{chunk-avwgktxb.js → chunk-a8x0dmec.js} +1 -1
  41. package/bin/{chunk-reyxk4bw.js → chunk-af1mcn9p.js} +1 -1
  42. package/bin/{chunk-gk2q9a3f.js → chunk-azafjrm4.js} +2 -2
  43. package/bin/{chunk-7gmdnsdg.js → chunk-b5a77dzv.js} +1 -1
  44. package/bin/chunk-b80fgsdf.js +1 -0
  45. package/bin/{chunk-nbdw8fen.js → chunk-bg6kp843.js} +1 -1
  46. package/bin/{chunk-5tcdwep5.js → chunk-brxwrh0b.js} +3 -3
  47. package/bin/{chunk-1zwajpwf.js → chunk-c51tvhra.js} +3 -3
  48. package/bin/{chunk-4hkkdm2q.js → chunk-c5dr9m1d.js} +1 -1
  49. package/bin/{chunk-jmpb5633.js → chunk-cbpgrg5j.js} +1 -1
  50. package/bin/{chunk-ytdwk2fq.js → chunk-cwfjvynz.js} +1 -1
  51. package/bin/{chunk-xx337zcw.js → chunk-da2w7c80.js} +2 -2
  52. package/bin/{chunk-5adsx8x4.js → chunk-dchtr0ap.js} +1 -1
  53. package/bin/{chunk-hmpwg5za.js → chunk-dqxh6dwz.js} +2 -2
  54. package/bin/chunk-e1s1zgv0.js +2 -0
  55. package/bin/{chunk-s2fnfyn9.js → chunk-erharpzt.js} +1 -1
  56. package/bin/{chunk-3tedzb2j.js → chunk-f3pb9mh9.js} +7 -7
  57. package/bin/chunk-fp8x63vs.js +2 -0
  58. package/bin/chunk-ft11rrhz.js +1 -0
  59. package/bin/chunk-fyszcddw.js +2 -0
  60. package/bin/chunk-g6hq18q1.js +1 -0
  61. package/bin/{chunk-hk5rc6cd.js → chunk-g6xgghnq.js} +4 -4
  62. package/bin/{chunk-w4ghe71n.js → chunk-gdg0tkbk.js} +1 -1
  63. package/bin/{chunk-4991gz3y.js → chunk-gjp851vj.js} +1 -1
  64. package/bin/{chunk-gc5sbfa5.js → chunk-gy68h3x5.js} +2 -2
  65. package/bin/{chunk-ryzz5fht.js → chunk-h4s1fgf1.js} +1 -1
  66. package/bin/chunk-hsv4v7na.js +1 -0
  67. package/bin/chunk-j3kjscfj.js +2 -0
  68. package/bin/{chunk-zw86wnwe.js → chunk-jbt3e1ac.js} +1 -1
  69. package/bin/{chunk-rchsme43.js → chunk-jrf90z42.js} +2 -2
  70. package/bin/{chunk-wjyaezs7.js → chunk-k2aqztk1.js} +1 -1
  71. package/bin/{chunk-wndm3px3.js → chunk-kfpfqxb3.js} +1 -1
  72. package/bin/chunk-kyxramkk.js +1 -0
  73. package/bin/{chunk-drepsbb4.js → chunk-m5z5mzan.js} +1 -1
  74. package/bin/{chunk-t7nsgg5k.js → chunk-n48548fs.js} +3 -3
  75. package/bin/chunk-ncnr223m.js +2 -0
  76. package/bin/{chunk-97f2af6d.js → chunk-ncp007yb.js} +5 -5
  77. package/bin/{chunk-trveq4wg.js → chunk-ncqhp76x.js} +2 -2
  78. package/bin/{chunk-fnmwksnb.js → chunk-njswnpaq.js} +2 -2
  79. package/bin/{chunk-1xh34aew.js → chunk-nkmr6gqc.js} +1 -1
  80. package/bin/chunk-nngp6fhe.js +1 -0
  81. package/bin/{chunk-vap4k11j.js → chunk-nzggcbgk.js} +5 -5
  82. package/bin/chunk-p1nb8wk8.js +3 -0
  83. package/bin/{chunk-1j27fzy1.js → chunk-p4yrnr37.js} +2 -2
  84. package/bin/{chunk-453ykvaw.js → chunk-pc2dnpkh.js} +1 -1
  85. package/bin/{chunk-579e4wv4.js → chunk-pdrmbxrt.js} +2 -2
  86. package/bin/{chunk-4mjywsj8.js → chunk-pmj9b8qt.js} +2 -2
  87. package/bin/{chunk-zxk7q0zk.js → chunk-psk38vp4.js} +1 -1
  88. package/bin/{chunk-qka4mkmj.js → chunk-pve3zpta.js} +1 -1
  89. package/bin/{chunk-j2bvj2yn.js → chunk-q3q0brsn.js} +1 -1
  90. package/bin/{chunk-ze20rm02.js → chunk-qg1f1z3t.js} +2 -2
  91. package/bin/{chunk-9ccw540k.js → chunk-qk7me5ra.js} +1 -1
  92. package/bin/{chunk-3ttrhqy3.js → chunk-qqqarj5v.js} +2 -2
  93. package/bin/chunk-qysf4mpk.js +299 -0
  94. package/bin/{chunk-q806pqeh.js → chunk-r0j962y1.js} +1 -1
  95. package/bin/chunk-r5dxd4sx.js +1 -0
  96. package/bin/{chunk-mz0yjra0.js → chunk-s0caa0zm.js} +1 -1
  97. package/bin/chunk-sa6k5ye7.js +1 -0
  98. package/bin/{chunk-s2k4qntr.js → chunk-ss0mcgbd.js} +2 -2
  99. package/bin/chunk-sz6cnm4q.css +1 -0
  100. package/bin/{chunk-pazjhrnf.js → chunk-tgee88jq.js} +3 -3
  101. package/bin/{chunk-9t8n2des.js → chunk-ty71fdw9.js} +1 -1
  102. package/bin/{chunk-nr20tvnw.js → chunk-v0201sn5.js} +2 -2
  103. package/bin/chunk-v2xt5p3x.js +10 -0
  104. package/bin/{chunk-cbgq517y.js → chunk-w3jmahea.js} +1 -1
  105. package/bin/chunk-w88h5wtf.js +1 -0
  106. package/bin/{chunk-1gvscz88.js → chunk-w9160hxz.js} +2 -2
  107. package/bin/{chunk-914bp49r.js → chunk-wmkbkad1.js} +2 -2
  108. package/bin/{chunk-0zv3bks2.js → chunk-wnpjz2kw.js} +1 -1
  109. package/bin/{chunk-k2k9vjq6.js → chunk-wrbas9cg.js} +1 -1
  110. package/bin/{chunk-t2hy6tj9.js → chunk-xcwjsav0.js} +1 -1
  111. package/bin/{chunk-gt4csat6.js → chunk-xgy6ppww.js} +2 -2
  112. package/bin/{chunk-4v41a1r9.js → chunk-y13s3641.js} +3 -3
  113. package/bin/{chunk-7bcxj1jd.js → chunk-y78v01te.js} +1 -1
  114. package/bin/{chunk-ks8xzc95.js → chunk-y8a3hans.js} +2 -2
  115. package/bin/{chunk-vm5fx7td.js → chunk-z422yh6b.js} +1 -1
  116. package/bin/chunk-z5t4yxzb.js +2 -0
  117. package/bin/{chunk-jgs8an3h.js → chunk-zcfehv0w.js} +4 -4
  118. package/bin/{chunk-6ghcj4a9.js → chunk-zg7a107s.js} +1 -1
  119. package/bin/{chunk-msfw3jmc.js → chunk-zp1sv030.js} +1 -1
  120. package/bin/{chunk-kpgfqkp0.js → chunk-zrxe6p0q.js} +1 -1
  121. package/bin/chunk-zwenq5zy.js +2 -0
  122. package/bin/shumai-app.html +1 -1
  123. package/bin/shumai-app.js +484 -270
  124. package/package.json +7 -7
  125. package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
  126. package/prisma/schema.prisma +1 -0
  127. package/bin/chunk-0cmx7k4c.js +0 -1
  128. package/bin/chunk-16xax8kk.js +0 -1
  129. package/bin/chunk-3zkasqb8.js +0 -1
  130. package/bin/chunk-5vzrpz50.js +0 -2
  131. package/bin/chunk-77fmkpdz.js +0 -10
  132. package/bin/chunk-7kjgvxqa.js +0 -2
  133. package/bin/chunk-837fky18.js +0 -3
  134. package/bin/chunk-84as6x83.js +0 -1
  135. package/bin/chunk-8e28hcny.js +0 -2
  136. package/bin/chunk-9ybt6vbm.js +0 -1
  137. package/bin/chunk-d27mm390.js +0 -1
  138. package/bin/chunk-dj92fss9.js +0 -2
  139. package/bin/chunk-f6svp4dp.js +0 -2
  140. package/bin/chunk-fsyzs0tf.js +0 -1
  141. package/bin/chunk-gdm6yfqq.js +0 -2
  142. package/bin/chunk-gye8gabk.js +0 -2
  143. package/bin/chunk-jffktpqg.js +0 -1
  144. package/bin/chunk-m9pr03kn.js +0 -2
  145. package/bin/chunk-mfn9qjm4.js +0 -2
  146. package/bin/chunk-snhsjs4x.js +0 -299
  147. package/bin/chunk-tm7f32c7.js +0 -14
  148. package/bin/chunk-vy8gntez.js +0 -1
  149. package/bin/chunk-vyzptrea.js +0 -2
  150. package/bin/chunk-wdsf44hs.js +0 -2
  151. package/bin/chunk-x5jwwvs0.js +0 -1
  152. package/bin/chunk-x92cq59c.js +0 -1
  153. package/bin/chunk-xtf3c29c.css +0 -1
  154. package/bin/chunk-xz6713tj.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "A fullstack AI-powered media workspace and workflow engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "zod": "4.5.4"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-darwin-arm64": "0.4.4",
31
- "@shumai-one/shumai-darwin-x64": "0.4.4",
32
- "@shumai-one/shumai-linux-arm64": "0.4.4",
33
- "@shumai-one/shumai-linux-x64": "0.4.4",
34
- "@shumai-one/shumai-win32-arm64": "0.4.4",
35
- "@shumai-one/shumai-win32-x64": "0.4.4"
30
+ "@shumai-one/shumai-darwin-arm64": "0.4.5",
31
+ "@shumai-one/shumai-darwin-x64": "0.4.5",
32
+ "@shumai-one/shumai-linux-arm64": "0.4.5",
33
+ "@shumai-one/shumai-linux-x64": "0.4.5",
34
+ "@shumai-one/shumai-win32-arm64": "0.4.5",
35
+ "@shumai-one/shumai-win32-x64": "0.4.5"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,2 @@
1
+ -- CreateIndex
2
+ CREATE INDEX "asset_comments_asset_id_idx" ON "asset_comments"("asset_id");
@@ -657,6 +657,7 @@ model AssetComment {
657
657
 
658
658
  attachments AssetCommentAttachment[] @relation("CommentToAttachment")
659
659
 
660
+ @@index([assetId])
660
661
  @@map("asset_comments")
661
662
  }
662
663
 
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,zp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:n}=er(zp(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=Fe("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,Up}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function l(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Up(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!e});if(!r||!e||!i)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:e,rootFolderId:e})}var c=Fe("/projects/$projectId/")({component:l});export{c as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,jp}from"./chunk-7rhz2gze.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-0qaq0sp8.js";import{Di}from"./chunk-rqf7999q.js";import"./chunk-3ttrhqy3.js";import"./chunk-1xh34aew.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-avwgktxb.js";import"./chunk-5adsx8x4.js";import"./chunk-gk2q9a3f.js";C();function l(){let{projectId:e}=p.useParams(),{teamId:r,ensureTeamIdForProject:i}=it();h(()=>{i(e)},[e,i]);let{data:a}=er(jp(e)),o=a?.rootFolder,{data:d}=Z({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!d)return t(_t,{});return t(Di,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var p=Fe("/projects/$projectId/agentsmd")({component:l});export{p as Route};
@@ -1,2 +0,0 @@
1
- import{Vo,dm,nl}from"./chunk-7rhz2gze.js";function er(e,r){return nl({...e,enabled:!0,suspense:!0,throwOnError:dm,placeholderData:void 0},Vo,r)}
2
- export{er};
@@ -1,10 +0,0 @@
1
- import{D,N,h,O,w,u,C,B,t,o,U,Tr,A,T,Ha,be,hr,Xt,Si,ve,De,S,bn,wn,vn,xn,Ee,Ie,Te,Dy,M_,G_,Uf,Sv,gC,vC,xC,AI,it,ua,gt,At,yt,Ls,Ur,Qt,le}from"./chunk-7rhz2gze.js";import{ii,In}from"./chunk-m9pr03kn.js";var tn=Tr((m,j)=>({isDrawing:!1,currentTool:"arrow",currentColor:"#ef4444",annotations:[],history:[[]],historyIndex:0,setIsDrawing:(l)=>m({isDrawing:l}),setTool:(l)=>m({currentTool:l}),setColor:(l)=>m({currentColor:l}),addAnnotation:(l)=>{let{annotations:f,history:g,historyIndex:L}=j(),v=[...f,l],b=g.slice(0,L+1);b.push(v),m({annotations:v,history:b,historyIndex:b.length-1})},setAnnotations:(l)=>{m({annotations:l,history:[l],historyIndex:0})},undo:()=>{let{historyIndex:l,history:f}=j();if(l>0){let g=l-1;m({annotations:f[g],historyIndex:g})}},redo:()=>{let{historyIndex:l,history:f}=j();if(l<f.length-1){let g=l+1;m({annotations:f[g],historyIndex:g})}},reset:()=>m({isDrawing:!1,currentTool:"arrow",annotations:[],history:[[]],historyIndex:0})}));var Mt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],iu=T("arrow-left",Mt);var Dt=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],$e=T("brush",Dt);var Et=[["path",{d:"M5 12h14",key:"1ays0h"}]],xa=T("minus",Et);var Rt=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],He=T("redo",Rt);var Tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Be=T("square",Tt);var Lt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Oe=T("undo",Lt);C();var St=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#a855f7","#ec4899","#000000","#ffffff"],Us=D(({projectId:m,onSendMessage:j,replyingTo:l,onCancelReply:f,placeholder:g,initialText:L="",value:v,onChangeText:b,disabled:he=!1,allowMentions:qe,disableMentions:We=!1,allowAttachments:Ke=!0,workspaceAssets:E,onRemoveWorkspaceAsset:xe,allowMarkup:Ve,hideAnnotationControl:Xe=!1,canMarkup:Qe=!0,markupDisabledTooltip:Ge,allowTimestamp:Je=!0,currentTime:x,frameRate:y,startTimecode:ye,formatTimestamp:R,bottomLeftExtra:Ye,isStreaming:ae=!1,onAbort:Ze,onTyping:H},et)=>{let[k,q]=u([]),[se,J]=u(null),[I,tt]=u(!0),W=qe??!We,nt=Ve??!Xe,K=Je,{videoTimeDisplayMode:Y}=Qt(),ot=O(()=>{if(x===void 0)return"";if(R)return R(x);if(!y)return"";let e=Math.round(x*y);return In(e,y,Y,ye)},[x,y,Y,ye,R]),{teamId:Z,ensureTeamIdForProject:we}=it(),{members:Ne,loading:ke,fetchMembers:rt,fetchProjectMembers:at}=Ur();h(()=>{if(m&&!Z)we(m)},[m,Z,we]);let{isDrawing:st,setIsDrawing:V,currentTool:ee,setTool:te,currentColor:Ce,setColor:lt,undo:ct,redo:dt,history:ut,historyIndex:Ae,annotations:ie,reset:Me}=tn(),[ce,_]=u(!1),[de,mt]=u(""),[X,Q]=u(0),[M,Re]=u({bots:!1,users:!1}),[ue,P]=u(!1),pt=O(()=>{if(!I||!K||x===void 0||!R&&!y||ue)return"";if(Y==="timecode")return"pl-[120px]";return"pl-[85px]"},[I,K,x,y,ue,Y,R]),s=w(null),ne=w(null),F=w(null),Le=w(null),z=w(!1),{mutateAsync:Se}=U({mutationFn:async({projectId:e,data:n})=>{let r=await A.api.projects[":projectId"].attachments.$post({param:{projectId:e},json:n});if(!r.ok)throw Error("Failed to create attachment");return await r.json()}});h(()=>{if(v!==void 0&&s.current){if(z.current){z.current=!1;return}if(s.current.innerText!==v)s.current.innerText=v,P(!!v.trim())}else if(L&&s.current){s.current.innerText=L,P(!!L.trim()),s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}},[v,L]);let me=w(null),_e=N((e)=>{if(!s.current)return;let n=document.createElement("span");n.contentEditable="false",n.dataset.type="mention",n.dataset.id=e.id,n.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",n.innerText=`@${e.name}`;let r=document.createTextNode(" ");s.current.appendChild(n),s.current.appendChild(r);let i=document.createRange(),c=window.getSelection();i.setStartAfter(r),i.collapse(!0),c?.removeAllRanges(),c?.addRange(i),P(!0);let a=s.current.innerText||"";z.current=!0,b?.(a),H?.(),s.current.focus()},[b,H]);h(()=>{if(l&&s.current){if(l.id!==me.current){if(me.current=l.id,W&&l.creator?.id&&l.creator?.name){let r=s.current.querySelectorAll('span[data-type="mention"]');if(!Array.from(r).some((c)=>c.dataset.id===l.creator.id)){_e({id:l.creator.id,name:l.creator.name});return}}}s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}else if(!l)me.current=null},[l,W,_e]),h(()=>()=>{V(!1)},[V]);let G=Ne.filter((e)=>e.type==="agent"&&e.name?.toLowerCase().startsWith(de.toLowerCase())).map((e)=>({type:"user",data:e})),oe=Ne.filter((e)=>e.type!=="agent"&&e.name?.toLowerCase().startsWith(de.toLowerCase())).map((e)=>({type:"user",data:e})),re=[...M.bots?[]:G,...M.users?[]:oe];h(()=>{Q(0)},[de,ce,M]),h(()=>{Le.current?.querySelector(`[data-index="${X}"]`)?.scrollIntoView({block:"nearest"})},[X]);let Pe=(e)=>e.split(" ").map((n)=>n[0]).slice(0,2).join("").toUpperCase(),Fe=()=>{if(!s.current)return;let e=s.current.innerText||"";if(P(!!e.trim()),z.current=!0,b?.(e),H?.(),!W){_(!1),F.current=null;return}let n=window.getSelection();if(!n||n.rangeCount===0)return;let r=n.getRangeAt(0),{startContainer:i,startOffset:c}=r;if(i.nodeType===Node.TEXT_NODE){let d=(i.textContent||"").slice(0,c),p=d.lastIndexOf("@");if(p!==-1){let Ct=p===0,It=d[p-1];if(Ct||/\s/.test(It)){let je=d.slice(p+1);if(!/\s/.test(je)){if(mt(je),_(!0),m)at(m,!0,!0);else if(Z)rt(Z,!0,!0);let ge=document.createRange();ge.setStart(i,p),ge.setEnd(i,c),F.current=ge;return}}}}_(!1),F.current=null},pe=(e)=>{if(!F.current||!s.current)return;let n=F.current;n.deleteContents();let r=document.createElement("span");r.contentEditable="false",r.dataset.type="mention",r.dataset.id=e.data.id,r.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",r.innerText=`@${e.data.name}`,n.insertNode(r);let i=document.createTextNode(" ");r.after(i);let c=document.createRange(),a=window.getSelection();c.setStartAfter(i),c.collapse(!0),a?.removeAllRanges(),a?.addRange(c),_(!1),F.current=null,P(!0);let d=s.current.innerText||"";z.current=!0,b?.(d),H?.(),s.current.focus()},ft=(e)=>{e.preventDefault();let n=e.clipboardData.getData("text/plain");if(!n)return;let r=window.getSelection();if(!r||r.rangeCount===0||!s.current?.contains(r.anchorNode)){if(s.current){s.current.focus();let c=document.createRange();c.selectNodeContents(s.current),c.collapse(!1),r=window.getSelection(),r?.removeAllRanges(),r?.addRange(c)}}if(!(typeof document.execCommand==="function"&&document.queryCommandSupported?.("insertText")&&document.execCommand("insertText",!1,n))){let c=window.getSelection();if(c&&c.rangeCount>0){let a=c.getRangeAt(0);a.deleteContents();let d=document.createTextNode(n);a.insertNode(d),a.setStartAfter(d),a.collapse(!0),c.removeAllRanges(),c.addRange(a)}else if(s.current)s.current.innerText+=n}Fe()},bt=(e)=>{if(e.nativeEvent.isComposing)return;if(ce&&W&&re.length>0){if(e.key==="ArrowUp"){e.preventDefault(),Q((n)=>n>0?n-1:re.length-1);return}if(e.key==="ArrowDown"){e.preventDefault(),Q((n)=>n<re.length-1?n+1:0);return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault(),pe(re[X]);return}if(e.key==="Escape"){e.preventDefault(),_(!1);return}}if(e.key==="Enter"&&!e.shiftKey)e.preventDefault(),Ue()},ht=N(async(e)=>{if(!e.target.files)return;let n=Array.from(e.target.files);for(let r of n){let i=`${Date.now()}-${r.name}`,c={id:i,file:r,progress:0};q((a)=>[...a,c]);try{let a=await Se({projectId:m,data:{fileName:r.name,contentType:r.type,size:r.size}});if(a.uploadUrl&&a.id)await fetch(a.uploadUrl,{method:"PUT",body:r,headers:{"Content-Type":r.type}}),q((d)=>d.map((p)=>p.id===i?{...p,progress:100,attachmentId:a.id}:p))}catch(a){q((d)=>d.map((p)=>p.id===i?{...p,error:a instanceof Error?a.message:"Upload failed"}:p))}}if(ne.current)ne.current.value=""},[m,Se]),xt=(e)=>{q((n)=>n.filter((r)=>r.id!==e))},Ue=()=>{if(!s.current)return;if(k.some((a)=>!a.attachmentId&&!a.error))return;let n=k.map((a)=>a.attachmentId).filter((a)=>!!a),r=k.filter((a)=>!a.error&&!!a.attachmentId).map((a)=>({id:a.attachmentId,name:a.file.name,type:a.file.type,url:a.file.type.startsWith("image/")||Ls(a.file.name)?URL.createObjectURL(a.file):void 0})),i="";s.current.childNodes.forEach((a)=>{if(a.nodeType===Node.TEXT_NODE)i+=a.textContent;else if(a.nodeType===Node.ELEMENT_NODE){let d=a;if(d.dataset.type==="mention")i+=`<@${d.dataset.id}>`;else if(d.tagName==="BR")i+=`
2
- `;else if(d.tagName==="DIV"||d.tagName==="P")i+=`
3
- `+d.innerText;else i+=d.innerText}}),i=i.trim();let c=(E?.length??0)>0;if(!i&&n.length===0&&ie.length===0&&!c)return;if(j(i,n,ie,l?.id,K&&I?x:void 0,r),s.current.innerHTML="",P(!1),z.current=!0,b?.(""),q([]),J(null),V(!1),Me(),_(!1),f)f()},fe=k.some((e)=>!e.attachmentId&&!e.error),vt=k.some((e)=>!!e.attachmentId),wt=(E?.length??0)>0,Nt=he||ae,ze=(ue||vt||ie.length>0||wt)&&!Nt,kt=E&&E.length>0||k.length>0||!!l;return o("div",{ref:et,className:"relative flex flex-col w-full border border-foreground/35 rounded-3xl shadow-sm transition-all duration-200 bg-background",children:[t("style",{children:`
4
- [contenteditable]:empty:before {
5
- content: attr(data-placeholder);
6
- color: #9ca3af;
7
- cursor: text;
8
- }
9
- `}),ce&&W&&(ke||G.length>0||oe.length>0)&&t("div",{onMouseDown:(e)=>e.preventDefault(),className:"absolute bottom-full left-4 mb-2 w-64 rounded-xl shadow-lg border border-border overflow-hidden z-20 bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 duration-200",children:t("div",{ref:Le,className:"h-64 overflow-y-auto",children:ke?o("div",{className:"p-2 space-y-4 animate-pulse",children:[o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(le,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-28"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-20"})]})]}),o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(le,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-32"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-24"})]})]})]}):o(B,{children:[G.length>0&&o(B,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Re((n)=>({...n,bots:!n.bots})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Agents"}),t(be,{className:`w-3 h-3 transition-transform ${M.bots?"-rotate-90":""}`})]}),!M.bots&&G.map((e,n)=>{let r=n;return o("button",{type:"button","data-index":r,onMouseDown:(i)=>i.preventDefault(),onClick:()=>pe(e),onMouseEnter:()=>Q(r),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${r===X?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ee,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Pe(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]}),oe.length>0&&o(B,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Re((n)=>({...n,users:!n.users})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Members"}),t(be,{className:`w-3 h-3 transition-transform ${M.users?"-rotate-90":""}`})]}),!M.users&&oe.map((e,n)=>{let r=M.bots?0:G.length,i=n+r;return o("button",{type:"button","data-index":i,onMouseDown:(c)=>c.preventDefault(),onClick:()=>pe(e),onMouseEnter:()=>Q(i),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${i===X?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ee,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Pe(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]})]})})}),kt&&o("div",{className:"flex flex-col gap-2 p-3 pb-0 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[E&&E.length>0&&t("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border border-border/60 rounded-lg bg-muted/20 p-2.5 divide-y divide-border/50",children:E.map((e)=>o("div",{className:"flex items-center justify-between py-1 text-xs group",children:[o("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[t("span",{className:"truncate font-medium text-foreground",children:e.name}),t("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:e.type})]}),xe&&t("button",{onClick:()=>xe(e.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5 cursor-pointer",title:gC?.()||"Remove from context",children:t(ve,{className:"h-3.5 w-3.5"})})]},e.id))}),l&&o("div",{className:"flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border",children:[t("div",{className:"text-xs text-muted-foreground truncate mr-2",children:xC({message:l.message||""})}),t("button",{onClick:f,className:"text-muted-foreground hover:text-foreground p-1 rounded-full hover:bg-muted-foreground/10 shrink-0",children:t(De,{className:"w-3.5 h-3.5"})})]}),k.length>0&&t("div",{className:"flex gap-3 overflow-x-auto py-2 px-1 scrollbar-hide",children:k.map((e)=>o("div",{className:"relative group flex-shrink-0",children:[o("div",{className:"w-16 h-16 rounded-lg border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center",children:[e.file.type.startsWith("image/")?t("img",{src:URL.createObjectURL(e.file),alt:"preview",onClick:()=>J(e.file),className:`w-full h-full object-cover ${!e.attachmentId?"opacity-50":""}`}):t(Xt,{className:"w-8 h-8 text-gray-400"}),fe&&!e.attachmentId&&!e.error&&t("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:t(ii,{progress:e.progress,className:"w-10 h-10"})})]}),t("button",{onClick:()=>xt(e.id),className:"absolute -top-1.5 -right-1.5 bg-gray-500 text-white rounded-full p-0.5 shadow-md opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 z-10 cursor-pointer",children:t(De,{className:"w-3 h-3"})}),t("span",{className:"text-[10px] text-gray-500 mt-1 block max-w-[4rem] truncate text-center",children:e.file.name})]},e.id))})]}),o("div",{onClick:()=>s.current?.focus(),className:"w-full px-4 pt-1 pb-1 cursor-text flow-root max-h-60 overflow-y-auto",children:[K&&I&&x!==void 0&&(y!==void 0||R!==void 0)&&t("div",{onClick:(e)=>{e.stopPropagation(),s.current?.focus()},className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text",children:ot}),t("div",{ref:s,contentEditable:!he&&!ae,suppressContentEditableWarning:!0,onInput:Fe,onKeyDown:bt,onPaste:ft,"data-placeholder":g||(l?vC():Sv()),className:`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block whitespace-pre-wrap break-words ${pt}`})]}),o("div",{className:"flex justify-between items-center px-2 pb-2",children:[st?o("div",{className:"flex items-center gap-2 overflow-x-auto scrollbar-hide w-full mr-2",children:[t(S,{onClick:()=>{V(!1),Me()},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer text-gray-500 hover:text-gray-700 hover:bg-gray-100 mr-2",title:"Back",children:t(iu,{className:"w-4 h-4"})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:()=>te("arrow"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="arrow"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Arrow",children:t(Ha,{size:16,className:"rotate-45"})}),t("button",{onClick:()=>te("line"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="line"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Line",children:t(xa,{size:16,className:"-rotate-45"})}),t("button",{onClick:()=>te("box"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="box"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Box",children:t(Be,{size:16})}),t("button",{onClick:()=>te("freehand"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="freehand"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Freehand",children:t($e,{size:16})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),o(gt,{children:[t(At,{asChild:!0,children:o("button",{className:"flex items-center gap-1 p-1 rounded hover:bg-gray-100",children:[t("div",{className:"w-4 h-4 rounded-full border border-gray-200",style:{backgroundColor:Ce}}),t(be,{size:12,className:"text-gray-500"})]})}),t(yt,{className:"w-auto p-2",align:"center",side:"top",children:t("div",{className:"flex items-center gap-1",children:St.map((e)=>t("button",{onClick:()=>lt(e),className:`w-6 h-6 rounded-full border border-gray-200 transition-transform hover:scale-110 ${Ce===e?"ring-2 ring-blue-500 ring-offset-1":""}`,style:{backgroundColor:e}},e))})})]}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:ct,disabled:Ae<=0,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(Oe,{size:16})}),t("button",{onClick:dt,disabled:Ae>=ut.length-1,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(He,{size:16})})]}):o("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[80%]",children:[Ye,Ke&&o(B,{children:[t("input",{type:"file",ref:ne,className:"hidden",multiple:!0,onChange:ht}),t(S,{onClick:()=>ne.current?.click(),className:"p-2 rounded-full cursor-pointer shrink-0",variant:"ghost",size:"icon",title:Dy(),children:t(Si,{className:"w-4 h-4"})})]}),K&&x!==void 0&&(y!==void 0||R!==void 0)&&t(S,{onClick:()=>tt(!I),variant:I?"secondary":"ghost",size:"icon",className:`p-2 rounded-full cursor-pointer shrink-0 ${I?"text-blue-600 bg-blue-50 dark:bg-blue-900/20":""}`,title:I?M_():G_(),children:t(hr,{className:"w-4 h-4"})}),nt&&(Qe?t(S,{onClick:()=>{H?.(),V(!0)},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer shrink-0",title:AI(),children:t(ua,{className:"w-4 h-4"})}):t(bn,{children:o(wn,{children:[t(vn,{asChild:!0,children:t("span",{className:"inline-block cursor-not-allowed shrink-0",children:t(S,{disabled:!0,variant:"ghost",size:"icon",className:"p-2 rounded-full opacity-40 cursor-not-allowed pointer-events-none",children:t(ua,{className:"w-4 h-4"})})})}),t(xn,{side:"top",children:t("p",{className:"text-xs",children:Ge||Uf()})})]})}))]}),ae?t("button",{onClick:Ze,className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5 cursor-pointer",title:"Stop generation",children:t("div",{className:"h-4 w-4 flex items-center justify-center",children:t("div",{className:"h-3 w-3 rounded-[2px] bg-white"})})}):t("button",{onClick:Ue,disabled:!ze||fe,className:`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${ze&&!fe?"bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5 cursor-pointer":"bg-gray-400 cursor-not-allowed opacity-50"}`,children:t(Ha,{className:"w-4 h-4"})})]}),se&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>J(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:t(De,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:URL.createObjectURL(se),alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),J(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:se.name})]})]})});Us.displayName="ChatInput";
10
- export{iu,xa,tn,Us};
@@ -1,2 +0,0 @@
1
- import{D,h,Ge,O,w,u,C,B,t,o,K,U,Tr,A,T,wt,Un,Me,be,Gr,pt,hr,Rs,Po,fe,Ut,De,E,dt,he,Y,Lt,se,oa,sa,zn,ia,Cc,S,Ee,Ie,Te,ge,Ae,ye,W,is,Xu,mm,nd,Ic,Uy,Fy,Tc,zy,jy,qy,gf,Mc,Hy,$y,ke,fl,sd,If,ml,Tf,Rf,kf,Ti,Zf,Qv,Vv,gd,Fh,Yf,_d,Oo,UC,vg,VC,HI,pe,Qg,ue,me,de,Tt,H,Wo,kr,un,jn,R,lt,xe,Pi,Ja,Ld,El,fr,Hc,$c,Xn,Ni,gt,At,yt,Mr,xr,V,qe,Ur}from"./chunk-7rhz2gze.js";import{Eo,pr}from"./chunk-gc5sbfa5.js";import{Hn,oo}from"./chunk-cbgq517y.js";import{rn}from"./chunk-ytdwk2fq.js";function Dt(e){let n=e.lastIndexOf(".");if(n>0)return[0,n];return[0,e.length]}function ps(e){e.focus();let[n,r]=Dt(e.value);if(typeof e.setSelectionRange==="function")e.setSelectionRange(n,r);else e.select()}var Pt=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],Zo=T("audio-lines",Pt);var Or=Tr((e)=>({fields:[],loadedProjectId:null,setFields:(n,r)=>e({fields:n,loadedProjectId:r}),updateFields:(n)=>e({fields:n})}));function Ke(e,n){let{start:r,end:a}=El(n?.in,e),i=+r>+a,s=i?+r:+a,c=i?a:r;c.setHours(0,0,0,0);let l=n?.step??1;if(!l)return[];if(l<0)l=-l,i=!i;let m=[];while(+c<=s)m.push(lt(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return i?m.reverse():m}function Ne(e,n){return xe(e,n?.in).getDate()}function We(e,n){return xe(e,n?.in).getDay()}function Fe(e,n){return xe(e,n?.in).getHours()}function Re(e,n){return xe(e,n?.in).getMinutes()}var Ot=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pe=T("circle-question-mark",Ot);var Vt=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Ze=T("text-align-start",Vt);var Bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Xe=T("ban",Bt);var Ht=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qe=T("hash",Ht);var $t=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zs=T("settings",$t);var zt=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Se=T("star",zt);var Gt=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Ye=T("tags",Gt);var jt=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Je=T("toggle-left",jt);var Kt=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Bi=T("type",Kt);C();var Wt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.date,[s,c]=u(!1),l=w(null),m=e?new Date(e):new Date,f=Ja(m)?m:new Date,[v,x]=u(f);h(()=>{if(s&&e){let N=new Date(e);if(Ja(N))x(N)}},[s,e]),h(()=>{let N=(g)=>{if(l.current&&!l.current.contains(g.target)){if(s)c(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);let p=()=>{if(!a)c(!0)},F=(N)=>{if(!N)return"";let g=new Date(N);if(!Ja(g))return"Invalid Date";let k="PPP";if(i?.displayFormat==="usa")k="MM/dd/yyyy";else if(i?.displayFormat==="euro")k="dd/MM/yyyy";else if(i?.displayFormat==="iso")k="yyyy-MM-dd";if(i?.includeTime)if(i?.timeFormat==="twenty_four_hour")k+=" HH:mm";else k+=" p";let j=fr(g,k);if(i?.displayTimezone)j+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return j},d=new Date(v.getFullYear(),v.getMonth(),1),M=Ld(v),z=Ke({start:d,end:M}),P=We(d),b=(N)=>{let g=new Date(N);if(i?.includeTime)g.setHours(Fe(f)),g.setMinutes(Re(f));let k=g.toISOString();if(r(k),!i?.includeTime)c(!1)},G=(N,g)=>{let k=e?new Date(e):new Date;if(!Ja(k))k.setTime(new Date().getTime());if(N==="hour")k.setHours(g);if(N==="minute")k.setMinutes(g);let j=k.toISOString();r(j)},y=Array.from({length:24},(N,g)=>g),X=Array.from({length:12},(N,g)=>g*5);if(s)return o("div",{className:"relative w-full",ref:l,children:[t("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:e?F(e):t("span",{className:"text-muted-foreground",children:"Select date..."})}),o("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[o("div",{className:"p-4 w-64",children:[o("div",{className:"flex justify-between items-center mb-4",children:[t("button",{onClick:()=>x(Pi(v,-1)),className:"p-1 hover:bg-accent rounded",children:t(Gr,{className:"w-4 h-4"})}),t("span",{className:"font-semibold text-sm",children:fr(v,"MMMM yyyy")}),t("button",{onClick:()=>x(Pi(v,1)),className:"p-1 hover:bg-accent rounded",children:t(pt,{className:"w-4 h-4"})})]}),t("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((N)=>t("div",{children:N},N))}),o("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:P}).map((N,g)=>t("div",{},`empty-${g}`)),z.map((N)=>{let g=e?new Date(e):null,k=g&&Ja(g)&&Ne(g)===Ne(N)&&Hc(g)===Hc(N)&&$c(g)===$c(N);return t("button",{onClick:()=>b(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${k?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:Ne(N)},N.toString())})]})]}),i?.includeTime&&o("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[o("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[t(hr,{className:"w-3 h-3"})," Time"]}),o("div",{className:"flex flex-1 h-64",children:[t("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:y.map((N)=>t("div",{onClick:()=>G("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Fe(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),t("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:X.map((N)=>t("div",{onClick:()=>G("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Re(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return t("div",{onClick:p,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e?F(e):t("span",{className:"text-muted-foreground italic",children:"Empty"})})},et=Wt;C();var Zt=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=w(null),m=w(null),[f,v]=u(!1);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus(),v(!1)},[a]),h(()=>{let d=(M)=>{if(f&&m.current&&!m.current.contains(M.target))v(!1)};if(f)document.addEventListener("mousedown",d);return()=>{document.removeEventListener("mousedown",d)}},[f]);let x=()=>{i(!1),n(s)},p=(d)=>{d.stopPropagation(),v(!0)},F=(d)=>{if(d.stopPropagation(),!r)i(!0)};if(a)return t("textarea",{ref:l,value:s,onChange:(d)=>c(d.target.value),onBlur:x,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return o("div",{ref:m,className:"relative w-full text-sm",children:[t("div",{onClick:p,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!r?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})}),f&&t("div",{onClick:F,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!r?"cursor-text":""}`,children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},tt=Zt;C();var Xt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.number,[s,c]=u(!1),[l,m]=u(""),f=w(null);h(()=>{m(e!==void 0&&e!==null?e.toString():"")},[e]),h(()=>{if(s&&f.current)f.current.focus()},[s]);let v=()=>{if(!a)c(!0)},x=()=>{if(c(!1),l==="")r(void 0);else{let d=parseFloat(l);r(isNaN(d)?void 0:d)}},p=(d)=>{if(d.key==="Enter")d.stopPropagation(),f.current?.blur()},F=(d)=>{if(d===void 0||d===null||isNaN(d))return"";return d.toFixed(i?.scale)};if(s)return t("input",{ref:f,type:"number",step:1/Math.pow(10,i?.scale||0),value:l,onChange:(d)=>m(d.target.value),onBlur:x,onKeyDown:p,onDoubleClick:(d)=>d.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return t("div",{onClick:v,onDoubleClick:(d)=>d.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e!==void 0&&e!==null?F(e):t("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},ot=Xt;C();var Qt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.rating,s=Math.max(2,Math.min(6,i?.maxValue||5)),[c,l]=u(null),m=(v,x)=>{if(v.stopPropagation(),a)return;let p;if(e===x)p=0;else p=x;r(p)},f=Array.from({length:s},(v,x)=>x+1);return t("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!a&&l(null),onDoubleClick:(v)=>v.stopPropagation(),children:f.map((v)=>{let x=c!==null?v<=c:v<=(e||0);return t("button",{onClick:(p)=>m(p,v),onMouseEnter:()=>!a&&l(v),className:`focus:outline-none transition-transform ${!a?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:a,children:t(Se,{className:`w-5 h-5 transition-colors ${x?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},v)})})},au=Qt;C();C();var qt=Object.defineProperty,I=(e,n)=>qt(e,"name",{value:n,configurable:!0}),rt=["PageUp","PageDown"],at=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],it={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ve="Slider",[Le,Jt,eo]=sa(ve),[Ve,nr]=dt(ve,[eo]),[to,we]=Ve(ve),no=D(I(function(n,r){let{name:a,min:i=0,max:s=100,step:c=1,orientation:l="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[i],value:x,onValueChange:p=I(()=>{},"onValueChange"),onValueCommit:F=I(()=>{},"onValueCommit"),inverted:d=!1,form:M,...z}=n,P=w(new Set),b=w(0),G=w(!1),X=l==="horizontal"?ro:ao,[N,g]=u(null),k=he(r,g),[j=[],ee]=Lt({prop:x,defaultProp:v,onChange:I((Z)=>{[...P.current][b.current]?.focus({preventScroll:!0,focusVisible:G.current}),G.current=!1,p(Z)},"onChange")}),q=w(j),oe=w(j);h(()=>{let Z=M?N?.ownerDocument.getElementById(M):N?.closest("form");if(Z instanceof HTMLFormElement){let te=I(()=>ee(oe.current),"reset");return Z.addEventListener("reset",te),()=>Z.removeEventListener("reset",te)}},[N,M,ee]);function _(Z){let te=xt(j,Z);L(Z,te)}I(_,"handleSlideStart");function Q(Z){L(Z,b.current)}I(Q,"handleSlideMove");function J(){if(String(j)!==String(q.current))F(j)}I(J,"handleSlideEnd");function L(Z,te,{commit:Ue}={commit:!1}){let ze=He(c),_e=ce(Math.round((Z-i)/c)*c+i,ze),le=ia(_e,[i,s]);ee((ae=[])=>{let ne=ht(ae,le,te);if(St(ne,f*c)){b.current=ne.indexOf(le);let je=String(ne)!==String(ae);if(je&&Ue)F(ne);return je?ne:ae}else return ae})}return I(L,"updateValues"),t(to,{scope:n.__scopeSlider,name:a,disabled:m,min:i,max:s,valueIndexToChangeRef:b,thumbs:P.current,values:j,orientation:l,form:M,children:t(Le.Provider,{scope:n.__scopeSlider,children:t(Le.Slot,{scope:n.__scopeSlider,children:t(X,{"aria-disabled":m,"data-disabled":m?"":void 0,...z,ref:k,onPointerDown:Y(z.onPointerDown,()=>{if(!m)q.current=j,G.current=!1}),min:i,max:s,inverted:d,onSlideStart:m?void 0:_,onSlideMove:m?void 0:Q,onSlideEnd:m?void 0:J,onHomeKeyDown:()=>{if(!m)G.current=!0,L(i,0,{commit:!0})},onEndKeyDown:()=>{if(!m)G.current=!0,L(s,j.length-1,{commit:!0})},onStepKeyDown:({event:Z,direction:te})=>{if(!m){G.current=!0;let _e=rt.includes(Z.key)||Z.shiftKey&&at.includes(Z.key)?10:1,le=b.current,ae=j[le],ne=Ct(ae,{min:i,step:c,direction:te,multiplier:_e});L(ne,le,{commit:!0})}}})})})})},"Slider")),[st,ct]=Ve(ve,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ro=D(I(function(n,r){let{min:a,max:i,dir:s,inverted:c,onSlideStart:l,onSlideMove:m,onSlideEnd:f,onStepKeyDown:v,...x}=n,[p,F]=u(null),d=he(r,F),M=w(void 0),z=zn(s),P=z==="ltr",b=P&&!c||!P&&c;function G(y){let X=M.current||p.getBoundingClientRect(),N=[0,X.width],k=Ce(N,b?[a,i]:[i,a]);return M.current=X,k(y-X.left)}return I(G,"getValueFromPointer"),t(st,{scope:n.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:t(ut,{dir:z,"data-orientation":"horizontal",...x,ref:d,style:{...x.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(y)=>{let X=G(y.clientX);l?.(X)},onSlideMove:(y)=>{let X=G(y.clientX);m?.(X)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:(y)=>{let N=it[b?"from-left":"from-right"].includes(y.key);v?.({event:y,direction:N?-1:1})}})})},"SliderHorizontal")),ao=D(I(function(n,r){let{min:a,max:i,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:m,onStepKeyDown:f,...v}=n,x=w(null),p=he(r,x),F=w(void 0),d=!s;function M(z){let P=F.current||x.current.getBoundingClientRect(),b=[0,P.height],y=Ce(b,d?[i,a]:[a,i]);return F.current=P,y(z-P.top)}return I(M,"getValueFromPointer"),t(st,{scope:n.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:t(ut,{"data-orientation":"vertical",...v,ref:p,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(z)=>{let P=M(z.clientY);c?.(P)},onSlideMove:(z)=>{let P=M(z.clientY);l?.(P)},onSlideEnd:()=>{F.current=void 0,m?.()},onStepKeyDown:(z)=>{let b=it[d?"from-bottom":"from-top"].includes(z.key);f?.({event:z,direction:b?-1:1})}})})},"SliderVertical")),ut=D(I(function(n,r){let{__scopeSlider:a,onSlideStart:i,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:l,onEndKeyDown:m,onStepKeyDown:f,...v}=n,x=we(ve,a);return t(se.span,{...v,ref:r,onKeyDown:Y(n.onKeyDown,(p)=>{if(p.key==="Home")l(p),p.preventDefault();else if(p.key==="End")m(p),p.preventDefault();else if(rt.concat(at).includes(p.key))f(p),p.preventDefault()}),onPointerDown:Y(n.onPointerDown,(p)=>{let F=p.target;if(F.setPointerCapture(p.pointerId),p.preventDefault(),x.thumbs.has(F))F.focus({preventScroll:!0,focusVisible:!1});else i(p)}),onPointerMove:Y(n.onPointerMove,(p)=>{if(p.target.hasPointerCapture(p.pointerId))s(p)}),onPointerUp:Y(n.onPointerUp,(p)=>{let F=p.target;if(F.hasPointerCapture(p.pointerId))F.releasePointerCapture(p.pointerId),c(p)})})},"SliderImpl")),io="SliderTrack",so=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(io,a);return t(se.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...i,ref:r})},"SliderTrack")),nt="SliderRange",lo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(nt,a),c=ct(nt,a),l=w(null),m=he(r,l),f=s.values.length,v=s.values.map((F)=>Be(F,s.min,s.max)),x=f>1?Math.min(...v):0,p=100-Math.max(...v);return t(se.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...i,ref:m,style:{...n.style,[c.startEdge]:x+"%",[c.endEdge]:p+"%"}})},"SliderRange")),co="SliderThumb",[uo,mt]=Ve(co),mo="SliderThumbProvider";function ft(e){let{__scopeSlider:n,name:r,children:a,internal_do_not_use_render:i}=e,s=we(mo,n),c=Jt(n),[l,m]=u(null),f=O(()=>l?c().findIndex((z)=>z.ref.current===l):-1,[c,l]),v=oa(l),x=l?!!s.form||!!l.closest("form"):!0,p=s.values[f],F=r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),d=p===void 0?0:Be(p,s.min,s.max);h(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let M={value:p,name:F,form:s.form,isFormControl:x,index:f,thumb:l,onThumbChange:m,percent:d,size:v};return t(uo,{scope:n,...M,children:Et(i)?i(M):a})}I(ft,"SliderThumbProvider");var Oe="SliderThumbTrigger",fo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(Oe,a),c=ct(Oe,a),{index:l,value:m,percent:f,size:v,onThumbChange:x}=mt(Oe,a),p=he(r,x),F=vt(l,s.values.length),d=v?.[c.size],M=d?bt(d,f,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${f}% + ${M}px)`},children:t(Le.ItemSlot,{scope:a,children:t(se.span,{role:"slider","aria-label":n["aria-label"]||F,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...i,ref:p,style:m===void 0?{display:"none"}:n.style,onFocus:Y(n.onFocus,()=>{s.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),po=D(I(function(n,r){let{__scopeSlider:a,name:i,...s}=n;return t(ft,{__scopeSlider:a,name:i,internal_do_not_use_render:({index:c,isFormControl:l})=>o(B,{children:[t(fo,{...s,ref:r,__scopeSlider:a}),l?t(ho,{__scopeSlider:a},c):null]})})},"SliderThumb")),go="SliderBubbleInput",ho=D(I(function({__scopeSlider:n,...r},a){let{value:i,name:s,form:c}=mt(go,n),l=w(null),m=he(l,a),f=Cc(i);return h(()=>{let v=l.current;if(!v)return;let x=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==i&&F){let d=new Event("input",{bubbles:!0});F.call(v,i),v.dispatchEvent(d)}},[f,i]),t(se.input,{style:{display:"none"},name:s,form:c,...r,ref:m,defaultValue:i})},"SliderBubbleInput"));function ht(e=[],n,r){let a=[...e];return a[r]=n,a.sort((i,s)=>i-s)}I(ht,"getNextSortedValues");function Be(e,n,r){let s=100/(r-n)*(e-n);return ia(s,[0,100])}I(Be,"convertValueToPercentage");function vt(e,n){if(n>2)return`Value ${e+1} of ${n}`;else if(n===2)return["Minimum","Maximum"][e];else return}I(vt,"getLabel");function xt(e,n){if(e.length===1)return 0;let r=e.map((i)=>Math.abs(i-n)),a=Math.min(...r);return r.indexOf(a)}I(xt,"getClosestValueIndex");function bt(e,n,r){let a=e/2,i=50,s=Ce([0,50],[0,a]);return(a-s(n)*r)*r}I(bt,"getThumbInBoundsOffset");function Nt(e){return e.slice(0,-1).map((n,r)=>e[r+1]-n)}I(Nt,"getStepsBetweenValues");function St(e,n){if(n>0){let r=Nt(e);return Math.min(...r)>=n}return!0}I(St,"hasMinStepsBetweenValues");function Ce(e,n){return(r)=>{if(e[0]===e[1]||n[0]===n[1])return n[0];let a=(n[1]-n[0])/(e[1]-e[0]);return n[0]+a*(r-e[0])}}I(Ce,"linearScale");function He(e){if(!Number.isFinite(e))return 0;let n=e.toString();if(n.includes("e")){let[a,i]=n.split("e"),s=a.split(".")[1]||"",c=Number(i);return Math.max(0,s.length-c)}let r=n.split(".")[1];return r?r.length:0}I(He,"getDecimalCount");function ce(e,n){let r=Math.pow(10,n);return Math.round(e*r)/r}I(ce,"roundValue");function Ct(e,{min:n,step:r,direction:a,multiplier:i}){let s=He(r),c=(e-n)/r,l=Math.round(c),m=ce(l*r+n,s)===ce(e,s),f;if(m)f=l+i*a;else if(a>0)f=Math.ceil(c);else f=Math.floor(c);return ce(f*r+n,s)}I(Ct,"getNextStepValue");function Et(e){return typeof e==="function"}I(Et,"isFunction");var re;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(re||(re={}));class ie extends Error{constructor(e,n){super(`${n} (${e})`);this.name="ULIDError",this.code=e}}function xo(e){let n=Math.floor(e()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(n)}function bo(e){let n=yo(),r=n&&(n.crypto||n.msCrypto)||null;if(typeof r?.getRandomValues==="function")return()=>{let a=new Uint8Array(1);return r.getRandomValues(a),a[0]/256};else if(typeof r?.randomBytes==="function")return()=>r.randomBytes(1).readUInt8()/256;throw new ie(re.PRNGDetectFailure,"Failed to find a reliable PRNG")}function yo(){if(So())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function wo(e,n){let r="";for(;e>0;e--)r=xo(n)+r;return r}function No(e,n=10){if(isNaN(e))throw new ie(re.EncodeTimeValueMalformed,`Time must be a number: ${e}`);else if(e>281474976710655)throw new ie(re.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);else if(e<0)throw new ie(re.EncodeTimeNegative,`Time must be positive: ${e}`);else if(Number.isInteger(e)===!1)throw new ie(re.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,a="";for(let i=n;i>0;i--)r=e%32,a="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(r)+a,e=(e-r)/32;return a}function So(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Bo(e,n){let r=n||bo(),a=!e||isNaN(e)?Date.now():e;return No(a,10)+wo(16,r)}function Co(e,n,r){let a=e.slice();return a.splice(r,0,a.splice(n,1)[0]),a}function su(e,n,r,a){if(r===a)return e;let i=Co(n,r,a),s=new Set(n.map((l)=>l.id)),c=0;return e.map((l)=>s.has(l.id)?i[c++]:l)}async function Ui(e){let n=[],r=[],a=e.items;if(a)for(let c=0;c<a.length;c++){let l=a[c];if(l.kind==="file"){let m=l.webkitGetAsEntry?.();if(m)r.push({entry:m,path:""})}}else return Array.from(e.files);let i=(c)=>new Promise((l)=>{c.readEntries((m)=>l(m),()=>l([]))}),s=(c)=>new Promise((l,m)=>{c.file((f)=>l(f),(f)=>m(f))});while(r.length>0){let c=r.shift();if(!c)continue;let{entry:l,path:m}=c;if(l.isFile)try{let f=await s(l),v=m?`${m}/${f.name}`:f.name;Object.defineProperty(f,"webkitRelativePath",{value:v,writable:!1,configurable:!0}),n.push(f)}catch(f){console.error("Error reading file entry:",f)}else if(l.isDirectory){let f=l.createReader(),v=[],x=await i(f);while(x.length>0)v=v.concat(x),x=await i(f);let p=m?`${m}/${l.name}`:l.name;for(let F of v)r.push({entry:F,path:p})}}return n}C();C();function Bl(){let[e,n]=u(!1);return o(pe,{open:e,onOpenChange:n,children:[t(Qg,{asChild:!0,children:o(S,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:gf(),children:[t(Pe,{className:"h-3.5 w-3.5"}),t("span",{className:"sr-only",children:gf()})]})}),o(ue,{className:"sm:max-w-[500px]",children:[o(me,{children:[o(de,{className:"flex items-center gap-2",children:[t(Pe,{className:"h-5 w-5 text-muted-foreground"}),gf()]}),t(Tt,{children:qy()})]}),o("div",{className:"space-y-4 py-2",children:[o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{children:Mc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Hy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:$y()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(rn,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{children:Ic()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Uy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:Fy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(wt,{className:"h-4 w-4 text-blue-500 shrink-0"}),t("span",{children:Tc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:zy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:jy()})]})]})]})]})}var si=["red","orange","yellow","green","blue","purple","gray"],wa={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function ms(e){if(!e)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let n=e.toLowerCase(),r=wa[n];if(r)return{backgroundColor:r.bg,color:r.text};if(e.startsWith("#"))return{backgroundColor:`${e}33`,color:e};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:e}}function va(e=[]){let n=new Set(e.map((a)=>a.color?.toLowerCase()).filter(Boolean)),r=si.filter((a)=>!n.has(a.toLowerCase()));if(r.length>0)return r[Math.floor(Math.random()*r.length)];return si[Math.floor(Math.random()*si.length)]}var ai={[Mr.text]:Bi,[Mr.longText]:Ze,[Mr.select]:Po,[Mr.selectMulti]:Ye,[Mr.rating]:Se,[Mr.number]:Qe,[Mr.toggle]:Je,[Mr.date]:Un,[Mr.user]:Hn,[Mr.userMulti]:oo};function _o({field:e,index:n,onVisibilityChange:r}){let{ref:a,handleRef:i}=Ni({id:e.id,index:n}),s=e.config?.type?ai[e.config.type]:null;return o("div",{ref:a,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[o("div",{className:"flex items-center gap-2",children:[t("div",{ref:i,className:"cursor-grab",children:t(Rs,{className:"h-4 w-4 text-muted-foreground"})}),s&&t(s,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===xr.CONTENT&&t(rn,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===xr.CREATION_CONTEXT&&t(wt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{className:"text-sm truncate",children:e.config?.name})]}),t(qe,{checked:e.visible,onCheckedChange:(c)=>r(e.id,c)})]})}function Kp({projectId:e,onManageFields:n,onSave:r}){let{fields:a,updateFields:i}=Or(),[s,c]=u(""),[l,m]=u("list"),[f,v]=u(""),[x,p]=u(""),[F,d]=u(xr.NONE),[M,z]=u(""),[P,b]=u([]),G=K();h(()=>{G.invalidateQueries({queryKey:["fields",e]})},[e,G]);let y=A.api.projects[":projectId"].fields.order.$patch,{mutate:X}=U({mutationFn:async(_)=>{if(!(await y(_)).ok)throw Error(Tf());return null}}),N=A.api.projects[":projectId"].fields.$post,{mutate:g}=U({mutationFn:async(_)=>{let Q=await N(_);if(!Q.ok)throw Error(If());return await Q.json()},onSuccess:(_)=>{let Q={..._,visible:!0},J=[...a,Q];i(J),v(""),b([]),X({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))}),r?.()}}),k=O(()=>a.filter((_)=>_.config?.name?.toLowerCase().includes(s.toLowerCase())),[a,s]),j=(_)=>{if(_.canceled)return;let{source:Q}=_.operation;if(!Xn(Q))return;let{initialIndex:J,index:L}=Q;if(J===L)return;let Z=su(a,k,J,L);i(Z),X({param:{projectId:e},json:Z.map((te)=>({fieldId:te.id,visible:te.visible||!1}))})},ee=(_,Q)=>{let J=a.map((L)=>L.id===_?{...L,visible:Q}:L);i(J),X({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))})},q=()=>{if(!f||!x)return;let _=x===Mr.select?{select:{options:P}}:x===Mr.selectMulti?{selectMulti:{options:P}}:{};g({param:{projectId:e},json:{config:{name:f,type:x,autofillSource:F,..._},label:f,description:M}})},oe=a.filter((_)=>_.visible).length;if(l==="create")return t("div",{className:"w-80 p-4",children:o("div",{className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(V,{htmlFor:"field-name",children:Rf()}),t(H,{id:"field-name",placeholder:Vv(),value:f,onChange:(_)=>v(_.target.value),autoFocus:!0})]}),o("div",{className:"space-y-2",children:[t(V,{children:kf()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"w-full justify-between font-normal",children:[x?t("span",{className:"capitalize",children:x.replace(/_/g," ")}):t("span",{className:"text-muted-foreground border-dashed",children:VC()}),t(be,{className:"ml-2 h-4 w-4 opacity-50"})]})}),t(ye,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(Mr).map((_)=>t(W,{onClick:()=>{p(_),b([])},className:"capitalize",children:_.replace(/_/g," ")},_))})]})]}),o("div",{className:"space-y-2",children:[t(V,{htmlFor:"field-desc",children:fl()}),t(H,{id:"field-desc",placeholder:sd(),value:M,onChange:(_)=>z(_.target.value)})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center gap-1",children:[t(V,{children:nd()}),t(Bl,{})]}),o(Eo,{type:"single",value:F,onValueChange:(_)=>{if(_)d(_)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[t(pr,{value:xr.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Mc()}),t(pr,{value:xr.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Ic()}),t(pr,{value:xr.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Tc()})]})]}),(x===Mr.select||x===Mr.selectMulti)&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-sm font-medium",children:_d()}),o(S,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let _={id:Bo(),displayName:gd(),color:va(P)};b([...P,_])},children:[t(fe,{className:"h-4 w-4 mr-1"})," ",Xu()]})]}),t("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:P.map((_,Q)=>o("div",{className:"flex items-center gap-2",children:[t(H,{value:_.displayName,onChange:(J)=>{let L=[...P];L[Q]={..._,displayName:J.target.value},b(L)},placeholder:Yf(),className:"h-8 flex-1"}),o(gt,{children:[t(At,{asChild:!0,children:t("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:wa[_.color||""]?.hex||_.color||"#808080"}})}),t(yt,{className:"p-2 w-auto",align:"end",children:t("div",{className:"flex gap-1",children:si.map((J)=>t("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:wa[J]?.hex||J},onClick:()=>{let L=[...P];L[Q]={..._,color:J},b(L)}},J))})})]}),t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{b(P.filter((J,L)=>L!==Q))},children:t(De,{className:"h-4 w-4"})})]},_.id))})]}),o("div",{className:"flex gap-2 pt-2",children:[t(S,{variant:"secondary",className:"flex-1",onClick:()=>{m("list"),v(""),p(""),d(xr.NONE),z(""),b([])},children:ke()}),t(S,{className:"flex-1",onClick:q,disabled:!f||!x,children:Oo()})]})]})});return o("div",{className:"w-80 p-4",children:[t("div",{className:"flex items-center justify-between mb-4",children:o("h3",{className:"font-semibold",children:[Ti()," ",t("span",{className:"text-muted-foreground text-sm font-normal",children:HI({count:oe})})]})}),o("div",{className:"relative mb-4",children:[t(Ut,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t(H,{placeholder:UC(),value:s,onChange:(_)=>c(_.target.value),className:"pl-8"})]}),t("div",{className:"max-h-60 overflow-y-auto pr-2",children:t(jn,{sensors:[un.configure({activationConstraints:[new kr.Distance({value:8})]}),Wo],onDragEnd:j,children:k.map((_,Q)=>t(_o,{field:_,index:Q,onVisibilityChange:ee},_.id))})}),n&&o("div",{className:"mt-4 space-y-2",children:[o(S,{variant:"secondary",className:"w-full",onClick:n,children:[t(Zs,{className:"h-4 w-4 mr-2"}),Zf()]}),o(S,{className:"w-full",onClick:()=>m("create"),children:[t(fe,{className:"h-4 w-4 mr-2"}),Qv()]})]})]})}var Fo=({value:e,config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.select,c=s?.options||[],[l,m]=u(!1),[f,v]=u(""),x=c.find((y)=>y.id===e),p=f.trim(),F=c.filter((y)=>y.displayName.toLowerCase().includes(p.toLowerCase())),d=c.some((y)=>y.displayName.trim().toLowerCase()===p.toLowerCase()||y.id.toLowerCase()===p.toLowerCase()),M=()=>{if(!a)m(!0)},z=(y)=>{r(y),m(!1),v("")},P=(y)=>{if(a)return;if(m(y),!y)v("")},b=async()=>{if(!p)return;let y={id:p.toLowerCase().replace(/\s+/g,"-"),displayName:p,color:va(c)},X=[...c,y],N={...n,select:{...s,options:X}};if(i)try{let g=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:N}});if(!g.ok){R.error(ml());return}let k=await g.json(),ee=Or.getState().fields.map((q)=>q.id===k.id?{...q,...k,visible:q.visible}:q);Or.getState().updateFields(ee)}catch{R.error(ml());return}r(y.id),v(""),m(!1)};return t("div",{className:"relative w-full",onClick:(y)=>y.stopPropagation(),children:o(gt,{open:!a&&l,onOpenChange:P,children:[t(At,{asChild:!0,children:o("div",{onClick:M,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((y)=>{if(!y)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:ms(y.color),children:y.displayName})})(x),!a&&t(be,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(yt,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(y)=>y.stopPropagation(),children:[t(Ut,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:vg(),value:f,onChange:(y)=>v(y.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[f===""&&o("div",{onClick:()=>z(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[t(De,{className:"w-3.5 h-3.5"})," Clear"]}),F.map((y)=>t("div",{onClick:()=>z(y.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${e===y.id?"bg-accent/50 font-medium":""}`,children:t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ms(y.color),children:y.displayName})},y.id)),F.length===0&&!p&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:Fh()}),p!==""&&!d&&o("div",{onClick:b,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(fe,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:mm({name:p})})]})]})]})]})})},_t=Fo;C();var Mo=({value:e=[],config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.selectMulti,c=s?.options||[],l=w(null),[m,f]=u(!1),[v,x]=u(e.length),[p,F]=u(""),d=c.filter((g)=>(e||[]).includes(g.id))||[],M=p.trim(),z=c.filter((g)=>g.displayName.toLowerCase().includes(M.toLowerCase())),P=c.some((g)=>g.displayName.trim().toLowerCase()===M.toLowerCase()||g.id.toLowerCase()===M.toLowerCase());Ge(()=>{if(m){x(d.length);return}if(l.current){let g=l.current.clientWidth-8,j=document.createElement("canvas").getContext("2d");if(j&&g>0){j.font="500 12px ui-sans-serif, system-ui, sans-serif";let ee=4,q=d.map((Z)=>Math.ceil(j.measureText(Z.displayName).width)+18);if(q.reduce((Z,te)=>Z+te,0)+Math.max(0,q.length-1)*ee<=g){x(d.length);return}let Q=g-32-ee,J=0,L=0;for(let Z=0;Z<q.length;Z++){let te=L>0?J+ee+q[Z]:q[Z];if(te>Q)break;J=te,L++}x(L)}}},[d,m,e]);let b=(g)=>{let k=e||[],j;if(k.includes(g))j=k.filter((ee)=>ee!==g);else j=[...k,g];r(j)},G=async()=>{if(!M)return;let g={id:M.toLowerCase().replace(/\s+/g,"-"),displayName:M,color:va(c)},k=[...c,g],j={...n,selectMulti:{...s,options:k}};if(i)try{let ee=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:j}});if(!ee.ok){R.error(ml());return}let q=await ee.json(),_=Or.getState().fields.map((Q)=>Q.id===q.id?{...Q,...q,visible:Q.visible}:Q);Or.getState().updateFields(_)}catch{R.error(ml());return}r([...e||[],g.id]),F("")},y=(g)=>{if(g.stopPropagation(),!a)f(!0)},X=d.length-v;return t("div",{className:"relative w-full",onClick:(g)=>g.stopPropagation(),children:o(gt,{open:!a&&m,onOpenChange:(g)=>{if(a)return;if(f(g),!g)F("")},children:[t(At,{asChild:!0,children:o("div",{ref:l,onClick:y,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!a||X>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[d.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),d.slice(0,v).map((g)=>t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:ms(g.color),children:g.displayName},g.id)),X>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",X]})]})}),o(yt,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(g)=>g.stopPropagation(),children:[t(Ut,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:vg(),value:p,onChange:(g)=>F(g.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[z.map((g)=>{let k=(e||[]).includes(g.id);return o("div",{onClick:()=>b(g.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${k?"bg-accent/30 font-medium":""}`,children:[t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ms(g.color),children:g.displayName}),k&&t(Me,{className:"w-3.5 h-3.5 text-primary"})]},g.id)}),z.length===0&&!M&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:Fh()}),M!==""&&!P&&o("div",{onClick:G,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(fe,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:mm({name:M})})]})]})]})]})})},Ft=Mo;C();var Ro=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=w(null);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus()},[a]);let m=()=>{if(!r)i(!0)},f=()=>{i(!1),n(s)},v=(x)=>{if(x.key==="Enter")l.current?.blur()};if(a)return t("input",{ref:l,type:"text",value:s,onChange:(x)=>c(x.target.value),onBlur:f,onKeyDown:v,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return t("div",{onClick:m,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e||t("span",{className:"text-muted-foreground italic",children:"Empty"})})},Mt=Ro;var ko=({value:e,onSave:n,readOnly:r})=>t("div",{className:"flex items-center h-[28px] w-full",onClick:(i)=>i.stopPropagation(),children:t(qe,{checked:e,onCheckedChange:(i)=>{if(!r)n(i)},disabled:r,className:"cursor-pointer"})}),Rt=ko;C();var To=({value:e,onSave:n,readOnly:r})=>{let a=is(),{members:i,fetchMembers:s}=Ur(),[c,l]=u(!1);h(()=>{if(a)s(a)},[a,s]);let m=i.find((d)=>d.id===e),f=()=>{if(!r)l(!0)},v=(d)=>{n(d),l(!1)},x=(d)=>{if(r)return;l(d)},p=(d)=>d.split(" ").map((M)=>M[0]).slice(0,2).join("").toUpperCase();return t("div",{className:"relative w-full",onClick:(d)=>d.stopPropagation(),children:o(gt,{open:!r&&c,onOpenChange:x,children:[t(At,{asChild:!0,children:o("div",{onClick:f,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((d)=>{if(!d)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[o(Ee,{className:"w-4 h-4",children:[t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"truncate max-w-[120px]",children:d.name})]})})(m),!r&&t(be,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(yt,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[o("div",{onClick:()=>v(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[t(De,{className:"w-3 h-3"})," Clear"]}),i.map((d)=>o("div",{onClick:()=>v(d.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[o(Ee,{className:"w-5 h-5",children:[t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:d.name})]},d.id))]})]})})},kt=To;C();var Io=({value:e=[],onSave:n,readOnly:r})=>{let a=is(),{members:i,fetchMembers:s}=Ur(),c=w(null),[l,m]=u(!1),[f,v]=u(e.length);h(()=>{if(a)s(a)},[a,s]);let x=i.filter((b)=>(e||[]).includes(b.id)),p=(b)=>b.split(" ").map((G)=>G[0]).slice(0,2).join("").toUpperCase();Ge(()=>{if(l){v(x.length);return}if(c.current){let b=c.current.clientWidth-8,y=document.createElement("canvas").getContext("2d");if(y&&b>0){y.font="500 12px ui-sans-serif, system-ui, sans-serif";let X=4,N=x.map((oe)=>Math.min(100,Math.ceil(y.measureText(oe.name).width))+40);if(N.reduce((oe,_)=>oe+_,0)+Math.max(0,N.length-1)*X<=b){v(x.length);return}let j=b-32-X,ee=0,q=0;for(let oe=0;oe<N.length;oe++){let _=q>0?ee+X+N[oe]:N[oe];if(_>j)break;ee=_,q++}v(q)}}},[x,l,e]);let F=(b)=>{let G=e||[],y;if(G.includes(b))y=G.filter((X)=>X!==b);else y=[...G,b];n(y)},d=(b)=>{if(b.stopPropagation(),!r)m(!0)},M=x.length-f,z=(b)=>{if(r)return;m(b)},P=(b)=>o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[o(Ee,{className:"w-4 h-4",children:[t(Ie,{src:b.image,alt:b.name,className:"object-cover"}),t(Te,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(b.name)})]}),t("span",{className:"truncate max-w-[100px]",children:b.name})]},b.id);return t("div",{className:"relative w-full",onClick:(b)=>b.stopPropagation(),children:o(gt,{open:!r&&l,onOpenChange:z,children:[t(At,{asChild:!0,children:o("div",{ref:c,onClick:d,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!r||M>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[x.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),x.slice(0,f).map(P),M>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",M]})]})}),t(yt,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:i.map((b)=>{let G=(e||[]).includes(b.id);return o("div",{onClick:()=>F(b.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[o("div",{className:"flex items-center gap-2",children:[o(Ee,{className:"w-5 h-5",children:[t(Ie,{src:b.image,alt:b.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(b.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:b.name})]}),G&&t(Me,{className:"w-4 h-4 text-primary"})]},b.id)})})]})})},It=Io;var Do=(e)=>{if(!e.config)return t("div",{children:"Unknown Field Type"});switch(e.config.type){case"text":return t(Mt,{...e,value:e.value,onSave:e.onSave});case"longText":return t(tt,{...e,value:e.value,onSave:e.onSave});case"select":return t(_t,{...e,value:e.value,onSave:e.onSave});case"selectMulti":return t(Ft,{...e,value:e.value,onSave:e.onSave});case"rating":return t(au,{...e,value:e.value,onSave:e.onSave});case"number":return t(ot,{...e,value:e.value,onSave:e.onSave});case"toggle":return t(Rt,{...e,value:e.value,onSave:e.onSave});case"date":return t(et,{...e,value:e.value,onSave:e.onSave});case"user":return t(kt,{...e,value:e.value,onSave:e.onSave});case"userMulti":return t(It,{...e,value:e.value,onSave:e.onSave});default:return t("div",{children:"Unknown Field Type"})}},hs=Do;C();function Bs({className:e,defaultValue:n,value:r,min:a=0,max:i=100,...s}){let c=O(()=>Array.isArray(r)?r:Array.isArray(n)?n:[a,i],[r,n,a,i]);return o(no,{"data-slot":"slider",defaultValue:n,value:r,min:a,max:i,className:E("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...s,children:[t(so,{"data-slot":"slider-track",className:E("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(lo,{"data-slot":"slider-range",className:E("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(l,m)=>t(po,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
2
- export{Zo,Zs,Bi,su,Ui,Or,Bo,ps,au,Bl,si,wa,ms,va,ai,Kp,hs,Bs};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function es(_){if(_===void 0)return;let n=Array.from(_);if(n.length<=64)return _;return n.slice(0,64).join("")}
3
- export{es};
@@ -1 +0,0 @@
1
- import{t,Fe}from"./chunk-7rhz2gze.js";import"./chunk-tm7f32c7.js";import"./chunk-7kjgvxqa.js";import"./chunk-gc5sbfa5.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-snhsjs4x.js";import"./chunk-77fmkpdz.js";import"./chunk-914bp49r.js";import"./chunk-f6svp4dp.js";import"./chunk-0qaq0sp8.js";import{ha}from"./chunk-vyzptrea.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";function s(){let{shareId:e,folderId:a}=n.useParams();return t(ha,{shareId:e,initialFolderId:a})}var n=Fe("/share/$shareId/folders/$folderId")({component:s});export{n as Route};
@@ -1,2 +0,0 @@
1
- import{h,w,u,C,B,t,o,K,U,A,L,$r,be,pt,vt,Ms,fe,S,ge,Ae,ye,W,ke,Wa,qm,at,Nc,Oc,Xm,j_,q_,ph,mh,hh,qf,Hf,$f,Gf,gl,Zh,Kf,Wf,Qh,Vh,dp,hg,Ng,Ip,EI,kp,Pp,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,Tt,H,Pt,Mt,R,Kr,dn,tA}from"./chunk-7rhz2gze.js";import{Yc,Jc,Xc,eu,tu}from"./chunk-tm7f32c7.js";import{Bo}from"./chunk-7kjgvxqa.js";import{so}from"./chunk-9t8n2des.js";C();var Se=[];function Ll({teamId:r,projectId:y,assetId:m,folders:a,files:l,totalFolders:Me,totalFiles:Re,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:D,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:qe,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:b,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:k=!1,isRecents:N=!1,isLoading:se=!1,isShareView:q=!1,isPublic:ie=!1,shareId:Oe,allowDownload:re=!0}){let d=K(),{canEdit:_,canAdmin:We}=Pt(y),ne=w(null),ae=w(null),[O,je]=u(!0),[j,Qe]=u(!0),[He,F]=u(!1),[I,le]=u(""),[Ke,Q]=u(!1),ce=Me??a.length,he=Re??l.length,ve=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),we=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Le=ve>-1,Pe=we>-1,De=(e,s)=>{if(s)return e===1?Hf({count:e}):qf({count:e});else return e===1?Gf({count:e}):$f({count:e})},{editingItemId:xe,setEditingItemId:Ce,handleAction:Ne,onRenameSubmit:_e,isDeleteDialogOpen:Ve,setIsDeleteDialogOpen:Ge,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:T,resolvedFiles:Fe,startDownload:it}=tu({teamId:r,projectId:y,assetId:m,folders:a,files:l,selectedIds:D,isPublic:ie,shareId:Oe}),{ref:lt,inView:Ie}=Mt();h(()=>{if(Ie){if(ee&&!b)Z();else if(oe&&!x)te()}},[Ie,ee,b,oe,x,Z,te]);let dt=dn((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=U({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Se]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),M=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||M?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),E=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,E,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await Jc({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Te=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((z)=>z.startsWith(".")))continue;let E=g.pop(),i=n,v="";for(let z of g)if(v=`${v}/${z}`,!p.has(v)){let G=[],Dt={name:z,type:"folder",id:Bo(),children:G,size:0};i.push(Dt),p.set(v,G),i=G}else i=p.get(v);let M={file:f,id:Bo()};s.push(M);let c=f.type;if(E.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:E,size:f.size,type:"file",id:M.id,children:[],mediaType:c})}Se=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},ut=A.api.folders.$post,{mutate:ft,isPending:Ee}=U({mutationFn:async(e)=>{let s=await ut({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{R.success(gl()),F(!1),le(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{R.error(`Error: ${e.message}`)}}),{mutate:gt,isPending:V}=U({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:y}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{R.success(EI()),d.invalidateQueries({queryKey:["projects",y,"recently-deleted"]}),qe(),Q(!1)},onError:(e)=>{R.error(`Error: ${e.message}`)}}),ht=(e)=>{if(e.preventDefault(),!I.trim())return;ft(I.trim())},wt=!se&&a.length===0&&l.length===0&&!b&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[_&&o(B,{children:[t("input",{type:"file",ref:ne,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}}),t("input",{type:"file",ref:ae,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}})]}),k&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t($r,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:dp()})]}),We&&t(S,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>Q(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(tA,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[ce>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!O),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[O?t(be,{className:"h-4 w-4"}):t(pt,{className:"h-4 w-4"}),o("span",{children:[De(ce,!1),Le?` • ${Kr(ve)}`:""]})]}),O&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(eu,{item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:re},e.id))})]}),he>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>Qe(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(be,{className:"h-4 w-4"}):t(pt,{className:"h-4 w-4"}),o("span",{children:[De(he,!0),Pe?` • ${Kr(we)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(Xc,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:re},e.id))})]})]}),wt&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:N?o("div",{className:"flex flex-col items-center gap-2",children:[t(Ms,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:Kf()}),t("p",{className:"text-xs text-muted-foreground",children:Wf()})]}):t("span",{children:Ip()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(b||x)&&t(L,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),_&&!k&&!N&&!q&&!ie&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(fe,{className:"h-6 w-6"})})}),o(ye,{align:"end",side:"top",className:"w-48 mb-2",children:[o(W,{onClick:()=>ne.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:kp()})]}),o(W,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:Pp()})]}),o(W,{onClick:()=>F(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(Yc,{className:"h-4 w-4"}),t("span",{children:gl()})]})]})]})}),t(pe,{open:He,onOpenChange:F,children:t(ue,{className:"sm:max-w-md",children:o("form",{onSubmit:ht,children:[o(me,{children:[t(de,{children:gl()}),t(Tt,{children:mh()})]}),t("div",{className:"py-4",children:t(H,{autoFocus:!0,placeholder:mh(),value:I,onChange:(e)=>le(e.target.value)})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>F(!1),children:ke()}),o(S,{type:"submit",disabled:!I.trim()||Ee,children:[Ee?t(L,{className:"h-4 w-4 animate-spin mr-2"}):null,Wa()]})]})]})})}),t(Je,{open:Ve,onOpenChange:Ge,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc()}),t(nt,{children:Nc()})]}),o(tt,{children:[t(st,{children:ke()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at()})]})]})}),t(Je,{open:Ke,onOpenChange:Q,children:o(Xe,{children:[o(et,{children:[t(rt,{children:q_()}),t(nt,{children:j_()})]}),o(tt,{children:[t(st,{children:ke()}),t(ot,{onClick:()=>gt(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":at()})]})]})}),t(pe,{open:Ze,onOpenChange:P,children:o(ue,{className:"sm:max-w-md",children:[o(me,{children:[t(de,{children:T?Qh():qm()}),t(Tt,{children:T?hg():ph()})]}),T?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(L,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:Vh()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:Xm({count:Fe.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t($r,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:Zh()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:hh()})]})]})]}),t($e,{children:!T?o(B,{children:[t(S,{variant:"outline",onClick:()=>P(!1),children:ke()}),o(S,{onClick:it,className:"gap-2",disabled:Fe.length===0,children:[t(vt,{className:"h-4 w-4"}),Ng()]})]}):t(S,{variant:"outline",onClick:()=>P(!1),children:ke()})})]})})]})}
2
- export{Ll};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,Gp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Gp(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Fe("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,Fp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Fp(o)),e=s?.rootFolder,{data:n}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!n)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:"recents",rootFolderId:e})}var l=Fe("/projects/$projectId/recents")({component:i});export{l as Route};
@@ -1,2 +0,0 @@
1
- import{h,O,w,u,C,B,t,o,K,Z,U,ut,Re,A,E,dg,fg,HC,Pt,us,kr,un,jn,qc,Ar,en,Ur,Qt,yr,Do,Lo}from"./chunk-7rhz2gze.js";import{Or}from"./chunk-7kjgvxqa.js";import{Aa}from"./chunk-tm7f32c7.js";import{ga}from"./chunk-1j27fzy1.js";import{oi,Dl}from"./chunk-7pw1550a.js";import{Ll}from"./chunk-8e28hcny.js";import{ba}from"./chunk-snhsjs4x.js";import{Sr}from"./chunk-0qaq0sp8.js";C();function Ce(i,s,F,r,c,f){let D=i.type==="folder",g=s.type==="folder";if(D!==g)return null;let x=g?r:c,b=x.findIndex((a)=>a.id===F),S=x.findIndex((a)=>a.id===s.id);if(b===-1||S===-1)return null;let T=Math.min(b,S),q=Math.max(b,S),v=x.slice(T,q+1),l=new Set(f);return v.forEach((a)=>{if(a.id)l.add(a.id)}),l}function qn({teamId:i,projectId:s,projectName:F,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:D}){let g=Re(),x=K(),{canEdit:b}=Pt(s),{setFields:S}=Or(),T=A.api.files[":fileId"].metadata.$patch,{mutate:q}=U({mutationFn:async(e)=>{if(!(await T(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:v}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(v)S(v,s)},[v,s,S]);let l=r==="recently-deleted",a=r==="recents",[te,Q]=u(null),[p,L]=u(new Set),[W,se]=u(null),[Pe,ke]=u(240),[Ne,Me]=u(360),{isChatbotOpen:_}=yr(),{members:Ae,fetchMembers:oe}=Ur(),{metadata:ze,fetchMetadata:ne,setMetadata:Le}=Lo();h(()=>{if(i)oe(i),ne(i)},[i,oe,ne]);let H=O(()=>f?.filter?.searchFilter?.conditions||[],[f]),[I,V]=u(H);h(()=>{V(H)},[H]);let ae=`project:${s}:sort`,P=ze[ae]||{field:"custom",order:"asc"},je=(e)=>{if(e)Le(i,ae,e)},m=!!f,R=I.length>0||m,{fileListLeftSidebarCollapsed:re,setFileListLeftSidebarCollapsed:De,fileListRightSidebarCollapsed:ie,setFileListRightSidebarCollapsed:$e,viewModes:Te}=Qt(),le=Te[s]??"card",qe=w(null),{data:k}=l||a?{data:void 0}:Z({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:de,clearProjectState:ce}=en();h(()=>(de({teamId:i,projectId:s,projectName:F,rootFolderId:c,ancestorFolders:k?.ancestorFolders??[],currentAsset:l?{name:dg(),type:"folder"}:a?{name:fg(),type:"folder"}:m?{id:f.id,name:f.name,type:"folder"}:{id:k?.id||r,name:k?.name,type:"folder"},isRootFolder:!l&&!a&&!m&&r===c,onFolderClick:(e)=>{g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ce()),[i,s,F,k,l,a,r,c,de,ce,g]);let{data:X,fetchNextPage:fe,hasNextPage:pe,isFetchingNextPage:ue,isLoading:Ee}=ut({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",I,P,m],queryFn:async({pageParam:e})=>{if(l||m||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(R)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:P,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!R&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:G,fetchNextPage:ge,hasNextPage:me,isFetchingNextPage:he,isLoading:Ke}=ut({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",I,P,m],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:R||m,conditions:I,sort:P}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),N=X?.pages.flatMap((e)=>e.data??[])??[],y=G?.pages.flatMap((e)=>e.data??[])??[],ye=(!R&&!a?Ee:!1)||Ke,xe=X?.pages[0]?.pageInfo?.total,Se=G?.pages[0]?.pageInfo?.total,Fe=X?.pages[0]?.pageInfo?.totalSize,we=G?.pages[0]?.pageInfo?.totalSize,J=()=>{L(new Set),Q(null),se(null)},{dragState:M,handleDragStart:Qe,handleDragEnd:Oe}=Dl({teamId:i,projectId:s,assetId:r,folders:N,files:y,selectedIds:p,onClearSelection:J}),Y=O(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return y.find((d)=>d.id===e)||null},[p,y]),be=(e)=>{if(l)return;if(e.type==="folder")V([]),g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else g({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},ve=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&W){let Ie=[...N,...y].find((j)=>j.id===W);if(Ie){let j=Ce(Ie,e,W,N,y,p);if(j){L(j),Q(e);return}}}if(d){let z=new Set(p);if(z.has(e.id))z.delete(e.id);else z.add(e.id);L(z)}else L(new Set([e.id]));se(e.id),Q(e)},ee=(e,n,d)=>{q({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{x.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),x.invalidateQueries({queryKey:["search",i,r]})}})};if(Do())return t(Ll,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,onClearSelection:J,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,rootFolderId:c});return o(jn,{modifiers:[oi.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===us)return us.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===us)return us.configure({dropAnimation:null});return n}),sensors:l||a||!b?[]:[un.configure({activationConstraints:[new kr.Distance({value:10})]})],onDragStart:Qe,onDragEnd:Oe,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:qe,className:"flex flex-1 overflow-hidden relative",children:[!re&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>De(!0)}),(!ie||_)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{$e(!0),yr.getState().setIsChatbotOpen(!1)}}),!re&&o(B,{children:[t("div",{className:"bg-background",style:{width:Pe},children:t(Ar,{teamId:i,projectId:s,projectName:F,rootFolderId:c,dragState:M,ancestorFolders:k?.ancestorFolders??[]})}),t(Sr,{onResize:(e)=>{ke((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(Aa,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,displayStyle:le,onClearSelection:J,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,filterConditions:I,onFilterChange:V,sort:P,onSortChange:je,dragState:M,collection:f,onUpdateCollection:D,rootFolderId:c}),(!ie||_)&&o(B,{children:[t(Sr,{onResize:(e)=>{Me((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:Ne},className:"bg-background flex flex-col flex-shrink-0",children:_?t(ga,{projectId:s,contextAssetId:r}):Y?t(ba,{teamId:i,projectId:s,file:Y,onSaveField:(e,n)=>ee(Y.id,e,n),members:Ae,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:HC()})})]})]})}),t(qc,{children:M?.isActive?t("div",{className:E("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",le==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",M.itemCount," item",M.itemCount!==1?"s":""]})}):null})]})}
2
- export{qn};
@@ -1,2 +0,0 @@
1
- import{N,h,O,w,u,C,B,t,o,K,Z,U,ut,A,T,wr,L,ko,Me,be,Gr,pt,vt,Xt,ve,De,E,S,ge,Ga,Ae,ye,W,Qr,Gt,Qa,Va,Ka,py,ke,od,at,Nc,Oc,gr,id,rb,Ab,Ti,Lf,Ov,Oh,Dh,bl,Kh,tp,No,Oo,kd,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,H,ie,Pt,Mt,R,wo,vo,Vr,En,we,Ur,Hd}from"./chunk-7rhz2gze.js";import{ya,_a,ru,nu,fs,Zi,ou}from"./chunk-snhsjs4x.js";import{Or,ps,hs}from"./chunk-7kjgvxqa.js";import{Us}from"./chunk-77fmkpdz.js";var ct=[["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=T("pencil",ct);function ni({file:i,mediaControllerRef:a,onPlay:r,onPause:l,onTimeUpdate:D,annotations:c,startTime:I,shareId:v,allowDownload:y,children:m}){let b=fs(i),z=b.viewer;return t(z,{ref:a,file:i,onPlay:r,onPause:l,onTimeUpdate:D,annotations:c,startTime:I,shareId:v,allowDownload:y,children:m},b.id)}C();C();function Ge({teamId:i,projectId:a,file:r,onSaveField:l,members:D,onCommentSelect:c,hideAnnotationControl:I=!1,readOnly:v=!1,publicFields:y,isPublic:m=!1,shareId:b,currentTime:z,onTyping:te,selectedCommentId:f,heightPercent:_,onHeightPercentChange:Q}){let{canEdit:j}=Pt(a),{fields:p,setFields:J}=Or(),se=K(),{ref:re,inView:fe}=Mt(),[s,P]=u(null),[q,ne]=u(!1),[Ne,Ee]=u(null),G=w(!1),ze=w(0),Y=w(_),je=(e)=>{G.current=!0,ze.current=e.clientY,Y.current=_,e.target.setPointerCapture?.(e.pointerId)},Pe=N((e)=>{if(!G.current)return;let k=(ze.current-e.clientY)/window.innerHeight*100,oe=Math.min(85,Math.max(10,Y.current+k));Q(oe)},[Q]),Te=(e)=>{G.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:ee}=Z({queryKey:["fields",a],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:a}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!a&&!y}),M=fs(r);h(()=>{if(y)J(y,a);else if(ee)J(ee,a)},[ee,y,a,J]);let{data:he,fetchNextPage:X,hasNextPage:Ie}=ut({queryKey:m?["shares",b,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(m){let d=localStorage.getItem(`share_pwd_${b}`)||"",k=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:b,fileId:r.id},query:{after:e}},{headers:{"x-share-password":d}});if(!k.ok)throw Error("Failed to fetch comments");return await k.json()}else{let d=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!d.ok)throw Error("Failed to fetch comments");return await d.json()}},enabled:!!r?.id&&(!m||!!b),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Fe}=U({mutationFn:async({text:e,attachmentIds:d,annotations:k,replyToId:oe,guestUserId:xe,second:Ce})=>{if(m){let le=localStorage.getItem(`share_pwd_${b}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:b,fileId:r.id},json:{message:e,attachmentIds:d,replyToId:oe??void 0,annotations:k,second:Ce??void 0}},{headers:{"x-share-password":le,...xe?{"x-guest-user-id":xe}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let le=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:d,replyToId:oe??void 0,annotations:k,second:Ce??void 0}});if(!le.ok)throw Error("Failed to create comment");return await le.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:m?["shares",b,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{R.error(Ab?.()||"Failed to post comment")}}),Se=he?.pages?.[0]?.pageInfo?.total??he?.pages.reduce((e,d)=>e+(d.data?.length||0),0)??0;h(()=>{if(fe&&Ie)X()},[fe,X,Ie]);let V=O(()=>(r?.fieldValues||[]).reduce((e,d)=>(e[d.fieldId]=d,e),{}),[r?.fieldValues]),ae=O(()=>[...p].sort((e,d)=>{let k=e.config?.name?.toLowerCase()||"",oe=d.config?.name?.toLowerCase()||"";if(k<oe)return-1;if(k>oe)return 1;return 0}),[p]),Ve=he?.pages.flatMap((e)=>e.data??[])??[],_e=(e,d,k=[],oe,xe)=>{if(!e.trim()&&d.length===0&&k.length===0)return;let Ce=oe||s?.id||null;if(m){let le=localStorage.getItem(`guest_user_id_${b}`);if(!le)Ee({text:e,attachmentIds:d,annotations:k,replyToId:Ce,second:xe}),ne(!0);else Fe({text:e,attachmentIds:d,annotations:k,replyToId:Ce,guestUserId:le,second:xe})}else Fe({text:e,attachmentIds:d,annotations:k,replyToId:Ce,second:xe});P(null)},Oe=(e)=>{if(Ne)Fe({...Ne,guestUserId:e}),Ee(null),P(null)},Re=(e)=>{let d=D.find((k)=>k.id===e);if(d)return d;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=_<=15;return o("div",{style:{height:`${_}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:Pe,onPointerUp:Te,onPointerCancel:Te,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(wo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(vo,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Vr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[od()," ",Se>0&&`(${Se})`]}),t(Vr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Ti()})]}),o(En,{value:"comments",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"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:[py?.()||"All comments",Se>0?` (${Se})`:""]})}),t(ie,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Ve.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Dh()}):o("div",{className:"space-y-3",children:[Ve.map((e)=>o("div",{children:[t(Zi,{teamId:i,message:e,getUser:Re,onReply:P,hasReplies:!!e.replies?.length,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===e.id,onSelect:()=>{c?.(e)}}),e.replies?.map((d,k)=>t("div",{children:t(Zi,{teamId:i,isReply:!0,message:d,getUser:Re,onReply:P,hasReplies:!1,isLastReply:k===(e.replies?.length??0)-1,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===d.id,onSelect:()=>{c?.(d)}})},d.id))]},e.id)),t("div",{ref:re})]})}),(!v||m)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(ou,{isOpen:q,onClose:()=>ne(!1),onSuccess:Oe,children:t(Us,{projectId:a,onSendMessage:_e,replyingTo:s,onCancelReply:()=>P(null),hideAnnotationControl:I,disableMentions:m,currentTime:M?.commentsConfig?.hasTimestamp?z:void 0,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:te})})})]}),t(En,{value:"fields",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:t(ie,{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(hs,{fieldId:e.id,config:e.config,value:V[e.id]?.value,onSave:j?(d)=>l(e.id,d):void 0,readOnly:v||e.readOnly||!j})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function Ye({fileName:i,folderName:a,version:r,versions:l,activeFileId:D,isPublic:c=!1,shareId:I,allowDownload:v=!0,downloadInfo:y,canEdit:m=!1,onBack:b,onPrevFile:z,onNextFile:te,hasPrevFile:f=!1,hasNextFile:_=!1,onSelectVersion:Q,onRename:j,onDelete:p,onLinkedTasks:J,linkedTaskCount:se=0}){let re=async(s)=>{try{let P=c&&I?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:I,fileId:D},json:{key:s}}):await A.api.files["download-url"].$post({json:{key:s,assetId:D}});if(!P.ok)return;let{url:q}=await P.json(),ne=document.createElement("a");ne.href=q,ne.download="",document.body.appendChild(ne),ne.click(),document.body.removeChild(ne)}catch{}},fe=(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:b,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":tp(),children:t(Gr,{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:[a&&o(B,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:a}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),l&&l.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:i}),r!==void 0&&o(we,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(be,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(ye,{align:"center",className:"w-48 z-40",children:[t(Qr,{className:"text-xs",children:kd()}),l.map((s)=>o(W,{onClick:()=>Q?.(s.id),className:E("flex items-center justify-between text-xs cursor-pointer",s.id===D?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",s.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:s.name||i})]},s.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:i}),r!==void 0&&o(we,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(f||_)&&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:!f,onClick:z,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Kh(),"aria-label":Kh(),children:t(Gr,{className:"h-3.5 w-3.5"})}),t(S,{variant:"ghost",size:"icon",disabled:!_,onClick:te,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Oh(),"aria-label":Oh(),children:t(pt,{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":Ov(),children:t(wr,{className:"h-4 w-4"})})}),o(ye,{align:"end",className:"w-52 z-40",children:[v&&(fe?o(Qa,{children:[o(Va,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]}),t(Ga,{children:o(Ka,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:gr()}),y?.videoTranscodes?.map((s)=>{let P=Math.max(s.width,s.height),q=`${s.height}p`;if(P>=3840)q="2160p";else if(P>=1920)q="1080p";else if(P>=1280)q="720p";else if(P>=960)q="540p";else if(P>=640)q="360p";else if(P>=320)q="180p";return o(W,{onClick:()=>re(s.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:q}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},q)}),y?.originalKey&&o(B,{children:[t(Gt,{}),o(W,{onClick:()=>re(y.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:bl?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:i.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(W,{onClick:()=>y?.originalKey&&re(y.originalKey),disabled:!y?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]})),l&&l.length>1&&Q&&o(Qa,{children:[t(Va,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:kd?.()||"Switch version"})}),t(Ga,{children:o(Ka,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:kd?.()||"Switch version"}),l.map((s)=>o(W,{onClick:()=>Q(s.id),className:E("flex items-center justify-between text-xs cursor-pointer",s.id===D?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",s.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:s.name||i})]},s.id))]})})]}),J&&o(W,{onClick:J,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(ko,{className:"h-3.5 w-3.5"}),t("span",{children:Lf?.()||"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})]}),m&&j&&o(W,{onClick:j,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Qe,{className:"h-3.5 w-3.5"}),t("span",{children:No()})]}),m&&p&&o(B,{children:[t(Gt,{}),o(W,{onClick:p,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(ve,{className:"h-3.5 w-3.5"}),t("span",{children:at()})]})]})]})]})})]})}function Nl({projectId:i,teamId:a="",fileId:r,file:l,projectInfo:D,ancestorFolders:c=[],versions:I,activeFileId:v,startTime:y,isPublic:m=!1,shareId:b,allowDownload:z=!0,publicFields:te,siblingFiles:f=[],onNavigateToFile:_,onNavigateBack:Q,onRenameFile:j,onDeleteFile:p,onSaveField:J,onSelectVersion:se}){let{canEdit:re}=Pt(i),{members:fe}=Ur(),s=w(null),[P,q]=u(50),[ne,Ne]=u([]),[Ee,G]=u(0),[ze,Y]=u(null),[je,Pe]=u(!1),[Te,ee]=u(""),M=w(null),[he,X]=u(!1),[Ie,Fe]=u(!1),[Se,V]=u(!1),[ae,Ve]=u(!1),{data:_e}=Z({queryKey:["teams",a,"kanban","assets",v,"tasks"],queryFn:async()=>{if(!a||!v||m)return{data:[],total:0};let x=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:a,assetId:v}});if(!x.ok)return{data:[],total:0};return await x.json()},enabled:!!a&&!!v&&!m}),Oe=_e?.total??_e?.data?.length??0,{prevFile:Re,nextFile:Le}=O(()=>{if(!f||f.length===0)return{prevFile:null,nextFile:null};let x=f.findIndex((ce)=>ce.id===r||ce.id===v);if(x===-1)return{prevFile:null,nextFile:null};return{prevFile:x>0?f[x-1]:null,nextFile:x<f.length-1?f[x+1]:null}},[f,r,v]),e=c.length>0?c[0]?.name:D?.name,k=I?.find((x)=>x.id===v)?.version??(I&&I.length>0?I.length:void 0),oe=O(()=>({originalKey:l.media?.original?.key,videoTranscodes:l.media?.videoTranscodes?.map((x)=>({key:x.key,width:x.width,height:x.height}))}),[l.media]),xe=()=>{Ne([]),Y(null)},Ce=(x)=>{Y(x.id||null);let ce=x.annotations;if(ce&&ce.length>0)Ne(ce);else Ne([]);if(x.second!==null&&x.second!==void 0)s.current?.seekTo(x.second),s.current?.pause();else if(ce&&ce.length>0)s.current?.pause()},le=async(x)=>{if(x?.preventDefault(),!Te.trim()||!j)return;try{Fe(!0),await j(Te.trim()),Pe(!1)}finally{Fe(!1)}},Be=async()=>{if(!p)return;try{X(!0),await p(),V(!1)}finally{X(!1)}};return h(()=>{G(0),Y(null),Ne([])},[l?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(Ye,{fileName:l.name,folderName:e,version:k,versions:I,activeFileId:v,isPublic:m,shareId:b,allowDownload:z,downloadInfo:oe,canEdit:re,onBack:Q,hasPrevFile:!!Re,hasNextFile:!!Le,onPrevFile:()=>Re&&_(Re.id),onNextFile:()=>Le&&_(Le.id),onSelectVersion:se,onRename:()=>{ee(l.name),Pe(!0)},onDelete:()=>V(!0),onLinkedTasks:!m?()=>Ve(!0):void 0,linkedTaskCount:Oe}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ni,{file:l,mediaControllerRef:s,onPlay:xe,onTimeUpdate:G,annotations:ne,startTime:y,shareId:b,allowDownload:z})}),t(Ge,{teamId:a,projectId:i,file:l,onSaveField:J,members:fe,onCommentSelect:Ce,hideAnnotationControl:l.proxyType==="audio",readOnly:m||!re,publicFields:te,isPublic:m,shareId:b,currentTime:Ee,onTyping:()=>s.current?.pause(),selectedCommentId:ze,heightPercent:P,onHeightPercentChange:q}),!m&&ae&&t(Hd,{teamId:a,assetId:v,assetName:l.name,isOpen:ae,onClose:()=>Ve(!1)}),!m&&t(pe,{open:je,onOpenChange:Pe,children:t(ue,{children:o("form",{onSubmit:le,children:[t(me,{children:t(de,{children:No()})}),t("div",{className:"py-4",children:t(H,{ref:M,value:Te,onChange:(x)=>ee(x.target.value),placeholder:id?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(M.current)ps(M.current)},0)},autoFocus:!0})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>Pe(!1),children:ke()}),o(S,{type:"submit",disabled:Ie||!Te.trim(),children:[Ie&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),Oo()]})]})]})})}),!m&&t(Je,{open:Se,onOpenChange:V,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc?.()||"Delete Asset?"}),t(nt,{children:Nc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:ke()}),o(ot,{onClick:Be,disabled:he,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[he&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),at()]})]})]})})]})}C();function We({activeState:i,activeAsset:a,previewUrl:r,isFullScreen:l,onTogglePlay:D,onToggleLoop:c,onSeek:I,onVolumeChange:v,onToggleMute:y,onChangePlaybackRate:m,onChangeResolution:b,onZoomIn:z,onZoomOut:te,onFit:f,onDownload:_,onToggleFullScreen:Q,allowDownload:j=!0}){if(i?.kind==="video"&&i.video&&a){let p=i.video,J=p.totalFrames/p.frameRate,se=p.currentFrame/p.frameRate,re={isPlaying:p.isPlaying,progress:J>0?se/J*100:0,currentTime:se,duration:J,volume:p.volume,isMuted:p.isMuted,isLooping:p.isLooping,playbackRate:p.playbackRate,isFullScreen:l,showFrames:!1,currentResolution:p.currentResolution},fe=r&&!a.media?.videoPreview?{...a,media:{...a.media,videoPreview:{url:r}}}:a;return t(ru,{state:re,zoom:i.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:p.buffered,data:fe,resolutions:p.resolutions,togglePlay:D,toggleLoop:c,toggleMute:y,handleVolumeChange:v,changePlaybackRate:m,changeResolution:(s)=>b(s.resolution),handleDownload:(s)=>_(s),toggleFullScreen:Q,onZoomChange:(s)=>s>=i.zoom?z():te(),onZoomReset:f,frameRate:p.frameRate,totalFrames:p.totalFrames,currentFrame:p.currentFrame,seekToFrame:I,allowDownload:j})}if(i?.kind==="image")return t(nu,{zoom:i.zoom,onZoomIn:z,onZoomOut:te,onFit:f,onDownload:()=>_(),canDownload:!!a?.media?.original?.key,fullscreen:{isFullScreen:l,onToggle:Q},allowDownload:j});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:l?t(_a,{className:"h-5 w-5"}):t(ya,{className:"h-5 w-5"})})})}function Ke({side:i,fileName:a,version:r,activeVersionId:l,versions:D,isActive:c,onActivate:I,onSwitchVersion:v,onExit:y}){let m=E("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",c?"text-foreground":"text-muted-foreground hover:text-foreground"),b=t("button",{onClick:y,title:rb(),className:m,children:t(De,{className:"h-4 w-4"})}),z=o("button",{onClick:I,className:E("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",c?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:a}),r!==void 0&&o("span",{className:E("flex-shrink-0 rounded border px-1 py-0 text-xs",c?"border-foreground/40":"border-border"),children:["v",r]})]}),te=o(ge,{children:[t(Ae,{onClick:I,title:kd(),className:m,children:t(be,{className:"h-4 w-4"})}),t(ye,{align:i==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:D.map((f)=>{let _=f.id===l;return o(W,{onClick:()=>v(f.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",f.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:f.previewUrl?t("img",{src:f.previewUrl,alt:f.name||void 0,className:"h-full w-full object-cover"}):t(Xt,{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:f.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:f.creator?.name||"Unknown"})]}),_&&t(Me,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},f.id)})})})]});return t("div",{onMouseDown:I,className:E("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",c?"border-b-2 border-primary":"border-border"),children:i==="left"?o(B,{children:[b,z,te]}):o(B,{children:[z,te,t("div",{className:"ml-auto"}),b]})})}function it(i,a,r){return Z({queryKey:a?["public-share-file",r,i,localStorage.getItem(`share_pwd_${r}`)||""]:["files",i],queryFn:async()=>{if(a){let D=localStorage.getItem(`share_pwd_${r}`)||"",c=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:i}},{headers:{"x-share-password":D}});if(!c.ok)throw Error("Failed to fetch version asset");return await c.json()}let l=await A.api.files[":fileId"].$get({param:{fileId:i}});if(!l.ok)throw Error("Failed to fetch version asset");return await l.json()},enabled:!!i&&(!a||!!r)})}function Ol({isPublic:i=!1,shareId:a,versions:r,leftId:l,rightId:D,activeSide:c,annotations:I,seekRequest:v,onActiveSideChange:y,onSwitchVersion:m,onExit:b,onActiveAssetChange:z,onPlay:te,onTimeUpdate:f,allowDownload:_=!0}){let Q=w(null),j=w(null),p=w(null),[J,se]=u(null),[re,fe]=u(null),[s,P]=u(1),[q,ne]=u(!1),[Ne,Ee]=u(!1),{data:G,isLoading:ze}=it(l,i,a),{data:Y,isLoading:je}=it(D,i,a),Pe=fs(G),Te=fs(Y),ee=!!G&&!!Y&&Pe.id===Te.id,M=c==="left"?G:Y,he=c==="left"?J:re,X=N(()=>c==="left"?j.current:p.current,[c]),Ie=N(()=>c==="left"?p.current:j.current,[c]);h(()=>{z(M??null)},[M,z]),h(()=>{if(!v)return;let n=X();if(n?.seekToSecond(v.second),n?.pause(),ee){let g=Ie();g?.seekToSecond(v.second),g?.pause()}},[v?.nonce]),h(()=>{let n=()=>Ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Fe=N((n)=>se(n),[]),Se=N((n)=>fe(n),[]),V=N((n)=>{let g=X();if(g)n(g);if(ee){let F=Ie();if(F)n(F)}},[X,Ie,ee]),ae=N(()=>{let n=!he?.video?.isPlaying;V((g)=>n?g.play():g.pause())},[he?.video?.isPlaying,V]);h(()=>{let n=(g)=>{let F=document.activeElement;if(F&&(F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F instanceof HTMLElement&&F.isContentEditable))return;let He=g.key===" ",Ue=F&&(F.tagName==="BUTTON"||F.tagName==="A"||F.tagName==="SELECT"||F.tagName==="OPTION"||F.getAttribute("role")==="button"||F.getAttribute("role")==="link"||F.getAttribute("role")==="checkbox"||F.getAttribute("role")==="radio"||F.getAttribute("role")==="menuitem");if(He&&Ue)return;if(g.key===" "||g.key.toLowerCase()==="k")g.preventDefault(),ae()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[ae]);let Ve=N((n)=>V((g)=>g.seekToFrame(n)),[V]),_e=N(()=>X()?.toggleLoop(),[X]),Oe=N((n)=>{P(n),ne(n===0)},[]),Re=N(()=>ne((n)=>!n),[]),Le=N((n)=>V((g)=>g.setPlaybackRate(n)),[V]),e=N((n)=>X()?.changeResolution(n),[X]),d=N(()=>V((n)=>n.zoomBy(1.2)),[V]),k=N(()=>V((n)=>n.zoomBy(0.8)),[V]),oe=N(()=>V((n)=>n.fit()),[V]),xe=N((n)=>{X()?.download(n)},[X]),Ce=N(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),le=N((n,g)=>{if(ee)p.current?.panBy(n,g)},[ee]),Be=N((n,g)=>{if(ee)j.current?.panBy(n,g)},[ee]),x=N(()=>ae(),[ae]),ce=N((n)=>r.find((g)=>g.id===n)?.version,[r]),lt=O(()=>M?.media?.videoPreview?.url,[M?.media?.videoPreview?.url]),Ze=(n,g)=>{let He=fs(g)?.comparePane;if(!He)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 Ue=c===n;return t(He,{ref:n==="left"?j:p,file:g,shareId:a,isActive:Ue,annotations:Ue?I:[],onStateChange:n==="left"?Fe:Se,onUserPan:n==="left"?le:Be,onActivate:()=>y(n),muted:Ue?q:!0,volume:s,onPlay:te,onTimeUpdate:f,onRequestTogglePlay:x},g.id)},dt=!!G&&!!Y,mt=ze||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:[G&&t(Ke,{side:"left",fileName:G.name,version:ce(l),activeVersionId:l,versions:r,isActive:c==="left",onActivate:()=>y("left"),onSwitchVersion:(n)=>m("left",n),onExit:b}),t("div",{className:"relative flex min-h-0 flex-1",children:G?Ze("left",G):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[Y&&t(Ke,{side:"right",fileName:Y.name,version:ce(D),activeVersionId:D,versions:r,isActive:c==="right",onActivate:()=>y("right"),onSwitchVersion:(n)=>m("right",n),onExit:b}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Ze("right",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),mt&&!dt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(L,{className:"h-8 w-8 animate-spin text-foreground"})}),t(We,{activeState:he,activeAsset:M??null,previewUrl:lt,isFullScreen:Ne,onTogglePlay:ae,onToggleLoop:_e,onSeek:Ve,onVolumeChange:Oe,onToggleMute:Re,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:d,onZoomOut:k,onFit:oe,onDownload:xe,onToggleFullScreen:Ce,allowDownload:_})]})}
2
- export{ni,Nl,Ol};
@@ -1 +0,0 @@
1
- import{N,h,O,w,u,C,B,t,o,K,Z,U,ut,Fe,A,T,L,Me,Gr,pt,Yn,Jn,Po,fe,ve,De,S,ge,Ae,ye,W,Qr,Gt,df,pm,pf,yy,_y,Ey,mf,ke,m0,Wa,R0,N0,Qm,at,xf,B_,W_,oh,nb,ab,ib,lb,cb,ub,Ii,ca,Dc,Mf,Ti,Db,qb,aw,pw,hw,Rw,Pw,Nw,pd,Dv,bx,vx,Mx,kx,Jf,Hh,Xf,fS,pS,vl,_C,MC,Oo,NC,jC,$C,Ig,Rg,Bc,xl,bp,wp,vp,Sl,Uc,Fc,xp,Sp,zc,oI,sI,aI,iI,lI,cn,Np,ZI,BI,Op,Gg,$I,GI,QI,VI,KI,pe,ue,me,$e,de,H,ie,it,kr,un,jn,qc,R,Ar,en,V,qe,Le,Ze,Be,Ue,ne,ma,Qt,Lo,_t,$p}from"./chunk-7rhz2gze.js";import{Bi,Bs}from"./chunk-7kjgvxqa.js";import{Wc,Aa}from"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-rssgmj7x.js";import{Sr}from"./chunk-0qaq0sp8.js";import{oi,Dl}from"./chunk-7pw1550a.js";import{ri}from"./chunk-3ttrhqy3.js";import{kl}from"./chunk-kswvyqq1.js";import{Pl}from"./chunk-453ykvaw.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import{zl}from"./chunk-yfnem6se.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import{so}from"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import{ao}from"./chunk-rq0n0vcc.js";import{Rr}from"./chunk-0zv3bks2.js";C();var Ct=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],lt=T("folder-open",Ct);var It=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],dt=T("list-filter",It);var Ft=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],ct=T("palette",Ft);C();function Dt({ratio:a}){switch(a){case"16:9":return t("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"});case"9:16":return t("span",{className:"inline-block w-2.5 h-4 border border-current rounded-[1px] shrink-0"});case"4:3":return t("span",{className:"inline-block w-3.5 h-2.5 border border-current rounded-[1px] shrink-0"});case"3:4":return t("span",{className:"inline-block w-2.5 h-3.5 border border-current rounded-[1px] shrink-0"});case"1:1":return t("span",{className:"inline-block w-3 h-3 border border-current rounded-[1px] shrink-0"});default:return t("span",{className:"inline-block w-4 h-2.5 border border-current rounded-[1px] shrink-0"})}}function rt(){return Math.random().toString(36).substring(2,9)}function mt(){return{id:rt(),type:"text",text:"CONFIDENTIAL",x:0.5,y:0.5,size:0.05,color:"#999999",opacity:0.5,rotation:-30}}function Mt(){return{id:rt(),type:"image",imageAssetKey:"",x:0.5,y:0.5,size:0.15,opacity:0.5,rotation:0}}var tt=[{id:"dark",label:"Dark Slate",bg:"#1e293b",dot:"#475569"},{id:"black",label:"Black",bg:"#000000",dot:"#404040"},{id:"gray",label:"Slate Gray",bg:"#64748b",dot:"#cbd5e1"},{id:"white",label:"White",bg:"#ffffff",dot:"#94a3b8"},{id:"green",label:"Chroma Green",bg:"#059669",dot:"#047857"}],Bt={"16:9":1.7777777777777777,"9:16":0.5625,"4:3":1.3333333333333333,"3:4":0.75,"1:1":1};function gt({open:a,onOpenChange:b,initialConfig:g,shareId:p,teamId:k,onSaveSuccess:x}){let P=K(),[d,v]=u([]),[c,f]=u(null),[j,z]=u(null),[_,he]=u("16:9"),[Ne,Se]=u("grid"),[Ce,X]=u(!1),[we,oe]=u("new"),[ce,Y]=u(""),[J,ee]=u(null),I=w(null),te=w(null),[ae,Ie]=u({w:0,h:0}),[F,q]=u(!1),s=N((e)=>{if(te.current=e,!e)return;let l=()=>{let{clientWidth:M,clientHeight:y}=e;if(M<=0||y<=0)return;let E=Bt[_],et=M,We=et/E;if(We>y)We=y,et=We*E;Ie({w:Math.round(et),h:Math.round(We)})};l();let n=new ResizeObserver(l);return n.observe(e),()=>{n.disconnect(),te.current=null}},[_]),G=it((e)=>e.teamId),_e=k||G,[Oe,Te]=u(!1),[re,je]=u({}),le=w(null),Pe=A.api.teams[":teamId"].files.$post,xe=async(e,l)=>{let n=e.target.files?.[0];if(!n)return;if(n.size>1048576){if(R.error(Db()),le.current)le.current.value="";return}if(!_e){R.error(Dc());return}Te(!0);let M=URL.createObjectURL(n);je((y)=>({...y,[l]:M}));try{let y=await Pe({param:{teamId:_e},form:{file:n}});if(!y.ok)throw Error(Dc());let E=await y.json();D(l,{imageAssetKey:E.key,imageAssetUrl:E.url})}catch(y){let E=y instanceof Error?y.message:Dc();R.error(E)}finally{if(Te(!1),le.current)le.current.value=""}};h(()=>{if(a){if(g?.blocks&&g.blocks.length>0)v(g.blocks),f(g.blocks[0].id);else{let e=mt();v([e]),f(e.id)}z(null)}},[a,g]);let{data:se=[]}=Z({queryKey:["watermark-templates",k],queryFn:async()=>{let e=await A.api["watermark-templates"].$get({query:k?{teamId:k}:{}});if(!e.ok)return[];return await e.json()},enabled:a}),Ke=A.api.shares[":shareId"].watermark.$put,{mutate:Qe,isPending:Ve}=U({mutationFn:async(e)=>{let l=await Ke({param:{shareId:p},json:{enabled:!0,config:e}});if(!l.ok){let n=await l.json().catch(()=>null);throw Error(n?.error||ca())}return await l.json()},onSuccess:()=>{P.invalidateQueries({queryKey:["share",p]}),P.invalidateQueries({queryKey:["shares"]}),R.success(KI()),b(!1),x?.()},onError:(e)=>{R.error(e.message||ca())}}),He=A.api["watermark-templates"].$post,{mutate:Ge,isPending:Ee}=U({mutationFn:async({name:e,config:l})=>{let n=await He({json:{name:e,teamId:k||void 0,config:l}});if(!n.ok)throw Error(ca());return await n.json()},onSuccess:(e)=>{P.invalidateQueries({queryKey:["watermark-templates"]}),z(e.id),X(!1),R.success(aI())},onError:()=>{R.error(ca())}}),Xe=A.api["watermark-templates"][":templateId"].$put,{mutate:r,isPending:m}=U({mutationFn:async({templateId:e,config:l})=>{let n=await Xe({param:{templateId:e},json:{config:l}});if(!n.ok)throw Error(ca());return await n.json()},onSuccess:()=>{P.invalidateQueries({queryKey:["watermark-templates"]}),X(!1),R.success(iI())},onError:()=>{R.error(ca())}}),Q=A.api["watermark-templates"][":templateId"].$delete,{mutate:ht}=U({mutationFn:async(e)=>{if(!(await Q({param:{templateId:e}})).ok)throw Error(Ii())},onSuccess:(e,l)=>{if(P.invalidateQueries({queryKey:["watermark-templates"]}),j===l)z(null);R.success(oI())},onError:()=>{R.error(Ii())}}),be=d.findIndex((e)=>e.id===c),i=be>=0?d[be]:null,ot=()=>{let e=mt();v((l)=>[...l,e]),f(e.id)},vt=()=>{let e=Mt();v((l)=>[...l,e]),f(e.id)},nt=(e)=>{if(!e)return;v((l)=>{let n=l.filter((M)=>M.id!==e);if(c===e)f(n.length>0?n[Math.max(0,be-1)].id:null);return n})},D=(e,l)=>{v((n)=>n.map((M)=>M.id===e?{...M,...l}:M))},wt=()=>{if(d.length===0)return;let e=(be-1+d.length)%d.length;f(d[e].id)},yt=()=>{if(d.length===0)return;let e=(be+1)%d.length;f(d[e].id)},bt=(e,l)=>{e.stopPropagation(),f(l),q(!0)},Ye=N((e)=>{if(!F||!c||!I.current)return;let l=I.current.getBoundingClientRect(),n=(e.clientX-l.left)/l.width,M=(e.clientY-l.top)/l.height,y=Math.max(0,Math.min(1,Math.round(n*100)/100)),E=Math.max(0,Math.min(1,Math.round(M*100)/100));D(c,{x:y,y:E})},[F,c]),Je=N(()=>{q(!1)},[]);h(()=>{if(F)window.addEventListener("mousemove",Ye),window.addEventListener("mouseup",Je);return()=>{window.removeEventListener("mousemove",Ye),window.removeEventListener("mouseup",Je)}},[F,Ye,Je]),h(()=>{let e=(l)=>{if(!a||!c)return;let n=l.target?.tagName?.toLowerCase();if(n==="input"||n==="textarea"||n==="select")return;if(l.key==="Delete"||l.key==="Backspace")l.preventDefault(),nt(c)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,c,be]);let Nt=(e)=>{if(e.config?.blocks&&e.config.blocks.length>0){let l=e.config.blocks.map((n)=>({...n,id:rt()}));v(l),f(l[0].id),z(e.id)}},kt=()=>{if(d.length===0){R.error(vx());return}Qe({blocks:d})},St=()=>{if(we==="new"){if(!ce.trim()){R.error(oh());return}Ge({name:ce.trim(),config:{blocks:d}})}else{let e=J||j;if(!e){R.error(Ig());return}r({templateId:e,config:{blocks:d}})}};return o(B,{children:[t(pe,{open:a,onOpenChange:b,children:o(ue,{showCloseButton:!1,className:"sm:max-w-[1400px] max-w-[95vw] w-[95vw] h-[88vh] flex flex-col p-0 gap-0 overflow-hidden",onPointerDownOutside:(e)=>e.preventDefault(),children:[o("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-card",children:[t("div",{className:"flex items-center gap-3",children:t(de,{className:"text-base font-semibold",children:GI()})}),o("div",{className:"flex items-center gap-2",children:[o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",size:"sm",className:"gap-2 text-xs",children:[t(lt,{className:"h-4 w-4 text-muted-foreground"}),QI()]})}),o(ye,{align:"end",className:"w-56",children:[t(Qr,{className:"text-xs font-semibold text-muted-foreground",children:Nw()}),se.length===0?t("div",{className:"px-2 py-1.5 text-xs text-muted-foreground italic",children:bx()}):se.map((e)=>o(W,{onClick:()=>Nt(e),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{className:"truncate flex-1",children:e.name}),j===e.id&&t(Me,{className:"h-3.5 w-3.5 text-primary ml-2 flex-shrink-0"}),t(S,{variant:"ghost",size:"icon",className:"h-5 w-5 hover:bg-destructive/10 hover:text-destructive ml-1",onClick:(l)=>{l.stopPropagation(),ht(e.id)},children:t(ve,{className:"h-3 w-3"})})]},e.id)),t(Gt,{}),o(W,{onClick:()=>{oe("new"),Y(""),X(!0)},className:"text-xs gap-2 cursor-pointer",children:[t(fe,{className:"h-3.5 w-3.5 text-primary"}),Qm()]}),se.length>0&&o(W,{onClick:()=>{oe("overwrite"),ee(j||se[0].id),X(!0)},className:"text-xs gap-2 cursor-pointer",children:[t(ri,{className:"h-3.5 w-3.5 text-muted-foreground"}),Hh()]})]})]}),t(S,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>b(!1),children:ke()}),o(S,{size:"sm",className:"text-xs bg-primary hover:bg-primary/90 text-primary-foreground gap-1.5",disabled:Ve,onClick:kt,children:[t(ri,{className:"h-3.5 w-3.5"}),NC()]})]})]}),o("div",{className:"flex-1 flex overflow-hidden",children:[o("div",{className:"w-[65%] flex flex-col p-4 bg-muted/20 border-r border-border overflow-hidden select-none",children:[o("div",{className:"flex items-center justify-between mb-3",children:[t("div",{className:"flex items-center gap-1 bg-muted/60 p-1 rounded-md border border-border/60",children:["16:9","9:16","4:3","3:4","1:1"].map((e)=>o(S,{variant:_===e?"secondary":"ghost",size:"sm",className:ze("h-7 px-2.5 text-xs gap-1.5 font-mono transition-all",_===e?"bg-background shadow-xs font-semibold text-foreground border border-border/50":"text-muted-foreground hover:text-foreground"),onClick:()=>he(e),children:[t(Dt,{ratio:e}),t("span",{children:e})]},e))}),t("div",{className:"flex items-center gap-1.5 bg-background border border-border/60 rounded-md p-1",children:tt.map((e)=>t("button",{type:"button",onClick:()=>Se(e.id),style:{backgroundColor:e.bg},className:ze("w-5 h-5 rounded-full border border-border/80 transition-all cursor-pointer relative",Ne===e.id?"ring-2 ring-primary ring-offset-1 scale-110":"hover:scale-105 opacity-80 hover:opacity-100"),title:e.label},e.id))})]}),t("div",{ref:s,className:"flex-1 flex items-center justify-center overflow-hidden",children:(()=>{let e=tt.find((n)=>n.id===Ne)||tt[0],l=ae.w>0&&ae.h>0;return t("div",{ref:I,onClick:()=>f(null),style:{backgroundColor:e.bg,backgroundImage:`radial-gradient(${e.dot} 1px, transparent 1px)`,backgroundSize:"16px 16px",...l?{width:ae.w,height:ae.h}:{}},className:ze("relative rounded-lg border border-border overflow-hidden shadow-inner transition-all",_==="16:9"&&"aspect-[16/9] w-full max-h-full",_==="9:16"&&"aspect-[9/16] h-full max-w-full",_==="4:3"&&"aspect-[4/3] w-full max-h-full",_==="3:4"&&"aspect-[3/4] h-full max-w-full",_==="1:1"&&"aspect-square h-full max-w-full"),children:d.map((n)=>{let M=n.id===c,y=n.size*(ae.w||640);return t("div",{onMouseDown:(E)=>bt(E,n.id),onClick:(E)=>{E.stopPropagation(),f(n.id)},style:{left:`${n.x*100}%`,top:`${n.y*100}%`,transform:`translate(-50%, -50%) rotate(${n.rotation}deg)`,opacity:n.opacity},className:ze("absolute cursor-move select-none transition-shadow rounded p-1.5 flex items-center justify-center",M?"ring-2 ring-primary ring-offset-2 ring-offset-background/80 bg-primary/10":"hover:ring-1 hover:ring-muted-foreground/50"),children:n.type==="text"?t("span",{style:{fontSize:`${y}px`,color:n.color,lineHeight:1,whiteSpace:"nowrap",fontWeight:700,textShadow:"0 1px 3px rgba(0,0,0,0.5)"},children:n.text||"Text"}):t("div",{style:{width:`${y}px`,height:`${y}px`},className:"bg-primary/20 border border-primary/40 rounded flex items-center justify-center p-1 overflow-hidden",children:re[n.id]||n.imageAssetUrl?t("img",{src:re[n.id]||n.imageAssetUrl,alt:"Watermark logo",className:"w-full h-full object-contain pointer-events-none"}):t(Yn,{className:"h-1/2 w-1/2 opacity-70 text-primary"})})},n.id)})})})()})]}),o("div",{className:"w-[35%] flex flex-col bg-card overflow-hidden border-l border-border",children:[t("div",{className:"p-4 border-b border-border bg-muted/10 flex items-center justify-between",children:o("div",{className:"flex items-center gap-2",children:[t(Jn,{className:"h-4 w-4 text-muted-foreground"}),t("span",{className:"text-xs font-semibold",children:Gg()})]})}),o("div",{className:"p-3 border-b border-border bg-background flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-1",children:[t(S,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:d.length<=1,onClick:wt,children:t(Gr,{className:"h-4 w-4"})}),o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs font-mono",children:d.length===0?"0 / 0":`${be+1} / ${d.length}`})}),t(ye,{align:"start",className:"w-48",children:d.map((e,l)=>o(W,{onClick:()=>f(e.id),className:"text-xs flex items-center justify-between cursor-pointer",children:[o("span",{className:"flex items-center gap-2 truncate",children:[e.type==="text"?t(Bi,{className:"h-3.5 w-3.5 text-muted-foreground"}):t(Yn,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.type==="text"?e.text||"Text":e.imageAssetKey||"Image"]}),o("span",{className:"text-[10px] font-mono text-muted-foreground ml-2",children:["#",l+1]})]},e.id))})]}),t(S,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:d.length<=1,onClick:yt,children:t(pt,{className:"h-4 w-4"})})]}),o("div",{className:"flex items-center gap-1",children:[i&&t(S,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10",title:at(),onClick:()=>nt(i.id),children:t(ve,{className:"h-4 w-4"})}),o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o(S,{size:"sm",className:"h-7 text-xs gap-1",children:[t(fe,{className:"h-3.5 w-3.5"}),df()]})}),o(ye,{align:"end",children:[o(W,{onClick:ot,className:"text-xs gap-2 cursor-pointer",children:[t(Bi,{className:"h-3.5 w-3.5"}),pf()]}),o(W,{onClick:vt,className:"text-xs gap-2 cursor-pointer",children:[t(Yn,{className:"h-3.5 w-3.5"}),pm()]})]})]})]})]}),t(ie,{className:"flex-1 min-h-0 p-4",children:i?o("div",{className:"space-y-5 text-xs",children:[o("div",{className:"flex items-center justify-between pb-2 border-b border-border",children:[o("span",{className:"font-semibold text-muted-foreground flex items-center gap-1.5",children:[i.type==="text"?t(Bi,{className:"h-4 w-4 text-primary"}):t(Yn,{className:"h-4 w-4 text-primary"}),i.type==="text"?pf():pm()]}),o("span",{className:"text-[10px] font-mono text-muted-foreground",children:["ID: ",i.id.slice(0,6)]})]}),i.type==="text"&&o("div",{className:"space-y-2",children:[t(V,{className:"text-xs",children:lI()}),t(H,{type:"text",value:i.text,onChange:(e)=>D(i.id,{text:e.target.value}),className:"text-xs h-8"})]}),i.type==="image"&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:pw()}),i.imageAssetKey&&o("button",{type:"button",onClick:()=>D(i.id,{imageAssetKey:"",imageAssetUrl:void 0}),className:"text-xs text-muted-foreground hover:text-destructive flex items-center gap-1 font-medium transition-colors cursor-pointer",children:[t(De,{className:"w-3.5 h-3.5"}),vl?vl():"Remove"]})]}),t("input",{type:"file",ref:le,className:"hidden",accept:"image/*",onChange:(e)=>xe(e,i.id)}),o("div",{onClick:()=>le.current?.click(),className:"relative aspect-square w-full rounded-xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 hover:border-primary/50 hover:bg-muted/40 transition-all p-2",children:[Oe&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(L,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold",children:Op()})]})}),re[i.id]||i.imageAssetUrl?o(B,{children:[t("img",{src:re[i.id]||i.imageAssetUrl,alt:"Uploaded logo preview",className:"max-w-full max-h-full object-contain transition-transform duration-300 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1 text-white z-10",children:[t(so,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Np()})]})]}):o("div",{className:"flex flex-col items-center gap-1.5 text-center p-3",children:[t("div",{className:"p-2 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(so,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:ZI()}),t("p",{className:"text-[10px] text-muted-foreground mt-0.5 max-w-[150px] mx-auto leading-normal",children:BI()})]})]})]})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:i.type==="text"?qb():hw()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.size*100),"%"]})]}),o("div",{className:"flex items-center gap-3",children:[t(Bs,{min:i.type==="text"?0.01:0.02,max:i.type==="text"?0.12:0.5,step:0.005,value:[i.size],onValueChange:([e])=>D(i.id,{size:e}),className:"flex-1"}),t(H,{type:"number",min:1,max:100,value:Math.round(i.size*100),onChange:(e)=>D(i.id,{size:Math.min(1,Math.max(0.001,Number(e.target.value)/100))}),className:"w-16 h-7 text-xs font-mono text-right"})]})]}),i.type==="text"&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:m0()}),t("span",{className:"font-mono text-[11px] text-muted-foreground uppercase",children:i.color})]}),o("div",{className:"flex items-center gap-2",children:[t("input",{type:"color",value:i.color,onChange:(e)=>D(i.id,{color:e.target.value}),className:"w-8 h-8 rounded border border-border cursor-pointer bg-transparent p-0"}),t(H,{type:"text",value:i.color,onChange:(e)=>D(i.id,{color:e.target.value}),className:"flex-1 h-8 text-xs font-mono"})]}),t("div",{className:"flex items-center gap-1.5 pt-1",children:["#FFFFFF","#000000","#999999","#EF4444","#3B82F6","#10B981","#F59E0B"].map((e)=>t("button",{type:"button",onClick:()=>D(i.id,{color:e}),style:{backgroundColor:e},className:"w-5 h-5 rounded-full border border-border hover:scale-110 transition-transform"},e))})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:Mx()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.opacity*100),"%"]})]}),t(Bs,{min:0,max:1,step:0.01,value:[i.opacity],onValueChange:([e])=>D(i.id,{opacity:e})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:MC()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[i.rotation,"°"]})]}),t(Bs,{min:-180,max:180,step:1,value:[i.rotation],onValueChange:([e])=>D(i.id,{rotation:e})}),t("div",{className:"flex items-center gap-1.5 pt-1",children:[-45,-30,0,30,45].map((e)=>o(S,{variant:"outline",size:"sm",className:"h-6 text-[10px] flex-1 px-1 font-mono",onClick:()=>D(i.id,{rotation:e}),children:[e,"°"]},e))})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:fS()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.x*100),"%"]})]}),t(Bs,{min:0,max:1,step:0.01,value:[i.x],onValueChange:([e])=>D(i.id,{x:e})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:pS()}),o("span",{className:"font-mono text-[11px] text-muted-foreground",children:[Math.round(i.y*100),"%"]})]}),t(Bs,{min:0,max:1,step:0.01,value:[i.y],onValueChange:([e])=>D(i.id,{y:e})})]})]}):o("div",{className:"py-12 text-center text-xs text-muted-foreground space-y-3",children:[t("p",{children:$C()}),o(S,{size:"sm",variant:"outline",onClick:ot,children:[t(fe,{className:"h-3.5 w-3.5 mr-1"}),pf()]})]})})]})]})]})}),t(pe,{open:Ce,onOpenChange:X,children:o(ue,{className:"max-w-md",children:[t(me,{children:t(de,{className:"text-sm font-semibold",children:we==="new"?Qm():Hh()})}),t("div",{className:"py-3 space-y-4 text-xs",children:we==="new"?o("div",{className:"space-y-2",children:[t(V,{children:sI()}),t(H,{type:"text",value:ce,onChange:(e)=>Y(e.target.value),placeholder:oh(),className:"text-xs"})]}):o("div",{className:"space-y-2",children:[t(V,{children:Ig()}),t("select",{value:J||"",onChange:(e)=>ee(e.target.value),className:"w-full h-9 rounded-md border border-input bg-background px-3 text-xs",children:se.map((e)=>t("option",{value:e.id,children:e.name},e.id))})]})}),o($e,{children:[t(S,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>X(!1),children:ke()}),t(S,{size:"sm",className:"text-xs",disabled:Ee||m,onClick:St,children:Wa()})]})]})})]})}function ze(...a){return a.filter(Boolean).join(" ")}C();function xt({shareLink:a,viewMode:b,onViewModeChange:g,defaultSortOrder:p,onSortOrderChange:k}){let x=K(),[P,d]=u(a.password||""),[v,c]=u(a.expireAt?new Date(a.expireAt):void 0),[f,j]=u(!1);h(()=>{d(a.password||"")},[a.password]);let[z,_]=u(a.hasPassword),[he,Ne]=u(!!a.expireAt),{data:Se,refetch:Ce}=Z({queryKey:["share-watermark",a.id],queryFn:async()=>{let s=await A.api.shares[":shareId"].watermark.$get({param:{shareId:a.id}});if(!s.ok)return null;return await s.json()},refetchInterval:(s)=>(s.state.data?.watermarkStatus||a.watermarkStatus)==="processing"?3000:!1}),X=A.api.shares[":shareId"].watermark.$put,{mutate:we}=U({mutationFn:async()=>{let s=await X({param:{shareId:a.id},json:{enabled:!1}});if(!s.ok)throw Error(ca());return await s.json()},onSuccess:()=>{x.invalidateQueries({queryKey:["shares",a.projectId]}),x.invalidateQueries({queryKey:["share",a.id]}),x.invalidateQueries({queryKey:["share-watermark",a.id]}),R.success($I())}}),oe=Se?.watermarkStatus??a.watermarkStatus??(a.watermarkConfigId?"ready":"disabled"),ce=Se?.watermarkConfig?.config??a.watermarkConfig?.config??null,Y=ce!==null&&oe!=="disabled",{data:J}=Z({queryKey:["fields",a.projectId],queryFn:async()=>{let s=await A.api.projects[":projectId"].fields.$get({param:{projectId:a.projectId}});if(!s.ok)throw Error(ab());return await s.json()},enabled:!!a.projectId}),ee=A.api.shares[":shareId"].$put,{mutate:I}=U({mutationFn:async(s)=>{let G=await ee({param:{shareId:a.id},json:s});if(!G.ok)throw Error(ca());return await G.json()},onSuccess:()=>{x.invalidateQueries({queryKey:["shares",a.projectId]}),x.invalidateQueries({queryKey:["share",a.id]}),R.success(Rg())}}),te=`${window.location.origin}/share/${a.id}`,ae=async(s)=>{if(await ao(s))R.success(R0())},Ie=(s)=>{let G=a.fieldVisibility||{},_e={...G,[s]:!G[s]};I({fieldVisibility:_e})},F="index",q="asc";if(p){let s=p.split(":");F=s[0],q=s[1]||"asc"}return o("div",{className:"flex flex-col h-full bg-background border-l border-border",children:[t("div",{className:"flex-1 overflow-y-auto",children:o("div",{className:"p-4 space-y-6",children:[o("div",{className:"space-y-4",children:[o("div",{className:"flex items-center justify-between",children:[t("h3",{className:"text-sm font-medium",children:Rw()}),t(qe,{checked:!a.isDisabled,onCheckedChange:(s)=>I({isDisabled:!s})})]}),o("div",{className:"relative w-full",children:[t(H,{value:te,readOnly:!0,className:"pr-10 bg-muted/50 text-xs"}),t(S,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>ae(te),children:t(Rr,{className:"h-4 w-4"})})]})]}),o("div",{className:"space-y-1",children:[t(Re,{title:jC(),icon:t(zl,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-4 pt-2",children:[o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:Xf()}),t(qe,{checked:z,onCheckedChange:(s)=>{if(_(s),!s)I({password:null})}})]}),z&&o("div",{className:"flex gap-2 animate-in fade-in slide-in-from-top-1 duration-200",children:[t(H,{type:"text",value:P,onChange:(s)=>d(s.target.value),placeholder:W_(),className:"text-xs"}),t(S,{size:"sm",onClick:()=>I({password:P}),children:Oo()})]})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:nb()}),t(qe,{checked:he,onCheckedChange:(s)=>{if(Ne(s),!s)c(void 0),I({expireAt:null})}})]}),he&&t("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:t(ma,{value:v,onChange:(s)=>{c(s),I({expireAt:s?s.toISOString():null})},className:"text-xs"})})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:yy()}),t(qe,{checked:a.allowDownload,onCheckedChange:(s)=>I({allowDownload:s})})]}),t("p",{className:"text-xs text-muted-foreground",children:_y()})]}),o("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:Gg()}),t(qe,{checked:Y,disabled:oe==="processing",onCheckedChange:(s)=>{if(!s)we();else j(!0)}})]}),Y&&oe==="processing"&&o("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 font-medium py-1 animate-pulse",children:[t(L,{className:"h-3.5 w-3.5 animate-spin"}),t("span",{children:VI()})]}),Y&&oe!=="processing"&&t(S,{variant:"outline",size:"sm",className:"w-full text-xs gap-1.5 mt-1",onClick:()=>j(!0),children:B_()})]})]})}),t(Re,{title:Ey(),icon:t(ct,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-3 pt-2 flex gap-2",children:[o(S,{variant:b==="card"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>g("card"),children:[t(Jn,{className:"h-4 w-4"}),aw()]}),o(S,{variant:b==="list"?"secondary":"outline",size:"sm",className:"flex-1 gap-2 text-xs",onClick:()=>g("list"),children:[t(Po,{className:"h-4 w-4"}),Pw()]})]})}),t(Re,{title:Ti(),icon:t(dt,{className:"h-4 w-4"}),children:t("div",{className:"p-3 space-y-3 pt-2",children:J?.map((s)=>o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-xs",children:s.config?.name}),t(qe,{checked:a.fieldVisibility?.[s.id]??!1,onCheckedChange:()=>Ie(s.id)})]},s.id))})}),t(Re,{title:xl(),icon:t(Pl,{className:"h-4 w-4"}),children:o("div",{className:"p-3 space-y-4 pt-2",children:[o("div",{className:"space-y-2",children:[t(V,{className:"text-xs text-muted-foreground",children:Mf()}),o(Le,{value:F,onValueChange:(s)=>{if(s==="index")k(null);else k(`${s}:${q}`)},children:[t(Be,{className:"w-full text-xs h-9",children:t(Ze,{})}),o(Ue,{children:[t(ne,{value:"index",children:bp()}),t(ne,{value:"name",children:Sl()}),t(ne,{value:"createdAt",children:wp()}),t(ne,{value:"size",children:xp()})]})]})]}),o("div",{className:"space-y-2",children:[t(V,{className:"text-xs text-muted-foreground",children:Jf()}),o(S,{variant:"outline",className:"w-full justify-between font-normal text-xs h-9",disabled:F==="index",onClick:()=>{k(`${F}:${q==="asc"?"desc":"asc"}`)},children:[t("span",{children:F==="name"?q==="asc"?Bc():zc():F==="createdAt"?q==="asc"?Fc():Uc():F==="size"?q==="asc"?Sp():vp():q==="asc"?mf():xf()}),t(Wc,{className:"h-4 w-4 opacity-50"})]})]})]})})]})]})}),o("div",{className:"p-4 border-t border-border space-y-2",children:[o(S,{variant:"outline",className:"w-full justify-center",onClick:()=>window.open(te,"_blank"),children:[t(kl,{className:"h-4 w-4 mr-2"}),kx()]}),o(S,{className:"w-full justify-center bg-blue-600 hover:bg-blue-700 text-white",onClick:()=>ae(te),children:[t(Rr,{className:"h-4 w-4 mr-2"}),N0()]})]}),t(gt,{open:f,onOpenChange:j,initialConfig:ce,shareId:a.id,onSaveSuccess:()=>{Ce(),x.invalidateQueries({queryKey:["share",a.id]}),x.invalidateQueries({queryKey:["shares",a.projectId]})}})]})}function Re({title:a,icon:b,children:g}){let[p,k]=u(!1);return o("div",{className:"border-b border-border last:border-0",children:[o("button",{onClick:()=>k(!p),className:"w-full flex items-center justify-between py-3 px-2 hover:bg-muted/50 transition-colors",children:[o("div",{className:"flex items-center gap-3",children:[b,t("span",{className:"text-sm font-medium",children:a})]}),t(pt,{className:Pt("h-4 w-4 transition-transform",p&&"rotate-90")})]}),p&&g&&t("div",{className:"animate-in fade-in slide-in-from-top-1 duration-200",children:g})]})}function Pt(...a){return a.filter(Boolean).join(" ")}function st({teamId:a,projectId:b,projectName:g,shareId:p,rootFolderId:k}){let x=K(),{fetchMetadata:P}=Lo();h(()=>{if(a)P(a)},[a,P]);let{data:d}=Z({queryKey:["share",p],queryFn:async()=>{let r=await A.api.shares[":shareId"].$get({param:{shareId:p}});if(!r.ok)throw Error(cb());return await r.json()}}),v=d?.rootFolderId,[c,f]=u(null),[j,z]=u([]);h(()=>{if(v)f(v),z([]),xe(new Set)},[v,p]);let _=en((r)=>r.setProjectState),he=en((r)=>r.clearProjectState),Ne=(r)=>{if(r===c)return;if(r===v)f(v),z([]);else{let m=j.findIndex((Q)=>Q.id===r);if(m!==-1)f(r),z(j.slice(m+1))}xe(new Set)},[Se,Ce]=u(240),[X,we]=u(360),{shareConfigLeftSidebarCollapsed:oe,shareConfigRightSidebarCollapsed:ce}=Qt(),Y=d?.defaultSortOrder||null,J,ee;if(Y){let r=Y.split(":");J=r[0],ee=r[1]}let I=d?.viewMode??"card",{data:te,fetchNextPage:ae,hasNextPage:Ie,isFetchingNextPage:F,isLoading:q}=ut({queryKey:["folder-children",a,c,"folder",J,ee],queryFn:async({pageParam:r})=>{let m=await A.api.folders[":folderId"].children.$get({param:{folderId:c},query:{assetType:"folder",after:r,sort:J,order:ee}});if(!m.ok)throw Error(lb());return await m.json()},enabled:!!c,initialPageParam:"",getNextPageParam:(r)=>r.pageInfo?.cursor||void 0}),{data:s,fetchNextPage:G,hasNextPage:_e,isFetchingNextPage:Oe,isLoading:Te}=ut({queryKey:["folder-children",a,c,"file",J,ee],queryFn:async({pageParam:r})=>{let m=await A.api.folders[":folderId"].children.$get({param:{folderId:c},query:{assetType:"file",after:r,sort:J,order:ee}});if(!m.ok)throw Error(ib());return await m.json()},enabled:!!c,initialPageParam:"",getNextPageParam:(r)=>r.pageInfo?.cursor||void 0}),re=O(()=>te?.pages.flatMap((r)=>r.data??[])??[],[te]),je=O(()=>s?.pages.flatMap((r)=>r.data??[])??[],[s]);h(()=>{if(d)_({teamId:a,projectId:b,projectName:g,ancestorFolders:j,currentAsset:{name:c===v?d.name:re.find((r)=>r.id===c)?.name||d.name,type:"folder"},isRootFolder:!1,shareId:p,onFolderClick:Ne});return()=>he()},[a,b,g,j,c,v,d,p,re,_,he]);let le=()=>{xe(new Set)},[Pe,xe]=u(new Set),{dragState:se,handleDragStart:Ke,handleDragEnd:Qe}=Dl({teamId:a,projectId:b,assetId:c||"",folders:re,files:je,selectedIds:Pe,onClearSelection:le}),Ve=A.api.shares[":shareId"].assets[":assetId"].$delete,{mutate:He}=U({mutationFn:async(r)=>{if(!(await Ve({param:{shareId:p,assetId:r}})).ok)throw Error(ub())},onSuccess:()=>{x.invalidateQueries({queryKey:["folder-children",a,c]}),R.success(_C())}}),Ge=A.api.shares[":shareId"].$put,{mutate:Ee}=U({mutationFn:async(r)=>{let m=await Ge({param:{shareId:p},json:r});if(!m.ok)throw Error(ca());return await m.json()},onSuccess:()=>{x.invalidateQueries({queryKey:["share",p]}),R.success(Rg())}}),Xe=(r)=>{if(r.type==="folder"||r.targetType==="folder"){let m=c===v?d?.name||"":re.find((Q)=>Q.id===c)?.name||cn();z((Q)=>[{id:c,name:m},...Q]),f(r.id),xe(new Set)}};if(!d)return t("div",{children:pd()});return o(jn,{modifiers:[oi.configure({anchor:{x:0,y:0}})],sensors:[un.configure({activationConstraints:[new kr.Distance({value:10})]})],onDragStart:Ke,onDragEnd:Qe,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!oe&&o(B,{children:[t("div",{className:"bg-background",style:{width:Se},children:t(Ar,{teamId:a,projectId:b,projectName:g,rootFolderId:k,dragState:se})}),t(Sr,{onResize:(r)=>Ce((m)=>Math.max(180,Math.min(400,m+r)))})]}),t(Aa,{teamId:a,projectId:b,assetId:c||"",folders:re,files:je,selectedItem:null,selectedIds:Pe,onItemSelect:(r,m)=>{if(m.metaKey||m.ctrlKey){let Q=new Set(Pe);if(Q.has(r.id))Q.delete(r.id);else Q.add(r.id);xe(Q)}else xe(new Set([r.id]))},onItemDoubleClick:Xe,onSaveField:()=>{},displayStyle:I,onClearSelection:le,fetchNextFoldersPage:ae,hasNextFoldersPage:Ie,isFetchingNextFoldersPage:F,fetchNextFilesPage:G,hasNextFilesPage:_e,isFetchingNextFilesPage:Oe,isLoading:q||Te,filterConditions:[],onFilterChange:()=>{},dragState:se,isShareView:!0,onRemoveFromShare:(r)=>{r.forEach((m)=>He(m.id))},fieldVisibility:d.fieldVisibility}),!ce&&o(B,{children:[t(Sr,{onResize:(r)=>we((m)=>Math.max(240,Math.min(600,m-r)))}),t("div",{style:{width:X},className:"flex-shrink-0 h-full",children:t(xt,{shareLink:d,viewMode:I,onViewModeChange:(r)=>Ee({viewMode:r}),defaultSortOrder:Y,onSortOrderChange:(r)=>Ee({defaultSortOrder:r})})})]})]})}),t(qc,{children:se?.isActive?t("div",{className:"flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium shadow-md",children:Dv({count:se.itemCount})}):null})]})}C();function Tt(){let{projectId:a,shareId:b}=jt.useParams(),{teamId:g,ensureTeamIdForProject:p}=it();h(()=>{p(a)},[a,p]);let{data:k}=er($p(a)),x=k?.rootFolder,{data:P}=Z({queryKey:["folders",x],queryFn:async()=>{let d=await A.api.folders[":folderId"].$get({param:{folderId:x}});if(!d.ok)throw Error("Failed to fetch folder");return await d.json()},enabled:!!x});if(!g||!x||!P)return t(_t,{});return t(st,{teamId:g,projectId:a,projectName:k.name??"",shareId:b,rootFolderId:x})}var jt=Fe("/projects/$projectId/shares/$shareId")({component:Tt});export{jt as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jd,kn,nc,oc,sc,ac,mu,hu,em,nA,ys,zo,Fr}from"./chunk-nkdk229f.js";export{sc as EncryptJWT,oc as SignJWT,em as UnsecuredJWT,Jd as base64url,ac as calculateJwkThumbprint,mu as createLocalJWKSet,hu as createRemoteJWKSet,Fr as decodeJwt,zo as decodeProtectedHeader,ys as importJWK,nA as importPKCS8,nc as jwtDecrypt,kn as jwtVerify};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{yc,_c,Pu}from"./chunk-9ccw540k.js";export{yc as ENV_KEY,_c as ENV_SECRET,Pu as fromEnv};
@@ -1 +0,0 @@
1
- import{t,Fe}from"./chunk-7rhz2gze.js";import"./chunk-tm7f32c7.js";import"./chunk-7kjgvxqa.js";import"./chunk-gc5sbfa5.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-snhsjs4x.js";import"./chunk-77fmkpdz.js";import"./chunk-914bp49r.js";import"./chunk-f6svp4dp.js";import"./chunk-0qaq0sp8.js";import{ha}from"./chunk-vyzptrea.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";function a(){let{shareId:e}=s.useParams();return t(ha,{shareId:e})}var s=Fe("/share/$shareId/")({component:a});export{s as Route};
@@ -1,2 +0,0 @@
1
- import{t,o,E}from"./chunk-7rhz2gze.js";var Sa=(r)=>{if(isNaN(r))return"00:00";let e=new Date(r*1000),c=e.getUTCHours(),a=e.getUTCMinutes().toString().padStart(2,"0"),n=e.getUTCSeconds().toString().padStart(2,"0");if(c)return`${c}:${a}:${n}`;return`${a}:${n}`},In=(r,e,c,a)=>{if(c==="frames")return`${r} fr`;if(c==="standard")return Sa(r/e);let n=Math.round(e),d=e!==n,i=!1;if(d&&(n===30||n===60))i=!0;let l=0;if(a){let s=a.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(s){let f=parseInt(s[1],10),u=parseInt(s[2],10),S=parseInt(s[3],10),N=parseInt(s[5],10);if(i=s[4]!==":",l=(f*3600+u*60+S)*n+N,i){let h=f*60+u,C=e<30?2:4;l-=C*(h-Math.floor(h/10))}}}let m=r+l;if(i){let s=e<30?2:4,f=Math.floor(m/(17982*s/2)),u=m%(17982*s/2);if(u<s)u=u+s;m+=9*s*f+s*Math.floor((u-s)/(1798*s/2))}let p=m%n,g=Math.floor(m/n)%60,b=Math.floor(m/(n*60))%60,M=Math.floor(m/(n*3600))%24,x=i?";":":";return`${M.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}${x}${p.toString().padStart(2,"0")}`};var lu=(r,e)=>{if(!e)return 0;let c=1/e;return r*c+c/2},cu=(r)=>Math.max(100,3000/(r||30)),uu=({dbTotalFrames:r,containerDuration:e,frameRate:c})=>{let a=c||30,n=Math.round(e*a);if(r<=0)return n;let d=r/a,i=e-d,l=cu(a)/1000;return i>l?n:r};var ii=({progress:r,className:e})=>{let a=2*Math.PI*20,n=a-Math.min(100,Math.max(0,r))/100*a;return o("svg",{viewBox:"0 0 50 50",className:E("w-12 h-12",e),children:[t("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),t("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:a,strokeDashoffset:n,transform:"rotate(-90 25 25)"}),t("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(r)}%`})]})};
2
- export{ii,Sa,In,lu,cu,uu};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-97f2af6d.js";import{nf,sT}from"./chunk-4v41a1r9.js";export{nf as createKyselyAdapter,sT as kyselyAdapter};