@intent-hq/web 2.376.0 → 2.376.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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{reP1x2hx.js → -bihBnD_.js} +1 -1
  3. package/web/app/immutable/chunks/{CxfmOiQr.js → 2tp4E25F.js} +1 -1
  4. package/web/app/immutable/chunks/{qu0QpfUw.js → 6GF_gyTS.js} +1 -1
  5. package/web/app/immutable/chunks/{Wg-KBN6b.js → 6HwVA3Xi.js} +13 -13
  6. package/web/app/immutable/chunks/{B7o1DJo9.js → 6NqQpMgA.js} +1 -1
  7. package/web/app/immutable/chunks/{CtawaW2N.js → 8UE1B61A.js} +1 -1
  8. package/web/app/immutable/chunks/{BgttkbLb.js → B5n1Er-h.js} +1 -1
  9. package/web/app/immutable/chunks/{D7VeTrYO.js → B6ZbCtHN.js} +1 -1
  10. package/web/app/immutable/chunks/{D283eGmG.js → B77YOXDU.js} +1 -1
  11. package/web/app/immutable/chunks/{DTzE7g9m.js → B85xL2lt.js} +1 -1
  12. package/web/app/immutable/chunks/{BgxLwwHQ.js → BEbBWmo4.js} +1 -1
  13. package/web/app/immutable/chunks/{zaxjdjiF.js → BEv4fIdD.js} +1 -1
  14. package/web/app/immutable/chunks/{-SrZYziV.js → BFT4wQs3.js} +1 -1
  15. package/web/app/immutable/chunks/{6529TVsv.js → BGql-rAX.js} +1 -1
  16. package/web/app/immutable/chunks/{DyFc4NAd.js → BHsQzwHt.js} +1 -1
  17. package/web/app/immutable/chunks/{BQ5vM4FB.js → BOZ6hjJI.js} +2 -2
  18. package/web/app/immutable/chunks/{BrRuqfTp.js → BPqKxoH8.js} +1 -1
  19. package/web/app/immutable/chunks/{C2VSMRVU.js → BSyKFBWd.js} +1 -1
  20. package/web/app/immutable/chunks/{LqBZITyo.js → BWIYTJ4a.js} +3 -3
  21. package/web/app/immutable/chunks/{D4XPYll-.js → BWyPNph7.js} +2 -2
  22. package/web/app/immutable/chunks/{PqstdoKv.js → BaO0hXxI.js} +1 -1
  23. package/web/app/immutable/chunks/{DtO0wAdA.js → BcliNPZw.js} +2 -2
  24. package/web/app/immutable/chunks/{DBI3WymG.js → BdBn1UvT.js} +1 -1
  25. package/web/app/immutable/chunks/{CjCvg4fu.js → BdNdGDSe.js} +1 -1
  26. package/web/app/immutable/chunks/{Bcx8Sxo7.js → BdaN2XXm.js} +1 -1
  27. package/web/app/immutable/chunks/{BvhuCBEE.js → Bdn-RKqv.js} +2 -2
  28. package/web/app/immutable/chunks/{CRWeEeIp.js → BePTHsT0.js} +1 -1
  29. package/web/app/immutable/chunks/{DMdq0QC2.js → BjRLyMd2.js} +1 -1
  30. package/web/app/immutable/chunks/{BoT5B49_.js → BkcFLgQ7.js} +1 -1
  31. package/web/app/immutable/chunks/{DxrRvklK.js → BkmrZjpE.js} +1 -1
  32. package/web/app/immutable/chunks/{5IrgxRfr.js → BntFPxwt.js} +1 -1
  33. package/web/app/immutable/chunks/{BLSHNn4a.js → BoLBqPln.js} +1 -1
  34. package/web/app/immutable/chunks/{DkY0xIi7.js → BpimY2Bn.js} +2 -2
  35. package/web/app/immutable/chunks/{XmeiGQiO.js → Bs1CY0TU.js} +1 -1
  36. package/web/app/immutable/chunks/{B-lpv6Gv.js → Bt2C0fwl.js} +2 -2
  37. package/web/app/immutable/chunks/{BmNAS5xc.js → BuXc_maR.js} +1 -1
  38. package/web/app/immutable/chunks/{CqlSBroo.js → BzwPeFzF.js} +1 -1
  39. package/web/app/immutable/chunks/{Y4Eu_VSz.js → C22LcJ65.js} +3 -3
  40. package/web/app/immutable/chunks/{D_fLfdMn.js → C3beNZjc.js} +1 -1
  41. package/web/app/immutable/chunks/{BxlVsP3O.js → C4cfJuJM.js} +1 -1
  42. package/web/app/immutable/chunks/{BGMy2Ryn.js → C9x6kmJK.js} +1 -1
  43. package/web/app/immutable/chunks/{Cfy5Crpr.js → CCWqLSpV.js} +1 -1
  44. package/web/app/immutable/chunks/{BXB-ioXM.js → CGx1Vpie.js} +1 -1
  45. package/web/app/immutable/chunks/{BaEFcPEE.js → CJBG3N9y.js} +3 -3
  46. package/web/app/immutable/chunks/{Bwl-WDiM.js → CJfYXtXQ.js} +1 -1
  47. package/web/app/immutable/chunks/{Bu8LYT1B.js → CKGNYRrS.js} +2 -2
  48. package/web/app/immutable/chunks/{D1FftGj7.js → CKKDDlBT.js} +1 -1
  49. package/web/app/immutable/chunks/{CJh_F--P.js → CLG1DPRT.js} +1 -1
  50. package/web/app/immutable/chunks/{jsYE2rXv.js → CMn7jvlN.js} +1 -1
  51. package/web/app/immutable/chunks/{NzPgPyYa.js → COK2QQN9.js} +1 -1
  52. package/web/app/immutable/chunks/{C4MiITEz.js → COZ3dQ_A.js} +1 -1
  53. package/web/app/immutable/chunks/{7IpY0EgW.js → CQx3pm4t.js} +1 -1
  54. package/web/app/immutable/chunks/{tw85acZN.js → CW7lfTzm.js} +1 -1
  55. package/web/app/immutable/chunks/{TSQNyjhg.js → CX4bqTrJ.js} +1 -1
  56. package/web/app/immutable/chunks/{p0fS0rJD.js → CXfim-2t.js} +1 -1
  57. package/web/app/immutable/chunks/{Dy7nbUgl.js → CXgy6Mbb.js} +1 -1
  58. package/web/app/immutable/chunks/{CwQIGTQ1.js → CZw2t1gL.js} +1 -1
  59. package/web/app/immutable/chunks/{CHHUtp07.js → C_0xgdqY.js} +1 -1
  60. package/web/app/immutable/chunks/{Csv5_672.js → Cihg5T05.js} +1 -1
  61. package/web/app/immutable/chunks/{kPyUfani.js → CihneiLA.js} +1 -1
  62. package/web/app/immutable/chunks/{QSHJFaU7.js → CpIVKWwx.js} +4 -4
  63. package/web/app/immutable/chunks/{C71BdIUW.js → CqM0ozU7.js} +1 -1
  64. package/web/app/immutable/chunks/{D3GrssRa.js → CrNPV-Vp.js} +1 -1
  65. package/web/app/immutable/chunks/{DXf8KXiZ.js → CrgJwS7n.js} +1 -1
  66. package/web/app/immutable/chunks/{CX9_bRjk.js → Cs85XoQa.js} +1 -1
  67. package/web/app/immutable/chunks/{Bs1drFy2.js → CtECFAby.js} +1 -1
  68. package/web/app/immutable/chunks/{DwhE2_yv.js → Cvp_IOBl.js} +1 -1
  69. package/web/app/immutable/chunks/{DjLLAN4K.js → Cw3skelK.js} +1 -1
  70. package/web/app/immutable/chunks/{DTpQzThG.js → CwBMToxu.js} +1 -1
  71. package/web/app/immutable/chunks/{C54d-qnB.js → D1DNtybi.js} +1 -1
  72. package/web/app/immutable/chunks/{DgaQFJ1C.js → D2eaIIb4.js} +1 -1
  73. package/web/app/immutable/chunks/{DopSRBlm.js → D4gtBVLN.js} +1 -1
  74. package/web/app/immutable/chunks/{B9nat7hx.js → D4lP_X71.js} +1 -1
  75. package/web/app/immutable/chunks/{DjpjFygj.js → D5bd-ecJ.js} +1 -1
  76. package/web/app/immutable/chunks/{CDeldaOF.js → D5raGlU7.js} +2 -2
  77. package/web/app/immutable/chunks/{Ba4cYgvZ.js → D6W9Whdp.js} +3 -3
  78. package/web/app/immutable/chunks/{CSp6HTdW.js → D7u67tV0.js} +2 -2
  79. package/web/app/immutable/chunks/{BvKzoZLa.js → D8XqXEXt.js} +1 -1
  80. package/web/app/immutable/chunks/{B4ot6F6B.js → DCibR4Jk.js} +1 -1
  81. package/web/app/immutable/chunks/{DgV330Oe.js → DDFAsI-l.js} +1 -1
  82. package/web/app/immutable/chunks/{BLYYB2Pl.js → DIDOx8hd.js} +1 -1
  83. package/web/app/immutable/chunks/{Cbu0O7F_.js → DKHSbBis.js} +1 -1
  84. package/web/app/immutable/chunks/{BOLzaoLg.js → DOEOrBL9.js} +1 -1
  85. package/web/app/immutable/chunks/{hCk1hXVJ.js → DOMMuuHJ.js} +1 -1
  86. package/web/app/immutable/chunks/{zK-Wn6qa.js → DQGdnFBd.js} +1 -1
  87. package/web/app/immutable/chunks/{CHzHsjlJ.js → DY-U3TFa.js} +1 -1
  88. package/web/app/immutable/chunks/{9IHp8VDb.js → DZEGFjPx.js} +1 -1
  89. package/web/app/immutable/chunks/{Blp2y8Zh.js → DdJ4cD_u.js} +1 -1
  90. package/web/app/immutable/chunks/{wqzy1XTy.js → DeDQhZv5.js} +1 -1
  91. package/web/app/immutable/chunks/{CeWlRIsm.js → Deoe5X7L.js} +1 -1
  92. package/web/app/immutable/chunks/{5II1c2xL.js → DhW_HWBK.js} +1 -1
  93. package/web/app/immutable/chunks/{BoEPe-FL.js → DiP5BH15.js} +1 -1
  94. package/web/app/immutable/chunks/{bzfuMuVY.js → DmnStjtN.js} +1 -1
  95. package/web/app/immutable/chunks/{BVunuTwn.js → Dn7Cyi1s.js} +1 -1
  96. package/web/app/immutable/chunks/{i_Orzl3O.js → Domj4ONg.js} +2 -2
  97. package/web/app/immutable/chunks/{DnUdAfCR.js → DtEw_Okh.js} +1 -1
  98. package/web/app/immutable/chunks/{D-7b6BAb.js → DzsC5hAQ.js} +1 -1
  99. package/web/app/immutable/chunks/{BYeDxl_R.js → EmfdzzTF.js} +1 -1
  100. package/web/app/immutable/chunks/{C09ifoAC.js → IB26d-_M.js} +4 -4
  101. package/web/app/immutable/chunks/{Dec_LXa-.js → K0CA4l_-.js} +3 -3
  102. package/web/app/immutable/chunks/{DLMaiw5B.js → KS10KUQ4.js} +1 -1
  103. package/web/app/immutable/chunks/{0vLUv3ld.js → KaHKnBKn.js} +1 -1
  104. package/web/app/immutable/chunks/{CB9DABC0.js → L0PmMCK6.js} +1 -1
  105. package/web/app/immutable/chunks/{PD1TeEVF.js → NEcXJ8Qo.js} +1 -1
  106. package/web/app/immutable/chunks/{G4lPpFfF.js → P27dN3C7.js} +1 -1
  107. package/web/app/immutable/chunks/{Ro7n3ECj.js → RyWl3sPF.js} +1 -1
  108. package/web/app/immutable/chunks/{DfXFG9So.js → UaQjBP_O.js} +1 -1
  109. package/web/app/immutable/chunks/{DM81x_EL.js → Ydj2ePK_.js} +1 -1
  110. package/web/app/immutable/chunks/{z1Wv0MVw.js → YopO0YfH.js} +5 -5
  111. package/web/app/immutable/chunks/{7FS8g33K.js → ZWIGjqdM.js} +3 -3
  112. package/web/app/immutable/chunks/{DQlLBrpj.js → bcfKuKQn.js} +1 -1
  113. package/web/app/immutable/chunks/{i0zaZVKI.js → ebxZ5PPm.js} +1 -1
  114. package/web/app/immutable/chunks/{C3FNiYoh.js → iNDSBgu7.js} +1 -1
  115. package/web/app/immutable/chunks/{1_Sb4Kkv.js → kZL4nf_J.js} +4 -4
  116. package/web/app/immutable/chunks/{NUgfgzzR.js → my69Ox9w.js} +1 -1
  117. package/web/app/immutable/chunks/{BH4muXHE.js → pIjvEfMB.js} +3 -3
  118. package/web/app/immutable/chunks/{BtgBrLqZ.js → qg2KHuAY.js} +1 -1
  119. package/web/app/immutable/chunks/{CPCza4LC.js → qyBT4DY2.js} +1 -1
  120. package/web/app/immutable/chunks/{BkLeC-gf.js → rCkv5VsR.js} +1 -1
  121. package/web/app/immutable/chunks/{Aa4mTk2-.js → rHK6sLv4.js} +1 -1
  122. package/web/app/immutable/chunks/{j9buSIht.js → sEj9k2KM.js} +1 -1
  123. package/web/app/immutable/chunks/{CkmjUBxn.js → sZBOVpM6.js} +1 -1
  124. package/web/app/immutable/chunks/{CJpjySL_.js → tGL9OSFf.js} +1 -1
  125. package/web/app/immutable/chunks/{9Fwj-RCt.js → ucKP4cAm.js} +3 -3
  126. package/web/app/immutable/chunks/{COhzmnEo.js → x8bssjcx.js} +1 -1
  127. package/web/app/immutable/chunks/{Dwb4ijU4.js → xFC1lhKl.js} +1 -1
  128. package/web/app/immutable/chunks/{DXQ7EI2S.js → xIoxAtek.js} +1 -1
  129. package/web/app/immutable/entry/{app.CVv4zmJ_.js → app.YY31OTuo.js} +2 -2
  130. package/web/app/immutable/entry/start.DBl7cnaM.js +1 -0
  131. package/web/app/immutable/nodes/{0.Cb_UZQTB.js → 0.I2U7Nyeq.js} +1 -1
  132. package/web/app/immutable/nodes/{1.B0kBQ96l.js → 1.CgZVKAf9.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CGIePvim.js → 10.CsryZO2H.js} +4 -4
  134. package/web/app/immutable/nodes/{11.DcWpM7Yi.js → 11.BTowiakT.js} +1 -1
  135. package/web/app/immutable/nodes/{15.DDtIC3Hq.js → 15.CzU59iiE.js} +1 -1
  136. package/web/app/immutable/nodes/{19.B1-CCqHR.js → 19.vtvcgUzO.js} +2 -2
  137. package/web/app/immutable/nodes/{2.CAFqSYBH.js → 2.xEZtPl1l.js} +4 -4
  138. package/web/app/immutable/nodes/{3.CNcHr_kX.js → 3.hyVEcKKo.js} +1 -1
  139. package/web/app/immutable/nodes/{4.BzoidTar.js → 4.CdWgO8Xv.js} +1 -1
  140. package/web/app/immutable/nodes/{5.vAApKfTG.js → 5.BhLUauX8.js} +1 -1
  141. package/web/app/immutable/nodes/{6.D2VrWob4.js → 6.B3Vi01S1.js} +1 -1
  142. package/web/app/immutable/nodes/{7.cIi2v_en.js → 7.DW7p588B.js} +1 -1
  143. package/web/app/immutable/nodes/{8.DVH30a1F.js → 8.Bt8gdMyu.js} +1 -1
  144. package/web/app/immutable/nodes/{9.AUZxhWIX.js → 9.BSZ1-MKZ.js} +4 -4
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.CiYvv3YQ.js +0 -1
@@ -1,4 +1,4 @@
1
- var N_=Object.defineProperty;var Fg=n=>{throw TypeError(n)};var B_=(n,r,a)=>r in n?N_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>B_(n,typeof r!="symbol"?r+"":r,a),W_=(n,r,a)=>r.has(n)||Fg("Cannot "+a);var Ro=(n,r,a)=>(W_(n,r,"read from private field"),a?a.call(n):r.get(n)),Dg=(n,r,a)=>r.has(n)?Fg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as ln,bo as Z,bw as dn,bp as cf,b as cn,bm as g,bq as Ur,bs as pe,br as qi}from"./1KDVFF23.js";import{bs as un,a5 as S,bf as fs,bA as y,W as p,bn as gn,aA as ee,aB as E,ca as ie,a7 as Ot,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as vn,b_ as q,bO as j,c5 as dt,bH as w,bV as he,bj as Es,bk as no,b$ as on,ai as Bc,aj as ps,bo as jl,br as Mr,c0 as qt,cb as sc,aw as wi,a as U_}from"./3SdAC2_C.js";import{i as N}from"./Zg9SWWIQ.js";import{k as xi}from"./Dhj-Oo-y.js";import{g as Dn,i as z_,I as qo,p as Lo,e as Mo}from"./CYCawVEx.js";import{n as Lt,l as ma,c as eo,j as Ng,k as Fo,h as j_}from"./CjK2zm52.js";import{b as uf,e as Wc,f as ke,s as Ne,c as Wt,g as gs}from"./D8B7qxXm.js";import{b as G_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as V_,U as K_,Z as Q_,X as J_,Y as Y_,I as Bg,o as X_,l as Z_,a2 as ew,x as Wg,$ as tw,a0 as Ug,r as nw,s as rw}from"./BaEFcPEE.js";import{Jr as O,fo as aw,eW as sw,f3 as ow,eX as iw,f1 as lw,f0 as dw,eZ as cw,e$ as uw,eY as gw,rt as pw,c6 as fw,i as $i,J0 as vw,D9 as gf,De as hw,Dg as zg,Dd as mw,Df as _w,vC as ww,vE as bw,Cm as pf,cp as yw,cn as Iw,Bv as Sw,bE as $w,A1 as kw,Cb as oc,u_ as xw,cq as jg,dB as Cw,dC as Pw,Cl as Rw,el as Tw,CF as Aw,CE as Mw,CJ as Ew,CI as qw,cQ as Lw,cT as Hw,nB as Ow,er as Fw,wP as Dw,CK as Nw,wR as Bw,CL as Ww,cU as Uw,cV as zw,nJ as jw,Ae as Gw,Dq as Vw,wk as Kw,wl as Qw,yZ as Jw,z1 as ic,wg as Yw,wh as Xw,rR as Zw,re as eb,rc as tb,f_ as nb,HL as rb,Lf as ab,GJ as sb,gn as ob,p1 as ib,Jf as lb,oi as db,A0 as cb,ft as Gg,r1 as Vg,fm as ub,fl as gb,tA as pb,g3 as Kg,rd as fb,fe as vb,C6 as hb,m as mb,nK as _b,zF as wb,yX as bb,Ew as yb,El as Qg,xf as Ib,xg as Jg,uZ as Yg,p2 as Sb,DC as $b,gj as kb,g1 as xb,eU as Cb,cM as Pb,A4 as Rb,Lk as Tb,Cr as Ab,LC as Mb,y0 as Eb,ga as qb,fd as Lb,cL as Hb,cI as Ob,cH as Fb,vq as Db,xm as Nb,xk as Bb,cF as Wb,cE as Ub,z3 as zb,y_ as jb,xl as Gb}from"./BPo1GPk4.js";import{a as Uc}from"./CC7to1B5.js";import{aM as Vb,aL as Kb,bg as Qb,a7 as Jb,aD as Yb,aO as Xb,M as ff,a0 as vf,b8 as Zb,b2 as ey,as as Xg,P as bl,b0 as Zg,a$ as ep,a_ as tp}from"./QSHJFaU7.js";import{k as hf,F as ty,G as Cc,ar as ny,a_ as El,a8 as mf,Q as ry,aT as lc,ao as ay,aG as sy,B as oy,y as _f,r as iy,z as ly,u as dy,aY as cy,aE as wf,aD as bf,aF as uy,aJ as dc,aQ as np,aP as yl,aR as rp,P as ap,d as gy,e as py,av as fy,V as sp,aC as vy,c as hy,l as my,aS as op,an as _y,au as ip,a as wy,ay as by,ac as lp,aB as yy,aU as dp,aX as cp,m as up,ad as Iy,R as Sy,aw as gp,ak as $y,O as ky,aq as xy,h as Cy,p as Py,_ as cc,Z as Ry,aA as pp,a7 as Ty,f as Ay,i as My,a5 as Ey,ab as qy}from"./BH4muXHE.js";import{f as Ly,o as Hy,E as Oy,C as Fy,m as Dy,a2 as fp,aa as Ny,K as By,e as Wy,y as Uy}from"./Q-Hp56ht.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as yf,O as If,W as zy,bv as jy,aF as Sf,dH as $f,aV as Eo,e8 as Gy,dw as kf,aw as zc,dV as jc,aO as xf,cP as Vy,V as ha,a3 as Xs,B as Ky,a7 as Qy,a4 as Jy,M as Yy,a6 as Xy,ar as Zy,aG as Cf,aP as ql,r as eI,n as Pc,H as tI,dY as nI,aR as rI,aK as aI,c9 as sI,aX as oI,bM as iI,bK as lI,bL as dI,c8 as cI,c7 as uI,cN as gI,cM as pI,aT as fI,bb as vI,bd as hI,bg as mI,bc as _I,bl as wI,bf as bI,be as yI,bh as II,bi as SI,bk as $I,bj as kI,ax as xI,ay as CI,cj as PI,ck as RI,dv as TI,du as AI,b0 as MI,G as EI,b4 as qI,cf as LI,C as vp,d0 as HI,ba as cs,b$ as OI,X as FI,bq as DI,E as NI,ad as BI,t as WI,cW as UI,d3 as hp,Q as mp,dt as zI,cQ as uc}from"./DkYquFOp.js";import{u as Pf,a as Il,ag as jI,x as GI,ad as Rf,af as VI,ac as Tf,a4 as KI,F as _p,D as QI,e as JI,n as YI,s as XI,m as ZI,Y as eS,k as tS}from"./DM81x_EL.js";import{a2 as nS,b5 as rS,cM as aS,a_ as sS,b4 as oS,c2 as iS,c9 as lS,w as dS,x as cS,cd as uS}from"./DwhE2_yv.js";import{n as gS,P as Af,F as pS,ai as fS,r as vS,ac as hS}from"./PtMxuYy8.js";import{I as mS,s as _S,H as wp}from"./Bqd7fdCF.js";import{e as wS}from"./CL3a4Hm1.js";import{e as bS,f as yS}from"./C7hm9bSX.js";import{s as IS,o as Zs,b as SS,g as Nl,d as $S,l as bi}from"./CIyUrgF0.js";import{a5 as kS,a7 as xS,D as CS,N as PS,ac as bp,X as RS,i as TS,r as cr,v as Ri,u as na,p as ki,x as br,S as Gc,m as Gl,s as Ho,y as Ti,o as ro,n as ao,t as yp,aa as so,w as oo,a9 as Vc,q as _a,z as Oo,J as Rc,_ as Ip,g as AS,F as MS,U as Mf,I as Ef,a8 as qf,a6 as Ll,O as ES,E as Lf,V as qS,A as LS,b as HS,ab as OS,ad as Sl,G as FS,e as gc,l as DS,C as NS,f as Ys,j as Sp,H as us,Q as BS,d as $l,c as WS,a as $p,h as US,L as zS,Y as kp,a4 as pc,a1 as xp,a0 as jS,a3 as Cp,$ as Pp,T as GS,B as VS,k as KS,a2 as QS,K as JS,R as YS,P as XS,W as ZS}from"./tw85acZN.js";import{m as e$}from"./Dms_DO28.js";import{g as Hf}from"./CkrblKaH.js";import{b as t$}from"./BIwMjRQQ.js";import{g as n$}from"./BA7mfVzm.js";import{a as r$}from"./CClsvy7n.js";import{q as Of,d as ur,r as a$,e as Bl,j as s$,g as Tc,i as o$,f as Ac,c as i$,A as l$,O as Rp,k as d$}from"./CkmjUBxn.js";import{P as c$}from"./DpgIqMGp.js";import{e as u$}from"./CEqmtghP.js";import{b as g$,a as p$,g as f$,c as v$,i as h$}from"./DPF9_zKV.js";import{R as m$,g as _$,W as kl,c as w$}from"./TSQNyjhg.js";import"./Ch-pFfsN.js";import"./IdqO6uHC.js";import{s as Ai}from"./Dmy603At.js";import{F as b$,h as y$}from"./BpT_ybtH.js";import"./CBLFNmYJ.js";import{C as I$,e as Br,L as S$,l as Vl,d as Kl,K as Ql,h as Kc,M as Jl,S as Da}from"./DHbv9I-C.js";import{D as $$}from"./Bv5YjDej.js";import{f as Tp}from"./nHwpsxWy.js";import"./DU3vNstz.js";import{i as Ff}from"./BjLb7AHW.js";import{h as Ap,i as Mp,g as Ep,P as qp,C as k$,m as Hl,R as x$}from"./D7vAVIvz.js";import{f as It,ae as C$}from"./DPbnmxjX.js";import{F as ft,bs as P$,cd as R$,aw as Na,a2 as Df,c9 as T$,bf as A$,be as M$,bg as E$,aO as Lp,aj as fc,aB as vc,bB as Nf,d3 as Wl,cF as q$,aM as Hp,cb as Op,cK as Ul,bu as L$,aS as H$,d0 as O$,a8 as Bf,ac as F$,ag as D$,cr as N$,ba as B$,aC as Wf,cT as Fp,cz as W$,ax as U$,cD as z$,c3 as j$}from"./BZytk_HL.js";import{c as Uf}from"./ChTqQfQN.js";import"./jUAybD8G.js";import{c as Rt}from"./DpSAF6fh.js";import{a5 as zf,bg as G$,ar as V$,k as K$,Y as Q$,W as J$,a2 as Y$,Z as X$,bw as Z$,V as ek,a1 as tk,ah as nk}from"./CHHUtp07.js";import{d as zl,f as rk,e as ak}from"./DxrRvklK.js";import{A as sk}from"./BcEldzTj.js";import{D as ok}from"./DVok8lSR.js";import"./Dzl5aoA8.js";import{a as ik,C as lk}from"./Ow3KARwj.js";import"./DYGC3eZn.js";import{C as dk}from"./CtguhKZB.js";import{h as Mc,r as ck,a as uk}from"./DkY0xIi7.js";import{s as gk}from"./CuAAvi1f.js";import{I as pk,a as jf}from"./xJBWkpxc.js";import{L as fk}from"./1wMLd-77.js";import{g as vk,f as hk,b as mk}from"./CMgAi196.js";import{s as Mi,g as Yn,i as _k,j as wk,e as Dp,r as Np,f as bk,d as yk,a as hc,h as Ik}from"./G4lPpFfF.js";import{i as Bp,a as Sk}from"./Bu13V5mO.js";import{seekConversationToMessage as Wp}from"./zaxjdjiF.js";import{l as Kt,o as mc,h as Qc,n as Ec,q as $k}from"./CntPxeXh.js";import{o as kk}from"./CDeldaOF.js";import{A as Gf}from"./Bo5PTszQ.js";import{b as Vf}from"./Bek4Es60.js";import{g as xk,e as Kf,v as Ck,f as Pk,N as Rk,M as Tk,K as Ak,k as Qf,l as Mk,H as Jf,s as Yf}from"./B6Zf-ZTX.js";import{selectCurrentWorkspaceTabId as _c}from"./BblwdMxR.js";import{o as Ek}from"./D283eGmG.js";import{d as qk}from"./B0Z-1lwJ.js";import{P as Lk}from"./wfSdTH77.js";import{g as Hk}from"./D-7b6BAb.js";import{H as Xf,M as Ok,y as Fk,g as Dk,i as Nk,u as Bk,e as Zf,c as ev,d as Wk}from"./BtT-JO5g.js";import{c as Uk,h as Jc,f as tv,M as zk}from"./DM4cCUDd.js";import{t as jk}from"./DAsc1V4f.js";import{s as Gk}from"./BsieX9dN.js";import{i as nv}from"./B4wiFjXK.js";import{d as Vk,i as Kk,r as Qk}from"./C7Ibt0hX.js";import{g as Jk}from"./BYBN65Dm.js";var Yk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Xk=E("<div><!></div>");function rv(n,r){if(new.target)return ln({component:rv,...n});un(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),d=Z(r,"children",7),l=cf(r,Yk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return d()},set children(v){d(v),ee()},$set:dn,$on:(v,R)=>cn(r,v,R)},u=Xk();uf(u,v=>({"data-slot":"card-header",class:v,...l}),[()=>Wc("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",dk,i())]);var b=S(u);return Ai(b,()=>d()??fs),y(u),wr(u,v=>a(v),()=>a()),p(n,u),gn(f)}var Zk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ex=E("<div><!></div>");function av(n,r){if(new.target)return ln({component:av,...n});un(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),d=Z(r,"children",7),l=cf(r,Zk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return d()},set children(v){d(v),ee()},$set:dn,$on:(v,R)=>cn(r,v,R)},u=ex();uf(u,v=>({"data-slot":"card-title",class:v,...l}),[()=>Wc("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var b=S(u);return Ai(b,()=>d()??fs),y(u),wr(u,v=>a(v),()=>a()),p(n,u),gn(f)}const xl=mS.CHAT_MEDIA,wc=IS().min(1).max(512);Zs({workspaceId:wc,agentId:wc,draftId:Nl(),principalId:wc,media:SS(gS).min(1).max(20)}).strict();const tx=Zs({sessionId:Nl()}).strict();tx.extend({control:$S("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:bS}).strict(),Zs({action:bi("transcribe"),request:yS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Yc(n,r,a,i=async(d,l)=>typeof window>"u"||_S(window)!=="electron"?{ok:!1,error:"unavailable"}:wS().invoke(d,l)){let d=null,l=null,f=!1;async function u(){f=!0,a.removeEventListener("abort",b);const x=d;d=null,x&&await i(xl.CLOSE,{sessionId:x}).catch(()=>{})}const b=()=>{u()};a.addEventListener("abort",b,{once:!0});const v=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function R(){if(v(),d)return d;if(l)return l;l=(async()=>{const x=await i(xl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");d=x.value.sessionId;try{return v(),d}catch(F){throw await u(),F}})();try{return await l}finally{l=null}}async function I(x){const F=await R();v();const D=await i(xl.CONTROL,{sessionId:F,control:x});return v(),D}return{service:{exportMedia:x=>I({action:"export",request:x}),adoptMediaJob:x=>I({action:"adopt",jobId:x}),transcribeMedia:x=>I({action:"transcribe",request:x}),releaseMediaJob:async x=>d?await i(xl.CONTROL,{sessionId:d,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:u,readiness:()=>I({action:"readiness"})}}const bc=new Set;async function nx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),d=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:u}=i,b=Pi(O.state),v=Dl.select(O.state,f),R=yf.select(O.state),I=hf(),M=JSON.stringify([b,f,u]);if(!b||!v||!R||l.wsId!==f||bc.has(M))return!1;bc.add(M);const x=new AbortController,F=()=>x.abort();a.addEventListener("abort",F,{once:!0});const D=()=>!a.aborted&&!x.signal.aborted&&Pi(O.state)===b&&Dl.select(O.state,f)===v&&mf(I)&&r.isCurrentDraft(i),T=O.getReadableState().subscribe(()=>{D()||x.abort()});let H=null;try{if(!D()||nS(d))return!1;const V=Pf(i.attachments),oe=Af(pS(f,u),V,d.map(ce=>({contextItemId:ce.id,attachmentId:ce.attachmentId,path:ce.path}))),P=new Set([...oe.images,...oe.clips].map(ce=>ce.contextItemId));if(V.some(([ce])=>!P.has(ce))||oe.images.some(ce=>ce.mediaError)||oe.clips.some(ce=>ce.mediaError)||!fS(l.text,oe))throw new Error("invalid-evidence");if(H=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!D())return!1;const k=await Ly.agents.get(u,f);if(!D())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const J=oe.clips.flatMap(ce=>ce.media?[ce.media]:[]);J.length&&!H&&(H=Yc({workspaceId:f,agentId:u,draftId:crypto.randomUUID(),principalId:R.principal.id,media:J},D,x.signal));const ge=ty(d,oe),Te=Cc(ge),ve=await ny({workspaceId:f,agentId:u,evidence:oe,clickedItems:d,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:I,service:H?.service??null,current:D,onRecord:()=>{}});return!ve||!D()?!1:El(O,u,ve)}catch{return D()&&O.dispatch(aw(u,g.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",F),await H?.dispose(),bc.delete(M)}}const sv=1e4,Up={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function zp(n){return kS(n.messageMetadata)}function rx(n,r){if(n.some(zp)){const a=n[0];return a&&!zp(a)&&jp(a,r)?[a.id]:[]}return n.filter(a=>jp(a,r)).map(a=>a.id)}function ax(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function jp(n,r){return!n.requeuedAfterFailure&&xS(n,r)}function sx(n,r){const{busy:a,queue:i,delivered:d,now:l}=r,f=r.blocked||r.interrupted,u=r.timeoutMs??sv;let b=n.prediction;if(b){const x=new Set(i.map(H=>H.id)),F=b.ids.filter(H=>x.has(H)&&!d.has(H)),D=l-b.startedAt>=u,T=n.wasBusy&&!a;!F.length||D||f&&!a||T?b=null:F.length!==b.ids.length&&(b={...b,ids:F})}const v=n.wasBusy&&!a,R=n.wasBusy?n.busySince:a?l:null,I=n.wasBusy&&n.preempted||R!==null&&r.directSendAt!==null&&r.directSendAt>R;if(!b&&v&&!f&&!I){const x=rx(i,l).filter(F=>!d.has(F));x.length&&(b={ids:x,startedAt:l})}const M={wasBusy:a,busySince:a?R:null,preempted:a&&I,prediction:b};return n.wasBusy===M.wasBusy&&n.busySince===M.busySince&&n.preempted===M.preempted&&n.prediction===M.prediction?n:M}class ox{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let d;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{d=setTimeout(()=>f(!0),i)})]);if(clearTimeout(d),l)return!1}return!0}}function ix(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Gp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var lx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function ov(n,r){if(new.target)return ln({component:ov,...n});un(r,!0);const a=()=>pe(R,"$typing$",i),[i,d]=Ur();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),u=Z(r,"class",7,"");const b=Bn(""),v=Bn("");ie(()=>{b.set(l())}),ie(()=>{v.set(f())});const R=rS(b,v),I=o(()=>u$(a()));var M={get workspaceId(){return l()},set workspaceId(H){l(H),ee()},get agentId(){return f()},set agentId(H){f(H),ee()},get class(){return u()},set class(H=""){u(H),ee()},$set:dn,$on:(H,V)=>cn(r,H,V)},x=Ot(),F=ye(x);{var D=H=>{var V=lx(),oe=S(V),P=S(oe);c$(P,{get people(){return a()},size:12,decorative:!0}),y(oe);var k=_(oe,2),J=de(k,!0);vn(2),y(V),q(()=>{ke(V,1,`${Of} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${u()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(J,e(I))}),p(H,V)};N(F,H=>{e(I)&&H(D)})}p(n,x);var T=gn(M);return d(),T}const dx=50,cx=5e3,ux=500,gx=()=>({authority:()=>Pi(O.state),persistSnapshot:ay,dispatch:n=>O.dispatch(n),ownerView:n=>sy.withStore(O)(n)});function px(n){const r=n.store??gx(),a=crypto.randomUUID();let i=he(!1),d=he(!1),l=he(!1),f=null,u=null,b=0,v=!1,R=null,I=null,M=null,x=0,F=null,D=null;const T={};let H,V=he([]),oe=null,P=0,k="",J=0,ge="";const Te=()=>{const B=n.workspaceId(),C=n.agentId();if(!B||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||v)return null;const Me=n.inputValue(),L=ce(),X=H?.shared,Y=X?.workspaceId===B&&X.agentId===C?X.lifetime:null,be=JSON.stringify([re,B,C,x,Y,L.map(z=>[z.id,z.attachmentId,z.path])]);be!==ge&&(ge=be,J+=1);const De=JSON.stringify([re,B,C,Me,L,x]);return De!==k&&(k=De,P+=1),{authority:re,ownerId:a,workspaceId:B,agentId:C,text:Me,attachments:JSON.parse(JSON.stringify(L)),generation:P,attachmentEpoch:J}};let ve=null;const ce=()=>jI(n.contextItems(),GI(n.contextItems(),e(V))),we=B=>{if(H=B,!B||v)return;const C=B.restore;if(D&&C?.requestId===D.requestId&&C.status!=="pending"){const{apply:L}=D;D=null,w(d,!1),C.status==="restored"&&w(V,C.draft?.attachments??[]),L(C)}const re=B.shared;if(re&&!e(d)&&u===`${re.workspaceId}\0${re.agentId}`){const L=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(oe!==L){oe=L;const X=ve??f,Y=X&&n.inputValue()===X.text&&JSON.stringify(ce())===X.attachmentsJson;re.origin===a?ve={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:Y&&(b+=1,M&&clearTimeout(M),w(V,re.snapshot.attachments),ve=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(V))),n.applyEditorContent(re.snapshot.text))}}dt(Te);const Me=[];for(const L of B.saves){if(L.status==="pending")continue;Me.push(L.id);const X=T[L.id];delete T[L.id],X?.(L)}Me.length>0&&queueMicrotask(()=>r.dispatch(lw(a,Me)))},ne=(B,C,re)=>{const Me=crypto.randomUUID();D={requestId:Me,apply:re},w(d,!0),r.dispatch(cw(a,Me,B,C))},te=()=>{D&&(D=null,w(d,!1),r.dispatch(gw(a)))},Be=()=>{const B=F;B&&(F=null,r.dispatch(uw(a)),H?.saves.some(C=>C.id===B)||delete T[B])};r.dispatch(sw(a));const se=r.ownerView(a).subscribe(B=>dt(()=>we(B))),me=()=>{I&&(clearTimeout(I),I=null),w(l,!1)},Ee=()=>{F&&(F=null,r.dispatch(dw(a)))};ie(()=>{const B=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!B){dt(()=>{b+=1,u=null,te(),R&&clearTimeout(R),R=null,me(),M&&clearTimeout(M),M=null,w(i,!1),Ee()});return}if(!C||!re)return;const Me=`${C}\0${re}`;if(u===Me)return;const L=u!==null;u=Me;const X=++b;dt(()=>{f=null,ve=null,oe=null,w(V,[]),R&&clearTimeout(R),me(),M&&(clearTimeout(M),M=null),L&&(Ee(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const Y=ry(C,re);if(Y){w(V,Y.attachments),w(i,!1);const De=n.contextItems().length>0,z=Y.text,Ie=JSON.stringify(Y.attachments);n.setInputValue(Y.text),De||n.setContextItems(Il(Y.attachments)),n.applyEditorContent(Y.text),f={text:Y.text,attachmentsJson:Ie},ne(C,re,Ce=>{if(Ce.status!=="restored")return;const He=Ce.draft;if(v||!(n.active?.()??!0)||u!==Me||b!==X)return;const st=He?.text??"",Je=He?.attachments??[],Oe=JSON.stringify(Je);lc(C,re,{text:st,attachments:Je});const Pe=n.inputValue()===z&&JSON.stringify(ce())===Ie;De||!Pe||(st!==z&&(n.setInputValue(st),n.applyEditorContent(st)),Oe!==Ie&&n.setContextItems(Il(Je)),f={text:st,attachmentsJson:Oe})});return}w(i,!0),I=setTimeout(()=>{I=null,(n.active?.()??!0)&&w(l,!0)},ux),R=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),me())},cx);const be=()=>{!(n.active?.()??!0)||u!==Me||b!==X||(R&&clearTimeout(R),w(i,!1),me())};ne(C,re,De=>{if(De.status!=="restored"){be();return}const z=De.draft;if(v||!(n.active?.()??!0)||u!==Me||b!==X)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),M=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},dx)),f===null){const Ce=z?.text??"",He=z?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(He)},lc(C,re,{text:Ce,attachments:He})}be()})})}),ie(()=>{const B=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Me=e(i);if(!B){dt(Be);return}if(!C||!re)return;const L=n.inputValue(),X=ce();if(dt(Te),dt(Be),Me||f===null&&!L&&X.length===0)return;const Y=JSON.stringify(X);if(f!==null&&f.text===L&&f.attachmentsJson===Y)return;JSON.stringify(e(V))!==Y&&w(V,X);const be=`${C}\0${re}`,De=x,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){u===be&&x===De&&(f={text:L,attachmentsJson:Y});return}n.onSaveError?.(new Error(Ie.error))}},dt(()=>{F=z,r.dispatch(ow(a,z,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:L,attachments:X,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),ie(()=>()=>{v=!0,R&&clearTimeout(R),I&&clearTimeout(I),M&&clearTimeout(M),Ee(),se(),r.dispatch(iw(a))});const qe=B=>{const C=Te();return C!==null&&C.authority===B.authority&&C.ownerId===B.ownerId&&C.workspaceId===B.workspaceId&&C.agentId===B.agentId&&C.generation===B.generation&&C.text===B.text&&JSON.stringify(C.attachments)===JSON.stringify(B.attachments)};return{captureDraft:Te,isCurrentDraft:qe,updateAttachmentScreen(B,C,re){return!qe(B)||!B.attachments.some(Me=>Me.id===C)?null:(w(V,B.attachments.map(Me=>Me.id===C?{...Me,screen:structuredClone(re)}:Me)),Te())},async flushDraft(B){if(!qe(B))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,B.workspaceId,B.agentId,B,B.authority),qe(B)},get restorePending(){return e(d)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(b+=1,x+=1,te(),R&&(clearTimeout(R),R=null),M&&(clearTimeout(M),M=null),w(i,!1),me(),Be(),u!==null){const[B,C]=u.split("\0");lc(B,C,{text:"",attachments:[]}),ve=null,w(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=Af(JSON.stringify([n.workspaceId,n.agentId]),Pf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(d=>d.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function fx(n,r,a){const i=O.state.principal.snapshot,d=()=>Pi(O.state)===n.authority&&a.isCurrentDraft(n);if(!i||!d()||!await a.flushDraft(n)||!d())return{ready:!1};const l=new AbortController,f=Yc({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},d,l.signal);try{const u=await f.readiness();return!d()||!u.ok?{ready:!1}:u.value.find(b=>b.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Vp(n){let r=he(null),a=he(!1),i=he(!1),d=null,l=!0,f=0,u=null;Es(()=>{l=!1,f++}),ie(()=>{const I=n.capture();e(r)&&(!I||I.authority!==e(r).capture.authority||I.ownerId!==e(r).capture.ownerId||I.workspaceId!==e(r).capture.workspaceId||I.agentId!==e(r).capture.agentId||I.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function b(I){if(n.disabled()||e(a))return;const M=n.drafts.captureDraft(),x=Ei(M),F=x?.clips.find(V=>V.contextItemId===I);if(!M||!F?.media||!x)return;const D=oy({workspaceId:M.workspaceId,agentId:M.agentId,clip:F,evidence:x,marks:x.marks}),T=_f(M.workspaceId,F.path);if(!D||!T)return;const H=++f;d=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||f!==H||!n.drafts.isCurrentDraft(M))return;const V=await(n.prepareOutput??fx)(M,F.media,n.drafts);if(!l||f!==H||!n.drafts.isCurrentDraft(M))return;const{attachmentPath:oe,...P}=D;w(r,{capture:M,contextItemId:I,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===H&&w(i,!0)}finally{l&&f===H&&w(a,!1)}}async function v(I){const M=crypto.randomUUID(),x=e(r),F=n.drafts.captureDraft();if(!x||!F||F.authority!==x.capture.authority||F.ownerId!==x.capture.ownerId||F.workspaceId!==x.capture.workspaceId||F.agentId!==x.capture.agentId||F.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:M,result:"stale-source"};const D=Ei(F),T=D?.clips.find(J=>J.contextItemId===x.contextItemId);if(!D||!T?.media)return{requestId:M,result:"stale-source"};const V=u?.openId===x.snapshot.openId&&u.inputRevision===I.revision&&JSON.stringify(u.media)===JSON.stringify(T.media)?{...I,revision:T.media.saved?.revision??0}:I,oe=vS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:F.workspaceId,agentId:F.agentId},sourceId:I.sourceId,sourceRevision:I.sourceRevision,expectedEditRevision:V.revision,edit:V});if(oe.status!=="saved")return{requestId:M,result:oe.status==="invalid-edit"?"failed":oe.status};const P=hS({...D,clips:D.clips.map(J=>J.id===T.id?{...J,media:oe.media}:J)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(F,x.contextItemId,P);if(!k)return{requestId:M,result:"stale-source"};u={openId:x.snapshot.openId,media:oe.media,inputRevision:I.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:M,result:"stale-source"};await n.drafts.flushDraft(k);const J=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!J||J.attachmentEpoch!==x.capture.attachmentEpoch||J.authority!==k.authority||J.ownerId!==k.ownerId||J.workspaceId!==k.workspaceId||J.agentId!==k.agentId||JSON.stringify(J.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:M,result:"stale-source"}:(u=null,{requestId:M,result:"saved",saved:oe.media.saved??void 0})}catch{return{requestId:M,result:"failed"}}}function R(I){return n.disabled()||!n.onRemove(I)?!1:(e(r)?.contextItemId===I&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:b,save:v,remove:R,close(){w(r,null)},restoreFocus(){d?.isConnected&&d.focus()}}}var vx=E('<p role="alert"> </p>'),hx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),mx=E("<!> <!> <!>",1);function iv(n,r){if(new.target)return ln({component:iv,...n});un(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),d=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Vp),u=Z(r,"beforeOpen",7),b=Z(r,"onReviewChange",7);const v=dt(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>d(),onRemove:P=>l()(P),beforeOpen:()=>u()?.()??Promise.resolve()}));ie(()=>{const P=v.opening,k=v.session;dt(()=>b()?.(P,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const R=o(iy),I=o(()=>Ei(a())),M=o(()=>e(I)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Tp(P.durationMs),recording:!1,url:a()?_f(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:ly(P.media.saved)}:{}}))??[]);let x=he(null);var F={get capture(){return a()},set capture(P){a(P),ee()},get drafts(){return i()},set drafts(P){i(P),ee()},get disabled(){return d()},set disabled(P=!1){d(P),ee()},get onRemove(){return l()},set onRemove(P){l(P),ee()},get controllerFactory(){return f()},set controllerFactory(P=Vp){f(P),ee()},get beforeOpen(){return u()},set beforeOpen(P){u(P),ee()},get onReviewChange(){return b()},set onReviewChange(P){b(P),ee()},$set:dn,$on:(P,k)=>cn(r,P,k)},D=mx(),T=ye(D);{let P=o(()=>d()||v.opening);CS(T,{get items(){return e(M)},get labels(){return e(R)},get disabled(){return e(P)},onEdit:k=>void v.open(k),onMarkUp:k=>void v.open(k),get onRemove(){return v.remove}})}var H=_(T,2);{var V=P=>{var k=vx(),J=de(k,!0);q(ge=>j(J,ge),[()=>g.dock_captureEditor_saveFailed_label()]),p(P,k)};N(H,P=>{v.problem&&P(V)})}var oe=_(H,2);{let P=o(()=>!!v.session),k=o(()=>g.dock_captureEditor_recording_title({duration:v.session?Tp(v.session.snapshot.durationMs??0):""}));I$(oe,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>v.close(),onCloseAutoFocus:J=>{J.preventDefault(),v.restoreFocus()},get contentRef(){return e(x)},set contentRef(J){w(x,J,!0)},children:(J,ge)=>{var Te=Ot(),ve=ye(Te);{var ce=we=>{var ne=Ot(),te=ye(ne);xi(te,()=>v.session.snapshot.openId,Be=>{var se=hx(),me=S(se);$$(me,{get snapshot(){return v.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>v.close(),get onSave(){return v.save},onDelete:async()=>!!v.session&&v.remove(v.session.contextItemId)}),y(se),p(Be,se)}),p(we,ne)};N(ve,we=>{v.session&&we(ce)})}p(J,Te)},$$slots:{default:!0}})}return p(n,D),gn(F)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function _x(n){let r=he(!1),a=he(!1),i=he(null),d=!1,l=0,f=null,u=null;async function b(I){I.abort.abort(),I.slot?.cancel(),await I.native?.dispose()}async function v(){l++;const I=u;u=null,I&&await b(I)}no(()=>{const I=()=>{w(r,document.hasFocus(),!0)};return I(),window.addEventListener("focus",I),window.addEventListener("blur",I),()=>{window.removeEventListener("focus",I),window.removeEventListener("blur",I)}});const R=O.getReadableState().subscribe(()=>{u&&!u.current()&&v()});return Es(()=>{d=!0,R(),v()}),ie(()=>{const I=n.capture(),M=I?Cl(I):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===M);dt(()=>{if(!x||!I){v();return}if(u?.key===M)return;if(f===M){v();return}v();const D=Ei(I)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=D[0],H=O.state.principal.snapshot,V=Dl.select(O.state,I.workspaceId);if(!T||!H||!V||n.drafts.gateActive)return;const oe=hf(),P=new AbortController,k=()=>!d&&!P.signal.aborted&&Pi(O.state)===I.authority&&Dl.select(O.state,I.workspaceId)===V&&mf(oe)&&!!n.capture()&&Cl(n.capture())===M,J={key:M,capture:I,abort:P,native:null,slot:null,current:k};u=J;const ge=l;n.drafts.flushDraft(I).then(async Te=>{if(!(u!==J||ge!==l||!k())){if(!Te){f=M,await v();return}J.native=Yc({workspaceId:I.workspaceId,agentId:I.agentId,draftId:crypto.randomUUID(),principalId:H.principal.id,media:structuredClone(D)},k,P.signal),J.slot=dy(J.native.service),f=M,J.slot.warm(M,T,k)}}).catch(()=>{u===J&&v()})})}),{cancel:v,async beforeEditorOpen(){w(a,!0),f=null,await v()},editorState(I,M){w(a,I,!0);const x=M?Cl(M.capture):null;M&&e(i)?.openId!==M.openId&&(f=null),w(i,M&&x?{openId:M.openId,key:x}:null)},take(I,M){const x=u;if(!x?.native||!x.slot||x.key!==Cl(I)||!x.current())return v(),null;u=null,l++;const F=x.native,D=x.slot,T=()=>x.abort.abort();return M.addEventListener("abort",T,{once:!0}),M.aborted&&T(),{service:{...F.service,takePreparedRecording:H=>D.take(x.key,H,()=>!M.aborted&&x.current())},async dispose(){M.removeEventListener("abort",T),await b(x)}}}}}var wx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function lv(n,r){if(new.target)return ln({component:lv,...n});un(r,!1);var a={$set:dn,$on:(f,u)=>cn(r,f,u)};Ff();var i=wx(),d=S(i),l=de(d,!0);return y(i),q(f=>j(l,f),[()=>g.chat_draftGate_loading_label()]),p(n,i),gn(a)}var bx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function qc(n,r){if(new.target)return ln({component:qc,...n});un(r,!1);var a={$set:dn,$on:(f,u)=>cn(r,f,u)};Ff();var i=bx(),d=_(S(i),2),l=de(d,!0);return vn(2),y(i),q((f,u)=>{Ne(i,"aria-label",f),j(l,u)},[()=>g.chat_newMessagesDivider_label(),()=>g.chat_newMessagesDivider_label()]),p(n,i),gn(a)}function yx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Ix(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Sx(n,r){return r&&n.includes(r)?r:null}function Kp(n,r,a){return r-n<=a}const $x=.2;function Qp(n,r,a){const i=Math.max(0,a-r),d=n-$x*r;return Math.min(Math.max(0,d),i)}function kx(n,r,a){return n!==null&&a&&n===r}function xx(n){return n?pw(n)&&fw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Cx(n){const r=[],a=new Set;let i,d;for(const H of n.messages){if(H.agentId&&H.agentId!==n.agentId){i=void 0,d=void 0;continue}if(a.has(H.id))continue;a.add(H.id),n.breakBeforeMessageIds?.has(H.id)&&(i=void 0,d=void 0);const V=PS(H);if(V?.kind!=="turn-failure")d=void 0;else{const oe=i?.seq!==void 0&&H.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(H.seq)&&H.seq===i.seq+1;(!d||!oe)&&(d={key:JSON.stringify([n.agentId,"notice",H.id]),anchorMessageId:H.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(d)),d.records.push({messageId:H.id,reason:V.reason,timestamp:H.timestamp}),d.recordedFailureCount+=1}i=H}const l=new Map;for(const H of n.queue){if(!H.requeuedAfterFailure)continue;const V=H.turnId||void 0,oe=JSON.stringify([n.agentId,V?"turn":"queue",V??H.id]);let P=l.get(oe);P||(P={key:oe,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(oe,P)),P.queueIds.includes(H.id)||P.queueIds.push(H.id)}const f=[...l.values()],u=n.session?.id===n.agentId?n.session:void 0,b=u?.status===$i.Error,v=n.transientError||b&&u.stopReason||null,R=b&&!v,I=b&&(!n.transientError||n.transientError===u.stopReason)?u.stopReasonTimestamp:void 0,M=I?bp(I):null,x=M&&v&&v===u?.stopReason?r.flatMap(H=>H.records).filter(H=>H.reason===v&&bp(H.timestamp)===M):[],F=x.length===1?x[0].messageId:void 0,T=(u?If(u):!1)?"attempting":f.length?"queued":v||R?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:v,needsFallbackReason:R,timestamp:I,noticeId:F}}}function Px(n,r){const a=n.hiddenTail[0]?.id,i=Cx({...r,messages:[...n.groups.flatMap(u=>u.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),d=i.current.noticeId,l=i.history.map(u=>({...u,records:u.records.filter(b=>b.messageId!==d)})).filter(u=>u.records.length>0),f=new Set(l.map(u=>u.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(u=>[u.records[0].messageId,u])),collapsedMessageIds:new Set(i.history.flatMap(u=>u.records.map(b=>b.messageId).filter(b=>!f.has(b))))}}var Rx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Tx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Ax=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Mx=E('<div class="mb-5"><!></div>'),Ex=E('<p data-testid="agent-welcome-description"> </p> <!>',1),qx=E("<!> <!>",1),Lx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Hx=E("<!> <span> </span>",1),Ox=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function dv(n,r){if(new.target)return ln({component:dv,...n});un(r,!0);const a=()=>pe(x,"$userOverrides$",f),i=()=>pe(M,"$specialists$",f),d=()=>pe(H,"$isGitHubAuth$",f),l=()=>pe(V,"$recentSpecialistIds$",f),[f,u]=Ur();let b=Z(r,"onSpecialistChange",7),v=Z(r,"session",7),R=Z(r,"workspaceId",7);const I=Bn(R()??"");ie(()=>I.set(R()??""));const M=zf(I),x=G$();ie(()=>{a()});const F=o(()=>{if(!v()||zy(v()))return null;const B=v().metadata?.specialist||v().agentMetadata?.specialist;return B&&i().find(C=>C.id===B)||null});async function D(B){B?await zl({specialist:B,hash:"specialists"}):await zl({view:"create-specialist"})}let T=he(!1);const H=V$(),V=aS(),oe=o(()=>vw(K$(i(),d()),l()));let P=he(!1);const k=o(()=>g.chat_regularAgentWelcome_generalDescription_label()),J=o(()=>e(F)?.name??g.chat_shared_general_fallback()),ge=o(()=>e(F)?.description??g.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(F)?e(F).defaultBehaviorPrompt||"":e(k));var ve={get onSpecialistChange(){return b()},set onSpecialistChange(B){b(B),ee()},get session(){return v()},set session(B){v(B),ee()},get workspaceId(){return R()},set workspaceId(B){R(B),ee()},$set:dn,$on:(B,C)=>cn(r,B,C)},ce=Ox(),we=S(ce);{var ne=B=>{var C=Mx(),re=S(C);ok(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(X){w(P,X,!0)},trigger:(X,Y)=>{let be=()=>(Y?.()).props;{let De=o(()=>Wc("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));It(X,qi(be,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(De)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Rx(),He=ye(Ce),st=S(He);{let Se=o(()=>e(F)?.id??null),Ae=o(()=>e(F)?.icon??null);sk(st,{agentId:"blank",variant:"emphasized",get specialist(){return e(Se)},get icon(){return e(Ae)}})}y(He);var Je=_(He,2),Oe=S(Je),Pe=de(Oe,!0),G=_(Oe,2),ae=de(G,!0);y(Je);var Le=_(Je,2),Q=S(Le);ft(Q,{get icon(){return Na},size:10}),y(Le),q(()=>{j(Pe,e(J)),j(ae,e(ge))}),p(z,Ce)},$$slots:{default:!0}}))}},content:X=>{var Y=Ax(),be=S(Y),De=S(be),z=de(De,!0),Ie=_(De,2),Ce=de(Ie,!0);y(be);var He=_(be,2),st=S(He);{let Pe=o(()=>e(F)?.id??null);V_(st,{get specialists(){return e(oe)},get value(){return e(Pe)},onchange:G=>{w(P,!1),b()?.(G)}})}y(He);var Je=_(He,2),Oe=S(Je);Rt(Oe,()=>Br,(Pe,G)=>{G(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(P,!1),D()},children:(ae,Le)=>{var Q=Tx(),Se=ye(Q),Ae=S(Se);ft(Ae,{get icon(){return R$},size:12}),y(Se);var ze=_(Se,2),Ge=de(ze,!0);q(We=>j(Ge,We),[()=>g.chat_regularAgentWelcome_createSpecialist_label()]),p(ae,Q)},$$slots:{default:!0}})}),y(Je),y(Y),q((Pe,G)=>{j(z,Pe),j(Ce,G)},[()=>g.workspace_createAgentSection_specialists_label(),()=>g.workspace_createAgentSection_specialists_description()]),p(X,Y)},$$slots:{trigger:!0,content:!0}}),y(C),p(B,C)};N(we,B=>{b()&&B(ne)})}var te=_(we,2);{var Be=B=>{var C=Ot(),re=ye(C);{let Me=o(()=>g.chat_specialistSelector_prompt_label());Rt(re,()=>lk,(L,X)=>{X(L,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(Y,be)=>{var De=qx(),z=ye(De);Rt(z,()=>rv,(Ce,He)=>{He(Ce,{children:(st,Je)=>{var Oe=Ot(),Pe=ye(Oe);Rt(Pe,()=>av,(G,ae)=>{ae(G,{class:"type-caption font-medium",children:(Le,Q)=>{vn();var Se=on();q(Ae=>j(Se,Ae),[()=>g.chat_specialistSelector_prompt_label()]),p(Le,Se)},$$slots:{default:!0}})}),p(st,Oe)},$$slots:{default:!0}})});var Ie=_(z,2);Rt(Ie,()=>ik,(Ce,He)=>{He(Ce,{children:(st,Je)=>{var Oe=Ex(),Pe=ye(Oe),G=de(Pe,!0),ae=_(Pe,2);It(ae,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Le,Q)=>{vn();var Se=on();q(Ae=>j(Se,Ae),[()=>e(T)?g.chat_regularAgentWelcome_showLess_label():g.chat_regularAgentWelcome_showMore_label()]),p(Le,Se)},$$slots:{default:!0}}),q(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Te))}),p(st,Oe)},$$slots:{default:!0}})}),p(Y,De)},$$slots:{default:!0}})})}p(B,C)},se=B=>{var C=Lx(),re=de(C,!0);q(()=>j(re,e(Te))),p(B,C)};N(te,B=>{e(F)?B(Be):B(se,-1)})}var me=_(te,2);{var Ee=B=>{It(B,{variant:"ghost-light",size:"sm",onclick:()=>D(e(F).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Me=Hx(),L=ye(Me);ft(L,{get icon(){return P$},size:12,class:"opacity-60"});var X=_(L,2),Y=de(X,!0);q(be=>j(Y,be),[()=>g.chat_regularAgentWelcome_customize_label()]),p(C,Me)},$$slots:{default:!0}})};N(me,B=>{e(F)&&B(Ee)})}y(ce),p(n,ce);var qe=gn(ve);return u(),qe}var Fx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Dx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Nx=E('<span class="type-caption"> </span>'),Bx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Wx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Xc(n,r){if(new.target)return ln({component:Xc,...n});un(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),d=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),u=Z(r,"reserveShortcutHintSpace",7,!1),b=Z(r,"workspaceId",7);const R=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",I=s$.replace("text-ui","type-caption");function M(k){i()(k)}function x(k,J){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),M(J))}function F(k,J){k.preventDefault(),k.stopPropagation(),Mc(J,{workspaceId:b(),event:k})}function D(k,J){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Mc(J,{workspaceId:b(),event:k}))}function T(k){return k<3}var H={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return d()},set onEdit(k){d(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return u()},set reserveShortcutHintSpace(k=!1){u(k),ee()},get workspaceId(){return b()},set workspaceId(k){b(k),ee()},$set:dn,$on:(k,J)=>cn(r,k,J)},V=Ot(),oe=ye(V);{var P=k=>{var J=Wx(),ge=S(J);{const Te=(ce,we)=>{let ne=()=>(we?.()).item,te=()=>(we?.()).index;const Be=o(()=>Qb(ne())),se=o(()=>e(Be)[0]?.type==="text"?e(Be)[0].content:"");var me=Bx(),Ee=S(me),qe=S(Ee);ft(qe,{get icon(){return Df},size:16,get class(){return ur}}),y(Ee);var B=_(Ee,2),C=S(B),re=de(C,!0),Me=_(C);Dn(Me,17,()=>e(Be).slice(e(se)?1:0),z_,(z,Ie)=>{var Ce=Ot(),He=ye(Ce);{var st=Oe=>{const Pe=o(()=>Kb(e(Ie).url));var G=Fx(),ae=de(G,!0);q(()=>{Ne(G,"href",e(Pe)),Ne(G,"title",e(Pe)),j(ae,e(Ie).label)}),ps("click",G,Le=>F(Le,e(Pe))),ps("keydown",G,Le=>D(Le,e(Pe))),p(Oe,G)},Je=Oe=>{var Pe=on();q(()=>j(Pe,e(Ie).content)),p(Oe,Pe)};N(He,Oe=>{e(Ie).type==="link"?Oe(st):Oe(Je,-1)})}p(z,Ce)}),y(B);var L=_(B,2);{var X=z=>{var Ie=Dx();let Ce;var He=de(Ie);q(()=>{Ce=ke(Ie,1,`${I??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),Ne(Ie,"aria-hidden",f()?void 0:"true"),Ne(Ie,"data-hint-visible",f()),j(He,`${R}${te()+1}`)}),p(z,Ie)},Y=o(()=>T(te())&&(f()||u()));N(L,z=>{e(Y)&&z(X)})}var be=_(L,2);{var De=z=>{C$(z,{side:"top",delayDuration:300,trigger:He=>{{let st=o(()=>g.chat_suggestedPrompts_editInInput_ariaLabel());It(He,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Je=>{Je.stopPropagation(),d()(ne())},get"aria-label"(){return e(st)},children:(Je,Oe)=>{ft(Je,{get icon(){return T$},size:"xs"})},$$slots:{default:!0}})}},content:He=>{var st=Nx(),Je=de(st,!0);q(Oe=>j(Je,Oe),[()=>g.chat_suggestedPrompts_edit_tooltip()]),p(He,st)},$$slots:{trigger:!0,content:!0}})};N(be,z=>{d()&&z(De)})}y(me),q(z=>{ke(me,1,`${Of} ${a$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Ee,1,`${Bl??""} mt-px self-start`),Ne(C,"aria-label",z),j(re,e(se))},[()=>Vb(ne())]),ps("click",C,z=>{z.stopPropagation(),M(ne())}),ps("keydown",C,z=>x(z,ne())),p(ce,me)};let ve=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");S$(ge,{get items(){return a()},virtualize:!1,onActivate:M,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(ve)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}y(J),Lt(1,J,()=>ma,()=>({tier:"fast",y:0,scale:1})),Lt(2,J,()=>eo,()=>({tier:"fast"})),p(k,J)};N(oe,k=>{a().length>0&&k(P)})}return p(n,V),gn(H)}Bc(["click","keydown"]);var Ux=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function cv(n,r){if(new.target)return ln({component:cv,...n});un(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const d=o(()=>[{label:g.chat_chiefEmptyState_assignedPrs_label(),prompt:g.chat_chiefEmptyState_assignedPrs_prompt()},{label:g.chat_chiefEmptyState_staleWorkspaces_label(),prompt:g.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:g.chat_chiefEmptyState_agentPerformance_label(),prompt:g.chat_chiefEmptyState_agentPerformance_prompt()},{label:g.chat_chiefEmptyState_morningBrief_label(),prompt:g.chat_chiefEmptyState_morningBrief_prompt()},{label:g.chat_chiefEmptyState_randomTheme_label(),prompt:g.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(d).map(M=>M.label));function f(M){const x=e(d).find(F=>F.label===M);x&&a()(x.prompt)}var u={get onSelect(){return a()},set onSelect(M){a(M),ee()},get compact(){return i()},set compact(M=!1){i(M),ee()},$set:dn,$on:(M,x)=>cn(r,M,x)},b=Ux(),v=S(b),R=de(v,!0),I=_(v,2);return Xc(I,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),y(b),q(M=>j(R,M),[()=>g.chat_chiefEmptyState_intro_label()]),p(n,b),gn(u)}const Zc=2e3,zx=4e3,jx=zx-Zc-2;function Gx(n,r=Zc){const a=[];let i=0;for(let d=n.length-1;d>=0&&i<r;d-=1){const l=n[d];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(b=>b.type==="text").map(b=>b.text||b.content||"").join(""),u=(l.role==="assistant"?K_(f).cleanedContent:f).trim();u&&(a.unshift({role:l.role,text:u}),i+=u.length)}return a}function Vx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
1
+ var N_=Object.defineProperty;var Fg=n=>{throw TypeError(n)};var B_=(n,r,a)=>r in n?N_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>B_(n,typeof r!="symbol"?r+"":r,a),W_=(n,r,a)=>r.has(n)||Fg("Cannot "+a);var Ro=(n,r,a)=>(W_(n,r,"read from private field"),a?a.call(n):r.get(n)),Dg=(n,r,a)=>r.has(n)?Fg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as ln,bo as Z,bw as dn,bp as cf,b as cn,bm as g,bq as Ur,bs as pe,br as qi}from"./1KDVFF23.js";import{bs as un,a5 as S,bf as fs,bA as y,W as p,bn as gn,aA as ee,aB as E,ca as ie,a7 as Ot,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as vn,b_ as q,bO as j,c5 as dt,bH as w,bV as he,bj as Es,bk as no,b$ as on,ai as Bc,aj as ps,bo as jl,br as Mr,c0 as qt,cb as sc,aw as wi,a as U_}from"./3SdAC2_C.js";import{i as N}from"./Zg9SWWIQ.js";import{k as xi}from"./Dhj-Oo-y.js";import{g as Dn,i as z_,I as qo,p as Lo,e as Mo}from"./CYCawVEx.js";import{n as Lt,l as ma,c as eo,j as Ng,k as Fo,h as j_}from"./CjK2zm52.js";import{b as uf,e as Wc,f as ke,s as Ne,c as Wt,g as gs}from"./D8B7qxXm.js";import{b as G_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as V_,U as K_,Z as Q_,X as J_,Y as Y_,I as Bg,o as X_,l as Z_,a2 as ew,x as Wg,$ as tw,a0 as Ug,r as nw,s as rw}from"./CJBG3N9y.js";import{Jr as O,fo as aw,eW as sw,f3 as ow,eX as iw,f1 as lw,f0 as dw,eZ as cw,e$ as uw,eY as gw,rt as pw,c6 as fw,i as $i,J0 as vw,D9 as gf,De as hw,Dg as zg,Dd as mw,Df as _w,vC as ww,vE as bw,Cm as pf,cp as yw,cn as Iw,Bv as Sw,bE as $w,A1 as kw,Cb as oc,u_ as xw,cq as jg,dB as Cw,dC as Pw,Cl as Rw,el as Tw,CF as Aw,CE as Mw,CJ as Ew,CI as qw,cQ as Lw,cT as Hw,nB as Ow,er as Fw,wP as Dw,CK as Nw,wR as Bw,CL as Ww,cU as Uw,cV as zw,nJ as jw,Ae as Gw,Dq as Vw,wk as Kw,wl as Qw,yZ as Jw,z1 as ic,wg as Yw,wh as Xw,rR as Zw,re as eb,rc as tb,f_ as nb,HL as rb,Lf as ab,GJ as sb,gn as ob,p1 as ib,Jf as lb,oi as db,A0 as cb,ft as Gg,r1 as Vg,fm as ub,fl as gb,tA as pb,g3 as Kg,rd as fb,fe as vb,C6 as hb,m as mb,nK as _b,zF as wb,yX as bb,Ew as yb,El as Qg,xf as Ib,xg as Jg,uZ as Yg,p2 as Sb,DC as $b,gj as kb,g1 as xb,eU as Cb,cM as Pb,A4 as Rb,Lk as Tb,Cr as Ab,LC as Mb,y0 as Eb,ga as qb,fd as Lb,cL as Hb,cI as Ob,cH as Fb,vq as Db,xm as Nb,xk as Bb,cF as Wb,cE as Ub,z3 as zb,y_ as jb,xl as Gb}from"./BPo1GPk4.js";import{a as Uc}from"./CC7to1B5.js";import{aM as Vb,aL as Kb,bg as Qb,a7 as Jb,aD as Yb,aO as Xb,M as ff,a0 as vf,b8 as Zb,b2 as ey,as as Xg,P as bl,b0 as Zg,a$ as ep,a_ as tp}from"./CpIVKWwx.js";import{k as hf,F as ty,G as Cc,ar as ny,a_ as El,a8 as mf,Q as ry,aT as lc,ao as ay,aG as sy,B as oy,y as _f,r as iy,z as ly,u as dy,aY as cy,aE as wf,aD as bf,aF as uy,aJ as dc,aQ as np,aP as yl,aR as rp,P as ap,d as gy,e as py,av as fy,V as sp,aC as vy,c as hy,l as my,aS as op,an as _y,au as ip,a as wy,ay as by,ac as lp,aB as yy,aU as dp,aX as cp,m as up,ad as Iy,R as Sy,aw as gp,ak as $y,O as ky,aq as xy,h as Cy,p as Py,_ as cc,Z as Ry,aA as pp,a7 as Ty,f as Ay,i as My,a5 as Ey,ab as qy}from"./pIjvEfMB.js";import{f as Ly,o as Hy,E as Oy,C as Fy,m as Dy,a2 as fp,aa as Ny,K as By,e as Wy,y as Uy}from"./Q-Hp56ht.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as yf,O as If,W as zy,bv as jy,aF as Sf,dH as $f,aV as Eo,e8 as Gy,dw as kf,aw as zc,dV as jc,aO as xf,cP as Vy,V as ha,a3 as Xs,B as Ky,a7 as Qy,a4 as Jy,M as Yy,a6 as Xy,ar as Zy,aG as Cf,aP as ql,r as eI,n as Pc,H as tI,dY as nI,aR as rI,aK as aI,c9 as sI,aX as oI,bM as iI,bK as lI,bL as dI,c8 as cI,c7 as uI,cN as gI,cM as pI,aT as fI,bb as vI,bd as hI,bg as mI,bc as _I,bl as wI,bf as bI,be as yI,bh as II,bi as SI,bk as $I,bj as kI,ax as xI,ay as CI,cj as PI,ck as RI,dv as TI,du as AI,b0 as MI,G as EI,b4 as qI,cf as LI,C as vp,d0 as HI,ba as cs,b$ as OI,X as FI,bq as DI,E as NI,ad as BI,t as WI,cW as UI,d3 as hp,Q as mp,dt as zI,cQ as uc}from"./DkYquFOp.js";import{u as Pf,a as Il,ag as jI,x as GI,ad as Rf,af as VI,ac as Tf,a4 as KI,F as _p,D as QI,e as JI,n as YI,s as XI,m as ZI,Y as eS,k as tS}from"./Ydj2ePK_.js";import{a2 as nS,b5 as rS,cM as aS,a_ as sS,b4 as oS,c2 as iS,c9 as lS,w as dS,x as cS,cd as uS}from"./Cvp_IOBl.js";import{n as gS,P as Af,F as pS,ai as fS,r as vS,ac as hS}from"./PtMxuYy8.js";import{I as mS,s as _S,H as wp}from"./Bqd7fdCF.js";import{e as wS}from"./CL3a4Hm1.js";import{e as bS,f as yS}from"./C7hm9bSX.js";import{s as IS,o as Zs,b as SS,g as Nl,d as $S,l as bi}from"./CIyUrgF0.js";import{a5 as kS,a7 as xS,D as CS,N as PS,ac as bp,X as RS,i as TS,r as cr,v as Ri,u as na,p as ki,x as br,S as Gc,m as Gl,s as Ho,y as Ti,o as ro,n as ao,t as yp,aa as so,w as oo,a9 as Vc,q as _a,z as Oo,J as Rc,_ as Ip,g as AS,F as MS,U as Mf,I as Ef,a8 as qf,a6 as Ll,O as ES,E as Lf,V as qS,A as LS,b as HS,ab as OS,ad as Sl,G as FS,e as gc,l as DS,C as NS,f as Ys,j as Sp,H as us,Q as BS,d as $l,c as WS,a as $p,h as US,L as zS,Y as kp,a4 as pc,a1 as xp,a0 as jS,a3 as Cp,$ as Pp,T as GS,B as VS,k as KS,a2 as QS,K as JS,R as YS,P as XS,W as ZS}from"./CW7lfTzm.js";import{m as e$}from"./Dms_DO28.js";import{g as Hf}from"./CkrblKaH.js";import{b as t$}from"./BIwMjRQQ.js";import{g as n$}from"./BA7mfVzm.js";import{a as r$}from"./CClsvy7n.js";import{q as Of,d as ur,r as a$,e as Bl,j as s$,g as Tc,i as o$,f as Ac,c as i$,A as l$,O as Rp,k as d$}from"./sZBOVpM6.js";import{P as c$}from"./DpgIqMGp.js";import{e as u$}from"./CEqmtghP.js";import{b as g$,a as p$,g as f$,c as v$,i as h$}from"./DPF9_zKV.js";import{R as m$,g as _$,W as kl,c as w$}from"./CX4bqTrJ.js";import"./Ch-pFfsN.js";import"./IdqO6uHC.js";import{s as Ai}from"./Dmy603At.js";import{F as b$,h as y$}from"./BpT_ybtH.js";import"./CBLFNmYJ.js";import{C as I$,e as Br,L as S$,l as Vl,d as Kl,K as Ql,h as Kc,M as Jl,S as Da}from"./DHbv9I-C.js";import{D as $$}from"./Bv5YjDej.js";import{f as Tp}from"./nHwpsxWy.js";import"./DU3vNstz.js";import{i as Ff}from"./BjLb7AHW.js";import{h as Ap,i as Mp,g as Ep,P as qp,C as k$,m as Hl,R as x$}from"./D7vAVIvz.js";import{f as It,ae as C$}from"./DPbnmxjX.js";import{F as ft,bs as P$,cd as R$,aw as Na,a2 as Df,c9 as T$,bf as A$,be as M$,bg as E$,aO as Lp,aj as fc,aB as vc,bB as Nf,d3 as Wl,cF as q$,aM as Hp,cb as Op,cK as Ul,bu as L$,aS as H$,d0 as O$,a8 as Bf,ac as F$,ag as D$,cr as N$,ba as B$,aC as Wf,cT as Fp,cz as W$,ax as U$,cD as z$,c3 as j$}from"./BZytk_HL.js";import{c as Uf}from"./ChTqQfQN.js";import"./jUAybD8G.js";import{c as Rt}from"./DpSAF6fh.js";import{a5 as zf,bg as G$,ar as V$,k as K$,Y as Q$,W as J$,a2 as Y$,Z as X$,bw as Z$,V as ek,a1 as tk,ah as nk}from"./C_0xgdqY.js";import{d as zl,f as rk,e as ak}from"./BkmrZjpE.js";import{A as sk}from"./BcEldzTj.js";import{D as ok}from"./DVok8lSR.js";import"./Dzl5aoA8.js";import{a as ik,C as lk}from"./Ow3KARwj.js";import"./DYGC3eZn.js";import{C as dk}from"./CtguhKZB.js";import{h as Mc,r as ck,a as uk}from"./BpimY2Bn.js";import{s as gk}from"./CuAAvi1f.js";import{I as pk,a as jf}from"./xJBWkpxc.js";import{L as fk}from"./1wMLd-77.js";import{g as vk,f as hk,b as mk}from"./CMgAi196.js";import{s as Mi,g as Yn,i as _k,j as wk,e as Dp,r as Np,f as bk,d as yk,a as hc,h as Ik}from"./P27dN3C7.js";import{i as Bp,a as Sk}from"./Bu13V5mO.js";import{seekConversationToMessage as Wp}from"./BEv4fIdD.js";import{l as Kt,o as mc,h as Qc,n as Ec,q as $k}from"./CntPxeXh.js";import{o as kk}from"./D5raGlU7.js";import{A as Gf}from"./Bo5PTszQ.js";import{b as Vf}from"./Bek4Es60.js";import{g as xk,e as Kf,v as Ck,f as Pk,N as Rk,M as Tk,K as Ak,k as Qf,l as Mk,H as Jf,s as Yf}from"./B6Zf-ZTX.js";import{selectCurrentWorkspaceTabId as _c}from"./BblwdMxR.js";import{o as Ek}from"./B77YOXDU.js";import{d as qk}from"./B0Z-1lwJ.js";import{P as Lk}from"./wfSdTH77.js";import{g as Hk}from"./DzsC5hAQ.js";import{H as Xf,M as Ok,y as Fk,g as Dk,i as Nk,u as Bk,e as Zf,c as ev,d as Wk}from"./BtT-JO5g.js";import{c as Uk,h as Jc,f as tv,M as zk}from"./DM4cCUDd.js";import{t as jk}from"./DAsc1V4f.js";import{s as Gk}from"./BsieX9dN.js";import{i as nv}from"./B4wiFjXK.js";import{d as Vk,i as Kk,r as Qk}from"./C7Ibt0hX.js";import{g as Jk}from"./BYBN65Dm.js";var Yk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Xk=E("<div><!></div>");function rv(n,r){if(new.target)return ln({component:rv,...n});un(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),d=Z(r,"children",7),l=cf(r,Yk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return d()},set children(v){d(v),ee()},$set:dn,$on:(v,R)=>cn(r,v,R)},u=Xk();uf(u,v=>({"data-slot":"card-header",class:v,...l}),[()=>Wc("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",dk,i())]);var b=S(u);return Ai(b,()=>d()??fs),y(u),wr(u,v=>a(v),()=>a()),p(n,u),gn(f)}var Zk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ex=E("<div><!></div>");function av(n,r){if(new.target)return ln({component:av,...n});un(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),d=Z(r,"children",7),l=cf(r,Zk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return d()},set children(v){d(v),ee()},$set:dn,$on:(v,R)=>cn(r,v,R)},u=ex();uf(u,v=>({"data-slot":"card-title",class:v,...l}),[()=>Wc("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var b=S(u);return Ai(b,()=>d()??fs),y(u),wr(u,v=>a(v),()=>a()),p(n,u),gn(f)}const xl=mS.CHAT_MEDIA,wc=IS().min(1).max(512);Zs({workspaceId:wc,agentId:wc,draftId:Nl(),principalId:wc,media:SS(gS).min(1).max(20)}).strict();const tx=Zs({sessionId:Nl()}).strict();tx.extend({control:$S("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:bS}).strict(),Zs({action:bi("transcribe"),request:yS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Yc(n,r,a,i=async(d,l)=>typeof window>"u"||_S(window)!=="electron"?{ok:!1,error:"unavailable"}:wS().invoke(d,l)){let d=null,l=null,f=!1;async function u(){f=!0,a.removeEventListener("abort",b);const x=d;d=null,x&&await i(xl.CLOSE,{sessionId:x}).catch(()=>{})}const b=()=>{u()};a.addEventListener("abort",b,{once:!0});const v=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function R(){if(v(),d)return d;if(l)return l;l=(async()=>{const x=await i(xl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");d=x.value.sessionId;try{return v(),d}catch(F){throw await u(),F}})();try{return await l}finally{l=null}}async function I(x){const F=await R();v();const D=await i(xl.CONTROL,{sessionId:F,control:x});return v(),D}return{service:{exportMedia:x=>I({action:"export",request:x}),adoptMediaJob:x=>I({action:"adopt",jobId:x}),transcribeMedia:x=>I({action:"transcribe",request:x}),releaseMediaJob:async x=>d?await i(xl.CONTROL,{sessionId:d,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:u,readiness:()=>I({action:"readiness"})}}const bc=new Set;async function nx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),d=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:u}=i,b=Pi(O.state),v=Dl.select(O.state,f),R=yf.select(O.state),I=hf(),M=JSON.stringify([b,f,u]);if(!b||!v||!R||l.wsId!==f||bc.has(M))return!1;bc.add(M);const x=new AbortController,F=()=>x.abort();a.addEventListener("abort",F,{once:!0});const D=()=>!a.aborted&&!x.signal.aborted&&Pi(O.state)===b&&Dl.select(O.state,f)===v&&mf(I)&&r.isCurrentDraft(i),T=O.getReadableState().subscribe(()=>{D()||x.abort()});let H=null;try{if(!D()||nS(d))return!1;const V=Pf(i.attachments),oe=Af(pS(f,u),V,d.map(ce=>({contextItemId:ce.id,attachmentId:ce.attachmentId,path:ce.path}))),P=new Set([...oe.images,...oe.clips].map(ce=>ce.contextItemId));if(V.some(([ce])=>!P.has(ce))||oe.images.some(ce=>ce.mediaError)||oe.clips.some(ce=>ce.mediaError)||!fS(l.text,oe))throw new Error("invalid-evidence");if(H=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!D())return!1;const k=await Ly.agents.get(u,f);if(!D())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const J=oe.clips.flatMap(ce=>ce.media?[ce.media]:[]);J.length&&!H&&(H=Yc({workspaceId:f,agentId:u,draftId:crypto.randomUUID(),principalId:R.principal.id,media:J},D,x.signal));const ge=ty(d,oe),Te=Cc(ge),ve=await ny({workspaceId:f,agentId:u,evidence:oe,clickedItems:d,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:I,service:H?.service??null,current:D,onRecord:()=>{}});return!ve||!D()?!1:El(O,u,ve)}catch{return D()&&O.dispatch(aw(u,g.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",F),await H?.dispose(),bc.delete(M)}}const sv=1e4,Up={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function zp(n){return kS(n.messageMetadata)}function rx(n,r){if(n.some(zp)){const a=n[0];return a&&!zp(a)&&jp(a,r)?[a.id]:[]}return n.filter(a=>jp(a,r)).map(a=>a.id)}function ax(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function jp(n,r){return!n.requeuedAfterFailure&&xS(n,r)}function sx(n,r){const{busy:a,queue:i,delivered:d,now:l}=r,f=r.blocked||r.interrupted,u=r.timeoutMs??sv;let b=n.prediction;if(b){const x=new Set(i.map(H=>H.id)),F=b.ids.filter(H=>x.has(H)&&!d.has(H)),D=l-b.startedAt>=u,T=n.wasBusy&&!a;!F.length||D||f&&!a||T?b=null:F.length!==b.ids.length&&(b={...b,ids:F})}const v=n.wasBusy&&!a,R=n.wasBusy?n.busySince:a?l:null,I=n.wasBusy&&n.preempted||R!==null&&r.directSendAt!==null&&r.directSendAt>R;if(!b&&v&&!f&&!I){const x=rx(i,l).filter(F=>!d.has(F));x.length&&(b={ids:x,startedAt:l})}const M={wasBusy:a,busySince:a?R:null,preempted:a&&I,prediction:b};return n.wasBusy===M.wasBusy&&n.busySince===M.busySince&&n.preempted===M.preempted&&n.prediction===M.prediction?n:M}class ox{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let d;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{d=setTimeout(()=>f(!0),i)})]);if(clearTimeout(d),l)return!1}return!0}}function ix(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Gp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var lx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function ov(n,r){if(new.target)return ln({component:ov,...n});un(r,!0);const a=()=>pe(R,"$typing$",i),[i,d]=Ur();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),u=Z(r,"class",7,"");const b=Bn(""),v=Bn("");ie(()=>{b.set(l())}),ie(()=>{v.set(f())});const R=rS(b,v),I=o(()=>u$(a()));var M={get workspaceId(){return l()},set workspaceId(H){l(H),ee()},get agentId(){return f()},set agentId(H){f(H),ee()},get class(){return u()},set class(H=""){u(H),ee()},$set:dn,$on:(H,V)=>cn(r,H,V)},x=Ot(),F=ye(x);{var D=H=>{var V=lx(),oe=S(V),P=S(oe);c$(P,{get people(){return a()},size:12,decorative:!0}),y(oe);var k=_(oe,2),J=de(k,!0);vn(2),y(V),q(()=>{ke(V,1,`${Of} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${u()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(J,e(I))}),p(H,V)};N(F,H=>{e(I)&&H(D)})}p(n,x);var T=gn(M);return d(),T}const dx=50,cx=5e3,ux=500,gx=()=>({authority:()=>Pi(O.state),persistSnapshot:ay,dispatch:n=>O.dispatch(n),ownerView:n=>sy.withStore(O)(n)});function px(n){const r=n.store??gx(),a=crypto.randomUUID();let i=he(!1),d=he(!1),l=he(!1),f=null,u=null,b=0,v=!1,R=null,I=null,M=null,x=0,F=null,D=null;const T={};let H,V=he([]),oe=null,P=0,k="",J=0,ge="";const Te=()=>{const B=n.workspaceId(),C=n.agentId();if(!B||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||v)return null;const Me=n.inputValue(),L=ce(),X=H?.shared,Y=X?.workspaceId===B&&X.agentId===C?X.lifetime:null,be=JSON.stringify([re,B,C,x,Y,L.map(z=>[z.id,z.attachmentId,z.path])]);be!==ge&&(ge=be,J+=1);const De=JSON.stringify([re,B,C,Me,L,x]);return De!==k&&(k=De,P+=1),{authority:re,ownerId:a,workspaceId:B,agentId:C,text:Me,attachments:JSON.parse(JSON.stringify(L)),generation:P,attachmentEpoch:J}};let ve=null;const ce=()=>jI(n.contextItems(),GI(n.contextItems(),e(V))),we=B=>{if(H=B,!B||v)return;const C=B.restore;if(D&&C?.requestId===D.requestId&&C.status!=="pending"){const{apply:L}=D;D=null,w(d,!1),C.status==="restored"&&w(V,C.draft?.attachments??[]),L(C)}const re=B.shared;if(re&&!e(d)&&u===`${re.workspaceId}\0${re.agentId}`){const L=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(oe!==L){oe=L;const X=ve??f,Y=X&&n.inputValue()===X.text&&JSON.stringify(ce())===X.attachmentsJson;re.origin===a?ve={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:Y&&(b+=1,M&&clearTimeout(M),w(V,re.snapshot.attachments),ve=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(V))),n.applyEditorContent(re.snapshot.text))}}dt(Te);const Me=[];for(const L of B.saves){if(L.status==="pending")continue;Me.push(L.id);const X=T[L.id];delete T[L.id],X?.(L)}Me.length>0&&queueMicrotask(()=>r.dispatch(lw(a,Me)))},ne=(B,C,re)=>{const Me=crypto.randomUUID();D={requestId:Me,apply:re},w(d,!0),r.dispatch(cw(a,Me,B,C))},te=()=>{D&&(D=null,w(d,!1),r.dispatch(gw(a)))},Be=()=>{const B=F;B&&(F=null,r.dispatch(uw(a)),H?.saves.some(C=>C.id===B)||delete T[B])};r.dispatch(sw(a));const se=r.ownerView(a).subscribe(B=>dt(()=>we(B))),me=()=>{I&&(clearTimeout(I),I=null),w(l,!1)},Ee=()=>{F&&(F=null,r.dispatch(dw(a)))};ie(()=>{const B=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!B){dt(()=>{b+=1,u=null,te(),R&&clearTimeout(R),R=null,me(),M&&clearTimeout(M),M=null,w(i,!1),Ee()});return}if(!C||!re)return;const Me=`${C}\0${re}`;if(u===Me)return;const L=u!==null;u=Me;const X=++b;dt(()=>{f=null,ve=null,oe=null,w(V,[]),R&&clearTimeout(R),me(),M&&(clearTimeout(M),M=null),L&&(Ee(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const Y=ry(C,re);if(Y){w(V,Y.attachments),w(i,!1);const De=n.contextItems().length>0,z=Y.text,Ie=JSON.stringify(Y.attachments);n.setInputValue(Y.text),De||n.setContextItems(Il(Y.attachments)),n.applyEditorContent(Y.text),f={text:Y.text,attachmentsJson:Ie},ne(C,re,Ce=>{if(Ce.status!=="restored")return;const He=Ce.draft;if(v||!(n.active?.()??!0)||u!==Me||b!==X)return;const st=He?.text??"",Je=He?.attachments??[],Oe=JSON.stringify(Je);lc(C,re,{text:st,attachments:Je});const Pe=n.inputValue()===z&&JSON.stringify(ce())===Ie;De||!Pe||(st!==z&&(n.setInputValue(st),n.applyEditorContent(st)),Oe!==Ie&&n.setContextItems(Il(Je)),f={text:st,attachmentsJson:Oe})});return}w(i,!0),I=setTimeout(()=>{I=null,(n.active?.()??!0)&&w(l,!0)},ux),R=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),me())},cx);const be=()=>{!(n.active?.()??!0)||u!==Me||b!==X||(R&&clearTimeout(R),w(i,!1),me())};ne(C,re,De=>{if(De.status!=="restored"){be();return}const z=De.draft;if(v||!(n.active?.()??!0)||u!==Me||b!==X)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),M=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},dx)),f===null){const Ce=z?.text??"",He=z?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(He)},lc(C,re,{text:Ce,attachments:He})}be()})})}),ie(()=>{const B=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Me=e(i);if(!B){dt(Be);return}if(!C||!re)return;const L=n.inputValue(),X=ce();if(dt(Te),dt(Be),Me||f===null&&!L&&X.length===0)return;const Y=JSON.stringify(X);if(f!==null&&f.text===L&&f.attachmentsJson===Y)return;JSON.stringify(e(V))!==Y&&w(V,X);const be=`${C}\0${re}`,De=x,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){u===be&&x===De&&(f={text:L,attachmentsJson:Y});return}n.onSaveError?.(new Error(Ie.error))}},dt(()=>{F=z,r.dispatch(ow(a,z,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:L,attachments:X,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),ie(()=>()=>{v=!0,R&&clearTimeout(R),I&&clearTimeout(I),M&&clearTimeout(M),Ee(),se(),r.dispatch(iw(a))});const qe=B=>{const C=Te();return C!==null&&C.authority===B.authority&&C.ownerId===B.ownerId&&C.workspaceId===B.workspaceId&&C.agentId===B.agentId&&C.generation===B.generation&&C.text===B.text&&JSON.stringify(C.attachments)===JSON.stringify(B.attachments)};return{captureDraft:Te,isCurrentDraft:qe,updateAttachmentScreen(B,C,re){return!qe(B)||!B.attachments.some(Me=>Me.id===C)?null:(w(V,B.attachments.map(Me=>Me.id===C?{...Me,screen:structuredClone(re)}:Me)),Te())},async flushDraft(B){if(!qe(B))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,B.workspaceId,B.agentId,B,B.authority),qe(B)},get restorePending(){return e(d)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(b+=1,x+=1,te(),R&&(clearTimeout(R),R=null),M&&(clearTimeout(M),M=null),w(i,!1),me(),Be(),u!==null){const[B,C]=u.split("\0");lc(B,C,{text:"",attachments:[]}),ve=null,w(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=Af(JSON.stringify([n.workspaceId,n.agentId]),Pf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(d=>d.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function fx(n,r,a){const i=O.state.principal.snapshot,d=()=>Pi(O.state)===n.authority&&a.isCurrentDraft(n);if(!i||!d()||!await a.flushDraft(n)||!d())return{ready:!1};const l=new AbortController,f=Yc({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},d,l.signal);try{const u=await f.readiness();return!d()||!u.ok?{ready:!1}:u.value.find(b=>b.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Vp(n){let r=he(null),a=he(!1),i=he(!1),d=null,l=!0,f=0,u=null;Es(()=>{l=!1,f++}),ie(()=>{const I=n.capture();e(r)&&(!I||I.authority!==e(r).capture.authority||I.ownerId!==e(r).capture.ownerId||I.workspaceId!==e(r).capture.workspaceId||I.agentId!==e(r).capture.agentId||I.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function b(I){if(n.disabled()||e(a))return;const M=n.drafts.captureDraft(),x=Ei(M),F=x?.clips.find(V=>V.contextItemId===I);if(!M||!F?.media||!x)return;const D=oy({workspaceId:M.workspaceId,agentId:M.agentId,clip:F,evidence:x,marks:x.marks}),T=_f(M.workspaceId,F.path);if(!D||!T)return;const H=++f;d=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||f!==H||!n.drafts.isCurrentDraft(M))return;const V=await(n.prepareOutput??fx)(M,F.media,n.drafts);if(!l||f!==H||!n.drafts.isCurrentDraft(M))return;const{attachmentPath:oe,...P}=D;w(r,{capture:M,contextItemId:I,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===H&&w(i,!0)}finally{l&&f===H&&w(a,!1)}}async function v(I){const M=crypto.randomUUID(),x=e(r),F=n.drafts.captureDraft();if(!x||!F||F.authority!==x.capture.authority||F.ownerId!==x.capture.ownerId||F.workspaceId!==x.capture.workspaceId||F.agentId!==x.capture.agentId||F.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:M,result:"stale-source"};const D=Ei(F),T=D?.clips.find(J=>J.contextItemId===x.contextItemId);if(!D||!T?.media)return{requestId:M,result:"stale-source"};const V=u?.openId===x.snapshot.openId&&u.inputRevision===I.revision&&JSON.stringify(u.media)===JSON.stringify(T.media)?{...I,revision:T.media.saved?.revision??0}:I,oe=vS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:F.workspaceId,agentId:F.agentId},sourceId:I.sourceId,sourceRevision:I.sourceRevision,expectedEditRevision:V.revision,edit:V});if(oe.status!=="saved")return{requestId:M,result:oe.status==="invalid-edit"?"failed":oe.status};const P=hS({...D,clips:D.clips.map(J=>J.id===T.id?{...J,media:oe.media}:J)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(F,x.contextItemId,P);if(!k)return{requestId:M,result:"stale-source"};u={openId:x.snapshot.openId,media:oe.media,inputRevision:I.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:M,result:"stale-source"};await n.drafts.flushDraft(k);const J=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!J||J.attachmentEpoch!==x.capture.attachmentEpoch||J.authority!==k.authority||J.ownerId!==k.ownerId||J.workspaceId!==k.workspaceId||J.agentId!==k.agentId||JSON.stringify(J.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:M,result:"stale-source"}:(u=null,{requestId:M,result:"saved",saved:oe.media.saved??void 0})}catch{return{requestId:M,result:"failed"}}}function R(I){return n.disabled()||!n.onRemove(I)?!1:(e(r)?.contextItemId===I&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:b,save:v,remove:R,close(){w(r,null)},restoreFocus(){d?.isConnected&&d.focus()}}}var vx=E('<p role="alert"> </p>'),hx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),mx=E("<!> <!> <!>",1);function iv(n,r){if(new.target)return ln({component:iv,...n});un(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),d=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Vp),u=Z(r,"beforeOpen",7),b=Z(r,"onReviewChange",7);const v=dt(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>d(),onRemove:P=>l()(P),beforeOpen:()=>u()?.()??Promise.resolve()}));ie(()=>{const P=v.opening,k=v.session;dt(()=>b()?.(P,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const R=o(iy),I=o(()=>Ei(a())),M=o(()=>e(I)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Tp(P.durationMs),recording:!1,url:a()?_f(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:ly(P.media.saved)}:{}}))??[]);let x=he(null);var F={get capture(){return a()},set capture(P){a(P),ee()},get drafts(){return i()},set drafts(P){i(P),ee()},get disabled(){return d()},set disabled(P=!1){d(P),ee()},get onRemove(){return l()},set onRemove(P){l(P),ee()},get controllerFactory(){return f()},set controllerFactory(P=Vp){f(P),ee()},get beforeOpen(){return u()},set beforeOpen(P){u(P),ee()},get onReviewChange(){return b()},set onReviewChange(P){b(P),ee()},$set:dn,$on:(P,k)=>cn(r,P,k)},D=mx(),T=ye(D);{let P=o(()=>d()||v.opening);CS(T,{get items(){return e(M)},get labels(){return e(R)},get disabled(){return e(P)},onEdit:k=>void v.open(k),onMarkUp:k=>void v.open(k),get onRemove(){return v.remove}})}var H=_(T,2);{var V=P=>{var k=vx(),J=de(k,!0);q(ge=>j(J,ge),[()=>g.dock_captureEditor_saveFailed_label()]),p(P,k)};N(H,P=>{v.problem&&P(V)})}var oe=_(H,2);{let P=o(()=>!!v.session),k=o(()=>g.dock_captureEditor_recording_title({duration:v.session?Tp(v.session.snapshot.durationMs??0):""}));I$(oe,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>v.close(),onCloseAutoFocus:J=>{J.preventDefault(),v.restoreFocus()},get contentRef(){return e(x)},set contentRef(J){w(x,J,!0)},children:(J,ge)=>{var Te=Ot(),ve=ye(Te);{var ce=we=>{var ne=Ot(),te=ye(ne);xi(te,()=>v.session.snapshot.openId,Be=>{var se=hx(),me=S(se);$$(me,{get snapshot(){return v.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>v.close(),get onSave(){return v.save},onDelete:async()=>!!v.session&&v.remove(v.session.contextItemId)}),y(se),p(Be,se)}),p(we,ne)};N(ve,we=>{v.session&&we(ce)})}p(J,Te)},$$slots:{default:!0}})}return p(n,D),gn(F)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function _x(n){let r=he(!1),a=he(!1),i=he(null),d=!1,l=0,f=null,u=null;async function b(I){I.abort.abort(),I.slot?.cancel(),await I.native?.dispose()}async function v(){l++;const I=u;u=null,I&&await b(I)}no(()=>{const I=()=>{w(r,document.hasFocus(),!0)};return I(),window.addEventListener("focus",I),window.addEventListener("blur",I),()=>{window.removeEventListener("focus",I),window.removeEventListener("blur",I)}});const R=O.getReadableState().subscribe(()=>{u&&!u.current()&&v()});return Es(()=>{d=!0,R(),v()}),ie(()=>{const I=n.capture(),M=I?Cl(I):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===M);dt(()=>{if(!x||!I){v();return}if(u?.key===M)return;if(f===M){v();return}v();const D=Ei(I)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=D[0],H=O.state.principal.snapshot,V=Dl.select(O.state,I.workspaceId);if(!T||!H||!V||n.drafts.gateActive)return;const oe=hf(),P=new AbortController,k=()=>!d&&!P.signal.aborted&&Pi(O.state)===I.authority&&Dl.select(O.state,I.workspaceId)===V&&mf(oe)&&!!n.capture()&&Cl(n.capture())===M,J={key:M,capture:I,abort:P,native:null,slot:null,current:k};u=J;const ge=l;n.drafts.flushDraft(I).then(async Te=>{if(!(u!==J||ge!==l||!k())){if(!Te){f=M,await v();return}J.native=Yc({workspaceId:I.workspaceId,agentId:I.agentId,draftId:crypto.randomUUID(),principalId:H.principal.id,media:structuredClone(D)},k,P.signal),J.slot=dy(J.native.service),f=M,J.slot.warm(M,T,k)}}).catch(()=>{u===J&&v()})})}),{cancel:v,async beforeEditorOpen(){w(a,!0),f=null,await v()},editorState(I,M){w(a,I,!0);const x=M?Cl(M.capture):null;M&&e(i)?.openId!==M.openId&&(f=null),w(i,M&&x?{openId:M.openId,key:x}:null)},take(I,M){const x=u;if(!x?.native||!x.slot||x.key!==Cl(I)||!x.current())return v(),null;u=null,l++;const F=x.native,D=x.slot,T=()=>x.abort.abort();return M.addEventListener("abort",T,{once:!0}),M.aborted&&T(),{service:{...F.service,takePreparedRecording:H=>D.take(x.key,H,()=>!M.aborted&&x.current())},async dispose(){M.removeEventListener("abort",T),await b(x)}}}}}var wx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function lv(n,r){if(new.target)return ln({component:lv,...n});un(r,!1);var a={$set:dn,$on:(f,u)=>cn(r,f,u)};Ff();var i=wx(),d=S(i),l=de(d,!0);return y(i),q(f=>j(l,f),[()=>g.chat_draftGate_loading_label()]),p(n,i),gn(a)}var bx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function qc(n,r){if(new.target)return ln({component:qc,...n});un(r,!1);var a={$set:dn,$on:(f,u)=>cn(r,f,u)};Ff();var i=bx(),d=_(S(i),2),l=de(d,!0);return vn(2),y(i),q((f,u)=>{Ne(i,"aria-label",f),j(l,u)},[()=>g.chat_newMessagesDivider_label(),()=>g.chat_newMessagesDivider_label()]),p(n,i),gn(a)}function yx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Ix(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Sx(n,r){return r&&n.includes(r)?r:null}function Kp(n,r,a){return r-n<=a}const $x=.2;function Qp(n,r,a){const i=Math.max(0,a-r),d=n-$x*r;return Math.min(Math.max(0,d),i)}function kx(n,r,a){return n!==null&&a&&n===r}function xx(n){return n?pw(n)&&fw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Cx(n){const r=[],a=new Set;let i,d;for(const H of n.messages){if(H.agentId&&H.agentId!==n.agentId){i=void 0,d=void 0;continue}if(a.has(H.id))continue;a.add(H.id),n.breakBeforeMessageIds?.has(H.id)&&(i=void 0,d=void 0);const V=PS(H);if(V?.kind!=="turn-failure")d=void 0;else{const oe=i?.seq!==void 0&&H.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(H.seq)&&H.seq===i.seq+1;(!d||!oe)&&(d={key:JSON.stringify([n.agentId,"notice",H.id]),anchorMessageId:H.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(d)),d.records.push({messageId:H.id,reason:V.reason,timestamp:H.timestamp}),d.recordedFailureCount+=1}i=H}const l=new Map;for(const H of n.queue){if(!H.requeuedAfterFailure)continue;const V=H.turnId||void 0,oe=JSON.stringify([n.agentId,V?"turn":"queue",V??H.id]);let P=l.get(oe);P||(P={key:oe,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(oe,P)),P.queueIds.includes(H.id)||P.queueIds.push(H.id)}const f=[...l.values()],u=n.session?.id===n.agentId?n.session:void 0,b=u?.status===$i.Error,v=n.transientError||b&&u.stopReason||null,R=b&&!v,I=b&&(!n.transientError||n.transientError===u.stopReason)?u.stopReasonTimestamp:void 0,M=I?bp(I):null,x=M&&v&&v===u?.stopReason?r.flatMap(H=>H.records).filter(H=>H.reason===v&&bp(H.timestamp)===M):[],F=x.length===1?x[0].messageId:void 0,T=(u?If(u):!1)?"attempting":f.length?"queued":v||R?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:v,needsFallbackReason:R,timestamp:I,noticeId:F}}}function Px(n,r){const a=n.hiddenTail[0]?.id,i=Cx({...r,messages:[...n.groups.flatMap(u=>u.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),d=i.current.noticeId,l=i.history.map(u=>({...u,records:u.records.filter(b=>b.messageId!==d)})).filter(u=>u.records.length>0),f=new Set(l.map(u=>u.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(u=>[u.records[0].messageId,u])),collapsedMessageIds:new Set(i.history.flatMap(u=>u.records.map(b=>b.messageId).filter(b=>!f.has(b))))}}var Rx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Tx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Ax=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Mx=E('<div class="mb-5"><!></div>'),Ex=E('<p data-testid="agent-welcome-description"> </p> <!>',1),qx=E("<!> <!>",1),Lx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Hx=E("<!> <span> </span>",1),Ox=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function dv(n,r){if(new.target)return ln({component:dv,...n});un(r,!0);const a=()=>pe(x,"$userOverrides$",f),i=()=>pe(M,"$specialists$",f),d=()=>pe(H,"$isGitHubAuth$",f),l=()=>pe(V,"$recentSpecialistIds$",f),[f,u]=Ur();let b=Z(r,"onSpecialistChange",7),v=Z(r,"session",7),R=Z(r,"workspaceId",7);const I=Bn(R()??"");ie(()=>I.set(R()??""));const M=zf(I),x=G$();ie(()=>{a()});const F=o(()=>{if(!v()||zy(v()))return null;const B=v().metadata?.specialist||v().agentMetadata?.specialist;return B&&i().find(C=>C.id===B)||null});async function D(B){B?await zl({specialist:B,hash:"specialists"}):await zl({view:"create-specialist"})}let T=he(!1);const H=V$(),V=aS(),oe=o(()=>vw(K$(i(),d()),l()));let P=he(!1);const k=o(()=>g.chat_regularAgentWelcome_generalDescription_label()),J=o(()=>e(F)?.name??g.chat_shared_general_fallback()),ge=o(()=>e(F)?.description??g.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(F)?e(F).defaultBehaviorPrompt||"":e(k));var ve={get onSpecialistChange(){return b()},set onSpecialistChange(B){b(B),ee()},get session(){return v()},set session(B){v(B),ee()},get workspaceId(){return R()},set workspaceId(B){R(B),ee()},$set:dn,$on:(B,C)=>cn(r,B,C)},ce=Ox(),we=S(ce);{var ne=B=>{var C=Mx(),re=S(C);ok(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(X){w(P,X,!0)},trigger:(X,Y)=>{let be=()=>(Y?.()).props;{let De=o(()=>Wc("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));It(X,qi(be,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(De)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Rx(),He=ye(Ce),st=S(He);{let Se=o(()=>e(F)?.id??null),Ae=o(()=>e(F)?.icon??null);sk(st,{agentId:"blank",variant:"emphasized",get specialist(){return e(Se)},get icon(){return e(Ae)}})}y(He);var Je=_(He,2),Oe=S(Je),Pe=de(Oe,!0),G=_(Oe,2),ae=de(G,!0);y(Je);var Le=_(Je,2),Q=S(Le);ft(Q,{get icon(){return Na},size:10}),y(Le),q(()=>{j(Pe,e(J)),j(ae,e(ge))}),p(z,Ce)},$$slots:{default:!0}}))}},content:X=>{var Y=Ax(),be=S(Y),De=S(be),z=de(De,!0),Ie=_(De,2),Ce=de(Ie,!0);y(be);var He=_(be,2),st=S(He);{let Pe=o(()=>e(F)?.id??null);V_(st,{get specialists(){return e(oe)},get value(){return e(Pe)},onchange:G=>{w(P,!1),b()?.(G)}})}y(He);var Je=_(He,2),Oe=S(Je);Rt(Oe,()=>Br,(Pe,G)=>{G(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(P,!1),D()},children:(ae,Le)=>{var Q=Tx(),Se=ye(Q),Ae=S(Se);ft(Ae,{get icon(){return R$},size:12}),y(Se);var ze=_(Se,2),Ge=de(ze,!0);q(We=>j(Ge,We),[()=>g.chat_regularAgentWelcome_createSpecialist_label()]),p(ae,Q)},$$slots:{default:!0}})}),y(Je),y(Y),q((Pe,G)=>{j(z,Pe),j(Ce,G)},[()=>g.workspace_createAgentSection_specialists_label(),()=>g.workspace_createAgentSection_specialists_description()]),p(X,Y)},$$slots:{trigger:!0,content:!0}}),y(C),p(B,C)};N(we,B=>{b()&&B(ne)})}var te=_(we,2);{var Be=B=>{var C=Ot(),re=ye(C);{let Me=o(()=>g.chat_specialistSelector_prompt_label());Rt(re,()=>lk,(L,X)=>{X(L,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(Y,be)=>{var De=qx(),z=ye(De);Rt(z,()=>rv,(Ce,He)=>{He(Ce,{children:(st,Je)=>{var Oe=Ot(),Pe=ye(Oe);Rt(Pe,()=>av,(G,ae)=>{ae(G,{class:"type-caption font-medium",children:(Le,Q)=>{vn();var Se=on();q(Ae=>j(Se,Ae),[()=>g.chat_specialistSelector_prompt_label()]),p(Le,Se)},$$slots:{default:!0}})}),p(st,Oe)},$$slots:{default:!0}})});var Ie=_(z,2);Rt(Ie,()=>ik,(Ce,He)=>{He(Ce,{children:(st,Je)=>{var Oe=Ex(),Pe=ye(Oe),G=de(Pe,!0),ae=_(Pe,2);It(ae,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Le,Q)=>{vn();var Se=on();q(Ae=>j(Se,Ae),[()=>e(T)?g.chat_regularAgentWelcome_showLess_label():g.chat_regularAgentWelcome_showMore_label()]),p(Le,Se)},$$slots:{default:!0}}),q(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Te))}),p(st,Oe)},$$slots:{default:!0}})}),p(Y,De)},$$slots:{default:!0}})})}p(B,C)},se=B=>{var C=Lx(),re=de(C,!0);q(()=>j(re,e(Te))),p(B,C)};N(te,B=>{e(F)?B(Be):B(se,-1)})}var me=_(te,2);{var Ee=B=>{It(B,{variant:"ghost-light",size:"sm",onclick:()=>D(e(F).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Me=Hx(),L=ye(Me);ft(L,{get icon(){return P$},size:12,class:"opacity-60"});var X=_(L,2),Y=de(X,!0);q(be=>j(Y,be),[()=>g.chat_regularAgentWelcome_customize_label()]),p(C,Me)},$$slots:{default:!0}})};N(me,B=>{e(F)&&B(Ee)})}y(ce),p(n,ce);var qe=gn(ve);return u(),qe}var Fx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Dx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Nx=E('<span class="type-caption"> </span>'),Bx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Wx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Xc(n,r){if(new.target)return ln({component:Xc,...n});un(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),d=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),u=Z(r,"reserveShortcutHintSpace",7,!1),b=Z(r,"workspaceId",7);const R=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",I=s$.replace("text-ui","type-caption");function M(k){i()(k)}function x(k,J){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),M(J))}function F(k,J){k.preventDefault(),k.stopPropagation(),Mc(J,{workspaceId:b(),event:k})}function D(k,J){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Mc(J,{workspaceId:b(),event:k}))}function T(k){return k<3}var H={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return d()},set onEdit(k){d(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return u()},set reserveShortcutHintSpace(k=!1){u(k),ee()},get workspaceId(){return b()},set workspaceId(k){b(k),ee()},$set:dn,$on:(k,J)=>cn(r,k,J)},V=Ot(),oe=ye(V);{var P=k=>{var J=Wx(),ge=S(J);{const Te=(ce,we)=>{let ne=()=>(we?.()).item,te=()=>(we?.()).index;const Be=o(()=>Qb(ne())),se=o(()=>e(Be)[0]?.type==="text"?e(Be)[0].content:"");var me=Bx(),Ee=S(me),qe=S(Ee);ft(qe,{get icon(){return Df},size:16,get class(){return ur}}),y(Ee);var B=_(Ee,2),C=S(B),re=de(C,!0),Me=_(C);Dn(Me,17,()=>e(Be).slice(e(se)?1:0),z_,(z,Ie)=>{var Ce=Ot(),He=ye(Ce);{var st=Oe=>{const Pe=o(()=>Kb(e(Ie).url));var G=Fx(),ae=de(G,!0);q(()=>{Ne(G,"href",e(Pe)),Ne(G,"title",e(Pe)),j(ae,e(Ie).label)}),ps("click",G,Le=>F(Le,e(Pe))),ps("keydown",G,Le=>D(Le,e(Pe))),p(Oe,G)},Je=Oe=>{var Pe=on();q(()=>j(Pe,e(Ie).content)),p(Oe,Pe)};N(He,Oe=>{e(Ie).type==="link"?Oe(st):Oe(Je,-1)})}p(z,Ce)}),y(B);var L=_(B,2);{var X=z=>{var Ie=Dx();let Ce;var He=de(Ie);q(()=>{Ce=ke(Ie,1,`${I??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),Ne(Ie,"aria-hidden",f()?void 0:"true"),Ne(Ie,"data-hint-visible",f()),j(He,`${R}${te()+1}`)}),p(z,Ie)},Y=o(()=>T(te())&&(f()||u()));N(L,z=>{e(Y)&&z(X)})}var be=_(L,2);{var De=z=>{C$(z,{side:"top",delayDuration:300,trigger:He=>{{let st=o(()=>g.chat_suggestedPrompts_editInInput_ariaLabel());It(He,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Je=>{Je.stopPropagation(),d()(ne())},get"aria-label"(){return e(st)},children:(Je,Oe)=>{ft(Je,{get icon(){return T$},size:"xs"})},$$slots:{default:!0}})}},content:He=>{var st=Nx(),Je=de(st,!0);q(Oe=>j(Je,Oe),[()=>g.chat_suggestedPrompts_edit_tooltip()]),p(He,st)},$$slots:{trigger:!0,content:!0}})};N(be,z=>{d()&&z(De)})}y(me),q(z=>{ke(me,1,`${Of} ${a$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Ee,1,`${Bl??""} mt-px self-start`),Ne(C,"aria-label",z),j(re,e(se))},[()=>Vb(ne())]),ps("click",C,z=>{z.stopPropagation(),M(ne())}),ps("keydown",C,z=>x(z,ne())),p(ce,me)};let ve=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");S$(ge,{get items(){return a()},virtualize:!1,onActivate:M,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(ve)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}y(J),Lt(1,J,()=>ma,()=>({tier:"fast",y:0,scale:1})),Lt(2,J,()=>eo,()=>({tier:"fast"})),p(k,J)};N(oe,k=>{a().length>0&&k(P)})}return p(n,V),gn(H)}Bc(["click","keydown"]);var Ux=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function cv(n,r){if(new.target)return ln({component:cv,...n});un(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const d=o(()=>[{label:g.chat_chiefEmptyState_assignedPrs_label(),prompt:g.chat_chiefEmptyState_assignedPrs_prompt()},{label:g.chat_chiefEmptyState_staleWorkspaces_label(),prompt:g.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:g.chat_chiefEmptyState_agentPerformance_label(),prompt:g.chat_chiefEmptyState_agentPerformance_prompt()},{label:g.chat_chiefEmptyState_morningBrief_label(),prompt:g.chat_chiefEmptyState_morningBrief_prompt()},{label:g.chat_chiefEmptyState_randomTheme_label(),prompt:g.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(d).map(M=>M.label));function f(M){const x=e(d).find(F=>F.label===M);x&&a()(x.prompt)}var u={get onSelect(){return a()},set onSelect(M){a(M),ee()},get compact(){return i()},set compact(M=!1){i(M),ee()},$set:dn,$on:(M,x)=>cn(r,M,x)},b=Ux(),v=S(b),R=de(v,!0),I=_(v,2);return Xc(I,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),y(b),q(M=>j(R,M),[()=>g.chat_chiefEmptyState_intro_label()]),p(n,b),gn(u)}const Zc=2e3,zx=4e3,jx=zx-Zc-2;function Gx(n,r=Zc){const a=[];let i=0;for(let d=n.length-1;d>=0&&i<r;d-=1){const l=n[d];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(b=>b.type==="text").map(b=>b.text||b.content||"").join(""),u=(l.role==="assistant"?K_(f).cleanedContent:f).trim();u&&(a.unshift({role:l.role,text:u}),i+=u.length)}return a}function Vx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
2
2
 
3
3
  `).slice(-Zc),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const d=`Suggested prompts:
4
4
  ${i.map(l=>`- ${l}`).join(`
@@ -1 +1 @@
1
- var Vt=Object.defineProperty;var yt=e=>{throw TypeError(e)};var jt=(e,i,s)=>i in e?Vt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s;var J=(e,i,s)=>jt(e,typeof i!="symbol"?i+"":i,s),bt=(e,i,s)=>i.has(e)||yt("Cannot "+s);var t=(e,i,s)=>(bt(e,i,"read from private field"),s?s.call(e):i.get(e)),g=(e,i,s)=>i.has(e)?yt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,s),a=(e,i,s,n)=>(bt(e,i,"write to private field"),n?n.call(e,s):i.set(e,s),s),o=(e,i,s)=>(bt(e,i,"access private method"),s);var vt=(e,i,s,n)=>({set _(r){a(e,i,r,s)},get _(){return t(e,i,n)}});import{_ as wt}from"./1KDVFF23.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./QSHJFaU7.js";import{B as Ft,D as Kt}from"./CwQIGTQ1.js";import{I as F,E as Ct,b as Qt,a as Ut}from"./DICr2Lvd.js";function Xt(e,i){for(const s of Array.isArray(e)?e:[e]){let n=xt.get(s.name);n==null&&(n=s,xt.set(s.name,n)),i.attachLanguages([n]),qt.add(n.name)}}function Zt(e,i){let s;return function(...n){clearTimeout(s),s=setTimeout(()=>e.apply(this,n),i)}}const Dt=0;let Wt=0;var H,T,P,Q,L,st,it,C,U,nt,u,D,_,A,O,b,v,z,dt,E,B,X,N,R,Z,Tt,ft,h,K,ut,zt,Et,Y,pt,It,ct,tt,Ot,gt,et,Bt,Pt,At,Yt=(At=class{constructor(e,i,s){g(this,h);J(this,"backend");g(this,H);g(this,T);g(this,P);g(this,Q);g(this,L);g(this,st);g(this,it);g(this,C);g(this,U);g(this,nt,!1);g(this,u,[F]);g(this,D,[]);g(this,_,0);g(this,A,[]);g(this,O,-1);g(this,b,!0);g(this,v,!1);g(this,z,0);g(this,dt,++Wt);g(this,E,-1);g(this,B,-1);g(this,X);g(this,N,0);g(this,R,[]);g(this,Z,!1);g(this,Tt,Zt(async e=>{if(t(this,nt))return;const{startingLine:i=0,totalLines:s=1/0}=e??{},n=Math.min(s===1/0?1/0:i+s,t(this,L).lineCount);if(t(this,T)==null&&!Lt(t(this,L).languageId)){if(await this.backend?.loadLanguages([t(this,L).languageId]),t(this,nt))return;a(this,T,t(this,H).getLanguage(t(this,L).languageId))}o(this,h,K).call(this),o(this,h,It).call(this,n)},500));g(this,ft,({data:e})=>{if(typeof e!="object"||e===null)return;const{type:i,tokenizerId:s,jobId:n}=e;i==="tokenize"&&s===t(this,dt)&&typeof n=="number"&&n===t(this,z)&&(t(this,E)>=0?o(this,h,Bt).call(this,n):o(this,h,Pt).call(this,n))});this.backend=s,a(this,H,e),a(this,L,i.textDocument),a(this,P,i.theme),a(this,Q,[]),a(this,st,i.tokenizeMaxLineLength??1e3),a(this,it,i.onDeferTokenize),a(this,C,i.matchBrackets!==!1),a(this,U,i.__debug??!1),o(this,h,ut).call(this),o(this,h,K).call(this)}getStringCommentRegexpRangesInLine(e){if(!t(this,C)||e<0||e>=t(this,L).lineCount||(o(this,h,ut).call(this),t(this,T)==null))return null;if(t(this,R)[e]===void 0){o(this,h,et).call(this,e);const i=t(this,u)[e]??F,s=o(this,h,ct).call(this,e,i);t(this,u)[e+1]=s.state}return t(this,R)[e]??null}setTheme(e){t(this,P)!==e&&(a(this,P,e),o(this,h,K).call(this),this.stopBackgroundTokenize(),a(this,u,[F]),a(this,D,[]),a(this,_,0),a(this,A,[]),t(this,T)!=null&&t(this,L).lineCount>0&&o(this,h,pt).call(this,0))}dispose(){a(this,nt,!0),this.stopBackgroundTokenize(),o(this,h,Et).call(this)}tokenize(e,i,s=!1){if(o(this,h,ut).call(this),o(this,h,K).call(this),t(this,T)==null&&!Lt(t(this,L).languageId))throw new Error(`Grammar for language "${t(this,L).languageId}" not loaded`);const{lineCount:n}=t(this,L),{startingLine:r=0,totalLines:l=1/0}=i??{},d=l===1/0?n:Math.min(r+l,n),c=e.startLine,f=Math.max(r,c),I=i!=null&&l!==1/0&&e.lineDelta>0&&c<d&&e.endLine>=d,m=e.lineDelta===0&&(e.changedLineChanges?.every(([,,p])=>p===0)??!0);t(this,C)&&!m&&(t(this,R).length=Math.min(t(this,R).length,e.startLine));const M=s&&e.lineDelta!==0&&c>=r,S=m||i==null||c>=f,y=e.changedLineRanges??[[c,e.endLine]];a(this,D,[]),a(this,_,0),a(this,A,[]);let V=-1;if(c<f)for(const[p,w]of y)p<f&&(V=Math.max(V,Math.min(w,f-1)));const mt=V>=c&&(m||e.lineDelta<0);m?o(this,h,et).call(this,c):(o(this,h,Ot).call(this,e),(i==null||c>=f)&&o(this,h,et).call(this,f));let j=0,St=y[j][1],ht,Rt=0,k=m?y[j][0]:f,rt=!1;const Mt=new Map,W=mt?new Map:void 0;if(W!=null&&!m){const p=Math.min(V+1,f,d);if(p>c){o(this,h,et).call(this,p);let w=c,ot=t(this,u)[w]??F;for(;w<p;w++){const x=o(this,h,ct).call(this,w,ot);ot=x.state,W.set(w,x.resolvedTokens)}t(this,u)[p]=ot}}let q=t(this,u)[k]??F;for(;k<d;){const p=m?t(this,u)[k+1]:M?o(this,h,gt).call(this,k+1):void 0;S&&(t(this,u)[k]=q);const{resolvedTokens:w,state:ot}=o(this,h,ct).call(this,k,q);if(q=ot,k>=f?Mt.set(k,w):W?.set(k,w),S&&(t(this,u)[k+1]=q),rt=k>=St&&(m||M)&&p!=null&&q.equals(p),rt){j++;const x=y[j];if(x==null)break;if(x[0]>=d){ht=x[0],Rt=j;break}let lt=t(this,u)[x[0]];if(M)for(let kt=k+2;kt<=x[0]&&(lt=o(this,h,gt).call(this,kt),lt!=null);kt++)t(this,u)[kt]=lt;lt==null?(St=x[1],k++):(k=x[0],q=lt,St=x[1]),rt=!1;continue}k++}if(S&&(k<d?t(this,u)[k+1]=q:t(this,u)[k]=q),rt&&M&&ht==null){for(let p=k+2;p<=n;p++){const w=o(this,h,gt).call(this,p);if(w==null)break;t(this,u)[p]=w}a(this,D,[]),a(this,_,0),a(this,A,[])}if(W!=null&&W.size>0&&t(this,it).call(this,W),ht!=null)t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,ht)),o(this,h,pt).call(this,ht,y,Rt);else if(!rt&&k<n){const p=I&&c>=f?d:c<f&&!m?c:k;t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,p)),o(this,h,pt).call(this,p,y,j)}return Mt}prebuildStateStack(e){o(this,h,ut).call(this),t(this,Tt).call(this,e)}stopBackgroundTokenize(){a(this,B,-1),!t(this,b)&&(a(this,b,!0),a(this,v,!1),a(this,O,-1),a(this,E,-1),a(this,X,void 0),a(this,N,0),a(this,D,[]),a(this,_,0),a(this,A,[]),o(this,h,Et).call(this))}pauseBackgroundTokenize(){t(this,b)||t(this,v)||(t(this,U)&&console.log("[diffs/editor] background tokenization paused",{jobId:t(this,z)}),a(this,v,!0))}resumeBackgroundTokenize(){t(this,b)||!t(this,v)||t(this,T)==null||t(this,O)<0||(t(this,U)&&console.log("[diffs/editor] background tokenization resumed",{jobId:t(this,z)}),a(this,v,!1),o(this,h,Y).call(this,t(this,z)))}},H=new WeakMap,T=new WeakMap,P=new WeakMap,Q=new WeakMap,L=new WeakMap,st=new WeakMap,it=new WeakMap,C=new WeakMap,U=new WeakMap,nt=new WeakMap,u=new WeakMap,D=new WeakMap,_=new WeakMap,A=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,z=new WeakMap,dt=new WeakMap,E=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,R=new WeakMap,Z=new WeakMap,Tt=new WeakMap,ft=new WeakMap,h=new WeakSet,K=function(){if(t(this,P)==="")return;this.backend?.getTheme(t(this,P));const{colorMap:e}=t(this,H).setTheme(t(this,P));a(this,Q,e)},ut=function(){t(this,T)==null&&!Lt(t(this,L).languageId)&&t(this,H).getLoadedLanguages().includes(t(this,L).languageId)&&a(this,T,t(this,H).getLanguage(t(this,L).languageId))},zt=function(){t(this,Z)||(globalThis.addEventListener("message",t(this,ft)),a(this,Z,!0))},Et=function(){t(this,Z)&&(globalThis.removeEventListener("message",t(this,ft)),a(this,Z,!1))},Y=function(e){globalThis.postMessage({type:"tokenize",tokenizerId:t(this,dt),jobId:e})},pt=function(e,i,s=0){if(Lt(t(this,L).languageId))return;const n=++vt(this,z)._;t(this,U)&&console.log("[diffs/editor] background tokenization scheduled",{jobId:n,startLine:e,changedLineRanges:i,changedRangeIndex:s}),a(this,b,!1),a(this,v,!1),a(this,O,e),t(this,E)>=0&&a(this,B,Math.max(t(this,B),t(this,E))),a(this,E,-1),a(this,X,i),a(this,N,s),o(this,h,zt).call(this),o(this,h,Y).call(this,n)},It=function(e){if(t(this,T)==null||t(this,u).length>e)return;if(!t(this,b)){t(this,E)>=0?a(this,E,Math.max(t(this,E),e)):a(this,B,Math.max(t(this,B),e));return}const i=++vt(this,z)._;a(this,b,!1),a(this,v,!1),a(this,O,t(this,u).length-1),a(this,E,e),a(this,B,-1),a(this,X,void 0),a(this,N,0),o(this,h,zt).call(this),o(this,h,Y).call(this,i)},ct=function(e,i){const s=t(this,L).getLineText(e);if(s.length>=t(this,st))return console.warn(`[diffs] Line(${e}) too long to tokenize: ${s.length}`),o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};if(t(this,T)==null||s===""||s.trim()==="")return o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};const n=_t(t(this,T),t(this,Q),s,i,Dt,t(this,C));return o(this,h,tt).call(this,e,n.bracketIgnoredRanges),{resolvedTokens:n.resolvedTokens,state:n.ruleStack}},tt=function(e,i){t(this,C)&&(t(this,R)[e]=i)},Ot=function(e){const i=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],s=e.startLine+1;s<=t(this,u).length-s?(a(this,D,t(this,u)),a(this,_,0),a(this,u,t(this,u).slice(0,s))):(a(this,_,s),a(this,D,t(this,u).slice(s)),t(this,u).length=Math.min(t(this,u).length,s)),a(this,A,i)},gt=function(e){let i=e;for(let s=t(this,A).length-1;s>=0;s--){const[n,r,l]=t(this,A)[s];if(l!==0){if(i>r)i-=l;else if(i>n)return t(this,u)[e]}}return t(this,D)[i-t(this,_)]??t(this,u)[e]},et=function(e,i){const s=Math.min(Math.max(0,e),t(this,L).lineCount);if(t(this,u).length>s||t(this,T)==null)return!0;const n=i==null?0:performance.now();let r=t(this,u).length-1,l=t(this,u)[r]??F;for(;r<s;){t(this,u)[r]=l;const d=t(this,L).getLineText(r);if(d.length<t(this,st)&&d!==""&&d.trim()!==""){const c=_t(t(this,T),t(this,Q),d,l,Dt,t(this,C),!1);o(this,h,tt).call(this,r,c.bracketIgnoredRanges),l=c.ruleStack}else o(this,h,tt).call(this,r,null);if(r++,t(this,u)[r]=l,i!=null&&performance.now()-n>i)break}return r>=s},Bt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=o(this,h,et).call(this,t(this,E),1);if(!(t(this,b)||t(this,v)||e!==t(this,z))){if(i){this.stopBackgroundTokenize();return}a(this,O,t(this,u).length-1),o(this,h,Y).call(this,e)}},Pt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=performance.now(),s=new Map,n=t(this,L).lineCount,r=t(this,X);let l=t(this,O),d=t(this,u)[l]??F,c=!1,f=t(this,N),I=r?.[f]?.[1];for(;l<n;){t(this,u)[l]=d;const m=I!=null?o(this,h,gt).call(this,l+1):void 0,M=o(this,h,ct).call(this,l,d);if(s.set(l,M.resolvedTokens),d=M.state,t(this,u)[l+1]=d,c=I!=null&&l>=I&&m!=null&&d.equals(m),l++,c){f++;const S=r?.[f];if(S==null)break;if(I=S[1],t(this,u)[S[0]]==null)c=!1;else{l=S[0],d=t(this,u)[l]??d,c=!1;continue}}if(performance.now()-i>1)break}if(t(this,it).call(this,s),!(t(this,b)||t(this,v)||e!==t(this,z))){if(c||l>=n){const m=t(this,B);this.stopBackgroundTokenize(),m>=0&&o(this,h,It).call(this,m);return}a(this,O,l),a(this,N,f),o(this,h,Y).call(this,e)}},At);function _t(e,i,s,n,r,l=!0,d=!0){const c=e.tokenizeLine2(s,n,r);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${s.substring(0,100)}`);const f=c.tokens,I=f.length/2,m=[],M=[];if(!d&&!l)return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M};for(let S=0;S<I;S++){const y=f[2*S],V=S+1<I?f[2*S+2]:s.length;if(y===V)continue;const mt=f[2*S+1];if(d){const j=Ct.getForeground(mt);m.push([y,i[j],s.slice(y,V)])}l&&Ct.getTokenType(mt)>0&&M.push([y,V])}return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M}}function Lt(e){return e==="text"||e==="ansi"}var $,G,at,te=(at=class extends Ft{constructor(s,n){super();J(this,"highlighter");J(this,"options");g(this,$,"");g(this,G);this.highlighter=s,this.options=n}tokenizeChunk(s,n){const r=(t(this,$)+s).split(/(\r\n|\r|\n)/);let l=[];for(let d=0;d<r.length;d+=2){const c=r[d],f=this.highlighter.codeToTokens(c,{...this.options,grammarState:t(this,G)}),I=f.tokens[0].map(m=>({...m,offset:m.offset+this.stableOffset}));d+1<r.length?(Ht(n,I),this.pushLineBreak(n,c.length,r[d+1]),a(this,G,f.grammarState)):(l=I,a(this,$,c))}return{unstable:l,tailLength:t(this,$).length}}clone(){this.assertActive();const s=new at(this.highlighter,this.options);return this.copyStateTo(s),a(s,$,t(this,$)),a(s,G,t(this,G)),s}resetSource(){a(this,$,""),a(this,G,void 0)}releaseSource(){this.resetSource()}},$=new WeakMap,G=new WeakMap,at),he=class $t extends Kt{constructor(s,n){super(s,Nt(s));J(this,"raw");J(this,"loadedThemes",new Map);J(this,"attachedLanguages",new Set(["text","ansi"]));this.raw=n}static async create(s){const n=s==="shiki-wasm"?(await wt(async()=>{const{createOnigurumaEngine:l}=await import("./fp9mRO0R.js");return{createOnigurumaEngine:l}},[],import.meta.url)).createOnigurumaEngine(wt(()=>import("./Cey7Y6ql.js"),[],import.meta.url)):(await wt(async()=>{const{createJavaScriptRegexEngine:l}=await import("./LU5PuYrD.js");return{createJavaScriptRegexEngine:l}},[],import.meta.url)).createJavaScriptRegexEngine(),r=await Qt({themes:[],langs:[],engine:n});return new $t(s,r)}getTheme(s){this.assertNotDisposed();const n=this.loadedThemes.get(s),r=this.themeResolver.getResolvedTheme(s)??n;if(r==null)throw new Error(`Theme "${s}" has not been resolved`);if(n!==r){const l=r.textmate??(r.cssVariables!=null?Ut(r.cssVariables):void 0);if(l==null)throw new Error(`Theme "${s}" does not support Shiki`);this.raw.setTheme({...l,name:s}),this.loadedThemes.set(s,r)}return r}codeToTokens(s,n){return this.raw.codeToTokens(s,this.resolveOptions(n))}createEditorTokenizer(s){return new Yt(this.raw,s,this)}createStreamTokenizer(s){return new te(this.raw,this.resolveOptions(s))}async loadLanguages(s){this.assertNotDisposed();const n=s.filter(r=>!this.attachedLanguages.has(r));Xt(await Gt(n),this)}hasLoadedLanguages(s){if(this.disposed)return!1;let n;return s.every(r=>this.attachedLanguages.has(r)?!0:Jt.has(r)?!1:(n??=this.raw.getLoadedLanguages(),n.includes(r)))}attachLanguages(s){this.assertNotDisposed();for(const n of s){if(this.attachedLanguages.has(n.name))continue;const r=n.data.find(l=>l.name===n.name||l.aliases?.includes(n.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);this.raw.loadLanguageSync(n.data);try{this.raw.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(n.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:s,themes:n,...r}){if(this.assertNotDisposed(),s!=null)return this.getTheme(s),{...r,theme:s};if(n==null)throw new Error("A theme or themes option is required");for(const l of Object.values(n))this.getTheme(l);return{...r,themes:n}}};export{he as ShikiHighlighter};
1
+ var Vt=Object.defineProperty;var yt=e=>{throw TypeError(e)};var jt=(e,i,s)=>i in e?Vt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s;var J=(e,i,s)=>jt(e,typeof i!="symbol"?i+"":i,s),bt=(e,i,s)=>i.has(e)||yt("Cannot "+s);var t=(e,i,s)=>(bt(e,i,"read from private field"),s?s.call(e):i.get(e)),g=(e,i,s)=>i.has(e)?yt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,s),a=(e,i,s,n)=>(bt(e,i,"write to private field"),n?n.call(e,s):i.set(e,s),s),o=(e,i,s)=>(bt(e,i,"access private method"),s);var vt=(e,i,s,n)=>({set _(r){a(e,i,r,s)},get _(){return t(e,i,n)}});import{_ as wt}from"./1KDVFF23.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./CpIVKWwx.js";import{B as Ft,D as Kt}from"./CZw2t1gL.js";import{I as F,E as Ct,b as Qt,a as Ut}from"./DICr2Lvd.js";function Xt(e,i){for(const s of Array.isArray(e)?e:[e]){let n=xt.get(s.name);n==null&&(n=s,xt.set(s.name,n)),i.attachLanguages([n]),qt.add(n.name)}}function Zt(e,i){let s;return function(...n){clearTimeout(s),s=setTimeout(()=>e.apply(this,n),i)}}const Dt=0;let Wt=0;var H,T,P,Q,L,st,it,C,U,nt,u,D,_,A,O,b,v,z,dt,E,B,X,N,R,Z,Tt,ft,h,K,ut,zt,Et,Y,pt,It,ct,tt,Ot,gt,et,Bt,Pt,At,Yt=(At=class{constructor(e,i,s){g(this,h);J(this,"backend");g(this,H);g(this,T);g(this,P);g(this,Q);g(this,L);g(this,st);g(this,it);g(this,C);g(this,U);g(this,nt,!1);g(this,u,[F]);g(this,D,[]);g(this,_,0);g(this,A,[]);g(this,O,-1);g(this,b,!0);g(this,v,!1);g(this,z,0);g(this,dt,++Wt);g(this,E,-1);g(this,B,-1);g(this,X);g(this,N,0);g(this,R,[]);g(this,Z,!1);g(this,Tt,Zt(async e=>{if(t(this,nt))return;const{startingLine:i=0,totalLines:s=1/0}=e??{},n=Math.min(s===1/0?1/0:i+s,t(this,L).lineCount);if(t(this,T)==null&&!Lt(t(this,L).languageId)){if(await this.backend?.loadLanguages([t(this,L).languageId]),t(this,nt))return;a(this,T,t(this,H).getLanguage(t(this,L).languageId))}o(this,h,K).call(this),o(this,h,It).call(this,n)},500));g(this,ft,({data:e})=>{if(typeof e!="object"||e===null)return;const{type:i,tokenizerId:s,jobId:n}=e;i==="tokenize"&&s===t(this,dt)&&typeof n=="number"&&n===t(this,z)&&(t(this,E)>=0?o(this,h,Bt).call(this,n):o(this,h,Pt).call(this,n))});this.backend=s,a(this,H,e),a(this,L,i.textDocument),a(this,P,i.theme),a(this,Q,[]),a(this,st,i.tokenizeMaxLineLength??1e3),a(this,it,i.onDeferTokenize),a(this,C,i.matchBrackets!==!1),a(this,U,i.__debug??!1),o(this,h,ut).call(this),o(this,h,K).call(this)}getStringCommentRegexpRangesInLine(e){if(!t(this,C)||e<0||e>=t(this,L).lineCount||(o(this,h,ut).call(this),t(this,T)==null))return null;if(t(this,R)[e]===void 0){o(this,h,et).call(this,e);const i=t(this,u)[e]??F,s=o(this,h,ct).call(this,e,i);t(this,u)[e+1]=s.state}return t(this,R)[e]??null}setTheme(e){t(this,P)!==e&&(a(this,P,e),o(this,h,K).call(this),this.stopBackgroundTokenize(),a(this,u,[F]),a(this,D,[]),a(this,_,0),a(this,A,[]),t(this,T)!=null&&t(this,L).lineCount>0&&o(this,h,pt).call(this,0))}dispose(){a(this,nt,!0),this.stopBackgroundTokenize(),o(this,h,Et).call(this)}tokenize(e,i,s=!1){if(o(this,h,ut).call(this),o(this,h,K).call(this),t(this,T)==null&&!Lt(t(this,L).languageId))throw new Error(`Grammar for language "${t(this,L).languageId}" not loaded`);const{lineCount:n}=t(this,L),{startingLine:r=0,totalLines:l=1/0}=i??{},d=l===1/0?n:Math.min(r+l,n),c=e.startLine,f=Math.max(r,c),I=i!=null&&l!==1/0&&e.lineDelta>0&&c<d&&e.endLine>=d,m=e.lineDelta===0&&(e.changedLineChanges?.every(([,,p])=>p===0)??!0);t(this,C)&&!m&&(t(this,R).length=Math.min(t(this,R).length,e.startLine));const M=s&&e.lineDelta!==0&&c>=r,S=m||i==null||c>=f,y=e.changedLineRanges??[[c,e.endLine]];a(this,D,[]),a(this,_,0),a(this,A,[]);let V=-1;if(c<f)for(const[p,w]of y)p<f&&(V=Math.max(V,Math.min(w,f-1)));const mt=V>=c&&(m||e.lineDelta<0);m?o(this,h,et).call(this,c):(o(this,h,Ot).call(this,e),(i==null||c>=f)&&o(this,h,et).call(this,f));let j=0,St=y[j][1],ht,Rt=0,k=m?y[j][0]:f,rt=!1;const Mt=new Map,W=mt?new Map:void 0;if(W!=null&&!m){const p=Math.min(V+1,f,d);if(p>c){o(this,h,et).call(this,p);let w=c,ot=t(this,u)[w]??F;for(;w<p;w++){const x=o(this,h,ct).call(this,w,ot);ot=x.state,W.set(w,x.resolvedTokens)}t(this,u)[p]=ot}}let q=t(this,u)[k]??F;for(;k<d;){const p=m?t(this,u)[k+1]:M?o(this,h,gt).call(this,k+1):void 0;S&&(t(this,u)[k]=q);const{resolvedTokens:w,state:ot}=o(this,h,ct).call(this,k,q);if(q=ot,k>=f?Mt.set(k,w):W?.set(k,w),S&&(t(this,u)[k+1]=q),rt=k>=St&&(m||M)&&p!=null&&q.equals(p),rt){j++;const x=y[j];if(x==null)break;if(x[0]>=d){ht=x[0],Rt=j;break}let lt=t(this,u)[x[0]];if(M)for(let kt=k+2;kt<=x[0]&&(lt=o(this,h,gt).call(this,kt),lt!=null);kt++)t(this,u)[kt]=lt;lt==null?(St=x[1],k++):(k=x[0],q=lt,St=x[1]),rt=!1;continue}k++}if(S&&(k<d?t(this,u)[k+1]=q:t(this,u)[k]=q),rt&&M&&ht==null){for(let p=k+2;p<=n;p++){const w=o(this,h,gt).call(this,p);if(w==null)break;t(this,u)[p]=w}a(this,D,[]),a(this,_,0),a(this,A,[])}if(W!=null&&W.size>0&&t(this,it).call(this,W),ht!=null)t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,ht)),o(this,h,pt).call(this,ht,y,Rt);else if(!rt&&k<n){const p=I&&c>=f?d:c<f&&!m?c:k;t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,p)),o(this,h,pt).call(this,p,y,j)}return Mt}prebuildStateStack(e){o(this,h,ut).call(this),t(this,Tt).call(this,e)}stopBackgroundTokenize(){a(this,B,-1),!t(this,b)&&(a(this,b,!0),a(this,v,!1),a(this,O,-1),a(this,E,-1),a(this,X,void 0),a(this,N,0),a(this,D,[]),a(this,_,0),a(this,A,[]),o(this,h,Et).call(this))}pauseBackgroundTokenize(){t(this,b)||t(this,v)||(t(this,U)&&console.log("[diffs/editor] background tokenization paused",{jobId:t(this,z)}),a(this,v,!0))}resumeBackgroundTokenize(){t(this,b)||!t(this,v)||t(this,T)==null||t(this,O)<0||(t(this,U)&&console.log("[diffs/editor] background tokenization resumed",{jobId:t(this,z)}),a(this,v,!1),o(this,h,Y).call(this,t(this,z)))}},H=new WeakMap,T=new WeakMap,P=new WeakMap,Q=new WeakMap,L=new WeakMap,st=new WeakMap,it=new WeakMap,C=new WeakMap,U=new WeakMap,nt=new WeakMap,u=new WeakMap,D=new WeakMap,_=new WeakMap,A=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,z=new WeakMap,dt=new WeakMap,E=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,R=new WeakMap,Z=new WeakMap,Tt=new WeakMap,ft=new WeakMap,h=new WeakSet,K=function(){if(t(this,P)==="")return;this.backend?.getTheme(t(this,P));const{colorMap:e}=t(this,H).setTheme(t(this,P));a(this,Q,e)},ut=function(){t(this,T)==null&&!Lt(t(this,L).languageId)&&t(this,H).getLoadedLanguages().includes(t(this,L).languageId)&&a(this,T,t(this,H).getLanguage(t(this,L).languageId))},zt=function(){t(this,Z)||(globalThis.addEventListener("message",t(this,ft)),a(this,Z,!0))},Et=function(){t(this,Z)&&(globalThis.removeEventListener("message",t(this,ft)),a(this,Z,!1))},Y=function(e){globalThis.postMessage({type:"tokenize",tokenizerId:t(this,dt),jobId:e})},pt=function(e,i,s=0){if(Lt(t(this,L).languageId))return;const n=++vt(this,z)._;t(this,U)&&console.log("[diffs/editor] background tokenization scheduled",{jobId:n,startLine:e,changedLineRanges:i,changedRangeIndex:s}),a(this,b,!1),a(this,v,!1),a(this,O,e),t(this,E)>=0&&a(this,B,Math.max(t(this,B),t(this,E))),a(this,E,-1),a(this,X,i),a(this,N,s),o(this,h,zt).call(this),o(this,h,Y).call(this,n)},It=function(e){if(t(this,T)==null||t(this,u).length>e)return;if(!t(this,b)){t(this,E)>=0?a(this,E,Math.max(t(this,E),e)):a(this,B,Math.max(t(this,B),e));return}const i=++vt(this,z)._;a(this,b,!1),a(this,v,!1),a(this,O,t(this,u).length-1),a(this,E,e),a(this,B,-1),a(this,X,void 0),a(this,N,0),o(this,h,zt).call(this),o(this,h,Y).call(this,i)},ct=function(e,i){const s=t(this,L).getLineText(e);if(s.length>=t(this,st))return console.warn(`[diffs] Line(${e}) too long to tokenize: ${s.length}`),o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};if(t(this,T)==null||s===""||s.trim()==="")return o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};const n=_t(t(this,T),t(this,Q),s,i,Dt,t(this,C));return o(this,h,tt).call(this,e,n.bracketIgnoredRanges),{resolvedTokens:n.resolvedTokens,state:n.ruleStack}},tt=function(e,i){t(this,C)&&(t(this,R)[e]=i)},Ot=function(e){const i=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],s=e.startLine+1;s<=t(this,u).length-s?(a(this,D,t(this,u)),a(this,_,0),a(this,u,t(this,u).slice(0,s))):(a(this,_,s),a(this,D,t(this,u).slice(s)),t(this,u).length=Math.min(t(this,u).length,s)),a(this,A,i)},gt=function(e){let i=e;for(let s=t(this,A).length-1;s>=0;s--){const[n,r,l]=t(this,A)[s];if(l!==0){if(i>r)i-=l;else if(i>n)return t(this,u)[e]}}return t(this,D)[i-t(this,_)]??t(this,u)[e]},et=function(e,i){const s=Math.min(Math.max(0,e),t(this,L).lineCount);if(t(this,u).length>s||t(this,T)==null)return!0;const n=i==null?0:performance.now();let r=t(this,u).length-1,l=t(this,u)[r]??F;for(;r<s;){t(this,u)[r]=l;const d=t(this,L).getLineText(r);if(d.length<t(this,st)&&d!==""&&d.trim()!==""){const c=_t(t(this,T),t(this,Q),d,l,Dt,t(this,C),!1);o(this,h,tt).call(this,r,c.bracketIgnoredRanges),l=c.ruleStack}else o(this,h,tt).call(this,r,null);if(r++,t(this,u)[r]=l,i!=null&&performance.now()-n>i)break}return r>=s},Bt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=o(this,h,et).call(this,t(this,E),1);if(!(t(this,b)||t(this,v)||e!==t(this,z))){if(i){this.stopBackgroundTokenize();return}a(this,O,t(this,u).length-1),o(this,h,Y).call(this,e)}},Pt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=performance.now(),s=new Map,n=t(this,L).lineCount,r=t(this,X);let l=t(this,O),d=t(this,u)[l]??F,c=!1,f=t(this,N),I=r?.[f]?.[1];for(;l<n;){t(this,u)[l]=d;const m=I!=null?o(this,h,gt).call(this,l+1):void 0,M=o(this,h,ct).call(this,l,d);if(s.set(l,M.resolvedTokens),d=M.state,t(this,u)[l+1]=d,c=I!=null&&l>=I&&m!=null&&d.equals(m),l++,c){f++;const S=r?.[f];if(S==null)break;if(I=S[1],t(this,u)[S[0]]==null)c=!1;else{l=S[0],d=t(this,u)[l]??d,c=!1;continue}}if(performance.now()-i>1)break}if(t(this,it).call(this,s),!(t(this,b)||t(this,v)||e!==t(this,z))){if(c||l>=n){const m=t(this,B);this.stopBackgroundTokenize(),m>=0&&o(this,h,It).call(this,m);return}a(this,O,l),a(this,N,f),o(this,h,Y).call(this,e)}},At);function _t(e,i,s,n,r,l=!0,d=!0){const c=e.tokenizeLine2(s,n,r);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${s.substring(0,100)}`);const f=c.tokens,I=f.length/2,m=[],M=[];if(!d&&!l)return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M};for(let S=0;S<I;S++){const y=f[2*S],V=S+1<I?f[2*S+2]:s.length;if(y===V)continue;const mt=f[2*S+1];if(d){const j=Ct.getForeground(mt);m.push([y,i[j],s.slice(y,V)])}l&&Ct.getTokenType(mt)>0&&M.push([y,V])}return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M}}function Lt(e){return e==="text"||e==="ansi"}var $,G,at,te=(at=class extends Ft{constructor(s,n){super();J(this,"highlighter");J(this,"options");g(this,$,"");g(this,G);this.highlighter=s,this.options=n}tokenizeChunk(s,n){const r=(t(this,$)+s).split(/(\r\n|\r|\n)/);let l=[];for(let d=0;d<r.length;d+=2){const c=r[d],f=this.highlighter.codeToTokens(c,{...this.options,grammarState:t(this,G)}),I=f.tokens[0].map(m=>({...m,offset:m.offset+this.stableOffset}));d+1<r.length?(Ht(n,I),this.pushLineBreak(n,c.length,r[d+1]),a(this,G,f.grammarState)):(l=I,a(this,$,c))}return{unstable:l,tailLength:t(this,$).length}}clone(){this.assertActive();const s=new at(this.highlighter,this.options);return this.copyStateTo(s),a(s,$,t(this,$)),a(s,G,t(this,G)),s}resetSource(){a(this,$,""),a(this,G,void 0)}releaseSource(){this.resetSource()}},$=new WeakMap,G=new WeakMap,at),he=class $t extends Kt{constructor(s,n){super(s,Nt(s));J(this,"raw");J(this,"loadedThemes",new Map);J(this,"attachedLanguages",new Set(["text","ansi"]));this.raw=n}static async create(s){const n=s==="shiki-wasm"?(await wt(async()=>{const{createOnigurumaEngine:l}=await import("./fp9mRO0R.js");return{createOnigurumaEngine:l}},[],import.meta.url)).createOnigurumaEngine(wt(()=>import("./Cey7Y6ql.js"),[],import.meta.url)):(await wt(async()=>{const{createJavaScriptRegexEngine:l}=await import("./LU5PuYrD.js");return{createJavaScriptRegexEngine:l}},[],import.meta.url)).createJavaScriptRegexEngine(),r=await Qt({themes:[],langs:[],engine:n});return new $t(s,r)}getTheme(s){this.assertNotDisposed();const n=this.loadedThemes.get(s),r=this.themeResolver.getResolvedTheme(s)??n;if(r==null)throw new Error(`Theme "${s}" has not been resolved`);if(n!==r){const l=r.textmate??(r.cssVariables!=null?Ut(r.cssVariables):void 0);if(l==null)throw new Error(`Theme "${s}" does not support Shiki`);this.raw.setTheme({...l,name:s}),this.loadedThemes.set(s,r)}return r}codeToTokens(s,n){return this.raw.codeToTokens(s,this.resolveOptions(n))}createEditorTokenizer(s){return new Yt(this.raw,s,this)}createStreamTokenizer(s){return new te(this.raw,this.resolveOptions(s))}async loadLanguages(s){this.assertNotDisposed();const n=s.filter(r=>!this.attachedLanguages.has(r));Xt(await Gt(n),this)}hasLoadedLanguages(s){if(this.disposed)return!1;let n;return s.every(r=>this.attachedLanguages.has(r)?!0:Jt.has(r)?!1:(n??=this.raw.getLoadedLanguages(),n.includes(r)))}attachLanguages(s){this.assertNotDisposed();for(const n of s){if(this.attachedLanguages.has(n.name))continue;const r=n.data.find(l=>l.name===n.name||l.aliases?.includes(n.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);this.raw.loadLanguageSync(n.data);try{this.raw.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(n.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:s,themes:n,...r}){if(this.assertNotDisposed(),s!=null)return this.getTheme(s),{...r,theme:s};if(n==null)throw new Error("A theme or themes option is required");for(const l of Object.values(n))this.getTheme(l);return{...r,themes:n}}};export{he as ShikiHighlighter};
@@ -1,4 +1,4 @@
1
- import{p as tt}from"./CjCvg4fu.js";import{U as et,aZ as at,V as rt,a_ as it,Y as nt,b0 as ot,b as l,ay as E,X as st,q as lt,aX as ct,aH as dt,d as I,B as gt,r as ht,aJ as pt,O as ft}from"./1_Sb4Kkv.js";import{p as ut}from"./DcZr-m_l.js";import{o as mt}from"./CHzHsjlJ.js";var vt=ft.pie,R={sections:new Map,showData:!1},b=R.sections,H=R.showData,St=structuredClone(vt),xt=l(()=>structuredClone(St),"getConfig"),wt=l(()=>{b=new Map,H=R.showData,ht()},"clear"),$t=l(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);b.has(t)||(b.set(t,a),E.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=l(()=>b,"getSections"),yt=l(t=>{H=t},"setShowData"),Dt=l(()=>H,"getShowData"),U={getConfig:xt,clear:wt,setDiagramTitle:ot,getDiagramTitle:nt,setAccTitle:it,getAccTitle:rt,setAccDescription:at,getAccDescription:et,addSection:$t,getSections:Ct,setShowData:yt,getShowData:Dt},bt=l((t,a)=>{tt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:l(async t=>{const a=await ut("pie",t);E.debug(a),bt(a,U)},"parse")},At=l(t=>`
1
+ import{p as tt}from"./BdNdGDSe.js";import{U as et,aZ as at,V as rt,a_ as it,Y as nt,b0 as ot,b as l,ay as E,X as st,q as lt,aX as ct,aH as dt,d as I,B as gt,r as ht,aJ as pt,O as ft}from"./kZL4nf_J.js";import{p as ut}from"./DcZr-m_l.js";import{o as mt}from"./DY-U3TFa.js";var vt=ft.pie,R={sections:new Map,showData:!1},b=R.sections,H=R.showData,St=structuredClone(vt),xt=l(()=>structuredClone(St),"getConfig"),wt=l(()=>{b=new Map,H=R.showData,ht()},"clear"),$t=l(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);b.has(t)||(b.set(t,a),E.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=l(()=>b,"getSections"),yt=l(t=>{H=t},"setShowData"),Dt=l(()=>H,"getShowData"),U={getConfig:xt,clear:wt,setDiagramTitle:ot,getDiagramTitle:nt,setAccTitle:it,getAccTitle:rt,setAccDescription:at,getAccDescription:et,addSection:$t,getSections:Ct,setShowData:yt,getShowData:Dt},bt=l((t,a)=>{tt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:l(async t=>{const a=await ut("pie",t);E.debug(a),bt(a,U)},"parse")},At=l(t=>`
2
2
  .pieCircle{
3
3
  stroke: ${t.pieStrokeColor};
4
4
  stroke-width : ${t.pieStrokeWidth};
@@ -1 +1 @@
1
- import{aB as v,b as y}from"./1_Sb4Kkv.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
1
+ import{aB as v,b as y}from"./kZL4nf_J.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
@@ -1,4 +1,4 @@
1
- var jl=Object.defineProperty;var Vl=(r,t,a)=>t in r?jl(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a;var pa=(r,t,a)=>Vl(r,typeof t!="symbol"?t+"":t,a);import{t as yt,bo as g,bw as wt,b as xt,bm as l,bq as Ea,bs as Kt,br as Gl,bp as hn}from"./1KDVFF23.js";import{ai as Ga,bs as kt,ca as er,aD as e,bH as B,ay as ge,bS as C,a7 as bt,W as d,a5 as U,bA as q,bn as It,c9 as n,bV as fe,aA as m,b_ as L,aj as Ir,aB as I,be as mr,b$ as Mr,bO as Q,bf as rr,c0 as Ia,bl as ie,bj as ja,c6 as Kl,bo as nn,br as Zr,am as Da,ax as Ba,bk as rs,aw as pn,bz as as,cb as Bn,c5 as Mn,aC as Tr,cd as vo,bv as Zl}from"./3SdAC2_C.js";import{i as F}from"./Zg9SWWIQ.js";import{g as Sr,e as da,p as ms,i as Ha,I as Ql,h as Ys,X as pi,o as Xl}from"./CYCawVEx.js";import{n as Zt,l as On,c as Ja,g as rn,s as ks,k as ns,S as Jl}from"./CjK2zm52.js";import{s as te,f as ze,g as _n,c as Pt,e as Yt,b as bn,p as Yl,S as ed,C as td}from"./D8B7qxXm.js";import{b as ea}from"./Dn334wJv.js";import{f as st,ae as eo,a_ as rd}from"./DPbnmxjX.js";import{J as ad,O as nd,Q as Is}from"./BpT_ybtH.js";import"./Ch-pFfsN.js";import"./IdqO6uHC.js";import"./CBLFNmYJ.js";import{k as vi,s as Na}from"./Dmy603At.js";import{F as Nt,a4 as zs,bg as ka,cK as ps,au as hi,aZ as _i,aK as sd,c9 as od,a6 as ss,aN as id,cN as ld,cM as dd,a3 as vs,aC as os,aw as hs,I as ho,aj as cd,bu as ud,aS as fd,aX as gd,bJ as md,ao as pd,bk as bi,cC as vd,aP as _o,c0 as Ss,aI as Wn,cW as hd,cb as _d,bn as bd,b as yd,cp as wd,ag as xd,ba as Ts,cr as wn,cF as kd,az as Id,c6 as Sd,d3 as Td}from"./BZytk_HL.js";import{C as yi,A as Cd,o as Md}from"./DHbv9I-C.js";import{b as Cs,V as bo}from"./Ug7t_gUQ.js";import{A as wi,I as Ad,R as Pd,q as Rd}from"./9Fwj-RCt.js";import{bZ as xi,aj as Nd,j as Gn,a4 as Ws,al as is,E as Ed,au as Kn,aP as $d,aS as yo}from"./DwhE2_yv.js";import{t as an,o as Ld}from"./DAsc1V4f.js";import{ch as Zn,aP as qn,d2 as ki,d4 as Va,c6 as _s,q as Od,cX as Ii,d1 as bs,d0 as Si,c_ as Ti,n as Ca,al as qd,am as Dd,aJ as Bd,z as Fd,V as zd,a3 as wo,D as Ci,e4 as Wd,bq as Mi,av as Ai,aM as Hd,aF as Ud,ak as jd,r as Vd,C as Ms,ag as Gd,U as xn,e2 as Kd,ab as Zd,k as xo,u as Qd,Z as Xd,v as Jd,i as Yd,g as As,f as ko,a0 as ec,$ as tc,a9 as rc,x as Pi,y as Ri,l as Ni,j as ac,s as nc,a as sc,d5 as oc,ae as ic,e3 as lc,L as dc,F as cc,a2 as Io}from"./DkYquFOp.js";import{Jr as mt,oZ as uc,tO as Qn,nO as So,vH as Ei,vJ as $i,r$ as fc,yF as ls,u_ as Li,nJ as Oi,bq as En,nW as gc,nX as mc,yG as pc,qx as vc,ti as hc,vA as qi,nI as _c,mN as bc,m as yc,z7 as wc,z4 as xc,z6 as kc}from"./BPo1GPk4.js";import{a3 as Ic,y as Ps,a1 as Sc,O as Rs,W as Tc,$ as Cc,k as Mc,p as kn,P as un,q as Ac,G as Pc,v as Rc,t as Nc,M as Ns,K as Ec,z as $c,L as Lc,_ as An,U as Hn,N as To,n as Co,E as Oc,c as Es,F as Mo,B as qc,w as Ao,J as Pn,Q as Dc,H as Bc,j as Fc,R as zc,T as Wc,A as Hc,g as Uc,b as jc,D as Vc,f as Gc,e as Kc,a as Zc,C as Qc,i as Xc,d as ds,V as Di,a4 as Jc,u as Yc,l as eu}from"./BaEFcPEE.js";import{i as tu,e as ru}from"./C7Ibt0hX.js";import{g as $s}from"./B5aYN90J.js";import{M as In,C as Rn}from"./Ba4cYgvZ.js";import{C as Po}from"./DzTe1W0Z.js";import"./D-7b6BAb.js";import{P as au}from"./Blp2y8Zh.js";import"./DJk5np0g.js";import{c as Bi}from"./ChTqQfQN.js";import{S as nu}from"./CqlSBroo.js";import{D as Ro,M as su}from"./1_Sb4Kkv.js";import{b as ou,s as en,c as cs}from"./G4lPpFfF.js";import{O as Xn,y as Ls,E as Os,B as qs,N as iu,m as lu,l as du,k as Fi,d as vn,C as No,f as cu,e as uu,g as fu}from"./CkmjUBxn.js";import{a as zi,s as Eo}from"./BsieX9dN.js";import{f as gu}from"./BdWqymET.js";import{c as na}from"./CT6GHk2v.js";import{a as mu,k as Wi,h as to,q as Hi,l as kr}from"./CntPxeXh.js";import{P as pu}from"./Dzl5aoA8.js";import{r as Ds,q as Bs,B as $o,i as vu}from"./DM81x_EL.js";import{R as Ui,C as ys,m as hu,h as _u,g as bu,i as Lo,P as yu}from"./D7vAVIvz.js";import"./jUAybD8G.js";import{c as wu,s as xu}from"./7FS8g33K.js";import{h as gn}from"./DkY0xIi7.js";import{b as ku,a as ji}from"./CRWeEeIp.js";import{P as Vi}from"./DHSWOw-U.js";import{B as Iu}from"./DT8FaJbg.js";import{o as Gi,r as Su,e as Tu}from"./9IHp8VDb.js";import{o as Ki}from"./CDeldaOF.js";import{A as Jn,b as Zi}from"./Bek4Es60.js";import{g as ro}from"./KImhPY_I.js";import{a as Cu,M as Mu}from"./J9vGyyn3.js";import{t as xr}from"./C-BsEdGZ.js";import{E as Au,n as Pu}from"./Q-Hp56ht.js";import{c as Sn}from"./DpSAF6fh.js";import{A as Ru}from"./Bo5PTszQ.js";import{f as Nu,d as Eu}from"./DxrRvklK.js";import{ac as $u,$ as Qi,_ as Xi,N as Lu,Y as Ou,K as Oo,X as qu,v as Du}from"./BH4muXHE.js";import{a as Bu}from"./CC7to1B5.js";import{k as Fu}from"./Dhj-Oo-y.js";import{S as zu}from"./CToFQRbb.js";import{u as Wu,a as Hu,c as qo,S as Uu}from"./D9tVylVS.js";import{T as us}from"./C82gBCX8.js";import"./CBmGf0Ke.js";import{g as ju,a as Vu}from"./xJBWkpxc.js";import{a as Gu}from"./471Fgn_p.js";import{b as Ji}from"./BMfUzLG6.js";import{b as Do}from"./goTpbPhD.js";import{ah as Ua,n as Ku}from"./CMgAi196.js";import{c as Zu}from"./z1Wv0MVw.js";import{r as Bo}from"./0vLUv3ld.js";function Qu(r){if(!r||typeof r!="object")return null;const t=r;if(t.type!=="script_monitor_wake"||t.source!=="system")return null;const{scriptName:a,scriptId:s,runId:o,monitorId:i,workspaceId:c,reason:u}=t;if(typeof a!="string"||typeof s!="string"||!s||typeof o!="string"||!o||typeof i!="string"||!i||typeof c!="string"||!c||u!=="finished"&&u!=="ttl-expired"&&u!=="output-match"&&u!=="line-count")return null;const h=t.trigger;return{scriptName:a,scriptId:s,runId:o,monitorId:i,workspaceId:c,reason:u,...u==="output-match"&&typeof h?.matchedLine=="string"?{matchedLine:h.matchedLine}:{}}}function Xu(r){return r?.type==="script_monitor_wake"&&!("remoteAgentId"in r)}function Ju(r,t,a,s=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const o=r.messageMetadata?.fromPrincipalId??r.author?.principalId,i=$u(r)&&r.author?.principalId!==null&&o===t;return{edit:i,remove:i||t===a||s,sendNow:(i||s)&&!Yi(r)}}function Tn(r,t){if(t)return r.find(a=>a.editing&&a.editingMessageId?a.editingMessageId===t:a.id===t)}function Yi(r){return Xu(r.messageMetadata)&&typeof r.messageMetadata?.monitorId=="string"}function Fo(r,t=Date.now()){const a=r.messageMetadata,s=a?.fromPrincipalId,o=a&&Object.hasOwn(a,"humanAuthor")&&!(typeof s=="string"&&s.length>0),i=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!i&&!o&&!Yi(r)}const Ib="pl-3.5! pr-2!";var Yu=I('<span class="tile-remove-slot svelte-d8pwpf"><!></span>'),zo=I('<span class="attachment-status svelte-d8pwpf"> </span>'),ef=I('<div class="file-image tile svelte-d8pwpf" data-kind="file"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),tf=I("<!><span> </span>",1),rf=I('<img alt="" draggable="false"/>'),af=I('<span class="summary svelte-d8pwpf" data-clip-summary=""> </span>'),nf=I('<span class="clip svelte-d8pwpf"><span class="record-dot svelte-d8pwpf" aria-hidden="true"></span><span class="duration svelte-d8pwpf"> </span><!></span>'),sf=I('<div class="tile svelte-d8pwpf"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),of=I('<div class="attachment-row svelte-d8pwpf" role="group" data-dock-media-attachments=""></div>'),lf=I("<!> <!> <!>",1),df=I('<img draggable="false" class="svelte-d8pwpf"/>'),cf=I('<video controls="" playsinline="" class="svelte-d8pwpf"></video>',2),uf=I('<div class="media-viewer svelte-d8pwpf"><!></div>'),ff=I("<!> <!>",1);function gf(r,t){if(new.target)return yt({component:gf,...r});kt(t,!0);const a=(P,he=rr,Y=rr)=>{var S=Yu(),le=U(S);st(le,{variant:"secondary",size:"icon-sm",class:"tile-action tile-remove",get disabled(){return i()},get"aria-label"(){return Y()},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return Y()},onclick:()=>O(he()),children:(Pe,Te)=>{Cs(Pe,{glyph:"x"})},$$slots:{default:!0}}),q(S),d(P,S)};let s=g(t,"items",7),o=g(t,"labels",7),i=g(t,"disabled",7,!1),c=g(t,"onMarkUp",7),u=g(t,"onEdit",7),h=g(t,"onRemove",7),v=g(t,"onRetry",7),k=g(t,"onCopy",7),E=g(t,"onMenu",7);const N=P=>P.owner==="attachment"?2:{image:0,clip:1,file:2}[P.kind],G=n(()=>[...s()].sort((P,he)=>N(P)-N(he)));let w=fe(null),T=fe(!1),re=fe(null),j=null;const A=n(()=>s().find(P=>P.id===e(re)));er(()=>{(!e(A)||e(A).kind==="image"&&!V(e(A)))&&B(T,!1)});function V(P){return P.kind==="image"&&P.status!=="placing"&&P.status!=="failed"&&P.url.trim().length>0}function D(P){return P.kind==="image"?o().image(P.markCount):P.kind==="clip"?P.summary?`${o().clip(P.duration)} ${P.summary}`:o().clip(P.duration):P.name}function ae(P,he){if(!(i()||P.kind==="file"||P.kind==="image"&&!V(P)||P.kind==="clip"&&(!P.url||P.recording))){if((P.kind==="clip"||P.kind==="image")&&u()){u()(P.id);return}j=he,B(re,P.id,!0),B(T,!0)}}async function O(P){i()||(e(re)===P&&B(T,!1),h()(P),await Ia(),(!document.activeElement||document.activeElement===document.body)&&e(w)?.querySelector("button:not(:disabled)")?.focus())}function W(P){const he=s().find(Y=>Y.id===P);i()||!he||!V(he)||(B(T,!1),u()?u()(P):c()(P))}function ee(P,he){P.key!=="Delete"||i()||(P.preventDefault(),P.stopPropagation(),O(he))}function R(P){return P.status==="placing"||P.status==="failed"?!1:P.kind==="image"?!!P.file||V(P):P.kind==="clip"&&!P.recording&&!!P.url}function J(P,he){const Y=ad()?P.metaKey:P.ctrlKey,S=P.key.toLowerCase();if(Y&&!P.shiftKey&&!P.altKey&&(S==="c"||S==="x")){if(!k()||!R(he)||(P.preventDefault(),P.stopPropagation(),S==="x"&&i()))return;k()(he.id,S==="x");return}ee(P,he.id)}function se(P,he){!E()||!R(he)||(P.preventDefault(),E()(he.id))}var ke={get items(){return s()},set items(P){s(P),m()},get labels(){return o()},set labels(P){o(P),m()},get disabled(){return i()},set disabled(P=!1){i(P),m()},get onMarkUp(){return c()},set onMarkUp(P){c(P),m()},get onEdit(){return u()},set onEdit(P){u(P),m()},get onRemove(){return h()},set onRemove(P){h(P),m()},get onRetry(){return v()},set onRetry(P){v(P),m()},get onCopy(){return k()},set onCopy(P){k(P),m()},get onMenu(){return E()},set onMenu(P){E(P),m()},$set:wt,$on:(P,he)=>xt(t,P,he)},ce=ff(),me=ge(ce);{var Me=P=>{var he=of();Sr(he,21,()=>e(G),Y=>Y.id,(Y,S)=>{var le=bt(),Pe=ge(le);{var Te=pe=>{var M=ef(),X=U(M);{let z=n(()=>i()||e(S).status==="placing");wi(X,{get id(){return e(S).id},get name(){return e(S).file.name},get type(){return e(S).file.imageMimeType},get imageData(){return e(S).file.imageData},get imageMimeType(){return e(S).file.imageMimeType},variant:"thumbnail",thumbnailClass:"size-full",class:"size-full",get disabled(){return e(z)},get placementStatus(){return e(S).status},get placementError(){return e(S).error}})}var ne=C(X,2);{var _e=z=>{var ye=zo(),Ne=ie(ye,!0);L(()=>{te(ye,"data-failed",e(S).status==="failed"||void 0),te(ye,"role",e(S).status==="failed"?"alert":"status"),te(ye,"title",e(S).error),Q(Ne,e(S).status==="failed"?e(S).error??o().attachmentFailed:o().attachmentPending)}),d(z,ye)};F(ne,z=>{e(S).status&&z(_e)})}var _=C(ne,2),Ie=U(_);{var Ce=z=>{st(z,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(S).id),children:(ye,Ne)=>{Nt(ye,{get icon(){return zs},size:16})},$$slots:{default:!0}})};F(Ie,z=>{e(S).status==="failed"&&v()&&z(Ce)})}var $=C(Ie,2);{let z=n(()=>l.chat_attachmentPreview_remove_ariaLabel({name:e(S).file.name}));a($,()=>e(S).id,()=>e(z))}q(_),q(M),L(()=>te(M,"data-attachment-id",e(S).id)),Ir("keydown",M,z=>J(z,e(S))),Ir("contextmenu",M,z=>se(z,e(S))),Zt(1,M,()=>On,()=>({tier:"fast",y:3,scale:.98})),Zt(2,M,()=>Ja,()=>({tier:"fast"})),d(pe,M)},Re=pe=>{const M=n(()=>e(S).kind==="image"&&!V(e(S))&&e(S).status!=="failed");var X=sf(),ne=U(X);{var _e=xe=>{st(xe,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile file",get"aria-label"(){return e(S).name},get disabled(){return i()},onkeydown:$e=>ee($e,e(S).id),children:($e,Le)=>{var Ue=tf(),oe=ge(Ue);Nt(oe,{get icon(){return ka},size:20});var Ge=C(oe),pt=ie(Ge,!0);L(()=>Q(pt,e(S).name)),d($e,Ue)},$$slots:{default:!0}})},_=xe=>{{let $e=n(()=>D(e(S))),Le=n(()=>i()||e(S).kind==="clip"&&(e(S).recording||!e(S).url));st(xe,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile",get"aria-label"(){return e($e)},get disabled(){return e(Le)},onkeydown:Ue=>J(Ue,e(S)),onclick:Ue=>{Ue.currentTarget instanceof HTMLElement&&ae(e(S),Ue.currentTarget)},children:(Ue,oe)=>{var Ge=bt(),pt=ge(Ge);{var Ft=et=>{var Ke=rf();L(()=>te(Ke,"src",e(S).url)),d(et,Ke)},tr=et=>{var Ke=nf(),Lt=C(U(Ke)),St=ie(Lt,!0),ut=C(Lt);{var Fe=K=>{var y=af(),ve=ie(y,!0);L(()=>Q(ve,e(S).summary)),d(K,y)};F(ut,K=>{e(S).summary&&K(Fe)})}q(Ke),L(()=>Q(St,e(S).duration)),d(et,Ke)};F(pt,et=>{e(S).kind==="image"?et(Ft):et(tr,-1)})}d(Ue,Ge)},$$slots:{default:!0}})}},Ie=n(()=>e(S).kind!=="image"||V(e(S)));F(ne,xe=>{e(S).kind==="file"?xe(_e):e(Ie)&&xe(_,1)})}var Ce=C(ne,2);{var $=xe=>{var $e=zo(),Le=ie($e,!0);L(()=>{te($e,"data-failed",e(S).status==="failed"||void 0),te($e,"role",e(S).status==="failed"?"alert":"status"),te($e,"title",e(S).error),Q(Le,e(S).status==="failed"?e(S).error??o().attachmentFailed:o().attachmentPending)}),d(xe,$e)};F(Ce,xe=>{(e(S).status||e(M))&&xe($)})}var z=C(Ce,2),ye=U(z);{var Ne=xe=>{st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(S).id),children:($e,Le)=>{Nt($e,{get icon(){return zs},size:16})},$$slots:{default:!0}})},Ve=xe=>{{let $e=n(()=>u()?o().edit:o().markUp),Le=n(()=>u()?o().edit:o().markUp);st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e($e)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(Le)},onclick:()=>W(e(S).id),children:(Ue,oe)=>{Cs(Ue,{glyph:"pencil"})},$$slots:{default:!0}})}},qe=n(()=>V(e(S))),$t=xe=>{{let $e=n(()=>u()?o().edit:o().play),Le=n(()=>u()?o().edit:o().play);st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e($e)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(Le)},onclick:Ue=>{Ue.currentTarget instanceof HTMLElement&&ae(e(S),Ue.currentTarget)},children:(Ue,oe)=>{{let Ge=n(()=>u()?"pencil":"play");Cs(Ue,{get glyph(){return e(Ge)}})}},$$slots:{default:!0}})}};F(ye,xe=>{e(S).status==="failed"&&v()?xe(Ne):e(qe)?xe(Ve,1):e(S).kind==="clip"&&!e(S).recording&&e(S).url&&xe($t,2)})}var we=C(ye,2);a(we,()=>e(S).id,()=>o().remove),q(z),q(X),L(()=>{te(X,"data-kind",e(S).kind),te(X,"data-attachment-id",e(S).id),te(X,"aria-busy",e(M)||void 0)}),Ir("contextmenu",X,xe=>se(xe,e(S))),Zt(1,X,()=>On,()=>({tier:"fast",y:3,scale:.98})),Zt(2,X,()=>Ja,()=>({tier:"fast"})),d(pe,X)};F(Pe,pe=>{e(S).kind==="image"&&e(S).file?pe(Te):pe(Re,-1)})}d(Y,le)}),q(he),ea(he,Y=>B(w,Y),()=>e(w)),L(()=>te(he,"aria-label",o().attachments)),d(P,he)};F(me,P=>{e(G).length&&P(Me)})}var Be=C(me,2);{const P=Y=>{var S=bt(),le=ge(S);{var Pe=Te=>{var Re=lf(),pe=ge(Re);{var M=_=>{st(_,{variant:"primary",get disabled(){return i()},onclick:()=>e(A)&&W(e(A).id),children:(Ie,Ce)=>{mr();var $=Mr();L(()=>Q($,o().markUp)),d(Ie,$)},$$slots:{default:!0}})},X=n(()=>V(e(A)));F(pe,_=>{e(X)&&_(M)})}var ne=C(pe,2);st(ne,{variant:"secondary",get disabled(){return i()},onclick:()=>e(A)&&O(e(A).id),children:(_,Ie)=>{mr();var Ce=Mr();L(()=>Q(Ce,o().remove)),d(_,Ce)},$$slots:{default:!0}});var _e=C(ne,2);st(_e,{variant:"ghost-light",onclick:()=>{B(T,!1)},children:(_,Ie)=>{mr();var Ce=Mr();L(()=>Q(Ce,o().done)),d(_,Ce)},$$slots:{default:!0}}),d(Te,Re)};F(le,Te=>{e(A)&&e(A).kind!=="file"&&Te(Pe)})}d(Y,S)};let he=n(()=>e(A)?D(e(A)):o().attachments);yi(Be,{get title(){return e(he)},size:"wide",showCloseButton:!1,onCloseAutoFocus:Y=>{Y.preventDefault(),j?.isConnected?j.focus():e(w)?.querySelector("button:not(:disabled)")?.focus()},get open(){return e(T)},set open(Y){B(T,Y,!0)},footer:P,children:(Y,S)=>{var le=bt(),Pe=ge(le);{var Te=Re=>{var pe=uf(),M=U(pe);{var X=_=>{var Ie=df();L(Ce=>{te(Ie,"src",e(A).url),te(Ie,"alt",Ce)},[()=>D(e(A))]),d(_,Ie)},ne=n(()=>e(A).kind==="image"&&V(e(A))),_e=_=>{var Ie=cf();L(Ce=>{te(Ie,"src",e(A).url),te(Ie,"aria-label",Ce)},[()=>D(e(A))]),d(_,Ie)};F(M,_=>{e(ne)?_(X):e(A).kind==="clip"&&e(A).url&&_(_e,1)})}q(pe),d(Re,pe)};F(Pe,Re=>{e(A)&&e(A).kind!=="file"&&Re(Te)})}d(Y,le)},$$slots:{footer:!0,default:!0}})}return d(r,ce),It(ke)}Ga(["keydown","contextmenu"]);var mf=I("<!> ",1),pf=I('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function el(r,t){if(new.target)return yt({component:el,...r});kt(t,!0);let a=g(t,"name",7),s=g(t,"description",7),o=g(t,"content",7),i=g(t,"onUseScript",7),c=fe(!1);function u(){navigator.clipboard.writeText(o()),B(c,!0),setTimeout(()=>{B(c,!1)},2e3)}function h(){i()?.({name:a(),description:s(),content:o()})}var v={get name(){return a()},set name(R){a(R),m()},get description(){return s()},set description(R){s(R),m()},get content(){return o()},set content(R){o(R),m()},get onUseScript(){return i()},set onUseScript(R){i(R),m()},$set:wt,$on:(R,J)=>xt(t,R,J)},k=pf(),E=U(k),N=U(E),G=U(N),w=U(G);Nt(w,{get icon(){return ps},size:"sm"}),q(G);var T=C(G,2),re=ie(T,!0);q(N);var j=C(N,2),A=U(j);st(A,{variant:"ghost-light",size:"sm",onclick:u,class:"h-7 px-2",children:(R,J)=>{var se=mf(),ke=ge(se);{let me=n(()=>e(c)?hi:_i);Nt(ke,{get icon(){return e(me)},class:"mr-1"})}var ce=C(ke);L(me=>Q(ce,` ${me??""}`),[()=>e(c)?l.chat_shared_copied_label():l.chat_shared_copy_label()]),d(R,se)},$$slots:{default:!0}});var V=C(A,2);{var D=R=>{st(R,{variant:"ghost-light",size:"sm",onclick:h,class:"h-7 px-2",children:(J,se)=>{mr();var ke=Mr();L(ce=>Q(ke,ce),[()=>l.chat_setupScriptCard_useScript_label()]),d(J,ke)},$$slots:{default:!0}})};F(V,R=>{i()&&R(D)})}q(j),q(E);var ae=C(E,2),O=ie(ae,!0),W=C(ae,2),ee=ie(W,!0);return q(k),L(()=>{Q(re,a()),Q(O,s()),Q(ee,o())}),d(r,k),It(v)}const wr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class vf{constructor(){pa(this,"buffer","");pa(this,"currentToolName",null);pa(this,"currentToolId",null);pa(this,"lastToolId",null);pa(this,"currentToolParams",[]);pa(this,"currentToolResultContent",[]);pa(this,"inToolResult",!1);pa(this,"inCodeBlock",!1);pa(this,"codeBlockLanguage","");pa(this,"codeBlockContent","");pa(this,"characterBuffer","");pa(this,"inCharacterMode",!1);pa(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const o=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const u=this.currentToolResultContent.some(v=>v.startsWith("❌")||v.startsWith("Error:")),h=this.currentToolResultContent.map(v=>v.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
1
+ var jl=Object.defineProperty;var Vl=(r,t,a)=>t in r?jl(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a;var pa=(r,t,a)=>Vl(r,typeof t!="symbol"?t+"":t,a);import{t as yt,bo as g,bw as wt,b as xt,bm as l,bq as Ea,bs as Kt,br as Gl,bp as hn}from"./1KDVFF23.js";import{ai as Ga,bs as kt,ca as er,aD as e,bH as B,ay as ge,bS as C,a7 as bt,W as d,a5 as U,bA as q,bn as It,c9 as n,bV as fe,aA as m,b_ as L,aj as Ir,aB as I,be as mr,b$ as Mr,bO as Q,bf as rr,c0 as Ia,bl as ie,bj as ja,c6 as Kl,bo as nn,br as Zr,am as Da,ax as Ba,bk as rs,aw as pn,bz as as,cb as Bn,c5 as Mn,aC as Tr,cd as vo,bv as Zl}from"./3SdAC2_C.js";import{i as F}from"./Zg9SWWIQ.js";import{g as Sr,e as da,p as ms,i as Ha,I as Ql,h as Ys,X as pi,o as Xl}from"./CYCawVEx.js";import{n as Zt,l as On,c as Ja,g as rn,s as ks,k as ns,S as Jl}from"./CjK2zm52.js";import{s as te,f as ze,g as _n,c as Pt,e as Yt,b as bn,p as Yl,S as ed,C as td}from"./D8B7qxXm.js";import{b as ea}from"./Dn334wJv.js";import{f as st,ae as eo,a_ as rd}from"./DPbnmxjX.js";import{J as ad,O as nd,Q as Is}from"./BpT_ybtH.js";import"./Ch-pFfsN.js";import"./IdqO6uHC.js";import"./CBLFNmYJ.js";import{k as vi,s as Na}from"./Dmy603At.js";import{F as Nt,a4 as zs,bg as ka,cK as ps,au as hi,aZ as _i,aK as sd,c9 as od,a6 as ss,aN as id,cN as ld,cM as dd,a3 as vs,aC as os,aw as hs,I as ho,aj as cd,bu as ud,aS as fd,aX as gd,bJ as md,ao as pd,bk as bi,cC as vd,aP as _o,c0 as Ss,aI as Wn,cW as hd,cb as _d,bn as bd,b as yd,cp as wd,ag as xd,ba as Ts,cr as wn,cF as kd,az as Id,c6 as Sd,d3 as Td}from"./BZytk_HL.js";import{C as yi,A as Cd,o as Md}from"./DHbv9I-C.js";import{b as Cs,V as bo}from"./Ug7t_gUQ.js";import{A as wi,I as Ad,R as Pd,q as Rd}from"./ucKP4cAm.js";import{bZ as xi,aj as Nd,j as Gn,a4 as Ws,al as is,E as Ed,au as Kn,aP as $d,aS as yo}from"./Cvp_IOBl.js";import{t as an,o as Ld}from"./DAsc1V4f.js";import{ch as Zn,aP as qn,d2 as ki,d4 as Va,c6 as _s,q as Od,cX as Ii,d1 as bs,d0 as Si,c_ as Ti,n as Ca,al as qd,am as Dd,aJ as Bd,z as Fd,V as zd,a3 as wo,D as Ci,e4 as Wd,bq as Mi,av as Ai,aM as Hd,aF as Ud,ak as jd,r as Vd,C as Ms,ag as Gd,U as xn,e2 as Kd,ab as Zd,k as xo,u as Qd,Z as Xd,v as Jd,i as Yd,g as As,f as ko,a0 as ec,$ as tc,a9 as rc,x as Pi,y as Ri,l as Ni,j as ac,s as nc,a as sc,d5 as oc,ae as ic,e3 as lc,L as dc,F as cc,a2 as Io}from"./DkYquFOp.js";import{Jr as mt,oZ as uc,tO as Qn,nO as So,vH as Ei,vJ as $i,r$ as fc,yF as ls,u_ as Li,nJ as Oi,bq as En,nW as gc,nX as mc,yG as pc,qx as vc,ti as hc,vA as qi,nI as _c,mN as bc,m as yc,z7 as wc,z4 as xc,z6 as kc}from"./BPo1GPk4.js";import{a3 as Ic,y as Ps,a1 as Sc,O as Rs,W as Tc,$ as Cc,k as Mc,p as kn,P as un,q as Ac,G as Pc,v as Rc,t as Nc,M as Ns,K as Ec,z as $c,L as Lc,_ as An,U as Hn,N as To,n as Co,E as Oc,c as Es,F as Mo,B as qc,w as Ao,J as Pn,Q as Dc,H as Bc,j as Fc,R as zc,T as Wc,A as Hc,g as Uc,b as jc,D as Vc,f as Gc,e as Kc,a as Zc,C as Qc,i as Xc,d as ds,V as Di,a4 as Jc,u as Yc,l as eu}from"./CJBG3N9y.js";import{i as tu,e as ru}from"./C7Ibt0hX.js";import{g as $s}from"./B5aYN90J.js";import{M as In,C as Rn}from"./D6W9Whdp.js";import{C as Po}from"./DzTe1W0Z.js";import"./DzsC5hAQ.js";import{P as au}from"./DdJ4cD_u.js";import"./DJk5np0g.js";import{c as Bi}from"./ChTqQfQN.js";import{S as nu}from"./BzwPeFzF.js";import{D as Ro,M as su}from"./kZL4nf_J.js";import{b as ou,s as en,c as cs}from"./P27dN3C7.js";import{O as Xn,y as Ls,E as Os,B as qs,N as iu,m as lu,l as du,k as Fi,d as vn,C as No,f as cu,e as uu,g as fu}from"./sZBOVpM6.js";import{a as zi,s as Eo}from"./BsieX9dN.js";import{f as gu}from"./BdWqymET.js";import{c as na}from"./CT6GHk2v.js";import{a as mu,k as Wi,h as to,q as Hi,l as kr}from"./CntPxeXh.js";import{P as pu}from"./Dzl5aoA8.js";import{r as Ds,q as Bs,B as $o,i as vu}from"./Ydj2ePK_.js";import{R as Ui,C as ys,m as hu,h as _u,g as bu,i as Lo,P as yu}from"./D7vAVIvz.js";import"./jUAybD8G.js";import{c as wu,s as xu}from"./ZWIGjqdM.js";import{h as gn}from"./BpimY2Bn.js";import{b as ku,a as ji}from"./BePTHsT0.js";import{P as Vi}from"./DHSWOw-U.js";import{B as Iu}from"./DT8FaJbg.js";import{o as Gi,r as Su,e as Tu}from"./DZEGFjPx.js";import{o as Ki}from"./D5raGlU7.js";import{A as Jn,b as Zi}from"./Bek4Es60.js";import{g as ro}from"./KImhPY_I.js";import{a as Cu,M as Mu}from"./J9vGyyn3.js";import{t as xr}from"./C-BsEdGZ.js";import{E as Au,n as Pu}from"./Q-Hp56ht.js";import{c as Sn}from"./DpSAF6fh.js";import{A as Ru}from"./Bo5PTszQ.js";import{f as Nu,d as Eu}from"./BkmrZjpE.js";import{ac as $u,$ as Qi,_ as Xi,N as Lu,Y as Ou,K as Oo,X as qu,v as Du}from"./pIjvEfMB.js";import{a as Bu}from"./CC7to1B5.js";import{k as Fu}from"./Dhj-Oo-y.js";import{S as zu}from"./CToFQRbb.js";import{u as Wu,a as Hu,c as qo,S as Uu}from"./D9tVylVS.js";import{T as us}from"./C82gBCX8.js";import"./CBmGf0Ke.js";import{g as ju,a as Vu}from"./xJBWkpxc.js";import{a as Gu}from"./471Fgn_p.js";import{b as Ji}from"./BMfUzLG6.js";import{b as Do}from"./goTpbPhD.js";import{ah as Ua,n as Ku}from"./CMgAi196.js";import{c as Zu}from"./YopO0YfH.js";import{r as Bo}from"./KaHKnBKn.js";function Qu(r){if(!r||typeof r!="object")return null;const t=r;if(t.type!=="script_monitor_wake"||t.source!=="system")return null;const{scriptName:a,scriptId:s,runId:o,monitorId:i,workspaceId:c,reason:u}=t;if(typeof a!="string"||typeof s!="string"||!s||typeof o!="string"||!o||typeof i!="string"||!i||typeof c!="string"||!c||u!=="finished"&&u!=="ttl-expired"&&u!=="output-match"&&u!=="line-count")return null;const h=t.trigger;return{scriptName:a,scriptId:s,runId:o,monitorId:i,workspaceId:c,reason:u,...u==="output-match"&&typeof h?.matchedLine=="string"?{matchedLine:h.matchedLine}:{}}}function Xu(r){return r?.type==="script_monitor_wake"&&!("remoteAgentId"in r)}function Ju(r,t,a,s=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const o=r.messageMetadata?.fromPrincipalId??r.author?.principalId,i=$u(r)&&r.author?.principalId!==null&&o===t;return{edit:i,remove:i||t===a||s,sendNow:(i||s)&&!Yi(r)}}function Tn(r,t){if(t)return r.find(a=>a.editing&&a.editingMessageId?a.editingMessageId===t:a.id===t)}function Yi(r){return Xu(r.messageMetadata)&&typeof r.messageMetadata?.monitorId=="string"}function Fo(r,t=Date.now()){const a=r.messageMetadata,s=a?.fromPrincipalId,o=a&&Object.hasOwn(a,"humanAuthor")&&!(typeof s=="string"&&s.length>0),i=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!i&&!o&&!Yi(r)}const Ib="pl-3.5! pr-2!";var Yu=I('<span class="tile-remove-slot svelte-d8pwpf"><!></span>'),zo=I('<span class="attachment-status svelte-d8pwpf"> </span>'),ef=I('<div class="file-image tile svelte-d8pwpf" data-kind="file"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),tf=I("<!><span> </span>",1),rf=I('<img alt="" draggable="false"/>'),af=I('<span class="summary svelte-d8pwpf" data-clip-summary=""> </span>'),nf=I('<span class="clip svelte-d8pwpf"><span class="record-dot svelte-d8pwpf" aria-hidden="true"></span><span class="duration svelte-d8pwpf"> </span><!></span>'),sf=I('<div class="tile svelte-d8pwpf"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),of=I('<div class="attachment-row svelte-d8pwpf" role="group" data-dock-media-attachments=""></div>'),lf=I("<!> <!> <!>",1),df=I('<img draggable="false" class="svelte-d8pwpf"/>'),cf=I('<video controls="" playsinline="" class="svelte-d8pwpf"></video>',2),uf=I('<div class="media-viewer svelte-d8pwpf"><!></div>'),ff=I("<!> <!>",1);function gf(r,t){if(new.target)return yt({component:gf,...r});kt(t,!0);const a=(P,he=rr,Y=rr)=>{var S=Yu(),le=U(S);st(le,{variant:"secondary",size:"icon-sm",class:"tile-action tile-remove",get disabled(){return i()},get"aria-label"(){return Y()},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return Y()},onclick:()=>O(he()),children:(Pe,Te)=>{Cs(Pe,{glyph:"x"})},$$slots:{default:!0}}),q(S),d(P,S)};let s=g(t,"items",7),o=g(t,"labels",7),i=g(t,"disabled",7,!1),c=g(t,"onMarkUp",7),u=g(t,"onEdit",7),h=g(t,"onRemove",7),v=g(t,"onRetry",7),k=g(t,"onCopy",7),E=g(t,"onMenu",7);const N=P=>P.owner==="attachment"?2:{image:0,clip:1,file:2}[P.kind],G=n(()=>[...s()].sort((P,he)=>N(P)-N(he)));let w=fe(null),T=fe(!1),re=fe(null),j=null;const A=n(()=>s().find(P=>P.id===e(re)));er(()=>{(!e(A)||e(A).kind==="image"&&!V(e(A)))&&B(T,!1)});function V(P){return P.kind==="image"&&P.status!=="placing"&&P.status!=="failed"&&P.url.trim().length>0}function D(P){return P.kind==="image"?o().image(P.markCount):P.kind==="clip"?P.summary?`${o().clip(P.duration)} ${P.summary}`:o().clip(P.duration):P.name}function ae(P,he){if(!(i()||P.kind==="file"||P.kind==="image"&&!V(P)||P.kind==="clip"&&(!P.url||P.recording))){if((P.kind==="clip"||P.kind==="image")&&u()){u()(P.id);return}j=he,B(re,P.id,!0),B(T,!0)}}async function O(P){i()||(e(re)===P&&B(T,!1),h()(P),await Ia(),(!document.activeElement||document.activeElement===document.body)&&e(w)?.querySelector("button:not(:disabled)")?.focus())}function W(P){const he=s().find(Y=>Y.id===P);i()||!he||!V(he)||(B(T,!1),u()?u()(P):c()(P))}function ee(P,he){P.key!=="Delete"||i()||(P.preventDefault(),P.stopPropagation(),O(he))}function R(P){return P.status==="placing"||P.status==="failed"?!1:P.kind==="image"?!!P.file||V(P):P.kind==="clip"&&!P.recording&&!!P.url}function J(P,he){const Y=ad()?P.metaKey:P.ctrlKey,S=P.key.toLowerCase();if(Y&&!P.shiftKey&&!P.altKey&&(S==="c"||S==="x")){if(!k()||!R(he)||(P.preventDefault(),P.stopPropagation(),S==="x"&&i()))return;k()(he.id,S==="x");return}ee(P,he.id)}function se(P,he){!E()||!R(he)||(P.preventDefault(),E()(he.id))}var ke={get items(){return s()},set items(P){s(P),m()},get labels(){return o()},set labels(P){o(P),m()},get disabled(){return i()},set disabled(P=!1){i(P),m()},get onMarkUp(){return c()},set onMarkUp(P){c(P),m()},get onEdit(){return u()},set onEdit(P){u(P),m()},get onRemove(){return h()},set onRemove(P){h(P),m()},get onRetry(){return v()},set onRetry(P){v(P),m()},get onCopy(){return k()},set onCopy(P){k(P),m()},get onMenu(){return E()},set onMenu(P){E(P),m()},$set:wt,$on:(P,he)=>xt(t,P,he)},ce=ff(),me=ge(ce);{var Me=P=>{var he=of();Sr(he,21,()=>e(G),Y=>Y.id,(Y,S)=>{var le=bt(),Pe=ge(le);{var Te=pe=>{var M=ef(),X=U(M);{let z=n(()=>i()||e(S).status==="placing");wi(X,{get id(){return e(S).id},get name(){return e(S).file.name},get type(){return e(S).file.imageMimeType},get imageData(){return e(S).file.imageData},get imageMimeType(){return e(S).file.imageMimeType},variant:"thumbnail",thumbnailClass:"size-full",class:"size-full",get disabled(){return e(z)},get placementStatus(){return e(S).status},get placementError(){return e(S).error}})}var ne=C(X,2);{var _e=z=>{var ye=zo(),Ne=ie(ye,!0);L(()=>{te(ye,"data-failed",e(S).status==="failed"||void 0),te(ye,"role",e(S).status==="failed"?"alert":"status"),te(ye,"title",e(S).error),Q(Ne,e(S).status==="failed"?e(S).error??o().attachmentFailed:o().attachmentPending)}),d(z,ye)};F(ne,z=>{e(S).status&&z(_e)})}var _=C(ne,2),Ie=U(_);{var Ce=z=>{st(z,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(S).id),children:(ye,Ne)=>{Nt(ye,{get icon(){return zs},size:16})},$$slots:{default:!0}})};F(Ie,z=>{e(S).status==="failed"&&v()&&z(Ce)})}var $=C(Ie,2);{let z=n(()=>l.chat_attachmentPreview_remove_ariaLabel({name:e(S).file.name}));a($,()=>e(S).id,()=>e(z))}q(_),q(M),L(()=>te(M,"data-attachment-id",e(S).id)),Ir("keydown",M,z=>J(z,e(S))),Ir("contextmenu",M,z=>se(z,e(S))),Zt(1,M,()=>On,()=>({tier:"fast",y:3,scale:.98})),Zt(2,M,()=>Ja,()=>({tier:"fast"})),d(pe,M)},Re=pe=>{const M=n(()=>e(S).kind==="image"&&!V(e(S))&&e(S).status!=="failed");var X=sf(),ne=U(X);{var _e=xe=>{st(xe,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile file",get"aria-label"(){return e(S).name},get disabled(){return i()},onkeydown:$e=>ee($e,e(S).id),children:($e,Le)=>{var Ue=tf(),oe=ge(Ue);Nt(oe,{get icon(){return ka},size:20});var Ge=C(oe),pt=ie(Ge,!0);L(()=>Q(pt,e(S).name)),d($e,Ue)},$$slots:{default:!0}})},_=xe=>{{let $e=n(()=>D(e(S))),Le=n(()=>i()||e(S).kind==="clip"&&(e(S).recording||!e(S).url));st(xe,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile",get"aria-label"(){return e($e)},get disabled(){return e(Le)},onkeydown:Ue=>J(Ue,e(S)),onclick:Ue=>{Ue.currentTarget instanceof HTMLElement&&ae(e(S),Ue.currentTarget)},children:(Ue,oe)=>{var Ge=bt(),pt=ge(Ge);{var Ft=et=>{var Ke=rf();L(()=>te(Ke,"src",e(S).url)),d(et,Ke)},tr=et=>{var Ke=nf(),Lt=C(U(Ke)),St=ie(Lt,!0),ut=C(Lt);{var Fe=K=>{var y=af(),ve=ie(y,!0);L(()=>Q(ve,e(S).summary)),d(K,y)};F(ut,K=>{e(S).summary&&K(Fe)})}q(Ke),L(()=>Q(St,e(S).duration)),d(et,Ke)};F(pt,et=>{e(S).kind==="image"?et(Ft):et(tr,-1)})}d(Ue,Ge)},$$slots:{default:!0}})}},Ie=n(()=>e(S).kind!=="image"||V(e(S)));F(ne,xe=>{e(S).kind==="file"?xe(_e):e(Ie)&&xe(_,1)})}var Ce=C(ne,2);{var $=xe=>{var $e=zo(),Le=ie($e,!0);L(()=>{te($e,"data-failed",e(S).status==="failed"||void 0),te($e,"role",e(S).status==="failed"?"alert":"status"),te($e,"title",e(S).error),Q(Le,e(S).status==="failed"?e(S).error??o().attachmentFailed:o().attachmentPending)}),d(xe,$e)};F(Ce,xe=>{(e(S).status||e(M))&&xe($)})}var z=C(Ce,2),ye=U(z);{var Ne=xe=>{st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(S).id),children:($e,Le)=>{Nt($e,{get icon(){return zs},size:16})},$$slots:{default:!0}})},Ve=xe=>{{let $e=n(()=>u()?o().edit:o().markUp),Le=n(()=>u()?o().edit:o().markUp);st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e($e)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(Le)},onclick:()=>W(e(S).id),children:(Ue,oe)=>{Cs(Ue,{glyph:"pencil"})},$$slots:{default:!0}})}},qe=n(()=>V(e(S))),$t=xe=>{{let $e=n(()=>u()?o().edit:o().play),Le=n(()=>u()?o().edit:o().play);st(xe,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e($e)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(Le)},onclick:Ue=>{Ue.currentTarget instanceof HTMLElement&&ae(e(S),Ue.currentTarget)},children:(Ue,oe)=>{{let Ge=n(()=>u()?"pencil":"play");Cs(Ue,{get glyph(){return e(Ge)}})}},$$slots:{default:!0}})}};F(ye,xe=>{e(S).status==="failed"&&v()?xe(Ne):e(qe)?xe(Ve,1):e(S).kind==="clip"&&!e(S).recording&&e(S).url&&xe($t,2)})}var we=C(ye,2);a(we,()=>e(S).id,()=>o().remove),q(z),q(X),L(()=>{te(X,"data-kind",e(S).kind),te(X,"data-attachment-id",e(S).id),te(X,"aria-busy",e(M)||void 0)}),Ir("contextmenu",X,xe=>se(xe,e(S))),Zt(1,X,()=>On,()=>({tier:"fast",y:3,scale:.98})),Zt(2,X,()=>Ja,()=>({tier:"fast"})),d(pe,X)};F(Pe,pe=>{e(S).kind==="image"&&e(S).file?pe(Te):pe(Re,-1)})}d(Y,le)}),q(he),ea(he,Y=>B(w,Y),()=>e(w)),L(()=>te(he,"aria-label",o().attachments)),d(P,he)};F(me,P=>{e(G).length&&P(Me)})}var Be=C(me,2);{const P=Y=>{var S=bt(),le=ge(S);{var Pe=Te=>{var Re=lf(),pe=ge(Re);{var M=_=>{st(_,{variant:"primary",get disabled(){return i()},onclick:()=>e(A)&&W(e(A).id),children:(Ie,Ce)=>{mr();var $=Mr();L(()=>Q($,o().markUp)),d(Ie,$)},$$slots:{default:!0}})},X=n(()=>V(e(A)));F(pe,_=>{e(X)&&_(M)})}var ne=C(pe,2);st(ne,{variant:"secondary",get disabled(){return i()},onclick:()=>e(A)&&O(e(A).id),children:(_,Ie)=>{mr();var Ce=Mr();L(()=>Q(Ce,o().remove)),d(_,Ce)},$$slots:{default:!0}});var _e=C(ne,2);st(_e,{variant:"ghost-light",onclick:()=>{B(T,!1)},children:(_,Ie)=>{mr();var Ce=Mr();L(()=>Q(Ce,o().done)),d(_,Ce)},$$slots:{default:!0}}),d(Te,Re)};F(le,Te=>{e(A)&&e(A).kind!=="file"&&Te(Pe)})}d(Y,S)};let he=n(()=>e(A)?D(e(A)):o().attachments);yi(Be,{get title(){return e(he)},size:"wide",showCloseButton:!1,onCloseAutoFocus:Y=>{Y.preventDefault(),j?.isConnected?j.focus():e(w)?.querySelector("button:not(:disabled)")?.focus()},get open(){return e(T)},set open(Y){B(T,Y,!0)},footer:P,children:(Y,S)=>{var le=bt(),Pe=ge(le);{var Te=Re=>{var pe=uf(),M=U(pe);{var X=_=>{var Ie=df();L(Ce=>{te(Ie,"src",e(A).url),te(Ie,"alt",Ce)},[()=>D(e(A))]),d(_,Ie)},ne=n(()=>e(A).kind==="image"&&V(e(A))),_e=_=>{var Ie=cf();L(Ce=>{te(Ie,"src",e(A).url),te(Ie,"aria-label",Ce)},[()=>D(e(A))]),d(_,Ie)};F(M,_=>{e(ne)?_(X):e(A).kind==="clip"&&e(A).url&&_(_e,1)})}q(pe),d(Re,pe)};F(Pe,Re=>{e(A)&&e(A).kind!=="file"&&Re(Te)})}d(Y,le)},$$slots:{footer:!0,default:!0}})}return d(r,ce),It(ke)}Ga(["keydown","contextmenu"]);var mf=I("<!> ",1),pf=I('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function el(r,t){if(new.target)return yt({component:el,...r});kt(t,!0);let a=g(t,"name",7),s=g(t,"description",7),o=g(t,"content",7),i=g(t,"onUseScript",7),c=fe(!1);function u(){navigator.clipboard.writeText(o()),B(c,!0),setTimeout(()=>{B(c,!1)},2e3)}function h(){i()?.({name:a(),description:s(),content:o()})}var v={get name(){return a()},set name(R){a(R),m()},get description(){return s()},set description(R){s(R),m()},get content(){return o()},set content(R){o(R),m()},get onUseScript(){return i()},set onUseScript(R){i(R),m()},$set:wt,$on:(R,J)=>xt(t,R,J)},k=pf(),E=U(k),N=U(E),G=U(N),w=U(G);Nt(w,{get icon(){return ps},size:"sm"}),q(G);var T=C(G,2),re=ie(T,!0);q(N);var j=C(N,2),A=U(j);st(A,{variant:"ghost-light",size:"sm",onclick:u,class:"h-7 px-2",children:(R,J)=>{var se=mf(),ke=ge(se);{let me=n(()=>e(c)?hi:_i);Nt(ke,{get icon(){return e(me)},class:"mr-1"})}var ce=C(ke);L(me=>Q(ce,` ${me??""}`),[()=>e(c)?l.chat_shared_copied_label():l.chat_shared_copy_label()]),d(R,se)},$$slots:{default:!0}});var V=C(A,2);{var D=R=>{st(R,{variant:"ghost-light",size:"sm",onclick:h,class:"h-7 px-2",children:(J,se)=>{mr();var ke=Mr();L(ce=>Q(ke,ce),[()=>l.chat_setupScriptCard_useScript_label()]),d(J,ke)},$$slots:{default:!0}})};F(V,R=>{i()&&R(D)})}q(j),q(E);var ae=C(E,2),O=ie(ae,!0),W=C(ae,2),ee=ie(W,!0);return q(k),L(()=>{Q(re,a()),Q(O,s()),Q(ee,o())}),d(r,k),It(v)}const wr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class vf{constructor(){pa(this,"buffer","");pa(this,"currentToolName",null);pa(this,"currentToolId",null);pa(this,"lastToolId",null);pa(this,"currentToolParams",[]);pa(this,"currentToolResultContent",[]);pa(this,"inToolResult",!1);pa(this,"inCodeBlock",!1);pa(this,"codeBlockLanguage","");pa(this,"codeBlockContent","");pa(this,"characterBuffer","");pa(this,"inCharacterMode",!1);pa(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const o=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const u=this.currentToolResultContent.some(v=>v.startsWith("❌")||v.startsWith("Error:")),h=this.currentToolResultContent.map(v=>v.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
2
2
  `);o.push({type:"tool_result",content:h,metadata:{toolId:this.currentToolId,isError:u}}),this.lastToolId=this.currentToolId,this.currentToolId=null,this.inToolResult=!1,this.currentToolResultContent=[]}const i=t.indexOf("🤖"),c=t.substring(i+2);if(this.inCharacterMode=!0,this.characterBuffer="",c&&c.trim()&&c!==`
3
3
  `){const u=c.replace(/^\n/,"");u&&(this.characterBuffer=u)}return o}if(this.inCharacterMode){if(t.trim()===""&&this.characterBuffer==="")return[];if(t.includes(`
4
4
  `)&&this.characterBuffer.length>0){const o=t.substring(0,t.indexOf(`
@@ -1,2 +1,2 @@
1
- import{K as jt}from"./7FS8g33K.js";import{V as Ut}from"./9Fwj-RCt.js";import{bI as Mt,aD as s,aG as zt,bH as Ie,bV as Me,bs as dt,ca as _t,c0 as Ht,a5 as j,bS as u,bl as F,bA as U,b_ as v,bO as l,aw as Kt,W as n,bn as pt,c9 as y,aA as T,aB as N,b$ as L,bf as ee,a7 as $,ay as w,be as De,am as Fe,ax as Ee}from"./3SdAC2_C.js";import{t as vt,bo as O,bm as _,bw as ut,b as ct,bs as Ze,bq as qt}from"./1KDVFF23.js";import{i as I}from"./Zg9SWWIQ.js";import{s as je,f as Ue,g as Be}from"./D8B7qxXm.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as Vt}from"./DM81x_EL.js";import{k as et}from"./Dhj-Oo-y.js";import{s as tt}from"./Dmy603At.js";import{n as se,b as at,j as ge}from"./CjK2zm52.js";import{F as $t,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./BZytk_HL.js";import{m as ea}from"./D7vAVIvz.js";import{f as Le}from"./DPbnmxjX.js";import"./BpT_ybtH.js";import{T as rt}from"./D_xvUCUD.js";import"./ChTqQfQN.js";import"./jUAybD8G.js";import"./BPo1GPk4.js";import{q as ta,h as aa,S as ra}from"./CkmjUBxn.js";import{O as We}from"./Cfy5Crpr.js";import{be as na,D as sa,q as oa}from"./CHHUtp07.js";import{d as ia}from"./DxrRvklK.js";import{s as la,f as da,c as nt}from"./fFnyP4ej.js";function ar(M){let b=0,E=!1;function Q(x){E!==x&&(E=x,M.onDragChange(x))}function Z(){b=0,Q(!1)}function X(x){return M.isEnabled&&!M.isEnabled()?!1:jt(x)}return{handleDragEnter(x){X(x)&&(x.preventDefault(),b++,Q(!0))},handleDragLeave(x){X(x)&&(x.preventDefault(),b=Math.max(0,b-1),b===0&&Q(!1))},handleDragOver(x){X(x)&&x.preventDefault()},handleDrop(x){if(!X(x))return;x.preventDefault(),Z();const G=Ut(x.dataTransfer);(G.files.length>0||G.folderFiles.length>0)&&M.onDrop(G)},reset:Z}}const gt=Symbol("panel-file-drop-context");function rr(){let M=Me(null);const b={register(E){Ie(M,E)},unregister(E){s(M)===E&&Ie(M,null)}};return Mt(gt,b),{context:b,handler:{get current(){return s(M)}}}}function nr(){return zt(gt)??null}var _a=N('<p class="type-caption text-subtle"> </p>'),pa=N('<div class="space-y-1" data-remote-setup-log=""><!> <pre role="log" tabindex="0"> </pre></div>');function va(M,b){if(new.target)return vt({component:va,...M});dt(b,!0);let E=O(b,"machine",7),Q=O(b,"output",7),Z=O(b,"truncated",7,!1);const X=y(()=>Gt({chunks:[{text:Q()??"",timestamp:""}]}).join(`
1
+ import{K as jt}from"./ZWIGjqdM.js";import{V as Ut}from"./ucKP4cAm.js";import{bI as Mt,aD as s,aG as zt,bH as Ie,bV as Me,bs as dt,ca as _t,c0 as Ht,a5 as j,bS as u,bl as F,bA as U,b_ as v,bO as l,aw as Kt,W as n,bn as pt,c9 as y,aA as T,aB as N,b$ as L,bf as ee,a7 as $,ay as w,be as De,am as Fe,ax as Ee}from"./3SdAC2_C.js";import{t as vt,bo as O,bm as _,bw as ut,b as ct,bs as Ze,bq as qt}from"./1KDVFF23.js";import{i as I}from"./Zg9SWWIQ.js";import{s as je,f as Ue,g as Be}from"./D8B7qxXm.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as Vt}from"./Ydj2ePK_.js";import{k as et}from"./Dhj-Oo-y.js";import{s as tt}from"./Dmy603At.js";import{n as se,b as at,j as ge}from"./CjK2zm52.js";import{F as $t,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./BZytk_HL.js";import{m as ea}from"./D7vAVIvz.js";import{f as Le}from"./DPbnmxjX.js";import"./BpT_ybtH.js";import{T as rt}from"./D_xvUCUD.js";import"./ChTqQfQN.js";import"./jUAybD8G.js";import"./BPo1GPk4.js";import{q as ta,h as aa,S as ra}from"./sZBOVpM6.js";import{O as We}from"./CCWqLSpV.js";import{be as na,D as sa,q as oa}from"./C_0xgdqY.js";import{d as ia}from"./BkmrZjpE.js";import{s as la,f as da,c as nt}from"./fFnyP4ej.js";function ar(M){let b=0,E=!1;function Q(x){E!==x&&(E=x,M.onDragChange(x))}function Z(){b=0,Q(!1)}function X(x){return M.isEnabled&&!M.isEnabled()?!1:jt(x)}return{handleDragEnter(x){X(x)&&(x.preventDefault(),b++,Q(!0))},handleDragLeave(x){X(x)&&(x.preventDefault(),b=Math.max(0,b-1),b===0&&Q(!1))},handleDragOver(x){X(x)&&x.preventDefault()},handleDrop(x){if(!X(x))return;x.preventDefault(),Z();const G=Ut(x.dataTransfer);(G.files.length>0||G.folderFiles.length>0)&&M.onDrop(G)},reset:Z}}const gt=Symbol("panel-file-drop-context");function rr(){let M=Me(null);const b={register(E){Ie(M,E)},unregister(E){s(M)===E&&Ie(M,null)}};return Mt(gt,b),{context:b,handler:{get current(){return s(M)}}}}function nr(){return zt(gt)??null}var _a=N('<p class="type-caption text-subtle"> </p>'),pa=N('<div class="space-y-1" data-remote-setup-log=""><!> <pre role="log" tabindex="0"> </pre></div>');function va(M,b){if(new.target)return vt({component:va,...M});dt(b,!0);let E=O(b,"machine",7),Q=O(b,"output",7),Z=O(b,"truncated",7,!1);const X=y(()=>Gt({chunks:[{text:Q()??"",timestamp:""}]}).join(`
2
2
  `));let x=Me(null),G=!0;function V(){s(x)&&(G=s(x).scrollHeight-s(x).scrollTop-s(x).clientHeight<8)}_t(()=>{s(X),!(!s(x)||!G)&&Ht().then(()=>{s(x)&&(s(x).scrollTop=s(x).scrollHeight)})});var oe={get machine(){return E()},set machine(R){E(R),T()},get output(){return Q()},set output(R){Q(R),T()},get truncated(){return Z()},set truncated(R=!1){Z(R),T()},$set:ut,$on:(R,J)=>ct(b,R,J)},H=pa(),te=j(H);{var ae=R=>{var J=_a(),W=F(J,!0);v(re=>l(W,re),[()=>_.remoteAgent_setup_outputTruncated()]),n(R,J)};I(te,R=>{Z()&&R(ae)})}var q=u(te,2),pe=F(q,!0);return Yt(q,R=>Ie(x,R),()=>s(x)),U(H),v((R,J)=>{je(q,"aria-label",R),Ue(q,1,`max-h-60 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 px-3 py-2 font-mono text-xs ${s(X)?"text-foreground":"text-subtle"} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`),l(pe,J)},[()=>_.remoteAgent_setup_outputLabel({machine:E()}),()=>s(X)||_.remoteAgent_setup_noOutput()]),Kt("scroll",q,V),n(M,H),pt(oe)}var ua=N('<span class="inline-flex items-center gap-1.5 svelte-enden2"> </span>'),ca=N('<h3 class="text-lg font-semibold tracking-[-0.016em] transition-colors duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2"><!></h3>'),ga=N('<span class="inline-block col-span-1 row-span-1 svelte-enden2"> </span>'),fa=N('<span class="text-sm font-mono text-muted-foreground tabular-nums svelte-enden2"><span class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></span> </span>'),ma=N('<div class="absolute inset-0 left-5 svelte-enden2"><!></div>'),st=N('<div class="svelte-enden2"><!></div>'),ba=N('<div class="relative flex items-start overflow-hidden rounded-md py-0.75 text-base leading-relaxed svelte-enden2"><!> <span data-testid="workspace-setup-step-icon"><!></span> <div class="setup-step-content min-w-0 text-muted-foreground font-normal leading-snug relative z-10 svelte-enden2" data-testid="workspace-setup-step-content"><!></div></div>'),xa=N('<div class="mt-1 text-xs tabular-nums svelte-enden2" data-testid="setup-card-progress-transfer"> </div>'),ha=N('<span data-testid="setup-card-progress-label" class="svelte-enden2"> </span> <div class="mt-1 h-[2px] w-full max-w-64 rounded-full bg-secondary overflow-hidden svelte-enden2"><div class="h-full bg-foreground/60 transition-[width] duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-testid="setup-card-progress-bar"></div></div> <!>',1),fe=N(" <!>",1),Ca=N('<span data-testid="setup-card-plain-folder" class="svelte-enden2"> <!> </span>'),wa=N(' <code class="text-sm bg-secondary py-1 px-1.5 svelte-enden2"> </code> <!>',1),ot=N(" <!> <!>",1),Sa=N(' <span class="svelte-enden2"> </span> ',1),ya=N(' <span class="svelte-enden2"> </span> <!>',1),ka=N('<span class="underline underline-offset-2 svelte-enden2"> </span><span class="whitespace-nowrap svelte-enden2"><span class="underline underline-offset-2 svelte-enden2"> </span><span class="setup-reference-punctuation svelte-enden2" aria-hidden="true"> </span></span>',1),Pa=N("<!> ",1),it=N('<span class="svelte-enden2"> </span>'),_e=N(" <!> ",1),Da=N('<pre class="text-xs text-muted-foreground font-mono leading-snug line-clamp-2 whitespace-pre-wrap svelte-enden2"> </pre>'),lt=N('<span class="text-xs text-muted-foreground opacity-50 svelte-enden2"> </span>'),Ia=N(" <!> <!> ",1),Na=N('<p class="text-xs text-muted-foreground leading-snug svelte-enden2"> </p>'),Ta=N('<div><div class="flex items-baseline gap-2.5 pt-3 pb-2 svelte-enden2"><div class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></div> <!></div> <div class="space-y-0.5 pb-4 svelte-enden2"><!> <!> <!> <!></div></div>');function Oa(M,b){if(new.target)return vt({component:Oa,...M});dt(b,!0);const E=()=>Ze(ft,"$progressEntry$",Z),Q=()=>Ze(mt,"$specialists$",Z),[Z,X]=qt();let x=O(b,"repoName",7),G=O(b,"repoPath",7),V=O(b,"worktreePath",7),oe=O(b,"workspaceId",7),H=O(b,"branch",7),te=O(b,"baseRef",7,"origin/main"),ae=O(b,"projectType",7),q=O(b,"setupScriptStatus",7),pe=O(b,"setupScriptContent",7),R=O(b,"onFocusSetupTerminal",7),J=O(b,"specialistName",7),W=O(b,"specialistId",7),re=O(b,"hasPrompt",7,!0),ve=O(b,"repoStatus",7,"pending"),me=O(b,"branchStatus",7,"pending"),be=O(b,"agentStatus",7,"pending"),ie=O(b,"skipIsolation",7,!1),ue=O(b,"plainFolder",7,!1),Ne=O(b,"progressId",7);const ft=la(Ne()??""),mt=na();let xe=Me(0);_t(()=>{const d=Math.min(E()?.percent??0,100);d>s(xe)&&Ie(xe,d,!0)});const bt=y(()=>E()?.sawFrame===!0),ze=y(()=>E()?.transfer?Vt(E().transfer):null),xt=y(()=>te().replace(/^[^/]+\//,"")),Te=y(()=>W()?oa(W()):void 0),ht=y(()=>W()?Q().find(d=>d.id===W()):void 0),Ct=y(()=>s(ht)?.name||s(Te)?.name||J()),He=y(()=>W()==="spec-writer"||W()===sa),Ke=y(()=>{const d=ue()?[ve()]:[ve(),me()];return q()&&d.push(q()),d.push(be()),d}),Oe=y(()=>s(Ke).length),qe=y(()=>s(Ke).filter(d=>d==="done").length),Ye=y(()=>Math.min(s(qe)+1,s(Oe))),ye=y(()=>s(qe)===s(Oe)),Ge=y(()=>s(ye)?_.onboarding_setupCard_ready_title():_.onboarding_setupCard_settingUp_title());function wt(d,B){navigator.clipboard.writeText(d),ea.success(_.onboarding_setupCard_copied_label({label:B}))}function Ae(d){return d.replace(/^\/Users\/[^/]+/,"~")}function St(){W()&&ia({specialist:W(),hash:"specialists"})}var yt={get repoName(){return x()},set repoName(d){x(d),T()},get repoPath(){return G()},set repoPath(d){G(d),T()},get worktreePath(){return V()},set worktreePath(d){V(d),T()},get workspaceId(){return oe()},set workspaceId(d){oe(d),T()},get branch(){return H()},set branch(d){H(d),T()},get baseRef(){return te()},set baseRef(d="origin/main"){te(d),T()},get projectType(){return ae()},set projectType(d){ae(d),T()},get setupScriptStatus(){return q()},set setupScriptStatus(d){q(d),T()},get setupScriptContent(){return pe()},set setupScriptContent(d){pe(d),T()},get onFocusSetupTerminal(){return R()},set onFocusSetupTerminal(d){R(d),T()},get specialistName(){return J()},set specialistName(d){J(d),T()},get specialistId(){return W()},set specialistId(d){W(d),T()},get hasPrompt(){return re()},set hasPrompt(d=!0){re(d),T()},get repoStatus(){return ve()},set repoStatus(d="pending"){ve(d),T()},get branchStatus(){return me()},set branchStatus(d="pending"){me(d),T()},get agentStatus(){return be()},set agentStatus(d="pending"){be(d),T()},get skipIsolation(){return ie()},set skipIsolation(d=!1){ie(d),T()},get plainFolder(){return ue()},set plainFolder(d=!1){ue(d),T()},get progressId(){return Ne()},set progressId(d){Ne(d),T()},$set:ut,$on:(d,B)=>ct(b,d,B)},ke=Ta(),Pe=j(ke);Be(Pe,"",{},{"padding-inline":"var(--operational-row-inline-padding)"});var Re=j(Pe),kt=j(Re);et(kt,()=>s(ye),d=>{var B=ca(),le=j(B);{var he=Y=>{var z=ua(),we=F(z,!0);v(()=>l(we,s(Ge))),n(Y,z)},Ce=Y=>{var z=L();v(()=>l(z,s(Ge))),n(Y,z)};I(le,Y=>{s(ye)?Y(he):Y(Ce,-1)})}U(B),se(1,B,()=>at,()=>({tier:"slow",distance:3})),se(2,B,()=>at,()=>({tier:"slow",distance:3})),n(d,B)}),U(Re);var Pt=u(Re,2);{var Dt=d=>{var B=fa(),le=j(B),he=j(le);et(he,()=>s(Ye),Y=>{var z=ga(),we=F(z,!0);v(()=>l(we,s(Ye))),se(1,z,()=>ge,()=>({axis:"y",tier:"slow"})),n(Y,z)}),U(le);var Ce=u(le);U(B),v(()=>l(Ce,`/${s(Oe)??""}`)),n(d,B)};I(Pt,d=>{s(ye)||d(Dt)})}U(Pe);var Ve=u(Pe,2);{const d=(f,h=ee,P=ee,D=ee,S=ee,C=ee)=>{var o=ba();Be(o,"",{},{gap:"0.25rem","padding-inline":"var(--operational-row-inline-padding)"});var t=j(o);{var e=m=>{var k=ma(),A=j(k);ra(A,{}),U(k),n(m,k)};I(t,m=>{h()==="active"&&m(e)})}var a=u(t,2),r=j(a);$t(r,{get icon(){return P()},size:14,get class(){return D()}}),U(a);var i=u(a,2),c=j(i);{var g=m=>{var k=st(),A=j(k);tt(A,S),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)},p=m=>{var k=st(),A=j(k);tt(A,C),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)};I(c,m=>{h()==="active"?m(g):m(p,-1)})}U(i),U(o),v(()=>Ue(a,1,`${aa} relative z-10 mt-1 flex size-4 shrink-0 items-center justify-start`,"svelte-enden2")),se(3,o,()=>ge,()=>({tier:"slow"})),n(f,o)},B=(f,h)=>{let P=Fe(()=>Ee(h?.(),""));var D=$(),S=w(D);{var C=t=>{{let e=y(()=>_.onboarding_setupCard_originalFolder_label());z(t,x,()=>s(e),G,()=>s(P))}},o=t=>{var e=L();v(()=>l(e,`${x()??""}${s(P)??""}`)),n(t,e)};I(S,t=>{G()?t(C):t(o,-1)})}n(f,D)},le=f=>{var h=$(),P=w(h);{var D=o=>{var t=ha(),e=w(t),a=F(e,!0),r=u(e,2),i=F(r),c=u(r,2);{var g=p=>{var m=xa(),k=F(m,!0);v(()=>l(k,s(ze))),n(p,m)};I(c,p=>{s(ze)&&p(g)})}v((p,m)=>{l(a,p),Be(i,`width: ${s(xe)??""}%`),je(i,"aria-label",m),je(i,"aria-valuenow",s(xe))},[()=>_.workspace_compactInitializer_progressWithPercent_label({label:nt(E()),percent:da(s(xe))}),()=>nt(E())]),n(o,t)},S=o=>{var t=fe(),e=w(t),a=u(e);{let r=y(()=>_.onboarding_setupCard_opening_after());B(a,()=>s(r))}v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_opening_before()]),n(o,t)},C=o=>{var t=fe(),e=w(t),a=u(e);B(a),v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_creatingIsolatedCopy_before()]),n(o,t)};I(P,o=>{s(bt)&&E()?o(D):ie()||ue()?o(S,1):o(C,-1)})}n(f,h)},he=f=>{var h=$(),P=w(h);{var D=o=>{const t=y(()=>V()||G());var e=Ca(),a=j(e),r=u(a);{var i=p=>{We(p,{get filePath(){return s(t)},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(m,k)=>{{let A=y(()=>Ae(s(t)));Y(m,()=>s(A),()=>".")}},$$slots:{default:!0}})},c=p=>{var m=L();v(()=>l(m,`${x()??""}.`)),n(p,m)};I(r,p=>{s(t)?p(i):p(c,-1)})}var g=u(r);U(e),v((p,m)=>{l(a,`${p??""} `),l(g,` ${m??""}`)},[()=>_.onboarding_setupCard_workingInFolder_before(),()=>_.onboarding_setupCard_plainFolderInPlace_label()]),n(o,e)},S=o=>{var t=wa(),e=w(t),a=u(e),r=F(a,!0),i=u(a,2);{var c=p=>{var m=fe(),k=w(m),A=u(k);We(A,{get filePath(){return V()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(K,de)=>{{let ne=y(()=>Ae(V()));Y(K,()=>s(ne),()=>".")}},$$slots:{default:!0}}),v(K=>l(k,` ${K??""} `),[()=>_.onboarding_setupCard_at_label()]),n(p,m)},g=p=>{var m=L(".");n(p,m)};I(i,p=>{V()?p(c):p(g,-1)})}v(p=>{l(e,`${p??""} `),l(r,s(xt))},[()=>_.onboarding_setupCard_workingDirectlyOn_before()]),n(o,t)},C=o=>{var t=ot(),e=w(t),a=u(e);B(a);var r=u(a,2);{var i=g=>{var p=fe(),m=w(p),k=u(m);We(k,{get filePath(){return V()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(A,K)=>{{let de=y(()=>Ae(V()));Y(A,()=>s(de),()=>".")}},$$slots:{default:!0}}),v(A=>l(m,` ${A??""} `),[()=>_.onboarding_setupCard_at_label()]),n(g,p)},c=g=>{var p=L(".");n(g,p)};I(r,g=>{V()?g(i):g(c,-1)})}v(g=>l(e,`${g??""} `),[()=>_.onboarding_setupCard_createdIsolatedCopy_before()]),n(o,t)};I(P,o=>{ue()?o(D):ie()?o(S,1):o(C,-1)})}n(f,h)},Ce=f=>{var h=$(),P=w(h);{var D=o=>{var t=$(),e=w(t);{var a=i=>{var c=Sa(),g=w(c),p=u(g),m=F(p,!0),k=u(p,1,!0);v((A,K)=>{l(g,`${A??""} `),l(m,H()),l(k,K)},[()=>_.onboarding_setupCard_workingOnBranchNamed_before(),()=>_.onboarding_setupCard_workingOnBranchActive_after()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ya(),e=w(t),a=u(e),r=F(a,!0),i=u(a),c=u(i);{let g=y(()=>_.onboarding_setupCard_baseRef_label()),p=y(()=>_.onboarding_setupCard_creatingBranch_after());z(c,te,()=>s(g),()=>{},()=>s(p))}v((g,p)=>{l(e,`${g??""} `),l(r,H()),l(i,` ${p??""} `)},[()=>_.onboarding_setupCard_creatingBranch_before(),()=>_.onboarding_setupCard_creatingBranch_middle()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_creatingBranchNoName_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Y=(f,h=ee,P)=>{let D=Fe(()=>Ee(P?.(),""));const S=y(()=>Array.from(h()));var C=ka(),o=w(C),t=F(o,!0),e=u(o),a=j(e),r=F(a,!0),i=u(a),c=F(i,!0);U(e),v((g,p)=>{l(t,g),l(r,p),l(c,s(D))},[()=>s(S).slice(0,-1).join(""),()=>s(S).at(-1)??""]),n(f,C)},z=(f,h=ee,P=ee,D=ee,S)=>{let C=Fe(()=>Ee(S?.(),""));const o=y(()=>s(C).match(/^\p{P}+/u)?.[0]??"");var t=Pa(),e=w(t);Le(e,{variant:"plain",wrapContent:!1,class:"setup-inline-link cursor-pointer hover:text-foreground transition-colors",onclick:()=>wt(D()??h(),P()),children:(r,i)=>{Y(r,h,()=>s(o))},$$slots:{default:!0}});var a=u(e,1,!0);v(r=>l(a,r),[()=>s(C).slice(s(o).length)]),n(f,t)},we=f=>{var h=$(),P=w(h);{var D=o=>{var t=$(),e=w(t);{var a=i=>{var c=fe(),g=w(c),p=u(g);{let m=y(()=>_.onboarding_setupCard_branchName_label()),k=y(()=>_.onboarding_setupCard_workingOnBranchDone_after());z(p,H,()=>s(m),()=>{},()=>s(k))}v(m=>l(g,`${m??""} `),[()=>_.onboarding_setupCard_workingOnBranchNamed_before()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingDirectlyOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ot(),e=w(t),a=u(e);{let i=y(()=>_.onboarding_setupCard_branchName_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_middle());z(a,H,()=>s(i),()=>{},()=>s(c))}var r=u(a,2);{let i=y(()=>_.onboarding_setupCard_baseRef_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_after());z(r,te,()=>s(i),()=>{},()=>s(c))}v(i=>l(e,`${i??""} `),[()=>_.onboarding_setupCard_workingInNewBranch_before()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_branchCreated_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Ft=f=>{De();var h=_e(),P=w(h),D=u(P);{var S=t=>{var e=it(),a=F(e,!0);v(()=>l(a,ae())),n(t,e)},C=t=>{var e=L();v(a=>l(e,a),[()=>_.onboarding_setupCard_project_label()]),n(t,e)};I(D,t=>{ae()?t(S):t(C,-1)})}var o=u(D);v((t,e)=>{l(P,`${t??""} `),l(o,` ${e??""}`)},[()=>_.onboarding_setupCard_runningSetup_before(),()=>_.onboarding_setupCard_runningSetup_after()]),n(f,h)},Et=f=>{De();var h=Ia(),P=w(h),D=u(P);{var S=r=>{var i=it(),c=F(i,!0);v(()=>l(c,ae())),n(r,i)},C=r=>{var i=L();v(c=>l(i,c),[()=>_.onboarding_setupCard_project_label()]),n(r,i)};I(D,r=>{ae()?r(S):r(C,-1)})}var o=u(D),t=u(o);{var e=r=>{var i=fe(),c=w(i),g=u(c);rt(g,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:A=>{Le(A,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",get onclick(){return R()},children:(K,de)=>{De();var ne=L();v(Se=>l(ne,Se),[()=>_.onboarding_setupCard_terminalTab_label()]),n(K,ne)},$$slots:{default:!0}})},content:A=>{var K=$(),de=w(K);{var ne=Se=>{var Qe=Da(),Wt=F(Qe,!0);v(()=>l(Wt,pe())),n(Se,Qe)};I(de,Se=>{pe()&&Se(ne)})}n(A,K)},footer:A=>{var K=lt(),de=F(K,!0);v(ne=>l(de,ne),[()=>_.onboarding_setupCard_openTerminal_footer()]),n(A,K)},$$slots:{trigger:!0,content:!0,footer:!0}}),v(p=>l(c,` ${p??""} `),[()=>_.onboarding_setupCard_ranSetupIn_middle()]),n(r,i)};I(t,r=>{R()&&r(e)})}var a=u(t,1,!0);v((r,i,c)=>{l(P,`${r??""} `),l(o,` ${i??""}`),l(a,c)},[()=>_.onboarding_setupCard_ranSetup_before(),()=>_.onboarding_setupCard_ranSetup_middle(),()=>_.onboarding_setupCard_ranSetup_after()]),n(f,h)},ce=f=>{rt(f,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:S=>{Le(S,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",onclick:St,children:(C,o)=>{De();var t=L();v(()=>l(t,s(Ct))),n(C,t)},$$slots:{default:!0}})},content:S=>{var C=$(),o=w(C);{var t=e=>{var a=Na(),r=F(a,!0);v(()=>l(r,s(Te).description)),n(e,a)};I(o,e=>{s(Te)&&e(t)})}n(S,C)},footer:S=>{var C=lt(),o=F(C,!0);v(t=>l(o,t),[()=>_.onboarding_setupCard_editInSettings_footer()]),n(S,C)},$$slots:{trigger:!0,content:!0,footer:!0}})},Bt=f=>{var h=$(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specStartingUp_before(),()=>_.onboarding_setupCard_specStartingUp_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_startingUpNamed_before(),()=>_.onboarding_setupCard_startingUpNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_startingUp_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)},Lt=f=>{var h=$(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specDone_before(),()=>_.onboarding_setupCard_specDone_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentDoneNamed_before(),()=>_.onboarding_setupCard_agentDoneNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentOrienting_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)};var $e=j(Ve);{var It=f=>{d(f,ve,()=>Xt,()=>"-ml-px transform scale-[0.98]",()=>le,()=>he)};I($e,f=>{ve()!=="pending"&&f(It)})}var Xe=u($e,2);{var Nt=f=>{d(f,me,()=>Jt,()=>"",()=>Ce,()=>we)};I(Xe,f=>{me()!=="pending"&&!ie()&&!ue()&&f(Nt)})}var Je=u(Xe,2);{var Tt=f=>{d(f,q,()=>Qt,()=>"ml-[0.5px]",()=>Ft,()=>Et)};I(Je,f=>{q()&&q()!=="pending"&&f(Tt)})}var Ot=u(Je,2);{var At=f=>{d(f,be,()=>Zt,()=>"ml-[-0.5px]",()=>Bt,()=>Lt)};I(Ot,f=>{be()!=="pending"&&f(At)})}U(Ve)}U(ke),v(()=>Ue(ke,1,`${ta} w-full overflow-hidden transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none`,"svelte-enden2")),n(M,ke);var Rt=pt(yt);return X(),Rt}export{va as R,Oa as W,rr as a,ar as c,nr as g};
@@ -1 +1 @@
1
- import{t as $,bo as v,bw as w,b as A,br as P,bs as B,bq as W,bp as R}from"./1KDVFF23.js";import{bs as h,b_ as F,aD as p,W as f,bA as M,bn as y,c9 as x,aA as m,aB as g,bV as k,br as q,ca as E,bH as C,a5 as H,bl as L,bS as N,bO as U,ay as V}from"./3SdAC2_C.js";import{f as Y}from"./DPbnmxjX.js";import{Y as j}from"./BpT_ybtH.js";import{F as G,cF as J}from"./BZytk_HL.js";import{ay as K,aB as Q}from"./CMgAi196.js";import{f as X}from"./BuFlry2f.js";import{g as Z,i as ee}from"./CYCawVEx.js";import{s as te,g as se}from"./D8B7qxXm.js";import{a as z}from"./CHHUtp07.js";var ae=g('<span class="svelte-dywwvd"></span>'),re=g('<span class="waveform svelte-dywwvd" aria-hidden="true" data-dictation-waveform=""></span>');function T(c,e){if(new.target)return $({component:T,...c});h(e,!0);let n=v(e,"levels",7);const r=x(()=>{const t=n().slice(-z).map(a=>Number.isFinite(a)?Math.min(1,Math.max(0,a)):0);return[...new Array(z-t.length).fill(0),...t]});var l={get levels(){return n()},set levels(t){n(t),m()},$set:w,$on:(t,a)=>A(e,t,a)},o=re();return Z(o,21,()=>p(r),ee,(t,a)=>{var i=ae();let d;F(()=>{te(i,"data-level",p(a)),d=se(i,"",d,{height:`${2+p(a)*12}px`})}),f(t,i)}),M(o),f(c,o),y(l)}var ne=g('<span class="dictation-meter svelte-1oz1rct"><span class="elapsed svelte-1oz1rct" data-dictation-elapsed=""> </span> <!></span>');function I(c,e){if(new.target)return $({component:I,...c});h(e,!0);let n=v(e,"levels",7),r=v(e,"startedAt",7,null),l=v(e,"elapsed",7),o=k(q(Date.now()));E(()=>{if(!(l()!==void 0||r()===null))return C(o,Date.now(),!0),j.subscribe(new Date(r()),()=>C(o,Date.now(),!0),"second")});const t=x(()=>l()??X(r()===null?0:p(o)-r()));var a={get levels(){return n()},set levels(s){n(s),m()},get startedAt(){return r()},set startedAt(s=null){r(s),m()},get elapsed(){return l()},set elapsed(s){l(s),m()},$set:w,$on:(s,u)=>A(e,s,u)},i=ne(),d=H(i),_=L(d,!0),b=N(d,2);return T(b,{get levels(){return n()}}),M(i),F(()=>U(_,p(t))),f(c,i),y(a)}var le=new Set(["$$slots","$$events","$$legacy","class"]),oe=g("<!> <!>",1);function ie(c,e){if(new.target)return $({component:ie,...c});h(e,!0);const n=()=>B(i,"$levels$",l),r=()=>B(d,"$startedAt$",l),[l,o]=W();let t=v(e,"class",7,""),a=R(e,le);const i=K(),d=Q();var _={get class(){return t()},set class(s=""){t(s),m()},$set:w,$on:(s,u)=>A(e,s,u)};{let s=x(()=>`dictation-stop-pill ${t()}`.trim());Y(c,P({variant:"ghost",size:"sm",get class(){return p(s)},"aria-pressed":"true"},()=>a,{children:(u,ce)=>{var D=oe(),S=V(D);G(S,{get icon(){return J},size:14});var O=N(S,2);I(O,{get levels(){return n()},get startedAt(){return r()}}),f(u,D)},$$slots:{default:!0}}))}var b=y(_);return o(),b}export{I as D,ie as a};
1
+ import{t as $,bo as v,bw as w,b as A,br as P,bs as B,bq as W,bp as R}from"./1KDVFF23.js";import{bs as h,b_ as F,aD as p,W as f,bA as M,bn as y,c9 as x,aA as m,aB as g,bV as k,br as q,ca as E,bH as C,a5 as H,bl as L,bS as N,bO as U,ay as V}from"./3SdAC2_C.js";import{f as Y}from"./DPbnmxjX.js";import{Y as j}from"./BpT_ybtH.js";import{F as G,cF as J}from"./BZytk_HL.js";import{ay as K,aB as Q}from"./CMgAi196.js";import{f as X}from"./BuFlry2f.js";import{g as Z,i as ee}from"./CYCawVEx.js";import{s as te,g as se}from"./D8B7qxXm.js";import{a as z}from"./C_0xgdqY.js";var ae=g('<span class="svelte-dywwvd"></span>'),re=g('<span class="waveform svelte-dywwvd" aria-hidden="true" data-dictation-waveform=""></span>');function T(c,e){if(new.target)return $({component:T,...c});h(e,!0);let n=v(e,"levels",7);const r=x(()=>{const t=n().slice(-z).map(a=>Number.isFinite(a)?Math.min(1,Math.max(0,a)):0);return[...new Array(z-t.length).fill(0),...t]});var l={get levels(){return n()},set levels(t){n(t),m()},$set:w,$on:(t,a)=>A(e,t,a)},o=re();return Z(o,21,()=>p(r),ee,(t,a)=>{var i=ae();let d;F(()=>{te(i,"data-level",p(a)),d=se(i,"",d,{height:`${2+p(a)*12}px`})}),f(t,i)}),M(o),f(c,o),y(l)}var ne=g('<span class="dictation-meter svelte-1oz1rct"><span class="elapsed svelte-1oz1rct" data-dictation-elapsed=""> </span> <!></span>');function I(c,e){if(new.target)return $({component:I,...c});h(e,!0);let n=v(e,"levels",7),r=v(e,"startedAt",7,null),l=v(e,"elapsed",7),o=k(q(Date.now()));E(()=>{if(!(l()!==void 0||r()===null))return C(o,Date.now(),!0),j.subscribe(new Date(r()),()=>C(o,Date.now(),!0),"second")});const t=x(()=>l()??X(r()===null?0:p(o)-r()));var a={get levels(){return n()},set levels(s){n(s),m()},get startedAt(){return r()},set startedAt(s=null){r(s),m()},get elapsed(){return l()},set elapsed(s){l(s),m()},$set:w,$on:(s,u)=>A(e,s,u)},i=ne(),d=H(i),_=L(d,!0),b=N(d,2);return T(b,{get levels(){return n()}}),M(i),F(()=>U(_,p(t))),f(c,i),y(a)}var le=new Set(["$$slots","$$events","$$legacy","class"]),oe=g("<!> <!>",1);function ie(c,e){if(new.target)return $({component:ie,...c});h(e,!0);const n=()=>B(i,"$levels$",l),r=()=>B(d,"$startedAt$",l),[l,o]=W();let t=v(e,"class",7,""),a=R(e,le);const i=K(),d=Q();var _={get class(){return t()},set class(s=""){t(s),m()},$set:w,$on:(s,u)=>A(e,s,u)};{let s=x(()=>`dictation-stop-pill ${t()}`.trim());Y(c,P({variant:"ghost",size:"sm",get class(){return p(s)},"aria-pressed":"true"},()=>a,{children:(u,ce)=>{var D=oe(),S=V(D);G(S,{get icon(){return J},size:14});var O=N(S,2);I(O,{get levels(){return n()},get startedAt(){return r()}}),f(u,D)},$$slots:{default:!0}}))}var b=y(_);return o(),b}export{I as D,ie as a};