@shumai-one/shumai 0.3.9 → 0.3.10

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 (171) hide show
  1. package/bin/{chunk-q3y6kdkh.js → chunk-02tqxzgz.js} +2 -2
  2. package/bin/chunk-09c03qdg.js +2 -0
  3. package/bin/{chunk-p65avrcv.js → chunk-0fpgfrv8.js} +2 -2
  4. package/bin/{chunk-fbqr4v70.js → chunk-0hbqkcsd.js} +1 -1
  5. package/bin/{chunk-zafjhkkk.js → chunk-0qcp4v52.js} +1 -1
  6. package/bin/chunk-0te5kcy3.js +2 -0
  7. package/bin/chunk-15zbprbe.js +1 -0
  8. package/bin/{chunk-ptmxkptc.js → chunk-1ev668rp.js} +2 -2
  9. package/bin/{chunk-z7m6sa7g.js → chunk-1qd83phd.js} +1 -1
  10. package/bin/{chunk-mwrheqe3.js → chunk-1whn0v5n.js} +1 -1
  11. package/bin/{chunk-s78r8f5v.js → chunk-28axgckk.js} +1 -1
  12. package/bin/{chunk-r0c9vmfm.js → chunk-2mxqjx3x.js} +1 -1
  13. package/bin/{chunk-x6ta6e2v.js → chunk-2sk6e4q0.js} +1 -1
  14. package/bin/{chunk-awaf0g5z.js → chunk-2sp0gkaw.js} +2 -2
  15. package/bin/{chunk-fhd9yadg.js → chunk-2t2wjzme.js} +2 -2
  16. package/bin/chunk-301pewt3.js +1 -0
  17. package/bin/chunk-33hax7fe.js +66 -0
  18. package/bin/{chunk-9fc118ea.js → chunk-34f4hk54.js} +2 -2
  19. package/bin/{chunk-331s5eb9.js → chunk-39s0cxq1.js} +2 -2
  20. package/bin/{chunk-c32x8x6z.js → chunk-41de755j.js} +1 -1
  21. package/bin/{chunk-naaa5ejw.js → chunk-42et2rqa.js} +2 -2
  22. package/bin/{chunk-pfwt5734.js → chunk-42f9r1sg.js} +2 -2
  23. package/bin/chunk-484yr1a7.js +1 -0
  24. package/bin/{chunk-jx9tqjh9.js → chunk-4shqnfq1.js} +1 -1
  25. package/bin/{chunk-h7jb1xb4.js → chunk-60xawsa6.js} +2 -2
  26. package/bin/chunk-62ag2nfa.js +2 -0
  27. package/bin/chunk-63emv4q3.js +1 -0
  28. package/bin/chunk-6529sh41.js +2 -0
  29. package/bin/{chunk-4yp5add5.js → chunk-661mcdxj.js} +2 -2
  30. package/bin/{chunk-n3997tqa.js → chunk-69sf7kb1.js} +1 -1
  31. package/bin/{chunk-0kfcfd0x.js → chunk-6gx6gdnk.js} +2 -2
  32. package/bin/chunk-6w395tfy.js +2 -0
  33. package/bin/chunk-7735r8d7.js +1 -0
  34. package/bin/{chunk-tx42kfdh.js → chunk-7m07t899.js} +1 -1
  35. package/bin/{chunk-dt9wfyf2.js → chunk-7r6h3fta.js} +2 -2
  36. package/bin/{chunk-5657zj59.js → chunk-7xwmj4ew.js} +1 -1
  37. package/bin/{chunk-vf6mpxrd.js → chunk-8r2agmv2.js} +2 -2
  38. package/bin/{chunk-dntwxkyf.js → chunk-8zmk029n.js} +1 -1
  39. package/bin/{chunk-hx2y4d75.js → chunk-90jcmarf.js} +2 -2
  40. package/bin/{chunk-7wh2mr72.js → chunk-94fyesf6.js} +1 -1
  41. package/bin/chunk-94yxj3yy.js +2 -0
  42. package/bin/{chunk-zwny8t7c.js → chunk-9rhckjgf.js} +1 -1
  43. package/bin/chunk-9ykcjdsv.js +3 -0
  44. package/bin/chunk-9yn5r2hh.js +2 -0
  45. package/bin/chunk-a80aab0f.js +2 -0
  46. package/bin/{chunk-rq6bvf0t.js → chunk-ag0pavv1.js} +1 -1
  47. package/bin/{chunk-6ja68bbj.js → chunk-at5ksmqs.js} +1 -1
  48. package/bin/{chunk-11j7ejan.js → chunk-bv5mh0e0.js} +3 -3
  49. package/bin/{chunk-7w01v7bw.js → chunk-bxexm2hd.js} +3 -3
  50. package/bin/{chunk-5ex69zt3.js → chunk-cc9fftnv.js} +2 -2
  51. package/bin/{chunk-r7crhkhn.js → chunk-ch25gq27.js} +2 -2
  52. package/bin/chunk-csky7q56.js +2 -0
  53. package/bin/{chunk-z71h48pj.js → chunk-d4ktgq49.js} +1 -1
  54. package/bin/{chunk-jvn0xnj8.js → chunk-day61cfg.js} +2 -2
  55. package/bin/{chunk-03ec6p4p.js → chunk-dgvcraag.js} +2 -2
  56. package/bin/{chunk-va9hwggw.js → chunk-e26p9vrv.js} +1 -1
  57. package/bin/{chunk-f37ywvvp.js → chunk-emyax05s.js} +1 -1
  58. package/bin/{chunk-3h4t28zz.js → chunk-enq1hf8g.js} +2 -2
  59. package/bin/{chunk-mffjg6zb.js → chunk-f03whbny.js} +2 -2
  60. package/bin/{chunk-vtm39m0n.js → chunk-fk9pd7ra.js} +1 -1
  61. package/bin/{chunk-8hex1hjk.js → chunk-fscyvjzb.js} +2 -2
  62. package/bin/{chunk-nw1ch5d8.js → chunk-g2bkj92r.js} +2 -2
  63. package/bin/chunk-g5qfxnz1.js +2 -0
  64. package/bin/{chunk-5efr8prc.js → chunk-g6aq2cyq.js} +1 -1
  65. package/bin/chunk-gh6j1nsm.js +1 -0
  66. package/bin/{chunk-wjk0f9fq.js → chunk-gra1fhdp.js} +2 -2
  67. package/bin/{chunk-79wjyt2p.js → chunk-gtenq4kq.js} +1 -1
  68. package/bin/chunk-h5jre78a.js +2 -0
  69. package/bin/{chunk-wth2f791.js → chunk-hcaw54dj.js} +2 -2
  70. package/bin/{chunk-8qryr65z.js → chunk-hsemzjvr.js} +2 -2
  71. package/bin/chunk-hte6gd36.js +1 -0
  72. package/bin/{chunk-vwayy6dy.js → chunk-j6dea33m.js} +3 -3
  73. package/bin/{chunk-bdwtaj3w.js → chunk-j99cr9mz.js} +2 -2
  74. package/bin/chunk-jn805ccq.js +1 -0
  75. package/bin/{chunk-tfwtxwth.js → chunk-k2w676wz.js} +2 -2
  76. package/bin/{chunk-ej18j83b.js → chunk-k33qdrdp.js} +1 -1
  77. package/bin/chunk-kmhkhcy6.js +68 -0
  78. package/bin/chunk-kp4kn4b4.js +2 -0
  79. package/bin/{chunk-9s1fdecm.js → chunk-m3ghgqc2.js} +1 -1
  80. package/bin/chunk-m84qgdyj.js +2 -0
  81. package/bin/{chunk-jt7fdhke.js → chunk-mk5hqjjd.js} +1 -1
  82. package/bin/{chunk-p2wyyvfa.js → chunk-mnhg12fm.js} +2 -2
  83. package/bin/{chunk-nc9hbzad.js → chunk-n3vzdzdw.js} +2 -2
  84. package/bin/{chunk-a6s80m0k.js → chunk-nw03w9pa.js} +1 -1
  85. package/bin/{chunk-7a4347xe.js → chunk-p31qe5mc.js} +2 -2
  86. package/bin/chunk-p48npmbh.js +2 -0
  87. package/bin/{chunk-6ts9djn2.js → chunk-p9w4ar11.js} +1 -1
  88. package/bin/chunk-pbztc6kv.js +1 -0
  89. package/bin/{chunk-v2dksv7p.js → chunk-pg55qp08.js} +2 -2
  90. package/bin/{chunk-agvb6bpw.js → chunk-pv4scagf.js} +1 -1
  91. package/bin/chunk-q0hrd0yw.js +2 -0
  92. package/bin/{chunk-wy82m4nq.js → chunk-qev7trtm.js} +2 -2
  93. package/bin/chunk-qk9npww4.js +2 -0
  94. package/bin/{chunk-zq665ybs.js → chunk-qphebjbv.js} +1 -1
  95. package/bin/{chunk-qp1hkx9k.js → chunk-rakz3pe6.js} +2 -2
  96. package/bin/chunk-rjga1vn2.js +2 -0
  97. package/bin/chunk-rt8yqz51.js +1 -0
  98. package/bin/chunk-s542e1y0.js +1 -0
  99. package/bin/{chunk-0rydta2q.js → chunk-s6e91ky2.js} +1 -1
  100. package/bin/{chunk-w4e52ade.js → chunk-s9s9hhet.js} +1 -1
  101. package/bin/{chunk-39j992fb.js → chunk-s9yzt7s3.js} +2 -2
  102. package/bin/chunk-sjsn35mp.js +1 -0
  103. package/bin/{chunk-0x6zt5yg.js → chunk-stggq92k.js} +1 -1
  104. package/bin/{chunk-zvq0btde.js → chunk-t16qt2ka.js} +3 -3
  105. package/bin/chunk-tc5evq8x.js +2 -0
  106. package/bin/chunk-tjrdsmdw.js +1 -0
  107. package/bin/{chunk-tk362keq.js → chunk-tkh0s7hg.js} +2 -2
  108. package/bin/{chunk-nn753fbs.js → chunk-tsym31yb.js} +2 -2
  109. package/bin/{chunk-a2m63585.js → chunk-v1ybpqrz.js} +1 -1
  110. package/bin/chunk-vbkwteh4.js +1 -0
  111. package/bin/chunk-vevscfh2.js +2 -0
  112. package/bin/chunk-vg33qt6z.js +11 -0
  113. package/bin/{chunk-wzw7rrfy.js → chunk-vgwjg37a.js} +2 -2
  114. package/bin/chunk-vwz2pa54.js +2 -0
  115. package/bin/chunk-we3vdyhb.js +1 -0
  116. package/bin/chunk-whn6dvak.js +1 -0
  117. package/bin/{chunk-j4byth37.js → chunk-wwjqqqr4.js} +1 -1
  118. package/bin/{chunk-mv4v52ah.js → chunk-xext4yvc.js} +1 -1
  119. package/bin/chunk-xr1wr22v.css +1 -0
  120. package/bin/chunk-xvpttxen.js +7 -0
  121. package/bin/chunk-y45tzhdn.js +2 -0
  122. package/bin/{chunk-c4yr75hy.js → chunk-y5ptk39s.js} +2 -2
  123. package/bin/{chunk-ytgtf0ak.js → chunk-y7b5gy17.js} +1 -1
  124. package/bin/{chunk-zcxajg6j.js → chunk-y8ffp5zj.js} +2 -2
  125. package/bin/chunk-yfgwknpa.js +78 -0
  126. package/bin/{chunk-yvknqnkb.js → chunk-z7b132c0.js} +2 -2
  127. package/bin/{chunk-v5c6t1w3.js → chunk-zdmcc6ps.js} +2 -2
  128. package/bin/shumai-app.html +1 -1
  129. package/bin/shumai-app.js +485 -291
  130. package/package.json +7 -7
  131. package/prisma/migrations/20260819091331_add_kanban_schema/migration.sql +164 -0
  132. package/prisma/migrations/20260821102514_add_kanban_notifications/migration.sql +26 -0
  133. package/prisma/migrations/20260821133500_add_c_collation_to_kanban_sort_index/migration.sql +10 -0
  134. package/prisma/migrations/20260822020609_add_kanban_task_assets/migration.sql +17 -0
  135. package/prisma/migrations/20260822071734_remove_kanban_task_cancelled_status/migration.sql +28 -0
  136. package/prisma/schema.prisma +187 -0
  137. package/bin/chunk-0h1yw3eq.js +0 -1
  138. package/bin/chunk-1eqdvehm.js +0 -2
  139. package/bin/chunk-2ckj039r.js +0 -2
  140. package/bin/chunk-2wcfw38x.js +0 -1
  141. package/bin/chunk-4st1t79p.js +0 -2
  142. package/bin/chunk-5ctpz542.js +0 -78
  143. package/bin/chunk-7t9c532y.js +0 -1
  144. package/bin/chunk-7zvv37z0.js +0 -7
  145. package/bin/chunk-9vjkb4vh.js +0 -1
  146. package/bin/chunk-ar79dg9g.js +0 -2
  147. package/bin/chunk-b0kh9jpt.js +0 -1
  148. package/bin/chunk-d5v9nz51.js +0 -1
  149. package/bin/chunk-ddt5224b.js +0 -2
  150. package/bin/chunk-eekmnfn4.js +0 -2
  151. package/bin/chunk-ff8zrme6.js +0 -1
  152. package/bin/chunk-g2qeb32y.js +0 -2
  153. package/bin/chunk-gtqchcj0.js +0 -2
  154. package/bin/chunk-hdx9q31r.js +0 -1
  155. package/bin/chunk-hk5pwxhf.js +0 -2
  156. package/bin/chunk-jkpxykx9.css +0 -1
  157. package/bin/chunk-jq28ge97.js +0 -1
  158. package/bin/chunk-n3e4agsa.js +0 -2
  159. package/bin/chunk-ppwy5dja.js +0 -1
  160. package/bin/chunk-px660tvj.js +0 -2
  161. package/bin/chunk-qbs0nvbn.js +0 -3
  162. package/bin/chunk-qt6j0fm6.js +0 -65
  163. package/bin/chunk-t6gqzden.js +0 -1
  164. package/bin/chunk-tn24as5d.js +0 -2
  165. package/bin/chunk-v2n1hwt3.js +0 -1
  166. package/bin/chunk-vhcsdnzv.js +0 -2
  167. package/bin/chunk-wk153p7c.js +0 -1
  168. package/bin/chunk-y8wj6g7y.js +0 -11
  169. package/bin/chunk-ympx92ct.js +0 -1
  170. package/bin/chunk-yx6mahz0.js +0 -1
  171. package/bin/chunk-z8s40zfa.js +0 -68
@@ -1,2 +0,0 @@
1
- import{Aa as GK,Ba as zK,Ca as QK,Da as HK,Ea as UK,Fa as BK,ya as _K,za as $K}from"./chunk-ar79dg9g.js";import{Jg as YK,Lg as gJ}from"./chunk-z8s40zfa.js";import{Ng as ZJ}from"./chunk-zcxajg6j.js";import{Pg as $J}from"./chunk-vhcsdnzv.js";import{Dh as KK,Ih as WK,vh as QJ,xh as HJ,yh as UJ,zh as w}from"./chunk-8qryr65z.js";import{$i as sJ,$j as wJ,Bi as p,Ej as kJ,Fi as nJ,Hi as aJ,Lh as NK,Mh as iJ,Nh as J,Oh as X,Ph as lJ,Si as rJ,Uh as v,Vh as _J,Yh as dJ,Zh as h,Zi as oJ,_h as GJ,bj as XJ,cj as YJ,dl as O,ej as tJ,fl as N,il as W,jl as TJ,kj as DJ,lk as JK,ll as RJ,ml as SJ,ni as z,nl as fJ,ol as hJ,pi as U,pl as XK,ql as ZK,rj as eJ,vk as uJ,zi as zJ}from"./chunk-5ctpz542.js";import{nm as vK}from"./chunk-j4byth37.js";var _=vK(NK(),1);function cK({teamId:B,projectId:Z,projectName:$,rootFolderId:P,dragState:b,onSelect:M,selectedFolderId:A,hideCollections:m,hideShares:C,ancestorFolders:D}){let q=GJ(),Q=lJ(),{canEdit:V}=WK(Z),j=dJ({from:"/projects/$projectId/recently-deleted",shouldThrow:!1}),[L,r]=_.useState(!0),[T,BJ]=_.useState(!0),[u,bJ]=_.useState(!0),{data:c,fetchNextPage:i,hasNextPage:g,isFetchingNextPage:R}=_J({queryKey:["shares",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].shares.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_share_links());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{data:l,fetchNextPage:o,hasNextPage:d,isFetchingNextPage:n}=_J({queryKey:["collections",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].collections.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_collections());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{ref:qJ,inView:s}=$J(),{ref:VJ,inView:t}=$J();_.useEffect(()=>{if(s&&d&&!n)o()},[s,d,n,o]),_.useEffect(()=>{if(t&&g&&!R)i()},[t,g,R,i]);let AJ=_.useMemo(()=>l?.pages.flatMap((K)=>K.data)||[],[l]),OJ=_.useMemo(()=>c?.pages.flatMap((K)=>K.data)||[],[c]),{mutate:PJ}=v({mutationFn:async()=>{let K=await U.api.projects[":projectId"].collections.$post({param:{projectId:Z},json:{name:W.untitled_collection(),filter:{sourceFolderId:P,searchFilter:{conditions:[],recursively:!0}}}});if(!K.ok)throw Error(W.failed_create_collection());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_created()),q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:MJ}=v({mutationFn:async()=>{let K=await U.api.projects[":projectId"].shares.$post({param:{projectId:Z},json:{name:new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}});if(!K.ok)throw Error(W.failed_create_share_link());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_created()),q({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),e=h({from:"/projects/$projectId/collections/$collectionId",shouldThrow:!1}),LJ=h({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1}),G=h({from:"/projects/$projectId/folders/$folderId",shouldThrow:!1}),[y,yJ]=_.useState(null),[F,EJ]=_.useState("collection"),[E,JJ]=_.useState(""),[qK,k]=_.useState(!1),[vJ,NJ]=_.useState(null),[S,CJ]=_.useState("collection"),[VK,f]=_.useState(!1),{mutate:IJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.folders[":folderId"].$put({param:{folderId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_folder());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:AK}=v({mutationFn:async(K)=>{if(!(await U.api.folders.$delete({json:{ids:[K]}})).ok)throw Error(W.failed_delete_folder());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_deleted()),f(!1),G?.folderId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),[OK,a]=_.useState(!1),[KJ,xJ]=_.useState(!1),[FJ,pJ]=_.useState([]),PK=async(K)=>{a(!0),xJ(!0),pJ([]);try{let Y=await U.api.files["download-links"].$post({json:{ids:[K]}});if(!Y.ok)throw Error(W.failed_to_prepare_download_links());let H=await Y.json();pJ(H.files)}catch(Y){z.error(W.failed_to_prepare_download_links()),a(!1),console.error(Y)}finally{xJ(!1)}},MK=()=>{let K=[...FJ];if(a(!1),K.length===0)return;z.info(W.starting_download_files({count:K.length}),{duration:5000});let Y=(WJ)=>new Promise((I)=>setTimeout(I,WJ));(async()=>{for(let I=0;I<K.length;I+=5){let EK=K.slice(I,I+5);for(let cJ of EK){let x=document.createElement("a");x.href=cJ.url,x.download=cJ.name,x.target="_blank",document.body.appendChild(x),x.click(),x.remove()}await Y(1000)}})().catch((WJ)=>{console.error("Background downloads failed:",WJ),z.error(W.some_downloads_failed())})},{mutate:mJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.collections[":collectionId"].$patch({param:{collectionId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_collection());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:LK}=v({mutationFn:async(K)=>{let Y=await U.api.collections[":collectionId"].$delete({param:{collectionId:K}});if(!Y.ok)throw Error(W.failed_delete_collection());return await Y.json()},onSuccess:(K,Y)=>{if(Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_deleted()),f(!1),e?.collectionId===Y)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:jJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.shares[":shareId"].$put({param:{shareId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_share_link());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:yK}=v({mutationFn:async(K)=>{if(!(await U.api.shares[":shareId"].$delete({param:{shareId:K}})).ok)throw Error(W.failed_delete_share_link());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_deleted()),f(!1),LJ?.shareId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}});return X("div",{className:"flex flex-col h-full overflow-hidden p-3 gap-4 bg-background",children:[X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",L?"flex-1 min-h-[50%] h-full":"flex-none h-[44px] max-h-[44px]"),children:[J("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>r(!L),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.folder_tree_assets()}),L?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]})}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",L?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[J(bK,{teamId:B,projectId:Z,folder:{id:P,name:$,type:"folder",sizeByte:0,fileCount:0,status:"processed",createdAt:"",updatedAt:""},level:0,isRoot:!0,dragState:b,onSelect:M,selectedFolderId:A,canEdit:V,onRenameTrigger:(K,Y)=>{yJ(K),EJ("folder"),JJ(Y),k(!0)},onDeleteTrigger:(K)=>{NJ(K),CJ("folder"),f(!0)},onDownloadTrigger:(K)=>{PK(K)},ancestorFolders:D},P),V&&X("div",{className:O("group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",j&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/recently-deleted",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(uJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.recently_deleted()})]})]})})]}),!m&&X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",T?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>BJ(!T),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.collections()}),T?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),V&&J("button",{"data-testid":"create-collection",onClick:()=>PJ(),className:"text-muted-foreground hover:text-foreground flex-none",children:J(wJ,{className:"h-3.5 w-3.5"})})]}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",T?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/collections",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_collections_count({count:l?.pages[0]?.pageInfo?.total||0})})]}),AJ.map((K)=>{let Y=e?.collectionId===K.id;return X("div",{className:O("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",Y&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(rJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:K.name})]}),V&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(H)=>H.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[J(w,{onClick:()=>{yJ(K.id),EJ("collection"),JJ(K.name),k(!0)},children:W.rename()}),J(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{NJ(K.id),CJ("collection"),f(!0)},children:W.delete()})]})]})})]},K.id)}),J("div",{ref:qJ,className:"h-1"}),n&&J("div",{className:"flex justify-center p-2",children:J(p,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),!C&&X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out",u?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>bJ(!u),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.share_links()}),u?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),V&&J("div",{className:"flex items-center gap-1 flex-none",children:J("button",{onClick:()=>MJ(),className:"text-muted-foreground hover:text-foreground",children:J(wJ,{className:"h-3.5 w-3.5"})})})]}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",u?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/shares",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_share_links_count({count:c?.pages[0]?.pageInfo?.total||0})})]}),OJ.map((K)=>J(CK,{link:K,projectId:Z,dragState:b,canEdit:V,onRenameTrigger:(Y,H)=>{yJ(Y),EJ("share"),JJ(H),k(!0)},onDeleteTrigger:(Y)=>{NJ(Y),CJ("share"),f(!0)}},K.id)),J("div",{ref:VJ,className:"h-1"}),R&&J("div",{className:"flex justify-center p-2",children:J(p,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),J(TJ,{open:qK,onOpenChange:k,children:X(RJ,{onClick:(K)=>K.stopPropagation(),children:[J(SJ,{children:J(hJ,{children:F==="collection"?W.rename_collection():F==="share"?W.rename_share_link():W.rename_folder()})}),J("div",{className:"py-4",children:J(ZK,{value:E,onChange:(K)=>JJ(K.target.value),placeholder:W.enter_new_name(),onKeyDown:(K)=>{if(K.key==="Enter"&&E.trim()){if(F==="collection")mJ({id:y,name:E});else if(F==="share")jJ({id:y,name:E});else if(F==="folder")IJ({id:y,name:E})}}})}),X(fJ,{children:[J(N,{variant:"ghost",onClick:()=>k(!1),children:W.cancel()}),J(N,{disabled:!E.trim(),onClick:()=>{if(F==="collection")mJ({id:y,name:E});else if(F==="share")jJ({id:y,name:E});else if(F==="folder")IJ({id:y,name:E})},children:W.rename()})]})]})}),J(_K,{open:VK,onOpenChange:f,children:X($K,{onClick:(K)=>K.stopPropagation(),children:[X(GK,{children:[J(QK,{children:S==="collection"?W.delete_collection_confirm():S==="share"?W.delete_share_link_confirm():W.delete_folder_confirm()}),J(HK,{children:W.delete_confirm_description({type:S==="collection"?W.collection():S==="share"?W.share_link():W.folder().toLowerCase()})})]}),X(zK,{children:[J(BK,{children:W.cancel()}),J(UK,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{if(S==="collection")LK(vJ);else if(S==="share")yK(vJ);else if(S==="folder")AK(vJ)},children:W.delete()})]})]})}),J(TJ,{open:OK,onOpenChange:a,children:X(RJ,{className:"sm:max-w-md",children:[X(SJ,{children:[J(hJ,{children:KJ?W.preparing_download():W.confirm_download()}),J(XK,{children:KJ?W.resolving_files_wait():W.folder_files_download_description()})]}),KJ?X("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[J(p,{className:"h-8 w-8 animate-spin text-primary"}),J("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:W.preparing_download_links()})]}):X("div",{className:"space-y-4 py-2",children:[J("div",{className:"text-sm text-muted-foreground",children:W.download_includes_files({count:FJ.length})}),X("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:[J(aJ,{className:"h-5 w-5 shrink-0 mt-0.5"}),X("div",{children:[J("p",{className:"font-semibold",children:W.no_folder_structure()}),J("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:W.folder_structure_warning()})]})]})]}),J(fJ,{children:!KJ?X(iJ,{children:[J(N,{variant:"outline",onClick:()=>a(!1),children:W.cancel()}),X(N,{onClick:MK,className:"gap-2",disabled:FJ.length===0,children:[J(DJ,{className:"h-4 w-4"}),W.start_download()]})]}):J(N,{disabled:!0,variant:"outline",children:W.cancel()})})]})})]})}function CK({link:B,projectId:Z,dragState:$,canEdit:P,onRenameTrigger:b,onDeleteTrigger:M}){let A=GJ(),C=h({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1})?.shareId===B.id,{ref:D,isDropTarget:q}=gJ({id:`share:${B.id}`,data:{type:"share-link",id:B.id}}),Q=!!$?.isActive;return X("div",{ref:D,className:O("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",C&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",q&&Q&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),onClick:()=>A({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:B.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(JK,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:B.name})]}),P&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(V)=>V.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[J(w,{onClick:()=>{b(B.id,B.name)},children:W.rename()}),J(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(B.id)},children:W.delete()})]})]})})]})}function bK({teamId:B,projectId:Z,folder:$,level:P,isRoot:b,dragState:M,onSelect:A,selectedFolderId:m,canEdit:C,onRenameTrigger:D,onDeleteTrigger:q,onDownloadTrigger:Q,ancestorFolders:V}){let j=_.useMemo(()=>{return V?.some((G)=>G.id===$.id)??!1},[V,$.id]),[L,r]=_.useState(b||j);_.useEffect(()=>{if(j)r(!0)},[j]);let T=GJ(),BJ=h({from:"/projects/$projectId/folders/$folderId",select:(G)=>({folderId:G.folderId}),shouldThrow:!1}),u=h({from:"/projects/$projectId/",shouldThrow:!1}),bJ=b?!!u:BJ?.folderId===$.id,{data:c,fetchNextPage:i,hasNextPage:g,isFetchingNextPage:R,isLoading:l}=_J({queryKey:["folders",$.id,"children",{assetType:"folder"}],queryFn:async({pageParam:G})=>{let y=await U.api.folders[":folderId"].children.$get({param:{folderId:$.id},query:{assetType:"folder",after:G,first:"20"}});if(!y.ok)throw Error(W.failed_to_fetch_folder_children());return await y.json()},initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0},enabled:L||!!b}),{ref:o,inView:d}=$J();_.useEffect(()=>{if(d&&g&&!R)i()},[d,g,R,i]);let n=c?.pages.flatMap((G)=>G.data??[])??[],qJ=(G)=>{G.stopPropagation(),r(!L)},s=()=>{if(A){A($);return}if(b)T({to:"/projects/$projectId",params:{projectId:Z}});else T({to:"/projects/$projectId/folders/$folderId",params:{projectId:Z,folderId:$.id}})},{ref:VJ,isDragging:t}=YK({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:!!b||!!A||!C}),{ref:AJ,isDropTarget:OJ}=gJ({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:M?.draggedIds.has($.id)||!!A||!C}),PJ=(G)=>{VJ(G),AJ(G)},MJ=_.useMemo(()=>{if(A)return!1;if(!M?.isActive)return!1;if(M.draggedIds.has($.id))return!1;return!0},[M,$.id,A]),e=OJ&&MJ,LJ=m===$.id;return X("div",{children:[X("div",{ref:PJ,className:O("group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",(bJ||LJ)&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",t&&"opacity-50",e&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),style:{...b?{}:{paddingLeft:`${P*12+8}px`}},onClick:s,children:[!b&&J("button",{onClick:qJ,className:"flex h-4 w-4 items-center justify-center shrink-0",children:L?J(oJ,{className:"h-3 w-3"}):J(sJ,{className:"h-3 w-3"})}),b?J(tJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}):J(eJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:$.name}),C&&!b&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(G)=>G.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[X(w,{onClick:()=>{D($.id,$.name)},children:[J(nJ,{className:"mr-2 h-4 w-4"}),W.rename()]}),X(w,{onClick:()=>{Q($.id)},children:[J(DJ,{className:"mr-2 h-4 w-4"}),W.download()]}),J(KK,{}),X(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{q($.id)},children:[J(uJ,{className:"mr-2 h-4 w-4"}),W.delete()]})]})]})})]}),L&&X("div",{children:[l&&J("div",{className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:J(p,{className:"h-4 w-4 animate-spin"})}),n.map((G)=>J(bK,{teamId:B,projectId:Z,folder:G,level:P+1,dragState:M,onSelect:A,selectedFolderId:m,canEdit:C,onRenameTrigger:D,onDeleteTrigger:q,onDownloadTrigger:Q,ancestorFolders:V},G.id)),g&&J("div",{ref:o,className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:R&&J(p,{className:"h-4 w-4 animate-spin"})})]})]})}
2
- export{cK as ta};
@@ -1 +0,0 @@
1
- import{va as cz}from"./chunk-px660tvj.js";import"./chunk-a6s80m0k.js";import{xa as r}from"./chunk-q3y6kdkh.js";import{Aa as Iz,Ba as gz,Ca as uz,Da as lz,Ea as dz,Fa as pz,ya as Cz,za as fz}from"./chunk-ar79dg9g.js";import{lf as Dz}from"./chunk-c4yr75hy.js";import"./chunk-03ec6p4p.js";import{Vg as m}from"./chunk-331s5eb9.js";import{qh as yz}from"./chunk-tn24as5d.js";import{sh as hz,th as Sz,uh as wz}from"./chunk-naaa5ejw.js";import{Ih as bz,vh as C,xh as f,yh as I,zh as w}from"./chunk-8qryr65z.js";import{$j as Zz,Ak as Jz,Bi as Gz,Di as Tz,Ei as Lz,Ik as Kz,Jh as Mz,Lh as $z,Mh as P,Nh as z,Oh as J,Ph as i,Qi as Rz,Sh as o,Uh as q,Yi as a,_h as n,di as Bz,dl as _z,fl as F,il as V,jl as kz,ll as qz,ml as Az,ni as Yz,nl as Ez,ol as Fz,pi as X,pl as Uz,qi as Vz,ql as j,ri as Pz,zi as vz}from"./chunk-5ctpz542.js";import{nm as Wz}from"./chunk-j4byth37.js";var k=Wz($z(),1);function Nz({open:Z,onOpenChange:T,mode:L,teamId:U,project:W}){let A=i(),K=n(),[H,O]=k.useState(""),[y,B]=k.useState(!0),[g,M]=k.useState(void 0),[b,N]=k.useState(void 0),[E,D]=k.useState(!1),v=k.useRef(null);k.useEffect(()=>{if(Z)if(L==="edit"&&W)O(W.name||""),M(W.coverImageKey),N(W.coverImage),B(W.enableNotification!==!1);else O(""),M(void 0),N(void 0),B(!0)},[Z,L,W]);let u=X.api.teams[":teamId"].projects.$post,{mutate:t}=q({mutationFn:async(Q)=>{let _=await u({param:{teamId:U},json:Q});if(!_.ok)throw Error(V.failed_create_project());return await _.json()},onSuccess:(Q)=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1);let _=Q;if(_&&typeof _.id==="string")K({to:"/projects/$projectId",params:{projectId:_.id}})}}),l=X.api.projects[":projectId"].$put,{mutate:s}=q({mutationFn:async(Q)=>{let _=await l({param:{projectId:W.id},json:Q});if(!_.ok)throw Error(V.failed_update_project());return await _.json()},onSuccess:()=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1)}}),e=X.api.teams[":teamId"].files.$post,{mutate:d}=q({mutationFn:async({file:Q})=>{let _=await e({param:{teamId:U},form:{file:Q}});if(!_.ok)throw Error(V.failed_upload_file());return await _.json()},onSuccess:(Q)=>{let _=Q;if(_&&typeof _.key==="string")M(_.key);D(!1)},onError:()=>{D(!1)}}),R=(Q)=>{let _=Q.target.files?.[0];if(_){D(!0);let zz=URL.createObjectURL(_);N(zz),d({file:_})}},h=()=>{v.current?.click()},p=(Q)=>{Q.stopPropagation(),M(void 0),N(void 0)},S=()=>{if(!H.trim())return;if(L==="create")t({name:H.trim(),coverImageKey:g,enableNotification:y});else if(L==="edit"&&W?.id)s({name:H.trim(),coverImageKey:g,enableNotification:y})};return z(kz,{open:Z,onOpenChange:T,children:J(qz,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[J(Az,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[z("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),z("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),z("div",{className:"flex items-center gap-3",children:J("div",{children:[z(Fz,{className:"text-xl font-semibold tracking-tight text-foreground",children:L==="create"?V.create_new_project():V.project_settings()}),z(Uz,{className:"text-xs text-muted-foreground/80 mt-1",children:L==="create"?V.configure_new_project_description():V.manage_project_description()})]})})]}),J("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[J("div",{className:"space-y-2",children:[z(m,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:V.project_name()}),J("div",{className:"relative",children:[z(j,{id:"name",value:H,onChange:(Q)=>O(Q.target.value),placeholder:V.project_name_placeholder(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),H.trim()&&z("div",{className:"absolute inset-y-0 right-3 flex items-center",children:z(a,{className:"w-4 h-4 text-primary"})})]}),z("p",{className:"text-[11px] text-muted-foreground",children:V.project_name_hint()})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J("div",{className:"flex items-center justify-between",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Lz,{className:"w-4 h-4 text-primary"}),V.project_cover()]}),b&&J("button",{type:"button",onClick:p,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[z(Kz,{className:"w-3.5 h-3.5"}),V.remove_cover()]})]}),J("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:h,children:[z("input",{type:"file",ref:v,className:"hidden",accept:"image/*",onChange:R}),E&&z("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:J("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[z(Gz,{className:"w-4 h-4 animate-spin text-primary"}),z("span",{className:"text-xs font-semibold text-foreground",children:V.uploading()})]})}),b?J(P,{children:[z("img",{src:b,alt:V.cover_preview(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),J("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.5 text-white z-10",children:[z(Jz,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),z("span",{className:"text-xs font-semibold",children:V.upload_image()})]})]}):J("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[z("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:z(Jz,{className:"w-4 h-4 text-muted-foreground"})}),J("div",{children:[z("p",{className:"text-xs font-medium text-foreground",children:V.upload_cover()}),z("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:V.upload_cover_hint()})]})]})]})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Tz,{className:"w-4 h-4 text-primary"}),V.project_preferences()]}),J("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[J("div",{className:"space-y-1 pr-4",children:[J("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[z(Rz,{className:"w-4 h-4 text-primary"}),V.activity_notifications()]}),z("p",{className:"text-xs text-muted-foreground leading-normal",children:V.activity_notifications_description()})]}),z(r,{checked:y,onCheckedChange:B,disabled:E,className:"mt-0.5"})]})]})]}),J(Ez,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[z(F,{type:"button",variant:"ghost",onClick:()=>T(!1),disabled:E,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:V.cancel()}),z(F,{type:"submit",onClick:S,disabled:!H.trim()||E,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:E?J(P,{children:[z(Gz,{className:"w-4 h-4 animate-spin"}),V.processing()]}):L==="create"?V.create_project():V.save_changes()})]})]})})}function Oz({sortBy:Z,sortDirection:T,onSortChange:L}){let U=(H)=>{L(H,T)},W=()=>{L(Z,T==="asc"?"desc":"asc")},A=(H)=>{switch(H){case"name":return V.sort_name();case"created_at":return V.sort_created();case"updated_at":return V.sort_updated();default:return H}},K=T==="asc";return J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"outline",className:"gap-2 bg-muted/50",children:[z("span",{className:"text-muted-foreground",children:V.sorted_by_label()}),z("span",{className:"font-medium text-foreground",children:A(Z)})]})}),J(I,{align:"end",className:"w-56 p-2",children:[z("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:V.sort_by()}),J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[z("span",{children:A(Z)}),z(Vz,{className:"h-4 w-4 opacity-50"})]})}),z(I,{className:"w-52",children:["name","created_at","updated_at"].map((H)=>J(w,{onClick:()=>U(H),className:"justify-between",children:[A(H),Z===H&&z(a,{className:"h-4 w-4"})]},H))})]}),J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:W,children:[z("span",{className:"text-muted-foreground",children:Z==="name"?K?z(P,{children:V.sort_a_to_z()}):z(P,{children:V.sort_z_to_a()}):K?z(P,{children:V.sort_oldest_to_newest()}):z(P,{children:V.sort_newest_to_oldest()})}),K?z(Pz,{className:"h-4 w-4 opacity-50"}):z(Vz,{className:"h-4 w-4 opacity-50"})]})]})]})}var $=Wz($z(),1);function JG(){let{teamId:Z}=VG.useParams(),{canEdit:T,canAdmin:L}=bz(),U=n(),W=i(),[A,K]=$.useState(null),[H,O]=$.useState(!1),[y,B]=$.useState("create"),[g,M]=$.useState(void 0),[b,N]=$.useState(!1),[E,D]=$.useState(void 0),[v,u]=$.useState(""),[t,l]=$.useState(!1),{metadata:s,setMetadata:e}=Dz(),d=`team:${Z}:projects:sort`,R=s[d],[h,p]=$.useState(()=>R?.sortBy||"name"),[S,Q]=$.useState(()=>R?.sortDirection||"asc");$.useEffect(()=>{if(R?.sortBy&&R.sortBy!==h)p(R.sortBy);if(R?.sortDirection&&R.sortDirection!==S)Q(R.sortDirection)},[R]);let _=X.api.teams[":teamId"].projects.$get,{data:zz}=o({queryKey:["teams",Z,"projects",h,S],queryFn:async()=>{let G=await _({param:{teamId:Z},query:{sortBy:h,sortDirection:S}});if(!G.ok)throw Error("Failed to fetch projects");return await G.json()},placeholderData:Mz}),{data:Hz}=o({queryKey:["teams",Z,"members"],queryFn:async()=>{let G=await X.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{}});if(!G.ok)throw Error("Failed to fetch members");return await G.json()}}),{data:Qz}=o({queryKey:["teams",Z,"me"],queryFn:async()=>{let G=await X.api.teams[":teamId"].me.$get({param:{teamId:Z}});if(!G.ok)throw Error("Failed to fetch me");return await G.json()}}),xz=X.api.teams[":teamId"].invite.$post,mz=q({mutationFn:async(G)=>{let Y=await xz(G);if(!Y.ok)throw Error("Failed to invite");return await Y.json()}}),c=q({mutationFn:async(G)=>{if(!(await X.api.projects[":projectId"].$delete({param:{projectId:G}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]})}}),iz=q({mutationFn:async(G)=>{let Y=await X.api.projects[":projectId"].$put({param:{projectId:G.id},json:{enableNotification:!G.enableNotification}});if(!Y.ok)throw Error("Failed to update project notification settings");return await Y.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]}),Yz.success(V.project_notification_updated())},onError:(G)=>{Yz.error(G instanceof Error?G.message:V.failed_update_project_notification())}}),Xz=()=>{B("create"),M(void 0),O(!0)},nz=()=>{K("create"),setTimeout(()=>{K(null)},100),setTimeout(()=>{Xz()},200)},az=(G)=>{B("edit"),M(G),O(!0)},jz=(G)=>{D(G),u(""),N(!0)},rz=async()=>{if(E&&v==="delete")try{await c.mutateAsync(E.id),N(!1)}catch(G){console.error(G)}},oz=(G,Y)=>{if(Y.detail>1)return;K(G),setTimeout(()=>{K(null)},100),setTimeout(()=>{U({to:"/projects/$projectId",params:{projectId:G}})},200)},tz=async(G)=>{return(await mz.mutateAsync({param:{teamId:Z},json:{role:G}})).code},sz=q({mutationFn:async({userId:G,role:Y})=>{if(!(await X.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:Z,userId:G},json:{role:Y}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),ez=q({mutationFn:async(G)=>{if(!(await X.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:Z,userId:G}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),zG=(G)=>{if(!G)return"??";return G.split(" ").map((Y)=>Y[0]).slice(0,2).join("").toUpperCase()},GG=(G,Y)=>{p(G),Q(Y),e(Z,d,{sortBy:G,sortDirection:Y})},x=Array.isArray(Hz)?Hz:[];return J("div",{className:"flex-1 overflow-y-auto p-4",children:[J("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[z("h1",{className:"text-2xl font-bold",children:V.projects()}),J("div",{className:"flex flex-wrap items-center gap-4",children:[J("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>l(!0),"data-testid":"team-members-trigger",children:[x.slice(0,3).map((G)=>J(hz,{className:"border-2 border-background w-8 h-8",children:[G.image&&z(Sz,{src:G.image,alt:G.name,className:"object-cover"}),z(wz,{className:"text-[10px]",children:zG(G.name)})]},G.id)),x.length>3&&J("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",x.length-3]})]}),z(Oz,{sortBy:h,sortDirection:S,onSortChange:GG}),T&&J(F,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:Xz,children:[z(Zz,{className:"w-4 h-4"}),V.create_project()]})]})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[zz?.data?.map((G)=>z("div",{className:_z("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",A===G.id?"scale-95":"scale-100"),onClick:(Y)=>oz(G.id,Y),children:J("div",{className:"flex flex-col",children:[J("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[G.coverImage?z("img",{src:G.coverImage,alt:G.name,className:"w-full h-full object-cover rounded"}):J("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[z("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),z("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),z("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),z("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),z("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),z("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),z("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),z("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),z("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),z("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),z("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),z("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),z("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),z("p",{className:"absolute left-1 bottom-2 text-white",children:G.name})]}),J("div",{className:"px-2 h-10 flex justify-between items-center",children:[J("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[V.updated_ago()," ",yz(G.updatedAt??"")]}),z("div",{onClick:(Y)=>Y.stopPropagation(),children:J(C,{modal:!1,children:[z(f,{asChild:!0,children:z("button",{className:"hover:bg-muted outline-none flex px-1",children:z(vz,{className:"w-5 h-5 text-muted-foreground"})})}),J(I,{align:"end",children:[T&&z(w,{onClick:(Y)=>{Y.stopPropagation(),az(G)},children:V.project_settings()}),J(w,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(Y)=>{Y.preventDefault(),iz.mutate(G)},children:[z("span",{children:V.notification()}),z(r,{checked:G.enableNotification??!0,className:"pointer-events-none"})]}),L&&z(w,{className:"text-destructive focus:text-destructive",onClick:()=>jz(G),children:V.delete()})]})]})})]})]})},G.id)),T&&z("div",{className:_z("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",A==="create"?"scale-95":"scale-100"),onClick:nz,children:J("div",{className:"flex flex-col",children:[z("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:z(Zz,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),z("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:z("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:V.create_project()})})]})})]}),z(Nz,{open:H,onOpenChange:O,mode:y,teamId:Z,project:g}),z(Cz,{open:b,onOpenChange:N,children:J(fz,{children:[J(Iz,{children:[z(uz,{children:V.are_you_sure()}),J(lz,{children:[V.delete_project_warning({name:E?.name??""}),J("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[z("span",{className:"text-sm font-medium",children:V.type_delete_to_confirm()}),z(j,{value:v,onChange:(G)=>u(G.target.value),placeholder:V.delete_placeholder(),className:"h-9",autoFocus:!0})]})]})]}),J(gz,{children:[z(pz,{disabled:c.isPending,children:V.cancel()}),z(dz,{onClick:(G)=>{G.preventDefault(),rz()},disabled:v!=="delete"||c.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c.isPending?V.deleting():V.delete()})]})]})}),z(cz,{open:t,onOpenChange:l,title:V.team_members(),type:"team",members:x,isOwner:Qz?.role==="owner",onInvite:tz,onUpdateRole:async(G,Y)=>{await sz.mutateAsync({userId:G,role:Y})},onRemoveMember:async(G)=>{await ez.mutateAsync(G)},currentUserId:Qz?.id})]})}var VG=Bz("/teams/$teamId/")({component:JG});export{VG as Route};
@@ -1,2 +0,0 @@
1
- import{Ff as l0,Gf as c0,Hf as u0,If as x0,Jf as j0,Mf as r0}from"./chunk-4st1t79p.js";import{Qf as E0,Rf as P0}from"./chunk-mffjg6zb.js";import{Sf as I0}from"./chunk-3h4t28zz.js";import{Xf as i0,Yf as n0}from"./chunk-nc9hbzad.js";import{Hg as S0,Mg as o0,wg as F0,xg as C0,yg as f0}from"./chunk-z8s40zfa.js";import{Ng as q0}from"./chunk-zcxajg6j.js";import{Rg as g0,Sg as D0,Tg as p0,Ug as m0}from"./chunk-03ec6p4p.js";import{lh as H0,oh as K0}from"./chunk-tn24as5d.js";import{Ch as v0,Dh as u,Eh as s,Fh as e,Gh as L0,Ih as a0,vh as d,wh as n,xh as t,yh as i,zh as O}from"./chunk-8qryr65z.js";import{Ej as w0,Kj as b0,Lh as N0,Mh as w,Nh as L,Oh as J,Ph as W0,Sh as X0,Ti as y0,Uh as o,Yi as M0,Zi as k0,_h as T0,ai as O0,dl as l,fl as $0,il as X,jl as G0,ll as Q0,ml as R0,ni as I,nj as a,ol as B0,pi as M,uj as Z0,vk as _0,xi as A0,yi as Y0,zj as V0}from"./chunk-5ctpz542.js";import{nm as J0}from"./chunk-j4byth37.js";var d0=J0(N0(),1);var c=J0(N0(),1);function U1(N){if(!N)return null;try{let U=K0(N);if(isNaN(U.getTime()))return null;return H0(U,"MMM d, yyyy")}catch{return null}}function z1({version:N,displayVersionNumber:U,index:K,canEdit:S,onRemove:$}){let[F,G]=c.useState(!1),{ref:Q,handleRef:C}=P0({id:N.id,index:K,disabled:!S}),R=U1(N.createdAt);return J("div",{ref:Q,className:"group flex items-center gap-3 p-2.5 rounded-lg border border-border bg-card hover:bg-accent/40 transition-colors",children:[J("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted text-muted-foreground rounded-full px-2.5 py-0.5 text-xs font-semibold select-none min-w-[2.25rem]",children:["v",U]}),S?L("div",{ref:C,className:"cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground p-1 -m-1 rounded touch-none flex items-center justify-center",children:L(Z0,{className:"h-4 w-4"})}):L("div",{className:"w-4"}),L("div",{className:"h-12 w-20 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:N.previewUrl?L("img",{src:N.previewUrl,alt:N.name||"",className:"h-full w-full object-cover"}):L(a,{className:"h-5 w-5 text-muted-foreground"})}),J("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[L("span",{className:"truncate text-sm font-medium text-foreground",title:N.name||"",children:N.name||"Untitled"}),J("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground truncate",children:[L("span",{children:N.creator?.name||X.unknown()}),R&&J(w,{children:[L("span",{children:"•"}),L("span",{children:R})]})]})]}),S&&J(d,{modal:!1,open:F,onOpenChange:G,children:[L(t,{asChild:!0,children:L($0,{variant:"ghost",size:"icon","aria-label":"More options",className:l("h-8 w-8 text-muted-foreground hover:text-foreground transition-opacity flex-shrink-0",F?"opacity-100":"opacity-0 group-hover:opacity-100 focus:opacity-100"),children:L(Y0,{className:"h-4 w-4"})})}),L(i,{align:"end",children:J(O,{onClick:()=>$(N.id),className:"text-destructive focus:text-destructive cursor-pointer",children:[L(_0,{className:"h-4 w-4 mr-2"}),L("span",{children:X.remove_from_stack()})]})})]})]})}function h0({open:N,onOpenChange:U,stackId:K,canEdit:S=!0,onVersionRemoved:$,onStackDissolved:F}){let G=W0(),[Q,C]=c.useState([]),{data:R,isLoading:V}=X0({queryKey:["version_stacks",K,"versions"],queryFn:async()=>{let W=await M.api.version_stacks[":stackId"].versions.$get({param:{stackId:K}});if(!W.ok)throw Error("Failed to fetch versions");return await W.json()},enabled:N&&!!K});c.useEffect(()=>{if(R)C(R)},[R]);let{mutate:k}=o({mutationFn:async({fileId:W,beforeId:Z})=>{if(!(await M.api.version_stacks[":stackId"].order.$post({param:{stackId:K},json:{fileId:W,beforeId:Z}})).ok)throw Error("Failed to reorder versions")},onSuccess:()=>{G.invalidateQueries({queryKey:["version_stacks"]}),G.invalidateQueries({queryKey:["files"]}),G.invalidateQueries({queryKey:["projects"]}),I.success(X.version_reordered_successfully())},onError:()=>{if(I.error(X.failed_to_reorder_versions()),R)C(R)}}),{mutate:D,isPending:A}=o({mutationFn:async(W)=>{if(!(await M.api.version_stacks[":stackId"].versions[":versionId"].$delete({param:{stackId:K,versionId:W}})).ok)throw Error("Failed to remove version from stack");return W},onSuccess:(W)=>{I.success(X.version_removed_successfully());let Z=Q.filter((q)=>q.id!==W);if(C(Z),G.invalidateQueries({queryKey:["version_stacks"]}),G.invalidateQueries({queryKey:["files"]}),G.invalidateQueries({queryKey:["projects"]}),Z.length<=1){let q=Z[0];if(U(!1),q)F?.(q.id)}else $?.(W,Z)},onError:()=>{I.error(X.failed_to_remove_version())}}),B=(W)=>{if(W.canceled)return;let{source:Z}=W.operation;if(!E0(Z))return;let{initialIndex:q,index:_}=Z;if(q===_)return;let f=[...Q],[b]=f.splice(q,1);f.splice(_,0,b),C(f);let E=_===f.length-1?"-1":f[_+1].id;k({fileId:b.id,beforeId:E})},h=(W)=>{if(A)return;D(W)};return L(G0,{open:N,onOpenChange:U,children:J(Q0,{className:"max-w-lg p-0 gap-0 overflow-hidden",children:[L(R0,{className:"p-4 pb-3 border-b border-border",children:L(B0,{className:"text-base font-semibold",children:X.manage_versions_title()})}),L(q0,{className:"max-h-[60vh] p-4",children:V?L("div",{className:"py-8 text-center text-sm text-muted-foreground",children:X.loading?.()||"Loading..."}):Q.length===0?L("div",{className:"py-8 text-center text-sm text-muted-foreground",children:X.no_versions_found()}):L("div",{className:"space-y-2",children:L(S0,{sensors:[f0.configure({activationConstraints:[new C0.Distance({value:6})]}),F0],onDragEnd:B,children:Q.map((W,Z)=>L(z1,{version:W,displayVersionNumber:Q.length-Z,index:Z,canEdit:S,onRemove:h},W.id))})})})]})})}function t0({teamId:N,projectId:U,projectName:K,ancestorFolders:S,currentAsset:$,isRootFolder:F,customTerminalBreadcrumb:G,displayStyle:Q,onDisplayStyleChange:C,isLeftSidebarCollapsed:R,onLeftSidebarToggle:V,isRightSidebarCollapsed:k,onRightSidebarToggle:D,isChatbotOpen:A=!1,onChatbotToggle:B,isPublic:h=!1,onFolderClick:W,onRename:Z,onDelete:q,fileId:_,shareId:f,allowDownload:b=!0,downloadInfo:E,versions:H,compareMode:x=!1,canCompareVersions:y=!1,onCompareVersions:j}){let g=T0(),{canEdit:p}=a0(U),[r,m]=d0.useState(!1),U0=!1,z0=(z)=>{if(!_)return;if(h&&f){g({to:"/share/$shareId/files/$fileId",params:{shareId:f,fileId:_},search:(Y)=>({...Y,version:z})});return}if(!U)return;g({to:"/projects/$projectId/files/$fileId",params:{projectId:U,fileId:_},search:(Y)=>({...Y,version:z})})},v=async(z)=>{if(!_)return;try{let Y=f?await M.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:f,fileId:_},json:{key:z}}):await M.api.files["download-url"].$post({json:{key:z,assetId:_}});if(!Y.ok)return;let{url:P}=await Y.json(),T=document.createElement("a");T.href=P,T.download="",document.body.appendChild(T),T.click(),document.body.removeChild(T)}catch{}},s0=$.proxyType!=="audio"&&(E?.videoTranscodes?.length??0)>0,e0=h?[{name:K,id:"root"},...S.slice().reverse().map((z)=>({name:z.name||"",id:z.id}))]:[{name:X.all_projects(),path:`/teams/${N}`,isMuted:!0},{name:K,path:`/projects/${U}`},...S.slice().reverse().map((z)=>({name:z.name||"",path:`/projects/${U}/folders/${z.id}`}))];return J("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[J("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[e0.map((z,Y)=>J("div",{className:"flex items-center gap-1",children:[Y>0&&L("span",{className:"text-muted-foreground",children:"/"}),z.path?L(O0,{to:z.path,className:l("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",z.isMuted?"text-muted-foreground":"text-foreground"),children:z.name}):L("button",{onClick:()=>z.id&&W?.(z.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:z.name})]},Y)),G?J("div",{className:"flex items-center gap-1",children:[L("span",{className:"text-muted-foreground",children:"/"}),L("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:G})]}):!F&&!x?J("div",{className:"flex items-center gap-1",children:[L("span",{className:"text-muted-foreground",children:"/"}),$.type==="folder"?L("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:$.name}):J(d,{modal:!1,children:[J(t,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[L("span",{children:$.name}),$.version!==void 0&&J(I0,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",$.version]}),L(k0,{className:"h-4 w-4"})]}),J(i,{className:"w-56",children:[b&&(s0?J(s,{children:[L(e,{className:"flex items-center gap-2",children:L("span",{children:X.download()})}),L(n,{children:J(L0,{className:"w-48",children:[L(v0,{children:X.download()}),E?.videoTranscodes?.map((z)=>{let Y=Math.max(z.width,z.height),P=`${z.height}p`;if(Y>=3840)P="2160p";else if(Y>=1920)P="1080p";else if(Y>=1280)P="720p";else if(Y>=960)P="540p";else if(Y>=640)P="360p";else if(Y>=320)P="180p";return J(O,{onClick:()=>v(z.key),className:"flex items-center justify-between",children:[L("span",{children:P}),L("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},P)}),E?.originalKey&&J(w,{children:[L(u,{}),J(O,{onClick:()=>v(E.originalKey),className:"flex items-center justify-between",children:[L("span",{children:"Original"}),L("span",{className:"text-xs text-muted-foreground",children:$.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):L(O,{onClick:()=>E?.originalKey&&v(E.originalKey),disabled:!E?.originalKey,children:X.download()})),p&&Z&&L(O,{onClick:Z,children:X.rename()}),p&&q&&L(O,{onClick:q,className:"text-destructive focus:text-destructive",children:X.delete()}),y&&j&&J(w,{children:[L(u,{}),J(O,{onClick:()=>j(),children:[L(A0,{className:"h-4 w-4"}),L("span",{children:X.compare_versions()})]})]}),H&&H.length>0&&J(w,{children:[L(u,{}),J(s,{children:[J(e,{className:"flex items-center gap-2",children:[L(V0,{className:"h-4 w-4"}),L("span",{children:"Versions"})]}),L(n,{children:J(L0,{className:"w-80 p-1",children:[L("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:H.map((z)=>{let Y=$.version===z.version;return J(O,{onClick:()=>z0(z.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[J("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",z.version]}),L("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:z.previewUrl?L("img",{src:z.previewUrl,alt:z.name||void 0,className:"h-full w-full object-cover"}):L(a,{className:"h-4 w-4 text-muted-foreground"})}),J("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[L("span",{className:"truncate text-sm font-semibold text-foreground",children:z.name}),L("span",{className:"truncate text-xs text-muted-foreground",children:z.creator?.name||"Unknown"})]}),Y&&L(M0,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},z.id)})}),L(u,{}),L("div",{className:"p-1",children:L("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors cursor-pointer",onClick:()=>m(!0),children:X.manage_versions()})})]})})]})]})]})]})]}):null,_&&H&&H.length>0&&L(h0,{open:r,onOpenChange:m,stackId:_,canEdit:p,onStackDissolved:(z)=>{m(!1),g({to:"/projects/$projectId/files/$fileId",params:{projectId:U,fileId:z}})},onVersionRemoved:(z,Y)=>{if(($.version?H.find((T)=>T.version===$.version)?.id:void 0)===z){let T=Y[0];if(T)g({to:"/projects/$projectId/files/$fileId",params:{projectId:U,fileId:_},search:(L1)=>({...L1,version:T.id})})}}})]}),J("div",{className:"flex items-center gap-2",children:[J("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!_&&!h&&V&&L("button",{onClick:V,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:R?"Show Left Sidebar":"Hide Left Sidebar",children:R?L(l0,{className:"h-4 w-4"}):L(u0,{className:"h-4 w-4 fill-primary stroke-0"})}),!_&&!h&&Q&&C&&J(w,{children:[L("button",{onClick:()=>C("card"),className:`rounded p-1.5 transition-colors ${Q==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:L(w0,{className:"h-4 w-4"})}),L("button",{onClick:()=>C("list"),className:`rounded p-1.5 transition-colors ${Q==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:L(b0,{className:"h-4 w-4"})})]}),L("button",{onClick:D,className:`rounded p-1.5 transition-colors ${!k&&!A?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:k?"Show Right Sidebar":"Hide Right Sidebar",children:!k&&!A?L(x0,{className:"h-4 w-4 fill-primary stroke-0"}):L(c0,{className:"h-4 w-4"})})]}),!h&&B&&L(g0,{children:J(D0,{children:[L(p0,{asChild:!0,children:L("span",{children:L("button",{disabled:!1,onClick:B,className:l("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",A?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:A?L(j0,{className:"h-6 w-6 text-primary transition-colors"}):L(y0,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),L(m0,{children:L("p",{children:A?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function I1(){let{projectState:N}=i0(),U=o0(),{isChatbotOpen:K,setIsChatbotOpen:S}=n0();if(!N)return L(J1,{});let{teamId:$,projectId:F,projectName:G,ancestorFolders:Q,currentAsset:C,isRootFolder:R,customTerminalBreadcrumb:V,fileId:k,downloadInfo:D,versions:A,isPublic:B,shareId:h,allowDownload:W,onFolderClick:Z,onRename:q,onDelete:_,compareMode:f,canCompareVersions:b,onCompareVersions:E}=N,H=!!k,x=!!V,y=!!h&&!H,j=H?U.fileViewLeftSidebarCollapsed:y?U.shareConfigLeftSidebarCollapsed:U.fileListLeftSidebarCollapsed,g=B?void 0:()=>H?U.setFileViewLeftSidebarCollapsed(!U.fileViewLeftSidebarCollapsed):y?U.setShareConfigLeftSidebarCollapsed(!U.shareConfigLeftSidebarCollapsed):U.setFileListLeftSidebarCollapsed(!U.fileListLeftSidebarCollapsed),p=B&&N.isRightSidebarCollapsed!==void 0?N.isRightSidebarCollapsed:H?U.fileViewRightSidebarCollapsed:y?U.shareConfigRightSidebarCollapsed:U.fileListRightSidebarCollapsed,r=B&&N.onRightSidebarToggle?N.onRightSidebarToggle:()=>{if(!B&&K)if(S(!1),H)U.setFileViewRightSidebarCollapsed(!1);else if(y)U.setShareConfigRightSidebarCollapsed(!1);else U.setFileListRightSidebarCollapsed(!1);else if(H)U.setFileViewRightSidebarCollapsed(!U.fileViewRightSidebarCollapsed);else if(y)U.setShareConfigRightSidebarCollapsed(!U.shareConfigRightSidebarCollapsed);else U.setFileListRightSidebarCollapsed(!U.fileListRightSidebarCollapsed)},m=B?void 0:()=>{S(!K)},U0=F?U.viewModes[F]??"card":"card";return L(t0,{teamId:$,projectId:F,projectName:G,ancestorFolders:Q,currentAsset:C,isRootFolder:R,customTerminalBreadcrumb:V,displayStyle:H||y||x?void 0:U0,onDisplayStyleChange:H||y||x?void 0:B?void 0:(v)=>{if(F)U.setViewMode(F,v)},isLeftSidebarCollapsed:j,onLeftSidebarToggle:g,isRightSidebarCollapsed:p,onRightSidebarToggle:r,isChatbotOpen:!B&&K,onChatbotToggle:m,isPublic:B,shareId:h,allowDownload:W,fileId:k,downloadInfo:D,versions:A,onFolderClick:Z,onRename:q,onDelete:_,compareMode:f,canCompareVersions:b,onCompareVersions:E})}function J1(){return L("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:L(r0,{className:"w-10 h-10 text-orange-600"})})}
2
- export{I1 as af};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{nb as a}from"./chunk-qp1hkx9k.js";import"./chunk-j4byth37.js";export default a();
@@ -1 +0,0 @@
1
- import{n as x}from"./chunk-ddt5224b.js";import"./chunk-zwny8t7c.js";import"./chunk-0rydta2q.js";import"./chunk-7zvv37z0.js";import"./chunk-7w01v7bw.js";import"./chunk-hk5pwxhf.js";import"./chunk-5ex69zt3.js";import"./chunk-wzw7rrfy.js";import"./chunk-n3e4agsa.js";import"./chunk-yvknqnkb.js";import"./chunk-ptmxkptc.js";import"./chunk-p2wyyvfa.js";import"./chunk-eekmnfn4.js";import"./chunk-r7crhkhn.js";import"./chunk-px660tvj.js";import"./chunk-a6s80m0k.js";import"./chunk-q3y6kdkh.js";import"./chunk-ar79dg9g.js";import{Ue as f}from"./chunk-bdwtaj3w.js";import{jf as p}from"./chunk-nn753fbs.js";import"./chunk-c4yr75hy.js";import"./chunk-4yp5add5.js";import"./chunk-4st1t79p.js";import"./chunk-mffjg6zb.js";import"./chunk-3h4t28zz.js";import"./chunk-qt6j0fm6.js";import"./chunk-nc9hbzad.js";import"./chunk-z8s40zfa.js";import"./chunk-zcxajg6j.js";import"./chunk-vhcsdnzv.js";import"./chunk-03ec6p4p.js";import"./chunk-331s5eb9.js";import"./chunk-tn24as5d.js";import"./chunk-naaa5ejw.js";import{Hh as h}from"./chunk-8qryr65z.js";import{Lh as w,Nh as a,Sh as l,Th as r,di as o,pi as c}from"./chunk-5ctpz542.js";import{nm as m}from"./chunk-j4byth37.js";var g=m(w(),1);function v(){let{projectId:e}=d.useParams(),{teamId:s,ensureTeamIdForProject:n}=h();g.useEffect(()=>{n(e)},[e,n]);let{data:i}=r(f(e)),t=i?.rootFolder,{data:b}=l({queryKey:["folders",t],queryFn:()=>(async()=>{return await(await c.api.folders[":folderId"].$get({param:{folderId:t}})).json()})(),enabled:!!t});if(!s||!t||!b)return a(p,{});return a(x,{teamId:s,projectId:e,projectName:i.name??"",assetId:"recently-deleted",rootFolderId:t})}var d=o("/projects/$projectId/recently-deleted")({component:v});export{d as Route};
@@ -1,2 +0,0 @@
1
- import{$ as p,_ as o,aa as r,ca as x,da as $0,ka as F5,la as d0}from"./chunk-n3e4agsa.js";import{xa as u0}from"./chunk-q3y6kdkh.js";import{Pf as o0,Qf as k5,Rf as V5}from"./chunk-mffjg6zb.js";import{Hg as P5,wg as _5,xg as m5,yg as U5}from"./chunk-z8s40zfa.js";import{Vg as W0}from"./chunk-331s5eb9.js";import{Xg as R0,Yg as b,bh as S2,gh as G0,lh as G2}from"./chunk-tn24as5d.js";import{sh as U0,th as P0,uh as k0}from"./chunk-naaa5ejw.js";import{vh as W5,xh as z5,yh as M5,zh as w5}from"./chunk-8qryr65z.js";import{$i as y2,$j as Q0,Dk as G5,Ei as c0,Ek as B5,Gi as N5,Ik as w0,Kj as Y5,Lh as h,Nh as X,Oh as H,Ph as $5,Pi as u2,Ti as n0,Uh as W2,Wi as J5,Yi as i0,Zi as z0,_i as x2,_k as f0,dl as V0,fj as v2,fl as i,ii as v0,ik as M0,il as m,ji as f2,jl as i2,kk as K5,kl as o2,ll as p2,ml as r2,ni as m0,ol as s2,pi as u,pl as a2,qk as h0,ql as O0,sk as q5,uj as Z5,uk as Q5,vi as B2,vj as X5,wk as H5}from"./chunk-5ctpz542.js";import{nm as j}from"./chunk-j4byth37.js";function g5($){let N=$.lastIndexOf(".");if(N>0)return[0,N];return[0,$.length]}function B1($){$.focus();let[N,J]=g5($.value);if(typeof $.setSelectionRange==="function")$.setSelectionRange(N,J);else $.select()}var V2=Symbol.for("immer-nothing"),w2=Symbol.for("immer-draftable"),v=Symbol.for("immer-state");function d($,...N){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var F0=Object.getPrototypeOf;function H0($){return!!$&&!!$[v]}function Y0($){if(!$)return!1;return F2($)||Array.isArray($)||!!$[w2]||!!$.constructor?.[w2]||A0($)||x0($)}var S5=Object.prototype.constructor.toString(),_2=new WeakMap;function F2($){if(!$||typeof $!=="object")return!1;let N=Object.getPrototypeOf($);if(N===null||N===Object.prototype)return!0;let J=Object.hasOwnProperty.call(N,"constructor")&&N.constructor;if(J===Object)return!0;if(typeof J!=="function")return!1;let Z=_2.get(J);if(Z===void 0)Z=Function.toString.call(J),_2.set(J,Z);return Z===S5}function S0($,N,J=!0){if(b0($)===0)(J?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{N(Y,$[Y],$)});else $.forEach((Z,Y)=>N(Y,Z,$))}function b0($){let N=$[v];return N?N.type_:Array.isArray($)?1:A0($)?2:x0($)?3:0}function a0($,N){return b0($)===2?$.has(N):Object.prototype.hasOwnProperty.call($,N)}function L2($,N,J){let Z=b0($);if(Z===2)$.set(N,J);else if(Z===3)$.add(J);else $[N]=J}function T5($,N){if($===N)return $!==0||1/$===1/N;else return $!==$&&N!==N}function A0($){return $ instanceof Map}function x0($){return $ instanceof Set}function X0($){return $.copy_||$.base_}function t0($,N){if(A0($))return new Map($);if(x0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let J=F2($);if(N===!0||N==="class_only"&&!J){let Z=Object.getOwnPropertyDescriptors($);delete Z[v];let Y=Reflect.ownKeys(Z);for(let q=0;q<Y.length;q++){let K=Y[q],Q=Z[K];if(Q.writable===!1)Q.writable=!0,Q.configurable=!0;if(Q.get||Q.set)Z[K]={configurable:!0,writable:!0,enumerable:Q.enumerable,value:$[K]}}return Object.create(F0($),Z)}else{let Z=F0($);if(Z!==null&&J)return{...$};let Y=Object.create(Z);return Object.assign(Y,$)}}function Z2($,N=!1){if(y0($)||H0($)||!Y0($))return $;if(b0($)>1)Object.defineProperties($,{set:g0,add:g0,clear:g0,delete:g0});if(Object.freeze($),N)Object.values($).forEach((J)=>Z2(J,!0));return $}function E5(){d(2)}var g0={value:E5};function y0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var b5={};function K0($){let N=b5[$];if(!N)d(0,$);return N}var L0;function C2(){return L0}function x5($,N){return{drafts_:[],parent_:$,immer_:N,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function m2($,N){if(N)K0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=N}function e0($){$2($),$.drafts_.forEach(y5),$.drafts_=null}function $2($){if($===L0)L0=$.parent_}function U2($){return L0=x5(L0,$)}function y5($){let N=$[v];if(N.type_===0||N.type_===1)N.revoke_();else N.revoked_=!0}function P2($,N){N.unfinalizedDrafts_=N.drafts_.length;let J=N.drafts_[0];if($!==void 0&&$!==J){if(J[v].modified_)e0(N),d(4);if(Y0($)){if($=T0(N,$),!N.parent_)E0(N,$)}if(N.patches_)K0("Patches").generateReplacementPatches_(J[v].base_,$,N.patches_,N.inversePatches_)}else $=T0(N,J,[]);if(e0(N),N.patches_)N.patchListener_(N.patches_,N.inversePatches_);return $!==V2?$:void 0}function T0($,N,J){if(y0(N))return N;let Z=$.immer_.shouldUseStrictIteration(),Y=N[v];if(!Y)return S0(N,(q,K)=>k2($,Y,N,q,K,J),Z),N;if(Y.scope_!==$)return N;if(!Y.modified_)return E0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let q=Y.copy_,K=q,Q=!1;if(Y.type_===3)K=new Set(q),q.clear(),Q=!0;if(S0(K,(W,z)=>k2($,Y,q,W,z,J,Q),Z),E0($,q,!1),J&&$.patches_)K0("Patches").generatePatches_(Y,J,$.patches_,$.inversePatches_)}return Y.copy_}function k2($,N,J,Z,Y,q,K){if(Y==null)return;if(typeof Y!=="object"&&!K)return;let Q=y0(Y);if(Q&&!K)return;if(H0(Y)){let W=q&&N&&N.type_!==3&&!a0(N.assigned_,Z)?q.concat(Z):void 0,z=T0($,Y,W);if(L2(J,Z,z),H0(z))$.canAutoFreeze_=!1;else return}else if(K)J.add(Y);if(Y0(Y)&&!Q){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(N&&N.base_&&N.base_[Z]===Y&&Q)return;if(T0($,Y),(!N||!N.scope_.parent_)&&typeof Z!=="symbol"&&(A0(J)?J.has(Z):Object.prototype.propertyIsEnumerable.call(J,Z)))E0($,Y)}}function E0($,N,J=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)Z2(N,J)}function v5($,N){let J=Array.isArray($),Z={type_:J?1:0,scope_:N?N.scope_:C2(),modified_:!1,finalized_:!1,assigned_:{},parent_:N,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=Z,q=X2;if(J)Y=[Z],q=C0;let{revoke:K,proxy:Q}=Proxy.revocable(Y,q);return Z.draft_=Q,Z.revoke_=K,Q}var X2={get($,N){if(N===v)return $;let J=X0($);if(!a0(J,N))return D5($,J,N);let Z=J[N];if($.finalized_||!Y0(Z))return Z;if(Z===r0($.base_,N))return s0($),$.copy_[N]=J2(Z,$);return Z},has($,N){return N in X0($)},ownKeys($){return Reflect.ownKeys(X0($))},set($,N,J){let Z=A2(X0($),N);if(Z?.set)return Z.set.call($.draft_,J),!0;if(!$.modified_){let Y=r0(X0($),N),q=Y?.[v];if(q&&q.base_===J)return $.copy_[N]=J,$.assigned_[N]=!1,!0;if(T5(J,Y)&&(J!==void 0||a0($.base_,N)))return!0;s0($),N2($)}if($.copy_[N]===J&&(J!==void 0||(N in $.copy_))||Number.isNaN(J)&&Number.isNaN($.copy_[N]))return!0;return $.copy_[N]=J,$.assigned_[N]=!0,!0},deleteProperty($,N){if(r0($.base_,N)!==void 0||N in $.base_)$.assigned_[N]=!1,s0($),N2($);else delete $.assigned_[N];if($.copy_)delete $.copy_[N];return!0},getOwnPropertyDescriptor($,N){let J=X0($),Z=Reflect.getOwnPropertyDescriptor(J,N);if(!Z)return Z;return{writable:!0,configurable:$.type_!==1||N!=="length",enumerable:Z.enumerable,value:J[N]}},defineProperty(){d(11)},getPrototypeOf($){return F0($.base_)},setPrototypeOf(){d(12)}},C0={};S0(X2,($,N)=>{C0[$]=function(){return arguments[0]=arguments[0][0],N.apply(this,arguments)}});C0.deleteProperty=function($,N){return C0.set.call(this,$,N,void 0)};C0.set=function($,N,J){return X2.set.call(this,$[0],N,J,$[0])};function r0($,N){let J=$[v];return(J?X0(J):$)[N]}function D5($,N,J){let Z=A2(N,J);return Z?"value"in Z?Z.value:Z.get?.call($.draft_):void 0}function A2($,N){if(!(N in $))return;let J=F0($);while(J){let Z=Object.getOwnPropertyDescriptor(J,N);if(Z)return Z;J=F0(J)}return}function N2($){if(!$.modified_){if($.modified_=!0,$.parent_)N2($.parent_)}}function s0($){if(!$.copy_)$.copy_=t0($.base_,$.scope_.immer_.useStrictShallowCopy_)}var j5=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(N,J,Z)=>{if(typeof N==="function"&&typeof J!=="function"){let q=J;J=N;let K=this;return function(W=q,...z){return K.produce(W,(M)=>J.call(this,M,...z))}}if(typeof J!=="function")d(6);if(Z!==void 0&&typeof Z!=="function")d(7);let Y;if(Y0(N)){let q=U2(this),K=J2(N,void 0),Q=!0;try{Y=J(K),Q=!1}finally{if(Q)e0(q);else $2(q)}return m2(q,Z),P2(Y,q)}else if(!N||typeof N!=="object"){if(Y=J(N),Y===void 0)Y=N;if(Y===V2)Y=void 0;if(this.autoFreeze_)Z2(Y,!0);if(Z){let q=[],K=[];K0("Patches").generateReplacementPatches_(N,Y,q,K),Z(q,K)}return Y}else d(1,N)},this.produceWithPatches=(N,J)=>{if(typeof N==="function")return(K,...Q)=>this.produceWithPatches(K,(W)=>N(W,...Q));let Z,Y;return[this.produce(N,J,(K,Q)=>{Z=K,Y=Q}),Z,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!Y0($))d(8);if(H0($))$=h5($);let N=U2(this),J=J2($,void 0);return J[v].isManual_=!0,$2(N),J}finishDraft($,N){let J=$&&$[v];if(!J||!J.isManual_)d(9);let{scope_:Z}=J;return m2(Z,N),P2(void 0,Z)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,N){let J;for(J=N.length-1;J>=0;J--){let Y=N[J];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(J>-1)N=N.slice(J+1);let Z=K0("Patches").applyPatches_;if(H0($))return Z($,N);return this.produce($,(Y)=>Z(Y,N))}};function J2($,N){let J=A0($)?K0("MapSet").proxyMap_($,N):x0($)?K0("MapSet").proxySet_($,N):v5($,N);return(N?N.scope_:C2()).drafts_.push(J),J}function h5($){if(!H0($))d(10,$);return R2($)}function R2($){if(!Y0($)||y0($))return $;let N=$[v],J,Z=!0;if(N){if(!N.modified_)return N.base_;N.finalized_=!0,J=t0($,N.scope_.immer_.useStrictShallowCopy_),Z=N.scope_.immer_.shouldUseStrictIteration()}else J=t0($,!0);if(S0(J,(Y,q)=>{L2(J,Y,R2(q))},Z),N)N.finalized_=!1;return J}var c5=new j5,O2=c5.produce;var n5=($)=>(N,J,Z)=>{return Z.setState=(Y,q,...K)=>{let Q=typeof Y==="function"?O2(Y):Y;return N(Q,q,...K)},$(Z.setState,J,Z)},I2=n5;var D0=v0()(f2(I2(($,N)=>({members:[],loading:!1,fetchMembers:async(J,Z,Y)=>{if(!Y&&N().loadedTeamId===J&&N().loadedWithAgents===Z)return;$({loading:!0});try{let q=await u.api.teams[":teamId"].members.$get({param:{teamId:J},query:{includeAgents:Z?"true":"false"}});if(!q.ok)throw Error("failed to fetch members");let K=await q.json();$({members:K||[],loadedTeamId:J,loadedProjectId:void 0,loadedWithAgents:Z,loading:!1})}catch{$({loading:!1})}},fetchProjectMembers:async(J,Z,Y)=>{if(!Y&&N().loadedProjectId===J&&N().loadedWithAgents===Z)return;$({loading:!0});try{let q=await u.api.projects[":projectId"].members.$get({param:{projectId:J},query:{includeAgents:Z?"true":"false"}});if(!q.ok)throw Error("failed to fetch project members");let K=await q.json();$({members:K||[],loadedProjectId:J,loadedTeamId:void 0,loadedWithAgents:Z,loading:!1})}catch{$({loading:!1})}}}))));var a=v0(($)=>({fields:[],loadedProjectId:null,setFields:(N,J)=>$({fields:N,loadedProjectId:J}),updateFields:(N)=>$({fields:N})}));function Y2($,N,J){let Z=b($,J?.in);if(isNaN(N))return R0(J?.in||$,NaN);if(!N)return Z;let Y=Z.getDate(),q=R0(J?.in||$,Z.getTime());q.setMonth(Z.getMonth()+N+1,0);let K=q.getDate();if(Y>=K)return q;else return Z.setFullYear(q.getFullYear(),q.getMonth(),Y),Z}function g2($,N){let J=b($,N?.in),Z=J.getMonth();return J.setFullYear(J.getFullYear(),Z+1,0),J.setHours(23,59,59,999),J}function T2($,N){let[J,Z]=S2($,N.start,N.end);return{start:J,end:Z}}function E2($,N){let{start:J,end:Z}=T2(N?.in,$),Y=+J>+Z,q=Y?+J:+Z,K=Y?Z:J;K.setHours(0,0,0,0);let Q=N?.step??1;if(!Q)return[];if(Q<0)Q=-Q,Y=!Y;let W=[];while(+K<=q)W.push(R0(J,K)),K.setDate(K.getDate()+Q),K.setHours(0,0,0,0);return Y?W.reverse():W}function j0($,N){return b($,N?.in).getDate()}function b2($,N){return b($,N?.in).getDay()}function K2($,N){return b($,N?.in).getHours()}function q2($,N){return b($,N?.in).getMinutes()}function Q2($,N){return b($,N?.in).getMonth()}function H2($,N){return b($,N?.in).getFullYear()}var t=j(h(),1);var d5=({value:$,config:N,onSave:J,readOnly:Z})=>{let Y=N?.date,[q,K]=t.useState(!1),Q=t.useRef(null),W=$?new Date($):new Date,z=G0(W)?W:new Date,[M,w]=t.useState(z);t.useEffect(()=>{if(q&&$){let P=new Date($);if(G0(P))w(P)}},[q,$]),t.useEffect(()=>{let P=(B)=>{if(Q.current&&!Q.current.contains(B.target)){if(q)K(!1)}};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[q]);let V=()=>{if(!Z)K(!0)},A=(P)=>{if(!P)return"";let B=new Date(P);if(!G0(B))return"Invalid Date";let F="PPP";if(Y?.displayFormat==="usa")F="MM/dd/yyyy";else if(Y?.displayFormat==="euro")F="dd/MM/yyyy";else if(Y?.displayFormat==="iso")F="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")F+=" HH:mm";else F+=" p";let f=G2(B,F);if(Y?.displayTimezone)f+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return f},G=new Date(M.getFullYear(),M.getMonth(),1),L=g2(M),O=E2({start:G,end:L}),T=b2(G),U=(P)=>{let B=new Date(P);if(Y?.includeTime)B.setHours(K2(z)),B.setMinutes(q2(z));let F=B.toISOString();if(J(F),!Y?.includeTime)K(!1)},I=(P,B)=>{let F=$?new Date($):new Date;if(!G0(F))F.setTime(new Date().getTime());if(P==="hour")F.setHours(B);if(P==="minute")F.setMinutes(B);let f=F.toISOString();J(f)},k=Array.from({length:24},(P,B)=>B),E=Array.from({length:12},(P,B)=>B*5);if(q)return H("div",{className:"relative w-full",ref:Q,children:[X("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:$?A($):X("span",{className:"text-muted-foreground",children:"Select date..."})}),H("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:[H("div",{className:"p-4 w-64",children:[H("div",{className:"flex justify-between items-center mb-4",children:[X("button",{onClick:()=>w(Y2(M,-1)),className:"p-1 hover:bg-accent rounded",children:X(x2,{className:"w-4 h-4"})}),X("span",{className:"font-semibold text-sm",children:G2(M,"MMMM yyyy")}),X("button",{onClick:()=>w(Y2(M,1)),className:"p-1 hover:bg-accent rounded",children:X(y2,{className:"w-4 h-4"})})]}),X("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((P)=>X("div",{children:P},P))}),H("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:T}).map((P,B)=>X("div",{},`empty-${B}`)),O.map((P)=>{let B=$?new Date($):null,F=B&&G0(B)&&j0(B)===j0(P)&&Q2(B)===Q2(P)&&H2(B)===H2(P);return X("button",{onClick:()=>U(P),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${F?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:j0(P)},P.toString())})]})]}),Y?.includeTime&&H("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[H("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[X(v2,{className:"w-3 h-3"})," Time"]}),H("div",{className:"flex flex-1 h-64",children:[X("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:k.map((P)=>X("div",{onClick:()=>I("hour",P),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${K2(z)===P?"bg-primary/10 font-medium text-primary":""}`,children:P.toString().padStart(2,"0")},P))}),X("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:E.map((P)=>X("div",{onClick:()=>I("minute",P),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${q2(z)===P?"bg-primary/10 font-medium text-primary":""}`,children:P.toString().padStart(2,"0")},P))})]})]})]})]});return X("div",{onClick:V,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?A($):X("span",{className:"text-muted-foreground italic",children:"Empty"})})},D2=d5;var l=j(h(),1);var l5=({value:$,onSave:N,readOnly:J})=>{let[Z,Y]=l.useState(!1),[q,K]=l.useState($||""),Q=l.useRef(null),W=l.useRef(null),[z,M]=l.useState(!1);l.useEffect(()=>{K($||"")},[$]),l.useEffect(()=>{if(Z&&Q.current)Q.current.focus(),M(!1)},[Z]),l.useEffect(()=>{let G=(L)=>{if(z&&W.current&&!W.current.contains(L.target))M(!1)};if(z)document.addEventListener("mousedown",G);return()=>{document.removeEventListener("mousedown",G)}},[z]);let w=()=>{Y(!1),N(q)},V=(G)=>{G.stopPropagation(),M(!0)},A=(G)=>{if(G.stopPropagation(),!J)Y(!0)};if(Z)return X("textarea",{ref:Q,value:q,onChange:(G)=>K(G.target.value),onBlur:w,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return H("div",{ref:W,className:"relative w-full text-sm",children:[X("div",{onClick:V,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 ${!J?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:X("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&X("div",{onClick:A,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 ${!J?"cursor-text":""}`,children:$?$:X("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},j2=l5;var e=j(h(),1);var u5=({value:$,config:N,onSave:J,readOnly:Z})=>{let Y=N?.number,[q,K]=e.useState(!1),[Q,W]=e.useState(""),z=e.useRef(null);e.useEffect(()=>{W($!==void 0&&$!==null?$.toString():"")},[$]),e.useEffect(()=>{if(q&&z.current)z.current.focus()},[q]);let M=()=>{if(!Z)K(!0)},w=()=>{if(K(!1),Q==="")J(void 0);else{let G=parseFloat(Q);J(isNaN(G)?void 0:G)}},V=(G)=>{if(G.key==="Enter")G.stopPropagation(),z.current?.blur()},A=(G)=>{if(G===void 0||G===null||isNaN(G))return"";return G.toFixed(Y?.scale)};if(q)return X("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:Q,onChange:(G)=>W(G.target.value),onBlur:w,onKeyDown:V,onDoubleClick:(G)=>G.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 X("div",{onClick:M,onDoubleClick:(G)=>G.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 ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?A($):X("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},h2=u5;var c2=j(h(),1);var i5=({value:$,config:N,onSave:J,readOnly:Z})=>{let Y=N?.rating,q=Math.max(2,Math.min(6,Y?.maxValue||5)),[K,Q]=c2.useState(null),W=(M,w)=>{if(M.stopPropagation(),Z)return;let V;if($===w)V=0;else V=w;J(V)},z=Array.from({length:q},(M,w)=>w+1);return X("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!Z&&Q(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let w=K!==null?M<=K:M<=($||0);return X("button",{onClick:(V)=>W(V,M),onMouseEnter:()=>!Z&&Q(M),className:`focus:outline-none transition-transform ${!Z?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:Z,children:X(h0,{className:`w-5 h-5 transition-colors ${w?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},n2=i5;var M2=j(h(),1);var q0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(q0||(q0={}));class B0 extends Error{constructor($,N){super(`${N} (${$})`);this.name="ULIDError",this.code=$}}function o5($){let N=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(N)}function p5($){let N=r5(),J=N&&(N.crypto||N.msCrypto)||null;if(typeof J?.getRandomValues==="function")return()=>{let Z=new Uint8Array(1);return J.getRandomValues(Z),Z[0]/256};else if(typeof J?.randomBytes==="function")return()=>J.randomBytes(1).readUInt8()/256;throw new B0(q0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function r5(){if(t5())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function s5($,N){let J="";for(;$>0;$--)J=o5(N)+J;return J}function a5($,N=10){if(isNaN($))throw new B0(q0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new B0(q0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new B0(q0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new B0(q0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let J,Z="";for(let Y=N;Y>0;Y--)J=$%32,Z="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)+Z,$=($-J)/32;return Z}function t5(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function d2($,N){let J=N||p5(),Z=!$||isNaN($)?Date.now():$;return a5(Z,10)+s5(16,J)}function e5($,N,J){let Z=$.slice();return Z.splice(J,0,Z.splice(N,1)[0]),Z}function l2($,N,J,Z){if(J===Z)return $;let Y=e5(N,J,Z),q=new Set(N.map((Q)=>Q.id)),K=0;return $.map((Q)=>q.has(Q.id)?Y[K++]:Q)}async function Q4($){let N=[],J=[],Z=$.items;if(Z)for(let K=0;K<Z.length;K++){let Q=Z[K];if(Q.kind==="file"){let W=Q.webkitGetAsEntry?.();if(W)J.push({entry:W,path:""})}}else return Array.from($.files);let Y=(K)=>{return new Promise((Q)=>{K.readEntries((W)=>Q(W),()=>Q([]))})},q=(K)=>{return new Promise((Q,W)=>{K.file((z)=>Q(z),(z)=>W(z))})};while(J.length>0){let K=J.shift();if(!K)continue;let{entry:Q,path:W}=K;if(Q.isFile)try{let z=await q(Q),M=W?`${W}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),N.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(Q.isDirectory){let z=Q.createReader(),M=[],w=await Y(z);while(w.length>0)M=M.concat(w),w=await Y(z);let V=W?`${W}/${Q.name}`:Q.name;for(let A of M)J.push({entry:A,path:V})}}return N}var c=j(h(),1);var t2=j(h(),1);function e2(){let[$,N]=t2.useState(!1);return H(i2,{open:$,onOpenChange:N,children:[X(o2,{asChild:!0,children:H(i,{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:m.autofill_source_help_title(),children:[X(B2,{className:"h-3.5 w-3.5"}),X("span",{className:"sr-only",children:m.autofill_source_help_title()})]})}),H(p2,{className:"sm:max-w-[500px]",children:[H(r2,{children:[H(s2,{className:"flex items-center gap-2",children:[X(B2,{className:"h-5 w-5 text-muted-foreground"}),m.autofill_source_help_title()]}),X(a2,{children:m.autofill_source_help_desc()})]}),H("div",{className:"space-y-4 py-2",children:[H("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[H("div",{className:"flex items-center gap-2 font-medium text-sm",children:[X(u2,{className:"h-4 w-4 text-muted-foreground shrink-0"}),X("span",{children:m.autofill_source_none()})]}),X("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.autofill_source_none_desc()}),X("p",{className:"text-xs italic text-muted-foreground/80",children:m.autofill_source_none_example()})]}),H("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[H("div",{className:"flex items-center gap-2 font-medium text-sm",children:[X(c0,{className:"h-4 w-4 text-amber-500 shrink-0"}),X("span",{children:m.autofill_source_content()})]}),X("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.autofill_source_content_desc()}),X("p",{className:"text-xs italic text-muted-foreground/80",children:m.autofill_source_content_example()})]}),H("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[H("div",{className:"flex items-center gap-2 font-medium text-sm",children:[X(n0,{className:"h-4 w-4 text-blue-500 shrink-0"}),X("span",{children:m.autofill_source_creation_context()})]}),X("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.autofill_source_creation_context_desc()}),X("p",{className:"text-xs italic text-muted-foreground/80",children:m.autofill_source_creation_context_example()})]})]})]})]})}var l0=["red","orange","yellow","green","blue","purple","gray"],z2={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 _0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let N=$.toLowerCase(),J=z2[N];if(J)return{backgroundColor:J.bg,color:J.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}function I0($=[]){let N=new Set($.map((Z)=>Z.color?.toLowerCase()).filter(Boolean)),J=l0.filter((Z)=>!N.has(Z.toLowerCase()));if(J.length>0)return J[Math.floor(Math.random()*J.length)];return l0[Math.floor(Math.random()*l0.length)]}var $1={[x.text]:H5,[x.longText]:N5,[x.select]:Y5,[x.selectMulti]:q5,[x.rating]:h0,[x.number]:X5,[x.toggle]:Q5,[x.date]:J5,[x.user]:G5,[x.userMulti]:B5};function N1({field:$,index:N,onVisibilityChange:J}){let{ref:Z,handleRef:Y}=V5({id:$.id,index:N}),q=$.config?.type?$1[$.config.type]:null;return H("div",{ref:Z,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[H("div",{className:"flex items-center gap-2",children:[X("div",{ref:Y,className:"cursor-grab",children:X(Z5,{className:"h-4 w-4 text-muted-foreground"})}),q&&X(q,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.config?.autofillSource===$0.CONTENT&&X(c0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.config?.autofillSource===$0.CREATION_CONTEXT&&X(n0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),X("span",{className:"text-sm truncate",children:$.config?.name})]}),X(u0,{checked:$.visible,onCheckedChange:(K)=>J($.id,K)})]})}function x4({projectId:$,onManageFields:N,onSave:J}){let{fields:Z,updateFields:Y}=a(),[q,K]=c.useState(""),[Q,W]=c.useState("list"),[z,M]=c.useState(""),[w,V]=c.useState(""),[A,G]=c.useState($0.NONE),[L,O]=c.useState(""),[T,U]=c.useState([]),I=$5();c.useEffect(()=>{I.invalidateQueries({queryKey:["fields",$]})},[$,I]);let k=u.api.projects[":projectId"].fields.order.$patch,{mutate:E}=W2({mutationFn:async(_)=>{if(!(await k(_)).ok)throw Error(m.failed_update_fields_order());return null}}),P=u.api.projects[":projectId"].fields.$post,{mutate:B}=W2({mutationFn:async(_)=>{let R=await P(_);if(!R.ok)throw Error(m.failed_create_field());return await R.json()},onSuccess:(_)=>{let R={..._,visible:!0},S=[...Z,R];Y(S),M(""),U([]),E({param:{projectId:$},json:S.map((C)=>({fieldId:C.id,visible:C.visible||!1}))}),J?.()}}),F=c.useMemo(()=>Z.filter((_)=>_.config?.name?.toLowerCase().includes(q.toLowerCase())),[Z,q]),f=(_)=>{if(_.canceled)return;let{source:R}=_.operation;if(!k5(R))return;let{initialIndex:S,index:C}=R;if(S===C)return;let n=l2(Z,F,S,C);Y(n),E({param:{projectId:$},json:n.map((Z0)=>({fieldId:Z0.id,visible:Z0.visible||!1}))})},y=(_,R)=>{let S=Z.map((C)=>C.id===_?{...C,visible:R}:C);Y(S),E({param:{projectId:$},json:S.map((C)=>({fieldId:C.id,visible:C.visible||!1}))})},g=()=>{if(!z||!w)return;let _=w===x.select?{select:{options:T}}:w===x.selectMulti?{selectMulti:{options:T}}:{};B({param:{projectId:$},json:{config:{name:z,type:w,autofillSource:A,..._},label:z,description:L}})},D=Z.filter((_)=>_.visible).length;if(Q==="create")return X("div",{className:"w-80 p-4",children:H("div",{className:"space-y-4",children:[H("div",{className:"space-y-2",children:[X(W0,{htmlFor:"field-name",children:m.field_name()}),X(O0,{id:"field-name",placeholder:m.new_field_placeholder(),value:z,onChange:(_)=>M(_.target.value),autoFocus:!0})]}),H("div",{className:"space-y-2",children:[X(W0,{children:m.field_type()}),H(W5,{children:[X(z5,{asChild:!0,children:H(i,{variant:"outline",className:"w-full justify-between font-normal",children:[w?X("span",{className:"capitalize",children:w.replace(/_/g," ")}):X("span",{className:"text-muted-foreground border-dashed",children:m.select_field_type()}),X(z0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),X(M5,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(x).map((_)=>X(w5,{onClick:()=>{V(_),U([])},className:"capitalize",children:_.replace(/_/g," ")},_))})]})]}),H("div",{className:"space-y-2",children:[X(W0,{htmlFor:"field-desc",children:m.description()}),X(O0,{id:"field-desc",placeholder:m.description_optional_placeholder(),value:L,onChange:(_)=>O(_.target.value)})]}),H("div",{className:"space-y-2",children:[H("div",{className:"flex items-center gap-1",children:[X(W0,{children:m.autofill_source()}),X(e2,{})]}),H(F5,{type:"single",value:A,onValueChange:(_)=>{if(_)G(_)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[X(d0,{value:$0.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:m.autofill_source_none()}),X(d0,{value:$0.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:m.autofill_source_content()}),X(d0,{value:$0.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:m.autofill_source_creation_context()})]})]}),(w===x.select||w===x.selectMulti)&&H("div",{className:"space-y-2",children:[H("div",{className:"flex items-center justify-between",children:[X(W0,{className:"text-sm font-medium",children:m.options()}),H(i,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let _={id:d2(),displayName:m.new_option(),color:I0(T)};U([...T,_])},children:[X(Q0,{className:"h-4 w-4 mr-1"})," ",m.add_option()]})]}),X("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:T.map((_,R)=>H("div",{className:"flex items-center gap-2",children:[X(O0,{value:_.displayName,onChange:(S)=>{let C=[...T];C[R]={..._,displayName:S.target.value},U(C)},placeholder:m.option_name_placeholder(),className:"h-8 flex-1"}),H(o,{children:[X(p,{asChild:!0,children:X("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:z2[_.color||""]?.hex||_.color||"#808080"}})}),X(r,{className:"p-2 w-auto",align:"end",children:X("div",{className:"flex gap-1",children:l0.map((S)=>X("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:z2[S]?.hex||S},onClick:()=>{let C=[...T];C[R]={..._,color:S},U(C)}},S))})})]}),X(i,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{U(T.filter((S,C)=>C!==R))},children:X(w0,{className:"h-4 w-4"})})]},_.id))})]}),H("div",{className:"flex gap-2 pt-2",children:[X(i,{variant:"secondary",className:"flex-1",onClick:()=>{W("list"),M(""),V(""),G($0.NONE),O(""),U([])},children:m.cancel()}),X(i,{className:"flex-1",onClick:g,disabled:!z||!w,children:m.save()})]})]})});return H("div",{className:"w-80 p-4",children:[X("div",{className:"flex items-center justify-between mb-4",children:H("h3",{className:"font-semibold",children:[m.fields()," ",X("span",{className:"text-muted-foreground text-sm font-normal",children:m.visible_count({count:D})})]})}),H("div",{className:"relative mb-4",children:[X(M0,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),X(O0,{placeholder:m.search_fields_placeholder(),value:q,onChange:(_)=>K(_.target.value),className:"pl-8"})]}),X("div",{className:"max-h-60 overflow-y-auto pr-2",children:X(P5,{sensors:[U5.configure({activationConstraints:[new m5.Distance({value:8})]}),_5],onDragEnd:f,children:F.map((_,R)=>X(N1,{field:_,index:R,onVisibilityChange:y},_.id))})}),N&&H("div",{className:"mt-4 space-y-2",children:[H(i,{variant:"secondary",className:"w-full",onClick:N,children:[X(K5,{className:"h-4 w-4 mr-2"}),m.manage_fields()]}),H(i,{className:"w-full",onClick:()=>W("create"),children:[X(Q0,{className:"h-4 w-4 mr-2"}),m.new_field()]})]})]})}var J1=({value:$,config:N,onSave:J,readOnly:Z,fieldId:Y})=>{let q=N?.select,K=q?.options||[],[Q,W]=M2.useState(!1),[z,M]=M2.useState(""),w=K.find((k)=>k.id===$),V=z.trim(),A=K.filter((k)=>k.displayName.toLowerCase().includes(V.toLowerCase())),G=K.some((k)=>k.displayName.trim().toLowerCase()===V.toLowerCase()||k.id.toLowerCase()===V.toLowerCase()),L=()=>{if(!Z)W(!0)},O=(k)=>{J(k),W(!1),M("")},T=(k)=>{if(Z)return;if(W(k),!k)M("")},U=async()=>{if(!V)return;let k={id:V.toLowerCase().replace(/\s+/g,"-"),displayName:V,color:I0(K)},E=[...K,k],P={...N,select:{...q,options:E}};if(Y)try{let B=await u.api.fields[":fieldId"].$put({param:{fieldId:Y},json:{config:P}});if(!B.ok){m0.error(m.failed_update_field());return}let F=await B.json(),y=a.getState().fields.map((g)=>g.id===F.id?{...g,...F,visible:g.visible}:g);a.getState().updateFields(y)}catch{m0.error(m.failed_update_field());return}J(k.id),M(""),W(!1)};return X("div",{className:"relative w-full",onClick:(k)=>k.stopPropagation(),children:H(o,{open:!Z&&Q,onOpenChange:T,children:[X(p,{asChild:!0,children:H("div",{onClick:L,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((k)=>{if(!k)return X("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return X("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:_0(k.color),children:k.displayName})})(w),!Z&&X(z0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),H(r,{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:[H("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(k)=>k.stopPropagation(),children:[X(M0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),X("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:m.search_options_placeholder(),value:z,onChange:(k)=>M(k.target.value),autoFocus:!0})]}),H("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[z===""&&H("div",{onClick:()=>O(""),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:[X(w0,{className:"w-3.5 h-3.5"})," Clear"]}),A.map((k)=>X("div",{onClick:()=>O(k.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${$===k.id?"bg-accent/50 font-medium":""}`,children:X("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:_0(k.color),children:k.displayName})},k.id)),A.length===0&&!V&&X("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:m.no_options_found()}),V!==""&&!G&&H("div",{onClick:U,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:[X(Q0,{className:"w-3.5 h-3.5 shrink-0"}),X("span",{className:"truncate",children:m.add_option_with_name({name:V})})]})]})]})]})})},L5=J1;var N0=j(h(),1);var Z1=({value:$=[],config:N,onSave:J,readOnly:Z,fieldId:Y})=>{let q=N?.selectMulti,K=q?.options||[],Q=N0.useRef(null),[W,z]=N0.useState(!1),[M,w]=N0.useState($.length),[V,A]=N0.useState(""),G=K.filter((B)=>($||[]).includes(B.id))||[],L=V.trim(),O=K.filter((B)=>B.displayName.toLowerCase().includes(L.toLowerCase())),T=K.some((B)=>B.displayName.trim().toLowerCase()===L.toLowerCase()||B.id.toLowerCase()===L.toLowerCase());N0.useLayoutEffect(()=>{if(W){w(G.length);return}if(Q.current){let B=Q.current.clientWidth-8,f=document.createElement("canvas").getContext("2d");if(f&&B>0){f.font="500 12px ui-sans-serif, system-ui, sans-serif";let y=4,g=G.map((n)=>Math.ceil(f.measureText(n.displayName).width)+18);if(g.reduce((n,Z0)=>n+Z0,0)+Math.max(0,g.length-1)*y<=B){w(G.length);return}let R=B-32-y,S=0,C=0;for(let n=0;n<g.length;n++){let Z0=C>0?S+y+g[n]:g[n];if(Z0>R)break;S=Z0,C++}w(C)}}},[G,W,$]);let U=(B)=>{let F=$||[],f;if(F.includes(B))f=F.filter((y)=>y!==B);else f=[...F,B];J(f)},I=async()=>{if(!L)return;let B={id:L.toLowerCase().replace(/\s+/g,"-"),displayName:L,color:I0(K)},F=[...K,B],f={...N,selectMulti:{...q,options:F}};if(Y)try{let y=await u.api.fields[":fieldId"].$put({param:{fieldId:Y},json:{config:f}});if(!y.ok){m0.error(m.failed_update_field());return}let g=await y.json(),_=a.getState().fields.map((R)=>R.id===g.id?{...R,...g,visible:R.visible}:R);a.getState().updateFields(_)}catch{m0.error(m.failed_update_field());return}J([...$||[],B.id]),A("")},k=(B)=>{if(B.stopPropagation(),!Z)z(!0)},E=G.length-M;return X("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:H(o,{open:!Z&&W,onOpenChange:(B)=>{if(Z)return;if(z(B),!B)A("")},children:[X(p,{asChild:!0,children:H("div",{ref:Q,onClick:k,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||E>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[G.length===0&&X("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),G.slice(0,M).map((B)=>X("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:_0(B.color),children:B.displayName},B.id)),E>0&&H("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:["+",E]})]})}),H(r,{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:[H("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(B)=>B.stopPropagation(),children:[X(M0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),X("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:m.search_options_placeholder(),value:V,onChange:(B)=>A(B.target.value),autoFocus:!0})]}),H("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[O.map((B)=>{let F=($||[]).includes(B.id);return H("div",{onClick:()=>U(B.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${F?"bg-accent/30 font-medium":""}`,children:[X("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:_0(B.color),children:B.displayName}),F&&X(i0,{className:"w-3.5 h-3.5 text-primary"})]},B.id)}),O.length===0&&!L&&X("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:m.no_options_found()}),L!==""&&!T&&H("div",{onClick:I,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:[X(Q0,{className:"w-3.5 h-3.5 shrink-0"}),X("span",{className:"truncate",children:m.add_option_with_name({name:L})})]})]})]})]})})},C5=Z1;var J0=j(h(),1);var X1=({value:$,onSave:N,readOnly:J})=>{let[Z,Y]=J0.useState(!1),[q,K]=J0.useState($||""),Q=J0.useRef(null);J0.useEffect(()=>{K($||"")},[$]),J0.useEffect(()=>{if(Z&&Q.current)Q.current.focus()},[Z]);let W=()=>{if(!J)Y(!0)},z=()=>{Y(!1),N(q)},M=(w)=>{if(w.key==="Enter")Q.current?.blur()};if(Z)return X("input",{ref:Q,type:"text",value:q,onChange:(w)=>K(w.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return X("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!J?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||X("span",{className:"text-muted-foreground italic",children:"Empty"})})},A5=X1;var Y1=({value:$,onSave:N,readOnly:J})=>{return X("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:X(u0,{checked:$,onCheckedChange:(Y)=>{if(!J)N(Y)},disabled:J,className:"cursor-pointer"})})},R5=Y1;var p0=j(h(),1);var K1=({value:$,onSave:N,readOnly:J})=>{let Z=o0(),{members:Y,fetchMembers:q}=D0(),[K,Q]=p0.useState(!1);p0.useEffect(()=>{if(Z)q(Z)},[Z,q]);let W=Y.find((G)=>G.id===$),z=()=>{if(!J)Q(!0)},M=(G)=>{N(G),Q(!1)},w=(G)=>{if(J)return;Q(G)},V=(G)=>{return G.split(" ").map((L)=>L[0]).slice(0,2).join("").toUpperCase()};return X("div",{className:"relative w-full",onClick:(G)=>G.stopPropagation(),children:H(o,{open:!J&&K,onOpenChange:w,children:[X(p,{asChild:!0,children:H("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!J?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((G)=>{if(!G)return X("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return H("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:[H(U0,{className:"w-4 h-4",children:[X(P0,{src:G.image,alt:G.name,className:"object-cover"}),X(k0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:V(G.name)})]}),X("span",{className:"truncate max-w-[120px]",children:G.name})]})})(W),!J&&X(z0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),H(r,{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:[H("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[X(w0,{className:"w-3 h-3"})," Clear"]}),Y.map((G)=>H("div",{onClick:()=>M(G.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[H(U0,{className:"w-5 h-5",children:[X(P0,{src:G.image,alt:G.name,className:"object-cover"}),X(k0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:V(G.name)})]}),X("span",{className:"text-sm font-medium text-foreground",children:G.name})]},G.id))]})]})})},O5=K1;var s=j(h(),1);var q1=({value:$=[],onSave:N,readOnly:J})=>{let Z=o0(),{members:Y,fetchMembers:q}=D0(),K=s.useRef(null),[Q,W]=s.useState(!1),[z,M]=s.useState($.length);s.useEffect(()=>{if(Z)q(Z)},[Z,q]);let w=Y.filter((U)=>($||[]).includes(U.id)),V=(U)=>{return U.split(" ").map((I)=>I[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(Q){M(w.length);return}if(K.current){let U=K.current.clientWidth-8,k=document.createElement("canvas").getContext("2d");if(k&&U>0){k.font="500 12px ui-sans-serif, system-ui, sans-serif";let E=4,P=w.map((D)=>{return Math.min(100,Math.ceil(k.measureText(D.name).width))+40});if(P.reduce((D,_)=>D+_,0)+Math.max(0,P.length-1)*E<=U){M(w.length);return}let f=U-32-E,y=0,g=0;for(let D=0;D<P.length;D++){let _=g>0?y+E+P[D]:P[D];if(_>f)break;y=_,g++}M(g)}}},[w,Q,$]);let A=(U)=>{let I=$||[],k;if(I.includes(U))k=I.filter((E)=>E!==U);else k=[...I,U];N(k)},G=(U)=>{if(U.stopPropagation(),!J)W(!0)},L=w.length-z,O=(U)=>{if(J)return;W(U)},T=(U)=>{return H("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:[H(U0,{className:"w-4 h-4",children:[X(P0,{src:U.image,alt:U.name,className:"object-cover"}),X(k0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:V(U.name)})]}),X("span",{className:"truncate max-w-[100px]",children:U.name})]},U.id)};return X("div",{className:"relative w-full",onClick:(U)=>U.stopPropagation(),children:H(o,{open:!J&&Q,onOpenChange:O,children:[X(p,{asChild:!0,children:H("div",{ref:K,onClick:G,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!J||L>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[w.length===0&&X("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.slice(0,z).map(T),L>0&&H("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:["+",L]})]})}),X(r,{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:Y.map((U)=>{let I=($||[]).includes(U.id);return H("div",{onClick:()=>A(U.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[H("div",{className:"flex items-center gap-2",children:[H(U0,{className:"w-5 h-5",children:[X(P0,{src:U.image,alt:U.name,className:"object-cover"}),X(k0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:V(U.name)})]}),X("span",{className:"text-sm font-medium text-foreground",children:U.name})]}),I&&X(i0,{className:"w-4 h-4 text-primary"})]},U.id)})})]})})},I5=q1;var Q1=($)=>{if(!$.config)return X("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return X(A5,{...$,value:$.value,onSave:$.onSave});case"longText":return X(j2,{...$,value:$.value,onSave:$.onSave});case"select":return X(L5,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return X(C5,{...$,value:$.value,onSave:$.onSave});case"rating":return X(n2,{...$,value:$.value,onSave:$.onSave});case"number":return X(h2,{...$,value:$.value,onSave:$.onSave});case"toggle":return X(R5,{...$,value:$.value,onSave:$.onSave});case"date":return X(D2,{...$,value:$.value,onSave:$.onSave});case"user":return X(O5,{...$,value:$.value,onSave:$.onSave});case"userMulti":return X(I5,{...$,value:$.value,onSave:$.onSave});default:return X("div",{children:"Unknown Field Type"})}},v$=Q1;var h$=({progress:$,className:N})=>{let Z=2*Math.PI*20,Y=Z-Math.min(100,Math.max(0,$))/100*Z;return H("svg",{viewBox:"0 0 50 50",className:V0("w-12 h-12",N),children:[X("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),X("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:Z,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),X("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var H1=($)=>{if(isNaN($))return"00:00";let N=new Date($*1000),J=N.getUTCHours(),Z=N.getUTCMinutes().toString().padStart(2,"0"),Y=N.getUTCSeconds().toString().padStart(2,"0");if(J)return`${J}:${Z}:${Y}`;return`${Z}:${Y}`},d$=($,N,J,Z)=>{if(J==="frames")return`${$} fr`;if(J==="standard")return H1($/N);let Y=Math.round(N),q=N!==Y,K=!1;if(q&&(Y===30||Y===60))K=!0;let Q=0;if(Z){let G=Z.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(G){let L=parseInt(G[1],10),O=parseInt(G[2],10),T=parseInt(G[3],10),U=parseInt(G[5],10);if(K=G[4]!==":",Q=(L*3600+O*60+T)*Y+U,K){let I=L*60+O,k=N<30?2:4;Q-=k*(I-Math.floor(I/10))}}}let W=$+Q;if(K){let G=N<30?2:4,L=Math.floor(W/(17982*G/2)),O=W%(17982*G/2);if(O<G)O=O+G;W+=9*G*L+G*Math.floor((O-G)/(1798*G/2))}let z=W%Y,M=Math.floor(W/Y)%60,w=Math.floor(W/(Y*60))%60,V=Math.floor(W/(Y*3600))%24,A=K?";":":";return`${V.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${A}${z.toString().padStart(2,"0")}`};var l$=($,N)=>{if(!N)return 0;let J=1/N;return $*J+J/2},G1=($)=>Math.max(100,3000/($||30)),u$=({dbTotalFrames:$,containerDuration:N,frameRate:J})=>{let Z=J||30,Y=Math.round(N*Z);if($<=0)return Y;let q=$/Z,K=N-q,Q=G1(Z)/1000;return K>Q?Y:$};var f5=j(h(),1);function r$({className:$,defaultValue:N,value:J,min:Z=0,max:Y=100,...q}){let K=f5.useMemo(()=>Array.isArray(J)?J:Array.isArray(N)?N:[Z,Y],[J,N,Z,Y]);return H(f0.Root,{"data-slot":"slider",defaultValue:N,value:J,min:Z,max:Y,className:V0("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",$),...q,children:[X(f0.Track,{"data-slot":"slider-track",className:V0("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:X(f0.Range,{"data-slot":"slider-range",className:V0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:K.length},(Q,W)=>X(f0.Thumb,{"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"},W))]})}
2
- export{Y2 as x,g2 as y,T2 as z,Q2 as A,H2 as B,l2 as C,Q4 as D,a as E,d2 as F,h$ as G,B1 as H,n2 as I,e2 as J,l0 as K,z2 as L,_0 as M,I0 as N,$1 as O,x4 as P,D0 as Q,v$ as R,H1 as S,d$ as T,l$ as U,G1 as V,u$ as W,r$ as X};