@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.
- package/bin/{chunk-mcj1xpcc.js → chunk-01vx2chc.js} +2 -2
- package/bin/chunk-0epkrexd.js +2 -0
- package/bin/chunk-0h5239kt.js +2 -0
- package/bin/{chunk-jt0ykktx.js → chunk-0jnstdgf.js} +1 -1
- package/bin/{chunk-x03jwaga.js → chunk-0njsjy6x.js} +4 -4
- package/bin/{chunk-7naa7tpn.js → chunk-13rq2gtr.js} +2 -2
- package/bin/chunk-1aqs9sdh.js +3 -0
- package/bin/{chunk-m0q2cgfg.js → chunk-22jbsrka.js} +1 -1
- package/bin/chunk-2qknebmd.js +1 -0
- package/bin/{chunk-a411xhmm.js → chunk-2qzmh3ae.js} +4 -4
- package/bin/{chunk-2nhgdqdg.js → chunk-2tt0b8ym.js} +2 -2
- package/bin/{chunk-p3f5aevs.js → chunk-2zm7czk6.js} +1 -1
- package/bin/{chunk-p4s95471.js → chunk-396tfwdx.js} +1 -1
- package/bin/chunk-3mx4trvh.js +10 -0
- package/bin/{chunk-b5rhvzv9.js → chunk-45pb3kzz.js} +2 -2
- package/bin/{chunk-q83h0hkx.js → chunk-47fmhzwv.js} +2 -2
- package/bin/chunk-4awk4xhq.js +2 -0
- package/bin/{chunk-2cdxm1cp.js → chunk-4b2x2qba.js} +23 -23
- package/bin/{chunk-knj2s8mg.js → chunk-4rjy7ybr.js} +8 -8
- package/bin/{chunk-q8w4mbw4.js → chunk-598x693h.js} +2 -2
- package/bin/chunk-5c7ztqs7.js +1 -0
- package/bin/{chunk-2jj4j8cn.js → chunk-65dh7x4c.js} +2 -2
- package/bin/{chunk-hnkcgvcj.js → chunk-66e2vrky.js} +1 -1
- package/bin/{chunk-g22wmpk1.js → chunk-6j3beg6n.js} +2 -2
- package/bin/{chunk-cgmebxx6.js → chunk-6ke13k69.js} +1 -1
- package/bin/{chunk-7sgrtxbt.js → chunk-6rqakmg0.js} +2 -2
- package/bin/{chunk-4mws03es.js → chunk-6ty4tfmf.js} +3 -3
- package/bin/chunk-7e9ws6dh.js +129 -0
- package/bin/chunk-7mdddkfc.js +1 -0
- package/bin/{chunk-q2bew2vc.js → chunk-7q4mgd5x.js} +2 -2
- package/bin/chunk-7yv7shad.js +1 -0
- package/bin/{chunk-qwpkcp8d.js → chunk-81b8rfv7.js} +2 -2
- package/bin/{chunk-atfz7g7e.js → chunk-8a7ymmd4.js} +2 -2
- package/bin/chunk-8ac9at5y.js +2 -0
- package/bin/{chunk-gxepkvt2.js → chunk-8zcfgz9c.js} +1 -1
- package/bin/{chunk-mcw198kg.js → chunk-955kf5kc.js} +8 -8
- package/bin/{chunk-jzgbxqdg.js → chunk-978rm9a9.js} +2 -2
- package/bin/{chunk-jt02kpfc.js → chunk-9qzbrp4d.js} +2 -2
- package/bin/{chunk-tekwpkjf.js → chunk-a283dh05.js} +2 -2
- package/bin/chunk-aa2a06cc.js +1 -0
- package/bin/{chunk-8cjet7pp.js → chunk-ajr1w3vq.js} +6 -6
- package/bin/chunk-akafypge.js +218 -0
- package/bin/chunk-amk373q2.js +2 -0
- package/bin/chunk-apq2gvvp.js +4 -0
- package/bin/chunk-av2w1sez.js +2 -0
- package/bin/{chunk-5wapd171.js → chunk-b6kmj34z.js} +12 -12
- package/bin/chunk-bkzaw9p8.js +1 -0
- package/bin/{chunk-zezje74z.js → chunk-bssb9tar.js} +3 -3
- package/bin/chunk-bwvj1aqc.js +1 -0
- package/bin/chunk-by9esjn7.js +3 -0
- package/bin/chunk-bywk8mbc.js +2 -0
- package/bin/{chunk-9xhjy897.js → chunk-c61g9hfa.js} +4 -4
- package/bin/{chunk-zrszykjf.js → chunk-cdcgjh8k.js} +1 -1
- package/bin/{chunk-yk12hydf.js → chunk-d277evce.js} +4 -4
- package/bin/{chunk-55h9ze53.js → chunk-d3brvxh7.js} +2 -2
- package/bin/{chunk-9t3p4xp6.js → chunk-dcb1nzf1.js} +1 -1
- package/bin/{chunk-mzsw9var.js → chunk-dfbzatq9.js} +2 -2
- package/bin/chunk-e0bckx12.js +2 -0
- package/bin/{chunk-3ckkwdjx.js → chunk-e2p4s2pj.js} +3 -3
- package/bin/chunk-e8zzg57c.js +2 -0
- package/bin/{chunk-vp3czaeh.js → chunk-edfaqwaq.js} +2 -2
- package/bin/chunk-ehgrp0f9.js +1 -0
- package/bin/chunk-evs2aaav.js +12 -0
- package/bin/{chunk-s9ksftq2.js → chunk-f5bhcjhw.js} +1 -1
- package/bin/{chunk-ns33grgx.js → chunk-fb9dedm2.js} +2 -2
- package/bin/{chunk-srxp5jav.js → chunk-ff0mh9p3.js} +32 -32
- package/bin/chunk-fpfby5tz.js +1 -0
- package/bin/{chunk-eyjfhdp9.js → chunk-gd3b5akr.js} +2 -2
- package/bin/{chunk-1wfg56z3.js → chunk-gm1fy3hm.js} +5 -5
- package/bin/{chunk-9n1w5dw1.js → chunk-gqkjx7rz.js} +3 -3
- package/bin/{chunk-1nvd90g2.js → chunk-h7f5370s.js} +1 -1
- package/bin/chunk-hcyhsn8e.js +2 -0
- package/bin/{chunk-vcrmjtcz.js → chunk-jxm0gzmf.js} +2 -2
- package/bin/{chunk-b7bnp021.js → chunk-k3ggy3xk.js} +2 -2
- package/bin/{chunk-257dcd2f.js → chunk-k9vjs21p.js} +2 -2
- package/bin/chunk-ka40gv72.js +1 -0
- package/bin/chunk-km70p970.js +2 -0
- package/bin/{chunk-e4yscwen.js → chunk-m6v8rb39.js} +8 -8
- package/bin/chunk-m8spagwp.js +4 -0
- package/bin/{chunk-y241cxff.js → chunk-mfh7mg5b.js} +1 -1
- package/bin/chunk-n0cn0218.js +2 -0
- package/bin/chunk-n54ftsdx.js +2 -0
- package/bin/{chunk-02fvcrej.js → chunk-n7cvj15k.js} +7 -7
- package/bin/chunk-na5fh7er.js +2 -0
- package/bin/chunk-neazdbxy.js +1 -0
- package/bin/chunk-nk24qw3m.js +1 -0
- package/bin/{chunk-73yncv54.js → chunk-nsbbseff.js} +2 -2
- package/bin/chunk-nseef85h.js +1 -0
- package/bin/chunk-p35ztj2z.js +3 -0
- package/bin/chunk-pcjc9ygv.js +2 -0
- package/bin/{chunk-167z646e.js → chunk-pemmtd8q.js} +1 -1
- package/bin/{chunk-82tps5n1.js → chunk-pzrqnnpg.js} +1 -1
- package/bin/{chunk-a74g6h8a.js → chunk-q43m934j.js} +2 -2
- package/bin/{chunk-r1xer8gn.js → chunk-q57m34h0.js} +3 -3
- package/bin/chunk-q5k72jz9.js +3 -0
- package/bin/chunk-q9fsxakd.js +2 -0
- package/bin/chunk-qadpe0ct.js +2 -0
- package/bin/chunk-qeypjv4f.css +1 -0
- package/bin/chunk-qw92z3wf.js +2 -0
- package/bin/chunk-r0byfq1t.js +1 -0
- package/bin/chunk-r0q88qw3.js +2 -0
- package/bin/chunk-rjhczkh3.js +2 -0
- package/bin/{chunk-mwktrwtx.js → chunk-s0wxbybf.js} +1 -1
- package/bin/{chunk-q5vkxee3.js → chunk-s4hkcw24.js} +2 -2
- package/bin/chunk-szta50g1.js +1 -0
- package/bin/chunk-t6cb99gp.js +2 -0
- package/bin/chunk-tcr080b9.js +1 -0
- package/bin/{chunk-yq32evnn.js → chunk-v4nqx084.js} +5 -5
- package/bin/{chunk-ympbfzz4.js → chunk-v7jzc3ye.js} +1 -1
- package/bin/{chunk-9zsv6d2f.js → chunk-vbe8wred.js} +1 -1
- package/bin/{chunk-hpbn0k9n.js → chunk-vf9s8b5t.js} +2 -2
- package/bin/{chunk-m9adtgzk.js → chunk-vk3eqr65.js} +1 -1
- package/bin/{chunk-hpwv4am3.js → chunk-vm9bbk97.js} +4 -4
- package/bin/{chunk-v05rrxp5.js → chunk-w4gqg27w.js} +2 -2
- package/bin/{chunk-x8mjh387.js → chunk-w6ym7tsd.js} +4 -4
- package/bin/{chunk-hzkjgcre.js → chunk-ways29d1.js} +1 -1
- package/bin/chunk-wesg7tg9.js +1 -0
- package/bin/chunk-wmrrapwv.js +2 -0
- package/bin/chunk-wnwsjgj8.js +2 -0
- package/bin/{chunk-hw6czrya.js → chunk-wrb4xq9v.js} +1 -1
- package/bin/{chunk-v5cn90cf.js → chunk-wzrzc07t.js} +2 -2
- package/bin/chunk-xd1axsdv.js +2 -0
- package/bin/{chunk-cwat1jwx.js → chunk-xk0jmx4s.js} +2 -2
- package/bin/{chunk-g6sdezec.js → chunk-y545vfn0.js} +1 -1
- package/bin/{chunk-fatmqnp1.js → chunk-y6h885fs.js} +1 -1
- package/bin/{chunk-cz13a82m.js → chunk-yncmfr39.js} +2 -2
- package/bin/{chunk-01052ssf.js → chunk-yxnz4ypt.js} +11 -11
- package/bin/chunk-zc1asygg.js +2 -0
- package/bin/{chunk-m82tkhaa.js → chunk-zc7wzcvh.js} +7 -7
- package/bin/chunk-zdvhh8mk.js +2 -0
- package/bin/{chunk-kvhf12b4.js → chunk-zg0b902x.js} +2 -2
- package/bin/{chunk-7v7mypc6.js → chunk-zhq7a7hs.js} +2 -2
- package/bin/{chunk-f25fe9th.js → chunk-zmnvskn7.js} +11 -11
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +470 -389
- package/package.json +7 -7
- package/prisma/migrations/20261102032402_add_archive_storage/migration.sql +25 -0
- package/prisma/schema.prisma +12 -6
- package/bin/chunk-0bj887zm.js +0 -2
- package/bin/chunk-1ktk6764.js +0 -10
- package/bin/chunk-26qn7fek.js +0 -2
- package/bin/chunk-2ne2b54t.js +0 -2
- package/bin/chunk-2vbeqczj.js +0 -1
- package/bin/chunk-37p6bcx2.js +0 -1
- package/bin/chunk-3knfx6dm.js +0 -1
- package/bin/chunk-3z85zxkn.js +0 -1
- package/bin/chunk-54tbfvya.js +0 -2
- package/bin/chunk-56kh5fxc.js +0 -1
- package/bin/chunk-576nj64j.js +0 -2
- package/bin/chunk-6cnqjngz.js +0 -1
- package/bin/chunk-7g46e1wy.js +0 -3
- package/bin/chunk-84x8p7v5.js +0 -1
- package/bin/chunk-88jg9dq5.js +0 -2
- package/bin/chunk-8fyg9dy4.js +0 -2
- package/bin/chunk-8gtfgkrn.js +0 -2
- package/bin/chunk-8mqbztj8.js +0 -2
- package/bin/chunk-8qdtvfx3.css +0 -1
- package/bin/chunk-8xb6yz11.js +0 -2
- package/bin/chunk-8yjsmr7g.js +0 -2
- package/bin/chunk-91rb0jpb.js +0 -2
- package/bin/chunk-96qpjght.js +0 -2
- package/bin/chunk-9f1xk1nt.js +0 -1
- package/bin/chunk-9mk9cvbk.js +0 -1
- package/bin/chunk-9nw5w8vh.js +0 -1
- package/bin/chunk-ah8fjb6f.js +0 -2
- package/bin/chunk-cf5axr8c.js +0 -1
- package/bin/chunk-dk42gf7v.js +0 -2
- package/bin/chunk-e4f56spj.js +0 -4
- package/bin/chunk-eb7mzbfm.js +0 -1
- package/bin/chunk-er14d498.js +0 -3
- package/bin/chunk-f6avg5qe.js +0 -129
- package/bin/chunk-fvx9k1dc.js +0 -2
- package/bin/chunk-gtf19jc1.js +0 -2
- package/bin/chunk-h1n7jqnw.js +0 -1
- package/bin/chunk-hfm82066.js +0 -2
- package/bin/chunk-j2s311yc.js +0 -3
- package/bin/chunk-kj6h5j5a.js +0 -4
- package/bin/chunk-km4gn6b6.js +0 -1
- package/bin/chunk-ny1kbmxt.js +0 -2
- package/bin/chunk-p3j6ydk1.js +0 -1
- package/bin/chunk-pk406dgy.js +0 -2
- package/bin/chunk-s1e4qy3q.js +0 -14
- package/bin/chunk-swtwaaqe.js +0 -1
- package/bin/chunk-tagdrg7p.js +0 -1
- package/bin/chunk-twtxnzbv.js +0 -2
- package/bin/chunk-v5mcjwxy.js +0 -2
- package/bin/chunk-vkzasgxw.js +0 -2
- package/bin/chunk-x342vzdx.js +0 -2
- package/bin/chunk-xc54vhfz.js +0 -2
- package/bin/chunk-xvkwbczx.js +0 -3
- package/bin/chunk-z1p13dnc.js +0 -2
- package/bin/chunk-zarz3sqn.js +0 -211
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,Q,w,L,W,a,g,ae,ee,X,Rt,Je,R,j,vr,V,Dr,Ht,xo,Dn,qt,Hl,Cr,Ni,rs,Re,ns,Ue,Ke,U,N,$e,He,Qe,De,Ne,Fe,se,g_,E_,Ge,vE,IE,Fd,xx,Cx,Eh,Dt,Jx,Yx,lC,cC,Dp,bC,$_,po,oI,sI,iI,aI,lI,cI,uI,zp,tT,u1,Ny,P1,H1,Ky,_0,zi,am,xg,lm,j0,Pg,oP,sP,$0,H0,G0,K0,W0,um,Y0,pP,ai,ct,ut,dt,ft,pt,mt,ht,gt,Se,xe,ke,ot,Ce,Nt,re,Ie,Bs,ln,ro,So,ci,cn,mm,Vt,B,ze,Zr,vt,An,xa,Av,jo,Qg,gl,Al,Sa,fe,Ve,Ye,Xe,et,tt,be,Ia,vm,bm,wm,xm}from"./chunk-akafypge.js";import{fc}from"./chunk-6rqakmg0.js";import{$o}from"./chunk-8a7ymmd4.js";import{$n}from"./chunk-qw92z3wf.js";import{Hn}from"./chunk-81b8rfv7.js";L();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=j("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(N,{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($o,{className:"w-3.5 h-3.5"}),a("span",{children:pP()})]}),g(N,{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($n,{className:"w-3.5 h-3.5"}),a("span",{children:u1()})]})]}),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(ns,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),a("span",{className:"truncate font-medium",children:b.id===xa?ai():b.title}),a(N,{variant:"ghost",size:"icon-xs",onClick:m,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:IE(),children:a(Ke,{className:"w-3 h-3"})})]})]}),x&&a("div",{className:"flex items-center gap-2 shrink-0",children:g(N,{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:Eh()})]})})]})}L();L();function oe({teamId:e,isOpen:r,onClose:b,goalToEdit:m}){let k=ae(),[x,D]=w(""),[p,T]=w("");S(()=>{if(m)D(m.title),T(m.description||"");else D(""),T("")},[m,r]);let{mutate:K,isPending:A}=X({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:po()}));throw Error(f.message||po())}return await n.json()},onSuccess:()=>{k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),B.success(oI()),b()},onError:(n)=>{B.error(n.message)}}),{mutate:P,isPending:I}=X({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:po()}));throw Error(f.message||po())}return await n.json()},onSuccess:()=>{k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),B.success(uI()),b()},onError:(n)=>{B.error(n.message)}}),E=(n)=>{if(n.preventDefault(),!x.trim())return;if(m)P();else K()},l=A||I;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?$_():Cx()}),a(Nt,{children:m?$_():xx()})]}),g("div",{className:"space-y-3 py-2",children:[g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"goal-title",children:lI()}),a(re,{id:"goal-title",value:x,onChange:(n)=>D(n.target.value),placeholder:cI(),required:!0,autoFocus:!0})]}),g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"goal-description",children:iI()}),a(Sa,{id:"goal-description",value:p,onChange:(n)=>T(n.target.value),placeholder:aI(),rows:3})]})]}),g(ot,{children:[a(N,{type:"button",variant:"outline",onClick:b,disabled:l,children:Ge()}),g(N,{type:"submit",disabled:!x.trim()||l,children:[l&&a(V,{className:"w-4 h-4 mr-1.5 animate-spin"}),m?zi():Fd()]})]})]})})})}function pe({teamId:e,selectedGoalId:r,onSelectGoal:b,isOwnerOrEditor:m=!0}){let k=ae(),[x,D]=w(!1),[p,T]=w(null),[K,A]=w(null),[P,I]=w(!1),{data:E,isLoading:l}=ee({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}=X({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:po()}));throw Error(c.message||po())}return await s.json()},onSuccess:(o,s)=>{if(k.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),k.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),B.success(sI()),r===s)b(null);A(null)},onError:(o)=>{B.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(N,{variant:"ghost",size:"icon-sm",onClick:()=>I(!1),title:zp(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:a(qt,{className:"w-4 h-4"})})}),g("div",{className:"mt-3 flex flex-col items-center gap-2",children:[a(N,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>b(null),title:g_(),className:U("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:a(fc,{className:"w-4 h-4"})}),a(N,{variant:"ghost",size:"icon-sm",onClick:()=>D(!0),title:Ny(),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(oe,{teamId:e,isOpen:x,onClose:()=>D(!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(ns,{className:"w-4 h-4 text-sidebar-primary"}),a("span",{children:zp()})]}),g("div",{className:"flex items-center gap-1",children:[m&&a(N,{variant:"ghost",size:"icon-sm",onClick:()=>D(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:Ny(),children:a(Re,{className:"w-4 h-4"})}),a(N,{variant:"ghost",size:"icon-sm",onClick:()=>I(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:a(Dn,{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:U("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(fc,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),a("span",{className:"truncate",children:g_()})]}),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(V,{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:P1()}):n.map((o)=>{let s=r===o.id,c=o.id===xa,v=c?ai():o.title,u=m&&!c;return g("div",{onClick:()=>b(o.id),className:U("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(ns,{className:U("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(W,{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(N,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:a(vr,{className:"w-3.5 h-3.5"})})}),g(Fe,{align:"end",className:"w-36",children:[g(se,{onClick:()=>{T(o)},children:[a(me,{className:"w-3.5 h-3.5 mr-2"}),bC()]}),g(se,{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"}),Dt()]})]})]})})]}):(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(oe,{teamId:e,isOpen:x||!!p,goalToEdit:p,onClose:()=>{D(!1),T(null)}}),K&&a(ct,{open:!!K,onOpenChange:(o)=>!o&&A(null),children:g(ut,{children:[g(dt,{children:[a(pt,{children:Jx()}),a(mt,{children:Yx({title:K.title})})]}),g(ft,{children:[a(gt,{disabled:i,children:Ge()}),g(ht,{onClick:()=>y(K.id),disabled:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[i&&a(V,{className:"w-4 h-4 mr-1.5 animate-spin"}),Dt()]})]})]})})]})}L();L();function ge(e){return+ze(e)<Date.now()}function ve({task:e,onClick:r,onDelete:b,disabled:m,isFirst:k,isLast:x,showBottomIndicator:D,currentUserId:p,currentUserRole:T}){let{source:K}=mm(),A=!!K,P=T?.toLowerCase()==="owner",I=T?.toLowerCase()==="editor",E=!!p&&e.creator?.id===p,l=e.reporter?.id===p||E,n=e.assignee?.id===p,f=P||I||l||n,y=E||P||l,i=m||!f,{ref:o,isDragging:s}=ci({id:e.id,data:{type:"kanban_task",task:e},disabled:i}),{ref:c,isDropTarget:v}=cn({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||m}),{ref:u,isDropTarget:d}=cn({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||m}),C=e.isAgentTask,_=e.status===vt.BLOCKED,h=e.dueDate?ge(new Date(e.dueDate))&&e.status!==vt.DONE:!1;return g("div",{className:"relative",children:[a("div",{ref:c,className:U("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:U("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||D)&&!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:U("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:U("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",Al(e.priority)),children:gl(e.priority)}),C&&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(Ht,{className:"w-3 h-3"}),a("span",{children:um()})]}),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(ns,{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:(G)=>G.stopPropagation(),children:g(De,{modal:!1,children:[a(Ne,{asChild:!0,children:a(N,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:a(vr,{className:"w-3.5 h-3.5"})})}),a(Fe,{align:"end",className:"w-32",children:g(se,{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"}),Dt()]})})]})})})]}),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(Dr,{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||j0()})]}),e.status===vt.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(Hn,{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(W,{children:[C?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(Ht,{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:ai()})}),g("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&g("div",{className:U("flex items-center gap-1 text-[10px] font-mono",h?"text-red-500 font-semibold":"text-muted-foreground"),title:Zr(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[a(xo,{className:"w-3 h-3"}),a("span",{children:Zr(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:tT({count:e.assetCount}),children:[a(Hl,{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(Ni,{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(rs,{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:D,onDeleteTask:p,onCreateTaskInColumn:T}){let K=x?.toLowerCase()==="owner"||x?.toLowerCase()==="editor",A=m==="my"?k:void 0,{data:P,fetchNextPage:I,hasNextPage:E,isFetchingNextPage:l,isLoading:n}=Rt({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:b,assigneeId:A}],queryFn:async({pageParam:F=""})=>{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:F||void 0}});if(!O.ok)throw Error("Failed to fetch column tasks");return await O.json()},initialPageParam:"",getNextPageParam:(F)=>F.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:f,inView:y}=Vt({threshold:0.1});S(()=>{if(y&&E&&!l)I()},[y,E,l,I]);let i=Q(()=>P?.pages?.flatMap((F)=>Array.isArray(F?.data)?F.data:[])||[],[P]),{source:o,target:s}=mm(),c=i.filter((F)=>F.id!==o?.id).at(-1),{ref:v,isDropTarget:u}=cn({id:r,data:{type:"kanban_column",status:r,lastTask:c}}),d=o?.data?.type==="kanban_task",C=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,G=Qg(r);return g("div",{ref:v,className:U("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",C&&"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:U("w-2.5 h-2.5 rounded-full shrink-0",G.dot)}),a("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:jo(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(V,{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:H1()})}):i.map((F,O)=>a(ve,{task:F,onClick:D,onDelete:p,isFirst:O===0,isLast:O===i.length-1,showBottomIndicator:_&&F.id===c?.id,currentUserId:k,currentUserRole:x},F.id)),a("div",{ref:f,className:"h-2"}),l&&a("div",{className:"flex justify-center py-2",children:a(V,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),K&&a("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:g(N,{variant:"ghost",size:"sm",onClick:()=>T(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:Eh()})]})})]})}function ye({teamId:e,selectedGoalId:r,scope:b,currentUserId:m,currentUserRole:k,onTaskClick:x,onCreateTaskInColumn:D}){let p=ae(),[T,K]=w(null),{mutate:A,isPending:P}=X({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:po()}));throw Error(f.message||po())}return await n.json()},onSuccess:()=>{p.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),p.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),B.success(sP()),K(null)},onError:(l)=>{B.error(l.message)}}),{mutate:I}=X({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:po()}));throw Error(c.message||po())}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 C=d.data.find((_)=>_.id===l);if(C)return o={...C,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((G)=>G.id===f);if(h!==-1)d=y==="before"?h:h+1}u.splice(d,0,c);let C=0,_=v.pages.map((h,G)=>{let F=h?.data?h.data.length:0,O=G===0&&F===0?1:G===v.pages.length-1?u.length-C:F,H=u.slice(C,C+O);return C+=O,{...h,data:H,pageInfo:{...h?.pageInfo,total:(h?.pageInfo?.total??0)+1}}});if(C<u.length&&_.length>0){let h=_.length-1;_[h]={..._[h],data:[..._[h]?.data??[],...u.slice(C)]}}return{...v,pages:_}})}return{previousQueries:i}},onError:(l,n,f)=>{if(f?.previousQueries)for(let[y,i]of f.previousQueries)p.setQueryData(y,i);B.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){B.error(vE());return}let u=f.data;if(!u)return;if(u.type==="reorder"&&u.task&&u.position){let d=u.task,C=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;I({taskId:i.id,fromStatus:i.status,status:C,beforeIndex:_,afterIndex:h,targetTaskId:d.id,position:u.position});return}if(u.type==="kanban_column"&&u.status){let{status:d,lastTask:C}=u;if(C){if(i.id===C.id){if(i.status===d)return;I({taskId:i.id,fromStatus:i.status,status:d});return}I({taskId:i.id,fromStatus:i.status,status:d,afterIndex:C.sortIndex??void 0,targetTaskId:C.id,position:"after"});return}if(i.status===d)return;I({taskId:i.id,fromStatus:i.status,status:d})}};return g(So,{sensors:[ro.configure({activationConstraints:[new ln.Distance({value:8})]}),Bs],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:Av.map((l)=>a(he,{teamId:e,status:l,selectedGoalId:r,scope:b,currentUserId:m,currentUserRole:k,onTaskClick:x,onDeleteTask:(n)=>K(n),onCreateTaskInColumn:D},l))})}),T&&a(ct,{open:!!T,onOpenChange:(l)=>!l&&K(null),children:g(ut,{children:[g(dt,{children:[a(pt,{children:lC()}),a(mt,{children:cC({title:T.title})})]}),g(ft,{children:[a(gt,{disabled:P,children:Ge()}),g(ht,{onClick:()=>A(T.id),disabled:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[P&&a(V,{className:"w-4 h-4 mr-1.5 animate-spin"}),Dt()]})]})]})})]})}L();function we({teamId:e,isOpen:r,onClose:b,initialGoalId:m}){let k=ae(),x=m===xa||!m?"none":m,[D,p]=w(""),[T,K]=w(""),[A,P]=w(!1),[I,E]=w(An.MEDIUM),[l,n]=w(x),[f,y]=w("none"),[i,o]=w("none"),[s,c]=w(void 0),[v,u]=w(void 0),[d,C]=w(null),[_,h]=w(null),[G,F]=w(null),[O,H]=w([]),[Y,Z]=w([]),[ie,le]=w(!1),{data:de}=ee({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(""),K(""),P(!1),E(An.MEDIUM),n(x),y("none"),o(de?.id||"none"),c(void 0),u(void 0),C(null),h(null),F(null),H([]),Z([])},[r,x,de?.id]);let{data:ce=[]}=ee({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=[]}=ee({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}=ee({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:J}=X({mutationFn:async()=>{let t=await R.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:D.trim(),description:T.trim()||void 0,isAgentTask:A,priority:I,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:Y.length>0?Y.map((M)=>M.id):void 0}});if(!t.ok){let M=await t.text().catch(()=>""),q=po();if(M)try{let ne=JSON.parse(M);if(ne&&typeof ne.message==="string")q=ne.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"]}),B.success(oP()),b()},onError:(t)=>{B.error(t.message)}}),Me=(t)=>{if(t.preventDefault(),!D.trim()||J)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:Eh()})}),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:K0()}),a(re,{id:"create-task-title",value:D,onChange:(t)=>p(t.target.value),placeholder:W0(),required:!0,autoFocus:!0})]}),g("div",{className:"space-y-1.5",children:[a(fe,{htmlFor:"create-task-desc",children:$0()}),a(Sa,{id:"create-task-desc",value:T,onChange:(t)=>K(t.target.value),placeholder:H0(),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(Ht,{className:"w-3.5 h-3.5 text-orange-500"}),a("span",{children:um()})]}),a("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:Y0()})]}),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:G0()}),g(Ye,{value:I,onValueChange:(t)=>E(t),children:[a(et,{className:"w-full h-9 text-xs",children:a(Xe,{})}),a(tt,{children:Object.values(An).map((t)=>a(be,{value:t,children:a("span",{className:U("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",Al(t)),children:gl(t)})},t))})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:zp()}),g(Ye,{value:l,onValueChange:n,children:[a(et,{className:"w-full h-9 text-xs",children:a(Xe,{placeholder:"None"})}),g(tt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:"None"})}),Le.filter((t)=>t.id!==xa).map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[a(ns,{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?am():E_()}),g(Ye,{value:f,onValueChange:y,children:[a(et,{className:"w-full h-9 text-xs",children:a(Xe,{placeholder:ai()})}),g(tt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:ai()})}),te?Ae.map((t)=>a(be,{value:t.id,children:g("div",{className:"flex items-center gap-2",children:[a(Ht,{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:_0()}),g(Ye,{value:i,onValueChange:o,children:[a(et,{className:"w-full h-9 text-xs",children:a(Xe,{placeholder:ai()})}),g(tt,{children:[a(be,{value:"none",children:a("span",{className:"text-muted-foreground italic",children:ai()})}),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:Pg()}),g(N,{type:"button",variant:"outline",size:"sm",onClick:()=>le(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[a(Cr,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),a("span",{className:"truncate",children:G||xg()})]})]}),g("div",{className:"space-y-1.5",children:[a(fe,{className:"text-xs font-medium text-muted-foreground",children:lm()}),a(Ia,{value:s,onChange:c,placeholder:lm(),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(Ia,{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:Ky()}),a(vm,{teamId:e,value:O,onChange:H})]}),a("div",{className:"sm:col-span-2 pt-1",children:a(bm,{teamId:e,projectId:d,assets:Y,onAddAssets:(t)=>Z((M)=>[...M,...t]),onRemoveAsset:(t)=>Z((M)=>M.filter((q)=>q.id!==t))})})]})]}),g(ot,{children:[a(N,{type:"button",variant:"outline",onClick:b,disabled:J,children:Ge()}),g(N,{type:"submit",disabled:!D.trim()||J,children:[J&&a(V,{className:"w-4 h-4 mr-1.5 animate-spin"}),Fd()]})]})]}),ie&&a(wm,{teamId:e,currentProjectId:d,currentTargetFolderId:_,isOpen:ie,onClose:()=>le(!1),onSelect:(t,M,q)=>{C(t),h(M),F(q||"Selected Folder")}})]})})}function Te({teamId:e,initialTaskId:r}){let[b,m]=w("team"),[k,x]=w(null),[D,p]=w(r??null),[T,K]=w(!1);S(()=>{if(r)p(r)},[r]);let[A,P]=w(vt.TODO),{data:I,isLoading:E}=ee({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}=ee({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=I?.role?.toLowerCase()==="owner"||I?.role?.toLowerCase()==="editor",i=(s=vt.TODO)=>{P(s),K(!0)},o=(s)=>{p(s.id)};if(E)return a("div",{className:"flex h-full items-center justify-center",children:a(V,{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(vt.TODO),canCreateTask:y}),a(ye,{teamId:e,selectedGoalId:k,scope:b,currentUserId:I?.id,currentUserRole:I?.role,onTaskClick:o,onCreateTaskInColumn:(s)=>i(s)})]}),D&&a(xm,{teamId:e,taskId:D,isOpen:!!D,onClose:()=>p(null),canEdit:y}),T&&a(we,{teamId:e,isOpen:T,initialStatus:A,initialGoalId:k,onClose:()=>K(!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,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{co,L,a,g,ee,R,Qv,Xv,vh,Fp,Bh,F1,cM,bg,E0,eO,Fg,Lg,to,Se,xe,ke,Ce,Nt,hv,sn,qo,ls,Te}from"./chunk-akafypge.js";import{us}from"./chunk-km70p970.js";L();var y=(p)=>p.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:");function Du({sessionId:p,open:N,onOpenChange:_}){let{data:x,isLoading:S}=ee({queryKey:["agent-sessions",p,"entries"],queryFn:async()=>{if(!p)return[];let r=await R.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:p}});if(!r.ok)throw Error("Failed to fetch session logs");return await r.json()},enabled:N&&!!p});return a(Se,{open:N,onOpenChange:_,children:g(xe,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[g(ke,{className:"pb-4 border-b border-foreground/15",children:[g(Ce,{className:"flex items-center gap-2 text-xl font-bold",children:[a(us,{className:"w-5 h-5 text-violet-500"}),Xv()]}),a(Nt,{children:Qv()})]}),a("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:S?g("div",{className:"space-y-4",children:[g("div",{className:"flex gap-4",children:[a(Te,{className:"h-5 w-5 rounded-full shrink-0"}),g("div",{className:"flex-1 space-y-2",children:[a(Te,{className:"h-4 w-1/4"}),a(Te,{className:"h-20 w-full"})]})]}),g("div",{className:"flex gap-4",children:[a(Te,{className:"h-5 w-5 rounded-full shrink-0"}),g("div",{className:"flex-1 space-y-2",children:[a(Te,{className:"h-4 w-1/4"}),a(Te,{className:"h-12 w-full"})]})]})]}):x&&x.length>0?a("div",{className:"flex flex-col",children:x.map((r)=>{let o=r.entry,b=o?.timestamp||r.timestamp,f="";if(typeof b==="string"||typeof b==="number"){let e=new Date(b);if(!isNaN(e.getTime()))f=sn(e.toISOString())}if(o&&typeof o==="object"){if(o.type==="custom_message"){if(o.customType==="context")return null;if(o.customType==="shumai_message"){let e=hv(o.details),d=typeof o.content==="string"?o.content:"",m=e?`${d}
|
|
2
2
|
|
|
3
|
-
${e}`.trim():d,w="bg-primary/10 text-primary",v=
|
|
4
|
-
export{
|
|
3
|
+
${e}`.trim():d,w="bg-primary/10 text-primary",v=E0();return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center bg-primary"}),g("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[g("div",{className:"flex items-center justify-between gap-2",children:[g("div",{className:"flex items-center gap-2 flex-wrap",children:[a("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:v}),g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:Fp(),children:[Fp(),": ",r.id]})]}),a("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),a("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:m})]})]},r.id)}}if(o.type==="message"&&o.message){let e=o.message,d="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",m=String(e.role||"");if(e.role==="user")d="bg-primary/10 text-primary",m=E0();else if(e.role==="assistant")d="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",m=cM();else if(e.role==="toolResult")d=e.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",m=Lg({name:String(e.toolName||to())});else if(e.role==="thought")d="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",m=bg();let w=(s)=>{let t=s;if(typeof s==="string")try{t=JSON.parse(s)}catch{}if(t&&typeof t==="object"&&!Array.isArray(t))return a("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(t).map(([n,l])=>{let c=l&&typeof l==="object"?JSON.stringify(l,null,2):String(l);return g("div",{className:"text-xs leading-relaxed break-words",children:[g("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[n,":"]})," ",a("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:c})]},n)})});return a("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(s)})},v=()=>{let s=e.content;if(!s)return null;if(typeof s==="string"){if(!s.trim())return null;return a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ls,{children:y(s)})})}if(Array.isArray(s)){let t=[];if(s.forEach((i,n)=>{if(!i)return;if(typeof i==="string"){if(!i.trim())return;t.push(a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ls,{children:y(i)})},`str-${n}`));return}if(typeof i==="object"){let l=i,c=l.type;if(c==="text"){let u=l.text;if(typeof u!=="string"||!u.trim())return;t.push(a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ls,{children:y(u)})},`txt-${n}`));return}if(c==="toolCall"){let u=String(l.name||l.toolName||to()),h=l.arguments||l.args;t.push(g("div",{className:"text-xs space-y-2 py-1",children:[g("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[vh()," ",a("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:u})]}),!!h&&g("div",{className:"space-y-1 pt-3",children:[a("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:Fg()}),w(h)]})]},`tool-${n}`));return}if(c==="image"){t.push(a("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Bh()},`img-${n}`));return}let k=JSON.stringify(i,null,2);if(k==="{}")return;t.push(a("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:k},`other-${n}`))}}),t.length===0)return null;return a("div",{className:"space-y-3 w-full",children:t.map((i,n)=>g(co,{children:[n>0&&a(qo,{className:"my-3 opacity-50"}),i]},n))})}return null};return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${e.role==="user"?"bg-primary":e.role==="assistant"?"bg-violet-500":e.role==="toolResult"?e.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),g("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[g("div",{className:"flex items-center justify-between gap-2",children:[g("div",{className:"flex items-center gap-2 flex-wrap",children:[a("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${d}`,children:m}),g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:Fp(),children:[Fp(),": ",r.id]})]}),a("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),v()]})]},r.id)}}return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),g("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[g("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",r.id]}),a("div",{className:"text-[10px] text-muted-foreground/60",children:f})]}),a("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(r.entry,null,2)})]})]},r.id)})}):g("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[a(us,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),a("p",{className:"text-sm font-medium",children:F1()}),a("p",{className:"text-xs text-muted-foreground/60 mt-1",children:eO()})]})})]})})}
|
|
4
|
+
export{Du};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,Je}from"./chunk-akafypge.js";import"./chunk-evs2aaav.js";import"./chunk-fb9dedm2.js";import"./chunk-7q4mgd5x.js";import"./chunk-7e9ws6dh.js";import"./chunk-d3brvxh7.js";import"./chunk-xd1axsdv.js";import"./chunk-zdvhh8mk.js";import"./chunk-bssb9tar.js";import"./chunk-q57m34h0.js";import"./chunk-3mx4trvh.js";import"./chunk-q9fsxakd.js";import"./chunk-s4hkcw24.js";import{Ma}from"./chunk-zc1asygg.js";import"./chunk-av2w1sez.js";import"./chunk-km70p970.js";import"./chunk-8a7ymmd4.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";import"./chunk-qw92z3wf.js";import"./chunk-zg0b902x.js";import"./chunk-81b8rfv7.js";import"./chunk-wzrzc07t.js";function o(){let{shareId:e,folderId:r}=d.useParams();return a(Ma,{shareId:e,initialFolderId:r})}var d=Je("/share/$shareId/folders/$folderId")({component:o});export{d as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,U}from"./chunk-akafypge.js";function zn({className:t,...e}){return a("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a("table",{"data-slot":"table",className:U("w-full caption-bottom text-sm",t),...e})})}function jn({className:t,...e}){return a("thead",{"data-slot":"table-header",className:U("[&_tr]:border-b",t),...e})}function qn({className:t,...e}){return a("tbody",{"data-slot":"table-body",className:U("[&_tr:last-child]:border-0",t),...e})}function Rr({className:t,...e}){return a("tr",{"data-slot":"table-row",className:U("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function bt({className:t,...e}){return a("th",{"data-slot":"table-head",className:U("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function yt({className:t,...e}){return a("td",{"data-slot":"table-cell",className:U("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}
|
|
2
|
+
export{zn,jn,qn,Rr,bt,yt};
|