@shumai-one/shumai 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/bin/{chunk-mcj1xpcc.js → chunk-01vx2chc.js} +2 -2
  2. package/bin/chunk-0epkrexd.js +2 -0
  3. package/bin/chunk-0h5239kt.js +2 -0
  4. package/bin/{chunk-jt0ykktx.js → chunk-0jnstdgf.js} +1 -1
  5. package/bin/{chunk-x03jwaga.js → chunk-0njsjy6x.js} +4 -4
  6. package/bin/{chunk-7naa7tpn.js → chunk-13rq2gtr.js} +2 -2
  7. package/bin/chunk-1aqs9sdh.js +3 -0
  8. package/bin/{chunk-m0q2cgfg.js → chunk-22jbsrka.js} +1 -1
  9. package/bin/chunk-2qknebmd.js +1 -0
  10. package/bin/{chunk-a411xhmm.js → chunk-2qzmh3ae.js} +4 -4
  11. package/bin/{chunk-2nhgdqdg.js → chunk-2tt0b8ym.js} +2 -2
  12. package/bin/{chunk-p3f5aevs.js → chunk-2zm7czk6.js} +1 -1
  13. package/bin/{chunk-p4s95471.js → chunk-396tfwdx.js} +1 -1
  14. package/bin/chunk-3mx4trvh.js +10 -0
  15. package/bin/{chunk-b5rhvzv9.js → chunk-45pb3kzz.js} +2 -2
  16. package/bin/{chunk-q83h0hkx.js → chunk-47fmhzwv.js} +2 -2
  17. package/bin/chunk-4awk4xhq.js +2 -0
  18. package/bin/{chunk-2cdxm1cp.js → chunk-4b2x2qba.js} +23 -23
  19. package/bin/{chunk-knj2s8mg.js → chunk-4rjy7ybr.js} +8 -8
  20. package/bin/{chunk-q8w4mbw4.js → chunk-598x693h.js} +2 -2
  21. package/bin/chunk-5c7ztqs7.js +1 -0
  22. package/bin/{chunk-2jj4j8cn.js → chunk-65dh7x4c.js} +2 -2
  23. package/bin/{chunk-hnkcgvcj.js → chunk-66e2vrky.js} +1 -1
  24. package/bin/{chunk-g22wmpk1.js → chunk-6j3beg6n.js} +2 -2
  25. package/bin/{chunk-cgmebxx6.js → chunk-6ke13k69.js} +1 -1
  26. package/bin/{chunk-7sgrtxbt.js → chunk-6rqakmg0.js} +2 -2
  27. package/bin/{chunk-4mws03es.js → chunk-6ty4tfmf.js} +3 -3
  28. package/bin/chunk-7e9ws6dh.js +129 -0
  29. package/bin/chunk-7mdddkfc.js +1 -0
  30. package/bin/{chunk-q2bew2vc.js → chunk-7q4mgd5x.js} +2 -2
  31. package/bin/chunk-7yv7shad.js +1 -0
  32. package/bin/{chunk-qwpkcp8d.js → chunk-81b8rfv7.js} +2 -2
  33. package/bin/{chunk-atfz7g7e.js → chunk-8a7ymmd4.js} +2 -2
  34. package/bin/chunk-8ac9at5y.js +2 -0
  35. package/bin/{chunk-gxepkvt2.js → chunk-8zcfgz9c.js} +1 -1
  36. package/bin/{chunk-mcw198kg.js → chunk-955kf5kc.js} +8 -8
  37. package/bin/{chunk-jzgbxqdg.js → chunk-978rm9a9.js} +2 -2
  38. package/bin/{chunk-jt02kpfc.js → chunk-9qzbrp4d.js} +2 -2
  39. package/bin/{chunk-tekwpkjf.js → chunk-a283dh05.js} +2 -2
  40. package/bin/chunk-aa2a06cc.js +1 -0
  41. package/bin/{chunk-8cjet7pp.js → chunk-ajr1w3vq.js} +6 -6
  42. package/bin/chunk-akafypge.js +218 -0
  43. package/bin/chunk-amk373q2.js +2 -0
  44. package/bin/chunk-apq2gvvp.js +4 -0
  45. package/bin/chunk-av2w1sez.js +2 -0
  46. package/bin/{chunk-5wapd171.js → chunk-b6kmj34z.js} +12 -12
  47. package/bin/chunk-bkzaw9p8.js +1 -0
  48. package/bin/{chunk-zezje74z.js → chunk-bssb9tar.js} +3 -3
  49. package/bin/chunk-bwvj1aqc.js +1 -0
  50. package/bin/chunk-by9esjn7.js +3 -0
  51. package/bin/chunk-bywk8mbc.js +2 -0
  52. package/bin/{chunk-9xhjy897.js → chunk-c61g9hfa.js} +4 -4
  53. package/bin/{chunk-zrszykjf.js → chunk-cdcgjh8k.js} +1 -1
  54. package/bin/{chunk-yk12hydf.js → chunk-d277evce.js} +4 -4
  55. package/bin/{chunk-55h9ze53.js → chunk-d3brvxh7.js} +2 -2
  56. package/bin/{chunk-9t3p4xp6.js → chunk-dcb1nzf1.js} +1 -1
  57. package/bin/{chunk-mzsw9var.js → chunk-dfbzatq9.js} +2 -2
  58. package/bin/chunk-e0bckx12.js +2 -0
  59. package/bin/{chunk-3ckkwdjx.js → chunk-e2p4s2pj.js} +3 -3
  60. package/bin/chunk-e8zzg57c.js +2 -0
  61. package/bin/{chunk-vp3czaeh.js → chunk-edfaqwaq.js} +2 -2
  62. package/bin/chunk-ehgrp0f9.js +1 -0
  63. package/bin/chunk-evs2aaav.js +12 -0
  64. package/bin/{chunk-s9ksftq2.js → chunk-f5bhcjhw.js} +1 -1
  65. package/bin/{chunk-ns33grgx.js → chunk-fb9dedm2.js} +2 -2
  66. package/bin/{chunk-srxp5jav.js → chunk-ff0mh9p3.js} +32 -32
  67. package/bin/chunk-fpfby5tz.js +1 -0
  68. package/bin/{chunk-eyjfhdp9.js → chunk-gd3b5akr.js} +2 -2
  69. package/bin/{chunk-1wfg56z3.js → chunk-gm1fy3hm.js} +5 -5
  70. package/bin/{chunk-9n1w5dw1.js → chunk-gqkjx7rz.js} +3 -3
  71. package/bin/{chunk-1nvd90g2.js → chunk-h7f5370s.js} +1 -1
  72. package/bin/chunk-hcyhsn8e.js +2 -0
  73. package/bin/{chunk-vcrmjtcz.js → chunk-jxm0gzmf.js} +2 -2
  74. package/bin/{chunk-b7bnp021.js → chunk-k3ggy3xk.js} +2 -2
  75. package/bin/{chunk-257dcd2f.js → chunk-k9vjs21p.js} +2 -2
  76. package/bin/chunk-ka40gv72.js +1 -0
  77. package/bin/chunk-km70p970.js +2 -0
  78. package/bin/{chunk-e4yscwen.js → chunk-m6v8rb39.js} +8 -8
  79. package/bin/chunk-m8spagwp.js +4 -0
  80. package/bin/{chunk-y241cxff.js → chunk-mfh7mg5b.js} +1 -1
  81. package/bin/chunk-n0cn0218.js +2 -0
  82. package/bin/chunk-n54ftsdx.js +2 -0
  83. package/bin/{chunk-02fvcrej.js → chunk-n7cvj15k.js} +7 -7
  84. package/bin/chunk-na5fh7er.js +2 -0
  85. package/bin/chunk-neazdbxy.js +1 -0
  86. package/bin/chunk-nk24qw3m.js +1 -0
  87. package/bin/{chunk-73yncv54.js → chunk-nsbbseff.js} +2 -2
  88. package/bin/chunk-nseef85h.js +1 -0
  89. package/bin/chunk-p35ztj2z.js +3 -0
  90. package/bin/chunk-pcjc9ygv.js +2 -0
  91. package/bin/{chunk-167z646e.js → chunk-pemmtd8q.js} +1 -1
  92. package/bin/{chunk-82tps5n1.js → chunk-pzrqnnpg.js} +1 -1
  93. package/bin/{chunk-a74g6h8a.js → chunk-q43m934j.js} +2 -2
  94. package/bin/{chunk-r1xer8gn.js → chunk-q57m34h0.js} +3 -3
  95. package/bin/chunk-q5k72jz9.js +3 -0
  96. package/bin/chunk-q9fsxakd.js +2 -0
  97. package/bin/chunk-qadpe0ct.js +2 -0
  98. package/bin/chunk-qeypjv4f.css +1 -0
  99. package/bin/chunk-qw92z3wf.js +2 -0
  100. package/bin/chunk-r0byfq1t.js +1 -0
  101. package/bin/chunk-r0q88qw3.js +2 -0
  102. package/bin/chunk-rjhczkh3.js +2 -0
  103. package/bin/{chunk-mwktrwtx.js → chunk-s0wxbybf.js} +1 -1
  104. package/bin/{chunk-q5vkxee3.js → chunk-s4hkcw24.js} +2 -2
  105. package/bin/chunk-szta50g1.js +1 -0
  106. package/bin/chunk-t6cb99gp.js +2 -0
  107. package/bin/chunk-tcr080b9.js +1 -0
  108. package/bin/{chunk-yq32evnn.js → chunk-v4nqx084.js} +5 -5
  109. package/bin/{chunk-ympbfzz4.js → chunk-v7jzc3ye.js} +1 -1
  110. package/bin/{chunk-9zsv6d2f.js → chunk-vbe8wred.js} +1 -1
  111. package/bin/{chunk-hpbn0k9n.js → chunk-vf9s8b5t.js} +2 -2
  112. package/bin/{chunk-m9adtgzk.js → chunk-vk3eqr65.js} +1 -1
  113. package/bin/{chunk-hpwv4am3.js → chunk-vm9bbk97.js} +4 -4
  114. package/bin/{chunk-v05rrxp5.js → chunk-w4gqg27w.js} +2 -2
  115. package/bin/{chunk-x8mjh387.js → chunk-w6ym7tsd.js} +4 -4
  116. package/bin/{chunk-hzkjgcre.js → chunk-ways29d1.js} +1 -1
  117. package/bin/chunk-wesg7tg9.js +1 -0
  118. package/bin/chunk-wmrrapwv.js +2 -0
  119. package/bin/chunk-wnwsjgj8.js +2 -0
  120. package/bin/{chunk-hw6czrya.js → chunk-wrb4xq9v.js} +1 -1
  121. package/bin/{chunk-v5cn90cf.js → chunk-wzrzc07t.js} +2 -2
  122. package/bin/chunk-xd1axsdv.js +2 -0
  123. package/bin/{chunk-cwat1jwx.js → chunk-xk0jmx4s.js} +2 -2
  124. package/bin/{chunk-g6sdezec.js → chunk-y545vfn0.js} +1 -1
  125. package/bin/{chunk-fatmqnp1.js → chunk-y6h885fs.js} +1 -1
  126. package/bin/{chunk-cz13a82m.js → chunk-yncmfr39.js} +2 -2
  127. package/bin/{chunk-01052ssf.js → chunk-yxnz4ypt.js} +11 -11
  128. package/bin/chunk-zc1asygg.js +2 -0
  129. package/bin/{chunk-m82tkhaa.js → chunk-zc7wzcvh.js} +7 -7
  130. package/bin/chunk-zdvhh8mk.js +2 -0
  131. package/bin/{chunk-kvhf12b4.js → chunk-zg0b902x.js} +2 -2
  132. package/bin/{chunk-7v7mypc6.js → chunk-zhq7a7hs.js} +2 -2
  133. package/bin/{chunk-f25fe9th.js → chunk-zmnvskn7.js} +11 -11
  134. package/bin/shumai-app.html +1 -1
  135. package/bin/shumai-app.js +470 -389
  136. package/package.json +7 -7
  137. package/prisma/migrations/20261102032402_add_archive_storage/migration.sql +25 -0
  138. package/prisma/schema.prisma +12 -6
  139. package/bin/chunk-0bj887zm.js +0 -2
  140. package/bin/chunk-1ktk6764.js +0 -10
  141. package/bin/chunk-26qn7fek.js +0 -2
  142. package/bin/chunk-2ne2b54t.js +0 -2
  143. package/bin/chunk-2vbeqczj.js +0 -1
  144. package/bin/chunk-37p6bcx2.js +0 -1
  145. package/bin/chunk-3knfx6dm.js +0 -1
  146. package/bin/chunk-3z85zxkn.js +0 -1
  147. package/bin/chunk-54tbfvya.js +0 -2
  148. package/bin/chunk-56kh5fxc.js +0 -1
  149. package/bin/chunk-576nj64j.js +0 -2
  150. package/bin/chunk-6cnqjngz.js +0 -1
  151. package/bin/chunk-7g46e1wy.js +0 -3
  152. package/bin/chunk-84x8p7v5.js +0 -1
  153. package/bin/chunk-88jg9dq5.js +0 -2
  154. package/bin/chunk-8fyg9dy4.js +0 -2
  155. package/bin/chunk-8gtfgkrn.js +0 -2
  156. package/bin/chunk-8mqbztj8.js +0 -2
  157. package/bin/chunk-8qdtvfx3.css +0 -1
  158. package/bin/chunk-8xb6yz11.js +0 -2
  159. package/bin/chunk-8yjsmr7g.js +0 -2
  160. package/bin/chunk-91rb0jpb.js +0 -2
  161. package/bin/chunk-96qpjght.js +0 -2
  162. package/bin/chunk-9f1xk1nt.js +0 -1
  163. package/bin/chunk-9mk9cvbk.js +0 -1
  164. package/bin/chunk-9nw5w8vh.js +0 -1
  165. package/bin/chunk-ah8fjb6f.js +0 -2
  166. package/bin/chunk-cf5axr8c.js +0 -1
  167. package/bin/chunk-dk42gf7v.js +0 -2
  168. package/bin/chunk-e4f56spj.js +0 -4
  169. package/bin/chunk-eb7mzbfm.js +0 -1
  170. package/bin/chunk-er14d498.js +0 -3
  171. package/bin/chunk-f6avg5qe.js +0 -129
  172. package/bin/chunk-fvx9k1dc.js +0 -2
  173. package/bin/chunk-gtf19jc1.js +0 -2
  174. package/bin/chunk-h1n7jqnw.js +0 -1
  175. package/bin/chunk-hfm82066.js +0 -2
  176. package/bin/chunk-j2s311yc.js +0 -3
  177. package/bin/chunk-kj6h5j5a.js +0 -4
  178. package/bin/chunk-km4gn6b6.js +0 -1
  179. package/bin/chunk-ny1kbmxt.js +0 -2
  180. package/bin/chunk-p3j6ydk1.js +0 -1
  181. package/bin/chunk-pk406dgy.js +0 -2
  182. package/bin/chunk-s1e4qy3q.js +0 -14
  183. package/bin/chunk-swtwaaqe.js +0 -1
  184. package/bin/chunk-tagdrg7p.js +0 -1
  185. package/bin/chunk-twtxnzbv.js +0 -2
  186. package/bin/chunk-v5mcjwxy.js +0 -2
  187. package/bin/chunk-vkzasgxw.js +0 -2
  188. package/bin/chunk-x342vzdx.js +0 -2
  189. package/bin/chunk-xc54vhfz.js +0 -2
  190. package/bin/chunk-xvkwbczx.js +0 -3
  191. package/bin/chunk-z1p13dnc.js +0 -2
  192. package/bin/chunk-zarz3sqn.js +0 -211
@@ -1 +0,0 @@
1
- import{S,G,w,Z,Y,a,g,ie,X,ee,Tt,Je,R,z,Ar,K,tn,$t,yo,Mn,jt,Ml,xr,Ri,Xo,Re,es,Ue,Ge,B,F,$e,He,Qe,De,Ne,Fe,de,HA,JA,Ke,yw,Sw,Ad,rE,nE,Ym,Mt,kE,RE,UE,zE,dp,XE,g_,lo,MC,OC,PC,DC,NC,FC,LC,_p,TS,LI,i0,iT,_T,v0,q0,Di,Lp,Xh,Zp,fy,lg,SM,IM,my,hy,Ay,yy,vy,Up,wy,NM,ni,_t,yt,vt,bt,wt,Et,xt,Ct,Se,xe,ke,ot,Ce,Ot,re,Ie,Os,an,Yn,Eo,si,ln,$p,Vt,j,ze,Nr,dt,hn,ma,By,Zo,bg,rl,nl,ga,fe,Ve,Xe,et,tt,rt,be,Aa,Kp,Wp,Jp,Xp}from"./chunk-zarz3sqn.js";import{Wl}from"./chunk-7sgrtxbt.js";import{Uo}from"./chunk-atfz7g7e.js";import{jn}from"./chunk-fvx9k1dc.js";import{qn}from"./chunk-qwpkcp8d.js";Z();var Oe=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],me=z("pen",Oe);function ue({scope:e,onScopeChange:r,selectedGoal:b,onClearGoal:m,onCreateTask:k,canCreateTask:x=!0}){return g("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[g("div",{className:"flex items-center gap-3 min-w-0",children:[g("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[g(F,{variant:e==="team"?"secondary":"ghost",size:"sm",onClick:()=>r("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[a(Uo,{className:"w-3.5 h-3.5"}),a("span",{children:NM()})]}),g(F,{variant:e==="my"?"secondary":"ghost",size:"sm",onClick:()=>r("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[a(jn,{className:"w-3.5 h-3.5"}),a("span",{children:LI()})]})]}),b&&g("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[a(es,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),a("span",{className:"truncate font-medium",children:b.id===ma?ni():b.title}),a(F,{variant:"ghost",size:"icon-xs",onClick:m,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:Sw(),children:a(Ge,{className:"w-3 h-3"})})]})]}),x&&a("div",{className:"flex items-center gap-2 shrink-0",children:g(F,{size:"sm",onClick:k,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[a(Re,{className:"w-3.5 h-3.5"}),a("span",{children:Ym()})]})})]})}Z();Z();function se({teamId:e,isOpen:r,onClose:b,goalToEdit:m}){let k=ie(),[x,C]=w(""),[p,D]=w("");S(()=>{if(m)C(m.title),D(m.description||"");else C(""),D("")},[m,r]);let{mutate:I,isPending:A}=ee({mutationFn:async()=>{let n=await R.api.teams[":teamId"].kanban.goals.$post({param:{teamId:e},json:{title:x.trim(),description:p.trim()||void 0}});if(!n.ok){let f=await n.json().catch(()=>({message:lo()}));throw Error(f.message||lo())}return await n.json()},onSuccess:()=>{k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),j.success(MC()),b()},onError:(n)=>{j.error(n.message)}}),{mutate:P,isPending:T}=ee({mutationFn:async()=>{if(!m)return;let n=await R.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:e,goalId:m.id},json:{title:x.trim(),description:p.trim()||null}});if(!n.ok){let f=await n.json().catch(()=>({message:lo()}));throw Error(f.message||lo())}return await n.json()},onSuccess:()=>{k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),j.success(LC()),b()},onError:(n)=>{j.error(n.message)}}),E=(n)=>{if(n.preventDefault(),!x.trim())return;if(m)P();else I()},l=A||T;return a(Se,{open:r,onOpenChange:(n)=>!n&&b(),children:a(xe,{className:"sm:max-w-xl",children:g("form",{onSubmit:E,className:"space-y-4",children:[g(ke,{children:[a(Ce,{children:m?g_():nE()}),a(Ot,{children:m?g_():rE()})]}),g("div",{className:"space-y-3 py-2",children:[g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"goal-title",children:NC()}),a(re,{id:"goal-title",value:x,onChange:(n)=>C(n.target.value),placeholder:FC(),required:!0,autoFocus:!0})]}),g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"goal-description",children:PC()}),a(ga,{id:"goal-description",value:p,onChange:(n)=>D(n.target.value),placeholder:DC(),rows:3})]})]}),g(ot,{children:[a(F,{type:"button",variant:"outline",onClick:b,disabled:l,children:Ke()}),g(F,{type:"submit",disabled:!x.trim()||l,children:[l&&a(K,{className:"w-4 h-4 mr-1.5 animate-spin"}),m?Di():Ad()]})]})]})})})}function pe({teamId:e,selectedGoalId:r,onSelectGoal:b,isOwnerOrEditor:m=!0}){let k=ie(),[x,C]=w(!1),[p,D]=w(null),[I,A]=w(null),[P,T]=w(!1),{data:E,isLoading:l}=X({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let o=await R.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!o.ok)throw Error("Failed to fetch goals");return await o.json()},enabled:!!e}),n=E?.data||[],f=n.reduce((o,s)=>o+(s.taskCount||0),0),{mutate:y,isPending:i}=ee({mutationFn:async(o)=>{let s=await R.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:e,goalId:o}});if(!s.ok){let c=await s.json().catch(()=>({message:lo()}));throw Error(c.message||lo())}return await s.json()},onSuccess:(o,s)=>{if(k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),j.success(OC()),r===s)b(null);A(null)},onError:(o)=>{j.error(o.message)}});if(P)return g("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[a("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:a(F,{variant:"ghost",size:"icon-sm",onClick:()=>T(!1),title:_p(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:a(jt,{className:"w-4 h-4"})})}),g("div",{className:"mt-3 flex flex-col items-center gap-2",children:[a(F,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>b(null),title:HA(),className:B("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:a(Wl,{className:"w-4 h-4"})}),a(F,{variant:"ghost",size:"icon-sm",onClick:()=>C(!0),title:i0(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:a(Re,{className:"w-4 h-4"})})]}),x&&a(se,{teamId:e,isOpen:x,onClose:()=>C(!1)})]});return g("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[g("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[g("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[a(es,{className:"w-4 h-4 text-sidebar-primary"}),a("span",{children:_p()})]}),g("div",{className:"flex items-center gap-1",children:[m&&a(F,{variant:"ghost",size:"icon-sm",onClick:()=>C(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:i0(),children:a(Re,{className:"w-4 h-4"})}),a(F,{variant:"ghost",size:"icon-sm",onClick:()=>T(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:a(Mn,{className:"w-4 h-4"})})]})]}),a(Ie,{className:"flex-1 p-2",children:g("div",{className:"space-y-1",children:[g("div",{onClick:()=>b(null),className:B("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",r===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[g("div",{className:"flex items-center gap-2 truncate min-w-0",children:[a(Wl,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),a("span",{className:"truncate",children:HA()})]}),f>0&&a("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:f})]}),l?a("div",{className:"flex items-center justify-center p-4",children:a(K,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):n.length===0?a("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:iT()}):n.map((o)=>{let s=r===o.id,c=o.id===ma,v=c?ni():o.title,u=m&&!c;return g("div",{onClick:()=>b(o.id),className:B("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",s?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[g("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a(es,{className:B("w-3.5 h-3.5 shrink-0",s?"text-sidebar-primary":"text-muted-foreground")}),a("span",{className:"line-clamp-2 break-words leading-tight",title:v,children:v})]}),a("div",{className:"flex items-center shrink-0 ml-1",children:u?g(Y,{children:[(o.taskCount??0)>0&&a("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:o.taskCount}),a("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(d)=>d.stopPropagation(),children:g(De,{modal:!1,children:[a(Ne,{asChild:!0,children:a(F,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:a(Ar,{className:"w-3.5 h-3.5"})})}),g(Fe,{align:"end",className:"w-36",children:[g(de,{onClick:()=>{D(o)},children:[a(me,{className:"w-3.5 h-3.5 mr-2"}),XE()]}),g(de,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{A(o)},children:[a(Ue,{className:"w-3.5 h-3.5 mr-2"}),Mt()]})]})]})})]}):(o.taskCount??0)>0&&a("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:o.taskCount})})]},o.id)})]})}),(x||p)&&a(se,{teamId:e,isOpen:x||!!p,goalToEdit:p,onClose:()=>{C(!1),D(null)}}),I&&a(_t,{open:!!I,onOpenChange:(o)=>!o&&A(null),children:g(yt,{children:[g(vt,{children:[a(wt,{children:kE()}),a(Et,{children:RE({title:I.title})})]}),g(bt,{children:[a(Ct,{disabled:i,children:Ke()}),g(xt,{onClick:()=>y(I.id),disabled:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[i&&a(K,{className:"w-4 h-4 mr-1.5 animate-spin"}),Mt()]})]})]})})]})}Z();Z();function ge(e){return+ze(e)<Date.now()}function ve({task:e,onClick:r,onDelete:b,disabled:m,isFirst:k,isLast:x,showBottomIndicator:C,currentUserId:p,currentUserRole:D}){let{source:I}=$p(),A=!!I,P=D?.toLowerCase()==="owner",T=D?.toLowerCase()==="editor",E=!!p&&e.creator?.id===p,l=e.reporter?.id===p||E,n=e.assignee?.id===p,f=P||T||l||n,y=E||P||l,i=m||!f,{ref:o,isDragging:s}=si({id:e.id,data:{type:"kanban_task",task:e},disabled:i}),{ref:c,isDropTarget:v}=ln({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||m}),{ref:u,isDropTarget:d}=ln({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||m}),N=e.isAgentTask,_=e.status===dt.BLOCKED,h=e.dueDate?ge(new Date(e.dueDate))&&e.status!==dt.DONE:!1;return g("div",{className:"relative",children:[a("div",{ref:c,className:B("absolute left-0 right-0 z-20",k?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",A&&!s?"pointer-events-auto":"pointer-events-none")}),a("div",{ref:u,className:B("absolute bottom-0 left-0 right-0 z-20",x?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",A&&!s?"pointer-events-auto":"pointer-events-none")}),v&&!s&&a("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(d||C)&&!s&&a("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),g("div",{ref:o,onClick:()=>r(e),className:B("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",s&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!s&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",_&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[g("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[g("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[a("span",{className:B("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",nl(e.priority)),children:rl(e.priority)}),N&&g("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[a($t,{className:"w-3 h-3"}),a("span",{children:Up()})]}),e.goal&&g("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[a(es,{className:"w-2.5 h-2.5 shrink-0"}),a("span",{className:"truncate",children:e.goal.title})]})]}),a("div",{className:"flex items-center gap-1 shrink-0",children:y&&a("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(q)=>q.stopPropagation(),children:g(De,{modal:!1,children:[a(Ne,{asChild:!0,children:a(F,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:a(Ar,{className:"w-3.5 h-3.5"})})}),a(Fe,{align:"end",className:"w-32",children:g(de,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>b?.(e),children:[a(Ue,{className:"w-3.5 h-3.5 mr-2"}),Mt()]})})]})})})]}),a("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:e.title}),_&&g("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[a(tn,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),a("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent?.blockReason||e.latestStatusEvent?.reason||e.latestStatusEvent?.summary||fy()})]}),e.status===dt.IN_REVIEW&&e.latestStatusEvent?.summary&&g("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[a(qn,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),a("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent.summary})]}),g("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[a("div",{className:"flex items-center gap-1.5 min-w-0",children:e.assignee?g(Y,{children:[N?a("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:a($t,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):g($e,{size:"sm",className:"w-5 h-5 border border-border",children:[a(He,{src:e.assignee.image}),a(Qe,{className:"text-[9px]",children:e.assignee.name.slice(0,2).toUpperCase()})]}),a("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:e.assignee.name})]}):a("span",{className:"text-[11px] italic text-muted-foreground/60",children:ni()})}),g("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&g("div",{className:B("flex items-center gap-1 text-[10px] font-mono",h?"text-red-500 font-semibold":"text-muted-foreground"),title:Nr(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[a(yo,{className:"w-3 h-3"}),a("span",{children:Nr(new Date(e.dueDate),"MM/dd")})]}),e.assetCount>0&&g("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:TS({count:e.assetCount}),children:[a(Ml,{className:"w-3 h-3"}),a("span",{children:e.assetCount})]}),e.dependencyCount>0&&g("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.dependencyCount} dependencies`,children:[a(Ri,{className:"w-3 h-3"}),a("span",{children:e.dependencyCount})]}),e.commentCount>0&&g("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.commentCount} comments`,children:[a(Xo,{className:"w-3 h-3"}),a("span",{children:e.commentCount})]})]})]})]})]})}function he({teamId:e,status:r,selectedGoalId:b,scope:m,currentUserId:k,currentUserRole:x,onTaskClick:C,onDeleteTask:p,onCreateTaskInColumn:D}){let I=x?.toLowerCase()==="owner"||x?.toLowerCase()==="editor",A=m==="my"?k:void 0,{data:P,fetchNextPage:T,hasNextPage:E,isFetchingNextPage:l,isLoading:n}=Tt({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:b,assigneeId:A}],queryFn:async({pageParam:L=""})=>{let O=await R.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:e},query:{status:r,goalId:b||void 0,assigneeId:A||void 0,first:"20",after:L||void 0}});if(!O.ok)throw Error("Failed to fetch column tasks");return await O.json()},initialPageParam:"",getNextPageParam:(L)=>L.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:f,inView:y}=Vt({threshold:0.1});S(()=>{if(y&&E&&!l)T()},[y,E,l,T]);let i=G(()=>P?.pages?.flatMap((L)=>Array.isArray(L?.data)?L.data:[])||[],[P]),{source:o,target:s}=$p(),c=i.filter((L)=>L.id!==o?.id).at(-1),{ref:v,isDropTarget:u}=ln({id:r,data:{type:"kanban_column",status:r,lastTask:c}}),d=o?.data?.type==="kanban_task",N=d&&(u||s?.data?.type==="kanban_column"&&s.data.status===r||s?.data?.type==="reorder"&&s.data.task?.status===r),_=d&&s?.data?.type==="kanban_column"&&s.data.status===r,h=P?.pages?.[0]?.pageInfo?.total??i.length,q=bg(r);return g("div",{ref:v,className:B("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",N&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[g("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[g("div",{className:"flex items-center gap-2 min-w-0",children:[a("div",{className:B("w-2.5 h-2.5 rounded-full shrink-0",q.dot)}),a("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:Zo(r)})]}),a("div",{className:"flex items-center gap-1 shrink-0",children:a("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:h})})]}),a(Ie,{className:"flex-1 min-h-0 [&>div>div]:block!",children:g("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[n?a("div",{className:"flex items-center justify-center py-10",children:a(K,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):i.length===0?a("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:a("p",{className:"text-xs text-muted-foreground/70",children:_T()})}):i.map((L,O)=>a(ve,{task:L,onClick:C,onDelete:p,isFirst:O===0,isLast:O===i.length-1,showBottomIndicator:_&&L.id===c?.id,currentUserId:k,currentUserRole:x},L.id)),a("div",{ref:f,className:"h-2"}),l&&a("div",{className:"flex justify-center py-2",children:a(K,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),I&&a("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:g(F,{variant:"ghost",size:"sm",onClick:()=>D(r),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[a(Re,{className:"w-3.5 h-3.5 mr-1.5"}),a("span",{children:Ym()})]})})]})}function ye({teamId:e,selectedGoalId:r,scope:b,currentUserId:m,currentUserRole:k,onTaskClick:x,onCreateTaskInColumn:C}){let p=ie(),[D,I]=w(null),{mutate:A,isPending:P}=ee({mutationFn:async(l)=>{let n=await R.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:e,taskId:l}});if(!n.ok){let f=await n.json().catch(()=>({message:lo()}));throw Error(f.message||lo())}return await n.json()},onSuccess:()=>{p.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),p.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),j.success(IM()),I(null)},onError:(l)=>{j.error(l.message)}}),{mutate:T}=ee({mutationFn:async({taskId:l,fromStatus:n,status:f,reason:y,beforeIndex:i,afterIndex:o})=>{let s=await R.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:e,taskId:l},json:{fromStatus:n,status:f,reason:y,beforeIndex:i,afterIndex:o}});if(!s.ok){let c=await s.json().catch(()=>({message:lo()}));throw Error(c.message||lo())}return await s.json()},onMutate:async({taskId:l,status:n,targetTaskId:f,position:y})=>{await p.cancelQueries({queryKey:["teams",e,"kanban","tasks"]});let i=p.getQueriesData({queryKey:["teams",e,"kanban","tasks"]}),o=null,s=(c)=>c[0]==="teams"&&c[1]===e&&c[2]==="kanban"&&c[3]==="tasks"&&typeof c[4]==="object"&&c[4]!==null&&("status"in c[4]);if(p.setQueriesData({predicate:(c)=>s(c.queryKey)},(c)=>{if(!c||!Array.isArray(c.pages))return c;let v=!1,u=c.pages.map((d)=>{if(!d||!Array.isArray(d.data))return d;let N=d.data.find((_)=>_.id===l);if(N)return o={...N,status:n},v=!0,{...d,data:d.data.filter((_)=>_.id!==l),pageInfo:{...d.pageInfo,total:Math.max(0,(d.pageInfo?.total??d.data.length)-1)}};return d});return v?{...c,pages:u}:c}),o){let c=o;p.setQueriesData({predicate:(v)=>{if(!s(v.queryKey))return!1;return v.queryKey[4]?.status===n}},(v)=>{if(!v||!Array.isArray(v.pages))return v;let u=v.pages.flatMap((h)=>h?.data??[]).filter((h)=>h.id!==l),d=u.length;if(f){let h=u.findIndex((q)=>q.id===f);if(h!==-1)d=y==="before"?h:h+1}u.splice(d,0,c);let N=0,_=v.pages.map((h,q)=>{let L=h?.data?h.data.length:0,O=q===0&&L===0?1:q===v.pages.length-1?u.length-N:L,U=u.slice(N,N+O);return N+=O,{...h,data:U,pageInfo:{...h?.pageInfo,total:(h?.pageInfo?.total??0)+1}}});if(N<u.length&&_.length>0){let h=_.length-1;_[h]={..._[h],data:[..._[h]?.data??[],...u.slice(N)]}}return{...v,pages:_}})}return{previousQueries:i}},onError:(l,n,f)=>{if(f?.previousQueries)for(let[y,i]of f.previousQueries)p.setQueryData(y,i);j.error(l.message)},onSettled:()=>{p.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]})}}),E=(l)=>{if(l.canceled)return;let{source:n,target:f}=l.operation;if(!n||!f)return;let y=n.data;if(y?.type!=="kanban_task"||!y.task)return;let i=y.task,o=k?.toLowerCase()==="owner",s=k?.toLowerCase()==="editor",c=i.reporter?.id===m||i.creator?.id===m,v=i.assignee?.id===m;if(!o&&!s&&!c&&!v){j.error(yw());return}let u=f.data;if(!u)return;if(u.type==="reorder"&&u.task&&u.position){let d=u.task,N=d.status;if(i.id===d.id)return;let _=u.position==="before"?d.sortIndex??void 0:void 0,h=u.position==="after"?d.sortIndex??void 0:void 0;T({taskId:i.id,fromStatus:i.status,status:N,beforeIndex:_,afterIndex:h,targetTaskId:d.id,position:u.position});return}if(u.type==="kanban_column"&&u.status){let{status:d,lastTask:N}=u;if(N){if(i.id===N.id){if(i.status===d)return;T({taskId:i.id,fromStatus:i.status,status:d});return}T({taskId:i.id,fromStatus:i.status,status:d,afterIndex:N.sortIndex??void 0,targetTaskId:N.id,position:"after"});return}if(i.status===d)return;T({taskId:i.id,fromStatus:i.status,status:d})}};return g(Eo,{sensors:[Yn.configure({activationConstraints:[new an.Distance({value:8})]}),Os],onDragEnd:E,children:[a("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:a("div",{className:"flex gap-4 h-full min-w-max pb-2",children:By.map((l)=>a(he,{teamId:e,status:l,selectedGoalId:r,scope:b,currentUserId:m,currentUserRole:k,onTaskClick:x,onDeleteTask:(n)=>I(n),onCreateTaskInColumn:C},l))})}),D&&a(_t,{open:!!D,onOpenChange:(l)=>!l&&I(null),children:g(yt,{children:[g(vt,{children:[a(wt,{children:UE()}),a(Et,{children:zE({title:D.title})})]}),g(bt,{children:[a(Ct,{disabled:P,children:Ke()}),g(xt,{onClick:()=>A(D.id),disabled:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[P&&a(K,{className:"w-4 h-4 mr-1.5 animate-spin"}),Mt()]})]})]})})]})}Z();function we({teamId:e,isOpen:r,onClose:b,initialGoalId:m}){let k=ie(),x=m===ma||!m?"none":m,[C,p]=w(""),[D,I]=w(""),[A,P]=w(!1),[T,E]=w(hn.MEDIUM),[l,n]=w(x),[f,y]=w("none"),[i,o]=w("none"),[s,c]=w(void 0),[v,u]=w(void 0),[d,N]=w(null),[_,h]=w(null),[q,L]=w(null),[O,U]=w([]),[J,W]=w([]),[ne,oe]=w(!1),{data:le}=X({queryKey:["teams",e,"me"],queryFn:async()=>{let t=await R.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!t.ok)return null;return await t.json()},enabled:!!e&&r});S(()=>{if(r)p(""),I(""),P(!1),E(hn.MEDIUM),n(x),y("none"),o(le?.id||"none"),c(void 0),u(void 0),N(null),h(null),L(null),U([]),W([])},[r,x,le?.id]);let{data:ce=[]}=X({queryKey:["teams",e,"members","human"],queryFn:async()=>{let t=await R.api.teams[":teamId"].members.$get({param:{teamId:e},query:{includeAgents:"false"}});if(!t.ok)return[];let M=await t.json();return Array.isArray(M)?M:[]},enabled:!!e&&r}),{data:Ae=[]}=X({queryKey:["teams",e,"agents"],queryFn:async()=>{let t=await R.api.teams[":teamId"].agents.$get({param:{teamId:e}});if(!t.ok)return[];return await t.json()||[]},enabled:!!e&&r}),{data:Pe}=X({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let t=await R.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!t.ok)return{data:[]};return await t.json()},enabled:!!e&&r}),Le=Pe?.data||[],{mutate:Ee,isPending:V}=ee({mutationFn:async()=>{let t=await R.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:C.trim(),description:D.trim()||void 0,isAgentTask:A,priority:T,goalId:l!=="none"?l:void 0,assigneeId:f!=="none"?f:void 0,reporterId:i!=="none"?i:void 0,startDate:s?s.toISOString():void 0,dueDate:v?v.toISOString():void 0,projectId:d||void 0,targetFolderId:_||void 0,parentIds:O.length>0?O:void 0,assetIds:J.length>0?J.map((M)=>M.id):void 0}});if(!t.ok){let M=await t.text().catch(()=>""),Q=lo();if(M)try{let ae=JSON.parse(M);if(ae&&typeof ae.message==="string")Q=ae.message}catch{Q=M}throw Error(Q)}return await t.json()},onSuccess:()=>{k.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),j.success(SM()),b()},onError:(t)=>{j.error(t.message)}}),Me=(t)=>{if(t.preventDefault(),!C.trim()||V)return;Ee()},te=A;return a(Se,{open:r,onOpenChange:(t)=>!t&&b(),children:g(xe,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[g("form",{onSubmit:Me,className:"space-y-4",children:[a(ke,{children:a(Ce,{children:Ym()})}),g("div",{className:"space-y-3.5 py-1",children:[g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"create-task-title",children:yy()}),a(re,{id:"create-task-title",value:C,onChange:(t)=>p(t.target.value),placeholder:vy(),required:!0,autoFocus:!0})]}),g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"create-task-desc",children:my()}),a(ga,{id:"create-task-desc",value:D,onChange:(t)=>I(t.target.value),placeholder:hy(),rows:3})]}),g("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[g("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[g("div",{className:"space-y-0.5 min-w-0 pr-2",children:[g(fe,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[a($t,{className:"w-3.5 h-3.5 text-orange-500"}),a("span",{children:Up()})]}),a("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:wy()})]}),a(Ve,{id:"create-is-agent-task",checked:A,onCheckedChange:(t)=>{P(t),y("none")}})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:Ay()}),g(Xe,{value:T,onValueChange:(t)=>E(t),children:[a(tt,{className:"w-full h-9 text-xs",children:a(et,{})}),a(rt,{children:Object.values(hn).map((t)=>a(be,{value:t,children:a("span",{className:B("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",nl(t)),children:rl(t)})},t))})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:_p()}),g(Xe,{value:l,onValueChange:n,children:[a(tt,{className:"w-full h-9 text-xs",children:a(et,{placeholder:"None"})}),g(rt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:"None"})}),Le.filter((t)=>t.id!==ma).map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[a(es,{className:"w-3.5 h-3.5 text-primary"}),a("span",{children:t.title})]})},t.id))]})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:te?Lp():JA()}),g(Xe,{value:f,onValueChange:y,children:[a(tt,{className:"w-full h-9 text-xs",children:a(et,{placeholder:ni()})}),g(rt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:ni()})}),te?Ae.map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[a($t,{className:"w-3.5 h-3.5 text-purple-500"}),a("span",{children:t.name})]})},t.id)):ce.map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[g($e,{size:"sm",className:"w-4 h-4",children:[a(He,{src:t.image}),a(Qe,{className:"text-[8px]",children:t.name.slice(0,2).toUpperCase()})]}),a("span",{children:t.name})]})},t.id))]})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:q0()}),g(Xe,{value:i,onValueChange:o,children:[a(tt,{className:"w-full h-9 text-xs",children:a(et,{placeholder:ni()})}),g(rt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:ni()})}),ce.map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[g($e,{size:"sm",className:"w-4 h-4",children:[a(He,{src:t.image}),a(Qe,{className:"text-[8px]",children:t.name.slice(0,2).toUpperCase()})]}),a("span",{children:t.name})]})},t.id))]})]})]}),te&&g("div",{className:"sm:col-span-2 space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:lg()}),g(F,{type:"button",variant:"outline",size:"sm",onClick:()=>oe(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[a(xr,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),a("span",{className:"truncate",children:q||Xh()})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:Zp()}),a(Aa,{value:s,onChange:c,placeholder:Zp(),className:"h-9 text-xs"})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:dp()}),a(Aa,{value:v,onChange:u,placeholder:dp(),className:"h-9 text-xs"})]}),g("div",{className:"sm:col-span-2 space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:v0()}),a(Kp,{teamId:e,value:O,onChange:U})]}),a("div",{className:"sm:col-span-2 pt-1",children:a(Wp,{teamId:e,projectId:d,assets:J,onAddAssets:(t)=>W((M)=>[...M,...t]),onRemoveAsset:(t)=>W((M)=>M.filter((Q)=>Q.id!==t))})})]})]}),g(ot,{children:[a(F,{type:"button",variant:"outline",onClick:b,disabled:V,children:Ke()}),g(F,{type:"submit",disabled:!C.trim()||V,children:[V&&a(K,{className:"w-4 h-4 mr-1.5 animate-spin"}),Ad()]})]})]}),ne&&a(Jp,{teamId:e,currentProjectId:d,currentTargetFolderId:_,isOpen:ne,onClose:()=>oe(!1),onSelect:(t,M,Q)=>{N(t),h(M),L(Q||"Selected Folder")}})]})})}function Te({teamId:e,initialTaskId:r}){let[b,m]=w("team"),[k,x]=w(null),[C,p]=w(r??null),[D,I]=w(!1);S(()=>{if(r)p(r)},[r]);let[A,P]=w(dt.TODO),{data:T,isLoading:E}=X({queryKey:["teams",e,"me"],queryFn:async()=>{let s=await R.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!s.ok)throw Error("Failed to fetch me");return await s.json()},enabled:!!e}),{data:l}=X({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let s=await R.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!s.ok)return{data:[]};return await s.json()},enabled:!!e}),n=l?.data||[],f=k?n.find((s)=>s.id===k)||null:null,y=T?.role?.toLowerCase()==="owner"||T?.role?.toLowerCase()==="editor",i=(s=dt.TODO)=>{P(s),I(!0)},o=(s)=>{p(s.id)};if(E)return a("div",{className:"flex h-full items-center justify-center",children:a(K,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return g("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[a(pe,{teamId:e,selectedGoalId:k,onSelectGoal:x,isOwnerOrEditor:y}),g("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[a(ue,{scope:b,onScopeChange:m,selectedGoal:f,onClearGoal:()=>x(null),onCreateTask:()=>i(dt.TODO),canCreateTask:y}),a(ye,{teamId:e,selectedGoalId:k,scope:b,currentUserId:T?.id,currentUserRole:T?.role,onTaskClick:o,onCreateTaskInColumn:(s)=>i(s)})]}),C&&a(Xp,{teamId:e,taskId:C,isOpen:!!C,onClose:()=>p(null),canEdit:y}),D&&a(we,{teamId:e,isOpen:D,initialStatus:A,initialGoalId:k,onClose:()=>I(!1)})]})}function je(){let{teamId:e}=_e.useParams(),{taskId:r}=_e.useSearch();return a(Te,{teamId:e,initialTaskId:r})}var _e=Je("/teams/$teamId/kanban")({component:je});export{_e as Route};
@@ -1,2 +0,0 @@
1
- import{z}from"./chunk-zarz3sqn.js";var e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],_r=z("circle-alert",e);
2
- export{_r};
@@ -1 +0,0 @@
1
- import{S,w,Z,Y,a,g,We,Wn,Je,z,wr,K,Po,Pn,F,yA,jw,qw,ph,hh,gS,KI,WI,Fh,r1,n1,o1,$0,Mk,Ok,re,x,H,fe,_a,ru,nu}from"./chunk-zarz3sqn.js";import{_r}from"./chunk-ny1kbmxt.js";var f=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],c=z("key-round",f);Z();var h=H({password:x().min(3,Fh()),confirmPassword:x().min(3,Fh())}).refine((s)=>s.password===s.confirmPassword,{message:o1(),path:["confirmPassword"]}),v=Je("/reset-password")({component:b});function b(){let s=We(),r=v.useSearch().token||"",[d,t]=w(null),[n,l]=w(!1),[o,u]=w(!1),e=ru({resolver:nu(h),defaultValues:{password:"",confirmPassword:""}});S(()=>{if(o){let i=setTimeout(()=>{s({to:"/login"})},3000);return()=>clearTimeout(i)}},[o,s]);let p=async(i)=>{if(!r){t(hh());return}l(!0),t(null);let{error:m}=await yA({newPassword:i.password,token:r});if(l(!1),m){t(m.message||hh());return}u(!0)};return g(_a,{children:[g("div",{className:"mb-8",children:[a("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:$0()}),a("p",{className:"text-muted-foreground text-sm mt-1",children:Mk()})]}),!r?g("div",{className:"space-y-6",children:[g("div",{className:"p-4 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm flex items-start gap-3",children:[a(_r,{className:"w-5 h-5 shrink-0 mt-0.5"}),g("div",{className:"space-y-1",children:[a("p",{className:"font-semibold",children:hh()}),a("p",{className:"text-xs text-muted-foreground",children:gS()})]})]}),a(Wn,{to:"/login",className:"block w-full",children:g(F,{variant:"outline",className:"w-full h-11 rounded-xl flex items-center justify-center gap-2",children:[ph(),a(Po,{className:"w-4 h-4"})]})})]}):o?g("div",{className:"space-y-6",children:[g("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 rounded-xl text-sm flex items-start gap-3",children:[a(wr,{className:"w-5 h-5 shrink-0 mt-0.5"}),g("div",{className:"space-y-1",children:[a("p",{className:"font-semibold",children:r1()}),a("p",{className:"text-xs text-muted-foreground",children:n1()})]})]}),a(Wn,{to:"/login",className:"block w-full",children:g(F,{className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",children:[ph(),a(Po,{className:"w-4 h-4"})]})})]}):g("form",{onSubmit:e.handleSubmit(p),className:"space-y-5",children:[d&&a("div",{className:"p-3 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm text-center font-medium",children:d}),g("div",{className:"space-y-2",children:[a(fe,{htmlFor:"password",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:KI()}),g("div",{className:"relative group",children:[a(Pn,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),a(re,{id:"password",type:"password",...e.register("password"),placeholder:WI(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.password&&a("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.password.message})]}),g("div",{className:"space-y-2",children:[a(fe,{htmlFor:"confirmPassword",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:jw()}),g("div",{className:"relative group",children:[a(Pn,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),a(re,{id:"confirmPassword",type:"password",...e.register("confirmPassword"),placeholder:qw(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.confirmPassword&&a("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.confirmPassword.message})]}),a(F,{type:"submit",className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",disabled:n,children:n?g(Y,{children:[a(K,{className:"h-4 w-4 animate-spin"}),Ok()]}):g(Y,{children:[a(c,{className:"w-4 h-4"}),$0()]})}),a("div",{className:"pt-2 text-center text-sm",children:a(Wn,{to:"/login",className:"font-semibold text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300 transition-colors hover:underline inline-flex items-center gap-1",children:ph()})})]})]})}export{v as Route};
@@ -1,2 +0,0 @@
1
- import{ks,_A,Mc}from"./chunk-zarz3sqn.js";function gr(e,r){return Mc({...e,enabled:!0,suspense:!0,throwOnError:_A,placeholderData:void 0},ks,r)}
2
- export{gr};