@shumai-one/shumai 0.3.11 → 0.4.1

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 (186) hide show
  1. package/bin/chunk-082zg4nr.js +307 -0
  2. package/bin/chunk-09pe07g6.js +7 -0
  3. package/bin/chunk-0qdzjcny.js +2 -0
  4. package/bin/chunk-0z1p2pvf.js +1 -0
  5. package/bin/{chunk-cmd0feyq.js → chunk-116p639c.js} +2 -2
  6. package/bin/{chunk-cyjh5qsk.js → chunk-13ypr8v0.js} +1 -1
  7. package/bin/{chunk-sepsqqdf.js → chunk-16txy3r1.js} +2 -2
  8. package/bin/{chunk-dyen2t1p.js → chunk-1vs91e4q.js} +2 -2
  9. package/bin/chunk-29e0mb43.js +1 -0
  10. package/bin/chunk-2a0egvsg.js +1 -0
  11. package/bin/chunk-2f35h4fn.js +2 -0
  12. package/bin/{chunk-tdp1jjv1.js → chunk-2jsjrqw4.js} +2 -2
  13. package/bin/chunk-2q7ew7yz.js +2 -0
  14. package/bin/{chunk-ps2hw0ps.js → chunk-2sc2jxd3.js} +1 -1
  15. package/bin/chunk-2vc6pw8q.js +2 -0
  16. package/bin/{chunk-f9ydhm8q.js → chunk-3gqdepkd.js} +2 -2
  17. package/bin/chunk-44370df5.js +4 -0
  18. package/bin/chunk-44xtwvd7.js +2 -0
  19. package/bin/{chunk-7t31qfw5.js → chunk-47r5b77s.js} +2 -2
  20. package/bin/chunk-4azttb3w.js +1 -0
  21. package/bin/{chunk-whm06pnc.js → chunk-4ee336e3.js} +1 -1
  22. package/bin/{chunk-qrhf20g2.js → chunk-4k2d8w9w.js} +2 -2
  23. package/bin/{chunk-kcg7d7pk.js → chunk-4yhd7bmp.js} +2 -2
  24. package/bin/chunk-4yybby29.js +2 -0
  25. package/bin/{chunk-0g0gt4bj.js → chunk-5395g4kq.js} +2 -2
  26. package/bin/{chunk-gx410cm2.js → chunk-5bkj2n94.js} +2 -2
  27. package/bin/{chunk-aq7q5e36.js → chunk-5c4h0t33.js} +2 -2
  28. package/bin/{chunk-byjze6hm.js → chunk-6nrynqdw.js} +2 -2
  29. package/bin/chunk-6tv7rm3x.js +2 -0
  30. package/bin/chunk-785kxysj.js +68 -0
  31. package/bin/{chunk-c16vvzdj.js → chunk-78cxvbjd.js} +1 -1
  32. package/bin/chunk-7g2k89gq.js +2 -0
  33. package/bin/chunk-7psq38hv.js +1 -0
  34. package/bin/{chunk-xsqk7ek2.js → chunk-7qzt5nhz.js} +1 -1
  35. package/bin/{chunk-b78s1cxz.js → chunk-7sf0gbbm.js} +2 -2
  36. package/bin/{chunk-9qytehed.js → chunk-7wvw67f3.js} +2 -2
  37. package/bin/chunk-7xcyn1ba.js +2 -0
  38. package/bin/{chunk-vvx62hp4.js → chunk-7zgvmn5q.js} +1 -1
  39. package/bin/{chunk-12r8a5ev.js → chunk-8pfgh13x.js} +2 -2
  40. package/bin/{chunk-xext4yvc.js → chunk-8rcfhfq5.js} +1 -1
  41. package/bin/{chunk-8qg6jjz4.js → chunk-8yt4m2pb.js} +2 -2
  42. package/bin/{chunk-y0k1f3gk.js → chunk-90tbc5f4.js} +2 -2
  43. package/bin/{chunk-mvkqjrcd.js → chunk-92yvt66q.js} +1 -1
  44. package/bin/chunk-93v3tm93.js +1 -0
  45. package/bin/{chunk-s04f76tb.js → chunk-9f83pnfc.js} +2 -2
  46. package/bin/chunk-a5b3aevg.js +2 -0
  47. package/bin/{chunk-0vqefpcw.js → chunk-af6m9p1d.js} +1 -1
  48. package/bin/chunk-ajryg2e2.js +1 -0
  49. package/bin/chunk-axb1f1ae.js +2 -0
  50. package/bin/chunk-b0cqsrse.js +9 -0
  51. package/bin/chunk-b27jgdsf.css +1 -0
  52. package/bin/{chunk-qz3kfrpr.js → chunk-bbar8rsh.js} +1 -1
  53. package/bin/{chunk-8bv8qsb8.js → chunk-be9a7kc6.js} +2 -2
  54. package/bin/{chunk-dwkv3bx5.js → chunk-bkbqvxfv.js} +2 -2
  55. package/bin/chunk-bwyph9a0.js +1 -0
  56. package/bin/{chunk-0xqf53hc.js → chunk-c43nmcfq.js} +1 -1
  57. package/bin/{chunk-4yke5y3z.js → chunk-c97vh5wb.js} +3 -3
  58. package/bin/{chunk-1dzby9bb.js → chunk-cerjktz2.js} +1 -1
  59. package/bin/chunk-cyvx7gcx.js +2 -0
  60. package/bin/{chunk-esa954t1.js → chunk-d6d1j7qq.js} +2 -2
  61. package/bin/{chunk-6edh2e59.js → chunk-d9sh922y.js} +1 -1
  62. package/bin/chunk-dbjc1vxt.js +1 -0
  63. package/bin/{chunk-pz7ms4n2.js → chunk-djkajvn7.js} +1 -1
  64. package/bin/{chunk-s0jy7grq.js → chunk-dyvmwafa.js} +2 -2
  65. package/bin/{chunk-zvjx64p5.js → chunk-ewge52nq.js} +1 -1
  66. package/bin/{chunk-qrnw89xg.js → chunk-f32kxe6c.js} +2 -2
  67. package/bin/{chunk-7anqxpyv.js → chunk-f4d3v0nc.js} +2 -2
  68. package/bin/{chunk-xfzk0mrt.js → chunk-f8ysqfyv.js} +2 -2
  69. package/bin/{chunk-dhhfwbns.js → chunk-fcsar7p0.js} +1 -1
  70. package/bin/{chunk-kbw63gr4.js → chunk-gfdfkqrc.js} +3 -3
  71. package/bin/chunk-gr30nssh.js +1 -0
  72. package/bin/chunk-gtwhwdbs.js +1 -0
  73. package/bin/{chunk-xsgxk1fj.js → chunk-gyaem1t4.js} +1 -1
  74. package/bin/chunk-hk6tvf7b.js +1 -0
  75. package/bin/{chunk-ntqn09r0.js → chunk-hmmzbyy1.js} +2 -2
  76. package/bin/{chunk-s9yzt7s3.js → chunk-hx2mvd20.js} +2 -2
  77. package/bin/chunk-hzz4hsss.js +1 -0
  78. package/bin/{chunk-5nk7y4ec.js → chunk-j10gz94w.js} +2 -2
  79. package/bin/{chunk-p9w4ar11.js → chunk-j5rx3x1q.js} +1 -1
  80. package/bin/{chunk-knh1stxe.js → chunk-j9q9rjvd.js} +2 -2
  81. package/bin/{chunk-ty32j999.js → chunk-jw00fmkp.js} +2 -2
  82. package/bin/chunk-k1f3gj25.js +3 -0
  83. package/bin/{chunk-393g7z2g.js → chunk-k20w9eaz.js} +1 -1
  84. package/bin/{chunk-31f07jzm.js → chunk-kejt7kcr.js} +2 -2
  85. package/bin/{chunk-k1jcdr0n.js → chunk-kkveddbn.js} +1 -1
  86. package/bin/chunk-ktvmxqfg.js +5 -0
  87. package/bin/{chunk-szf2q87p.js → chunk-m49g5tf4.js} +2 -2
  88. package/bin/{chunk-77c2xm0z.js → chunk-me3xj7na.js} +1 -1
  89. package/bin/{chunk-nw03w9pa.js → chunk-mgnxa0vy.js} +1 -1
  90. package/bin/{chunk-fv14er33.js → chunk-mgytr7nc.js} +1 -1
  91. package/bin/chunk-mkb4dycy.js +2 -0
  92. package/bin/chunk-n21a21vx.js +2 -0
  93. package/bin/{chunk-8r2agmv2.js → chunk-n8gsjwht.js} +2 -2
  94. package/bin/{chunk-t2z4qys8.js → chunk-nndzhn3n.js} +1 -1
  95. package/bin/{chunk-ghw914d2.js → chunk-pcxjm1re.js} +2 -2
  96. package/bin/{chunk-3qva5sqr.js → chunk-pg00gkr4.js} +2 -2
  97. package/bin/{chunk-wdgwymdp.js → chunk-pn94h6x7.js} +1 -1
  98. package/bin/chunk-pt51m9h1.js +2 -0
  99. package/bin/{chunk-hpm4razn.js → chunk-px2cvc1n.js} +2 -2
  100. package/bin/{chunk-rr12edz4.js → chunk-q059y3wx.js} +2 -2
  101. package/bin/{chunk-a5ja6d97.js → chunk-q46rc697.js} +1 -1
  102. package/bin/{chunk-sdjss6ja.js → chunk-r6g1srb3.js} +1 -1
  103. package/bin/chunk-r88vwaxc.js +1 -0
  104. package/bin/chunk-r9pzpqst.js +2 -0
  105. package/bin/{chunk-fsj3kxya.js → chunk-rar0gk7s.js} +2 -2
  106. package/bin/chunk-rfrpb986.js +1 -0
  107. package/bin/{chunk-4pj17byj.js → chunk-rfsbzd39.js} +2 -2
  108. package/bin/{chunk-jsqsrcse.js → chunk-s503pcvb.js} +3 -3
  109. package/bin/{chunk-50vzkdc8.js → chunk-s9sgkkjp.js} +1 -1
  110. package/bin/{chunk-12ps84z8.js → chunk-srs9jq8f.js} +2 -2
  111. package/bin/chunk-t77dwtcc.js +2 -0
  112. package/bin/{chunk-res6r4tm.js → chunk-tcqw0q8x.js} +1 -1
  113. package/bin/{chunk-sqy50q9g.js → chunk-thd9zasr.js} +1 -1
  114. package/bin/chunk-tkgpc6c9.js +2 -0
  115. package/bin/{chunk-qh3w5w8e.js → chunk-ts10cfmc.js} +2 -2
  116. package/bin/{chunk-69at8jm8.js → chunk-txkmks1h.js} +1 -1
  117. package/bin/chunk-v9hbssqd.js +3 -0
  118. package/bin/chunk-v9zc56qr.js +1 -0
  119. package/bin/{chunk-v073nwjn.js → chunk-vh7eb7tp.js} +2 -2
  120. package/bin/chunk-w9p59ahz.js +73 -0
  121. package/bin/{chunk-7888x3vz.js → chunk-wfee9d83.js} +3 -3
  122. package/bin/{chunk-r18tcdds.js → chunk-wxsq9zmf.js} +1 -1
  123. package/bin/chunk-wzdnsgwq.js +2 -0
  124. package/bin/chunk-x2nnv4j8.js +1 -0
  125. package/bin/chunk-xxtcmzcv.js +2 -0
  126. package/bin/{chunk-axnvvkdf.js → chunk-xyzmew7g.js} +1 -1
  127. package/bin/{chunk-2s97ngr8.js → chunk-ygsbmfcy.js} +2 -2
  128. package/bin/{chunk-z8crenxd.js → chunk-ym9xavj0.js} +1 -1
  129. package/bin/{chunk-3j47y8ah.js → chunk-z340qkez.js} +1 -1
  130. package/bin/{chunk-6qzcnkgx.js → chunk-za7ga4bf.js} +2 -2
  131. package/bin/{chunk-nzrrvn6c.js → chunk-zqvavykq.js} +2 -2
  132. package/bin/{chunk-f5c9g4y9.js → chunk-zt15ht52.js} +1 -1
  133. package/bin/shumai-app.html +1 -1
  134. package/bin/shumai-app.js +283 -315
  135. package/package.json +7 -7
  136. package/prisma/schema.prisma +1 -1
  137. package/bin/chunk-02b97gsf.js +0 -2
  138. package/bin/chunk-0ash207y.js +0 -2
  139. package/bin/chunk-0j3yb84c.js +0 -1
  140. package/bin/chunk-0wgqr4jg.js +0 -2
  141. package/bin/chunk-1tby7q3f.js +0 -1
  142. package/bin/chunk-3ztat2q9.js +0 -68
  143. package/bin/chunk-48yphy68.js +0 -73
  144. package/bin/chunk-4t2qcxp5.js +0 -1
  145. package/bin/chunk-5dfy6173.js +0 -2
  146. package/bin/chunk-68bfd8x7.js +0 -3
  147. package/bin/chunk-6ts5az6h.js +0 -2
  148. package/bin/chunk-72nj00dp.js +0 -1
  149. package/bin/chunk-8b11b9cj.js +0 -2
  150. package/bin/chunk-8ekjxb5q.js +0 -2
  151. package/bin/chunk-8zar6cc4.js +0 -2
  152. package/bin/chunk-9m9bn55a.js +0 -1
  153. package/bin/chunk-ayr3tsz3.js +0 -2
  154. package/bin/chunk-bthrbggg.js +0 -2
  155. package/bin/chunk-csh1ggtt.js +0 -1
  156. package/bin/chunk-ctx1ms5t.js +0 -2
  157. package/bin/chunk-day0vn14.js +0 -2
  158. package/bin/chunk-e5r6rnt9.js +0 -2
  159. package/bin/chunk-gwzk0fvn.js +0 -2
  160. package/bin/chunk-gx8sz5bw.js +0 -2
  161. package/bin/chunk-gydktfnx.js +0 -2
  162. package/bin/chunk-h5j1dqc0.js +0 -1
  163. package/bin/chunk-h7kyj2g2.js +0 -2
  164. package/bin/chunk-har4xctf.js +0 -2
  165. package/bin/chunk-hks5k0tm.js +0 -7
  166. package/bin/chunk-hv4t9h3e.js +0 -9
  167. package/bin/chunk-kchbbtdm.js +0 -2
  168. package/bin/chunk-mkwrrdme.js +0 -2
  169. package/bin/chunk-mm995mvc.js +0 -2
  170. package/bin/chunk-mz9pthjh.js +0 -2
  171. package/bin/chunk-n2ae527q.js +0 -307
  172. package/bin/chunk-n3xn2ve1.js +0 -1
  173. package/bin/chunk-q3fdffq5.js +0 -1
  174. package/bin/chunk-rd2n0rs6.js +0 -1
  175. package/bin/chunk-sttc4axf.js +0 -1
  176. package/bin/chunk-t6pmgmg2.js +0 -1
  177. package/bin/chunk-txpqhfqw.js +0 -1
  178. package/bin/chunk-vrdbqapq.js +0 -2
  179. package/bin/chunk-vwa17b2r.js +0 -1
  180. package/bin/chunk-wch8ygpt.js +0 -3
  181. package/bin/chunk-wqwvxskj.js +0 -1
  182. package/bin/chunk-wr3q8a9n.js +0 -1
  183. package/bin/chunk-wt01m93x.js +0 -1
  184. package/bin/chunk-xr1wr22v.css +0 -1
  185. package/bin/chunk-y1pnq12c.js +0 -2
  186. /package/bin/{chunk-xg9xscqz.js → chunk-kryt6pg3.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{Ze as S0}from"./chunk-6nrynqdw.js";import{_e as Kb}from"./chunk-5bkj2n94.js";import{Af as Ab,Bf as k0,Cf as u0,Df as Tb,zf as Pb}from"./chunk-kejt7kcr.js";import{Kf as o0,Lf as hb}from"./chunk-2q7ew7yz.js";import{Nf as i0,Of as l0,Pf as x0,Qf as D,Rf as x,Sf as d,bg as _b,dg as t0}from"./chunk-ktvmxqfg.js";import{gg as K0,hg as E0,ig as G0,jg as $0,kg as u}from"./chunk-hmmzbyy1.js";import{lg as Qb}from"./chunk-d6d1j7qq.js";import{mg as bb}from"./chunk-7g2k89gq.js";import{gh as p0}from"./chunk-785kxysj.js";import{hh as k}from"./chunk-ygsbmfcy.js";import{kh as a0}from"./chunk-16txy3r1.js";import{bi as P0}from"./chunk-2sc2jxd3.js";import{ci as Eb}from"./chunk-f32kxe6c.js";import{di as w0,ei as Y0,fi as W0}from"./chunk-2f35h4fn.js";import{gi as Wb,ii as Hb,ji as Jb,ki as Zb}from"./chunk-4k2d8w9w.js";import{Bi as N0,Ci as A0,Ii as Q,Ji as qb,Ki as Vb,Li as Xb,Mi as zb,Ni as Ob,Oi as Ub,Pi as ob,Qi as Db,Ri as V0,Ti as X0,Ui as z0,Vi as M0,Wi as O0,Yi as m,wi as D0,zi as P}from"./chunk-s503pcvb.js";import{_i as I}from"./chunk-axb1f1ae.js";import{$i as Z0,Aj as $b,Cl as fb,Dj as M,Fl as Yb,Gk as Cb,Nk as d0,Qj as Rb,Sl as U0,Wl as j,Xj as B0,_k as Mb,aj as T0,ak as C0,bj as b,cj as r,el as vb,il as L0,ok as wb,qk as g0,qm as A,rk as h0,rl as I0,sk as s0,tm as y,um as v0,xk as a}from"./chunk-w9p59ahz.js";import{rn as J0}from"./chunk-txkmks1h.js";var Ib=[D.TODO,D.READY,D.IN_PROGRESS,D.BLOCKED,D.IN_REVIEW,D.DONE];function f0(N){switch(N){case D.TODO:return y.status_todo();case D.READY:return y.status_ready();case D.IN_PROGRESS:return y.status_in_progress();case D.BLOCKED:return y.status_blocked();case D.IN_REVIEW:return y.status_in_review();case D.DONE:return y.status_done();default:return N}}function kb(N){switch(N){case D.TODO:return{badge:"bg-muted text-muted-foreground border-border",border:"border-border",dot:"bg-muted-foreground",bg:"bg-muted/30"};case D.READY:return{badge:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",border:"border-blue-500/30",dot:"bg-blue-500",bg:"bg-blue-500/5"};case D.IN_PROGRESS:return{badge:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",border:"border-amber-500/30",dot:"bg-amber-500",bg:"bg-amber-500/5"};case D.BLOCKED:return{badge:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",border:"border-red-500/30",dot:"bg-red-500",bg:"bg-red-500/5"};case D.IN_REVIEW:return{badge:"bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20",border:"border-purple-500/30",dot:"bg-purple-500",bg:"bg-purple-500/5"};case D.DONE:return{badge:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",border:"border-emerald-500/30",dot:"bg-emerald-500",bg:"bg-emerald-500/5"}}}function Q0(N){return kb(N).badge}function m0(N){switch(N){case x.LOW:return y.priority_low();case x.MEDIUM:return y.priority_medium();case x.HIGH:return y.priority_high();case x.URGENT:return y.priority_urgent();default:return N}}function c0(N){switch(N){case x.LOW:return"bg-muted text-muted-foreground border-border";case x.MEDIUM:return"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20";case x.HIGH:return"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20";case x.URGENT:return"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20 font-semibold";default:return"bg-muted text-muted-foreground border-border"}}var H0=J0(Z0(),1);var _0=J0(Z0(),1);var ub=[D.TODO,D.READY,D.IN_PROGRESS,D.IN_REVIEW,D.DONE,D.BLOCKED];function j0({teamId:N,currentTaskId:_,excludeTaskIds:E=[],value:W=[],knownTasks:O=[],onChange:q,disabled:z=!1,canEdit:T=!0,className:$}){let[J,B]=_0.useState(!1),[h,Z]=_0.useState(D.TODO),[X,w]=_0.useState(""),[p,H]=_0.useState(()=>{let G={};for(let U of O)G[U.id]={title:U.title,status:U.status};return G}),{data:R,isLoading:y0}=P({queryKey:["teams",N,"kanban","tasks","status",h],queryFn:async()=>{let G=await Q.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:N},query:{status:h,first:"100"}});if(!G.ok)return{data:[]};return await G.json()},enabled:!!N&&J}),F=R?.data||[];_0.useMemo(()=>{if(F.length>0)H((G)=>{let U=!1,g={...G};for(let S of F)if(!g[S.id]||g[S.id].title!==S.title||g[S.id].status!==S.status)g[S.id]={title:S.title,status:S.status},U=!0;return U?g:G})},[F]);let n=_0.useMemo(()=>{let G=new Set(E);if(_)G.add(_);return G},[_,E]),i=_0.useMemo(()=>{let G=X.trim().toLowerCase();return F.filter((U)=>{if(n.has(U.id))return!1;if(!G)return!0;return U.title.toLowerCase().includes(G)})},[F,n,X]),l=(G)=>{if(!T||z)return;let g=W.includes(G)?W.filter((S)=>S!==G):[...W,G];q?.(g)},f=(G,U)=>{if(U.stopPropagation(),!T||z)return;q?.(W.filter((g)=>g!==G))},V=T&&!z;return r(i0,{open:J&&V,onOpenChange:(G)=>V&&B(G),children:[b(l0,{asChild:!0,children:b("div",{role:"button",tabIndex:V?0:-1,className:j("w-full min-h-[36px] px-2.5 py-1.5 flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background text-xs transition-colors",V?"cursor-pointer hover:border-ring/60 focus:outline-none focus:ring-2 focus:ring-ring/50":"cursor-not-allowed opacity-70",$),children:W.length===0?r("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[b(d0,{className:"w-3.5 h-3.5 text-muted-foreground/70"}),b("span",{children:y.select_parent_tasks()})]}):W.map((G)=>{let U=p[G];return r("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[11px] bg-muted text-foreground border border-border/80 shrink-0 max-w-[220px]",children:[U?.status&&b("span",{className:j("px-1 py-0.2 rounded text-[9px] uppercase font-semibold shrink-0",Q0(U.status)),children:f0(U.status)}),b("span",{className:"truncate font-medium",children:U?.title||G}),V&&b("button",{type:"button",onClick:(g)=>f(G,g),className:"text-muted-foreground hover:text-destructive shrink-0 p-0.5 -mr-1",children:b(U0,{className:"w-3 h-3"})})]},G)})})}),r(x0,{align:"start",sideOffset:4,className:"w-[var(--radix-popover-trigger-width)] min-w-[320px] sm:min-w-[420px] max-w-[500px] p-2.5 space-y-2 bg-popover border border-border rounded-lg shadow-lg",children:[b("div",{className:"flex flex-wrap gap-1.5 pb-0.5",children:ub.map((G)=>{return b("button",{type:"button",onClick:()=>Z(G),className:j("text-[11px] h-7 px-2.5 rounded-md font-medium transition-colors border shrink-0",h===G?"bg-primary text-primary-foreground border-primary shadow-xs":"bg-muted/50 hover:bg-accent text-muted-foreground hover:text-foreground border-border/60"),children:f0(G)},G)})}),r("div",{className:"relative",children:[b(I0,{className:"w-3.5 h-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),b(v0,{value:X,onChange:(G)=>w(G.target.value),placeholder:y.filter_tasks_placeholder(),className:"h-8 pl-8 text-xs bg-muted/40",autoFocus:!0})]}),b("div",{className:"border rounded-md overflow-hidden bg-background/50",children:b(k,{className:"h-48 p-1",children:y0?b("div",{className:"flex items-center justify-center py-8",children:b(M,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):i.length===0?b("div",{className:"py-8 text-center text-xs text-muted-foreground italic",children:y.no_matching_tasks()}):b("div",{className:"space-y-1",children:i.map((G)=>{let U=W.includes(G.id);return r("div",{onClick:()=>l(G.id),className:j("flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors text-xs border border-transparent",U&&"bg-accent/50 border-border/50"),children:[r("div",{className:"flex items-center gap-2 min-w-0 flex-1 pr-2",children:[b("div",{className:j("w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors",U?"bg-primary border-primary text-primary-foreground":"border-input bg-background"),children:U&&b(C0,{className:"w-3 h-3 stroke-[3]"})}),b("span",{className:j("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium shrink-0",Q0(G.status)),children:f0(G.status)}),b("span",{className:"font-medium text-foreground truncate",children:G.title})]}),G.assignee&&b("span",{className:"text-[10px] text-muted-foreground truncate shrink-0",children:G.assignee.name})]},G.id)})})})})]})]})}var rb=J0(Z0(),1);var q0=J0(Z0(),1);function e0({teamId:N,initialProjectId:_,excludeAssetIds:E=[],isOpen:W,onClose:O,onConfirm:q}){let[z,T]=q0.useState(_||""),[$,J]=q0.useState(null),[B,h]=q0.useState(new Map),{data:Z,isLoading:X}=P({queryKey:["teams",N,"projects"],queryFn:async()=>{let K=await Q.api.teams[":teamId"].projects.$get({param:{teamId:N},query:{first:"100"}});if(!K.ok)throw Error("Failed to fetch projects");return await K.json()},enabled:!!N&&W}),w=Z?.data||[],p=z||(w[0]?.id??""),H=w.find((K)=>K.id===p),R=$?.id||H?.rootFolder||"",y0=R===H?.rootFolder,{data:F,fetchNextPage:n,hasNextPage:i,isFetchingNextPage:l,isLoading:f}=A0({queryKey:["folders",R,"children","folder","picker"],queryFn:async({pageParam:K})=>{let L=await Q.api.folders[":folderId"].children.$get({param:{folderId:R},query:{assetType:"folder",after:K,first:"20"}});if(!L.ok)throw Error("Failed to fetch folders");return await L.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!R&&W}),{data:V,fetchNextPage:G,hasNextPage:U,isFetchingNextPage:g,isLoading:S}=A0({queryKey:["folders",R,"children","file","picker"],queryFn:async({pageParam:K})=>{let L=await Q.api.folders[":folderId"].children.$get({param:{folderId:R},query:{assetType:"file",after:K,first:"20"}});if(!L.ok)throw Error("Failed to fetch files");return await L.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!R&&W}),{ref:Y,inView:o}=a0();q0.useEffect(()=>{if(o){if(i&&!l)n();else if(U&&!g)G()}},[o,i,l,n,U,g,G]);let t=f&&!F||S&&!V,v=l||g,C=q0.useMemo(()=>{let K=F?.pages.flatMap((r0)=>r0.data??[])??[],L=V?.pages.flatMap((r0)=>r0.data??[])??[];return[...K,...L]},[F,V]),e=(K)=>{let L=new Map(B);if(L.has(K.id))L.delete(K.id);else{let r0=H?`/${[H.name,...(K.ancestorFolders||[]).map((R0)=>R0.name)].filter(Boolean).join("/")}`:"/";L.set(K.id,{id:K.id,name:K.name,type:K.type,proxyType:K.proxyType??null,thumbnailUrl:K.preview?.thumbnailUrl??null,path:r0,creator:K.creator?{id:K.creator.id,name:K.creator.name,image:K.creator.image??void 0}:null,sizeByte:K.sizeByte??0,fileCount:K.fileCount??null,projectId:K.projectId??H?.id??null,createdAt:K.createdAt??new Date().toISOString()})}h(L)},s=()=>{if(!$||y0)return;let K=new Map(B);if(K.has($.id))K.delete($.id);else{let L=H?`/${[H.name,...($.ancestorFolders||[]).map((r0)=>r0.name)].filter(Boolean).join("/")}`:"/";K.set($.id,{id:$.id,name:$.name,type:"folder",proxyType:null,thumbnailUrl:null,path:L,creator:$.creator?{id:$.creator.id,name:$.creator.name,image:$.creator.image??void 0}:null,sizeByte:$.sizeByte??0,fileCount:$.fileCount??null,projectId:$.projectId??H?.id??null,createdAt:$.createdAt??new Date().toISOString()})}h(K)},b0=()=>{q(Array.from(B.values())),O()};return b(V0,{open:W,onOpenChange:(K)=>{if(!K)O()},children:r(X0,{className:"sm:max-w-4xl flex flex-col h-[650px] p-0 overflow-hidden gap-1",children:[b(z0,{className:"px-4 py-3 border-b shrink-0",children:r("div",{className:"flex items-center gap-2",children:[b(a,{className:"w-5 h-5 text-primary"}),b(O0,{children:y.select_assets()})]})}),r("div",{className:"flex items-center gap-2.5 px-4 py-1.5 border-b bg-transparent shrink-0",children:[r("span",{className:"text-xs font-medium text-muted-foreground whitespace-nowrap",children:[y.current_project_label(),":"]}),b("div",{className:"w-64",children:r(K0,{value:p,onValueChange:(K)=>{T(K),J(null)},children:[b(G0,{className:"h-8 text-xs bg-background",children:b(E0,{placeholder:y.select_project()})}),b($0,{children:w.map((K)=>b(u,{value:K.id,className:"text-xs",children:K.name},K.id))})]})})]}),r("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[b("div",{className:"w-1/3 min-h-0 border-r bg-sidebar/30 flex flex-col overflow-hidden",children:b(k,{className:"flex-1 min-h-0 [&>div>div]:block!",children:H&&H.rootFolder?b("div",{className:"p-2",children:b(p0,{teamId:N,projectId:H.id,projectName:H.name,rootFolderId:H.rootFolder,onSelect:(K)=>J(K),selectedFolderId:R,hideCollections:!0,hideShares:!0,hideRecentlyDeleted:!0})}):b("div",{className:"flex items-center justify-center h-full p-6 text-xs text-muted-foreground",children:X?b(M,{className:"w-5 h-5 animate-spin text-muted-foreground"}):y.no_project_selected()})})}),r("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden bg-background",children:[r("div",{className:"p-2.5 px-4 border-b flex items-center justify-between bg-muted/20 shrink-0",children:[r("div",{className:"flex items-center gap-2 text-xs font-medium truncate",children:[b(a,{className:"w-4 h-4 text-muted-foreground shrink-0"}),b("span",{className:"truncate",children:$?$.name:H?.name||""}),y0&&b("span",{className:"text-[10px] text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"Root"})]}),!y0&&$&&b(A,{size:"sm",variant:B.has($.id)?"secondary":"outline",className:"h-7 text-xs gap-1.5",onClick:s,disabled:E.includes($.id),children:B.has($.id)?r(T0,{children:[b(C0,{className:"w-3.5 h-3.5 text-primary"}),y.saved()]}):r(T0,{children:[b(L0,{className:"w-3.5 h-3.5"}),y.select_current_folder()]})})]}),b(k,{className:"flex-1 min-h-0 [&>div>div]:block!",children:t?b("div",{className:"flex items-center justify-center p-12",children:b(M,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):C.length===0?r("div",{className:"flex flex-col items-center justify-center p-12 text-center text-xs text-muted-foreground gap-2",children:[b(a,{className:"w-8 h-8 opacity-30"}),b("p",{children:y.no_assets_in_folder()})]}):r("div",{className:"divide-y divide-border/40",children:[C.map((K)=>{let L=E.includes(K.id),r0=B.has(K.id),R0=K.type==="folder";return r("div",{onClick:()=>{if(!L)e(K)},className:`flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 cursor-pointer transition-colors ${r0?"bg-primary/5":""} ${L?"opacity-50 cursor-not-allowed":""}`,children:[b(t0,{checked:r0,disabled:L,onCheckedChange:()=>{if(!L)e(K)},onClick:(Fb)=>Fb.stopPropagation()}),b("div",{className:"w-9 h-9 rounded bg-muted/60 border shrink-0 flex items-center justify-center overflow-hidden",children:K.preview?.thumbnailUrl?b("img",{src:K.preview.thumbnailUrl,alt:K.name,className:"w-full h-full object-cover"}):R0?b(a,{className:"w-5 h-5 text-primary fill-primary/20"}):b(h0,{className:"w-5 h-5 text-muted-foreground"})}),r("div",{className:"flex-1 min-w-0",children:[b("p",{className:"text-xs font-medium truncate text-foreground",children:K.name}),r("p",{className:"text-[11px] text-muted-foreground truncate",children:[R0?`${K.fileCount??0} items`:o0(K.sizeByte||0),K.creator?.name?` • ${K.creator.name}`:""]})]})]},K.id)}),b("div",{ref:Y,className:"h-1"}),v&&b("div",{className:"flex items-center justify-center p-3",children:b(M,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})})]})]}),r(M0,{className:"p-3 px-4 border-t flex items-center justify-between sm:justify-between bg-muted/10 shrink-0",children:[b("div",{className:"text-xs text-muted-foreground",children:B.size>0&&y.n_assets_selected({count:B.size})}),r("div",{className:"flex items-center gap-2",children:[b(A,{variant:"outline",size:"sm",onClick:O,children:y.cancel()}),b(A,{size:"sm",onClick:b0,disabled:B.size===0,children:y.add_assets()})]})]})]})})}function Nb({teamId:N,projectId:_,assets:E,onAddAssets:W,onRemoveAsset:O,disabled:q=!1}){let[z,T]=rb.useState(!1),$=(J)=>{let B=new Set(E.map((Z)=>Z.id)),h=J.filter((Z)=>!B.has(Z.id));if(h.length>0)W(h)};return r("div",{className:"space-y-2",children:[r("div",{className:"flex items-center justify-between",children:[r("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[b(s0,{className:"w-3.5 h-3.5 text-muted-foreground"}),b("span",{children:y.related_assets()}),E.length>0&&r("span",{className:"text-[11px] text-muted-foreground font-normal",children:["(",E.length,")"]})]}),!q&&b(A,{type:"button",variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-muted",onClick:()=>T(!0),title:y.add_assets(),children:b(L0,{className:"w-3.5 h-3.5"})})]}),b(bb,{}),E.length===0?b("p",{className:"text-xs text-muted-foreground/70 py-1 italic",children:y.no_related_assets()}):b("div",{className:"space-y-1.5 max-h-48 overflow-y-auto pr-1",children:E.map((J)=>{let B=J.type==="folder";return r("div",{className:"flex items-center justify-between gap-2 p-1.5 px-2 rounded-md bg-muted/40 hover:bg-muted/70 transition-colors text-xs border border-border/40",children:[r("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[b("div",{className:"w-7 h-7 rounded bg-muted border shrink-0 flex items-center justify-center overflow-hidden",children:J.thumbnailUrl?b("img",{src:J.thumbnailUrl,alt:J.name,className:"w-full h-full object-cover"}):B?b(a,{className:"w-4 h-4 text-primary fill-primary/20"}):b(h0,{className:"w-4 h-4 text-muted-foreground"})}),r("div",{className:"flex-1 min-w-0",children:[b("p",{className:"font-medium truncate text-foreground leading-snug",children:J.name}),b("p",{className:"text-[10px] text-muted-foreground truncate leading-none mt-0.5",children:J.path||"/"})]})]}),r("div",{className:"flex items-center gap-2 shrink-0",children:[J.creator&&r("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",title:J.creator.name,children:[r(w0,{className:"w-4 h-4 text-[9px]",children:[b(Y0,{src:J.creator.image||void 0}),b(W0,{children:J.creator.name.slice(0,1).toUpperCase()})]}),b("span",{className:"hidden sm:inline text-[11px] max-w-[80px] truncate",children:J.creator.name})]}),!q&&b(A,{type:"button",variant:"ghost",size:"sm",className:"h-5 w-5 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:()=>O(J.id),title:y.unlink_asset(),children:b(U0,{className:"w-3 h-3"})})]})]},J.id)})}),z&&b(e0,{teamId:N,initialProjectId:_,excludeAssetIds:E.map((J)=>J.id),isOpen:z,onClose:()=>T(!1),onConfirm:$})]})}var n0=J0(Z0(),1);function yb({teamId:N,currentProjectId:_,currentTargetFolderId:E,isOpen:W,onClose:O,onSelect:q}){let[z,T]=n0.useState(_||""),[$,J]=n0.useState(null),{data:B,isLoading:h}=P({queryKey:["teams",N,"projects"],queryFn:async()=>{let H=await Q.api.teams[":teamId"].projects.$get({param:{teamId:N},query:{first:"100"}});if(!H.ok)throw Error("Failed to fetch projects");return await H.json()},enabled:!!N&&W}),Z=B?.data||[],X=z||(Z[0]?.id??""),w=Z.find((H)=>H.id===X),p=()=>{if(!X)return;let H=$?.id||w?.rootFolder;if(H)q(X,H,$?.name||w?.name),O()};return b(V0,{open:W,onOpenChange:(H)=>!H&&O(),children:r(X0,{className:"sm:max-w-2xl flex flex-col h-[580px]",children:[b(z0,{children:r("div",{className:"flex items-center gap-2",children:[b(a,{className:"w-5 h-5 text-primary"}),b(O0,{children:y.select_target_folder()})]})}),r("div",{className:"flex flex-col gap-3 flex-1 overflow-hidden py-2",children:[r("div",{className:"space-y-1.5",children:[b("label",{className:"text-xs font-medium text-muted-foreground",children:y.select_project()}),r(K0,{value:X,onValueChange:(H)=>{T(H),J(null)},children:[b(G0,{className:"h-9",children:b(E0,{placeholder:y.select_project()})}),b($0,{children:Z.map((H)=>b(u,{value:H.id,children:H.name},H.id))})]})]}),r("div",{className:"space-y-1.5 flex-1 flex flex-col overflow-hidden",children:[b("label",{className:"text-xs font-medium text-muted-foreground",children:y.target_folder()}),b("div",{className:"border rounded-md flex-1 overflow-hidden bg-sidebar/50",children:b(k,{className:"h-full",children:w&&w.rootFolder?b(p0,{teamId:N,projectId:w.id,projectName:w.name,rootFolderId:w.rootFolder,onSelect:J,selectedFolderId:$?.id||E||w.rootFolder,hideCollections:!0,hideShares:!0,hideRecentlyDeleted:!0}):b("div",{className:"flex items-center justify-center h-full p-6 text-xs text-muted-foreground",children:h?b(M,{className:"w-5 h-5 animate-spin text-muted-foreground"}):y.no_project_selected()})})})]})]}),r(M0,{children:[b(A,{variant:"outline",onClick:O,children:y.cancel()}),b(A,{onClick:p,disabled:!X,children:y.confirm()})]})]})})}function Gb({teamId:N,task:_,canEdit:E=!0}){let W=D0(),[O,q]=H0.useState(_.title),[z,T]=H0.useState(_.description||""),[$,J]=H0.useState(!1),[B,h]=H0.useState(null),Z=H0.useRef(null);H0.useEffect(()=>{q(_.title),T(_.description||"")},[_.id,_.title,_.description]);let{data:X=[]}=P({queryKey:["teams",N,"members","human"],queryFn:async()=>{let f=await Q.api.teams[":teamId"].members.$get({param:{teamId:N},query:{includeAgents:"false"}});if(!f.ok)return[];let V=await f.json();return Array.isArray(V)?V:[]},enabled:!!N}),{data:w=[]}=P({queryKey:["teams",N,"agents"],queryFn:async()=>{let f=await Q.api.teams[":teamId"].agents.$get({param:{teamId:N}});if(!f.ok)return[];return await f.json()||[]},enabled:!!N}),{data:p}=P({queryKey:["teams",N,"kanban","goals"],queryFn:async()=>{let f=await Q.api.teams[":teamId"].kanban.goals.$get({param:{teamId:N},query:{}});if(!f.ok)return{data:[]};return await f.json()},enabled:!!N}),H=p?.data||[],{mutate:R,isPending:y0}=N0({mutationFn:async(f)=>{let V=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:N,taskId:_.id},json:f});if(!V.ok){let G=await V.json().catch(()=>({message:y.error()}));throw Error(G.message||y.error())}return await V.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",N,"kanban","task",_.id]}),W.invalidateQueries({queryKey:["teams",N,"kanban","tasks"]})},onError:(f)=>{m.error(f.message)}}),{mutate:F}=N0({mutationFn:async(f)=>{let V=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].assets.$post({param:{teamId:N,taskId:_.id},json:{assetIds:f.map((G)=>G.id)}});if(!V.ok)throw Error("Failed to link assets");return await V.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",N,"kanban","task",_.id]}),W.invalidateQueries({queryKey:["teams",N,"kanban","tasks"]}),m.success(y.asset_linked())},onError:(f)=>{m.error(f.message)}}),{mutate:n}=N0({mutationFn:async(f)=>{let V=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].assets[":assetId"].$delete({param:{teamId:N,taskId:_.id,assetId:f}});if(!V.ok)throw Error("Failed to unlink asset");return await V.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",N,"kanban","task",_.id]}),W.invalidateQueries({queryKey:["teams",N,"kanban","tasks"]}),m.success(y.asset_unlinked())},onError:(f)=>{m.error(f.message)}}),i=(f,V)=>{if(f==="title")q(V);if(f==="description")T(V);if(Z.current)clearTimeout(Z.current);Z.current=setTimeout(()=>{if(f==="title"&&V.trim()&&V.trim()!==_.title)R({title:V.trim()});else if(f==="description"&&V!==(_.description||""))R({description:V.trim()||null})},600)},l=_.isAgentTask;return r(k,{className:"h-full p-5",children:[r("div",{className:"space-y-6 w-full pr-3",children:[r("div",{className:"space-y-1.5",children:[r("div",{className:"flex items-center justify-between",children:[b(I,{htmlFor:"task-title",className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:y.task_title()}),y0&&r("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground animate-pulse",children:[b(M,{className:"w-3 h-3 animate-spin"}),y.saving()]})]}),b(v0,{id:"task-title",value:O,onChange:(f)=>i("title",f.target.value),disabled:!E,className:"text-base font-semibold h-10 bg-background",placeholder:y.task_title_placeholder()})]}),r("div",{className:"space-y-1.5",children:[b(I,{htmlFor:"task-description",className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:y.task_description()}),b(Kb,{id:"task-description",value:z,onChange:(f)=>i("description",f.target.value),disabled:!E,rows:5,className:"text-xs leading-relaxed bg-background",placeholder:y.task_description_placeholder()})]}),r("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 p-4 rounded-lg bg-muted/20 border border-border/60",children:[r("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-md border border-border/60 bg-background/50 px-3 py-2 h-14",children:[r("div",{className:"space-y-0.5 min-w-0 pr-2",children:[r(I,{className:"text-xs font-medium text-muted-foreground flex items-center gap-1.5",children:[b(B0,{className:"w-3.5 h-3.5 text-orange-500"}),b("span",{children:y.task_type_agent()})]}),b("p",{className:"text-[11px] text-muted-foreground/80 line-clamp-1",children:y.task_type_agent_desc()})]}),b(Eb,{checked:_.isAgentTask,disabled:!0})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.task_priority()}),r(K0,{value:_.priority,onValueChange:(f)=>R({priority:f}),disabled:!E,children:[b(G0,{className:"w-full h-8 text-xs bg-background",children:b(E0,{})}),b($0,{children:Object.values(x).map((f)=>b(u,{value:f,children:b("span",{className:j("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",c0(f)),children:m0(f)})},f))})]})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.goals()}),r(K0,{value:_.goal?.id||"none",onValueChange:(f)=>R({goalId:f==="none"?null:f}),disabled:!E,children:[b(G0,{className:"w-full h-8 text-xs bg-background",children:b(E0,{placeholder:y.no_folder_selected()})}),r($0,{children:[b(u,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:"None"})}),H.filter((f)=>f.id!==_b).map((f)=>b(u,{value:f.id,children:r("div",{className:"flex items-center gap-2",children:[b(fb,{className:"w-3.5 h-3.5 text-primary"}),b("span",{children:f.title})]})},f.id))]})]})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:l?y.select_agent():y.assignee()}),r(K0,{value:_.assignee?.id||"none",onValueChange:(f)=>R({assigneeId:f==="none"?null:f}),disabled:!E,children:[b(G0,{className:"w-full h-8 text-xs bg-background",children:b(E0,{placeholder:y.unassigned()})}),r($0,{children:[b(u,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:y.unassigned()})}),l?w.map((f)=>b(u,{value:f.id,children:r("div",{className:"flex items-center gap-2",children:[b(B0,{className:"w-3.5 h-3.5 text-purple-500"}),b("span",{children:f.name})]})},f.id)):X.map((f)=>b(u,{value:f.id,children:r("div",{className:"flex items-center gap-2",children:[r(w0,{size:"sm",className:"w-4 h-4",children:[b(Y0,{src:f.image}),b(W0,{className:"text-[8px]",children:f.name.slice(0,2).toUpperCase()})]}),b("span",{children:f.name})]})},f.id))]})]})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.reporter()}),r(K0,{value:_.reporter?.id||"none",onValueChange:(f)=>R({reporterId:f==="none"?null:f}),disabled:!E,children:[b(G0,{className:"w-full h-8 text-xs bg-background",children:b(E0,{placeholder:y.unassigned()})}),r($0,{children:[b(u,{value:"none",children:b("span",{className:"text-muted-foreground italic",children:y.unassigned()})}),X.map((f)=>b(u,{value:f.id,children:r("div",{className:"flex items-center gap-2",children:[r(w0,{size:"sm",className:"w-4 h-4",children:[b(Y0,{src:f.image}),b(W0,{className:"text-[8px]",children:f.name.slice(0,2).toUpperCase()})]}),b("span",{children:f.name})]})},f.id))]})]})]}),l&&r("div",{className:"sm:col-span-2 space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.target_folder()}),b("div",{className:"flex items-center gap-2",children:r(A,{type:"button",variant:"outline",size:"sm",onClick:()=>J(!0),disabled:!E,className:"w-full justify-start h-8 text-xs bg-background truncate font-normal",children:[b(a,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),b("span",{className:"truncate",children:B||(_.targetFolderId?"Selected Folder":y.select_target_folder())})]})})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.start_date()}),b(S0,{value:_.startDate?new Date(_.startDate):void 0,onChange:(f)=>R({startDate:f?f.toISOString():null}),disabled:!E,placeholder:y.start_date(),className:"h-8 text-xs bg-background"})]}),r("div",{className:"space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.due_date()}),b(S0,{value:_.dueDate?new Date(_.dueDate):void 0,onChange:(f)=>R({dueDate:f?f.toISOString():null}),disabled:!E,placeholder:y.due_date(),className:"h-8 text-xs bg-background"})]}),r("div",{className:"sm:col-span-2 space-y-1.5",children:[b(I,{className:"text-xs font-medium text-muted-foreground",children:y.parent_tasks()}),b(j0,{teamId:N,currentTaskId:_.id,excludeTaskIds:_.dependents.map((f)=>f.id),value:_.dependencies.map((f)=>f.id),knownTasks:[..._.dependencies,..._.dependents],onChange:(f)=>R({parentIds:f}),canEdit:E})]}),b("div",{className:"sm:col-span-2 pt-1",children:b(Nb,{teamId:N,projectId:_.projectId,assets:_.assets||[],onAddAssets:(f)=>F(f),onRemoveAsset:(f)=>n(f),disabled:!E})})]})]}),$&&b(yb,{teamId:N,currentProjectId:_.projectId,currentTargetFolderId:_.targetFolderId,isOpen:$,onClose:()=>J(!1),onSelect:(f,V,G)=>{h(G||"Selected Folder"),R({projectId:f,targetFolderId:V})}})]})}var nb=J0(Z0(),1);var F0=J0(Z0(),1);function Bb({teamId:N,taskId:_,comment:E,currentUserId:W,isOwnerOrAdmin:O}){let q=D0(),[z,T]=F0.useState(!1),[$,J]=F0.useState(null),B=O||E.author.id===W,{mutate:h,isPending:Z}=N0({mutationFn:async()=>{let w=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].comments[":commentId"].$delete({param:{teamId:N,taskId:_,commentId:E.id}});if(!w.ok){let p=await w.json().catch(()=>({message:y.error()}));throw Error(p.message||y.error())}return await w.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["teams",N,"kanban","tasks",_,"comments"]}),q.invalidateQueries({queryKey:["teams",N,"kanban","task",_]}),q.invalidateQueries({queryKey:["teams",N,"kanban","tasks"]}),m.success("Comment deleted"),T(!1)},onError:(w)=>{m.error(w.message)}}),X=(E.author.name||"U").split(" ").map((w)=>w[0]).slice(0,2).join("").toUpperCase();return r("div",{className:"relative flex gap-3 p-3 rounded-xl border border-transparent bg-foreground/[0.03] dark:bg-foreground/[0.08] hover:bg-foreground/[0.06] dark:hover:bg-foreground/[0.12] transition-colors group w-full max-w-full overflow-hidden",children:[r(w0,{className:"w-7 h-7 shrink-0 mt-0.5 border border-border",children:[E.author.image&&b(Y0,{src:E.author.image,alt:E.author.name}),b(W0,{className:"text-[10px] font-medium bg-muted text-muted-foreground",children:X})]}),r("div",{className:"flex-1 min-w-0 space-y-1.5 overflow-hidden",children:[r("div",{className:"flex items-center justify-between gap-2",children:[r("div",{className:"flex items-center gap-2 min-w-0",children:[b("span",{className:"font-semibold text-xs text-foreground truncate",children:E.author.name}),b("span",{className:"text-[10px] text-muted-foreground shrink-0 font-mono",children:P0(new Date(E.createdAt),"MMM d, h:mm a")})]}),B&&b("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:r(Wb,{modal:!1,children:[b(Hb,{asChild:!0,children:b(A,{size:"icon-xs",variant:"ghost",className:"h-5 w-5 text-muted-foreground",children:b($b,{className:"h-3.5 w-3.5"})})}),b(Jb,{align:"end",children:r(Zb,{className:"text-destructive focus:text-destructive cursor-pointer text-xs",onClick:()=>T(!0),children:[b(Yb,{className:"mr-1.5 h-3.5 w-3.5"}),b("span",{children:y.delete()})]})})]})})]}),E.body&&b("div",{className:"text-xs leading-relaxed prose prose-xs dark:prose-invert max-w-none break-words text-foreground/90 font-sans",children:b(Qb,{children:E.body})}),E.attachments&&E.attachments.length>0&&b("div",{className:"flex flex-col gap-1.5 pt-1.5 w-full max-w-full overflow-hidden",children:E.attachments.map((w)=>{let p=Tb(w.name||w.url);return r("div",{className:`group/att relative flex items-center w-full max-w-full rounded-lg border border-border bg-card hover:bg-muted/40 transition-colors overflow-hidden ${p?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"}`,onClick:()=>{if(p)J({url:w.url,name:w.name});else window.open(w.url,"_blank","noreferrer")},children:[p?b("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-muted/40 shrink-0",children:b("img",{src:w.url,alt:w.name,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):b(g0,{className:"w-4 h-4 text-muted-foreground shrink-0"}),r("div",{className:"min-w-0 flex-1 overflow-hidden",children:[b("p",{className:"text-xs font-medium text-foreground truncate block w-full",title:w.name,children:w.name}),w.sizeByte!==void 0&&w.sizeByte>0&&b("p",{className:"text-[10px] text-muted-foreground font-mono truncate",children:o0(w.sizeByte)})]}),b("a",{href:w.url,download:w.name,target:"_blank",rel:"noreferrer",className:"p-1 text-muted-foreground hover:text-foreground shrink-0 rounded-md hover:bg-muted transition-colors opacity-0 group-hover/att:opacity-100",onClick:(H)=>H.stopPropagation(),title:y.download(),children:b(wb,{className:"w-3.5 h-3.5"})})]},w.id)})})]}),b(qb,{open:z,onOpenChange:T,children:r(Vb,{children:[r(Xb,{children:[b(Ob,{children:y.delete_comment_confirm()}),b(Ub,{children:y.delete_comment_description()})]}),r(zb,{children:[b(Db,{disabled:Z,children:y.cancel()}),b(ob,{className:"bg-destructive hover:bg-destructive/90 text-white",disabled:Z,onClick:()=>h(),children:y.delete()})]})]})}),b(V0,{open:!!$,onOpenChange:(w)=>!w&&J(null),children:r(X0,{className:"w-auto max-w-[80vw] sm:max-w-[80vw] max-h-[80vh] p-2 sm:p-3 bg-background/95 backdrop-blur-sm border-border flex flex-col items-center justify-center overflow-hidden",onClick:(w)=>w.stopPropagation(),children:[b(z0,{className:"sr-only",children:b(O0,{children:$?.name||"Image Preview"})}),$&&r("div",{className:"flex flex-col items-center justify-center max-w-[80vw] max-h-[80vh] overflow-hidden",children:[b("img",{src:$.url,alt:$.name,className:"max-w-[80vw] max-h-[calc(80vh-2.5rem)] w-auto h-auto object-contain rounded-md"}),b("p",{className:"text-xs text-muted-foreground truncate max-w-full px-2 pt-1.5 text-center",children:$.name})]})]})})]})}var c=J0(Z0(),1);function Lb({teamId:N,onSendMessage:_,isSubmitting:E}){let[W,O]=c.useState(""),[q,z]=c.useState([]),[T,$]=c.useState(!1),[J,B]=c.useState(""),[h,Z]=c.useState(0),X=c.useRef(null),w=c.useRef(null),p=c.useRef(null),{members:H,fetchMembers:R}=hb();c.useEffect(()=>{if(N)R(N,!0,!0)},[N,R]);let{mutateAsync:y0}=N0({mutationFn:async(Y)=>{let o=await Q.api.teams[":teamId"].kanban.attachments.$post({param:{teamId:N},json:Y});if(!o.ok)throw Error("Failed to get attachment upload url");return await o.json()}}),F=(Y)=>{let o=Y.target.value;if(O(o),X.current)X.current.style.height="auto",X.current.style.height=`${Math.min(X.current.scrollHeight,160)}px`;let t=Y.target.selectionStart||0,v=o.slice(0,t),C=v.lastIndexOf("@");if(C!==-1){let e=C===0,s=v[C-1];if(e||/\s/.test(s)){let K=v.slice(C+1);if(!/\s/.test(K)){B(K),$(!0);return}}}$(!1)},n=H.filter((Y)=>Y.name?.toLowerCase().includes(J.toLowerCase()));c.useEffect(()=>{Z(0)},[J,T]);let i=(Y)=>{if(!X.current)return;let o=X.current.selectionStart||0,t=W.slice(0,o),v=W.slice(o),C=t.lastIndexOf("@");if(C!==-1){let e=`${W.slice(0,C)}@${Y.name} ${v}`;O(e),$(!1),setTimeout(()=>{if(X.current){X.current.focus();let s=C+Y.name.length+2;X.current.setSelectionRange(s,s)}},0)}},l=async(Y)=>{let o=Array.from(Y.target.files||[]);if(o.length===0)return;let t=o.map((v)=>({id:`${Date.now()}-${v.name}-${Math.random()}`,file:v,isUploading:!0}));z((v)=>[...v,...t]);for(let v of t)try{let C=await y0({fileName:v.file.name,size:v.file.size,contentType:v.file.type||"application/octet-stream"});if(!(await fetch(C.uploadUrl,{method:"PUT",body:v.file,headers:{"Content-Type":v.file.type||"application/octet-stream"}})).ok)throw Error("Failed to upload file to storage");z((s)=>s.map((b0)=>b0.id===v.id?{...b0,isUploading:!1,payload:{id:C.id,name:C.name,key:C.key,sizeByte:C.sizeByte,contentType:C.contentType,proxyType:C.proxyType}}:b0))}catch(C){let e=C instanceof Error?C.message:"Upload failed";m.error(`${v.file.name}: ${e}`),z((s)=>s.map((b0)=>b0.id===v.id?{...b0,isUploading:!1,error:e}:b0))}if(w.current)w.current.value=""},f=(Y)=>{z((o)=>o.filter((t)=>t.id!==Y))},V=q.some((Y)=>Y.isUploading),G=q.map((Y)=>Y.payload).filter((Y)=>!!Y),U=(W.trim().length>0||G.length>0)&&!V,g=async()=>{if(!U||E)return;try{if(await _(W.trim(),G.length>0?G:void 0),O(""),z([]),X.current)X.current.style.height="auto"}catch{}},S=(Y)=>{if(T&&n.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),Z((o)=>(o+1)%n.length);return}if(Y.key==="ArrowUp"){Y.preventDefault(),Z((o)=>(o-1+n.length)%n.length);return}if(Y.key==="Enter"||Y.key==="Tab"){Y.preventDefault();let o=n[h];if(o)i(o);return}if(Y.key==="Escape"){$(!1);return}}if(Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey))Y.preventDefault(),g()};return r("div",{className:"relative flex flex-col w-full border border-border focus-within:border-foreground/40 bg-card rounded-2xl p-2.5 shadow-2xs transition-all",children:[T&&n.length>0&&b("div",{ref:p,className:"absolute bottom-full left-0 mb-2 w-64 max-h-48 overflow-y-auto rounded-xl border border-border bg-popover p-1 shadow-lg z-50",children:n.map((Y,o)=>r("button",{type:"button",onClick:()=>i(Y),className:`w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left ${o===h?"bg-primary text-primary-foreground font-medium":"hover:bg-muted text-foreground"}`,children:[r(w0,{className:"w-5 h-5",children:[Y.image&&b(Y0,{src:Y.image}),b(W0,{className:"text-[9px]",children:Y.name?.slice(0,2).toUpperCase()})]}),b("span",{className:"truncate",children:Y.name})]},Y.id))}),q.length>0&&b("div",{className:"flex flex-wrap gap-1.5 pb-2 mb-1.5 border-b border-border/50",children:q.map((Y)=>{let o=Y.file.type.startsWith("image/");return r("div",{className:"flex items-center gap-1.5 pl-2 pr-1.5 py-1 rounded-lg bg-muted/60 border border-border text-xs max-w-[200px]",children:[Y.isUploading?b(M,{className:"w-3.5 h-3.5 animate-spin text-primary shrink-0"}):o?b(Cb,{className:"w-3.5 h-3.5 text-primary shrink-0"}):b(g0,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),r("div",{className:"min-w-0 flex-1 truncate",children:[b("span",{className:"truncate block font-medium text-[11px]",children:Y.file.name}),b("span",{className:"text-[9px] text-muted-foreground font-mono",children:o0(Y.file.size)})]}),b("button",{type:"button",onClick:()=>f(Y.id),className:"p-0.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",children:b(U0,{className:"w-3 h-3"})})]},Y.id)})}),b("textarea",{ref:X,value:W,onChange:F,onKeyDown:S,placeholder:y.comment_placeholder(),rows:1,className:"w-full min-h-[44px] max-h-[160px] bg-transparent border-0 focus:outline-hidden focus-visible:ring-0 resize-none text-xs text-foreground placeholder:text-muted-foreground/70 p-1 font-sans leading-relaxed"}),r("div",{className:"flex items-center justify-between pt-1 mt-1 border-t border-border/40",children:[r("div",{className:"flex items-center gap-1",children:[b("input",{ref:w,type:"file",multiple:!0,className:"hidden",onChange:l}),b(A,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>w.current?.click(),className:"h-7 w-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted",title:"Attach files",disabled:E,children:b(vb,{className:"w-3.5 h-3.5"})}),b("span",{className:"text-[10px] text-muted-foreground/60 hidden sm:inline pl-1",children:"Cmd+Enter to send"})]}),b(A,{type:"button",size:"icon-xs",onClick:g,disabled:!U||E,className:"h-7 w-7 rounded-full shadow-xs bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-40 transition-all shrink-0",title:"Send comment",children:E||V?b(M,{className:"w-3.5 h-3.5 animate-spin"}):b(Rb,{className:"w-3.5 h-3.5 stroke-[2.5]"})})]})]})}function pb({teamId:N,taskId:_,initialComments:E}){let W=D0(),{data:O}=P({queryKey:["teams",N,"me"],queryFn:async()=>{let Z=await Q.api.teams[":teamId"].me.$get({param:{teamId:N}});if(!Z.ok)throw Error("Failed to fetch me");return await Z.json()},enabled:!!N}),q=O?.role?.toLowerCase()==="owner"||O?.role?.toLowerCase()==="editor",{data:z,isLoading:T}=P({queryKey:["teams",N,"kanban","tasks",_,"comments"],queryFn:async()=>{let Z=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].comments.$get({param:{teamId:N,taskId:_}});if(!Z.ok)throw Error("Failed to fetch comments");return await Z.json()},initialData:E?{data:E}:void 0,enabled:!!N&&!!_,refetchInterval:4000}),$=z?.data||[],{mutateAsync:J,isPending:B}=N0({mutationFn:async({body:Z,attachments:X})=>{let w=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].comments.$post({param:{teamId:N,taskId:_},json:{body:Z,attachments:X}});if(!w.ok){let p=await w.json().catch(()=>({message:y.error()}));throw Error(p.message||y.error())}return await w.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",N,"kanban","tasks",_,"comments"]}),W.invalidateQueries({queryKey:["teams",N,"kanban","task",_]}),W.invalidateQueries({queryKey:["teams",N,"kanban","tasks"]})},onError:(Z)=>{m.error(Z.message)}}),h=async(Z,X)=>{await J({body:Z,attachments:X})};return r("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b(k,{className:"flex-1 min-h-0 p-3.5 [&>div>div]:block!",children:b("div",{className:"space-y-3 pr-1 pb-2 w-full max-w-full",children:T?b("div",{className:"flex items-center justify-center py-12",children:b(M,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):$.length===0?r("div",{className:"flex flex-col items-center justify-center py-16 text-center text-xs text-muted-foreground/80 space-y-2",children:[b("div",{className:"w-10 h-10 rounded-full bg-muted/60 flex items-center justify-center",children:b(Mb,{className:"w-5 h-5 opacity-40"})}),b("p",{className:"font-medium",children:y.no_comments_yet()})]}):$.map((Z)=>b(Bb,{teamId:N,taskId:_,comment:Z,currentUserId:O?.id,isOwnerOrAdmin:q},Z.id))})}),b("div",{className:"p-3 border-t border-border/60 bg-card/60 shrink-0",children:b(Lb,{teamId:N,onSendMessage:h,isSubmitting:B})})]})}function mb(N){let _=N.data||{};switch(N.type){case d.CREATED:return"Created task";case d.STATUS_CHANGED:return`Changed status from ${N.fromStatus?f0(N.fromStatus):"None"} to ${N.toStatus?f0(N.toStatus):"None"}`;case d.ASSIGNED:return"Assigned task";case d.UNASSIGNED:return"Unassigned task";case d.PRIORITY_CHANGED:return`Changed priority to ${String(_.to||"")}`;case d.GOAL_CHANGED:return"Updated goal association";case d.DEPENDENCY_ADDED:return"Added prerequisite dependency";case d.DEPENDENCY_REMOVED:return"Removed prerequisite dependency";case d.CHANGES_REQUESTED:return`Requested changes: "${String(_.reason||"")}"`;case d.BLOCKED:return`Task blocked: "${String(_.reason||_.blockReason||"")}"`;case d.UNBLOCKED:return"Task unblocked";case d.COMMENTED:return"Added a comment";default:return N.type}}function gb({teamId:N,taskId:_,initialEvents:E}){let{data:W,isLoading:O}=P({queryKey:["teams",N,"kanban","tasks",_,"events"],queryFn:async()=>{let z=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].events.$get({param:{teamId:N,taskId:_}});if(!z.ok)throw Error("Failed to fetch events");return await z.json()},initialData:E?{data:E}:void 0,enabled:!!N&&!!_}),q=W?.data||[];return b(k,{className:"h-full p-3",children:b("div",{className:"space-y-4 pr-2",children:b("div",{className:"space-y-2",children:O?b("div",{className:"flex items-center justify-center py-6",children:b(M,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):q.length===0?b("div",{className:"py-6 text-center text-xs text-muted-foreground",children:y.no_activity_yet()}):b("div",{className:"relative pl-5 space-y-3 before:absolute before:left-[4px] before:top-2 before:bottom-2 before:w-[2px] before:bg-border/60",children:q.map((z)=>r("div",{className:"relative flex items-start gap-2 text-xs",children:[b("div",{className:"absolute -left-5 top-[3px] w-2.5 h-2.5 rounded-full bg-background border-2 border-primary shrink-0"}),r("div",{className:"flex-1 min-w-0",children:[r("div",{className:"flex items-center justify-between gap-1",children:[b("span",{className:"font-medium text-foreground truncate",children:z.actor?.name||"System"}),b("span",{className:"text-[10px] text-muted-foreground font-mono shrink-0",children:P0(new Date(z.createdAt),"MM/dd HH:mm")})]}),b("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:mb(z)})]})]},z.id))})})})})}function Sb({teamId:N,task:_}){let[E,W]=nb.useState("comments");return b("div",{className:"flex flex-col h-full bg-sidebar/30 border-l border-border/60 overflow-hidden",children:r(Pb,{value:E,onValueChange:(O)=>W(O),className:"flex flex-col h-full",children:[b("div",{className:"px-3 pt-2.5 pb-1 border-b border-border/60 bg-card/50 shrink-0",children:r(Ab,{className:"w-full grid grid-cols-2 h-8 bg-muted/60",children:[r(k0,{value:"comments",className:"text-xs h-7",children:[b("span",{children:y.comments()}),_.comments.length>0&&r("span",{className:"text-[10px] font-mono text-muted-foreground ml-1",children:["(",_.comments.length,")"]})]}),b(k0,{value:"activity",className:"text-xs h-7",children:b("span",{children:y.activity()})})]})}),r("div",{className:"flex-1 overflow-hidden",children:[b(u0,{value:"comments",className:"h-full m-0 data-[state=active]:flex data-[state=active]:flex-col",children:b(pb,{teamId:N,taskId:_.id,initialComments:_.comments})}),b(u0,{value:"activity",className:"h-full m-0 data-[state=active]:block",children:b(gb,{teamId:N,taskId:_.id,initialEvents:_.events})})]})]})})}function q5({teamId:N,taskId:_,isOpen:E,onClose:W,canEdit:O=!0}){let{data:q,isLoading:z,error:T}=P({queryKey:["teams",N,"kanban","task",_],queryFn:async()=>{if(!_)return null;let $=await Q.api.teams[":teamId"].kanban.tasks[":taskId"].$get({param:{teamId:N,taskId:_}});if(!$.ok)throw Error("Failed to fetch task details");return await $.json()},enabled:!!N&&!!_&&E});return b(V0,{open:E,onOpenChange:($)=>!$&&W(),children:r(X0,{className:"sm:max-w-5xl w-[95vw] h-[88vh] p-0 gap-0 flex flex-col overflow-hidden bg-background",children:[b(z0,{className:"px-5 py-3 border-b border-border/70 flex flex-row items-center justify-between space-y-0 shrink-0 bg-card/80",children:r("div",{className:"flex items-center gap-2 min-w-0 pr-4",children:[q?.isAgentTask&&r("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[b(B0,{className:"w-3.5 h-3.5"}),b("span",{children:y.task_type_agent()})]}),q?.status&&b("span",{className:j("px-2 py-0.5 rounded text-[11px] font-medium border uppercase shrink-0",Q0(q.status)),children:f0(q.status)}),b(O0,{className:"text-sm font-semibold truncate text-foreground",children:q?.title||y.edit_task()})]})}),b("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:z?b("div",{className:"flex-1 flex items-center justify-center p-12",children:b(M,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):T||!q?b("div",{className:"flex-1 flex items-center justify-center p-12 text-xs text-muted-foreground",children:y.file_not_found()}):r(T0,{children:[b("div",{className:"flex-1 md:w-2/3 h-full overflow-hidden flex flex-col",children:b(Gb,{teamId:N,task:q,canEdit:O})}),b("div",{className:"md:w-1/3 h-full overflow-hidden flex flex-col",children:b(Sb,{teamId:N,task:q})})]})})]})})}
2
+ export{Ib as Pe,f0 as Qe,kb as Re,Q0 as Se,m0 as Te,c0 as Ue,j0 as Ve,Nb as We,yb as Xe,q5 as Ye};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{bm as _1}from"./chunk-sdjss6ja.js";import{cm as P1,dm as f1}from"./chunk-xsgxk1fj.js";import{lm as D1}from"./chunk-fv14er33.js";import{mm as B1}from"./chunk-fsj3kxya.js";import{nm as j1,om as S0}from"./chunk-9qytehed.js";import{Fm as T1,Im as I1,Jm as R1,Km as k1,Lm as y1}from"./chunk-r18tcdds.js";import{Mm as c}from"./chunk-393g7z2g.js";import{Nm as S1}from"./chunk-xsqk7ek2.js";import{Tm as j0}from"./chunk-cmd0feyq.js";import{Vm as A1}from"./chunk-a5ja6d97.js";import"./chunk-69at8jm8.js";function U(X,Z,$,W,Y){if(W==="m")throw TypeError("Private method is not writable");if(W==="a"&&!Y)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?X!==Z||!Y:!Z.has(X))throw TypeError("Cannot write private member to an object whose class did not declare it");return W==="a"?Y.call(X,$):Y?Y.value=$:Z.set(X,$),$}function z(X,Z,$,W){if($==="a"&&!W)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?X!==Z||!W:!Z.has(X))throw TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?W:$==="a"?W.call(X):W?W.value:Z.get(X)}var pZ=function(){let{crypto:X}=globalThis;if(X?.randomUUID)return pZ=X.randomUUID.bind(X),X.randomUUID();let Z=new Uint8Array(1),$=X?()=>X.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(W)=>(+W^$()&15>>+W/4).toString(16))};function d(X){return typeof X==="object"&&X!==null&&(("name"in X)&&X.name==="AbortError"||("message"in X)&&String(X.message).includes("FetchRequestCanceledException"))}var xX=(X)=>{if(X instanceof Error)return X;if(typeof X==="object"&&X!==null){try{if(Object.prototype.toString.call(X)==="[object Error]"){let Z=Error(X.message,X.cause?{cause:X.cause}:{});if(X.stack)Z.stack=X.stack;if(X.cause&&!Z.cause)Z.cause=X.cause;if(X.name)Z.name=X.name;return Z}}catch{}try{return Error(JSON.stringify(X))}catch{}}return Error(X)};class C extends Error{}class A extends C{constructor(X,Z,$,W,Y){super(`${A.makeMessage(X,Z,$)}`);this.status=X,this.headers=W,this.requestID=W?.get("request-id"),this.error=Z,this.type=Y??null}static makeMessage(X,Z,$){let W=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):$;if(X&&W)return`${X} ${W}`;if(X)return`${X} status code (no body)`;if(W)return W;return"(no status code or body)"}static generate(X,Z,$,W){if(!X||!W)return new s({message:$,cause:xX(Z)});let Y=Z,J=Y?.error?.type;if(X===400)return new FX(X,Y,$,W,J);if(X===401)return new LX(X,Y,$,W,J);if(X===403)return new AX(X,Y,$,W,J);if(X===404)return new jX(X,Y,$,W,J);if(X===409)return new SX(X,Y,$,W,J);if(X===422)return new BX(X,Y,$,W,J);if(X===429)return new DX(X,Y,$,W,J);if(X>=500)return new TX(X,Y,$,W,J);return new A(X,Y,$,W,J)}}class D extends A{constructor({message:X}={}){super(void 0,void 0,X||"Request was aborted.",void 0)}}class s extends A{constructor({message:X,cause:Z}){super(void 0,void 0,X||"Connection error.",void 0);if(Z)this.cause=Z}}class HX extends s{constructor({message:X}={}){super({message:X??"Request timed out."})}}class FX extends A{}class LX extends A{}class AX extends A{}class jX extends A{}class SX extends A{}class BX extends A{}class DX extends A{}class TX extends A{}var c1=/^[a-z][a-z0-9+.-]*:/i,P0=(X)=>{return c1.test(X)},lZ=(X)=>(lZ=Array.isArray,lZ(X)),iZ=lZ;function qZ(X){if(typeof X!=="object")return{};return X??{}}function nZ(X){if(!X)return!0;for(let Z in X)return!1;return!0}function f0(X,Z){return Object.prototype.hasOwnProperty.call(X,Z)}var I0=(X,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new C(`${X} must be an integer`);if(Z<0)throw new C(`${X} must be a positive integer`);return Z};var CZ=(X)=>{try{return JSON.parse(X)}catch(Z){return}};var R0=(X)=>new Promise((Z)=>setTimeout(Z,X));var i="0.91.1";var h0=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function d1(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var m1=()=>{let X=d1();if(X==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(Deno.build.os),"X-Stainless-Arch":k0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(X==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(globalThis.process.platform??"unknown"),"X-Stainless-Arch":k0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=u1();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function u1(){if(typeof navigator>"u"||!navigator)return null;let X=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:$}of X){let W=$.exec(navigator.userAgent);if(W){let Y=W[1]||0,J=W[2]||0,Q=W[3]||0;return{browser:Z,version:`${Y}.${J}.${Q}`}}}return null}var k0=(X)=>{if(X==="x32")return"x32";if(X==="x86_64"||X==="x64")return"x64";if(X==="arm")return"arm";if(X==="aarch64"||X==="arm64")return"arm64";if(X)return`other:${X}`;return"unknown"},y0=(X)=>{if(X=X.toLowerCase(),X.includes("ios"))return"iOS";if(X==="android")return"Android";if(X==="darwin")return"MacOS";if(X==="win32")return"Windows";if(X==="freebsd")return"FreeBSD";if(X==="openbsd")return"OpenBSD";if(X==="linux")return"Linux";if(X)return`Other:${X}`;return"Unknown"},_0,g0=()=>{return _0??(_0=m1())};function b0(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function rZ(...X){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...X)}function OZ(X){let Z=Symbol.asyncIterator in X?X[Symbol.asyncIterator]():X[Symbol.iterator]();return rZ({start(){},async pull($){let{done:W,value:Y}=await Z.next();if(W)$.close();else $.enqueue(Y)},async cancel(){await Z.return?.()}})}function PX(X){if(X[Symbol.asyncIterator])return X;let Z=X.getReader();return{async next(){try{let $=await Z.read();if($?.done)Z.releaseLock();return $}catch($){throw Z.releaseLock(),$}},async return(){let $=Z.cancel();return Z.releaseLock(),await $,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function v0(X){if(X===null||typeof X!=="object")return;if(X[Symbol.asyncIterator]){await X[Symbol.asyncIterator]().return?.();return}let Z=X.getReader(),$=Z.cancel();Z.releaseLock(),await $}var c0=({headers:X,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function d0(X){return Object.entries(X).filter(([Z,$])=>typeof $<"u").map(([Z,$])=>{if(typeof $==="string"||typeof $==="number"||typeof $==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent($)}`;if($===null)return`${encodeURIComponent(Z)}=`;throw new C(`Cannot stringify type ${typeof $}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function p0(X){let Z=0;for(let Y of X)Z+=Y.length;let $=new Uint8Array(Z),W=0;for(let Y of X)$.set(Y,W),W+=Y.length;return $}var m0;function fX(X){let Z;return(m0??(Z=new globalThis.TextEncoder,m0=Z.encode.bind(Z)))(X)}var u0;function aZ(X){let Z;return(u0??(Z=new globalThis.TextDecoder,u0=Z.decode.bind(Z)))(X)}var f,I;class n{constructor(){f.set(this,void 0),I.set(this,void 0),U(this,f,new Uint8Array,"f"),U(this,I,null,"f")}decode(X){if(X==null)return[];let Z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?fX(X):X;U(this,f,p0([z(this,f,"f"),Z]),"f");let $=[],W;while((W=i1(z(this,f,"f"),z(this,I,"f")))!=null){if(W.carriage&&z(this,I,"f")==null){U(this,I,W.index,"f");continue}if(z(this,I,"f")!=null&&(W.index!==z(this,I,"f")+1||W.carriage)){$.push(aZ(z(this,f,"f").subarray(0,z(this,I,"f")-1))),U(this,f,z(this,f,"f").subarray(z(this,I,"f")),"f"),U(this,I,null,"f");continue}let Y=z(this,I,"f")!==null?W.preceding-1:W.preceding,J=aZ(z(this,f,"f").subarray(0,Y));$.push(J),U(this,f,z(this,f,"f").subarray(W.index),"f"),U(this,I,null,"f")}return $}flush(){if(!z(this,f,"f").length)return[];return this.decode(`
2
+ import{vm as _1}from"./chunk-r6g1srb3.js";import{wm as P1,xm as f1}from"./chunk-gyaem1t4.js";import{Fm as D1}from"./chunk-mgytr7nc.js";import{Gm as B1}from"./chunk-rar0gk7s.js";import{Hm as j1,Im as S0}from"./chunk-7wvw67f3.js";import{Zm as T1,an as I1,bn as R1,cn as k1,dn as y1}from"./chunk-wxsq9zmf.js";import{en as c}from"./chunk-k20w9eaz.js";import{fn as S1}from"./chunk-7qzt5nhz.js";import{ln as j0}from"./chunk-116p639c.js";import{nn as A1}from"./chunk-q46rc697.js";import"./chunk-txkmks1h.js";function U(X,Z,$,W,Y){if(W==="m")throw TypeError("Private method is not writable");if(W==="a"&&!Y)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?X!==Z||!Y:!Z.has(X))throw TypeError("Cannot write private member to an object whose class did not declare it");return W==="a"?Y.call(X,$):Y?Y.value=$:Z.set(X,$),$}function z(X,Z,$,W){if($==="a"&&!W)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?X!==Z||!W:!Z.has(X))throw TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?W:$==="a"?W.call(X):W?W.value:Z.get(X)}var pZ=function(){let{crypto:X}=globalThis;if(X?.randomUUID)return pZ=X.randomUUID.bind(X),X.randomUUID();let Z=new Uint8Array(1),$=X?()=>X.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(W)=>(+W^$()&15>>+W/4).toString(16))};function d(X){return typeof X==="object"&&X!==null&&(("name"in X)&&X.name==="AbortError"||("message"in X)&&String(X.message).includes("FetchRequestCanceledException"))}var xX=(X)=>{if(X instanceof Error)return X;if(typeof X==="object"&&X!==null){try{if(Object.prototype.toString.call(X)==="[object Error]"){let Z=Error(X.message,X.cause?{cause:X.cause}:{});if(X.stack)Z.stack=X.stack;if(X.cause&&!Z.cause)Z.cause=X.cause;if(X.name)Z.name=X.name;return Z}}catch{}try{return Error(JSON.stringify(X))}catch{}}return Error(X)};class C extends Error{}class A extends C{constructor(X,Z,$,W,Y){super(`${A.makeMessage(X,Z,$)}`);this.status=X,this.headers=W,this.requestID=W?.get("request-id"),this.error=Z,this.type=Y??null}static makeMessage(X,Z,$){let W=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):$;if(X&&W)return`${X} ${W}`;if(X)return`${X} status code (no body)`;if(W)return W;return"(no status code or body)"}static generate(X,Z,$,W){if(!X||!W)return new s({message:$,cause:xX(Z)});let Y=Z,J=Y?.error?.type;if(X===400)return new FX(X,Y,$,W,J);if(X===401)return new LX(X,Y,$,W,J);if(X===403)return new AX(X,Y,$,W,J);if(X===404)return new jX(X,Y,$,W,J);if(X===409)return new SX(X,Y,$,W,J);if(X===422)return new BX(X,Y,$,W,J);if(X===429)return new DX(X,Y,$,W,J);if(X>=500)return new TX(X,Y,$,W,J);return new A(X,Y,$,W,J)}}class D extends A{constructor({message:X}={}){super(void 0,void 0,X||"Request was aborted.",void 0)}}class s extends A{constructor({message:X,cause:Z}){super(void 0,void 0,X||"Connection error.",void 0);if(Z)this.cause=Z}}class HX extends s{constructor({message:X}={}){super({message:X??"Request timed out."})}}class FX extends A{}class LX extends A{}class AX extends A{}class jX extends A{}class SX extends A{}class BX extends A{}class DX extends A{}class TX extends A{}var c1=/^[a-z][a-z0-9+.-]*:/i,P0=(X)=>{return c1.test(X)},lZ=(X)=>(lZ=Array.isArray,lZ(X)),iZ=lZ;function qZ(X){if(typeof X!=="object")return{};return X??{}}function nZ(X){if(!X)return!0;for(let Z in X)return!1;return!0}function f0(X,Z){return Object.prototype.hasOwnProperty.call(X,Z)}var I0=(X,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new C(`${X} must be an integer`);if(Z<0)throw new C(`${X} must be a positive integer`);return Z};var CZ=(X)=>{try{return JSON.parse(X)}catch(Z){return}};var R0=(X)=>new Promise((Z)=>setTimeout(Z,X));var i="0.91.1";var h0=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function d1(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var m1=()=>{let X=d1();if(X==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(Deno.build.os),"X-Stainless-Arch":k0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(X==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(globalThis.process.platform??"unknown"),"X-Stainless-Arch":k0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=u1();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function u1(){if(typeof navigator>"u"||!navigator)return null;let X=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:$}of X){let W=$.exec(navigator.userAgent);if(W){let Y=W[1]||0,J=W[2]||0,Q=W[3]||0;return{browser:Z,version:`${Y}.${J}.${Q}`}}}return null}var k0=(X)=>{if(X==="x32")return"x32";if(X==="x86_64"||X==="x64")return"x64";if(X==="arm")return"arm";if(X==="aarch64"||X==="arm64")return"arm64";if(X)return`other:${X}`;return"unknown"},y0=(X)=>{if(X=X.toLowerCase(),X.includes("ios"))return"iOS";if(X==="android")return"Android";if(X==="darwin")return"MacOS";if(X==="win32")return"Windows";if(X==="freebsd")return"FreeBSD";if(X==="openbsd")return"OpenBSD";if(X==="linux")return"Linux";if(X)return`Other:${X}`;return"Unknown"},_0,g0=()=>{return _0??(_0=m1())};function b0(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function rZ(...X){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...X)}function OZ(X){let Z=Symbol.asyncIterator in X?X[Symbol.asyncIterator]():X[Symbol.iterator]();return rZ({start(){},async pull($){let{done:W,value:Y}=await Z.next();if(W)$.close();else $.enqueue(Y)},async cancel(){await Z.return?.()}})}function PX(X){if(X[Symbol.asyncIterator])return X;let Z=X.getReader();return{async next(){try{let $=await Z.read();if($?.done)Z.releaseLock();return $}catch($){throw Z.releaseLock(),$}},async return(){let $=Z.cancel();return Z.releaseLock(),await $,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function v0(X){if(X===null||typeof X!=="object")return;if(X[Symbol.asyncIterator]){await X[Symbol.asyncIterator]().return?.();return}let Z=X.getReader(),$=Z.cancel();Z.releaseLock(),await $}var c0=({headers:X,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function d0(X){return Object.entries(X).filter(([Z,$])=>typeof $<"u").map(([Z,$])=>{if(typeof $==="string"||typeof $==="number"||typeof $==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent($)}`;if($===null)return`${encodeURIComponent(Z)}=`;throw new C(`Cannot stringify type ${typeof $}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function p0(X){let Z=0;for(let Y of X)Z+=Y.length;let $=new Uint8Array(Z),W=0;for(let Y of X)$.set(Y,W),W+=Y.length;return $}var m0;function fX(X){let Z;return(m0??(Z=new globalThis.TextEncoder,m0=Z.encode.bind(Z)))(X)}var u0;function aZ(X){let Z;return(u0??(Z=new globalThis.TextDecoder,u0=Z.decode.bind(Z)))(X)}var f,I;class n{constructor(){f.set(this,void 0),I.set(this,void 0),U(this,f,new Uint8Array,"f"),U(this,I,null,"f")}decode(X){if(X==null)return[];let Z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?fX(X):X;U(this,f,p0([z(this,f,"f"),Z]),"f");let $=[],W;while((W=i1(z(this,f,"f"),z(this,I,"f")))!=null){if(W.carriage&&z(this,I,"f")==null){U(this,I,W.index,"f");continue}if(z(this,I,"f")!=null&&(W.index!==z(this,I,"f")+1||W.carriage)){$.push(aZ(z(this,f,"f").subarray(0,z(this,I,"f")-1))),U(this,f,z(this,f,"f").subarray(z(this,I,"f")),"f"),U(this,I,null,"f");continue}let Y=z(this,I,"f")!==null?W.preceding-1:W.preceding,J=aZ(z(this,f,"f").subarray(0,Y));$.push(J),U(this,f,z(this,f,"f").subarray(W.index),"f"),U(this,I,null,"f")}return $}flush(){if(!z(this,f,"f").length)return[];return this.decode(`
3
3
  `)}}f=new WeakMap,I=new WeakMap;n.NEWLINE_CHARS=new Set([`
4
4
  `,"\r"]);n.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function i1(X,Z){for(let Y=Z??0;Y<X.length;Y++){if(X[Y]===10)return{preceding:Y,index:Y+1,carriage:!1};if(X[Y]===13)return{preceding:Y,index:Y+1,carriage:!0}}return null}function l0(X){for(let W=0;W<X.length-1;W++){if(X[W]===10&&X[W+1]===10)return W+2;if(X[W]===13&&X[W+1]===13)return W+2;if(X[W]===13&&X[W+1]===10&&W+3<X.length&&X[W+2]===13&&X[W+3]===10)return W+4}return-1}var MZ={off:0,error:200,warn:300,info:400,debug:500},oZ=(X,Z,$)=>{if(!X)return;if(f0(MZ,X))return X;S($).warn(`${Z} was set to ${JSON.stringify(X)}, expected one of ${JSON.stringify(Object.keys(MZ))}`);return};function IX(){}function EZ(X,Z,$){if(!Z||MZ[X]>MZ[$])return IX;else return Z[X].bind(Z)}var n1={error:IX,warn:IX,info:IX,debug:IX},i0=new WeakMap;function S(X){let Z=X.logger,$=X.logLevel??"off";if(!Z)return n1;let W=i0.get(Z);if(W&&W[0]===$)return W[1];let Y={error:EZ("error",Z,$),warn:EZ("warn",Z,$),info:EZ("info",Z,$),debug:EZ("debug",Z,$)};return i0.set(Z,[$,Y]),Y}var m=(X)=>{if(X.options)X.options={...X.options},delete X.options.headers;if(X.headers)X.headers=Object.fromEntries((X.headers instanceof Headers?[...X.headers]:Object.entries(X.headers)).map(([Z,$])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":$]));if("retryOfRequestLogID"in X){if(X.retryOfRequestLogID)X.retryOf=X.retryOfRequestLogID;delete X.retryOfRequestLogID}return X};var RX;class R{constructor(X,Z,$){this.iterator=X,RX.set(this,void 0),this.controller=Z,U(this,RX,$,"f")}static fromSSEResponse(X,Z,$){let W=!1,Y=$?S($):console;async function*J(){if(W)throw new C("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");W=!0;let Q=!1;try{for await(let w of r1(X,Z)){if(w.event==="completion")try{yield JSON.parse(w.data)}catch(G){throw Y.error("Could not parse message into JSON:",w.data),Y.error("From chunk:",w.raw),G}if(w.event==="message_start"||w.event==="message_delta"||w.event==="message_stop"||w.event==="content_block_start"||w.event==="content_block_delta"||w.event==="content_block_stop"||w.event==="message"||w.event==="user.message"||w.event==="user.interrupt"||w.event==="user.tool_confirmation"||w.event==="user.custom_tool_result"||w.event==="agent.message"||w.event==="agent.thinking"||w.event==="agent.tool_use"||w.event==="agent.tool_result"||w.event==="agent.mcp_tool_use"||w.event==="agent.mcp_tool_result"||w.event==="agent.custom_tool_use"||w.event==="agent.thread_context_compacted"||w.event==="session.status_running"||w.event==="session.status_idle"||w.event==="session.status_rescheduled"||w.event==="session.status_terminated"||w.event==="session.error"||w.event==="session.deleted"||w.event==="span.model_request_start"||w.event==="span.model_request_end")try{yield JSON.parse(w.data)}catch(G){throw Y.error("Could not parse message into JSON:",w.data),Y.error("From chunk:",w.raw),G}if(w.event==="ping")continue;if(w.event==="error"){let G=CZ(w.data)??w.data,M=G?.error?.type;throw new A(void 0,G,void 0,X.headers,M)}}Q=!0}catch(w){if(d(w))return;throw w}finally{if(!Q)Z.abort()}}return new R(J,Z,$)}static fromReadableStream(X,Z,$){let W=!1;async function*Y(){let Q=new n,w=PX(X);for await(let G of w)for(let M of Q.decode(G))yield M;for(let G of Q.flush())yield G}async function*J(){if(W)throw new C("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");W=!0;let Q=!1;try{for await(let w of Y()){if(Q)continue;if(w)yield JSON.parse(w)}Q=!0}catch(w){if(d(w))return;throw w}finally{if(!Q)Z.abort()}}return new R(J,Z,$)}[(RX=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let X=[],Z=[],$=this.iterator(),W=(Y)=>{return{next:()=>{if(Y.length===0){let J=$.next();X.push(J),Z.push(J)}return Y.shift()}}};return[new R(()=>W(X),this.controller,z(this,RX,"f")),new R(()=>W(Z),this.controller,z(this,RX,"f"))]}toReadableStream(){let X=this,Z;return rZ({async start(){Z=X[Symbol.asyncIterator]()},async pull($){try{let{value:W,done:Y}=await Z.next();if(Y)return $.close();let J=fX(JSON.stringify(W)+`
5
5
  `);$.enqueue(J)}catch(W){$.error(W)}},async cancel(){await Z.return?.()}})}}async function*r1(X,Z){if(!X.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new C("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new C("Attempted to iterate over a response with no body")}let $=new n0,W=new n,Y=PX(X.body);for await(let J of a1(Y))for(let Q of W.decode(J)){let w=$.decode(Q);if(w)yield w}for(let J of W.flush()){let Q=$.decode(J);if(Q)yield Q}}async function*a1(X){let Z=new Uint8Array;for await(let $ of X){if($==null)continue;let W=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?fX($):$,Y=new Uint8Array(Z.length+W.length);Y.set(Z),Y.set(W,Z.length),Z=Y;let J;while((J=l0(Z))!==-1)yield Z.slice(0,J),Z=Z.slice(J)}if(Z.length>0)yield Z}class n0{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(X){if(X.endsWith("\r"))X=X.substring(0,X.length-1);if(!X){if(!this.event&&!this.data.length)return null;let Y={event:this.event,data:this.data.join(`
@@ -1 +1 @@
1
- import{Be as R,Ce as F,De as z,Ee as A}from"./chunk-knh1stxe.js";import"./chunk-y0k1f3gk.js";import{ih as m}from"./chunk-dwkv3bx5.js";import{Ii as g}from"./chunk-8zar6cc4.js";import{$l as r,Ak as w,Ji as T,Ki as p,Li as e,Mi as t,Ri as k,Ti as i,Wi as y,Yl as d,am as h,cj as P,dj as S,kj as x,qk as L,wj as f}from"./chunk-48yphy68.js";import{Zm as E}from"./chunk-69at8jm8.js";var s=E(T(),1);var I=m.object({password:m.string().min(3,r.password_min_length()),confirmPassword:m.string().min(3,r.password_min_length())}).refine((a)=>a.password===a.confirmPassword,{message:r.passwords_do_not_match(),path:["confirmPassword"]}),K=y("/reset-password")({component:V});function V(){let a=k(),n=K.useSearch().token||"",[v,l]=s.useState(null),[b,N]=s.useState(!1),[c,B]=s.useState(!1),o=z({resolver:A(I),defaultValues:{password:"",confirmPassword:""}});s.useEffect(()=>{if(c){let u=setTimeout(()=>{a({to:"/login"})},3000);return()=>clearTimeout(u)}},[c,a]);let C=async(u)=>{if(!n){l(r.invalid_reset_token());return}N(!0),l(null);let{error:_}=await R({newPassword:u.password,token:n});if(N(!1),_){l(_.message||r.invalid_reset_token());return}B(!0)};return t(F,{children:[t("div",{className:"mb-8",children:[e("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:r.reset_password()}),e("p",{className:"text-muted-foreground text-sm mt-1",children:r.reset_password_subtitle()})]}),!n?t("div",{className:"space-y-6",children:[t("div",{className:"p-4 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm flex items-start gap-3",children:[e(P,{className:"w-5 h-5 shrink-0 mt-0.5"}),t("div",{className:"space-y-1",children:[e("p",{className:"font-semibold",children:r.invalid_reset_token()}),e("p",{className:"text-xs text-muted-foreground",children:r.invalid_reset_token_description()})]})]}),e(i,{to:"/login",className:"block w-full",children:t(d,{variant:"outline",className:"w-full h-11 rounded-xl flex items-center justify-center gap-2",children:[r.go_to_login(),e(f,{className:"w-4 h-4"})]})})]}):c?t("div",{className:"space-y-6",children:[t("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 rounded-xl text-sm flex items-start gap-3",children:[e(S,{className:"w-5 h-5 shrink-0 mt-0.5"}),t("div",{className:"space-y-1",children:[e("p",{className:"font-semibold",children:r.password_reset_success()}),e("p",{className:"text-xs text-muted-foreground",children:r.password_reset_success_description()})]})]}),e(i,{to:"/login",className:"block w-full",children:t(d,{className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",children:[r.go_to_login(),e(f,{className:"w-4 h-4"})]})})]}):t("form",{onSubmit:o.handleSubmit(C),className:"space-y-5",children:[v&&e("div",{className:"p-3 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm text-center font-medium",children:v}),t("div",{className:"space-y-2",children:[e(g,{htmlFor:"password",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:r.new_password()}),t("div",{className:"relative group",children:[e(w,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),e(h,{id:"password",type:"password",...o.register("password"),placeholder:r.new_password_placeholder(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),o.formState.errors.password&&e("p",{className:"text-destructive text-xs font-medium",children:o.formState.errors.password.message})]}),t("div",{className:"space-y-2",children:[e(g,{htmlFor:"confirmPassword",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:r.confirm_password()}),t("div",{className:"relative group",children:[e(w,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),e(h,{id:"confirmPassword",type:"password",...o.register("confirmPassword"),placeholder:r.confirm_password_placeholder(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),o.formState.errors.confirmPassword&&e("p",{className:"text-destructive text-xs font-medium",children:o.formState.errors.confirmPassword.message})]}),e(d,{type:"submit",className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",disabled:b,children:b?t(p,{children:[e(x,{className:"h-4 w-4 animate-spin"}),r.resetting_password()]}):t(p,{children:[e(L,{className:"w-4 h-4"}),r.reset_password()]})}),e("div",{className:"pt-2 text-center text-sm",children:e(i,{to:"/login",className:"font-semibold text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300 transition-colors hover:underline inline-flex items-center gap-1",children:r.go_to_login()})})]})]})}export{K as Route};
1
+ import{He as R,Ie as F,Je as z,Ke as A}from"./chunk-j9q9rjvd.js";import"./chunk-90tbc5f4.js";import{Ah as m}from"./chunk-bkbqvxfv.js";import{_i as g}from"./chunk-axb1f1ae.js";import{$i as T,Dj as x,Jk as L,Pj as f,Tk as w,aj as p,bj as e,cj as t,hj as k,jj as i,mj as y,qm as d,tm as r,uj as P,um as h,vj as S}from"./chunk-w9p59ahz.js";import{rn as E}from"./chunk-txkmks1h.js";var s=E(T(),1);var I=m.object({password:m.string().min(3,r.password_min_length()),confirmPassword:m.string().min(3,r.password_min_length())}).refine((a)=>a.password===a.confirmPassword,{message:r.passwords_do_not_match(),path:["confirmPassword"]}),K=y("/reset-password")({component:V});function V(){let a=k(),n=K.useSearch().token||"",[v,l]=s.useState(null),[b,N]=s.useState(!1),[c,B]=s.useState(!1),o=z({resolver:A(I),defaultValues:{password:"",confirmPassword:""}});s.useEffect(()=>{if(c){let u=setTimeout(()=>{a({to:"/login"})},3000);return()=>clearTimeout(u)}},[c,a]);let C=async(u)=>{if(!n){l(r.invalid_reset_token());return}N(!0),l(null);let{error:_}=await R({newPassword:u.password,token:n});if(N(!1),_){l(_.message||r.invalid_reset_token());return}B(!0)};return t(F,{children:[t("div",{className:"mb-8",children:[e("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:r.reset_password()}),e("p",{className:"text-muted-foreground text-sm mt-1",children:r.reset_password_subtitle()})]}),!n?t("div",{className:"space-y-6",children:[t("div",{className:"p-4 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm flex items-start gap-3",children:[e(P,{className:"w-5 h-5 shrink-0 mt-0.5"}),t("div",{className:"space-y-1",children:[e("p",{className:"font-semibold",children:r.invalid_reset_token()}),e("p",{className:"text-xs text-muted-foreground",children:r.invalid_reset_token_description()})]})]}),e(i,{to:"/login",className:"block w-full",children:t(d,{variant:"outline",className:"w-full h-11 rounded-xl flex items-center justify-center gap-2",children:[r.go_to_login(),e(f,{className:"w-4 h-4"})]})})]}):c?t("div",{className:"space-y-6",children:[t("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 rounded-xl text-sm flex items-start gap-3",children:[e(S,{className:"w-5 h-5 shrink-0 mt-0.5"}),t("div",{className:"space-y-1",children:[e("p",{className:"font-semibold",children:r.password_reset_success()}),e("p",{className:"text-xs text-muted-foreground",children:r.password_reset_success_description()})]})]}),e(i,{to:"/login",className:"block w-full",children:t(d,{className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",children:[r.go_to_login(),e(f,{className:"w-4 h-4"})]})})]}):t("form",{onSubmit:o.handleSubmit(C),className:"space-y-5",children:[v&&e("div",{className:"p-3 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm text-center font-medium",children:v}),t("div",{className:"space-y-2",children:[e(g,{htmlFor:"password",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:r.new_password()}),t("div",{className:"relative group",children:[e(w,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),e(h,{id:"password",type:"password",...o.register("password"),placeholder:r.new_password_placeholder(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),o.formState.errors.password&&e("p",{className:"text-destructive text-xs font-medium",children:o.formState.errors.password.message})]}),t("div",{className:"space-y-2",children:[e(g,{htmlFor:"confirmPassword",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:r.confirm_password()}),t("div",{className:"relative group",children:[e(w,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),e(h,{id:"confirmPassword",type:"password",...o.register("confirmPassword"),placeholder:r.confirm_password_placeholder(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),o.formState.errors.confirmPassword&&e("p",{className:"text-destructive text-xs font-medium",children:o.formState.errors.confirmPassword.message})]}),e(d,{type:"submit",className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",disabled:b,children:b?t(p,{children:[e(x,{className:"h-4 w-4 animate-spin"}),r.resetting_password()]}):t(p,{children:[e(L,{className:"w-4 h-4"}),r.reset_password()]})}),e("div",{className:"pt-2 text-center text-sm",children:e(i,{to:"/login",className:"font-semibold text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300 transition-colors hover:underline inline-flex items-center gap-1",children:r.go_to_login()})})]})]})}export{K as Route};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Na as a}from"./chunk-pg00gkr4.js";import"./chunk-txkmks1h.js";export default a();
@@ -1,2 +1,2 @@
1
- import{Li as i,Mi as r,Vl as o,Wl as a}from"./chunk-48yphy68.js";function m({delayDuration:t=0,...e}){return i(o.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function f({...t}){return i(o.Root,{"data-slot":"tooltip",...t})}function s({...t}){return i(o.Trigger,{"data-slot":"tooltip-trigger",...t})}function c({className:t,sideOffset:e=0,children:n,...d}){return i(o.Portal,{children:r(o.Content,{"data-slot":"tooltip-content",sideOffset:e,className:a("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",t),...d,children:[n,i(o.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}
2
- export{m as jh,f as kh,s as lh,c as mh};
1
+ import{Wl as a,bj as i,cj as r,om as o}from"./chunk-w9p59ahz.js";function m({delayDuration:t=0,...e}){return i(o.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function f({...t}){return i(o.Root,{"data-slot":"tooltip",...t})}function s({...t}){return i(o.Trigger,{"data-slot":"tooltip-trigger",...t})}function c({className:t,sideOffset:e=0,children:n,...d}){return i(o.Portal,{children:r(o.Content,{"data-slot":"tooltip-content",sideOffset:e,className:a("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",t),...d,children:[n,i(o.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}
2
+ export{m as Bh,f as Ch,s as Dh,c as Eh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=(a,b)=>()=>(a&&(b=a(a=0)),b);var w=(a)=>JSON.parse(a);var x=import.meta.require;
3
- export{s as Zm,t as _m,u as $m,v as an,w as bn,x as cn};
3
+ export{s as rn,t as sn,u as tn,v as un,w as vn,x as wn};