@intent-hq/web 2.374.0 → 2.374.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/{DeREMpl2.js → -GzAayRi.js} +1 -1
  3. package/web/app/immutable/chunks/{B7v8ICP4.js → 1PBEbLiL.js} +1 -1
  4. package/web/app/immutable/chunks/{Bq5w_10y.js → 5JkhMlm8.js} +1 -1
  5. package/web/app/immutable/chunks/{B4Pcyup-.js → 7N4d1SHx.js} +1 -1
  6. package/web/app/immutable/chunks/{CVKwip72.js → 8iM9mVCJ.js} +1 -1
  7. package/web/app/immutable/chunks/{Dxc-KEkE.js → A3itjZn8.js} +3 -3
  8. package/web/app/immutable/chunks/{BIzGfV52.js → AWXowPxU.js} +1 -1
  9. package/web/app/immutable/chunks/{CXwkFfQD.js → B14ddEbH.js} +1 -1
  10. package/web/app/immutable/chunks/{0Xr6eOOE.js → B1WcmQpq.js} +1 -1
  11. package/web/app/immutable/chunks/{Opn_u-ak.js → B2Arx0ZF.js} +1 -1
  12. package/web/app/immutable/chunks/{C2eOYH_G.js → B2wZ0Bb3.js} +1 -1
  13. package/web/app/immutable/chunks/{oHriEIAi.js → B5RGOddd.js} +2 -2
  14. package/web/app/immutable/chunks/{CiEru0ce.js → B6ZYX7Y8.js} +1 -1
  15. package/web/app/immutable/chunks/{Dtfq8wlv.js → B9zxG49e.js} +1 -1
  16. package/web/app/immutable/chunks/{B7FRjLIO.js → BE6Jwt_-.js} +2 -2
  17. package/web/app/immutable/chunks/{BoaqP5ET.js → BFBRQlnB.js} +1 -1
  18. package/web/app/immutable/chunks/{DLJOBEeO.js → BFSIy5Dg.js} +3 -3
  19. package/web/app/immutable/chunks/{Bi-OoqI4.js → BHMaHtb7.js} +3 -3
  20. package/web/app/immutable/chunks/{BWtNXuH3.js → BMLCt23V.js} +1 -1
  21. package/web/app/immutable/chunks/{BjC_rKsH.js → BPU4O8X2.js} +1 -1
  22. package/web/app/immutable/chunks/{B3pPpWYK.js → BPqj6Qvi.js} +1 -1
  23. package/web/app/immutable/chunks/{4aIDpPwE.js → BU_lcjuY.js} +1 -1
  24. package/web/app/immutable/chunks/{Dotp5YRU.js → BWuBGnGl.js} +1 -1
  25. package/web/app/immutable/chunks/{CWplqerm.js → BXUbR1fc.js} +1 -1
  26. package/web/app/immutable/chunks/{CLMgFYIH.js → BazydCWO.js} +1 -1
  27. package/web/app/immutable/chunks/{DsRXAU7N.js → BdEeTGSl.js} +1 -1
  28. package/web/app/immutable/chunks/{DNvCdh98.js → BfjyDFQP.js} +1 -1
  29. package/web/app/immutable/chunks/{fvPmV5Gi.js → BlBjpUY-.js} +2 -2
  30. package/web/app/immutable/chunks/{DZLkwu2T.js → BlbJ4pnj.js} +1 -1
  31. package/web/app/immutable/chunks/{BymgwXRn.js → Bnhl7xZz.js} +1 -1
  32. package/web/app/immutable/chunks/{DQbaQwzY.js → BtBMs8pl.js} +1 -1
  33. package/web/app/immutable/chunks/{DWBuWaVE.js → BuWZ2vPD.js} +1 -1
  34. package/web/app/immutable/chunks/{D--r5mHa.js → Bu_b7Geq.js} +1 -1
  35. package/web/app/immutable/chunks/{DhezPe3y.js → Bx_Vy-8F.js} +1 -1
  36. package/web/app/immutable/chunks/{Cf5H5FW2.js → C-1CqQ1f.js} +1 -1
  37. package/web/app/immutable/chunks/{BHrccWS6.js → C-IFS50X.js} +1 -1
  38. package/web/app/immutable/chunks/{BNlcBg5q.js → C0urABBN.js} +1 -1
  39. package/web/app/immutable/chunks/{ggBdElOR.js → C1VzVy_T.js} +1 -1
  40. package/web/app/immutable/chunks/{BbRVqgQZ.js → C1kgjET0.js} +1 -1
  41. package/web/app/immutable/chunks/{DCwrIUyt.js → C4qomPfT.js} +1 -1
  42. package/web/app/immutable/chunks/{xOVHBiMd.js → C6Y4L69O.js} +1 -1
  43. package/web/app/immutable/chunks/{Dt0cEsoV.js → C8IXZPNs.js} +2 -2
  44. package/web/app/immutable/chunks/{CYk_a71f.js → C8vjEKe_.js} +1 -1
  45. package/web/app/immutable/chunks/{C4ERaDtS.js → CBFYLXFF.js} +1 -1
  46. package/web/app/immutable/chunks/{CbMctCk2.js → CDYjKRWo.js} +1 -1
  47. package/web/app/immutable/chunks/{B6z9N_8y.js → CG5Ujj5n.js} +1 -1
  48. package/web/app/immutable/chunks/{vE_bc7tB.js → CHfIP-Ca.js} +1 -1
  49. package/web/app/immutable/chunks/{1e1uSG0B.js → CI03it4q.js} +1 -1
  50. package/web/app/immutable/chunks/{I7PibMUG.js → CI8lfy7e.js} +1 -1
  51. package/web/app/immutable/chunks/{CSrI4A-Z.js → CMSXP3JK.js} +1 -1
  52. package/web/app/immutable/chunks/{CN1fsMHu.js → CNsG6rqe.js} +1 -1
  53. package/web/app/immutable/chunks/{DT6jGD_v.js → CU4TDhZp.js} +2 -2
  54. package/web/app/immutable/chunks/{BpM87Usm.js → CZA7HKg8.js} +1 -1
  55. package/web/app/immutable/chunks/{C7CeFFBU.js → CcBYgr_O.js} +1 -1
  56. package/web/app/immutable/chunks/{mln4aKyz.js → CeAbChdf.js} +1 -1
  57. package/web/app/immutable/chunks/{C8hkzPoK.js → Cfbp4n6F.js} +2 -2
  58. package/web/app/immutable/chunks/{CsaKmxO_.js → CheTmX4x.js} +1 -1
  59. package/web/app/immutable/chunks/{Jd-PTJBp.js → ChuuGcaj.js} +3 -3
  60. package/web/app/immutable/chunks/{DMnVAzAI.js → CiJzGYSi.js} +1 -1
  61. package/web/app/immutable/chunks/{Qk2Uvykz.js → CiasNS4Y.js} +1 -1
  62. package/web/app/immutable/chunks/{GfYLoKaL.js → CkF26rCa.js} +1 -1
  63. package/web/app/immutable/chunks/{BoDtRDem.js → CkGI1ZG-.js} +1 -1
  64. package/web/app/immutable/chunks/{PrLg-ksP.js → Cm47R70f.js} +1 -1
  65. package/web/app/immutable/chunks/{hsWXTUXg.js → Cn1QrsR7.js} +1 -1
  66. package/web/app/immutable/chunks/{DtYEnzBU.js → CnAm8UDm.js} +1 -1
  67. package/web/app/immutable/chunks/{C-MW647h.js → Cox9QorC.js} +1 -1
  68. package/web/app/immutable/chunks/{b7K3kFDW.js → Csr-rIZF.js} +1 -1
  69. package/web/app/immutable/chunks/{DZc-gQMq.js → Cvxp3hv6.js} +1 -1
  70. package/web/app/immutable/chunks/{Z_Zl_SfR.js → CykMvH93.js} +1 -1
  71. package/web/app/immutable/chunks/{DKBM0Gj4.js → CyyQuDJ2.js} +1 -1
  72. package/web/app/immutable/chunks/{Btxass_5.js → D-_a8-qv.js} +1 -1
  73. package/web/app/immutable/chunks/{BLM5WEkv.js → D1p7bFmY.js} +1 -1
  74. package/web/app/immutable/chunks/{C-hRvbpj.js → D4X5QfgO.js} +3 -3
  75. package/web/app/immutable/chunks/{DXFg1wKa.js → D5wSh12h.js} +1 -1
  76. package/web/app/immutable/chunks/{DcPZVozd.js → D76tHJtr.js} +1 -1
  77. package/web/app/immutable/chunks/{5kmlNoKC.js → D8-vtN74.js} +4 -4
  78. package/web/app/immutable/chunks/{Chgxj7dA.js → D8KugJqg.js} +1 -1
  79. package/web/app/immutable/chunks/{o6BZHHo-.js → D91ZkM-_.js} +1 -1
  80. package/web/app/immutable/chunks/{Dyo489Aj.js → DAbdqRSx.js} +4 -4
  81. package/web/app/immutable/chunks/{BIXB2sEM.js → DDt9eLZK.js} +3 -3
  82. package/web/app/immutable/chunks/{DKOHx2a9.js → DGGMIXhj.js} +2 -2
  83. package/web/app/immutable/chunks/{CGvpPKXI.js → DL1sQHpf.js} +1 -1
  84. package/web/app/immutable/chunks/{8un-1yF0.js → DQn-1ubH.js} +1 -1
  85. package/web/app/immutable/chunks/{IcK2O8wN.js → DWiCzmLc.js} +1 -1
  86. package/web/app/immutable/chunks/{B4on2wzU.js → DYuqveqh.js} +1 -1
  87. package/web/app/immutable/chunks/{MncpPyA-.js → DaNITilt.js} +1 -1
  88. package/web/app/immutable/chunks/{DQPV9Jid.js → DcgZLPGn.js} +1 -1
  89. package/web/app/immutable/chunks/{CttZcTQ2.js → Dfqr3ucI.js} +1 -1
  90. package/web/app/immutable/chunks/{wouXHNlM.js → DfrnAh60.js} +13 -13
  91. package/web/app/immutable/chunks/{CuLrgEBU.js → DhTidcoi.js} +1 -1
  92. package/web/app/immutable/chunks/{DGK1iojf.js → Dhf5PPGB.js} +1 -1
  93. package/web/app/immutable/chunks/{DHyTxmrF.js → DjKYseTS.js} +1 -1
  94. package/web/app/immutable/chunks/{DmmbYbmC.js → Dm3SETfX.js} +6 -6
  95. package/web/app/immutable/chunks/{BJkBPBON.js → Dm8F4oqT.js} +2 -2
  96. package/web/app/immutable/chunks/{CZoORueB.js → DqeGDed0.js} +1 -1
  97. package/web/app/immutable/chunks/{CPc9hi45.js → DvyPNixU.js} +1 -1
  98. package/web/app/immutable/chunks/{DoEVipUF.js → Dw5mZcm5.js} +1 -1
  99. package/web/app/immutable/chunks/{D8IZMM7C.js → DwGC3Qoc.js} +1 -1
  100. package/web/app/immutable/chunks/{ygVTpe0W.js → Dya4in_M.js} +1 -1
  101. package/web/app/immutable/chunks/{DUmGlkcv.js → DyvQorI4.js} +1 -1
  102. package/web/app/immutable/chunks/{ZyBOjDmf.js → H-xlkAY8.js} +1 -1
  103. package/web/app/immutable/chunks/{hjdg1APe.js → I0qWsqIQ.js} +2 -2
  104. package/web/app/immutable/chunks/{v1GNktmz.js → IOUuDzhl.js} +3 -3
  105. package/web/app/immutable/chunks/{Bb4KDW-H.js → JFDbnVgN.js} +1 -1
  106. package/web/app/immutable/chunks/{78vu4B3v.js → JJ3RCq0j.js} +1 -1
  107. package/web/app/immutable/chunks/{BE1cGlQD.js → K-0xnE6j.js} +1 -1
  108. package/web/app/immutable/chunks/{C6a1-Err.js → KLcMYBf-.js} +1 -1
  109. package/web/app/immutable/chunks/{C3XalDjV.js → LcfcL_-4.js} +1 -1
  110. package/web/app/immutable/chunks/{BEtv8tBy.js → M2ziLO4-.js} +1 -1
  111. package/web/app/immutable/chunks/{DUGzdx5G.js → MvtlzB8k.js} +1 -1
  112. package/web/app/immutable/chunks/{CSiViQVW.js → QVs7xD_-.js} +1 -1
  113. package/web/app/immutable/chunks/{C7QIVjEh.js → QWptVHsb.js} +1 -1
  114. package/web/app/immutable/chunks/{CCK5TGK5.js → R7rkruRO.js} +1 -1
  115. package/web/app/immutable/chunks/{BlEa7UsU.js → Rar9KqJV.js} +1 -1
  116. package/web/app/immutable/chunks/{Dw2_URl8.js → TRC-1MZ6.js} +1 -1
  117. package/web/app/immutable/chunks/{DJsRid9i.js → TZXFgAt8.js} +1 -1
  118. package/web/app/immutable/chunks/{DQjZPSYr.js → UBi_ObtY.js} +1 -1
  119. package/web/app/immutable/chunks/{DM5MJ3Sn.js → VgpkVPqy.js} +1 -1
  120. package/web/app/immutable/chunks/{D5D__L6c.js → YTYw24Kl.js} +1 -1
  121. package/web/app/immutable/chunks/{BqB2D1x5.js → cZ6WbhzF.js} +4 -4
  122. package/web/app/immutable/chunks/{Dlu7eNjM.js → eUuFvR6M.js} +1 -1
  123. package/web/app/immutable/chunks/{Dl3FDpKM.js → hf11ueQS.js} +1 -1
  124. package/web/app/immutable/chunks/{CW2YUdJi.js → iwYLzKdV.js} +1 -1
  125. package/web/app/immutable/chunks/{FC-pHBfg.js → jbqICVar.js} +2 -2
  126. package/web/app/immutable/chunks/{BLub_WLN.js → o1xI68Cv.js} +3 -3
  127. package/web/app/immutable/chunks/{LIjxNVmo.js → qZOpciCD.js} +1 -1
  128. package/web/app/immutable/chunks/{CivTzCBV.js → zLwkenCD.js} +1 -1
  129. package/web/app/immutable/entry/{app.C3_ct89H.js → app.CSmhn5IS.js} +2 -2
  130. package/web/app/immutable/entry/start.9LRUpX9-.js +1 -0
  131. package/web/app/immutable/nodes/{0.B60cY-E8.js → 0.BJ-vuqyF.js} +1 -1
  132. package/web/app/immutable/nodes/{1.Fg7YybpB.js → 1.K8N2U7fJ.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CGBrSCkB.js → 10.R5acEqWk.js} +4 -4
  134. package/web/app/immutable/nodes/{11.CxV9uXd7.js → 11.4wdFN3fm.js} +1 -1
  135. package/web/app/immutable/nodes/{15.Bh_nopxE.js → 15.N_o5QWkl.js} +1 -1
  136. package/web/app/immutable/nodes/{19.0bOGZuAY.js → 19.DRknpyiO.js} +2 -2
  137. package/web/app/immutable/nodes/{2.DREuwjqg.js → 2.MIO2fuwM.js} +4 -4
  138. package/web/app/immutable/nodes/{3.DSIPMWPB.js → 3.-a-xJZ2X.js} +1 -1
  139. package/web/app/immutable/nodes/{4.CZVyJ7C4.js → 4.Cp7W3COg.js} +1 -1
  140. package/web/app/immutable/nodes/{5.DND6GJwF.js → 5.gJXhj0lL.js} +1 -1
  141. package/web/app/immutable/nodes/{6.Bk5k_Omu.js → 6.DKNQvcTz.js} +1 -1
  142. package/web/app/immutable/nodes/{7.DCF-Fawn.js → 7.CxbGknsS.js} +1 -1
  143. package/web/app/immutable/nodes/{8.aBszzfhj.js → 8.C-MNb_3a.js} +1 -1
  144. package/web/app/immutable/nodes/{9.Bs6CVTCT.js → 9.5VNiGtUs.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.BIOjq307.js +0 -1
@@ -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"./DxxarOOi.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./5kmlNoKC.js";import{B as Ft,D as Kt}from"./BjC_rKsH.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"./DxxarOOi.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./D8-vtN74.js";import{B as Ft,D as Kt}from"./BPU4O8X2.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 +1 @@
1
- import{b as a,B as w,ay as x}from"./Dyo489Aj.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s};
1
+ import{b as a,B as w,ay as x}from"./DAbdqRSx.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s};
@@ -1,4 +1,4 @@
1
- import{g as Ut}from"./B7v8ICP4.js";import{s as Kt}from"./D8IZMM7C.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./Dyo489Aj.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
1
+ import{g as Ut}from"./1PBEbLiL.js";import{s as Kt}from"./DwGC3Qoc.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./DAbdqRSx.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b as i,aW as l,aw as d,P as o}from"./Dyo489Aj.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{g as a,m as b,w as c,p as d,x as e,y as f,h as g,f as h};
1
+ import{b as i,aW as l,aw as d,P as o}from"./DAbdqRSx.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{g as a,m as b,w as c,p as d,x as e,y as f,h as g,f as h};
@@ -1,2 +1,2 @@
1
- import{Jq as l,r_ as u,J3 as b}from"./Zs30783q.js";import{at as v}from"./BmO6NekI.js";import{bG as m}from"./BfdTnj-p.js";import{be as S,ba as P}from"./CPc9hi45.js";import{J as M}from"./Hxdz4eYy.js";import{bm as s}from"./DxxarOOi.js";import{l as E}from"./BqJSWZOr.js";const D=l.createSelector(t=>t.backgroundAgentSettings.defaultModel),O=l.createSelector(t=>t.backgroundAgentSettings.typeOverrides),j=l.createSelector(t=>t.backgroundAgentSettings.defaultReasoningEffort),H=l.createSelector(t=>t.backgroundAgentSettings.typeReasoningEffortOverrides),w=l.createSelector(t=>t.backgroundAgentSettings),A=l.createSelector(t=>{const a=new Map,o=(e,i)=>{const n=a.get(e)??new Set;n.add(i),a.set(e,n)},_=m.select(t),d=M.select(t),g=v.select(t)[d];g&&d&&o(d,s.settings_providers_inUseDefaultModel_label({model:g})),u(d)&&!g&&o(d,s.settings_providers_inUseDefaultProvider_label());const p=t.backgroundAgentSettings?.providerId;p&&u(p)&&o(p,s.settings_providers_inUseQuickActions_label());for(const e of S.select(t)){const i=P.select(t,e.id),n=e.source?{project:s.settings_providers_pinSourceProject_label(),user:s.settings_providers_pinSourceUser_label(),bundled:s.settings_providers_pinSourceBundled_label(),builtin:s.settings_providers_pinSourceBuiltin_label(),"electron-store":s.settings_providers_pinSourceLegacy_label()}[e.source]:void 0,c=r=>n&&i?s.settings_providers_inUseSourcePath_label({reason:r,source:n,path:i}):n?s.settings_providers_inUseSource_label({reason:r,source:n}):i?s.settings_providers_inUsePath_label({reason:r,path:i}):r;if(e.codingAgent&&o(e.codingAgent,c(s.settings_providers_inUseSpecialistAgent_label({name:e.name}))),e.modelOptions?.forEach((r,f)=>{r.provider&&u(r.provider)&&o(r.provider,c(s.settings_providers_inUseSpecialistModelOption_label({name:e.name,position:E(f+1)})))}),e.defaultModel)if(e.defaultModel.includes(":")){const r=b(e.defaultModel).providerId??_;o(r,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}else e.codingAgent||o(_,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}return Object.fromEntries([...a].map(([e,i])=>[e,[...i].join(`
1
+ import{Jq as l,r_ as u,J3 as b}from"./Zs30783q.js";import{at as v}from"./BmO6NekI.js";import{bG as m}from"./BfdTnj-p.js";import{be as S,ba as P}from"./DvyPNixU.js";import{J as M}from"./Hxdz4eYy.js";import{bm as s}from"./DxxarOOi.js";import{l as E}from"./BqJSWZOr.js";const D=l.createSelector(t=>t.backgroundAgentSettings.defaultModel),O=l.createSelector(t=>t.backgroundAgentSettings.typeOverrides),j=l.createSelector(t=>t.backgroundAgentSettings.defaultReasoningEffort),H=l.createSelector(t=>t.backgroundAgentSettings.typeReasoningEffortOverrides),w=l.createSelector(t=>t.backgroundAgentSettings),A=l.createSelector(t=>{const a=new Map,o=(e,i)=>{const n=a.get(e)??new Set;n.add(i),a.set(e,n)},_=m.select(t),d=M.select(t),g=v.select(t)[d];g&&d&&o(d,s.settings_providers_inUseDefaultModel_label({model:g})),u(d)&&!g&&o(d,s.settings_providers_inUseDefaultProvider_label());const p=t.backgroundAgentSettings?.providerId;p&&u(p)&&o(p,s.settings_providers_inUseQuickActions_label());for(const e of S.select(t)){const i=P.select(t,e.id),n=e.source?{project:s.settings_providers_pinSourceProject_label(),user:s.settings_providers_pinSourceUser_label(),bundled:s.settings_providers_pinSourceBundled_label(),builtin:s.settings_providers_pinSourceBuiltin_label(),"electron-store":s.settings_providers_pinSourceLegacy_label()}[e.source]:void 0,c=r=>n&&i?s.settings_providers_inUseSourcePath_label({reason:r,source:n,path:i}):n?s.settings_providers_inUseSource_label({reason:r,source:n}):i?s.settings_providers_inUsePath_label({reason:r,path:i}):r;if(e.codingAgent&&o(e.codingAgent,c(s.settings_providers_inUseSpecialistAgent_label({name:e.name}))),e.modelOptions?.forEach((r,f)=>{r.provider&&u(r.provider)&&o(r.provider,c(s.settings_providers_inUseSpecialistModelOption_label({name:e.name,position:E(f+1)})))}),e.defaultModel)if(e.defaultModel.includes(":")){const r=b(e.defaultModel).providerId??_;o(r,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}else e.codingAgent||o(_,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}return Object.fromEntries([...a].map(([e,i])=>[e,[...i].join(`
2
2
  `)]))});l.createSelector((t,a)=>A.select(t)[a]??null);const h=[{id:"dracula",label:"Dracula"},{id:"nord",label:"Nord"},{id:"rose-pine",label:"Rosé Pine"},{id:"tokyo-night",label:"Tokyo Night"},{id:"solarized",label:"Solarized"},{id:"github",label:"GitHub"},{id:"high-contrast",label:"High Contrast"}],J=h.map(({id:t})=>t);export{J as T,h as a,j as b,w as c,O as d,H as e,A as f,D as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/oHriEIAi.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/FC-pHBfg.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Cij6f88k.js","/app/immutable/chunks/GfYLoKaL.js","/app/immutable/chunks/fvPmV5Gi.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/CGcJ5lqH.js","/app/immutable/chunks/BWxQ5UZF.js","/app/immutable/chunks/C5DeEaYP.js","/app/immutable/chunks/CmHh0Wvy.js"])))=>i.map(i=>d[i]);
2
- import{bm as v,_ as h}from"./DxxarOOi.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./Zs30783q.js";import{bL as $}from"./CPc9hi45.js";import{m as R}from"./DkkzFfYK.js";import"./3SdAC2_C.js";import"./Ch-D6DCZ.js";import"./C600Ggsz.js";import{R as N,F as g,E as G,Q as O}from"./BfQPFCP7.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import{o as q}from"./CkbzWFJM.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./oHriEIAi.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./FC-pHBfg.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./GfYLoKaL.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./BfdTnj-p.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./CGcJ5lqH.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BWxQ5UZF.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./oHriEIAi.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./C5DeEaYP.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./CmHh0Wvy.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./BfQPFCP7.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B5RGOddd.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/jbqICVar.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Cij6f88k.js","/app/immutable/chunks/CkF26rCa.js","/app/immutable/chunks/BlBjpUY-.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/CGcJ5lqH.js","/app/immutable/chunks/BWxQ5UZF.js","/app/immutable/chunks/C5DeEaYP.js","/app/immutable/chunks/CmHh0Wvy.js"])))=>i.map(i=>d[i]);
2
+ import{bm as v,_ as h}from"./DxxarOOi.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./Zs30783q.js";import{bL as $}from"./DvyPNixU.js";import{m as R}from"./DkkzFfYK.js";import"./3SdAC2_C.js";import"./Ch-D6DCZ.js";import"./C600Ggsz.js";import{R as N,F as g,E as G,Q as O}from"./BfQPFCP7.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import{o as q}from"./CkbzWFJM.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./B5RGOddd.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./jbqICVar.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./CkF26rCa.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./BfdTnj-p.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./CGcJ5lqH.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BWxQ5UZF.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./B5RGOddd.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./C5DeEaYP.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./CmHh0Wvy.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./BfQPFCP7.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BymgwXRn.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/Dyo489Aj.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DXFg1wKa.js","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/CPc9hi45.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/fvPmV5Gi.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/BmO6NekI.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Hxdz4eYy.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/Opn_u-ak.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/CvP7-iXZ.js","/app/immutable/chunks/DBEo2Y3v.js","/app/immutable/chunks/VlOW_lom.js","/app/immutable/chunks/Cncxuk-H.js","/app/immutable/chunks/DeaknxEN.js","/app/immutable/chunks/BrfF5NLx.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DBI9dTMM.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/euI_ACTK.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/Dep4c5m-.js","/app/immutable/chunks/B55Lo0FS.js","/app/immutable/chunks/BLKGmMKH.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/BzL9Egzq.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/DYME5vl6.js","/app/immutable/chunks/hjdg1APe.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/qM_0Sky2.js","/app/immutable/chunks/BYqiRSP_.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css","/app/immutable/chunks/D--r5mHa.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
2
- import{t as Ue,bo as x,bw as ze,b as Be,bm as Le,_ as Et}from"./DxxarOOi.js";import{bs as Ne,ca as vt,aD as a,bH as y,ay as ie,bS as Z,W,bn as Oe,bV as z,aA as F,c9 as R,aB as j,a5 as D,bA as V,b_ as te,a7 as Re,bl as He,aw as ke,aC as Lt,c3 as be,bb as Pe,bO as Ze,ai as Pt,aF as St,br as Rt,bj as Ht,aj as ee}from"./3SdAC2_C.js";import{i as X}from"./DzAQQ1i-.js";import{e as _e,g as Wt,i as Ut}from"./BUT4El0L.js";import{h as tt}from"./BKD7o1lQ.js";import{g as Xe,s as rt,f as le}from"./Ch-D6DCZ.js";import{b as Ee}from"./Dn334wJv.js";import{d1 as Me,d0 as nt,ap as zt,d3 as ht,a9 as We,aF as kt,aX as Bt,ax as Nt,a7 as at,r as Ot,aO as Vt,aT as qt,F as Dt}from"./DXFg1wKa.js";import{m as jt,bq as ot,Jq as Ke,vG as Kt,th as Gt,vI as Jt}from"./Zs30783q.js";import{K as Zt,a9 as Xt}from"./BfdTnj-p.js";import{l as Se}from"./ChTqQfQN.js";import{h as st}from"./hjdg1APe.js";import{a as Qt,c as bt,b as Qe,V as Ye,p as Fe,f as wt,I as Yt,r as $t,s as er}from"./Opn_u-ak.js";import{g as it}from"./D1F-b1I5.js";import{s as tr}from"./C600Ggsz.js";import{f as rr}from"./D5eCb9SA.js";import{F as Ge}from"./BfQPFCP7.js";import{m as lt}from"./BXwdEeCG.js";import{F as nr,bF as ar}from"./B5yEHkSy.js";import{t as or}from"./DAsc1V4f.js";function xe(r,o){return o||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(r.trim())}function sr(r,o){if(o||!r)return r;const n=document.createElement("template");n.innerHTML=r;for(const l of n.content.querySelectorAll("img, video")){const c=l.getAttribute("src")||l.getAttribute("data-media-src")||"",u=[...l.querySelectorAll("source")];if(!xe(c,!1)||u.some(f=>!xe(f.getAttribute("src")||"",!1))){const f=document.createElement("img");f.setAttribute("alt",l.getAttribute("alt")||l.getAttribute("data-name")||""),f.setAttribute("data-media-unavailable","node-owned"),l.replaceWith(f);continue}l.removeAttribute("srcset");const s=l.getAttribute("poster");s&&!xe(s,!1)&&l.removeAttribute("poster")}return n.innerHTML}const ir=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function lr(r){return r&&(ir.some(o=>o.test(r))||Zt(r,"markdown"))?"static":"simple"}var cr=j("<!> <!>",1);function It(r,o){if(new.target)return Ue({component:It,...r});Ne(o,!0);let n=x(o,"workspaceId",7),l=x(o,"canUseMedia",7),c=z(null),u=z(null),s=z(!1),f=z(!1);function _(m){y(c,{url:m.getAttribute("src")||"",name:m.getAttribute("alt")||void 0,opener:m},!0),y(s,!0)}function I(m){const h=nt(m.getAttribute("href")||"",n());return h&&l()(h)?(y(c,{url:h,name:m.textContent?.trim()||void 0,opener:m,assetLink:!0},!0),y(s,!0),!0):p(m)}function p(m){const h=Me(m.getAttribute("href")||"",n());return!h||!l()(h.url)?!1:(y(u,{url:h.url,mimeType:h.mimeType,name:m.textContent?.trim()||void 0,opener:m},!0),y(f,!0),!0)}vt(()=>{a(u)&&!Me(a(u).url,n())&&(y(f,!1),y(u,null)),a(c)?.assetLink&&!nt(a(c).url,n())&&(y(s,!1),y(c,null))});var k={openImage:_,openAsset:I,get workspaceId(){return n()},set workspaceId(m){n(m),F()},get canUseMedia(){return l()},set canUseMedia(m){l(m),F()},$set:ze,$on:(m,h)=>Be(o,m,h)},v=cr(),w=ie(v);{var M=m=>{Qt(m,{get imageUrl(){return a(c).url},get imageName(){return a(c).name},get openerElement(){return a(c).opener},showActionsMenu:!0,get open(){return a(s)},set open(h){y(s,h,!0)}})},E=R(()=>a(c)&&l()(a(c).url));X(w,m=>{a(E)&&m(M)})}var C=Z(w,2);{var t=m=>{bt(m,{get videoUrl(){return a(u).url},get videoName(){return a(u).name},get mimeType(){return a(u).mimeType},sourceKind:"workspace",get openerElement(){return a(u).opener},get open(){return a(f)},set open(h){y(f,h,!0)}})},d=R(()=>a(u)&&Me(a(u).url,n())&&l()(a(u).url));X(C,m=>{a(d)&&m(t)})}return W(r,v),Oe(k)}var dr=j('<div class="flex items-center gap-2"><!> <!></div>'),ur=Lt('<svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg>'),fr=j('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><!></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span><svg viewBox="0 0 20 20" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),mr=j("<div><!> <!></div>"),pr=j('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function yt(r,o){if(new.target)return Ue({component:yt,...r});Ne(o,!0);let n=x(o,"source",7),l=x(o,"name",23,()=>Le.chat_videoBlock_fromAgent_label()),c=x(o,"poster",7),u=x(o,"allowFileMedia",7,!0),s=x(o,"canOpenFile",7),f=x(o,"fluid",7,!1),_=x(o,"compact",7,!1),I=x(o,"compactPreview",7),p=z(!1),k=z(!1),v=z(!1),w=z(null);const M=R(()=>n().kind==="inline"?`data:${n().mimeType};base64,${n().data}`:n().url);function E(g){return xe(g,u()&&s()?.()!==!1)}const C=R(()=>!E(a(M))),t=R(()=>Fe(a(M))),d=R(()=>{if(!(!c()||!E(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const g=new URL(c());return(g.protocol==="https:"||g.protocol==="workspace-file:")&&!g.username&&!g.password?c():void 0}catch{return}}});function m(){y(k,!0),y(v,!1)}var h={get source(){return n()},set source(g){n(g),F()},get name(){return l()},set name(g=Le.chat_videoBlock_fromAgent_label()){l(g),F()},get poster(){return c()},set poster(g){c(g),F()},get allowFileMedia(){return u()},set allowFileMedia(g=!0){u(g),F()},get canOpenFile(){return s()},set canOpenFile(g){s(g),F()},get fluid(){return f()},set fluid(g=!1){f(g),F()},get compact(){return _()},set compact(g=!1){_(g),F()},get compactPreview(){return I()},set compactPreview(g){I(g),F()},$set:ze,$on:(g,H)=>Be(o,g,H)},T=pr(),U=ie(T);let O;var ve=D(U);{var q=g=>{Qe(g,{get name(){return l()},reason:"load-failed"})},ae=g=>{var H=dr(),ce=D(H);{let Q=R(()=>a(t)?.path),re=R(()=>a(t)?.workspaceId);Qe(ce,{get name(){return l()},reason:"load-failed",get path(){return a(Q)},get workspaceId(){return a(re)}})}var se=Z(ce,2);Ye(se,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType}}),V(H),W(g,H)},K=g=>{var H=mr();let ce;var se=D(H);{let de=R(()=>Le.chat_videoBlock_play_ariaLabel({name:l()}));rr(se,{wrapContent:!1,type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return a(de)},"data-testid":"chat-video-snapshot",onclick:()=>{E(a(M))&&y(p,!0)},get ref(){return a(w)},set ref(he){y(w,he,!0)},children:(he,qe)=>{var ue=Re(),B=ie(ue);{var we=Y=>{var G=Re(),J=ie(G);tr(J,I),W(Y,G)},fe=Y=>{var G=fr(),J=ie(G),Ce=D(J);{var Te=pe=>{var De=ur();W(pe,De)};X(Ce,pe=>{f()||pe(Te)})}V(J);var $=Z(J,2);$.muted=!0;var me=Z($,2),Ie=D(me),ye=He(Ie);V(me),te(()=>{rt($,"src",a(M)),rt($,"poster",a(d)),le($,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${a(d)||a(k)&&!a(v)?"opacity-100":"opacity-0"}`),le(Ie,1,`flex ${_()?"size-6":"size-11"} shrink-0 aspect-square items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`),le(ye,0,`ml-0.5 ${_()?"size-3":"size-5"}`)}),ke("loadeddata",$,m),ke("error",$,()=>y(v,!0)),W(Y,G)};X(B,Y=>{I()?Y(we):Y(fe,-1)})}W(he,ue)},$$slots:{default:!0}})}var Q=Z(se,2);{var re=de=>{Ye(de,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"})};X(Q,de=>{I()||de(re)})}V(H),te(()=>{le(H,1,`group relative aspect-video w-full max-w-2xl ${f()?"max-h-72":"max-h-40"}`),ce=Xe(H,"",ce,{height:I()?"100%":void 0,width:f()?"min(100%, calc(18rem * 16 / 9))":"min(100%, calc(10rem * 16 / 9))"})}),W(g,H)};X(ve,g=>{a(C)?g(q):a(v)?g(ae,1):g(K,-1)})}V(U);var oe=Z(U,2);{var Ve=g=>{bt(g,{get videoUrl(){return a(M)},get videoName(){return l()},get poster(){return a(d)},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},get openerElement(){return a(w)},get open(){return a(p)},set open(H){y(p,H,!0)}})};X(oe,g=>{!a(v)&&!a(C)&&g(Ve)})}return te(()=>O=Xe(U,"",O,{height:I()?"100%":void 0})),W(r,T),Oe(h)}const gr=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,vr=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ct(r,o){if(typeof r!="string"||!r||r!==r.trim())return null;if(r.startsWith("workspace-asset://"))return Me(r,o);if(r.startsWith("workspace-file://")){const l=Fe(r);if(!l||l.workspaceId!==o)return null;const c=ht(r);return c?lt(c,o):null}const n=r.startsWith("intent://")?r:`intent://local/file/${r}`;return lt(n,o)}function hr(r,o){if(r.startsWith("workspace-file://")){const n=Fe(r);if(!n||n.workspaceId!==o)return!1;const l=ht(r);return!!l&&!!We(l,o)}return!!We(r,o,{readOnly:!0})}function kr(r,o){return(o===0||!r[o-1].trim())&&(o===r.length-1||!r[o+1].trim())}function br(r,o,n){const l=n[0];return r.findIndex((c,u)=>{if(u<=o)return!1;const s=c.trim();return s.length>=n.length&&s.split("").every(f=>f===l)})}function wr(r,o){const n=r.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Bnhl7xZz.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/DAbdqRSx.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/D5wSh12h.js","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/DvyPNixU.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BlBjpUY-.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/BmO6NekI.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Hxdz4eYy.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/B2Arx0ZF.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/CvP7-iXZ.js","/app/immutable/chunks/DBEo2Y3v.js","/app/immutable/chunks/VlOW_lom.js","/app/immutable/chunks/Cncxuk-H.js","/app/immutable/chunks/DeaknxEN.js","/app/immutable/chunks/BrfF5NLx.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DBI9dTMM.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/euI_ACTK.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/Dep4c5m-.js","/app/immutable/chunks/B55Lo0FS.js","/app/immutable/chunks/BLKGmMKH.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/BzL9Egzq.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/DYME5vl6.js","/app/immutable/chunks/I0qWsqIQ.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/qM_0Sky2.js","/app/immutable/chunks/BYqiRSP_.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css","/app/immutable/chunks/Bu_b7Geq.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
2
+ import{t as Ue,bo as x,bw as ze,b as Be,bm as Le,_ as Et}from"./DxxarOOi.js";import{bs as Ne,ca as vt,aD as a,bH as y,ay as ie,bS as Z,W,bn as Oe,bV as z,aA as F,c9 as R,aB as j,a5 as D,bA as V,b_ as te,a7 as Re,bl as He,aw as ke,aC as Lt,c3 as be,bb as Pe,bO as Ze,ai as Pt,aF as St,br as Rt,bj as Ht,aj as ee}from"./3SdAC2_C.js";import{i as X}from"./DzAQQ1i-.js";import{e as _e,g as Wt,i as Ut}from"./BUT4El0L.js";import{h as tt}from"./BKD7o1lQ.js";import{g as Xe,s as rt,f as le}from"./Ch-D6DCZ.js";import{b as Ee}from"./Dn334wJv.js";import{d1 as Me,d0 as nt,ap as zt,d3 as ht,a9 as We,aF as kt,aX as Bt,ax as Nt,a7 as at,r as Ot,aO as Vt,aT as qt,F as Dt}from"./D5wSh12h.js";import{m as jt,bq as ot,Jq as Ke,vG as Kt,th as Gt,vI as Jt}from"./Zs30783q.js";import{K as Zt,a9 as Xt}from"./BfdTnj-p.js";import{l as Se}from"./ChTqQfQN.js";import{h as st}from"./I0qWsqIQ.js";import{a as Qt,c as bt,b as Qe,V as Ye,p as Fe,f as wt,I as Yt,r as $t,s as er}from"./B2Arx0ZF.js";import{g as it}from"./D1F-b1I5.js";import{s as tr}from"./C600Ggsz.js";import{f as rr}from"./D5eCb9SA.js";import{F as Ge}from"./BfQPFCP7.js";import{m as lt}from"./BXwdEeCG.js";import{F as nr,bF as ar}from"./B5yEHkSy.js";import{t as or}from"./DAsc1V4f.js";function xe(r,o){return o||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(r.trim())}function sr(r,o){if(o||!r)return r;const n=document.createElement("template");n.innerHTML=r;for(const l of n.content.querySelectorAll("img, video")){const c=l.getAttribute("src")||l.getAttribute("data-media-src")||"",u=[...l.querySelectorAll("source")];if(!xe(c,!1)||u.some(f=>!xe(f.getAttribute("src")||"",!1))){const f=document.createElement("img");f.setAttribute("alt",l.getAttribute("alt")||l.getAttribute("data-name")||""),f.setAttribute("data-media-unavailable","node-owned"),l.replaceWith(f);continue}l.removeAttribute("srcset");const s=l.getAttribute("poster");s&&!xe(s,!1)&&l.removeAttribute("poster")}return n.innerHTML}const ir=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function lr(r){return r&&(ir.some(o=>o.test(r))||Zt(r,"markdown"))?"static":"simple"}var cr=j("<!> <!>",1);function It(r,o){if(new.target)return Ue({component:It,...r});Ne(o,!0);let n=x(o,"workspaceId",7),l=x(o,"canUseMedia",7),c=z(null),u=z(null),s=z(!1),f=z(!1);function _(m){y(c,{url:m.getAttribute("src")||"",name:m.getAttribute("alt")||void 0,opener:m},!0),y(s,!0)}function I(m){const h=nt(m.getAttribute("href")||"",n());return h&&l()(h)?(y(c,{url:h,name:m.textContent?.trim()||void 0,opener:m,assetLink:!0},!0),y(s,!0),!0):p(m)}function p(m){const h=Me(m.getAttribute("href")||"",n());return!h||!l()(h.url)?!1:(y(u,{url:h.url,mimeType:h.mimeType,name:m.textContent?.trim()||void 0,opener:m},!0),y(f,!0),!0)}vt(()=>{a(u)&&!Me(a(u).url,n())&&(y(f,!1),y(u,null)),a(c)?.assetLink&&!nt(a(c).url,n())&&(y(s,!1),y(c,null))});var k={openImage:_,openAsset:I,get workspaceId(){return n()},set workspaceId(m){n(m),F()},get canUseMedia(){return l()},set canUseMedia(m){l(m),F()},$set:ze,$on:(m,h)=>Be(o,m,h)},v=cr(),w=ie(v);{var M=m=>{Qt(m,{get imageUrl(){return a(c).url},get imageName(){return a(c).name},get openerElement(){return a(c).opener},showActionsMenu:!0,get open(){return a(s)},set open(h){y(s,h,!0)}})},E=R(()=>a(c)&&l()(a(c).url));X(w,m=>{a(E)&&m(M)})}var C=Z(w,2);{var t=m=>{bt(m,{get videoUrl(){return a(u).url},get videoName(){return a(u).name},get mimeType(){return a(u).mimeType},sourceKind:"workspace",get openerElement(){return a(u).opener},get open(){return a(f)},set open(h){y(f,h,!0)}})},d=R(()=>a(u)&&Me(a(u).url,n())&&l()(a(u).url));X(C,m=>{a(d)&&m(t)})}return W(r,v),Oe(k)}var dr=j('<div class="flex items-center gap-2"><!> <!></div>'),ur=Lt('<svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg>'),fr=j('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><!></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span><svg viewBox="0 0 20 20" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),mr=j("<div><!> <!></div>"),pr=j('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function yt(r,o){if(new.target)return Ue({component:yt,...r});Ne(o,!0);let n=x(o,"source",7),l=x(o,"name",23,()=>Le.chat_videoBlock_fromAgent_label()),c=x(o,"poster",7),u=x(o,"allowFileMedia",7,!0),s=x(o,"canOpenFile",7),f=x(o,"fluid",7,!1),_=x(o,"compact",7,!1),I=x(o,"compactPreview",7),p=z(!1),k=z(!1),v=z(!1),w=z(null);const M=R(()=>n().kind==="inline"?`data:${n().mimeType};base64,${n().data}`:n().url);function E(g){return xe(g,u()&&s()?.()!==!1)}const C=R(()=>!E(a(M))),t=R(()=>Fe(a(M))),d=R(()=>{if(!(!c()||!E(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const g=new URL(c());return(g.protocol==="https:"||g.protocol==="workspace-file:")&&!g.username&&!g.password?c():void 0}catch{return}}});function m(){y(k,!0),y(v,!1)}var h={get source(){return n()},set source(g){n(g),F()},get name(){return l()},set name(g=Le.chat_videoBlock_fromAgent_label()){l(g),F()},get poster(){return c()},set poster(g){c(g),F()},get allowFileMedia(){return u()},set allowFileMedia(g=!0){u(g),F()},get canOpenFile(){return s()},set canOpenFile(g){s(g),F()},get fluid(){return f()},set fluid(g=!1){f(g),F()},get compact(){return _()},set compact(g=!1){_(g),F()},get compactPreview(){return I()},set compactPreview(g){I(g),F()},$set:ze,$on:(g,H)=>Be(o,g,H)},T=pr(),U=ie(T);let O;var ve=D(U);{var q=g=>{Qe(g,{get name(){return l()},reason:"load-failed"})},ae=g=>{var H=dr(),ce=D(H);{let Q=R(()=>a(t)?.path),re=R(()=>a(t)?.workspaceId);Qe(ce,{get name(){return l()},reason:"load-failed",get path(){return a(Q)},get workspaceId(){return a(re)}})}var se=Z(ce,2);Ye(se,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType}}),V(H),W(g,H)},K=g=>{var H=mr();let ce;var se=D(H);{let de=R(()=>Le.chat_videoBlock_play_ariaLabel({name:l()}));rr(se,{wrapContent:!1,type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return a(de)},"data-testid":"chat-video-snapshot",onclick:()=>{E(a(M))&&y(p,!0)},get ref(){return a(w)},set ref(he){y(w,he,!0)},children:(he,qe)=>{var ue=Re(),B=ie(ue);{var we=Y=>{var G=Re(),J=ie(G);tr(J,I),W(Y,G)},fe=Y=>{var G=fr(),J=ie(G),Ce=D(J);{var Te=pe=>{var De=ur();W(pe,De)};X(Ce,pe=>{f()||pe(Te)})}V(J);var $=Z(J,2);$.muted=!0;var me=Z($,2),Ie=D(me),ye=He(Ie);V(me),te(()=>{rt($,"src",a(M)),rt($,"poster",a(d)),le($,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${a(d)||a(k)&&!a(v)?"opacity-100":"opacity-0"}`),le(Ie,1,`flex ${_()?"size-6":"size-11"} shrink-0 aspect-square items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`),le(ye,0,`ml-0.5 ${_()?"size-3":"size-5"}`)}),ke("loadeddata",$,m),ke("error",$,()=>y(v,!0)),W(Y,G)};X(B,Y=>{I()?Y(we):Y(fe,-1)})}W(he,ue)},$$slots:{default:!0}})}var Q=Z(se,2);{var re=de=>{Ye(de,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"})};X(Q,de=>{I()||de(re)})}V(H),te(()=>{le(H,1,`group relative aspect-video w-full max-w-2xl ${f()?"max-h-72":"max-h-40"}`),ce=Xe(H,"",ce,{height:I()?"100%":void 0,width:f()?"min(100%, calc(18rem * 16 / 9))":"min(100%, calc(10rem * 16 / 9))"})}),W(g,H)};X(ve,g=>{a(C)?g(q):a(v)?g(ae,1):g(K,-1)})}V(U);var oe=Z(U,2);{var Ve=g=>{bt(g,{get videoUrl(){return a(M)},get videoName(){return l()},get poster(){return a(d)},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},get openerElement(){return a(w)},get open(){return a(p)},set open(H){y(p,H,!0)}})};X(oe,g=>{!a(v)&&!a(C)&&g(Ve)})}return te(()=>O=Xe(U,"",O,{height:I()?"100%":void 0})),W(r,T),Oe(h)}const gr=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,vr=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ct(r,o){if(typeof r!="string"||!r||r!==r.trim())return null;if(r.startsWith("workspace-asset://"))return Me(r,o);if(r.startsWith("workspace-file://")){const l=Fe(r);if(!l||l.workspaceId!==o)return null;const c=ht(r);return c?lt(c,o):null}const n=r.startsWith("intent://")?r:`intent://local/file/${r}`;return lt(n,o)}function hr(r,o){if(r.startsWith("workspace-file://")){const n=Fe(r);if(!n||n.workspaceId!==o)return!1;const l=ht(r);return!!l&&!!We(l,o)}return!!We(r,o,{readOnly:!0})}function kr(r,o){return(o===0||!r[o-1].trim())&&(o===r.length-1||!r[o+1].trim())}function br(r,o,n){const l=n[0];return r.findIndex((c,u)=>{if(u<=o)return!1;const s=c.trim();return s.length>=n.length&&s.split("").every(f=>f===l)})}function wr(r,o){const n=r.split(`
3
3
  `),l=[];let c=[];const u=()=>{const s=c.join(`
4
4
  `);s.trim()&&l.push({type:"markdown",content:s}),c=[]};for(let s=0;s<n.length;s+=1){const f=n[s].match(vr);if(f){const w=br(n,s,f[1]);if(w>s){const M=n.slice(s,w+1);if(f[2].trim()==="ws-block:video")try{const E=JSON.parse(n.slice(s+1,w).join(`
5
- `)),C=ct(E?.path,o);if(C){u(),l.push({type:"video",source:C,name:typeof E.path=="string"?E.path:void 0,poster:typeof E.poster=="string"?E.poster:void 0}),s=w;continue}}catch{}c.push(...M),s=w;continue}c.push(...n.slice(s));break}const I=!/^(?: {4}|\t)/.test(n[s])&&kr(n,s)?n[s].match(gr):null;if(!I){c.push(n[s]);continue}const[,p,k]=I,v=ct(k,o);v?(u(),l.push({type:"video",source:v,name:p||void 0})):k.startsWith("workspace-asset://")&&!zt(k)||hr(k,o)?c.push(n[s]):c.push(`[${p}](${k})`)}return u(),l}function Ae(r){return wt(r.getAttribute("src")||"")}function Je(r){return r instanceof HTMLImageElement?r:r instanceof HTMLAnchorElement?r.querySelector("img"):null}function Ir(r,o){const n=r.getBoundingClientRect(),l=o.getBoundingClientRect();return{top:n.top-l.top+6,right:l.right-n.right+6}}function dt(r,o){const n=document.activeElement;return!!(n&&(n===r||n===r?.closest("a")||o?.contains(n)))}function yr(r,o){const n=r.getAttribute("src")||"",l=Fe(n)?.path??kt(n,o)?.path;if(l)return l;if(n.startsWith("workspace-asset://")){const c=n.split(/[?#]/)[0].split("/").pop();if(c)return c}if(n&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith("//"))try{return decodeURI(n)}catch{return n}return r.getAttribute("alt")||void 0}const _t="data-image-sized",ut=r=>typeof r=="number"&&Number.isInteger(r)&&r>0;function _r(r){try{return encodeURI(r).replace(/%25/g,"%")}catch{return null}}function Ar(r){return r.startsWith("workspace-file://")?r.split(/[?#]/)[0]:r}function Mr(r,o,n){const l=new Map;for(const[c,u]of Object.entries(r)){if(!u||!ut(u.width)||!ut(u.height))continue;const s={width:u.width,height:u.height},f=new Set([c]),_=_r(c);_&&f.add(_);for(const I of[...f]){const p=We(I,o);if(p&&f.add(p),n!==void 0){const k=Bt(I,n);if(k){const v=We(`intent://local/file/${k.split("/").map(encodeURIComponent).join("/")}`,o);v&&f.add(v)}}}for(const I of f)l.has(I)||l.set(I,s)}return l}function xr(r,o,n,l){if(!o||!r.includes("<img"))return r;const c=Mr(o,n,l);return c.size===0?r:r.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const f=Ar(s[1].replace(/&amp;/g,"&")),_=c.get(f);return _?u.replace(/\s*\/?>$/,` width="${_.width}" height="${_.height}" ${_t}="">`):u})}function ft(r,o){let n=o,l,c=!1,u=!1;const s=new Map;function f(){for(const[p,{component:k,source:v}]of s)be(k),r.contains(p)&&p.replaceWith(v);s.clear()}function _(){if(!u){for(const[p,{component:k}]of s)r.contains(p)||(be(k),s.delete(p));if(n.enabled)for(const p of r.querySelectorAll("pre > code")){if(p.closest("[data-markdown-diagram]"))continue;const k=[...p.classList].find(C=>C.startsWith("language-"))?.slice(9);let v;if(k==="mermaid")v="mermaid";else if(k==="diagram"||k==="ws-block:diagram")v="diagram";else if(k==="ws-block")try{if(JSON.parse(p.textContent??"").type!=="diagram")continue;v="diagram"}catch{continue}else continue;const w=p.parentElement;if(!w)continue;if(!l){c||(c=!0,Et(()=>import("./BymgwXRn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]),import.meta.url).then(C=>{l=C.default,c=!1,_()}).catch(C=>{c=!1,Se.error("Failed to load the Markdown diagram renderer",{error:C})}));return}const M=document.createElement("div");M.dataset.markdownDiagram=v,w.replaceWith(M);const E=Pe(l,{target:M,context:n.context,props:{kind:v,source:p.textContent??"",workspaceId:n.workspaceId}});s.set(M,{component:E,source:w})}}}const I=new MutationObserver(_);return I.observe(r,{childList:!0,subtree:!0}),queueMicrotask(_),{update(p){(n.enabled!==p.enabled||n.workspaceId!==p.workspaceId)&&f(),n=p,_()},destroy(){u=!0,I.disconnect(),f()}}}var Fr=j('<span class="min-w-0 max-w-full truncate"> </span>'),Cr=j('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function At(r,o){if(new.target)return Ue({component:At,...r});Ne(o,!0);let n=x(o,"name",7);var l={get name(){return n()},set name(v){n(v),F()},$set:ze,$on:(v,w)=>Be(o,v,w)},c=Cr(),u=D(c),s=D(u);nr(s,{get icon(){return ar},class:"size-3.5"}),V(u);var f=Z(u,2),_=D(f),I=He(_,!0),p=Z(_,2);{var k=v=>{var w=Fr(),M=He(w,!0);_e(w,(E,C)=>or?.(E,C),n),te(()=>Ze(M,n())),W(v,w)};X(p,v=>{n()&&v(k)})}return V(f),V(c),te(v=>Ze(I,v),[()=>Le.ui_mediaLoadingPlaceholder_title_label()]),W(r,c),Oe(l)}const mt="markdown-image-frame";function Tr(r,o){const n=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function f(t){let d=l.get(t);return d||(d={source:t.getAttribute("src")||"",workspaceId:o.getWorkspaceId(),retries:0,failureHandled:!1},l.set(t,d)),d}function _(t){const d=f(t);return!s&&r.contains(d.fallbackHost??t)&&d.workspaceId===o.getWorkspaceId()&&o.canUseMedia(d.source)&&!t.hasAttribute("data-media-unavailable")&&!t.hasAttribute("data-media-unsupported")&&at(d.source)!==null}function I(t,d=!1){if(!_(t))return;const m=f(t),h=at(m.source);if(!h)return;const T=m.fallbackHost,U=T?.contains(document.activeElement)??!1;if(m.failureHandled=!1,m.fallbackHost=void 0,d&&(m.retries=0),t.removeAttribute("src"),t.setAttribute("src",h),T){const O=n.get(T);O&&be(O),n.delete(T),T.replaceWith(t),M(),U&&r.contains(t)&&t.focus()}}function p(t){const d=f(t);s||!r.contains(t)||d.failureHandled||(d.failureHandled=!0,_(t)&&d.retries<u.length?d.timer=setTimeout(()=>{d.timer=void 0,I(t)},u[d.retries++]):w(t,"load-failed"))}function k(t){const d=t.parentElement;return d?.classList.contains(mt)?d:null}function v(t){const d=Number(t.getAttribute("width")),m=Number(t.getAttribute("height"));if(!(d>0&&m>0))return;const h=document.createElement("span");h.className=mt,h.style.aspectRatio=`${d} / ${m}`,h.style.setProperty("--image-aspect-ratio",`${d} / ${m}`),h.style.setProperty("--image-width",`${d}px`),h.dataset.loaded="false",t.replaceWith(h),h.appendChild(t);const T=h.appendChild(document.createElement("span"));T.className="markdown-image-frame-placeholder",n.set(T,Pe(At,{target:T,props:{name:yr(t,o.getWorkspaceId())}}));const U=()=>{if(c.delete(t),s||!r.contains(h))return;h.dataset.loaded="true";const O=n.get(T);O&&(be(O),n.delete(T)),T.remove()};t.complete&&t.naturalWidth>0?U():(c.set(t,U),t.addEventListener("load",U,{once:!0}))}function w(t,d){const m=t.getAttribute("src")||t.getAttribute("data-media-src")||"",h=Fe(m),T=kt(m,o.getWorkspaceId()),U=h?.path??T?.path,O=h?.workspaceId??T?.workspaceId,ve=t.getAttribute("data-name")||t.getAttribute("alt")||U?.split("/").pop()||void 0,q=document.createElement(t instanceof HTMLVideoElement?"div":"span");q.className="media-unavailable-host",(k(t)??t).replaceWith(q),o.onMediaRemoved(t);let ae;if(t instanceof HTMLImageElement&&d==="load-failed"){const oe=f(t);oe.fallbackHost=q,_(t)&&(ae=()=>I(t,!0))}const K=Pe(Qe,{target:q,props:{name:ve,reason:d,path:U,workspaceId:O,onRetry:ae}});if(n.set(q,K),t instanceof HTMLVideoElement){q.classList.add("flex","items-center","gap-2");const oe=q.appendChild(document.createElement("span"));n.set(oe,Pe(Ye,{target:oe,props:{videoUrl:m,videoName:ve,sourceKind:"workspace",mimeType:Me(m,o.getWorkspaceId())?.mimeType}}))}}function M(){if(!s){for(const t of r.querySelectorAll("img"))Ae(t)&&!t.closest("a")&&(t.tabIndex=0,t.setAttribute("role","button")),!(t.hasAttribute("data-media-unsupported")||t.hasAttribute("data-media-unavailable"))&&(f(t),t.hasAttribute(_t)&&!k(t)&&v(t),t.getAttribute("src")&&t.complete&&t.naturalWidth===0&&p(t));for(const t of r.querySelectorAll("[data-media-unsupported]"))w(t,"unsupported");for(const t of r.querySelectorAll("[data-media-unavailable]"))w(t,Nt(t));for(const[t,d]of l)r.contains(d.fallbackHost??t)||(d.timer!==void 0&&clearTimeout(d.timer),l.delete(t));for(const[t,d]of c)r.contains(t)||(t.removeEventListener("load",d),c.delete(t));for(const[t,d]of n)r.contains(t)||(be(d),n.delete(t))}}function E(t){const d=t.target;(d instanceof HTMLImageElement||d instanceof HTMLVideoElement)&&(d instanceof HTMLImageElement?p(d):w(d,"load-failed"))}const C=new MutationObserver(M);return C.observe(r,{childList:!0,subtree:!0}),r.addEventListener("error",E,!0),queueMicrotask(M),{destroy(){s=!0,C.disconnect();for(const t of l.values())t.timer!==void 0&&clearTimeout(t.timer);l.clear();for(const[t,d]of c)t.removeEventListener("load",d);c.clear(),r.removeEventListener("error",E,!0);for(const t of n.values())be(t);n.clear()}}}var Er=j('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),Lr=j("<div></div>"),pt=j('<div role="group"><!> <!></div>'),Pr=j('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),Sr=j("<!> <!>",1);function gt(r,o){if(new.target)return Ue({component:gt,...r});Ne(o,!0);const n=e=>{var i=Re(),A=ie(i);{var b=P=>{var S=Er(),ne=D(S);{let N=R(()=>a(B).getAttribute("src")||""),ge=R(()=>a(B).getAttribute("alt")||void 0);Ee(Yt(ne,{get imageUrl(){return a(N)},get imageName(){return a(ge)},get open(){return a(fe)},set open(je){y(fe,je,!0)}}),je=>y(Y,je,!0),()=>a(Y))}V(S),Ee(S,N=>y(G,N),()=>a(G)),te(()=>Xe(S,`top: ${a(we).top??""}px; right: ${a(we).right??""}px;`)),W(P,S)},L=R(()=>a(B)&&K(a(B).getAttribute("src")||""));X(A,P=>{a(L)&&P(b)})}W(e,i)};let l=x(o,"content",7),c=x(o,"isStreaming",7,!1),u=x(o,"className",7,""),s=x(o,"workspaceId",23,()=>it()?.workspaceId??void 0),f=x(o,"relativeMediaBase",7),_=x(o,"onCodeBlockAction",7),I=x(o,"onFileClick",7),p=x(o,"canOpenFile",7),k=x(o,"allowFileMedia",7,!0),v=x(o,"taskBlockRenderMode",7,"placeholder"),w=x(o,"chatImageThumbnails",7,!1),M=x(o,"forceExternalLinks",7,!1),E=x(o,"renderRichFencesAsCode",7,!1),C=x(o,"renderDiagrams",7,!1),t=x(o,"allowSanitizedHtml",7,!1),d=x(o,"media",7);const m=Ot(),h=St(),T=R(()=>wr(l(),s())),U=R(()=>a(T).some(e=>e.type==="video")),O=R(()=>!a(U)&&a(T).length===1&&a(T)[0].type==="markdown"?a(T)[0].content:l()),ve=R(()=>lr(a(O)));let q=z(null),ae=z("");function K(e){return xe(e,k()&&p()?.()!==!1)}const oe=R(()=>sr(a(ae),k()&&p()?.()!==!1)),Ve=R(()=>$t(a(oe),s(),er)),g=R(()=>`<div class="markdown-content">${a(Ve)}</div>`);let H=0;const ce=150;let se=-1/0,Q=null,re=null;async function de(e,i,A,b){try{const L=await Vt(e,{...i,readOnly:!0});if(b!==H)return;y(ae,xr(L,A,i?.workspaceId,i?.relativeMediaBase),!0)}catch(L){if(b!==H)return;Se.error("Failed to process markdown:",L);const P=e.replace(/[&<>"']/g,S=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[S]||S);y(ae,`<p>${P}</p>`)}}function he(){if(!re)return;const e=ce-(performance.now()-se);if(e>0){Q=setTimeout(()=>{Q=null,he()},e);return}const i=re;re=null,se=performance.now(),i()}function qe(){Q!==null&&(clearTimeout(Q),Q=null),re=null,se=-1/0}vt(()=>{const e=a(O),i={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:v(),workspaceId:s(),relativeMediaBase:f()??(s()&&s()!==jt?"":void 0),renderRichFencesAsCode:E()||C(),processPrimitives:!C(),allowSanitizedHtml:t(),renderMath:!c(),workspaceFileVersion:m},A=d(),b=++H,L=()=>void de(e,i,A,b);c()?(re=L,Q===null&&he()):(qe(),L())});let ue=z(void 0),B=z(null),we=z(Rt({top:0,right:0})),fe=z(!1),Y=z(void 0),G=z(null);function J(e){if(e.type==="mouseover"&&dt(a(B),a(G)))return;const i=e.target,A=Je(i);if(A&&Ae(A)&&K(A.getAttribute("src")||"")){if(a(B)===A)return;y(B,A,!0),y(we,Ir(A,e.currentTarget),!0)}else if(a(B)&&!a(fe)){if(i instanceof Node&&a(G)?.contains(i))return;y(B,null)}}function Ce(){!a(fe)&&!dt(a(B),a(G))&&y(B,null)}function Te(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||(e.preventDefault(),e.stopPropagation(),J(e),y(fe,!0))}function $(e){return Tr(e,{getWorkspaceId:()=>s(),canUseMedia:K,onMediaRemoved:i=>{a(B)===i&&y(B,null)}})}function me(e){const i=e.target,A=i.closest("a");if(!A&&i instanceof HTMLImageElement){const L=i.getAttribute("src")||"";if(wt(L)&&K(L)){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openImage(i);return}}if(A?.href){if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openAsset(A))return;const L=pe(e),P=s()?ot(s()):void 0;st(A.href,{workspaceId:P,canOpenFile:p(),sourcePanelId:L,event:e,rawHref:A.getAttribute("href")??void 0,...M()?{forceExternal:!0}:{}});return}const b=qt(i.closest("[data-mention]"));if(b){const{type:L,meta:P}=b;if(L==="file"&&b.filePath){if(p()?.()===!1)return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.filePath;Se.debug("[MarkdownViewer] File mention clicked",{filePath:S,meta:P});const ne=pe(e),N=Ge({event:e});if(I())I()(S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne});else{const ge=s();ge&&Ke.dispatch(Kt(ge,S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne}))}}else if(b.folderPath!==void 0){if(p()?.()===!1||!s())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),Ke.dispatch(Gt(s(),Dt(b.folderPath)))}else if(L==="note"&&b.note){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.note.id;Se.debug("[MarkdownViewer] Note mention clicked",{noteId:S,meta:P});const ne=pe(e),N=Ge({event:e});if(b.note.workspaceId&&b.note.workspaceId!==s()){st(Xt(S,b.note.workspaceId),{workspaceId:s()?ot(s()):void 0,sourcePanelId:ne,event:e});return}const ge=s();ge&&Ke.dispatch(Jt(ge,S,{openInAdjacentPanel:N,sourcePanelId:ne}))}}}function Ie(e){if(ye(e),!e.defaultPrevented){if(e.target instanceof HTMLImageElement&&Ae(e.target)&&(e.key==="Enter"||e.key===" ")){me(e);return}e.key!=="Enter"||!Ge({event:e})||me(e)}}function ye(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||a(Y)?.handleCopy(e,i.getAttribute("src")||"")}function pe(e){const i=e.target;if(i instanceof HTMLElement)return i.closest("[data-panel-id]")?.dataset.panelId}Ht(()=>{H+=1,qe()});var De={get content(){return l()},set content(e){l(e),F()},get isStreaming(){return c()},set isStreaming(e=!1){c(e),F()},get className(){return u()},set className(e=""){u(e),F()},get workspaceId(){return s()},set workspaceId(e=it()?.workspaceId??void 0){s(e),F()},get relativeMediaBase(){return f()},set relativeMediaBase(e){f(e),F()},get onCodeBlockAction(){return _()},set onCodeBlockAction(e){_(e),F()},get onFileClick(){return I()},set onFileClick(e){I(e),F()},get canOpenFile(){return p()},set canOpenFile(e){p(e),F()},get allowFileMedia(){return k()},set allowFileMedia(e=!0){k(e),F()},get taskBlockRenderMode(){return v()},set taskBlockRenderMode(e="placeholder"){v(e),F()},get chatImageThumbnails(){return w()},set chatImageThumbnails(e=!1){w(e),F()},get forceExternalLinks(){return M()},set forceExternalLinks(e=!1){M(e),F()},get renderRichFencesAsCode(){return E()},set renderRichFencesAsCode(e=!1){E(e),F()},get renderDiagrams(){return C()},set renderDiagrams(e=!1){C(e),F()},get allowSanitizedHtml(){return t()},set allowSanitizedHtml(e=!1){t(e),F()},get media(){return d()},set media(e){d(e),F()},$set:ze,$on:(e,i)=>Be(o,e,i)},$e=Sr(),et=ie($e);{var Mt=e=>{var i=Lr();Wt(i,21,()=>a(T),Ut,(A,b)=>{var L=Re(),P=ie(L);{var S=N=>{yt(N,{get allowFileMedia(){return k()},get canOpenFile(){return p()},get source(){return a(b).source},get name(){return a(b).name},get poster(){return a(b).poster}})},ne=N=>{gt(N,{get content(){return a(b).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return f()},get onCodeBlockAction(){return _()},get onFileClick(){return I()},get canOpenFile(){return p()},get allowFileMedia(){return k()},get taskBlockRenderMode(){return v()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return M()},get renderRichFencesAsCode(){return E()},get renderDiagrams(){return C()},get allowSanitizedHtml(){return t()},get media(){return d()}})};X(P,N=>{a(b).type==="video"?N(S):N(ne,-1)})}W(A,L)}),V(i),te(()=>le(i,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(e,i)},xt=e=>{var i=pt();let A;var b=D(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Te),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)},Ft=e=>{var i=Pr(),A=D(i),b=He(A,!0);V(i),te(()=>{le(i,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),Ze(b,a(O))}),W(e,i)},Ct=e=>{var i=pt();let A;var b=D(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),Ee(i,P=>y(q,P),()=>a(q)),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Te),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)};X(et,e=>{a(U)?e(Mt):c()?e(xt,1):a(ve)==="simple"&&!t()?e(Ft,2):e(Ct,-1)})}var Tt=Z(et,2);return Ee(It(Tt,{get workspaceId(){return s()},canUseMedia:K}),e=>y(ue,e,!0),()=>a(ue)),W(r,$e),Oe(De)}Pt(["click","keydown","contextmenu","mouseover","focusin"]);export{yt as C,gt as M,At as a,wr as s};
5
+ `)),C=ct(E?.path,o);if(C){u(),l.push({type:"video",source:C,name:typeof E.path=="string"?E.path:void 0,poster:typeof E.poster=="string"?E.poster:void 0}),s=w;continue}}catch{}c.push(...M),s=w;continue}c.push(...n.slice(s));break}const I=!/^(?: {4}|\t)/.test(n[s])&&kr(n,s)?n[s].match(gr):null;if(!I){c.push(n[s]);continue}const[,p,k]=I,v=ct(k,o);v?(u(),l.push({type:"video",source:v,name:p||void 0})):k.startsWith("workspace-asset://")&&!zt(k)||hr(k,o)?c.push(n[s]):c.push(`[${p}](${k})`)}return u(),l}function Ae(r){return wt(r.getAttribute("src")||"")}function Je(r){return r instanceof HTMLImageElement?r:r instanceof HTMLAnchorElement?r.querySelector("img"):null}function Ir(r,o){const n=r.getBoundingClientRect(),l=o.getBoundingClientRect();return{top:n.top-l.top+6,right:l.right-n.right+6}}function dt(r,o){const n=document.activeElement;return!!(n&&(n===r||n===r?.closest("a")||o?.contains(n)))}function yr(r,o){const n=r.getAttribute("src")||"",l=Fe(n)?.path??kt(n,o)?.path;if(l)return l;if(n.startsWith("workspace-asset://")){const c=n.split(/[?#]/)[0].split("/").pop();if(c)return c}if(n&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith("//"))try{return decodeURI(n)}catch{return n}return r.getAttribute("alt")||void 0}const _t="data-image-sized",ut=r=>typeof r=="number"&&Number.isInteger(r)&&r>0;function _r(r){try{return encodeURI(r).replace(/%25/g,"%")}catch{return null}}function Ar(r){return r.startsWith("workspace-file://")?r.split(/[?#]/)[0]:r}function Mr(r,o,n){const l=new Map;for(const[c,u]of Object.entries(r)){if(!u||!ut(u.width)||!ut(u.height))continue;const s={width:u.width,height:u.height},f=new Set([c]),_=_r(c);_&&f.add(_);for(const I of[...f]){const p=We(I,o);if(p&&f.add(p),n!==void 0){const k=Bt(I,n);if(k){const v=We(`intent://local/file/${k.split("/").map(encodeURIComponent).join("/")}`,o);v&&f.add(v)}}}for(const I of f)l.has(I)||l.set(I,s)}return l}function xr(r,o,n,l){if(!o||!r.includes("<img"))return r;const c=Mr(o,n,l);return c.size===0?r:r.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const f=Ar(s[1].replace(/&amp;/g,"&")),_=c.get(f);return _?u.replace(/\s*\/?>$/,` width="${_.width}" height="${_.height}" ${_t}="">`):u})}function ft(r,o){let n=o,l,c=!1,u=!1;const s=new Map;function f(){for(const[p,{component:k,source:v}]of s)be(k),r.contains(p)&&p.replaceWith(v);s.clear()}function _(){if(!u){for(const[p,{component:k}]of s)r.contains(p)||(be(k),s.delete(p));if(n.enabled)for(const p of r.querySelectorAll("pre > code")){if(p.closest("[data-markdown-diagram]"))continue;const k=[...p.classList].find(C=>C.startsWith("language-"))?.slice(9);let v;if(k==="mermaid")v="mermaid";else if(k==="diagram"||k==="ws-block:diagram")v="diagram";else if(k==="ws-block")try{if(JSON.parse(p.textContent??"").type!=="diagram")continue;v="diagram"}catch{continue}else continue;const w=p.parentElement;if(!w)continue;if(!l){c||(c=!0,Et(()=>import("./Bnhl7xZz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]),import.meta.url).then(C=>{l=C.default,c=!1,_()}).catch(C=>{c=!1,Se.error("Failed to load the Markdown diagram renderer",{error:C})}));return}const M=document.createElement("div");M.dataset.markdownDiagram=v,w.replaceWith(M);const E=Pe(l,{target:M,context:n.context,props:{kind:v,source:p.textContent??"",workspaceId:n.workspaceId}});s.set(M,{component:E,source:w})}}}const I=new MutationObserver(_);return I.observe(r,{childList:!0,subtree:!0}),queueMicrotask(_),{update(p){(n.enabled!==p.enabled||n.workspaceId!==p.workspaceId)&&f(),n=p,_()},destroy(){u=!0,I.disconnect(),f()}}}var Fr=j('<span class="min-w-0 max-w-full truncate"> </span>'),Cr=j('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function At(r,o){if(new.target)return Ue({component:At,...r});Ne(o,!0);let n=x(o,"name",7);var l={get name(){return n()},set name(v){n(v),F()},$set:ze,$on:(v,w)=>Be(o,v,w)},c=Cr(),u=D(c),s=D(u);nr(s,{get icon(){return ar},class:"size-3.5"}),V(u);var f=Z(u,2),_=D(f),I=He(_,!0),p=Z(_,2);{var k=v=>{var w=Fr(),M=He(w,!0);_e(w,(E,C)=>or?.(E,C),n),te(()=>Ze(M,n())),W(v,w)};X(p,v=>{n()&&v(k)})}return V(f),V(c),te(v=>Ze(I,v),[()=>Le.ui_mediaLoadingPlaceholder_title_label()]),W(r,c),Oe(l)}const mt="markdown-image-frame";function Tr(r,o){const n=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function f(t){let d=l.get(t);return d||(d={source:t.getAttribute("src")||"",workspaceId:o.getWorkspaceId(),retries:0,failureHandled:!1},l.set(t,d)),d}function _(t){const d=f(t);return!s&&r.contains(d.fallbackHost??t)&&d.workspaceId===o.getWorkspaceId()&&o.canUseMedia(d.source)&&!t.hasAttribute("data-media-unavailable")&&!t.hasAttribute("data-media-unsupported")&&at(d.source)!==null}function I(t,d=!1){if(!_(t))return;const m=f(t),h=at(m.source);if(!h)return;const T=m.fallbackHost,U=T?.contains(document.activeElement)??!1;if(m.failureHandled=!1,m.fallbackHost=void 0,d&&(m.retries=0),t.removeAttribute("src"),t.setAttribute("src",h),T){const O=n.get(T);O&&be(O),n.delete(T),T.replaceWith(t),M(),U&&r.contains(t)&&t.focus()}}function p(t){const d=f(t);s||!r.contains(t)||d.failureHandled||(d.failureHandled=!0,_(t)&&d.retries<u.length?d.timer=setTimeout(()=>{d.timer=void 0,I(t)},u[d.retries++]):w(t,"load-failed"))}function k(t){const d=t.parentElement;return d?.classList.contains(mt)?d:null}function v(t){const d=Number(t.getAttribute("width")),m=Number(t.getAttribute("height"));if(!(d>0&&m>0))return;const h=document.createElement("span");h.className=mt,h.style.aspectRatio=`${d} / ${m}`,h.style.setProperty("--image-aspect-ratio",`${d} / ${m}`),h.style.setProperty("--image-width",`${d}px`),h.dataset.loaded="false",t.replaceWith(h),h.appendChild(t);const T=h.appendChild(document.createElement("span"));T.className="markdown-image-frame-placeholder",n.set(T,Pe(At,{target:T,props:{name:yr(t,o.getWorkspaceId())}}));const U=()=>{if(c.delete(t),s||!r.contains(h))return;h.dataset.loaded="true";const O=n.get(T);O&&(be(O),n.delete(T)),T.remove()};t.complete&&t.naturalWidth>0?U():(c.set(t,U),t.addEventListener("load",U,{once:!0}))}function w(t,d){const m=t.getAttribute("src")||t.getAttribute("data-media-src")||"",h=Fe(m),T=kt(m,o.getWorkspaceId()),U=h?.path??T?.path,O=h?.workspaceId??T?.workspaceId,ve=t.getAttribute("data-name")||t.getAttribute("alt")||U?.split("/").pop()||void 0,q=document.createElement(t instanceof HTMLVideoElement?"div":"span");q.className="media-unavailable-host",(k(t)??t).replaceWith(q),o.onMediaRemoved(t);let ae;if(t instanceof HTMLImageElement&&d==="load-failed"){const oe=f(t);oe.fallbackHost=q,_(t)&&(ae=()=>I(t,!0))}const K=Pe(Qe,{target:q,props:{name:ve,reason:d,path:U,workspaceId:O,onRetry:ae}});if(n.set(q,K),t instanceof HTMLVideoElement){q.classList.add("flex","items-center","gap-2");const oe=q.appendChild(document.createElement("span"));n.set(oe,Pe(Ye,{target:oe,props:{videoUrl:m,videoName:ve,sourceKind:"workspace",mimeType:Me(m,o.getWorkspaceId())?.mimeType}}))}}function M(){if(!s){for(const t of r.querySelectorAll("img"))Ae(t)&&!t.closest("a")&&(t.tabIndex=0,t.setAttribute("role","button")),!(t.hasAttribute("data-media-unsupported")||t.hasAttribute("data-media-unavailable"))&&(f(t),t.hasAttribute(_t)&&!k(t)&&v(t),t.getAttribute("src")&&t.complete&&t.naturalWidth===0&&p(t));for(const t of r.querySelectorAll("[data-media-unsupported]"))w(t,"unsupported");for(const t of r.querySelectorAll("[data-media-unavailable]"))w(t,Nt(t));for(const[t,d]of l)r.contains(d.fallbackHost??t)||(d.timer!==void 0&&clearTimeout(d.timer),l.delete(t));for(const[t,d]of c)r.contains(t)||(t.removeEventListener("load",d),c.delete(t));for(const[t,d]of n)r.contains(t)||(be(d),n.delete(t))}}function E(t){const d=t.target;(d instanceof HTMLImageElement||d instanceof HTMLVideoElement)&&(d instanceof HTMLImageElement?p(d):w(d,"load-failed"))}const C=new MutationObserver(M);return C.observe(r,{childList:!0,subtree:!0}),r.addEventListener("error",E,!0),queueMicrotask(M),{destroy(){s=!0,C.disconnect();for(const t of l.values())t.timer!==void 0&&clearTimeout(t.timer);l.clear();for(const[t,d]of c)t.removeEventListener("load",d);c.clear(),r.removeEventListener("error",E,!0);for(const t of n.values())be(t);n.clear()}}}var Er=j('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),Lr=j("<div></div>"),pt=j('<div role="group"><!> <!></div>'),Pr=j('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),Sr=j("<!> <!>",1);function gt(r,o){if(new.target)return Ue({component:gt,...r});Ne(o,!0);const n=e=>{var i=Re(),A=ie(i);{var b=P=>{var S=Er(),ne=D(S);{let N=R(()=>a(B).getAttribute("src")||""),ge=R(()=>a(B).getAttribute("alt")||void 0);Ee(Yt(ne,{get imageUrl(){return a(N)},get imageName(){return a(ge)},get open(){return a(fe)},set open(je){y(fe,je,!0)}}),je=>y(Y,je,!0),()=>a(Y))}V(S),Ee(S,N=>y(G,N),()=>a(G)),te(()=>Xe(S,`top: ${a(we).top??""}px; right: ${a(we).right??""}px;`)),W(P,S)},L=R(()=>a(B)&&K(a(B).getAttribute("src")||""));X(A,P=>{a(L)&&P(b)})}W(e,i)};let l=x(o,"content",7),c=x(o,"isStreaming",7,!1),u=x(o,"className",7,""),s=x(o,"workspaceId",23,()=>it()?.workspaceId??void 0),f=x(o,"relativeMediaBase",7),_=x(o,"onCodeBlockAction",7),I=x(o,"onFileClick",7),p=x(o,"canOpenFile",7),k=x(o,"allowFileMedia",7,!0),v=x(o,"taskBlockRenderMode",7,"placeholder"),w=x(o,"chatImageThumbnails",7,!1),M=x(o,"forceExternalLinks",7,!1),E=x(o,"renderRichFencesAsCode",7,!1),C=x(o,"renderDiagrams",7,!1),t=x(o,"allowSanitizedHtml",7,!1),d=x(o,"media",7);const m=Ot(),h=St(),T=R(()=>wr(l(),s())),U=R(()=>a(T).some(e=>e.type==="video")),O=R(()=>!a(U)&&a(T).length===1&&a(T)[0].type==="markdown"?a(T)[0].content:l()),ve=R(()=>lr(a(O)));let q=z(null),ae=z("");function K(e){return xe(e,k()&&p()?.()!==!1)}const oe=R(()=>sr(a(ae),k()&&p()?.()!==!1)),Ve=R(()=>$t(a(oe),s(),er)),g=R(()=>`<div class="markdown-content">${a(Ve)}</div>`);let H=0;const ce=150;let se=-1/0,Q=null,re=null;async function de(e,i,A,b){try{const L=await Vt(e,{...i,readOnly:!0});if(b!==H)return;y(ae,xr(L,A,i?.workspaceId,i?.relativeMediaBase),!0)}catch(L){if(b!==H)return;Se.error("Failed to process markdown:",L);const P=e.replace(/[&<>"']/g,S=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[S]||S);y(ae,`<p>${P}</p>`)}}function he(){if(!re)return;const e=ce-(performance.now()-se);if(e>0){Q=setTimeout(()=>{Q=null,he()},e);return}const i=re;re=null,se=performance.now(),i()}function qe(){Q!==null&&(clearTimeout(Q),Q=null),re=null,se=-1/0}vt(()=>{const e=a(O),i={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:v(),workspaceId:s(),relativeMediaBase:f()??(s()&&s()!==jt?"":void 0),renderRichFencesAsCode:E()||C(),processPrimitives:!C(),allowSanitizedHtml:t(),renderMath:!c(),workspaceFileVersion:m},A=d(),b=++H,L=()=>void de(e,i,A,b);c()?(re=L,Q===null&&he()):(qe(),L())});let ue=z(void 0),B=z(null),we=z(Rt({top:0,right:0})),fe=z(!1),Y=z(void 0),G=z(null);function J(e){if(e.type==="mouseover"&&dt(a(B),a(G)))return;const i=e.target,A=Je(i);if(A&&Ae(A)&&K(A.getAttribute("src")||"")){if(a(B)===A)return;y(B,A,!0),y(we,Ir(A,e.currentTarget),!0)}else if(a(B)&&!a(fe)){if(i instanceof Node&&a(G)?.contains(i))return;y(B,null)}}function Ce(){!a(fe)&&!dt(a(B),a(G))&&y(B,null)}function Te(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||(e.preventDefault(),e.stopPropagation(),J(e),y(fe,!0))}function $(e){return Tr(e,{getWorkspaceId:()=>s(),canUseMedia:K,onMediaRemoved:i=>{a(B)===i&&y(B,null)}})}function me(e){const i=e.target,A=i.closest("a");if(!A&&i instanceof HTMLImageElement){const L=i.getAttribute("src")||"";if(wt(L)&&K(L)){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openImage(i);return}}if(A?.href){if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openAsset(A))return;const L=pe(e),P=s()?ot(s()):void 0;st(A.href,{workspaceId:P,canOpenFile:p(),sourcePanelId:L,event:e,rawHref:A.getAttribute("href")??void 0,...M()?{forceExternal:!0}:{}});return}const b=qt(i.closest("[data-mention]"));if(b){const{type:L,meta:P}=b;if(L==="file"&&b.filePath){if(p()?.()===!1)return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.filePath;Se.debug("[MarkdownViewer] File mention clicked",{filePath:S,meta:P});const ne=pe(e),N=Ge({event:e});if(I())I()(S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne});else{const ge=s();ge&&Ke.dispatch(Kt(ge,S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne}))}}else if(b.folderPath!==void 0){if(p()?.()===!1||!s())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),Ke.dispatch(Gt(s(),Dt(b.folderPath)))}else if(L==="note"&&b.note){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.note.id;Se.debug("[MarkdownViewer] Note mention clicked",{noteId:S,meta:P});const ne=pe(e),N=Ge({event:e});if(b.note.workspaceId&&b.note.workspaceId!==s()){st(Xt(S,b.note.workspaceId),{workspaceId:s()?ot(s()):void 0,sourcePanelId:ne,event:e});return}const ge=s();ge&&Ke.dispatch(Jt(ge,S,{openInAdjacentPanel:N,sourcePanelId:ne}))}}}function Ie(e){if(ye(e),!e.defaultPrevented){if(e.target instanceof HTMLImageElement&&Ae(e.target)&&(e.key==="Enter"||e.key===" ")){me(e);return}e.key!=="Enter"||!Ge({event:e})||me(e)}}function ye(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||a(Y)?.handleCopy(e,i.getAttribute("src")||"")}function pe(e){const i=e.target;if(i instanceof HTMLElement)return i.closest("[data-panel-id]")?.dataset.panelId}Ht(()=>{H+=1,qe()});var De={get content(){return l()},set content(e){l(e),F()},get isStreaming(){return c()},set isStreaming(e=!1){c(e),F()},get className(){return u()},set className(e=""){u(e),F()},get workspaceId(){return s()},set workspaceId(e=it()?.workspaceId??void 0){s(e),F()},get relativeMediaBase(){return f()},set relativeMediaBase(e){f(e),F()},get onCodeBlockAction(){return _()},set onCodeBlockAction(e){_(e),F()},get onFileClick(){return I()},set onFileClick(e){I(e),F()},get canOpenFile(){return p()},set canOpenFile(e){p(e),F()},get allowFileMedia(){return k()},set allowFileMedia(e=!0){k(e),F()},get taskBlockRenderMode(){return v()},set taskBlockRenderMode(e="placeholder"){v(e),F()},get chatImageThumbnails(){return w()},set chatImageThumbnails(e=!1){w(e),F()},get forceExternalLinks(){return M()},set forceExternalLinks(e=!1){M(e),F()},get renderRichFencesAsCode(){return E()},set renderRichFencesAsCode(e=!1){E(e),F()},get renderDiagrams(){return C()},set renderDiagrams(e=!1){C(e),F()},get allowSanitizedHtml(){return t()},set allowSanitizedHtml(e=!1){t(e),F()},get media(){return d()},set media(e){d(e),F()},$set:ze,$on:(e,i)=>Be(o,e,i)},$e=Sr(),et=ie($e);{var Mt=e=>{var i=Lr();Wt(i,21,()=>a(T),Ut,(A,b)=>{var L=Re(),P=ie(L);{var S=N=>{yt(N,{get allowFileMedia(){return k()},get canOpenFile(){return p()},get source(){return a(b).source},get name(){return a(b).name},get poster(){return a(b).poster}})},ne=N=>{gt(N,{get content(){return a(b).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return f()},get onCodeBlockAction(){return _()},get onFileClick(){return I()},get canOpenFile(){return p()},get allowFileMedia(){return k()},get taskBlockRenderMode(){return v()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return M()},get renderRichFencesAsCode(){return E()},get renderDiagrams(){return C()},get allowSanitizedHtml(){return t()},get media(){return d()}})};X(P,N=>{a(b).type==="video"?N(S):N(ne,-1)})}W(A,L)}),V(i),te(()=>le(i,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(e,i)},xt=e=>{var i=pt();let A;var b=D(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Te),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)},Ft=e=>{var i=Pr(),A=D(i),b=He(A,!0);V(i),te(()=>{le(i,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),Ze(b,a(O))}),W(e,i)},Ct=e=>{var i=pt();let A;var b=D(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),Ee(i,P=>y(q,P),()=>a(q)),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Te),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)};X(et,e=>{a(U)?e(Mt):c()?e(xt,1):a(ve)==="simple"&&!t()?e(Ft,2):e(Ct,-1)})}var Tt=Z(et,2);return Ee(It(Tt,{get workspaceId(){return s()},canUseMedia:K}),e=>y(ue,e,!0),()=>a(ue)),W(r,$e),Oe(De)}Pt(["click","keydown","contextmenu","mouseover","focusin"]);export{yt as C,gt as M,At as a,wr as s};
@@ -1 +1 @@
1
- import{g as l,r as m,d as a}from"./DCwrIUyt.js";import{p}from"./B3pPpWYK.js";import{b as t,ay as o}from"./Dyo489Aj.js";import{M as u,b as c}from"./Co5Wv5vC.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=y(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),y=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),v=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(v(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},$={parser:b,db:a,renderer:m,styles:l};export{$ as diagram};
1
+ import{g as l,r as m,d as a}from"./C4qomPfT.js";import{p}from"./BPqj6Qvi.js";import{b as t,ay as o}from"./DAbdqRSx.js";import{M as u,b as c}from"./Co5Wv5vC.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=y(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),y=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),v=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(v(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},$={parser:b,db:a,renderer:m,styles:l};export{$ as diagram};
@@ -1,2 +1,2 @@
1
- import{K as jt}from"./Dxc-KEkE.js";import{V as Ut}from"./Bi-OoqI4.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"./DxxarOOi.js";import{i as I}from"./DzAQQ1i-.js";import{s as je,f as Ue,g as Be}from"./Ch-D6DCZ.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as Vt}from"./CuLrgEBU.js";import{k as et}from"./ByAetY4P.js";import{s as tt}from"./C600Ggsz.js";import{n as se,b as at,j as ge}from"./DSjVYlVX.js";import{F as $t,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./B5yEHkSy.js";import{m as ea}from"./DkkzFfYK.js";import{f as Le}from"./D5eCb9SA.js";import"./BfQPFCP7.js";import{T as rt}from"./xzC0xG4O.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import"./Zs30783q.js";import{q as ta,h as aa,S as ra}from"./C6a1-Err.js";import{O as We}from"./DUGzdx5G.js";import{be as na,D as sa,q as oa}from"./CPc9hi45.js";import{d as ia}from"./BNlcBg5q.js";import{s as la,f as da,c as nt}from"./DCEkJXus.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"./A3itjZn8.js";import{V as Ut}from"./BHMaHtb7.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"./DxxarOOi.js";import{i as I}from"./DzAQQ1i-.js";import{s as je,f as Ue,g as Be}from"./Ch-D6DCZ.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as Vt}from"./DhTidcoi.js";import{k as et}from"./ByAetY4P.js";import{s as tt}from"./C600Ggsz.js";import{n as se,b as at,j as ge}from"./DSjVYlVX.js";import{F as $t,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./B5yEHkSy.js";import{m as ea}from"./DkkzFfYK.js";import{f as Le}from"./D5eCb9SA.js";import"./BfQPFCP7.js";import{T as rt}from"./xzC0xG4O.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import"./Zs30783q.js";import{q as ta,h as aa,S as ra}from"./KLcMYBf-.js";import{O as We}from"./MvtlzB8k.js";import{be as na,D as sa,q as oa}from"./DvyPNixU.js";import{d as ia}from"./C0urABBN.js";import{s as la,f as da,c as nt}from"./DCEkJXus.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{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{d as E}from"./BXwdEeCG.js";import{Jq as o,Em as D,DJ as _,m as A,vn as O,uZ as C,ga as H,C$ as L,Dh as P,Fm as R,D3 as x}from"./Zs30783q.js";import{b8 as p}from"./BfdTnj-p.js";import{d as F}from"./B0Z-1lwJ.js";import{n as q}from"./fvPmV5Gi.js";import{o as B,e as W}from"./GfYLoKaL.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function $(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function J(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&$(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function K(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await E.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(D(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":W(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await q(d):await B(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await J(n,a,t);f&&T(n,a);const i=f||await K(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||F("chat:open-message",b)},w)}export{ee as openMessage,K as seekConversationToMessage};
1
+ import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{d as E}from"./BXwdEeCG.js";import{Jq as o,Em as D,DJ as _,m as A,vn as O,uZ as C,ga as H,C$ as L,Dh as P,Fm as R,D3 as x}from"./Zs30783q.js";import{b8 as p}from"./BfdTnj-p.js";import{d as F}from"./B0Z-1lwJ.js";import{n as q}from"./BlBjpUY-.js";import{o as B,e as W}from"./CkF26rCa.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function $(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function J(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&$(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function K(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await E.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(D(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":W(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await q(d):await B(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await J(n,a,t);f&&T(n,a);const i=f||await K(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||F("chat:open-message",b)},w)}export{ee as openMessage,K as seekConversationToMessage};