@shumai-one/shumai 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/bin/{chunk-rfsbzd39.js → chunk-07h4b77v.js} +2 -2
  2. package/bin/{chunk-j9q9rjvd.js → chunk-0t4n4d5w.js} +2 -2
  3. package/bin/{chunk-be9a7kc6.js → chunk-1611z9jg.js} +2 -2
  4. package/bin/{chunk-q46rc697.js → chunk-1phqxp6z.js} +1 -1
  5. package/bin/{chunk-xxtcmzcv.js → chunk-23hckrrz.js} +2 -2
  6. package/bin/{chunk-j10gz94w.js → chunk-30z44j1g.js} +2 -2
  7. package/bin/{chunk-thd9zasr.js → chunk-3j463k1g.js} +1 -1
  8. package/bin/{chunk-d6d1j7qq.js → chunk-4181tdds.js} +2 -2
  9. package/bin/{chunk-44370df5.js → chunk-480jtqng.js} +2 -2
  10. package/bin/{chunk-pcxjm1re.js → chunk-4c3g146q.js} +2 -2
  11. package/bin/chunk-4ca0zt5e.js +1 -0
  12. package/bin/chunk-4d9bgmf2.js +2 -0
  13. package/bin/{chunk-b0cqsrse.js → chunk-4ev56fss.js} +5 -5
  14. package/bin/{chunk-tcqw0q8x.js → chunk-4gk52tjq.js} +1 -1
  15. package/bin/chunk-4mdqkj4d.js +1 -0
  16. package/bin/{chunk-f4d3v0nc.js → chunk-4r91fggc.js} +2 -2
  17. package/bin/chunk-50fb1x3w.js +1 -0
  18. package/bin/chunk-59gj1njz.js +1 -0
  19. package/bin/{chunk-4ee336e3.js → chunk-5pr0t7fb.js} +1 -1
  20. package/bin/chunk-5vewxmz7.js +3 -0
  21. package/bin/chunk-62zx96pe.js +2 -0
  22. package/bin/{chunk-7xcyn1ba.js → chunk-63y0eb07.js} +2 -2
  23. package/bin/chunk-6d5xrgfx.js +2 -0
  24. package/bin/{chunk-jw00fmkp.js → chunk-6gbtz5bf.js} +2 -2
  25. package/bin/{chunk-r6g1srb3.js → chunk-6gjg5egq.js} +1 -1
  26. package/bin/{chunk-c97vh5wb.js → chunk-6m4jz9s1.js} +3 -3
  27. package/bin/{chunk-7zgvmn5q.js → chunk-6s4x525w.js} +1 -1
  28. package/bin/{chunk-7qzt5nhz.js → chunk-6w2wmvqs.js} +1 -1
  29. package/bin/{chunk-kejt7kcr.js → chunk-77d23vcn.js} +2 -2
  30. package/bin/{chunk-1vs91e4q.js → chunk-77m5p188.js} +2 -2
  31. package/bin/chunk-7bvx087f.js +1 -0
  32. package/bin/chunk-7pfjfrjg.js +5 -0
  33. package/bin/{chunk-78cxvbjd.js → chunk-7q10s127.js} +1 -1
  34. package/bin/{chunk-za7ga4bf.js → chunk-7thx8ctx.js} +2 -2
  35. package/bin/{chunk-s9sgkkjp.js → chunk-8t4s91gh.js} +1 -1
  36. package/bin/{chunk-bbar8rsh.js → chunk-98ey5p2e.js} +1 -1
  37. package/bin/{chunk-gfdfkqrc.js → chunk-9amndcyh.js} +3 -3
  38. package/bin/chunk-9bk23g9x.js +1 -0
  39. package/bin/chunk-9mkcfy43.js +1 -0
  40. package/bin/{chunk-8yt4m2pb.js → chunk-9t3nsq5n.js} +2 -2
  41. package/bin/{chunk-zqvavykq.js → chunk-9tjq99ds.js} +2 -2
  42. package/bin/chunk-9wm9rwh1.js +2 -0
  43. package/bin/{chunk-8pfgh13x.js → chunk-ab16fyg4.js} +2 -2
  44. package/bin/chunk-arv0g2av.js +1 -0
  45. package/bin/{chunk-hx2mvd20.js → chunk-aytj4zxg.js} +2 -2
  46. package/bin/{chunk-4k2d8w9w.js → chunk-b1ypjqgp.js} +2 -2
  47. package/bin/{chunk-pt51m9h1.js → chunk-bdjv0ykq.js} +2 -2
  48. package/bin/chunk-c1k86mfa.js +10 -0
  49. package/bin/{chunk-me3xj7na.js → chunk-caa96dgd.js} +1 -1
  50. package/bin/chunk-ce4v2yjy.js +1 -0
  51. package/bin/{chunk-pg00gkr4.js → chunk-cqh60y54.js} +2 -2
  52. package/bin/chunk-cvq7zgw7.js +1 -0
  53. package/bin/{chunk-16txy3r1.js → chunk-d9mjbtp2.js} +2 -2
  54. package/bin/{chunk-116p639c.js → chunk-dn7sbjws.js} +2 -2
  55. package/bin/{chunk-txkmks1h.js → chunk-dxyq9h8n.js} +1 -1
  56. package/bin/{chunk-mgytr7nc.js → chunk-e3cabksx.js} +1 -1
  57. package/bin/{chunk-f8ysqfyv.js → chunk-egcrbj94.js} +2 -2
  58. package/bin/chunk-ev17v1mv.js +2 -0
  59. package/bin/{chunk-a5b3aevg.js → chunk-evtpwg71.js} +1 -1
  60. package/bin/{chunk-zt15ht52.js → chunk-f3e0nsv2.js} +1 -1
  61. package/bin/{chunk-r9pzpqst.js → chunk-f40gjqpq.js} +1 -1
  62. package/bin/chunk-fe7822ak.js +299 -0
  63. package/bin/{chunk-srs9jq8f.js → chunk-g8tkhw9j.js} +2 -2
  64. package/bin/{chunk-mgnxa0vy.js → chunk-g9r0p4t8.js} +1 -1
  65. package/bin/chunk-gbjyh9ms.js +1 -0
  66. package/bin/{chunk-pn94h6x7.js → chunk-gtbsb39v.js} +1 -1
  67. package/bin/{chunk-d9sh922y.js → chunk-gytz1q13.js} +1 -1
  68. package/bin/chunk-h0fxysxs.js +7 -0
  69. package/bin/{chunk-9f83pnfc.js → chunk-h8bdvsqt.js} +2 -2
  70. package/bin/{chunk-ts10cfmc.js → chunk-hag024w8.js} +2 -2
  71. package/bin/{chunk-09pe07g6.js → chunk-hc6w5nw4.js} +1 -1
  72. package/bin/chunk-j69dqc48.js +2 -0
  73. package/bin/{chunk-13ypr8v0.js → chunk-jbtw1zym.js} +1 -1
  74. package/bin/{chunk-7wvw67f3.js → chunk-jc1vb7rj.js} +2 -2
  75. package/bin/{chunk-92yvt66q.js → chunk-jdv78w9r.js} +1 -1
  76. package/bin/{chunk-gyaem1t4.js → chunk-jjs70y9v.js} +1 -1
  77. package/bin/{chunk-6tv7rm3x.js → chunk-jmdar2gz.js} +2 -2
  78. package/bin/{chunk-cyvx7gcx.js → chunk-jvwz10n4.js} +1 -1
  79. package/bin/{chunk-ygsbmfcy.js → chunk-k47md1g4.js} +2 -2
  80. package/bin/{chunk-hmmzbyy1.js → chunk-k4v0brcb.js} +2 -2
  81. package/bin/chunk-k6n7c07e.js +1 -0
  82. package/bin/{chunk-af6m9p1d.js → chunk-kk2cstsg.js} +1 -1
  83. package/bin/{chunk-wfee9d83.js → chunk-knz4h56q.js} +3 -3
  84. package/bin/{chunk-j5rx3x1q.js → chunk-kqqtt6bd.js} +1 -1
  85. package/bin/{chunk-ym9xavj0.js → chunk-kvyp1t4j.js} +1 -1
  86. package/bin/{chunk-4yhd7bmp.js → chunk-kxskpgsq.js} +2 -2
  87. package/bin/{chunk-q059y3wx.js → chunk-m6srbjcs.js} +2 -2
  88. package/bin/{chunk-3gqdepkd.js → chunk-mcc1scxs.js} +2 -2
  89. package/bin/{chunk-90tbc5f4.js → chunk-mq83a0kk.js} +2 -2
  90. package/bin/chunk-mxm8g4q0.js +1 -0
  91. package/bin/{chunk-f32kxe6c.js → chunk-nhpgdqq5.js} +2 -2
  92. package/bin/{chunk-2jsjrqw4.js → chunk-nne496aa.js} +2 -2
  93. package/bin/{chunk-cerjktz2.js → chunk-nqpb0r9h.js} +1 -1
  94. package/bin/chunk-ns0zww9g.js +2 -0
  95. package/bin/{chunk-2sc2jxd3.js → chunk-ps4xfp23.js} +1 -1
  96. package/bin/chunk-pz2ec6xt.js +2 -0
  97. package/bin/{chunk-px2cvc1n.js → chunk-q163k309.js} +2 -2
  98. package/bin/chunk-q1da61ps.js +1 -0
  99. package/bin/{chunk-785kxysj.js → chunk-qrf0ady6.js} +2 -2
  100. package/bin/{chunk-kkveddbn.js → chunk-qy28f25e.js} +1 -1
  101. package/bin/{chunk-fcsar7p0.js → chunk-r7s4ypw1.js} +1 -1
  102. package/bin/chunk-ran23vm9.js +1 -0
  103. package/bin/chunk-rfvdc4n0.js +2 -0
  104. package/bin/{chunk-8rcfhfq5.js → chunk-rgthkvgx.js} +1 -1
  105. package/bin/chunk-s39n3yw3.js +2 -0
  106. package/bin/{chunk-z340qkez.js → chunk-s7wdd0g7.js} +1 -1
  107. package/bin/{chunk-n8gsjwht.js → chunk-s88ha5kx.js} +2 -2
  108. package/bin/chunk-sf91bt9m.js +2 -0
  109. package/bin/{chunk-c43nmcfq.js → chunk-sjwbjf9j.js} +1 -1
  110. package/bin/chunk-t62076pv.js +1 -0
  111. package/bin/{chunk-k20w9eaz.js → chunk-tbbwss3v.js} +1 -1
  112. package/bin/{chunk-djkajvn7.js → chunk-tjcc7a6y.js} +1 -1
  113. package/bin/{chunk-nndzhn3n.js → chunk-tp6ab26e.js} +1 -1
  114. package/bin/{chunk-5395g4kq.js → chunk-v2wxk9p5.js} +2 -2
  115. package/bin/{chunk-wzdnsgwq.js → chunk-vbk6y4hk.js} +2 -2
  116. package/bin/{chunk-dyvmwafa.js → chunk-vfgfg5fk.js} +2 -2
  117. package/bin/{chunk-5c4h0t33.js → chunk-vm6c3xx9.js} +2 -2
  118. package/bin/{chunk-wxsq9zmf.js → chunk-vsx96mt6.js} +1 -1
  119. package/bin/{chunk-vh7eb7tp.js → chunk-wbyw1shz.js} +2 -2
  120. package/bin/chunk-whh2vh50.css +1 -0
  121. package/bin/{chunk-m49g5tf4.js → chunk-wjkcq65s.js} +2 -2
  122. package/bin/{chunk-47r5b77s.js → chunk-wkefwkfp.js} +1 -1
  123. package/bin/{chunk-7sf0gbbm.js → chunk-x7bsnk1e.js} +2 -2
  124. package/bin/{chunk-rar0gk7s.js → chunk-xbhw6bpz.js} +2 -2
  125. package/bin/{chunk-5bkj2n94.js → chunk-xg5yrcj5.js} +2 -2
  126. package/bin/{chunk-ewge52nq.js → chunk-xw2gpcsh.js} +1 -1
  127. package/bin/{chunk-xyzmew7g.js → chunk-ycq8ank7.js} +1 -1
  128. package/bin/{chunk-w9p59ahz.js → chunk-yp9hvkc5.js} +9 -9
  129. package/bin/{chunk-bkbqvxfv.js → chunk-ytypyfkc.js} +2 -2
  130. package/bin/{chunk-axb1f1ae.js → chunk-z1kjmf60.js} +2 -2
  131. package/bin/chunk-z36bx86r.js +2 -0
  132. package/bin/chunk-z7hdnecp.js +3 -0
  133. package/bin/{chunk-2vc6pw8q.js → chunk-zeby1cq7.js} +1 -1
  134. package/bin/chunk-zs5e8z1w.js +1 -0
  135. package/bin/chunk-zxnyefg5.js +2 -0
  136. package/bin/shumai-app.html +1 -1
  137. package/bin/shumai-app.js +297 -285
  138. package/package.json +7 -7
  139. package/bin/chunk-082zg4nr.js +0 -307
  140. package/bin/chunk-0qdzjcny.js +0 -2
  141. package/bin/chunk-0z1p2pvf.js +0 -1
  142. package/bin/chunk-29e0mb43.js +0 -1
  143. package/bin/chunk-2a0egvsg.js +0 -1
  144. package/bin/chunk-2f35h4fn.js +0 -2
  145. package/bin/chunk-2q7ew7yz.js +0 -2
  146. package/bin/chunk-44xtwvd7.js +0 -2
  147. package/bin/chunk-4azttb3w.js +0 -1
  148. package/bin/chunk-4yybby29.js +0 -2
  149. package/bin/chunk-6nrynqdw.js +0 -2
  150. package/bin/chunk-7g2k89gq.js +0 -2
  151. package/bin/chunk-7psq38hv.js +0 -1
  152. package/bin/chunk-93v3tm93.js +0 -1
  153. package/bin/chunk-ajryg2e2.js +0 -1
  154. package/bin/chunk-b27jgdsf.css +0 -1
  155. package/bin/chunk-bwyph9a0.js +0 -1
  156. package/bin/chunk-dbjc1vxt.js +0 -1
  157. package/bin/chunk-gr30nssh.js +0 -1
  158. package/bin/chunk-gtwhwdbs.js +0 -1
  159. package/bin/chunk-hk6tvf7b.js +0 -1
  160. package/bin/chunk-hzz4hsss.js +0 -1
  161. package/bin/chunk-k1f3gj25.js +0 -3
  162. package/bin/chunk-ktvmxqfg.js +0 -5
  163. package/bin/chunk-mkb4dycy.js +0 -2
  164. package/bin/chunk-n21a21vx.js +0 -2
  165. package/bin/chunk-r88vwaxc.js +0 -1
  166. package/bin/chunk-rfrpb986.js +0 -1
  167. package/bin/chunk-s503pcvb.js +0 -7
  168. package/bin/chunk-t77dwtcc.js +0 -2
  169. package/bin/chunk-tkgpc6c9.js +0 -2
  170. package/bin/chunk-v9hbssqd.js +0 -3
  171. package/bin/chunk-v9zc56qr.js +0 -1
  172. package/bin/chunk-x2nnv4j8.js +0 -1
  173. /package/bin/{chunk-kryt6pg3.js → chunk-xg9xscqz.js} +0 -0
@@ -1 +0,0 @@
1
- import{Pe as y1,Qe as L1,Re as q1,Te as k_,Ue as u_,Ve as D1,We as p1,Xe as T1,Ye as m1}from"./chunk-t77dwtcc.js";import{Ze as r_}from"./chunk-6nrynqdw.js";import{_e as L_}from"./chunk-5bkj2n94.js";import"./chunk-kejt7kcr.js";import"./chunk-2q7ew7yz.js";import{Qf as l,Rf as j_,bg as s}from"./chunk-ktvmxqfg.js";import{gg as V_,hg as Q_,ig as f_,jg as N_,kg as d}from"./chunk-hmmzbyy1.js";import"./chunk-d6d1j7qq.js";import"./chunk-7g2k89gq.js";import{Rg as U1,Sg as P1,Tg as b1,ah as O1,ch as F1,eh as Z_,fh as m_}from"./chunk-785kxysj.js";import{hh as c_}from"./chunk-ygsbmfcy.js";import{kh as E1}from"./chunk-16txy3r1.js";import"./chunk-bkbqvxfv.js";import{Oh as V1,bi as l_}from"./chunk-2sc2jxd3.js";import{ci as S1}from"./chunk-f32kxe6c.js";import{di as X_,ei as H_,fi as z_}from"./chunk-2f35h4fn.js";import{gi as P_,ii as b_,ji as O_,ki as Y_}from"./chunk-4k2d8w9w.js";import{Bi as x,Ci as K1,Ii as G,Ji as y_,Ki as A_,Li as G_,Mi as C_,Ni as S_,Oi as D_,Pi as p_,Qi as T_,Ri as M_,Ti as w_,Ui as F_,Vi as B_,Wi as K_,Xi as Y1,Yi as c,wi as o,zi as i}from"./chunk-s503pcvb.js";import{_i as k}from"./chunk-axb1f1ae.js";import{$i as __,Aj as R_,Cl as n,Dj as g,Fj as Z1,Fl as U_,Hj as f1,Lj as N1,Nk as M1,Nl as _1,Ol as $1,Rk as o_,Sl as J1,Wl as m,Xj as $_,_j as h1,_k as w1,aj as q_,bj as _,cj as J,ck as X1,dk as H1,il as t,mj as g1,qm as P,sk as v1,tm as W,um as E_,xk as C1}from"./chunk-w9p59ahz.js";import{rn as e}from"./chunk-txkmks1h.js";var r=e(__(),1);function W1({scope:$,onScopeChange:H,selectedGoal:F,onClearGoal:h,onCreateTask:L,canCreateTask:B=!0}){return J("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:[J("div",{className:"flex items-center gap-3 min-w-0",children:[J("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[J(P,{variant:$==="team"?"secondary":"ghost",size:"sm",onClick:()=>H("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${$==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[_($1,{className:"w-3.5 h-3.5"}),_("span",{children:W.team_tasks()})]}),J(P,{variant:$==="my"?"secondary":"ghost",size:"sm",onClick:()=>H("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${$==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[_(_1,{className:"w-3.5 h-3.5"}),_("span",{children:W.my_tasks()})]})]}),F&&J("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:[_(n,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),_("span",{className:"truncate font-medium",children:F.id===s?W.unassigned():F.title}),_(P,{variant:"ghost",size:"icon-xs",onClick:h,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:W.clear_filter(),children:_(J1,{className:"w-3 h-3"})})]})]}),B&&_("div",{className:"flex items-center gap-2 shrink-0",children:J(P,{size:"sm",onClick:L,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[_(t,{className:"w-3.5 h-3.5"}),_("span",{children:W.create_task()})]})})]})}var W_=e(__(),1);var J_=e(__(),1);function d_({teamId:$,isOpen:H,onClose:F,goalToEdit:h}){let L=o(),[B,U]=J_.useState(""),[M,b]=J_.useState("");J_.useEffect(()=>{if(h)U(h.title),b(h.description||"");else U(""),b("")},[h,H]);let{mutate:y,isPending:C}=x({mutationFn:async()=>{let X=await G.api.teams[":teamId"].kanban.goals.$post({param:{teamId:$},json:{title:B.trim(),description:M.trim()||void 0}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.goal_created()),F()},onError:(X)=>{c.error(X.message)}}),{mutate:S,isPending:O}=x({mutationFn:async()=>{if(!h)return;let X=await G.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:$,goalId:h.id},json:{title:B.trim(),description:M.trim()||null}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.goal_updated()),F()},onError:(X)=>{c.error(X.message)}}),T=(X)=>{if(X.preventDefault(),!B.trim())return;if(h)S();else y()},Q=C||O;return _(M_,{open:H,onOpenChange:(X)=>!X&&F(),children:_(w_,{className:"sm:max-w-xl",children:J("form",{onSubmit:T,className:"space-y-4",children:[J(F_,{children:[_(K_,{children:h?W.edit_goal():W.create_goal()}),_(Y1,{children:h?W.edit_goal():W.create_first_goal()})]}),J("div",{className:"space-y-3 py-2",children:[J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"goal-title",children:W.goal_title()}),_(E_,{id:"goal-title",value:B,onChange:(X)=>U(X.target.value),placeholder:W.goal_title_placeholder(),required:!0,autoFocus:!0})]}),J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"goal-description",children:W.goal_description()}),_(L_,{id:"goal-description",value:M,onChange:(X)=>b(X.target.value),placeholder:W.goal_description_placeholder(),rows:3})]})]}),J(B_,{children:[_(P,{type:"button",variant:"outline",onClick:F,disabled:Q,children:W.cancel()}),J(P,{type:"submit",disabled:!B.trim()||Q,children:[Q&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),h?W.save_changes():W.create()]})]})]})})})}function z1({teamId:$,selectedGoalId:H,onSelectGoal:F,isOwnerOrEditor:h=!0}){let L=o(),[B,U]=W_.useState(!1),[M,b]=W_.useState(null),[y,C]=W_.useState(null),[S,O]=W_.useState(!1),{data:T,isLoading:Q}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let z=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!z.ok)throw Error("Failed to fetch goals");return await z.json()},enabled:!!$}),X=T?.data||[],w=X.reduce((z,Z)=>z+(Z.taskCount||0),0),{mutate:q,isPending:V}=x({mutationFn:async(z)=>{let Z=await G.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:$,goalId:z}});if(!Z.ok){let N=await Z.json().catch(()=>({message:W.error()}));throw Error(N.message||W.error())}return await Z.json()},onSuccess:(z,Z)=>{if(L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),L.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),c.success(W.goal_deleted()),H===Z)F(null);C(null)},onError:(z)=>{c.error(z.message)}});if(S)return J("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[_("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:_(P,{variant:"ghost",size:"icon-sm",onClick:()=>O(!1),title:W.goals(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:_(H1,{className:"w-4 h-4"})})}),J("div",{className:"mt-3 flex flex-col items-center gap-2",children:[_(P,{variant:H===null?"secondary":"ghost",size:"icon-sm",onClick:()=>F(null),title:W.all_tasks(),className:m("w-8 h-8 rounded-md",H===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:_(o_,{className:"w-4 h-4"})}),_(P,{variant:"ghost",size:"icon-sm",onClick:()=>U(!0),title:W.new_goal(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:_(t,{className:"w-4 h-4"})})]}),B&&_(d_,{teamId:$,isOpen:B,onClose:()=>U(!1)})]});return J("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[J("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[J("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[_(n,{className:"w-4 h-4 text-sidebar-primary"}),_("span",{children:W.goals()})]}),J("div",{className:"flex items-center gap-1",children:[h&&_(P,{variant:"ghost",size:"icon-sm",onClick:()=>U(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:W.new_goal(),children:_(t,{className:"w-4 h-4"})}),_(P,{variant:"ghost",size:"icon-sm",onClick:()=>O(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:_(X1,{className:"w-4 h-4"})})]})]}),_(c_,{className:"flex-1 p-2",children:J("div",{className:"space-y-1",children:[J("div",{onClick:()=>F(null),className:m("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]",H===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:[J("div",{className:"flex items-center gap-2 truncate min-w-0",children:[_(o_,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),_("span",{className:"truncate",children:W.all_tasks()})]}),w>0&&_("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:w})]}),Q?_("div",{className:"flex items-center justify-center p-4",children:_(g,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):X.length===0?_("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:W.no_goals_yet()}):X.map((z)=>{let Z=H===z.id,N=z.id===s,K=N?W.unassigned():z.title,v=h&&!N;return J("div",{onClick:()=>F(z.id),className:m("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]",Z?"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:[J("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[_(n,{className:m("w-3.5 h-3.5 shrink-0",Z?"text-sidebar-primary":"text-muted-foreground")}),_("span",{className:"line-clamp-2 break-words leading-tight",title:K,children:K})]}),_("div",{className:"flex items-center shrink-0 ml-1",children:v?J(q_,{children:[(z.taskCount??0)>0&&_("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:z.taskCount}),_("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(f)=>f.stopPropagation(),children:J(P_,{modal:!1,children:[_(b_,{asChild:!0,children:_(P,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:_(R_,{className:"w-3.5 h-3.5"})})}),J(O_,{align:"end",className:"w-36",children:[J(Y_,{onClick:()=>{b(z)},children:[_(Z1,{className:"w-3.5 h-3.5 mr-2"}),W.edit()]}),J(Y_,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{C(z)},children:[_(U_,{className:"w-3.5 h-3.5 mr-2"}),W.delete()]})]})]})})]}):(z.taskCount??0)>0&&_("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:z.taskCount})})]},z.id)})]})}),(B||M)&&_(d_,{teamId:$,isOpen:B||!!M,goalToEdit:M,onClose:()=>{U(!1),b(null)}}),y&&_(y_,{open:!!y,onOpenChange:(z)=>!z&&C(null),children:J(A_,{children:[J(G_,{children:[_(S_,{children:W.delete_goal()}),_(D_,{children:W.delete_goal_confirm({title:y.title})})]}),J(C_,{children:[_(T_,{disabled:V,children:W.cancel()}),J(p_,{onClick:()=>q(y.id),disabled:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[V&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.delete()]})]})]})})]})}var A1=e(__(),1);var g_=e(__(),1);function Q1($){return+V1($)<Date.now()}function B1({task:$,onClick:H,onDelete:F,disabled:h,isFirst:L,isLast:B,showBottomIndicator:U,currentUserId:M,currentUserRole:b}){let{source:y}=m_(),C=!!y,S=b?.toLowerCase()==="owner",O=b?.toLowerCase()==="editor",T=!!M&&$.creator?.id===M,Q=$.reporter?.id===M||T,X=$.assignee?.id===M,w=S||O||Q||X,q=T||S||Q,V=h||!w,{ref:z,isDragging:Z}=F1({id:$.id,data:{type:"kanban_task",task:$},disabled:V}),{ref:N,isDropTarget:K}=Z_({id:`reorder-before-${$.id}`,data:{type:"reorder",task:$,position:"before"},disabled:Z||h}),{ref:v,isDropTarget:f}=Z_({id:`reorder-after-${$.id}`,data:{type:"reorder",task:$,position:"after"},disabled:Z||h}),R=$.isAgentTask,A=$.status===l.BLOCKED,E=$.dueDate?Q1(new Date($.dueDate))&&$.status!==l.DONE:!1;return J("div",{className:"relative",children:[_("div",{ref:N,className:m("absolute left-0 right-0 z-20",L?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",C&&!Z?"pointer-events-auto":"pointer-events-none")}),_("div",{ref:v,className:m("absolute bottom-0 left-0 right-0 z-20",B?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",C&&!Z?"pointer-events-auto":"pointer-events-none")}),K&&!Z&&_("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"}),(f||U)&&!Z&&_("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"}),J("div",{ref:z,onClick:()=>H($),className:m("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",Z&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!Z&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",A&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[J("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[J("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[_("span",{className:m("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",u_($.priority)),children:k_($.priority)}),R&&J("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:[_($_,{className:"w-3 h-3"}),_("span",{children:W.task_type_agent()})]}),$.goal&&J("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:[_(n,{className:"w-2.5 h-2.5 shrink-0"}),_("span",{className:"truncate",children:$.goal.title})]})]}),_("div",{className:"flex items-center gap-1 shrink-0",children:q&&_("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(I)=>I.stopPropagation(),children:J(P_,{modal:!1,children:[_(b_,{asChild:!0,children:_(P,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:_(R_,{className:"w-3.5 h-3.5"})})}),_(O_,{align:"end",className:"w-32",children:J(Y_,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>F?.($),children:[_(U_,{className:"w-3.5 h-3.5 mr-2"}),W.delete()]})})]})})})]}),_("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:$.title}),A&&J("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:[_(N1,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),_("span",{className:"line-clamp-2 break-words",children:$.latestStatusEvent?.blockReason||$.latestStatusEvent?.reason||$.latestStatusEvent?.summary||W.status_blocked()})]}),$.status===l.IN_REVIEW&&$.latestStatusEvent?.summary&&J("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:[_(f1,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),_("span",{className:"line-clamp-2 break-words",children:$.latestStatusEvent.summary})]}),J("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[_("div",{className:"flex items-center gap-1.5 min-w-0",children:$.assignee?J(q_,{children:[R?_("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:_($_,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):J(X_,{size:"sm",className:"w-5 h-5 border border-border",children:[_(H_,{src:$.assignee.image}),_(z_,{className:"text-[9px]",children:$.assignee.name.slice(0,2).toUpperCase()})]}),_("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:$.assignee.name})]}):_("span",{className:"text-[11px] italic text-muted-foreground/60",children:W.unassigned()})}),J("div",{className:"flex items-center gap-2 shrink-0",children:[$.dueDate&&J("div",{className:m("flex items-center gap-1 text-[10px] font-mono",E?"text-red-500 font-semibold":"text-muted-foreground"),title:l_(new Date($.dueDate),"yyyy/MM/dd HH:mm"),children:[_(h1,{className:"w-3 h-3"}),_("span",{children:l_(new Date($.dueDate),"MM/dd")})]}),$.assetCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:W.linked_assets_count({count:$.assetCount}),children:[_(v1,{className:"w-3 h-3"}),_("span",{children:$.assetCount})]}),$.dependencyCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${$.dependencyCount} dependencies`,children:[_(M1,{className:"w-3 h-3"}),_("span",{children:$.dependencyCount})]}),$.commentCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${$.commentCount} comments`,children:[_(w1,{className:"w-3 h-3"}),_("span",{children:$.commentCount})]})]})]})]})]})}function R1({teamId:$,status:H,selectedGoalId:F,scope:h,currentUserId:L,currentUserRole:B,onTaskClick:U,onDeleteTask:M,onCreateTaskInColumn:b}){let y=B?.toLowerCase()==="owner"||B?.toLowerCase()==="editor",C=h==="my"?L:void 0,{data:S,fetchNextPage:O,hasNextPage:T,isFetchingNextPage:Q,isLoading:X}=K1({queryKey:["teams",$,"kanban","tasks",{status:H,goalId:F,assigneeId:C}],queryFn:async({pageParam:D=""})=>{let j=await G.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:$},query:{status:H,goalId:F||void 0,assigneeId:C||void 0,first:"20",after:D||void 0}});if(!j.ok)throw Error("Failed to fetch column tasks");return await j.json()},initialPageParam:"",getNextPageParam:(D)=>D.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!$}),{ref:w,inView:q}=E1({threshold:0.1});g_.useEffect(()=>{if(q&&T&&!Q)O()},[q,T,Q,O]);let V=g_.useMemo(()=>{return S?.pages?.flatMap((D)=>Array.isArray(D?.data)?D.data:[])||[]},[S]),{source:z,target:Z}=m_(),N=V.filter((D)=>D.id!==z?.id).at(-1),{ref:K,isDropTarget:v}=Z_({id:H,data:{type:"kanban_column",status:H,lastTask:N}}),f=z?.data?.type==="kanban_task",R=f&&(v||Z?.data?.type==="kanban_column"&&Z.data.status===H||Z?.data?.type==="reorder"&&Z.data.task?.status===H),A=f&&Z?.data?.type==="kanban_column"&&Z.data.status===H,E=S?.pages?.[0]?.pageInfo?.total??V.length,I=q1(H);return J("div",{ref:K,className:m("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",R&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[J("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[J("div",{className:"flex items-center gap-2 min-w-0",children:[_("div",{className:m("w-2.5 h-2.5 rounded-full shrink-0",I.dot)}),_("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:L1(H)})]}),_("div",{className:"flex items-center gap-1 shrink-0",children:_("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:E})})]}),_(c_,{className:"flex-1 min-h-0 [&>div>div]:block!",children:J("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[X?_("div",{className:"flex items-center justify-center py-10",children:_(g,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):V.length===0?_("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:_("p",{className:"text-xs text-muted-foreground/70",children:W.no_tasks_in_column()})}):V.map((D,j)=>_(B1,{task:D,onClick:U,onDelete:M,isFirst:j===0,isLast:j===V.length-1,showBottomIndicator:A&&D.id===N?.id,currentUserId:L,currentUserRole:B},D.id)),_("div",{ref:w,className:"h-2"}),Q&&_("div",{className:"flex justify-center py-2",children:_(g,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),y&&_("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:J(P,{variant:"ghost",size:"sm",onClick:()=>b(H),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:[_(t,{className:"w-3.5 h-3.5 mr-1.5"}),_("span",{children:W.create_task()})]})})]})}function G1({teamId:$,selectedGoalId:H,scope:F,currentUserId:h,currentUserRole:L,onTaskClick:B,onCreateTaskInColumn:U}){let M=o(),[b,y]=A1.useState(null),{mutate:C,isPending:S}=x({mutationFn:async(Q)=>{let X=await G.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:$,taskId:Q}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{M.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),M.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.task_deleted()),y(null)},onError:(Q)=>{c.error(Q.message)}}),{mutate:O}=x({mutationFn:async({taskId:Q,fromStatus:X,status:w,reason:q,beforeIndex:V,afterIndex:z})=>{let Z=await G.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:$,taskId:Q},json:{fromStatus:X,status:w,reason:q,beforeIndex:V,afterIndex:z}});if(!Z.ok){let N=await Z.json().catch(()=>({message:W.error()}));throw Error(N.message||W.error())}return await Z.json()},onMutate:async({taskId:Q,status:X,targetTaskId:w,position:q})=>{await M.cancelQueries({queryKey:["teams",$,"kanban","tasks"]});let V=M.getQueriesData({queryKey:["teams",$,"kanban","tasks"]}),z=null,Z=(N)=>{return N[0]==="teams"&&N[1]===$&&N[2]==="kanban"&&N[3]==="tasks"&&typeof N[4]==="object"&&N[4]!==null&&"status"in N[4]};if(M.setQueriesData({predicate:(N)=>Z(N.queryKey)},(N)=>{if(!N||!Array.isArray(N.pages))return N;let K=!1,v=N.pages.map((f)=>{if(!f||!Array.isArray(f.data))return f;let R=f.data.find((A)=>A.id===Q);if(R)return z={...R,status:X},K=!0,{...f,data:f.data.filter((A)=>A.id!==Q),pageInfo:{...f.pageInfo,total:Math.max(0,(f.pageInfo?.total??f.data.length)-1)}};return f});return K?{...N,pages:v}:N}),z){let N=z;M.setQueriesData({predicate:(K)=>{if(!Z(K.queryKey))return!1;return K.queryKey[4]?.status===X}},(K)=>{if(!K||!Array.isArray(K.pages))return K;let v=K.pages.flatMap((E)=>E?.data??[]).filter((E)=>E.id!==Q),f=v.length;if(w){let E=v.findIndex((I)=>I.id===w);if(E!==-1)f=q==="before"?E:E+1}v.splice(f,0,N);let R=0,A=K.pages.map((E,I)=>{let D=E?.data?E.data.length:0,j=I===0&&D===0?1:I===K.pages.length-1?v.length-R:D,h_=v.slice(R,R+j);return R+=j,{...E,data:h_,pageInfo:{...E?.pageInfo,total:(E?.pageInfo?.total??0)+1}}});if(R<v.length&&A.length>0){let E=A.length-1;A[E]={...A[E],data:[...A[E]?.data??[],...v.slice(R)]}}return{...K,pages:A}})}return{previousQueries:V}},onError:(Q,X,w)=>{if(w?.previousQueries)for(let[q,V]of w.previousQueries)M.setQueryData(q,V);c.error(Q.message)},onSettled:()=>{M.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]})}}),T=(Q)=>{if(Q.canceled)return;let{source:X,target:w}=Q.operation;if(!X||!w)return;let q=X.data;if(q?.type!=="kanban_task"||!q.task)return;let V=q.task,z=L?.toLowerCase()==="owner",Z=L?.toLowerCase()==="editor",N=V.reporter?.id===h||V.creator?.id===h,K=V.assignee?.id===h;if(!z&&!Z&&!N&&!K){c.error(W.cannot_change_task_status_permission());return}let v=w.data;if(!v)return;if(v.type==="reorder"&&v.task&&v.position){let f=v.task,R=f.status;if(V.id===f.id)return;let A=v.position==="before"?f.sortIndex??void 0:void 0,E=v.position==="after"?f.sortIndex??void 0:void 0;O({taskId:V.id,fromStatus:V.status,status:R,beforeIndex:A,afterIndex:E,targetTaskId:f.id,position:v.position});return}if(v.type==="kanban_column"&&v.status){let{status:f,lastTask:R}=v;if(R){if(V.id===R.id){if(V.status===f)return;O({taskId:V.id,fromStatus:V.status,status:f});return}O({taskId:V.id,fromStatus:V.status,status:f,afterIndex:R.sortIndex??void 0,targetTaskId:R.id,position:"after"});return}if(V.status===f)return;O({taskId:V.id,fromStatus:V.status,status:f})}};return J(O1,{sensors:[b1.configure({activationConstraints:[new P1.Distance({value:8})]}),U1],onDragEnd:T,children:[_("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:_("div",{className:"flex gap-4 h-full min-w-max pb-2",children:y1.map((Q)=>_(R1,{teamId:$,status:Q,selectedGoalId:H,scope:F,currentUserId:h,currentUserRole:L,onTaskClick:B,onDeleteTask:(X)=>y(X),onCreateTaskInColumn:U},Q))})}),b&&_(y_,{open:!!b,onOpenChange:(Q)=>!Q&&y(null),children:J(A_,{children:[J(G_,{children:[_(S_,{children:W.delete_task()}),_(D_,{children:W.delete_task_confirm({title:b.title})})]}),J(C_,{children:[_(T_,{disabled:S,children:W.cancel()}),J(p_,{onClick:()=>C(b.id),disabled:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[S&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.delete()]})]})]})})]})}var p=e(__(),1);function c1({teamId:$,isOpen:H,onClose:F,initialGoalId:h}){let L=o(),B=h===s||!h?"none":h,[U,M]=p.useState(""),[b,y]=p.useState(""),[C,S]=p.useState(!1),[O,T]=p.useState(j_.MEDIUM),[Q,X]=p.useState(B),[w,q]=p.useState("none"),[V,z]=p.useState("none"),[Z,N]=p.useState(void 0),[K,v]=p.useState(void 0),[f,R]=p.useState(null),[A,E]=p.useState(null),[I,D]=p.useState(null),[j,h_]=p.useState([]),[I_,x_]=p.useState([]),[a_,t_]=p.useState(!1),{data:s_}=i({queryKey:["teams",$,"me"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].me.$get({param:{teamId:$}});if(!Y.ok)return null;return await Y.json()},enabled:!!$&&H});p.useEffect(()=>{if(H)M(""),y(""),S(!1),T(j_.MEDIUM),X(B),q("none"),z(s_?.id||"none"),N(void 0),v(void 0),R(null),E(null),D(null),h_([]),x_([])},[H,B,s_?.id]);let{data:e_=[]}=i({queryKey:["teams",$,"members","human"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].members.$get({param:{teamId:$},query:{includeAgents:"false"}});if(!Y.ok)return[];let u=await Y.json();return Array.isArray(u)?u:[]},enabled:!!$&&H}),{data:j1=[]}=i({queryKey:["teams",$,"agents"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].agents.$get({param:{teamId:$}});if(!Y.ok)return[];return await Y.json()||[]},enabled:!!$&&H}),{data:I1}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!Y.ok)return{data:[]};return await Y.json()},enabled:!!$&&H}),x1=I1?.data||[],{mutate:i1,isPending:v_}=x({mutationFn:async()=>{let Y=await G.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:$},json:{title:U.trim(),description:b.trim()||void 0,isAgentTask:C,priority:O,goalId:Q!=="none"?Q:void 0,assigneeId:w!=="none"?w:void 0,reporterId:V!=="none"?V:void 0,startDate:Z?Z.toISOString():void 0,dueDate:K?K.toISOString():void 0,projectId:f||void 0,targetFolderId:A||void 0,parentIds:j.length>0?j:void 0,assetIds:I_.length>0?I_.map((u)=>u.id):void 0}});if(!Y.ok){let u=await Y.text().catch(()=>""),a=W.error();if(u)try{let n_=JSON.parse(u);if(n_&&typeof n_.message==="string")a=n_.message}catch{a=u}throw Error(a)}return await Y.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.task_created()),F()},onError:(Y)=>{c.error(Y.message)}}),n1=(Y)=>{if(Y.preventDefault(),!U.trim()||v_)return;i1()},i_=C;return _(M_,{open:H,onOpenChange:(Y)=>!Y&&F(),children:J(w_,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[J("form",{onSubmit:n1,className:"space-y-4",children:[_(F_,{children:_(K_,{children:W.create_task()})}),J("div",{className:"space-y-3.5 py-1",children:[J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"create-task-title",children:W.task_title()}),_(E_,{id:"create-task-title",value:U,onChange:(Y)=>M(Y.target.value),placeholder:W.task_title_placeholder(),required:!0,autoFocus:!0})]}),J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"create-task-desc",children:W.task_description()}),_(L_,{id:"create-task-desc",value:b,onChange:(Y)=>y(Y.target.value),placeholder:W.task_description_placeholder(),rows:3})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[J("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:[J("div",{className:"space-y-0.5 min-w-0 pr-2",children:[J(k,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[_($_,{className:"w-3.5 h-3.5 text-orange-500"}),_("span",{children:W.task_type_agent()})]}),_("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:W.task_type_agent_desc()})]}),_(S1,{id:"create-is-agent-task",checked:C,onCheckedChange:(Y)=>{S(Y),q("none")}})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.task_priority()}),J(V_,{value:O,onValueChange:(Y)=>T(Y),children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{})}),_(N_,{children:Object.values(j_).map((Y)=>_(d,{value:Y,children:_("span",{className:m("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",u_(Y)),children:k_(Y)})},Y))})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.goals()}),J(V_,{value:Q,onValueChange:X,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:"None"})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:"None"})}),x1.filter((Y)=>Y.id!==s).map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[_(n,{className:"w-3.5 h-3.5 text-primary"}),_("span",{children:Y.title})]})},Y.id))]})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:i_?W.select_agent():W.assignee()}),J(V_,{value:w,onValueChange:q,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:W.unassigned()})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:W.unassigned()})}),i_?j1.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[_($_,{className:"w-3.5 h-3.5 text-purple-500"}),_("span",{children:Y.name})]})},Y.id)):e_.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[J(X_,{size:"sm",className:"w-4 h-4",children:[_(H_,{src:Y.image}),_(z_,{className:"text-[8px]",children:Y.name.slice(0,2).toUpperCase()})]}),_("span",{children:Y.name})]})},Y.id))]})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.reporter()}),J(V_,{value:V,onValueChange:z,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:W.unassigned()})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:W.unassigned()})}),e_.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[J(X_,{size:"sm",className:"w-4 h-4",children:[_(H_,{src:Y.image}),_(z_,{className:"text-[8px]",children:Y.name.slice(0,2).toUpperCase()})]}),_("span",{children:Y.name})]})},Y.id))]})]})]}),i_&&J("div",{className:"sm:col-span-2 space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.target_folder()}),J(P,{type:"button",variant:"outline",size:"sm",onClick:()=>t_(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[_(C1,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),_("span",{className:"truncate",children:I||W.select_target_folder()})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.start_date()}),_(r_,{value:Z,onChange:N,placeholder:W.start_date(),className:"h-9 text-xs"})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.due_date()}),_(r_,{value:K,onChange:v,placeholder:W.due_date(),className:"h-9 text-xs"})]}),J("div",{className:"sm:col-span-2 space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.parent_tasks()}),_(D1,{teamId:$,value:j,onChange:h_})]}),_("div",{className:"sm:col-span-2 pt-1",children:_(p1,{teamId:$,projectId:f,assets:I_,onAddAssets:(Y)=>x_((u)=>[...u,...Y]),onRemoveAsset:(Y)=>x_((u)=>u.filter((a)=>a.id!==Y))})})]})]}),J(B_,{children:[_(P,{type:"button",variant:"outline",onClick:F,disabled:v_,children:W.cancel()}),J(P,{type:"submit",disabled:!U.trim()||v_,children:[v_&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.create()]})]})]}),a_&&_(T1,{teamId:$,currentProjectId:f,currentTargetFolderId:A,isOpen:a_,onClose:()=>t_(!1),onSelect:(Y,u,a)=>{R(Y),E(u),D(a||"Selected Folder")}})]})})}function k1({teamId:$,initialTaskId:H}){let[F,h]=r.useState("team"),[L,B]=r.useState(null),[U,M]=r.useState(H??null),[b,y]=r.useState(!1);r.useEffect(()=>{if(H)M(H)},[H]);let[C,S]=r.useState(l.TODO),{data:O,isLoading:T}=i({queryKey:["teams",$,"me"],queryFn:async()=>{let Z=await G.api.teams[":teamId"].me.$get({param:{teamId:$}});if(!Z.ok)throw Error("Failed to fetch me");return await Z.json()},enabled:!!$}),{data:Q}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let Z=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!Z.ok)return{data:[]};return await Z.json()},enabled:!!$}),X=Q?.data||[],w=L?X.find((Z)=>Z.id===L)||null:null,q=O?.role?.toLowerCase()==="owner"||O?.role?.toLowerCase()==="editor",V=(Z=l.TODO)=>{S(Z),y(!0)},z=(Z)=>{M(Z.id)};if(T)return _("div",{className:"flex h-full items-center justify-center",children:_(g,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return J("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[_(z1,{teamId:$,selectedGoalId:L,onSelectGoal:B,isOwnerOrEditor:q}),J("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[_(W1,{scope:F,onScopeChange:h,selectedGoal:w,onClearGoal:()=>B(null),onCreateTask:()=>V(l.TODO),canCreateTask:q}),_(G1,{teamId:$,selectedGoalId:L,scope:F,currentUserId:O?.id,currentUserRole:O?.role,onTaskClick:z,onCreateTaskInColumn:(Z)=>V(Z)})]}),U&&_(m1,{teamId:$,taskId:U,isOpen:!!U,onClose:()=>M(null),canEdit:q}),b&&_(c1,{teamId:$,isOpen:b,initialStatus:C,initialGoalId:L,onClose:()=>y(!1)})]})}function d1(){let{teamId:$}=u1.useParams(),{taskId:H}=u1.useSearch();return _(k1,{teamId:$,initialTaskId:H})}var u1=g1("/teams/$teamId/kanban")({component:d1});export{u1 as Route};
@@ -1 +0,0 @@
1
- import{o as s}from"./chunk-r9pzpqst.js";import"./chunk-4yybby29.js";import"./chunk-2vc6pw8q.js";import"./chunk-09pe07g6.js";import"./chunk-082zg4nr.js";import"./chunk-44xtwvd7.js";import"./chunk-44370df5.js";import"./chunk-srs9jq8f.js";import"./chunk-4yhd7bmp.js";import"./chunk-mkb4dycy.js";import"./chunk-mgnxa0vy.js";import"./chunk-wzdnsgwq.js";import"./chunk-6tv7rm3x.js";import"./chunk-t77dwtcc.js";import"./chunk-6nrynqdw.js";import"./chunk-5bkj2n94.js";import"./chunk-be9a7kc6.js";import"./chunk-xxtcmzcv.js";import"./chunk-pt51m9h1.js";import"./chunk-f4d3v0nc.js";import"./chunk-kejt7kcr.js";import"./chunk-2q7ew7yz.js";import"./chunk-j10gz94w.js";import"./chunk-ktvmxqfg.js";import"./chunk-k1f3gj25.js";import"./chunk-hmmzbyy1.js";import"./chunk-d6d1j7qq.js";import"./chunk-7g2k89gq.js";import"./chunk-7xcyn1ba.js";import"./chunk-785kxysj.js";import"./chunk-ygsbmfcy.js";import"./chunk-1vs91e4q.js";import"./chunk-16txy3r1.js";import"./chunk-90tbc5f4.js";import"./chunk-bkbqvxfv.js";import"./chunk-ts10cfmc.js";import"./chunk-rfsbzd39.js";import"./chunk-2sc2jxd3.js";import"./chunk-f32kxe6c.js";import"./chunk-2f35h4fn.js";import"./chunk-4k2d8w9w.js";import"./chunk-s503pcvb.js";import"./chunk-axb1f1ae.js";import{bj as t,mj as a}from"./chunk-w9p59ahz.js";import"./chunk-txkmks1h.js";function h(){let{shareId:n,fileId:o}=e.useParams(),{start:r,version:i,compare:l,cmpLeft:c,cmpRight:p,cmpActive:d}=e.useSearch();return t(s,{shareId:n,initialFileId:o,startTime:r,versionId:i,compare:l,compareLeftId:c,compareRightId:p,compareActiveSide:d})}var e=a("/share/$shareId/files/$fileId")({component:h});export{e as Route};
File without changes