@intent-hq/web 2.393.1 → 2.393.3

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/{C0tj6dfD.js → 1hYP3gUi.js} +1 -1
  3. package/web/app/immutable/chunks/{6gbXuD_9.js → 3cqOz24Y.js} +1 -1
  4. package/web/app/immutable/chunks/{BJTRhgs4.js → 4S_VTOEd.js} +1 -1
  5. package/web/app/immutable/chunks/{ye-GTjqo.js → 7jJBRPuC.js} +1 -1
  6. package/web/app/immutable/chunks/{DgmcmslQ.js → 9jgTbtbx.js} +1 -1
  7. package/web/app/immutable/chunks/{CS_KcnQC.js → B0-XNHTt.js} +1 -1
  8. package/web/app/immutable/chunks/{Baa59Un_.js → B2oWWvmu.js} +1 -1
  9. package/web/app/immutable/chunks/{ClK_UzEg.js → B4PY6IBn.js} +1 -1
  10. package/web/app/immutable/chunks/{D5vlW2SV.js → B81OcyKa.js} +1 -1
  11. package/web/app/immutable/chunks/{CMQzFQs4.js → BAbkro4M.js} +1 -1
  12. package/web/app/immutable/chunks/{B8COfuyw.js → BBcvOTyw.js} +1 -1
  13. package/web/app/immutable/chunks/{K6U2gbY4.js → BBwJ6R_2.js} +1 -1
  14. package/web/app/immutable/chunks/{BGntbMwK.js → BCFVOqXG.js} +1 -1
  15. package/web/app/immutable/chunks/{CxYEPO2e.js → BCeYsgrF.js} +1 -1
  16. package/web/app/immutable/chunks/{B5JMHmH2.js → BDScbqCA.js} +4 -4
  17. package/web/app/immutable/chunks/{CC5YTA05.js → BGH3Mfz3.js} +1 -1
  18. package/web/app/immutable/chunks/{C4P8DeLE.js → BGd1YVoP.js} +1 -1
  19. package/web/app/immutable/chunks/{C0yEXWZT.js → BH-HGq36.js} +1 -1
  20. package/web/app/immutable/chunks/{BoAOWVTV.js → BHk56AdF.js} +1 -1
  21. package/web/app/immutable/chunks/{CLXQSor9.js → BJ0QRkN-.js} +1 -1
  22. package/web/app/immutable/chunks/{ChnCUogL.js → BO2_KEmt.js} +1 -1
  23. package/web/app/immutable/chunks/{Bb15Q1ED.js → BOnUtfX8.js} +2 -2
  24. package/web/app/immutable/chunks/{BHwv4Hfl.js → BRQ0liSU.js} +1 -1
  25. package/web/app/immutable/chunks/{B4H39zb5.js → BRiR-Zth.js} +1 -1
  26. package/web/app/immutable/chunks/{BYFF4vXy.js → BTPQU-z7.js} +1 -1
  27. package/web/app/immutable/chunks/{CMtZLqiA.js → BUjLhONp.js} +1 -1
  28. package/web/app/immutable/chunks/{BvADYKOZ.js → BWBkq3pF.js} +2 -2
  29. package/web/app/immutable/chunks/{BDDEENB9.js → BWRYOYiz.js} +1 -1
  30. package/web/app/immutable/chunks/{DRVUI7n3.js → BYX9AHij.js} +1 -1
  31. package/web/app/immutable/chunks/{BGzLfgjy.js → Bcse_lR0.js} +1 -1
  32. package/web/app/immutable/chunks/{DU4u3RKB.js → BdiIB6Yl.js} +6 -6
  33. package/web/app/immutable/chunks/{8XCqMH_A.js → BgOktWwA.js} +1 -1
  34. package/web/app/immutable/chunks/{03rp11-0.js → BkFyPgDC.js} +1 -1
  35. package/web/app/immutable/chunks/{BiH1hXHp.js → Bm7In3hk.js} +1 -1
  36. package/web/app/immutable/chunks/{IuSiCp89.js → BndMbF4K.js} +1 -1
  37. package/web/app/immutable/chunks/{0fp6eBJ2.js → Boq8HoOO.js} +2 -2
  38. package/web/app/immutable/chunks/{B08hyH_t.js → BpLwFQ4q.js} +1 -1
  39. package/web/app/immutable/chunks/{CkT6bu2G.js → BpbkT3oI.js} +1 -1
  40. package/web/app/immutable/chunks/{_fNgz67j.js → BtF1bAoK.js} +1 -1
  41. package/web/app/immutable/chunks/{CNzTIPQp.js → BvyE7Laj.js} +1 -1
  42. package/web/app/immutable/chunks/{CKuv24OA.js → Bw78SA5p.js} +1 -1
  43. package/web/app/immutable/chunks/{D-IVWxYX.js → BxFoilQ9.js} +1 -1
  44. package/web/app/immutable/chunks/{DOrnNMXq.js → BxGGM6yg.js} +1 -1
  45. package/web/app/immutable/chunks/{P235vPf0.js → C1Mafuc_.js} +1 -1
  46. package/web/app/immutable/chunks/{Dl68BOSP.js → C484SieG.js} +1 -1
  47. package/web/app/immutable/chunks/{C9DL5612.js → C48kHoSC.js} +1 -1
  48. package/web/app/immutable/chunks/{CBDRhyjO.js → C5ULvu55.js} +1 -1
  49. package/web/app/immutable/chunks/{BfFqg0tr.js → C6QqVRYv.js} +1 -1
  50. package/web/app/immutable/chunks/{QiDikPQa.js → CDWLAx5B.js} +1 -1
  51. package/web/app/immutable/chunks/{2z2xJ2W_.js → CFNZ2elP.js} +2 -2
  52. package/web/app/immutable/chunks/{CfAvt2Zs.js → CLpY_BTv.js} +1 -1
  53. package/web/app/immutable/chunks/{D9lcY5kd.js → CQ1arf_8.js} +1 -1
  54. package/web/app/immutable/chunks/{Bx5_x_xs.js → CQ5WwXMH.js} +1 -1
  55. package/web/app/immutable/chunks/{DEVOS0tD.js → CQGw2ngo.js} +1 -1
  56. package/web/app/immutable/chunks/{D1rlIs5V.js → CRkv8ORO.js} +1 -1
  57. package/web/app/immutable/chunks/{BX6KUKcp.js → CT99PSFO.js} +1 -1
  58. package/web/app/immutable/chunks/{DN6txiJA.js → CVy1I5Tf.js} +1 -1
  59. package/web/app/immutable/chunks/{BBA4NncC.js → Cin4QH9G.js} +1 -1
  60. package/web/app/immutable/chunks/{Cwn1Htr4.js → CpCK2F1J.js} +1 -1
  61. package/web/app/immutable/chunks/{BGZDnsPV.js → Cq4GWvZ6.js} +2 -2
  62. package/web/app/immutable/chunks/{DJWOAwhC.js → Cqrkv-H5.js} +1 -1
  63. package/web/app/immutable/chunks/{DOYZ_D5o.js → CrdlEOtV.js} +1 -1
  64. package/web/app/immutable/chunks/{CNZpDeJb.js → CsYwlYPO.js} +1 -1
  65. package/web/app/immutable/chunks/{DZYGgiAb.js → CsrgAtz4.js} +1 -1
  66. package/web/app/immutable/chunks/{C3PqMGoR.js → CuE3-kO9.js} +1 -1
  67. package/web/app/immutable/chunks/{By2IWKC2.js → Cvgz5PHt.js} +1 -1
  68. package/web/app/immutable/chunks/{BMejr7u6.js → Cwh2ERPd.js} +1 -1
  69. package/web/app/immutable/chunks/{BGBZTOoV.js → CxUkAnkT.js} +2 -2
  70. package/web/app/immutable/chunks/{D2Y-4Hk1.js → Cy-mrEW6.js} +1 -1
  71. package/web/app/immutable/chunks/{DAvgrUpQ.js → Cy7t1cj5.js} +3 -3
  72. package/web/app/immutable/chunks/{Bl5dZSyT.js → CyhCdFNi.js} +2 -2
  73. package/web/app/immutable/chunks/{DUINlo9r.js → D0GH9QLb.js} +1 -1
  74. package/web/app/immutable/chunks/{BF2WXZJV.js → D1iAnKfV.js} +1 -1
  75. package/web/app/immutable/chunks/{DdNl3Rbm.js → D2EUZ0ZO.js} +3 -3
  76. package/web/app/immutable/chunks/{DeZREu1L.js → D4OT4rrq.js} +1 -1
  77. package/web/app/immutable/chunks/{Bw9UsBZT.js → D5KV67Mc.js} +1 -1
  78. package/web/app/immutable/chunks/{edvxHiJh.js → D9ey7F5y.js} +3 -3
  79. package/web/app/immutable/chunks/{BhzVqZCt.js → DBfbcrJt.js} +1 -1
  80. package/web/app/immutable/chunks/{Jpb8pOEi.js → DCG5E-Rx.js} +1 -1
  81. package/web/app/immutable/chunks/{BdvX8QCl.js → DDHiwKe-.js} +1 -1
  82. package/web/app/immutable/chunks/{BQr_CU_m.js → DHcJTGyy.js} +1 -1
  83. package/web/app/immutable/chunks/{CKGl1DmB.js → DIYRwakx.js} +1 -1
  84. package/web/app/immutable/chunks/{C12O35p-.js → DO3GIDaJ.js} +1 -1
  85. package/web/app/immutable/chunks/{DJPdI2sS.js → DO55QNxM.js} +7 -7
  86. package/web/app/immutable/chunks/{7qqqYD-I.js → DSsXp2Fj.js} +1 -1
  87. package/web/app/immutable/chunks/{BZDblkH_.js → DUHrEYc1.js} +1 -1
  88. package/web/app/immutable/chunks/{Dq1yTcBb.js → DbC0CEpK.js} +1 -1
  89. package/web/app/immutable/chunks/{B2p16ZcG.js → DbWtWMk_.js} +1 -1
  90. package/web/app/immutable/chunks/{CU4LG5o2.js → Dd82TT1o.js} +2 -2
  91. package/web/app/immutable/chunks/{D8BXRngi.js → DdSppEiH.js} +1 -1
  92. package/web/app/immutable/chunks/{BTVapThA.js → DedAwzLZ.js} +1 -1
  93. package/web/app/immutable/chunks/{BZcIlO-m.js → DemvDFU8.js} +1 -1
  94. package/web/app/immutable/chunks/{BGLaHsDV.js → DfAPgw64.js} +1 -1
  95. package/web/app/immutable/chunks/{Bz-k4xjY.js → DheFXFny.js} +1 -1
  96. package/web/app/immutable/chunks/{xXSv9C4P.js → DiUW4tT2.js} +1 -1
  97. package/web/app/immutable/chunks/{Dp6gutm7.js → DitJsTJy.js} +4 -4
  98. package/web/app/immutable/chunks/{BbwMNYGv.js → DkgGR1Rc.js} +3 -3
  99. package/web/app/immutable/chunks/{C2BkU_2B.js → DlVCEQ4B.js} +1 -1
  100. package/web/app/immutable/chunks/{DyFjB_S6.js → DnEe-7rI.js} +1 -1
  101. package/web/app/immutable/chunks/{CRNqz-CU.js → DoEdbEDC.js} +3 -3
  102. package/web/app/immutable/chunks/{BX6cGa3P.js → DoeYH-os.js} +1 -1
  103. package/web/app/immutable/chunks/{E6pB77s3.js → Dp0QLJ1t.js} +1 -1
  104. package/web/app/immutable/chunks/{X-RVyfO0.js → DpZnkOzK.js} +1 -1
  105. package/web/app/immutable/chunks/{CMHMpoVu.js → DpdO1dt4.js} +3 -3
  106. package/web/app/immutable/chunks/{PIyjm_eA.js → DvRaf0Wu.js} +1 -1
  107. package/web/app/immutable/chunks/{BU9PIki-.js → DwFh-UdE.js} +1 -1
  108. package/web/app/immutable/chunks/{6c2NdJk5.js → F0GjcITn.js} +1 -1
  109. package/web/app/immutable/chunks/{CFsh8rrs.js → HS4gU3Ib.js} +2 -2
  110. package/web/app/immutable/chunks/{DhA_Bjtj.js → LOQb0MVD.js} +1 -1
  111. package/web/app/immutable/chunks/{CHRXhmu4.js → NcCSP8R8.js} +1 -1
  112. package/web/app/immutable/chunks/{CGnjVQAU.js → O3tRt9ce.js} +2 -2
  113. package/web/app/immutable/chunks/{BUHPTzFz.js → XIaNS5jX.js} +1 -1
  114. package/web/app/immutable/chunks/{DpmfoOfT.js → XiPXGVAu.js} +1 -1
  115. package/web/app/immutable/chunks/{BSCmeu0N.js → ZgcC8xYU.js} +1 -1
  116. package/web/app/immutable/chunks/{BSglkeCR.js → ZnqiQki6.js} +1 -1
  117. package/web/app/immutable/chunks/{kc2Bsov-.js → _RCqdVrO.js} +1 -1
  118. package/web/app/immutable/chunks/{Dpt3eqkJ.js → bxbfFhrc.js} +1 -1
  119. package/web/app/immutable/chunks/{DMZaN70J.js → gxSHYj7K.js} +1 -1
  120. package/web/app/immutable/chunks/{CiezGigq.js → i1rnFpiA.js} +1 -1
  121. package/web/app/immutable/chunks/{BVY7HYcm.js → juQPJGiw.js} +1 -1
  122. package/web/app/immutable/chunks/{Bv6jwx4N.js → k_aih3uY.js} +1 -1
  123. package/web/app/immutable/chunks/{CD6SknDy.js → lCjMfiFA.js} +1 -1
  124. package/web/app/immutable/chunks/{Do3KjvK9.js → m2BU4-Rt.js} +1 -1
  125. package/web/app/immutable/chunks/{DjepxDVb.js → qV7UW5Ug.js} +4 -4
  126. package/web/app/immutable/chunks/{DBMzxcUI.js → qdGFil8r.js} +1 -1
  127. package/web/app/immutable/chunks/{2E4Z_ZFq.js → vsxZGfvn.js} +1 -1
  128. package/web/app/immutable/chunks/{PBRs5SJ0.js → wrqlcU3v.js} +1 -1
  129. package/web/app/immutable/entry/{app.BdS7izm7.js → app.VUOE966v.js} +2 -2
  130. package/web/app/immutable/entry/start.D7Riteau.js +1 -0
  131. package/web/app/immutable/nodes/{0.BISzmlhW.js → 0.DQfyK6_j.js} +1 -1
  132. package/web/app/immutable/nodes/{1.Bb1ZAxDG.js → 1.B1STFUy-.js} +1 -1
  133. package/web/app/immutable/nodes/{10.BgrCgg4r.js → 10.CBxmd5KB.js} +1 -1
  134. package/web/app/immutable/nodes/{11.BY0d-QhF.js → 11.CCQiwrBP.js} +1 -1
  135. package/web/app/immutable/nodes/{15.DYwYAZ5-.js → 15.weYqAejN.js} +1 -1
  136. package/web/app/immutable/nodes/{19.Dlni-a6M.js → 19.Bvtw65sy.js} +2 -2
  137. package/web/app/immutable/nodes/{2.CG_3VZwe.js → 2.BQiuods4.js} +1 -1
  138. package/web/app/immutable/nodes/{3.Dc7zxR5A.js → 3.BWAZNQYa.js} +1 -1
  139. package/web/app/immutable/nodes/{4.BK4Q0Tjj.js → 4.CMVBMJSy.js} +1 -1
  140. package/web/app/immutable/nodes/{5.uyWg8rJg.js → 5.B0DkXq0V.js} +1 -1
  141. package/web/app/immutable/nodes/{6.CqIhg880.js → 6.DP2jCSaD.js} +1 -1
  142. package/web/app/immutable/nodes/{7.DNnSBe4i.js → 7.FmzylZ8x.js} +1 -1
  143. package/web/app/immutable/nodes/{8.BGV6mK09.js → 8.CwB2JwQ-.js} +1 -1
  144. package/web/app/immutable/nodes/{9.BKtZcPwn.js → 9.Car1SqX8.js} +2 -2
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.CnycbH9m.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./Fcr7AvC-.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Gr,c5 as Ut,a as En,$ as wa,cd as Gt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./BhYXv0ZM.js";import{k as ya}from"./Cc0763mU.js";import{c as Ct}from"./2z64ELW5.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./BRCr02in.js";import{t as $t,k as Vs}from"./CWfjuhY2.js";import{h as qs}from"./pYdPYEfN.js";import{b as Zs,a as Hs}from"./CpIcQB5T.js";import{a as Yr,o as Jr,S as Yn,E as Ws,e as Rn}from"./CBbhUF1U.js";import"./x4bPxhVW.js";import"./BzXQ5SMs.js";import"./O5ZlQHf9.js";import{r as Ks,e as Xs}from"./s_T1Uukt.js";import{m as Yt}from"./qB07BmZl.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{jz as ir,JH as le,i as Aa,v1 as Qs,br as Gs,jC as Ys,z4 as Js,z6 as eo,jv as to,U as ea,V as ta,kd as tr,k9 as Jn,jZ as na,kh as no,jM as ro,ke as ao,x6 as so,x7 as oo,x4 as io,jN as lo,kc as ra,k6 as co,jA as uo,nh as go,ng as po,jw as aa,rN as fo,k3 as vo,jB as mo,k0 as ho,jK as sa,LG as _o,jH as bo,kb as wo}from"./D0qhIm1r.js";import{a_ as lr,dI as yo,O as xo,cU as Ao}from"./Cq6hdiVw.js";import{E as ka}from"./5uPsOw59.js";import"./CpK0xLH4.js";import{m as Sn,bE as ko,A as Io,bD as Ro,e as So,ah as Mo,bC as Co,bK as Po}from"./ye-GTjqo.js";import{u as Ia}from"./BwweojP5.js";import{d2 as Ra,al as Do,d0 as $o,a1 as Eo,bH as nr,be as cr,bj as Sa,bb as To,bk as zo,bA as Uo,by as Oo,bd as Lo,ba as No,ct as Bo,bv as Fo,bx as jo,bI as Vo,bD as qo,bl as Zo,bm as Ma,bL as Ho,bE as Wo,bz as Ko,bh as Xo,bG as Qo,bg as Go,bn as oa,bi as ia,bf as la,bs as Yo}from"./D5vlW2SV.js";import{e as Jo}from"./gKdztwD8.js";import{h as Ca,e as Pa,g as gt,i as gn,I as Da}from"./CA6H1-bp.js";import{b as Qt}from"./Dn334wJv.js";import{f as Oe,ae as ei}from"./D-lOH49i.js";import{T as ti}from"./YAuWnPYv.js";import"./lK1e5NlM.js";import{c as ni}from"./D-62MVd3.js";import{P as zn}from"./ZmAQurQV.js";import{l as pn,k as $a,q as rr,i as ri}from"./C7b3vXLD.js";import{F as kt,cn as ai,aS as si,bj as oi,Q as ii,cj as Ea,b7 as li,aZ as ci,bY as di,bF as ui,cd as gi,a6 as pi,$ as fi,d3 as vi,ad as mi}from"./ChHRVjww.js";import{A as fn}from"./DON9zoQ1.js";import{B as Ta}from"./Bmw5RheL.js";import{parseIntentLink as hi}from"./Bb15Q1ED.js";import{h as _i}from"./2z2xJ2W_.js";import{M as bi}from"./CMHMpoVu.js";import{a as wi}from"./BMejr7u6.js";import{T as za}from"./CMUWVW8A.js";import{c as Ua,d as Oa}from"./XMoRU8a7.js";import"./DU3vNstz.js";import{i as yi}from"./BjLb7AHW.js";import{a2 as xi}from"./DJPdI2sS.js";import{a as Ai,A as ca}from"./BSCmeu0N.js";import{I as ki}from"./DReNFETs.js";import{S as Ii}from"./DKxUsLaS.js";import{C as Ri}from"./BHkRlfpj.js";import{D as Si,p as Mi}from"./Bl5dZSyT.js";import{h as da,C as Ci}from"./DAvgrUpQ.js";import{g as Pi}from"./DWGXN6Nr.js";import{u as Di,n as $i}from"./CH7HNVC2.js";const Ei=/^!\[([^\]\n]*)\]\((workspace-asset:\/\/[^\s()]+)\)$/,Ti={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ar(s,n){const l=s.split(`
1
+ import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./Fcr7AvC-.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Gr,c5 as Ut,a as En,$ as wa,cd as Gt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./BhYXv0ZM.js";import{k as ya}from"./Cc0763mU.js";import{c as Ct}from"./2z64ELW5.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./BRCr02in.js";import{t as $t,k as Vs}from"./CWfjuhY2.js";import{h as qs}from"./pYdPYEfN.js";import{b as Zs,a as Hs}from"./CpIcQB5T.js";import{a as Yr,o as Jr,S as Yn,E as Ws,e as Rn}from"./CBbhUF1U.js";import"./x4bPxhVW.js";import"./BzXQ5SMs.js";import"./O5ZlQHf9.js";import{r as Ks,e as Xs}from"./s_T1Uukt.js";import{m as Yt}from"./qB07BmZl.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{jz as ir,JH as le,i as Aa,v1 as Qs,br as Gs,jC as Ys,z4 as Js,z6 as eo,jv as to,U as ea,V as ta,kd as tr,k9 as Jn,jZ as na,kh as no,jM as ro,ke as ao,x6 as so,x7 as oo,x4 as io,jN as lo,kc as ra,k6 as co,jA as uo,nh as go,ng as po,jw as aa,rN as fo,k3 as vo,jB as mo,k0 as ho,jK as sa,LG as _o,jH as bo,kb as wo}from"./D0qhIm1r.js";import{a_ as lr,dI as yo,O as xo,cU as Ao}from"./Cq6hdiVw.js";import{E as ka}from"./5uPsOw59.js";import"./CpK0xLH4.js";import{m as Sn,bE as ko,A as Io,bD as Ro,e as So,ah as Mo,bC as Co,bK as Po}from"./7jJBRPuC.js";import{u as Ia}from"./BwweojP5.js";import{d2 as Ra,al as Do,d0 as $o,a1 as Eo,bH as nr,be as cr,bj as Sa,bb as To,bk as zo,bA as Uo,by as Oo,bd as Lo,ba as No,ct as Bo,bv as Fo,bx as jo,bI as Vo,bD as qo,bl as Zo,bm as Ma,bL as Ho,bE as Wo,bz as Ko,bh as Xo,bG as Qo,bg as Go,bn as oa,bi as ia,bf as la,bs as Yo}from"./B81OcyKa.js";import{e as Jo}from"./gKdztwD8.js";import{h as Ca,e as Pa,g as gt,i as gn,I as Da}from"./CA6H1-bp.js";import{b as Qt}from"./Dn334wJv.js";import{f as Oe,ae as ei}from"./D-lOH49i.js";import{T as ti}from"./YAuWnPYv.js";import"./lK1e5NlM.js";import{c as ni}from"./D-62MVd3.js";import{P as zn}from"./ZmAQurQV.js";import{l as pn,k as $a,q as rr,i as ri}from"./C7b3vXLD.js";import{F as kt,cn as ai,aS as si,bj as oi,Q as ii,cj as Ea,b7 as li,aZ as ci,bY as di,bF as ui,cd as gi,a6 as pi,$ as fi,d3 as vi,ad as mi}from"./ChHRVjww.js";import{A as fn}from"./DON9zoQ1.js";import{B as Ta}from"./Bmw5RheL.js";import{parseIntentLink as hi}from"./BOnUtfX8.js";import{h as _i}from"./CFNZ2elP.js";import{M as bi}from"./DpdO1dt4.js";import{a as wi}from"./Cwh2ERPd.js";import{T as za}from"./CMUWVW8A.js";import{c as Ua,d as Oa}from"./XMoRU8a7.js";import"./DU3vNstz.js";import{i as yi}from"./BjLb7AHW.js";import{a2 as xi}from"./DO55QNxM.js";import{a as Ai,A as ca}from"./ZgcC8xYU.js";import{I as ki}from"./DReNFETs.js";import{S as Ii}from"./DKxUsLaS.js";import{C as Ri}from"./BHkRlfpj.js";import{D as Si,p as Mi}from"./CyhCdFNi.js";import{h as da,C as Ci}from"./Cy7t1cj5.js";import{g as Pi}from"./DWGXN6Nr.js";import{u as Di,n as $i}from"./CH7HNVC2.js";const Ei=/^!\[([^\]\n]*)\]\((workspace-asset:\/\/[^\s()]+)\)$/,Ti={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ar(s,n){const l=s.split(`
2
2
  `),r=[];let a=l.length;for(;a>0;){const f=Ei.exec(l[a-1]);if(!f||!Ra(f[2],n))break;r.unshift({name:f[1],url:f[2]}),a--}if(!r.length)return{text:s,images:r};const u=l.slice(0,a).join(`
3
3
  `);return{text:u.endsWith(`
4
4
  `)?u.slice(0,-1):u,images:r}}function Mn(s,n){if(!n.length)return s;const l=n.map(({name:r,url:a})=>`![${r.replace(/[[\]()\\\n\r]/g,"").trim()||"image"}](${a})`);return s?`${s}
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Bo8Bzt_n.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/Cq6hdiVw.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/pYdPYEfN.js","/app/immutable/chunks/Ccf5U4O_.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/qB07BmZl.js","/app/immutable/chunks/D-lOH49i.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/Cu9dGfYE.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/54ZDusyh.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js"])))=>i.map(i=>d[i]);
2
- var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./D0qhIm1r.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./Cq6hdiVw.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BS1zON0P.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./Y8hdNZSZ.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./BmqZzhgO.js";import{f as un}from"./BonA_mfc.js";import{bm as h,_ as fe}from"./Fcr7AvC-.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./D5vlW2SV.js";import{X as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./pYdPYEfN.js";import{l as H,i as An,n as In}from"./C7b3vXLD.js";import{b as Tn}from"./54ZDusyh.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./DjepxDVb.js";import{b as Ue,c as xn,a as Pn}from"./CZfU7DE3.js";import{m as Bn}from"./BBuvJMq5.js";import{m as On}from"./qB07BmZl.js";import"./3SdAC2_C.js";import"./BRCr02in.js";import"./CWfjuhY2.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Ckq6aQDS.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
2
+ var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./D0qhIm1r.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./Cq6hdiVw.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BS1zON0P.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./Y8hdNZSZ.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./BmqZzhgO.js";import{f as un}from"./BonA_mfc.js";import{bm as h,_ as fe}from"./Fcr7AvC-.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./B81OcyKa.js";import{X as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./pYdPYEfN.js";import{l as H,i as An,n as In}from"./C7b3vXLD.js";import{b as Tn}from"./54ZDusyh.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./qV7UW5Ug.js";import{b as Ue,c as xn,a as Pn}from"./CZfU7DE3.js";import{m as Bn}from"./BBuvJMq5.js";import{m as On}from"./qB07BmZl.js";import"./3SdAC2_C.js";import"./BRCr02in.js";import"./CWfjuhY2.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Ckq6aQDS.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
3
3
  ${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
4
4
 
5
5
  `),messageMetadata:{...s.messageMetadata,...Xt(v,D),edited_captures:m.metadata}}:s;return u(),$}async function Ta(e,t,n={}){const a=Qe(e);return Promise.all(e.images.map(async r=>{if(n[r.id])return{type:"image",...n[r.id]};const s=t.find(i=>i.id===r.contextItemId);if(!s?.imageData||!s.imageMimeType)throw new Error("dock-evidence-missing-pixels");const o=await Aa({base64:s.imageData,mimeType:s.imageMimeType},r,a.filter(({mark:i})=>i.imageId===r.id));return{type:"image",data:o.base64,mimeType:o.mimeType}}))}function Ca(){return et()}function ms(e){const{clip:t}=e;if(t.status!=="ready"||!t.path)return null;const n=e.marks.filter(s=>s.clipId===t.id&&typeof s.clipMs=="number").sort((s,o)=>s.clipMs-o.clipMs).map(s=>({id:s.id,tool:s.tool,atMs:s.clipMs,...s.element?.name?{label:s.element.name.slice(0,200)}:{}})),a=Zt(e.evidence??void 0,t.id),r=a?t.media:void 0;return{kind:"recording",workspaceId:e.workspaceId,agentId:e.agentId,attachmentId:a?.attachmentId??t.id,sourceRevision:a?`${a.id}:${a.revision}`:t.path,attachmentPath:t.path,title:"",durationMs:t.durationMs,marks:n,provenance:a?{...a.audio==="unknown"?{}:{hasMicAudio:a.audio==="available"},visuals:a.visuals}:{hasMicAudio:t.hasMicAudio,visuals:n.length>0?"baked-marks":"clean"},...a&&r?{source:a,saved:r.saved??null,transcript:r.transcript??null}:{}}}async function ps(e){if(!Ca())return{ok:!1,error:"unavailable"};try{return await on().invoke(sn.OPEN,e)??{ok:!1,error:"unavailable"}}catch{return{ok:!1,error:"transport"}}}function fs(e){let t=null,n=null;const a=i=>e.releaseMediaJob?.(i).catch(()=>{});function r(){const i=t;t=null,!(!i||i.taken||i.stopped)&&(i.stopped=!0,clearTimeout(i.timer),a(i.id))}function s(i,l,c){if(t?.key===i||n===i||(r(),n=null,!e.adoptMediaJob||!e.exportMedia||!c()||W(l)))return;const d=structuredClone(l),u=d.saved??re(d.source,d.source.capturedMarks??[],d.transcript),g=_e(u,d.source,d.transcript);if(d.source.kind!=="recording"||d.source.visuals!=="clean"||g.errors.length||!g.clips.length||u.voice==="transcript"&&d.transcript?.status!=="ready")return;const p={...d,saved:u},m=crypto.randomUUID(),w={key:i,mediaKey:JSON.stringify(p),id:m,current:c,taken:!1,stopped:!1,settled:!1,failed:!1,timer:setTimeout(()=>{t===w&&(n=i,r())},3e4),result:Promise.resolve({error:new Error("not-started")})};t=w,w.result=lt(p,m,e,()=>!w.stopped&&w.current()).then(async f=>w.stopped||!w.current()?(await a(m),{error:new Error("media-send-retired")}):{value:f},async f=>(w.failed=!0,t===w&&(n=i),await a(m),{error:f})).finally(()=>{w.settled=!0})}async function o(i,l,c){const d=t;if(!d||d.key!==i||d.mediaKey!==JSON.stringify(l)||d.stopped||d.taken||!c())return null;if(d.failed&&d.settled)return r(),null;d.taken=!0,d.current=c,clearTimeout(d.timer),t=null;const u=await d.result;if("error"in u)throw u.error;try{if(!c())throw new Error("media-send-retired");const g=await e.adoptMediaJob?.(d.id);if(!c())throw new Error("media-send-retired");return!g?.ok||!g.value?(await a(d.id),null):u.value}catch(g){throw await a(d.id),g}}return{warm:s,take:o,cancel:r}}function hs(e={}){const t=a=>cn(a,typeof e=="function"?e():e),n=a=>vn(t(a));return{actionHints:{get capture(){return{label:h.dock_composer_screenshotAction_label(),shortcut:t("dock.capture")}},get record(){return{label:h.ui_shortcuts_dockRecord_label(),shortcut:t("dock.record")}},get dictate(){return{label:h.dock_shortcut_dictate_label()}}},get capture(){return h.dock_composer_capture_tooltip({shortcut:n("dock.capture")})},captureMode:{get window(){return h.dock_composer_captureWindow_tooltip({shortcut:n("dock.capture")})},get region(){return h.dock_composer_captureRegion_tooltip({shortcut:n("dock.capture")})}},captureModes:{fullscreen:h.dock_composer_captureFullscreen_label(),window:h.dock_composer_captureWindow_label(),region:h.dock_composer_captureRegion_label()},captureOptions:h.dock_composer_captureModes_ariaLabel(),captureLimit:h.dock_composer_captureLimit_tooltip(),clipLimit:h.dock_composer_clipLimit_tooltip({limit:H(ae.clips)}),get record(){return h.dock_composer_record_tooltip({shortcut:n("dock.record")})},stopRecording:h.dock_composer_stopRecording_tooltip(),annotationTools:h.annotation_toolbar_ariaLabel(),annotateCurrent:a=>h.dock_composer_annotate_ariaLabel({tool:a}),tools:{pick:h.dock_composer_pick_label(),box:h.dock_composer_box_label(),pen:h.dock_composer_pen_label(),arrow:h.annotation_arrow_label()},get dictate(){return h.dock_shortcut_dictate_label()},stopDictating:h.dock_composer_stopDictating_tooltip(),annotating:h.dock_composer_annotating_status(),recording:h.dock_composer_recording_status(),markUp:h.dock_composer_markUp_label(),remove:h.chat_contextChip_remove_label(),play:h.dock_composer_play_label(),edit:h.dock_composer_edit_label(),done:h.dock_composer_done_label(),attachments:h.context_attachments_title_label(),retry:h.chat_shared_retry_label(),attachmentPending:h.dock_composer_attachmentPending_status(),attachmentFailed:h.dock_composer_attachmentFailed_error(),image:a=>h.dock_composer_image_ariaLabel({n:H(a)}),clip:a=>h.dock_composer_clip_ariaLabel({duration:a}),recordingReference:(a,r)=>r?h.dock_composer_recordingEnd_chip({n:H(a)}):h.dock_composer_recordingStart_chip({n:H(a)}),speechError:a=>a.includes("permission")?h.dock_composer_speechPermission_error():["unsupported-platform","helper-missing","recognizer-unavailable","locale-unsupported","assets-unavailable","unavailable"].includes(a)?h.dock_composer_speechUnavailable_error():h.dock_composer_speechFailed_error()}}function gs(e,t){return{enabled:e,limit:ae.files,excludedIds:t,unavailableMessage:h.dock_composer_filesUnavailable_error(),limitMessage:h.dock_composer_fileLimit_error({limit:H(ae.files)})}}function Ea(e){try{return new URL(e.pageUrl).hostname||e.pageUrl}catch{return e.pageUrl}}function ys(e,t){return e.targetAgentId===t}function ws(e){const t=e.element,n=e.viewport,a=Ea(e),r=t?`<${t.tagName.toLowerCase()}> · ${a}`:e.title||a,s=["<browser-element-capture>",`Page URL: ${e.pageUrl}`,`Page title: ${e.title}`,...t?[`DOM path: ${t.domPath}`,`CSS selector: ${t.selector}`,`Text snippet: ${t.textSnippet}`,...t.sourceRef?[`Source ref: ${t.sourceRef}`]:[],...n?[`Viewport: ${n.width}×${n.height}`]:[],`Element bounds: ${t.rect.width}×${t.rect.height} at (${t.rect.x}, ${t.rect.y})`]:[],"</browser-element-capture>"].join(`