@intent-hq/web 2.372.2 → 2.372.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BZQZwdGm.js → -il6if-X.js} +1 -1
  3. package/web/app/immutable/chunks/{DSIsc1Ss.js → 0PFbquWg.js} +1 -1
  4. package/web/app/immutable/chunks/{D9-KwDth.js → 2gbKHQXV.js} +1 -1
  5. package/web/app/immutable/chunks/{B6l-Kttu.js → 3vi-OgRR.js} +1 -1
  6. package/web/app/immutable/chunks/{B0kpU9fA.js → 4WFBPbig.js} +2 -2
  7. package/web/app/immutable/chunks/{vE2E6sS8.js → 64KJqioX.js} +1 -1
  8. package/web/app/immutable/chunks/{CrL6DZCQ.js → 8vt0w0gB.js} +1 -1
  9. package/web/app/immutable/chunks/{CL1PbmdJ.js → AzvtNQGc.js} +1 -1
  10. package/web/app/immutable/chunks/{lFTk8wpi.js → B3agx6Zv.js} +1 -1
  11. package/web/app/immutable/chunks/{BpWCMu3u.js → B430oCRo.js} +1 -1
  12. package/web/app/immutable/chunks/{BIn5egRU.js → B4N2SW_I.js} +1 -1
  13. package/web/app/immutable/chunks/{Dkvzw9dt.js → B6OWzTDz.js} +1 -1
  14. package/web/app/immutable/chunks/{CjYF1At4.js → B77zwvv7.js} +1 -1
  15. package/web/app/immutable/chunks/{DC0oh9YH.js → B8GoKZxM.js} +1 -1
  16. package/web/app/immutable/chunks/{Di4F3rxF.js → B93aSOB6.js} +1 -1
  17. package/web/app/immutable/chunks/{BrFkQr4z.js → BAcZGd3g.js} +1 -1
  18. package/web/app/immutable/chunks/{O-dTT9_6.js → BDMD6FdT.js} +1 -1
  19. package/web/app/immutable/chunks/{CrBBYf3_.js → BFAXN_U2.js} +1 -1
  20. package/web/app/immutable/chunks/{ulO2uazy.js → BIZcpPtH.js} +1 -1
  21. package/web/app/immutable/chunks/{ftVcR4tQ.js → BMjTWq66.js} +1 -1
  22. package/web/app/immutable/chunks/{BQNpzQlP.js → BQ0lhaiw.js} +1 -1
  23. package/web/app/immutable/chunks/{EwMtkE4R.js → BR-e1Dqz.js} +4 -4
  24. package/web/app/immutable/chunks/{Ixhw1ROs.js → BSXFgzj_.js} +1 -1
  25. package/web/app/immutable/chunks/{CnzZSXm6.js → BbbO1mVP.js} +1 -1
  26. package/web/app/immutable/chunks/{CajUAX8N.js → BiWBSez2.js} +2 -2
  27. package/web/app/immutable/chunks/{DY06SZsl.js → BjLzmoKu.js} +1 -1
  28. package/web/app/immutable/chunks/{ZJOyleCJ.js → BjmThgx9.js} +3 -3
  29. package/web/app/immutable/chunks/{BIkmNkpw.js → BlPpu_gv.js} +1 -1
  30. package/web/app/immutable/chunks/{BTcBtO7l.js → Bmgc_Vmk.js} +1 -1
  31. package/web/app/immutable/chunks/{D-usBtmP.js → BpXYSrHL.js} +4 -4
  32. package/web/app/immutable/chunks/{vlM04DTZ.js → BuHIOAsb.js} +1 -1
  33. package/web/app/immutable/chunks/{OusZ11tk.js → Buf2XX2m.js} +1 -1
  34. package/web/app/immutable/chunks/{BuQN2T0g.js → Byc-Gwn1.js} +2 -2
  35. package/web/app/immutable/chunks/{uA3ZM6fH.js → C2f0QCtk.js} +1 -1
  36. package/web/app/immutable/chunks/{C79sRXBG.js → C4tXJNlU.js} +1 -1
  37. package/web/app/immutable/chunks/{CQy8trug.js → C5Ddrquv.js} +1 -1
  38. package/web/app/immutable/chunks/{DsnmJyUD.js → C8F76z1j.js} +1 -1
  39. package/web/app/immutable/chunks/{B2NZzPt-.js → C8GDR5mq.js} +1 -1
  40. package/web/app/immutable/chunks/{DHpb0iQY.js → CBP_r2rZ.js} +1 -1
  41. package/web/app/immutable/chunks/{BOD8_Ffh.js → CCr3GhwT.js} +1 -1
  42. package/web/app/immutable/chunks/{A-qdlPO9.js → CEIGYgmC.js} +1 -1
  43. package/web/app/immutable/chunks/{Z4Jzxw8B.js → CLkKOQIb.js} +1 -1
  44. package/web/app/immutable/chunks/{CBHdapAk.js → CMR4RacT.js} +1 -1
  45. package/web/app/immutable/chunks/{B9STQthu.js → CMd9xe_v.js} +1 -1
  46. package/web/app/immutable/chunks/{DdJj628K.js → CNW9Rwes.js} +1 -1
  47. package/web/app/immutable/chunks/{Ds6NYQhM.js → CNc8h__d.js} +1 -1
  48. package/web/app/immutable/chunks/{CYyfRGPT.js → CP03b_lt.js} +1 -1
  49. package/web/app/immutable/chunks/{BTi_uPkP.js → CSUG4tUd.js} +2 -2
  50. package/web/app/immutable/chunks/{D82C3bhe.js → CVA75Jzf.js} +1 -1
  51. package/web/app/immutable/chunks/{CtZeiR9i.js → CXXobfG5.js} +1 -1
  52. package/web/app/immutable/chunks/{BApUcPKR.js → C_MA8w30.js} +1 -1
  53. package/web/app/immutable/chunks/{wDPUZWBZ.js → CbGkMYMi.js} +1 -1
  54. package/web/app/immutable/chunks/{xs1C7KnJ.js → CgyKOUjB.js} +1 -1
  55. package/web/app/immutable/chunks/{f50N8hQo.js → Ciyw1cDk.js} +1 -1
  56. package/web/app/immutable/chunks/{LbiCax8N.js → CjmicwNO.js} +1 -1
  57. package/web/app/immutable/chunks/Ck2JBj0W.js +3 -0
  58. package/web/app/immutable/chunks/{Dge5ZGj2.js → CmfLCgYN.js} +1 -1
  59. package/web/app/immutable/chunks/{2XoFwLeT.js → CuNdhmq6.js} +1 -1
  60. package/web/app/immutable/chunks/{CMAV3UUk.js → Cu_kcmjo.js} +1 -1
  61. package/web/app/immutable/chunks/{B0lZCUS6.js → CvO597Pq.js} +1 -1
  62. package/web/app/immutable/chunks/{CPj4SFCC.js → CwLBVHwC.js} +1 -1
  63. package/web/app/immutable/chunks/{CZDluI6H.js → CygNkso5.js} +1 -1
  64. package/web/app/immutable/chunks/{CtKyfVB_.js → D-5xnKgT.js} +1 -1
  65. package/web/app/immutable/chunks/{RwJyhbRN.js → D0WHOKE3.js} +1 -1
  66. package/web/app/immutable/chunks/{CIJY2gxU.js → D4HebHoD.js} +1 -1
  67. package/web/app/immutable/chunks/{BbobBw8S.js → D4_8WlAX.js} +1 -1
  68. package/web/app/immutable/chunks/{CR5ZxoLH.js → D4p9bnGO.js} +1 -1
  69. package/web/app/immutable/chunks/{BDThAQjj.js → D73rJM26.js} +1 -1
  70. package/web/app/immutable/chunks/{Df3mQZLv.js → D7X_WaSL.js} +3 -3
  71. package/web/app/immutable/chunks/{DE_K0DMt.js → D9E1Sed-.js} +3 -3
  72. package/web/app/immutable/chunks/{DCzChru-.js → D9ZsyNyz.js} +1 -1
  73. package/web/app/immutable/chunks/{2YKrLT6f.js → DAAshoKb.js} +1 -1
  74. package/web/app/immutable/chunks/{BesmUwoU.js → DL1rChoc.js} +1 -1
  75. package/web/app/immutable/chunks/{Oweeyv1v.js → DL9oF9R-.js} +1 -1
  76. package/web/app/immutable/chunks/{BehvUfjM.js → DO0YQnSr.js} +1 -1
  77. package/web/app/immutable/chunks/{BpSBXUuJ.js → DQITwHBm.js} +2 -2
  78. package/web/app/immutable/chunks/{DOOplL0N.js → DSam4kPq.js} +2 -2
  79. package/web/app/immutable/chunks/{BPW7kjsh.js → DSviIBB2.js} +1 -1
  80. package/web/app/immutable/chunks/{m11ohSMf.js → DTl-epgW.js} +1 -1
  81. package/web/app/immutable/chunks/{B418rdhJ.js → DUnf3IJM.js} +1 -1
  82. package/web/app/immutable/chunks/{5Z6V3HtS.js → DVkhmNxg.js} +3 -3
  83. package/web/app/immutable/chunks/{BWDjljS8.js → DXT_tHZV.js} +3 -3
  84. package/web/app/immutable/chunks/{BPwzpRKZ.js → DXq51U5Z.js} +1 -1
  85. package/web/app/immutable/chunks/{1mJrE3jk.js → DZnf3Vcd.js} +1 -1
  86. package/web/app/immutable/chunks/{B9Y57c7j.js → D_yMjDjB.js} +6 -6
  87. package/web/app/immutable/chunks/{CKK0Gz-a.js → DdfA1Cl6.js} +2 -2
  88. package/web/app/immutable/chunks/{DFQ6yCR1.js → DfvdR1t7.js} +13 -13
  89. package/web/app/immutable/chunks/{D1wNvwqn.js → Di8laZBj.js} +1 -1
  90. package/web/app/immutable/chunks/{CwB9Am9z.js → DjHgMTjl.js} +3 -3
  91. package/web/app/immutable/chunks/{BoefNJ5Q.js → DlekFIEJ.js} +1 -1
  92. package/web/app/immutable/chunks/{NPKMdhKA.js → DmNlyOFF.js} +2 -2
  93. package/web/app/immutable/chunks/{9DRLCqFH.js → DoGlKPs8.js} +1 -1
  94. package/web/app/immutable/chunks/{CNsgRr0G.js → DoKriIRg.js} +1 -1
  95. package/web/app/immutable/chunks/{CsleiD5D.js → DoUa1hTg.js} +1 -1
  96. package/web/app/immutable/chunks/{oaGKgX0i.js → DpqgMZNx.js} +1 -1
  97. package/web/app/immutable/chunks/{Bpb7JDWq.js → Dqso2iIq.js} +1 -1
  98. package/web/app/immutable/chunks/{DLmLA9DN.js → Dr_KWcsf.js} +1 -1
  99. package/web/app/immutable/chunks/{B89v0U4a.js → DsATs4Yw.js} +3 -3
  100. package/web/app/immutable/chunks/{OfToEAub.js → DtPlbqlO.js} +1 -1
  101. package/web/app/immutable/chunks/{C-y2Lv4J.js → DumB3eQv.js} +1 -1
  102. package/web/app/immutable/chunks/{R-aBLidW.js → DyOuvQsx.js} +3 -3
  103. package/web/app/immutable/chunks/{DCO02E6M.js → Dyda26aD.js} +1 -1
  104. package/web/app/immutable/chunks/{yLWVsiXj.js → Dz9187FZ.js} +1 -1
  105. package/web/app/immutable/chunks/{lCSqh71Z.js → DzXo18RQ.js} +1 -1
  106. package/web/app/immutable/chunks/{fth1noPu.js → FHdlPR2E.js} +1 -1
  107. package/web/app/immutable/chunks/{BEWjMMmw.js → QJaPD5ja.js} +3 -3
  108. package/web/app/immutable/chunks/{Cv2q5gkL.js → Smn45KEu.js} +1 -1
  109. package/web/app/immutable/chunks/{ahq3r4Wz.js → TWY-IEJw.js} +1 -1
  110. package/web/app/immutable/chunks/{DqfSttpc.js → a_hFrVUs.js} +1 -1
  111. package/web/app/immutable/chunks/{Bxb8LI6C.js → eHy-2vQk.js} +1 -1
  112. package/web/app/immutable/chunks/{Qh1eK2X9.js → eWtOjdwZ.js} +1 -1
  113. package/web/app/immutable/chunks/{zROLTv2m.js → ezsQjlt6.js} +1 -1
  114. package/web/app/immutable/chunks/{vQ3XSTvm.js → kRDyYnu-.js} +1 -1
  115. package/web/app/immutable/chunks/{BHtMcien.js → lMYobXp7.js} +1 -1
  116. package/web/app/immutable/chunks/{55NQjm3t.js → m5FEmsd9.js} +1 -1
  117. package/web/app/immutable/chunks/{DQewNXDh.js → n1Mub_w4.js} +1 -1
  118. package/web/app/immutable/chunks/{DsFpAZo7.js → pO_uIUtS.js} +2 -2
  119. package/web/app/immutable/chunks/{CQR1o7um.js → paBp5EDQ.js} +2 -2
  120. package/web/app/immutable/chunks/{eGqXrC9g.js → rUAQGuY9.js} +1 -1
  121. package/web/app/immutable/chunks/{DadrYnVI.js → s5eSUTR7.js} +1 -1
  122. package/web/app/immutable/chunks/{DyaBo2y6.js → sppurVVE.js} +1 -1
  123. package/web/app/immutable/chunks/{B5PU_SZw.js → tDXv5z_U.js} +1 -1
  124. package/web/app/immutable/chunks/{CAG8YIXN.js → uMNoDmQ2.js} +1 -1
  125. package/web/app/immutable/chunks/{D0xQDzbV.js → xCNFDAsL.js} +1 -1
  126. package/web/app/immutable/chunks/{CRBVaIXN.js → yc-ZA4uZ.js} +1 -1
  127. package/web/app/immutable/entry/{app.-hRXZvoO.js → app.DDy_f4Vr.js} +2 -2
  128. package/web/app/immutable/entry/start.CtWgyCM1.js +1 -0
  129. package/web/app/immutable/nodes/{0.Bf92A2SS.js → 0.BIgrj7tk.js} +1 -1
  130. package/web/app/immutable/nodes/{1.BWS1uOkH.js → 1.BS4qG73n.js} +1 -1
  131. package/web/app/immutable/nodes/{10.xvB45P-Z.js → 10.CoUmfWJP.js} +4 -4
  132. package/web/app/immutable/nodes/{11.CWt_UL31.js → 11.Cp19-DaX.js} +1 -1
  133. package/web/app/immutable/nodes/{15.BFkam5BT.js → 15._NKX_puo.js} +1 -1
  134. package/web/app/immutable/nodes/{19.DASGyMmu.js → 19.CrIpgdrd.js} +2 -2
  135. package/web/app/immutable/nodes/{2.BLp65UB0.js → 2.B-ARMoF4.js} +4 -4
  136. package/web/app/immutable/nodes/{3.sLYNU_z5.js → 3.CeiKZ0d6.js} +1 -1
  137. package/web/app/immutable/nodes/{4.CYsqPvqR.js → 4.-s0Jfvde.js} +1 -1
  138. package/web/app/immutable/nodes/{5.BDPUNvGt.js → 5.BIDxYMYJ.js} +1 -1
  139. package/web/app/immutable/nodes/{6.Cmp_rej6.js → 6.3fDeScAq.js} +1 -1
  140. package/web/app/immutable/nodes/{7.BeJ_Zasr.js → 7.DydkXABx.js} +1 -1
  141. package/web/app/immutable/nodes/{8.CTerGGp8.js → 8.DyQruTiJ.js} +1 -1
  142. package/web/app/immutable/nodes/{9.D8TUAlXi.js → 9.D0w1njvH.js} +4 -4
  143. package/web/app/version.json +1 -1
  144. package/web/index.html +9 -9
  145. package/web/app/immutable/chunks/Qqd9dQHZ.js +0 -3
  146. package/web/app/immutable/entry/start.C3r7ji-v.js +0 -1
@@ -1,4 +1,4 @@
1
- import{p as I}from"./zROLTv2m.js";import{aZ as _,U as E,Y as F,b0 as D,V as P,a_ as z,b as c,aX as G,r as B,q as w,W as C,O as W,ay as b,a6 as V,B as H}from"./D-usBtmP.js";import{p as U}from"./2ypcXvW0.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:m},x=structuredClone(A),X=W.radar,j=c(()=>w({...X,...C().radar}),"getConfig"),M=c(()=>x.axes,"getAxes"),Y=c(()=>x.curves,"getCurves"),Z=c(()=>x.options,"getOptions"),q=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule},x.options.ticks>y&&(b.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),x.options.ticks=y)},"setOptions"),Q=c(()=>{B(),x=structuredClone(A)},"clear"),$={getAxes:M,getCurves:Y,getOptions:Z,setAxes:q,setCurves:K,setOptions:J,getConfig:j,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await U("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
1
+ import{p as I}from"./ezsQjlt6.js";import{aZ as _,U as E,Y as F,b0 as D,V as P,a_ as z,b as c,aX as G,r as B,q as w,W as C,O as W,ay as b,a6 as V,B as H}from"./BpXYSrHL.js";import{p as U}from"./2ypcXvW0.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:m},x=structuredClone(A),X=W.radar,j=c(()=>w({...X,...C().radar}),"getConfig"),M=c(()=>x.axes,"getAxes"),Y=c(()=>x.curves,"getCurves"),Z=c(()=>x.options,"getOptions"),q=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule},x.options.ticks>y&&(b.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),x.options.ticks=y)},"setOptions"),Q=c(()=>{B(),x=structuredClone(A)},"clear"),$={getAxes:M,getCurves:Y,getOptions:Z,setAxes:q,setCurves:K,setOptions:J,getConfig:j,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await U("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
2
  .radarCurve-${r} {
3
3
  color: ${s};
4
4
  fill: ${s};
@@ -1,4 +1,4 @@
1
- import{p as z}from"./zROLTv2m.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./D-usBtmP.js";import{p as I}from"./2ypcXvW0.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
1
+ import{p as z}from"./ezsQjlt6.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./BpXYSrHL.js";import{p as I}from"./2ypcXvW0.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
2
2
  .packetByte {
3
3
  font-size: ${t.byteFontSize};
4
4
  }
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/vQ3XSTvm.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BxKppgO5.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/DsFpAZo7.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DqfSttpc.js"])))=>i.map(i=>d[i]);
2
- import{bm as c,_ as p}from"./ClpAEjbe.js";import{m as k}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{Q as A}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{m as L,Jq as d,vG as g,vI as v}from"./CpP1PKzF.js";import{a9 as R}from"./D9Ykl3eH.js";import{selectCurrentWorkspaceTabId as P}from"./DujUyPvo.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./vQ3XSTvm.js");return{openMessage:a}},__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]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./BxKppgO5.js").then(o=>o.o);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./DqfSttpc.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./DqfSttpc.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./DqfSttpc.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./CPDV_dyu.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/kRDyYnu-.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BxKppgO5.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/pO_uIUtS.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/a_hFrVUs.js"])))=>i.map(i=>d[i]);
2
+ import{bm as c,_ as p}from"./ClpAEjbe.js";import{m as k}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{Q as A}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{m as L,Jq as d,vG as g,vI as v}from"./CpP1PKzF.js";import{a9 as R}from"./D9Ykl3eH.js";import{selectCurrentWorkspaceTabId as P}from"./DujUyPvo.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./kRDyYnu-.js");return{openMessage:a}},__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]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./BxKppgO5.js").then(o=>o.o);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./a_hFrVUs.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./a_hFrVUs.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./a_hFrVUs.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./CPDV_dyu.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
@@ -1,4 +1,4 @@
1
- import{I as le}from"./lCSqh71Z.js";import{p as he}from"./zROLTv2m.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./D-usBtmP.js";import{p as Ee}from"./2ypcXvW0.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
1
+ import{I as le}from"./DzXo18RQ.js";import{p as he}from"./ezsQjlt6.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./BpXYSrHL.js";import{p as Ee}from"./2ypcXvW0.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
2
2
  ${s-i/2-L/2},${x+R}
3
3
  ${s-i/2-L/2},${x-R}
4
4
  ${t.posWithOffset-i/2-L},${x-c-R}
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CajUAX8N.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/C1zxTHwk.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BVi5KkOP.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/Xh71Wbuh.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/BeYVt6Wg.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/oXpJ1LFx.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/DujUyPvo.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/oaGKgX0i.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9Y57c7j.js","/app/immutable/chunks/2XoFwLeT.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/DsFpAZo7.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DqfSttpc.js"])))=>i.map(i=>d[i]);
2
- var Jp=Object.defineProperty;var Vl=n=>{throw TypeError(n)};var Gp=(n,e,t)=>e in n?Jp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var it=(n,e,t)=>Gp(n,typeof e!="symbol"?e+"":e,t),Xp=(n,e,t)=>e.has(n)||Vl("Cannot "+t);var Kn=(n,e,t)=>(Xp(n,e,"read from private field"),t?t.call(n):e.get(n)),Fi=(n,e,t)=>e.has(n)?Vl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as jt,bo as L,bw as Kt,b as Ut,bp as Yp,bm as re,bq as Qp,bs as Zp,_ as Vi}from"./ClpAEjbe.js";import{bs as qt,b_ as ne,W as U,bn as Jt,aA as P,aC as Ju,br as oa,bb as ni,c3 as En,aG as em,bk as Gu,a7 as Tr,ay as Rt,c0 as Xu,a5 as me,aD as m,bA as le,bS as ie,aw as tm,bH as pe,c9 as H,bV as Ge,aB as ee,ai as io,ca as pt,aj as Gn,bl as Se,bO as he,bo as Wa,bj as Yu,be as Qu,b$ as Zu,bf as nm,c5 as Sn}from"./CJxGDkBm.js";import{c as Do}from"./DSqSJXGX.js";import{s as xt,f as yn,c as aa,b as rm,g as yi,e as im}from"./CnGVh7I3.js";import{b as Dr}from"./NtFyWdpR.js";import{i as sm}from"./MZe3NxQe.js";import{d1 as om,aF as am,aT as Wl}from"./Bxb8LI6C.js";import{a as lm}from"./CC7to1B5.js";import{aT as cm,aB as um,ao as dm,aw as fm,ab as hm,f as rn,ae as ed,a1 as pm}from"./BVi5KkOP.js";import{i as xe}from"./wmcYjLAa.js";import{F as nn,bb as mm,bv as ja,bh as td,v as gm,bE as ym,d3 as bm,aI as jl,bg as Mr,bn as Ar,cZ as nd,cW as vm,cn as rd,cK as id,ak as km,av as sd,ay as Kl,ap as xm,aj as wm,as as Sm,cX as Cm,aZ as Mm,aN as Io,co as Em,bx as Tm,cb as Am,cy as Ul,Y as Nm,cH as Om,at as Dm,bU as Im,aq as Rm,c7 as Lm,bN as Pm,c_ as _m,al as zm,bl as $m,bF as Bm,a$ as Hm,d2 as Fm,am as Vm,bS as Wm,aT as jm,b0 as Km,c1 as Um,bd as qm,cx as Jm,cD as Gm,bR as Xm,bo as Ym,bi as ql}from"./CtJxHvGv.js";import{s as Qm}from"./WSVFXKpL.js";import{e as Zm}from"./CARsKzUN.js";import{b as eg,V as Jl,c as tg,p as ng,m as rg,s as ig}from"./DyaBo2y6.js";import{h as sg}from"./CPDV_dyu.js";import{g as Er,i as og}from"./BwASeArv.js";import{L as ag,S as lg,T as od}from"./ClEpfV0K.js";import{n as cg,l as ms}from"./By588DV1.js";import{h as ug}from"./CQR1o7um.js";import{bq as dg}from"./CpP1PKzF.js";import{g as fg}from"./G-nrQJwO.js";import{c as Ka,l as de}from"./ChTqQfQN.js";import{n as Gl,l as hg,c as pg}from"./oXpJ1LFx.js";import{$ as ad,a0 as mg,p as la,aN as gg,am as yg,a1 as bg,e5 as vg,a9 as kg}from"./D9Ykl3eH.js";import{i as dn,M as xg,D as wg,s as Ro,a as Sg,p as mr}from"./NPKMdhKA.js";import{A as Cg,b as Mg}from"./Dd5ei__B.js";import{P as Eg}from"./uD6eQoK5.js";import{a as ld}from"./B5wwCKYG.js";import{g as Xl}from"./CsFPvReh.js";import{H as Tg}from"./Bqd7fdCF.js";import{q as Ag}from"./B06RKBOm.js";import{b as Ng,P as Og}from"./DM2Efanx.js";var Dg=Ju('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"></path></svg>');function cd(n,e){if(new.target)return jt({component:cd,...n});qt(e,!0);let t=L(e,"size",7,16),r=L(e,"class",7,"");var i={get size(){return t()},set size(o=16){t(o),P()},get class(){return r()},set class(o=""){r(o),P()},$set:Kt,$on:(o,a)=>Ut(e,o,a)},s=Dg();return ne(()=>{xt(s,"width",t()),xt(s,"height",t()),yn(s,0,aa(r()))}),U(n,s),Jt(i)}var Yl=Object.defineProperty,Ig=(n,e)=>{let t={};for(var r in n)Yl(t,r,{get:n[r],enumerable:!0});return Yl(t,Symbol.toStringTag,{value:"Module"}),t};function mt(n){this.content=n}mt.prototype={constructor:mt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new mt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new mt(t)},addToStart:function(n,e){return new mt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new mt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new mt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=mt.from(n),n.size?new mt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=mt.from(n),n.size?new mt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=mt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};mt.from=function(n){if(n instanceof mt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new mt(e)};function ud(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&hd(o.charCodeAt(l-1))&&fd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=ud(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function dd(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&hd(c.charCodeAt(d-1))&&fd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=dd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function fd(n){return n>=56320&&n<57344}function hd(n){return n>=55296&&n<56320}class T{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new T(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,s)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return ud(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dd(this,e,t,r)}findIndex(e){if(e==0)return Wi(0,e);if(e==this.size)return Wi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Wi(t+1,s):Wi(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return T.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const Lo={index:0,offset:0};function Wi(n,e){return Lo.index=n,Lo.offset=e,Lo}function gs(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!gs(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gs(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Re=class ca{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&gs(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ca.none;if(e instanceof ca)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Re.none=[];class bi extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=md(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(pd(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new B(e,r,i)}}B.empty=new B(T.empty,0,0);function pd(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(pd(s.content,e-i-1,t-i-1)))}function md(n,e,t,r,i,s){let{index:o,offset:a}=n.findIndex(e),l=n.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=md(l.content,e-a-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return c&&n.replaceChild(o,l.copy(c))}function Rg(n,e,t){if(t.openStart>n.depth)throw new bi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new bi("Inconsistent open depths");return gd(n,e,t,0)}function gd(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=gd(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return nr(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Lg(t,n);return nr(s,bd(n,o,a,e,r))}else return nr(s,ys(n,e,r))}function yd(n,e){if(!e.type.compatibleContent(n.type))throw new bi("Cannot join "+e.type.name+" onto "+n.type.name)}function ua(n,e,t){let r=n.node(t);return yd(r,e.node(t)),r}function tr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ri(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(tr(n.nodeAfter,r),s++));for(let a=s;a<o;a++)tr(i.child(a),r);e&&e.depth==t&&e.textOffset&&tr(e.nodeBefore,r)}function nr(n,e){if(!n.type.validContent(e))throw new bi("Invalid content for node "+n.type.name);return n.copy(e)}function bd(n,e,t,r,i){let s=n.depth>i&&ua(n,e,i+1),o=r.depth>i&&ua(t,r,i+1),a=[];return ri(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(yd(s,o),tr(nr(s,bd(n,e,t,r,i+1)),a)):(s&&tr(nr(s,ys(n,e,i+1)),a),ri(e,t,i,a),o&&tr(nr(o,ys(t,r,i+1)),a)),ri(r,null,i,a),new T(a)}function ys(n,e,t){let r=[];if(ri(null,n,t,r),n.depth>t){let i=ua(n,e,t+1);tr(nr(i,ys(n,e,t+1)),r)}return ri(e,null,t,r),new T(r)}function Lg(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class vi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Re.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new bs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new vi(t,r,s)}static resolveCached(e,t){let r=Ql.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==t)return o}else Ql.set(e,r=new Pg);let i=r.elts[r.i]=vi.resolve(e,t);return r.i=(r.i+1)%_g,i}}class Pg{constructor(){this.elts=[],this.i=0}}const _g=12,Ql=new WeakMap;class bs{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const zg=Object.create(null);let Ln=class da{constructor(e,t,r,i=Re.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&gs(this.attrs,t||e.defaultAttrs||zg)&&Re.sameSet(this.marks,r||Re.none)}copy(e=null){return e==this.content?this:new da(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new da(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new B(c,i.depth-o,s.depth-o)}replace(e,t,r){return Rg(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return vi.resolveCached(this,e)}resolveNoCache(e){return vi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),vd(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Zl(this.type.attrs,this.attrs,"node",this.type.name);let e=Re.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];Zl(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Re.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Ln.prototype.text=void 0;class vs extends Ln{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function vd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function Zl(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class sr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $g(e,t);if(r.next==null)return sr.empty;let i=kd(r);r.next&&r.err("Unexpected trailing text");let s=Kg(jg(i));return Ug(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return T.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BiWBSez2.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/C1zxTHwk.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BVi5KkOP.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/Xh71Wbuh.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/BeYVt6Wg.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/oXpJ1LFx.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/DujUyPvo.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/DpqgMZNx.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/D_yMjDjB.js","/app/immutable/chunks/CuNdhmq6.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/pO_uIUtS.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/a_hFrVUs.js"])))=>i.map(i=>d[i]);
2
+ var Jp=Object.defineProperty;var Vl=n=>{throw TypeError(n)};var Gp=(n,e,t)=>e in n?Jp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var it=(n,e,t)=>Gp(n,typeof e!="symbol"?e+"":e,t),Xp=(n,e,t)=>e.has(n)||Vl("Cannot "+t);var Kn=(n,e,t)=>(Xp(n,e,"read from private field"),t?t.call(n):e.get(n)),Fi=(n,e,t)=>e.has(n)?Vl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as jt,bo as L,bw as Kt,b as Ut,bp as Yp,bm as re,bq as Qp,bs as Zp,_ as Vi}from"./ClpAEjbe.js";import{bs as qt,b_ as ne,W as U,bn as Jt,aA as P,aC as Ju,br as oa,bb as ni,c3 as En,aG as em,bk as Gu,a7 as Tr,ay as Rt,c0 as Xu,a5 as me,aD as m,bA as le,bS as ie,aw as tm,bH as pe,c9 as H,bV as Ge,aB as ee,ai as io,ca as pt,aj as Gn,bl as Se,bO as he,bo as Wa,bj as Yu,be as Qu,b$ as Zu,bf as nm,c5 as Sn}from"./CJxGDkBm.js";import{c as Do}from"./DSqSJXGX.js";import{s as xt,f as yn,c as aa,b as rm,g as yi,e as im}from"./CnGVh7I3.js";import{b as Dr}from"./NtFyWdpR.js";import{i as sm}from"./MZe3NxQe.js";import{d1 as om,aF as am,aT as Wl}from"./eHy-2vQk.js";import{a as lm}from"./CC7to1B5.js";import{aT as cm,aB as um,ao as dm,aw as fm,ab as hm,f as rn,ae as ed,a1 as pm}from"./BVi5KkOP.js";import{i as xe}from"./wmcYjLAa.js";import{F as nn,bb as mm,bv as ja,bh as td,v as gm,bE as ym,d3 as bm,aI as jl,bg as Mr,bn as Ar,cZ as nd,cW as vm,cn as rd,cK as id,ak as km,av as sd,ay as Kl,ap as xm,aj as wm,as as Sm,cX as Cm,aZ as Mm,aN as Io,co as Em,bx as Tm,cb as Am,cy as Ul,Y as Nm,cH as Om,at as Dm,bU as Im,aq as Rm,c7 as Lm,bN as Pm,c_ as _m,al as zm,bl as $m,bF as Bm,a$ as Hm,d2 as Fm,am as Vm,bS as Wm,aT as jm,b0 as Km,c1 as Um,bd as qm,cx as Jm,cD as Gm,bR as Xm,bo as Ym,bi as ql}from"./CtJxHvGv.js";import{s as Qm}from"./WSVFXKpL.js";import{e as Zm}from"./CARsKzUN.js";import{b as eg,V as Jl,c as tg,p as ng,m as rg,s as ig}from"./sppurVVE.js";import{h as sg}from"./CPDV_dyu.js";import{g as Er,i as og}from"./BwASeArv.js";import{L as ag,S as lg,T as od}from"./ClEpfV0K.js";import{n as cg,l as ms}from"./By588DV1.js";import{h as ug}from"./paBp5EDQ.js";import{bq as dg}from"./CpP1PKzF.js";import{g as fg}from"./G-nrQJwO.js";import{c as Ka,l as de}from"./ChTqQfQN.js";import{n as Gl,l as hg,c as pg}from"./oXpJ1LFx.js";import{$ as ad,a0 as mg,p as la,aN as gg,am as yg,a1 as bg,e5 as vg,a9 as kg}from"./D9Ykl3eH.js";import{i as dn,M as xg,D as wg,s as Ro,a as Sg,p as mr}from"./DmNlyOFF.js";import{A as Cg,b as Mg}from"./Dd5ei__B.js";import{P as Eg}from"./uD6eQoK5.js";import{a as ld}from"./B5wwCKYG.js";import{g as Xl}from"./CsFPvReh.js";import{H as Tg}from"./Bqd7fdCF.js";import{q as Ag}from"./B06RKBOm.js";import{b as Ng,P as Og}from"./DM2Efanx.js";var Dg=Ju('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"></path></svg>');function cd(n,e){if(new.target)return jt({component:cd,...n});qt(e,!0);let t=L(e,"size",7,16),r=L(e,"class",7,"");var i={get size(){return t()},set size(o=16){t(o),P()},get class(){return r()},set class(o=""){r(o),P()},$set:Kt,$on:(o,a)=>Ut(e,o,a)},s=Dg();return ne(()=>{xt(s,"width",t()),xt(s,"height",t()),yn(s,0,aa(r()))}),U(n,s),Jt(i)}var Yl=Object.defineProperty,Ig=(n,e)=>{let t={};for(var r in n)Yl(t,r,{get:n[r],enumerable:!0});return Yl(t,Symbol.toStringTag,{value:"Module"}),t};function mt(n){this.content=n}mt.prototype={constructor:mt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new mt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new mt(t)},addToStart:function(n,e){return new mt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new mt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new mt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=mt.from(n),n.size?new mt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=mt.from(n),n.size?new mt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=mt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};mt.from=function(n){if(n instanceof mt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new mt(e)};function ud(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&hd(o.charCodeAt(l-1))&&fd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=ud(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function dd(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&hd(c.charCodeAt(d-1))&&fd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=dd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function fd(n){return n>=56320&&n<57344}function hd(n){return n>=55296&&n<56320}class T{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new T(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,s)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return ud(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dd(this,e,t,r)}findIndex(e){if(e==0)return Wi(0,e);if(e==this.size)return Wi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Wi(t+1,s):Wi(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return T.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const Lo={index:0,offset:0};function Wi(n,e){return Lo.index=n,Lo.offset=e,Lo}function gs(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!gs(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gs(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Re=class ca{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&gs(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ca.none;if(e instanceof ca)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Re.none=[];class bi extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=md(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(pd(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new B(e,r,i)}}B.empty=new B(T.empty,0,0);function pd(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(pd(s.content,e-i-1,t-i-1)))}function md(n,e,t,r,i,s){let{index:o,offset:a}=n.findIndex(e),l=n.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=md(l.content,e-a-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return c&&n.replaceChild(o,l.copy(c))}function Rg(n,e,t){if(t.openStart>n.depth)throw new bi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new bi("Inconsistent open depths");return gd(n,e,t,0)}function gd(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=gd(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return nr(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Lg(t,n);return nr(s,bd(n,o,a,e,r))}else return nr(s,ys(n,e,r))}function yd(n,e){if(!e.type.compatibleContent(n.type))throw new bi("Cannot join "+e.type.name+" onto "+n.type.name)}function ua(n,e,t){let r=n.node(t);return yd(r,e.node(t)),r}function tr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ri(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(tr(n.nodeAfter,r),s++));for(let a=s;a<o;a++)tr(i.child(a),r);e&&e.depth==t&&e.textOffset&&tr(e.nodeBefore,r)}function nr(n,e){if(!n.type.validContent(e))throw new bi("Invalid content for node "+n.type.name);return n.copy(e)}function bd(n,e,t,r,i){let s=n.depth>i&&ua(n,e,i+1),o=r.depth>i&&ua(t,r,i+1),a=[];return ri(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(yd(s,o),tr(nr(s,bd(n,e,t,r,i+1)),a)):(s&&tr(nr(s,ys(n,e,i+1)),a),ri(e,t,i,a),o&&tr(nr(o,ys(t,r,i+1)),a)),ri(r,null,i,a),new T(a)}function ys(n,e,t){let r=[];if(ri(null,n,t,r),n.depth>t){let i=ua(n,e,t+1);tr(nr(i,ys(n,e,t+1)),r)}return ri(e,null,t,r),new T(r)}function Lg(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class vi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Re.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new bs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new vi(t,r,s)}static resolveCached(e,t){let r=Ql.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==t)return o}else Ql.set(e,r=new Pg);let i=r.elts[r.i]=vi.resolve(e,t);return r.i=(r.i+1)%_g,i}}class Pg{constructor(){this.elts=[],this.i=0}}const _g=12,Ql=new WeakMap;class bs{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const zg=Object.create(null);let Ln=class da{constructor(e,t,r,i=Re.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&gs(this.attrs,t||e.defaultAttrs||zg)&&Re.sameSet(this.marks,r||Re.none)}copy(e=null){return e==this.content?this:new da(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new da(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new B(c,i.depth-o,s.depth-o)}replace(e,t,r){return Rg(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return vi.resolveCached(this,e)}resolveNoCache(e){return vi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),vd(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Zl(this.type.attrs,this.attrs,"node",this.type.name);let e=Re.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];Zl(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Re.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Ln.prototype.text=void 0;class vs extends Ln{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function vd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function Zl(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class sr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $g(e,t);if(r.next==null)return sr.empty;let i=kd(r);r.next&&r.err("Unexpected trailing text");let s=Kg(jg(i));return Ug(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return T.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
3
3
  `)}}sr.empty=new sr(!0);class $g{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function kd(n){let e=[];do e.push(Bg(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bg(n){let e=[];do e.push(Hg(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hg(n){let e=Wg(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Fg(n,e);else break;return e}function ec(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Fg(n,e){let t=ec(n),r=t;return n.eat(",")&&(n.next!="}"?r=ec(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Vg(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Wg(n){if(n.eat("(")){let e=kd(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Vg(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jg(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=t();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=t();r(l,u),i(s(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function xd(n,e){return e-n}function tc(n,e){let t=[];return r(e),t.sort(xd);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&r(l)}}}function Kg(n){let e=Object.create(null);return t(tc(n,0));function t(r){let i=[];r.forEach(o=>{n[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);tc(n,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new sr(r.indexOf(n.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(xd);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function Ug(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function wd(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Sd(n,e){let t=Object.create(null);for(let r in n){let i=n[r],s=e&&e[r];if(s===void 0)if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r);else i.validate&&i.validate(s);t[r]=s}return t}function Cd(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Jg(n,r,e[r]);return t}let nc=class Md{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Cd(e,r.attrs),this.defaultAttrs=wd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==sr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Sd(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ln(this,this.computeAttrs(e),T.from(t),Re.setFrom(r))}createChecked(e=null,t,r){return t=T.from(t),this.checkContent(t),new Ln(this,this.computeAttrs(e),t,Re.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=T.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(T.empty,!0);return s?new Ln(this,e,t.append(s),Re.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Re.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Md(s,t,o));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function qg(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class Jg{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?qg(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class so{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cd(e,i.attrs),this.excluded=null;let s=wd(this.attrs);this.instance=s?new Re(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Re(this,Sd(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new so(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class ls{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=mt.from(e.nodes),t.marks=mt.from(e.marks||{}),this.nodes=nc.compile(this.spec.nodes,this),this.marks=so.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=sr.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?rc(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:rc(this,o.split(" "))}this.nodeFromJSON=i=>Ln.fromJSON(this,i),this.markFromJSON=i=>Re.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof nc){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new vs(r,r.defaultAttrs,e,Re.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function rc(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],o=s;if(s)t.push(s);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Gg(n){return n.tag!=null}function Xg(n){return n.style!=null}let ii=class fa{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Gg(i))this.tags.push(i);else if(Xg(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new sc(this,t,!1);return r.addAll(e,Re.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new sc(this,t,!0);return r.addAll(e,Re.none,t.from,t.to),B.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Zg(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=oc(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=oc(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new fa(e,fa.schemaRules(e)))}};const Ed={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Yg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Td={ol:!0,ul:!0},ki=1,ha=2,si=4;function ic(n,e,t){return e!=null?(e?ki:0)|(e==="full"?ha:0):n&&n.whitespace=="pre"?ki|ha:t&~si}class ji{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Re.none,this.match=s||(o&si?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(T.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ki)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=T.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(T.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ed.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sc{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=ic(null,t.preserveWhitespace,0)|(r?si:0);i?s=new ji(i.type,i.attrs,Re.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new ji(null,null,Re.none,!0,null,o):s=new ji(e.schema.topNodeType,null,Re.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&ha?"full":this.localPreserveWS||(i.options&ki)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
4
4
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;Td.hasOwnProperty(o)&&this.parser.normalizeLists&&Qg(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Yg.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Ed.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
5
5
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,t.attrs||null,r,t.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Re.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):ac(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r,!1);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=ic(e,s,o.options);o.options&si&&o.content.length==0&&(a|=si);let l=Re.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ac(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ji(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ki)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Qg(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Td.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Zg(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function oc(n){let e={};for(let t in n)e[t]=n[t];return e}function ac(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class fr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ki(t).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,t);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){if(e.isText)return Ki(t).createTextNode(e.text);let{dom:r,contentDOM:i}=cs(Ki(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&cs(Ki(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:cs(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new fr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=lc(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return lc(e.marks)}}function lc(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ki(n){return n.document||window.document}const cc=new WeakMap;function ey(n){let e=cc.get(n);return e===void 0&&cc.set(n,e=ty(n)),e}function ty(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function cs(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=ey(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=cs(n,f,t,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Ad=65535,Nd=Math.pow(2,16);function ny(n,e){return n+e*Nd}function uc(n){return n&Ad}function ry(n){return(n-(n&Ad))/Nd}const Od=1,Dd=2,us=4,Id=8;class pa{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Id)>0}get deletedBefore(){return(this.delInfo&(Od|us))>0}get deletedAfter(){return(this.delInfo&(Dd|us))>0}get deletedAcross(){return(this.delInfo&us)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=uc(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+ry(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:t:t,h=l+i+(f<0?0:u);if(r)return h;let p=e==(t<0?l:d)?null:ny(a/3,e-l),g=0;return c&&(g|=e==l?Dd:e==d?Od:us,(t<0?e!=l:e!=d)&&(g|=Id)),new pa(h,g,p)}i+=u-c}return r?e+i:new pa(e+i,0,null)}touches(e,t){let r=0,i=uc(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+t],u=this.ranges[i+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);class xi{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new xi(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new xi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new pa(e,i,null)}}const Po=Object.create(null);class Ct{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Po[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Po)throw new RangeError("Duplicate use of step JSON ID "+e);return Po[e]=t,t.prototype.jsonID=e,t}}class st{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new st(e,null)}static fail(e){return new st(null,e)}static fromReplace(e,t,r,i){try{return st.ok(e.replace(t,r,i))}catch(s){if(s instanceof bi)return st.fail(s.message);throw s}}}function Ua(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Ua(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return T.fromArray(r)}class In extends Ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new B(Ua(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return st.fromReplace(e,this.from,this.to,s)}invert(){return new Yt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new In(t.pos,r.pos,this.mark)}merge(e){return e instanceof In&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new In(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new In(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",In);class Yt extends Ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Ua(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return st.fromReplace(e,this.from,this.to,r)}invert(){return new In(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Yt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Yt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Yt(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",Yt);class Rn extends Ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new B(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Rn(this.pos,t.marks[i]);return new Rn(this.pos,this.mark)}}return new or(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Rn(t.pos,e.markFromJSON(t.mark))}}Ct.jsonID("addNodeMark",Rn);class or extends Ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new B(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Rn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new or(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new or(t.pos,e.markFromJSON(t.mark))}}Ct.jsonID("removeNodeMark",or);class et extends Ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&ma(e,this.from,this.to)?st.fail("Structure replace would overwrite content"):st.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new et(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&et.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new et(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof et)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new et(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new et(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new et(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}et.MAP_BIAS=1;Ct.jsonID("replace",et);class ft extends Ct{constructor(e,t,r,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(ma(e,this.from,this.gapFrom)||ma(e,this.gapTo,this.to)))return st.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return st.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?st.fromReplace(e,this.from,this.to,r):st.fail("Content does not fit in gap")}getMap(){return new Pt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ft(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new ft(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ft(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ct.jsonID("replaceAround",ft);function ma(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function iy(n,e,t,r){let i=[],s=[],o,a;n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new Yt(f,h,d[g])));a&&a.to==f?a.to=h:s.push(a=new In(f,h,r))}}),i.forEach(l=>n.step(l)),s.forEach(l=>n.step(l))}function sy(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof so){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>n.step(new Yt(o.from,o.to,o.style)))}function qa(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new et(a,u,B.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Yt(a,u,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new B(T.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new et(a+f.index,a+f.index+f[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(T.empty,!0);n.replace(a,a,new B(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function oy(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Br(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),a=n.$from.index(r)+i,l=n.$to.indexAfter(r)-s;if(r<n.depth&&o.canReplace(a,l,t))return r;if(r==0||o.type.spec.isolating||!oy(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function ay(n,e,t){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=T.empty,d=0;for(let p=s,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=T.from(r.node(p).copy(u)),d++):l--;let f=T.empty,h=0;for(let p=s,g=!1;p>t;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=T.from(i.node(p).copy(f)),h++):c++;n.step(new ft(l,c,o,a,new B(u.append(f),d,h),u.size-d,!0))}function Ja(n,e,t=null,r=n){let i=ly(n,e),s=i&&cy(r,e);return s?i.map(dc).concat({type:e,attrs:t}).concat(s.map(dc)):null}function dc(n){return{type:n,attrs:null}}function ly(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(r,i,o)?s:null}function cy(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function uy(n,e,t){let r=T.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let a=t[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=T.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new ft(i,s,i,s,new B(r,0,0),t.length,!0))}function dy(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&fy(n.doc,n.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Ld(n,o,a,s),qa(n,n.mapping.slice(s).map(a,1),r,void 0,c===null);let u=n.mapping.slice(s),d=u.map(a,1),f=u.map(a+o.nodeSize,1);return n.step(new ft(d,f,d+1,f-1,new B(T.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&Rd(n,o,a,s),!1}})}function Rd(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Ld(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -172,4 +172,4 @@ ${t}
172
172
  `,pasteChip:()=>" "}}function ce(b,E){return pl(b.state.doc,{from:0,to:E},{blockSeparator:`
173
173
 
174
174
  `,textSerializers:Fe(b)}).replace(/\u00A0/g," ")}function Oe(b){return ce(b,b.state.doc.content.size)}function Tt(b){return ce(b,b.state.selection.from)}function pr(b,E){const R=Oe(b),Q=RM(R,Tt(b).length);(!Q||Q.from!==m(te)?.from)&&(pe(He,null),pe(Et,null)),pe(te,Q,!0),Q&&E?.dismissNewContext&&pe(He,m(Ie),!0)}function Hi(){pe(Et,m(te)?.from??null,!0)}function Rl(b){b.preventDefault()}function Cp(b){if(!m(M)||!m(te))return;const E=Oe(m(M)),R=Tt(m(M)).length,Q={from:m(M).state.selection.from-m(te).query.length-1,to:m(M).state.selection.from+m(te).to-R},z=m(te).to===E.length||!/^\s/u.test(E.slice(m(te).to)),A=[{type:"skillCommand",attrs:{name:b.name}},...z?[{type:"text",text:" "}]:[]];m(M).chain().focus().insertContentAt(Q,A).setTextSelection(Q.from+2).run()}function Hr(b){const E=iM(b,N().map(R=>R.name));return be()?aC(E,be()):E}const Fr=new AM({readSnapshot:()=>{const b=m(M);return!b||b.isDestroyed||!w()||!m(rt)||!m(fe)?null:{text:qn(b),caretAtEnd:Ni(b.state),composing:m(Dt)||b.view.composing,menuOpen:m(_e)||Vr.pluginKey.getState(b.state)?.active===!0}},readContext:()=>w()?.()??"",request:IM,showGhost:b=>{m(M)&&!m(M).isDestroyed&&ra(m(M).view,b)}});function Ll(){Fr.cancel(),m(M)&&!m(M).isDestroyed&&Oi(m(M).state)&&ra(m(M).view,null)}function Mp(b,E){E||Oi(b.state)?Fr.cancel():Fr.schedule()}pt(()=>{(!w()||!m(rt))&&Sn(Ll)});function Ep(b){Fr.cancel(),m(M)&&!m(M).isDestroyed&&ra(m(M).view,b)}function Tp(b){if(!m(_e)||!m(vt))return!1;const E=!b.shiftKey&&!b.metaKey&&!b.ctrlKey&&!b.altKey&&["ArrowUp","ArrowDown","Enter"].includes(b.key);return b.key!=="Escape"&&!E?!1:m(vt).onKeyDown({event:b})?!0:b.key==="Enter"?(b.preventDefault(),!0):!1}function Ap(){m(M)&&m(M).view&&m(M).chain().focus().insertContent("@").run()}function Np(b){return m(M)&&m(M).view?(m(M).chain().focus().insertContent(b).run(),!0):!1}function Op(b){if(f()||!m(M)?.view)return!1;const{state:E,dispatch:R}=m(M).view,Q=Wu(E.schema,b);return Q.length===0?!1:(R(E.tr.replaceSelection(new B(T.from(Q),1,1)).scrollIntoView()),m(M).view.focus(),!0)}function Dp(){if(f())return!1;if(m(M)&&m(M).view)try{if(m(M).view.hasFocus())return!0;const b=m(M),E=document.activeElement;return requestAnimationFrame(()=>{if(m(M)!==b||b.isDestroyed||f()||b.view.hasFocus())return;const R=document.activeElement;R!==E&&R instanceof HTMLElement&&lm(R)&&!b.view.dom.contains(R)||(b.view.focus(),b.commands.scrollIntoView())}),typeof m(M).view.hasFocus=="function"?m(M).view.hasFocus():!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focus:",b)}return!1}function Ip(){if(f())return!1;if(m(M)&&m(M).view)try{return m(M).chain().focus("end").run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusEnd:",b)}return!1}function Rp(){if(f())return!1;if(m(M)&&m(M).view)try{return m(M).chain().focus().selectAll().run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusAndSelectAll:",b)}return!1}function Lp(){try{return m(M)?.getHTML?.()??""}catch(b){return i.error("[TipTapEditor] Error getting HTML:",b),m(M)?.getText?.()??""}}function Pp(){m(M)&&(on=!0,m(M).commands.clearContent(!0),on=!1)}async function _p(b){if(!m(M))return;const E=Hr(b||"");Ts(E,m(M).schema).eq(m(M).state.doc)||m(M).chain().command(({tr:R})=>(R.setMeta("external-update",!0),!0)).setContent(E).run()}function zp(b,E){m(M)&&m(M).view&&m(M).chain().focus().setImage({src:b,alt:E||""}).createParagraphNear().focus().run()}function $p(){if(!m(M))return i.warn("TipTapEditor: getInlineImages called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>{if(E.type.name==="image"){const R=E.attrs.src;R&&R.startsWith("data:")&&b.push({src:R,alt:E.attrs.alt||void 0})}return!0}),i.debug("TipTapEditor: Extracted inline images",{imageCount:b.length,imageSources:b.map(E=>({alt:E.alt,srcLength:E.src?.length||0}))}),b}function Bp(){return qn(m(M))}function Hp(b){if(i.debug("TipTapEditor: insertContextMention called",{hasEditor:!!m(M),hasEditorView:!!m(M)?.view,attrs:{itemType:b.itemType,identifier:b.identifier,title:b.title}}),m(M)&&m(M).view){const E=m(M).chain().focus().insertContextMention(b).run();return i.debug("TipTapEditor: insertContextMention result",{result:E}),E}return i.warn("TipTapEditor: insertContextMention failed - no editor"),!1}function Fp(b){if(!m(M)||!m(M).view)return i.warn("TipTapEditor: insertMention called but editor is not initialized"),!1;try{return m(M).chain().focus().insertContent({type:"mention",attrs:{id:b.id,label:b.label,type:b.type,uri:b.uri,meta:b.meta||{}}}).insertContent(" ").run(),!0}catch(E){return i.error("TipTapEditor: insertMention failed",E),!1}}function Vp(){if(!m(M))return i.warn("TipTapEditor: getMentions called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>(E.type.name==="mention"&&b.push({id:E.attrs.id,label:E.attrs.label,type:E.attrs.type||"file",uri:E.attrs.uri||"",meta:E.attrs.meta||{}}),!0)),i.debug("TipTapEditor: Extracted mentions",{mentionCount:b.length,types:b.map(E=>E.type)}),b}function Wp(){if(!m(M))return i.warn("TipTapEditor: getContextMentions called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>{if(E.type.name==="contextMention"){const R=E.attrs;b.push({itemType:R.itemType,provider:R.provider,title:R.title,url:R.url,identifier:R.identifier,contextId:R.contextId,description:R.description,metadata:R.metadata})}return!0}),i.debug("TipTapEditor: Extracted context mentions",{mentionCount:b.length}),b}const Vr={char:"@",pluginKey:new ze("mention"),items:async({query:b})=>{if(i.debug("Mention query:",b),_()?.(b),!g()&&y()){i.debug("No workspace but repoPath available, using async search:",y());const R={workspaceId:void 0,repoPath:y(),currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const Q=await s.search(b,R);return i.debug("Mention search results from repoPath:",Q.length),Q}catch(Q){i.error("Failed to search mentions with repoPath:",Q);const z=s.searchSync(b,R);return i.debug("Fallback sync search results:",z.length),z}}if(!g())return i.debug("No workspace and no repoPath - returning empty results"),[];const E={workspaceId:g().id,currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const R=await s.search(b,E);return i.debug("Mention search results:",R.length),R}catch(R){return i.error("Failed to search mentions:",R),[]}},render:()=>zC(ke),command:({editor:b,range:E,props:R})=>{const Q={id:R.id,label:R.label,type:R.type,uri:R.uri,meta:R.meta||{}};b.view&&b.chain().focus().deleteRange(E).insertContent({type:"mention",attrs:Q}).run(),V()?.(R)}};Gu(()=>{let b=!1;return(async()=>{const E=Hr(o()||"");if(b)return;const R=m(Le);if(!R)return;pe(M,new _x({element:R,extensions:[...be()?[sC.configure({references:()=>be()??[]}),oC]:[],aS.configure({heading:!1,codeBlock:!1,horizontalRule:!1,link:!1,bulletList:!1,orderedList:!1,listItem:!1,code:!1,bold:!1,italic:!1,strike:!1,blockquote:!1,dropcursor:!1}),kp({openOnClick:!1,linkOnPaste:!0,shouldAutoLink:z=>/^https?:\/\//.test(z)||z.startsWith("intent://"),HTMLAttributes:{class:"text-primary-ink underline"}}),lS.configure({placeholder:c()?({editor:z})=>Dn.getState(z.state)?.parts.length?"":l():l(),emptyEditorClass:"is-editor-empty text-subtle",showOnlyWhenEditable:!1}),NS.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"chat-inline-image"}}),zS.configure({workspaceId:g()?.id}),r.configure({HTMLAttributes:{class:"mention-chip"},suggestion:Vr,renderHTML({node:z}){const A=rg(z.attrs,g()?.id,ig);return["span",{"data-mention":"true","data-type":z.attrs.type||"file","data-uri":z.attrs.uri||"","data-meta":JSON.stringify(z.attrs.meta||{}),"data-id":z.attrs.id,"data-label":z.attrs.label,class:"mention-chip",tabindex:"0"},A]},renderText:({node:z})=>{const A=z.attrs||{};try{return vg({type:A.type,id:A.id,label:A.label,meta:A.meta})}catch{return`@${A?.meta?.fullPath||A?.meta?.path||A?.label||A?.id||"item"}`}}}),eC.extend({renderText:({node:z})=>{const A=z.attrs||{},Ee=JSON.stringify({provider:A.provider||"browser",identifier:A.identifier||"",title:A.title||"",url:A.url||"",description:A.description||"",metadata:A.metadata||"",itemType:A.itemType||""});return`@context[${btoa(unescape(encodeURIComponent(Ee)))}]`}}),iC,fC,dM,CM],content:E,editable:m(rt),enableCoreExtensions:{delete:!1},onCreate:({editor:z})=>{pr(z),v()&&requestAnimationFrame(()=>{if(z.isDestroyed)return;z.view.dom?.focus({preventScroll:!0})})},onTransaction:({transaction:z})=>{z.docChanged&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)},onUpdate:({editor:z,transaction:A})=>{if(A.getMeta("external-update")||A.getMeta(Il)||on)return;const Ee=K()?dC(A):null;Ee&&K()?.(Ee);const Je=qn(z);pr(z,{dismissNewContext:A.getMeta("uiEvent")==="paste"}),A.getMeta(Mo)?x()?.(Je,{programmatic:!0}):x()?.(Je),Mp(z,A.getMeta(wp)===!0)},onSelectionUpdate:({editor:z,transaction:A})=>{pr(z,{dismissNewContext:A.getMeta("uiEvent")==="paste"});const{from:Ee,to:Je,empty:q}=z.state.selection;if(q)F()?.(null);else{const De=z.state.doc.textBetween(Ee,Je," ");F()?.(De.trim()||null)}},onFocus:({editor:z})=>{Sn(()=>{pe(fe,!0),pr(z)})},onBlur:()=>{Sn(()=>{pe(fe,!1)}),Ll()},editorProps:{handleDOMEvents:{compositionstart:()=>(Sn(()=>{pe(Dt,!0)}),nt()?.(!0),!1),compositionend:()=>(queueMicrotask(()=>{queueMicrotask(()=>{!m(M)||m(M).isDestroyed||(Sn(()=>{pe(Dt,!1)}),nt()?.(!1),Mt())})}),!1),beforeinput:()=>(O()?.(),!1)},attributes:{class:`tiptap-editor ${p()}`,role:"textbox","aria-multiline":"true","aria-label":a(),autocomplete:"off",spellcheck:"false",autocorrect:"off",autocapitalize:"off"},handlePaste:(z,A)=>{if(pC(A))return!0;const Ee=A.clipboardData?.getData("text/plain");if(Ee){const Je=Ee.split(`
175
- `);if(Je.length>=5){const{state:De,dispatch:lt}=z,Qe=De.schema.nodes.pasteChip.create({content:Ee,lineCount:Je.length}),Bt=De.tr.replaceSelectionWith(Qe).setMeta("uiEvent","paste");return lt(Bt),!0}const q=A.clipboardData?.getData("text/html");if(q&&oM(q,Ee))return z.dispatch(z.state.tr.insertText(Ee).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Ee)){const{state:De,dispatch:lt}=z,Qe=Wu(De.schema,Ee);if(Qe.length>0){const Bt=new B(T.from(Qe),1,1);return lt(De.tr.replaceSelection(Bt).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,A)=>hC(A),handleKeyDown:(z,A)=>{if(z.composing||A.isComposing||A.keyCode===229)return!1;if(Sp(z,A)||Tp(A))return!0;if(A.key==="Escape"&&$())return A.preventDefault(),$()(),!0;const Ee=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Je=q=>Tg(A,Xl(q),Ee);if(Je("chat.mention-context")&&Xl("chat.mention-context")!=="@")return A.preventDefault(),m(M)?.chain().focus().insertContent("@").run(),!0;if(Ee&&A.ctrlKey&&!A.metaKey){if(A.key==="a"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.start();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="e"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.end();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="k"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.selection.$head,Qe=lt.pos,Bt=lt.end();return Qe<Bt&&De(q.tr.delete(Qe,Bt)),!0}if(A.key==="p"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","line"),!0}if(A.key==="n"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","line"),!0}if(A.key==="f"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","character"),!0}if(A.key==="b"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","character"),!0}}if(A.metaKey&&!A.ctrlKey&&!A.altKey){if(A.key==="ArrowLeft"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","backward","lineboundary"),!0}if(A.key==="ArrowRight"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","forward","lineboundary"),!0}if(A.key==="ArrowUp"){A.preventDefault();const{state:q,dispatch:De}=z,lt=1;if(A.shiftKey){const{from:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,lt,Qe)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}if(A.key==="ArrowDown"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.doc.content.size-1;if(A.shiftKey){const{to:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,Qe,lt)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}}if(Je("chat.force-send"))return A.preventDefault(),k()?.(),!0;if(Je("chat.new-line"))return A.preventDefault(),m(M)?.chain().setHardBreak().scrollIntoView().run(),!0;if(A.key==="ArrowUp"&&I()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:lt}=De.selection,Qe=lt<=1,Bt=De.doc.textContent.length===0;if(Qe||Bt){const jn=I()();if(jn!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(jn)).focus("end").run(),x()?.(jn),!0}}if(A.key==="ArrowDown"&&C()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:lt}=De.selection,Qe=De.doc.content.size-1,Bt=lt>=Qe,jn=De.doc.textContent.length===0;if(Bt||jn){const Wr=C()();if(Wr!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(Wr)).focus("end").run(),x()?.(Wr),!0}}return Je("chat.send")?Vr.pluginKey.getState(z.state)?.active?!1:S()?(A.preventDefault(),S()(),!0):!1:!1}}}),!0),R.addEventListener("mouseover",Pl),R.addEventListener("mouseout",_l),R.addEventListener("click",$l),m(M).view.dom.addEventListener("keydown",Bl)})(),()=>{b=!0}});function Pl(b){const E=b.target,R=Wl(E);if(R){const Q=E.getBoundingClientRect();if(!we){we=document.createElement("div"),(ke?.target()??document.body).appendChild(we);const z=R.type||"file",A=R.label||E.textContent||"",Ee={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};qe=ni(gp,{target:we,props:{mention:{id:R.id,type:z,label:A,uri:R.uri,meta:R.meta,icon:Ee[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}}});const Je=we.firstElementChild;Je instanceof HTMLElement&&(Ye=ke?.register(Je,wn)),we.addEventListener("mouseout",zl)}}}function _l(b){const E=b.target;b.relatedTarget?.closest(".mention-hover-preview")||E.hasAttribute("data-mention")&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}function zl(b){b.relatedTarget?.closest("[data-mention]")||qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}async function $l(b){const E=Wl(b.target);if(E&&E.type!=="member"){if(E.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./CajUAX8N.js");return{handleIntentLink:Q}},__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]),import.meta.url);await R(E.intentUrl);return}if(E.type==="note"&&E.note){if(b.preventDefault(),b.stopPropagation(),E.note.workspaceId){const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./CajUAX8N.js");return{handleIntentLink:Q}},__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]),import.meta.url);await R(kg(E.note.id,E.note.workspaceId))}else{const{navigateToNote:R}=await Vi(async()=>{const{navigateToNote:Q}=await import("./oaGKgX0i.js").then(z=>z.h);return{navigateToNote:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await R(E.note.id)}return}if(E.type==="file"&&E.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:R}=await Vi(async()=>{const{navigateToFile:Q}=await import("./oaGKgX0i.js").then(z=>z.h);return{navigateToFile:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await R(E.filePath);return}}}function Bl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!m(M))return;const{state:E,dispatch:R}=m(M).view;if(b.key==="ArrowLeft"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","backward","lineboundary")}else if(b.key==="ArrowRight"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","forward","lineboundary")}else if(b.key==="ArrowUp"){b.preventDefault(),b.stopPropagation();const Q=1;if(b.shiftKey){const{from:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,Q,z)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=E.doc.content.size-1;if(b.shiftKey){const{to:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,z,Q)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}}Yu(()=>{Fr.dispose(),m(M)&&(m(M).view.dom.removeEventListener("keydown",Bl),m(M).destroy()),m(Le)&&(m(Le).removeEventListener("mouseover",Pl),m(Le).removeEventListener("mouseout",_l),m(Le).removeEventListener("click",$l)),we&&we.removeEventListener("mouseout",zl),qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove())});let Eo=0;pt(()=>{if(!m(M))return;const b=qn(m(M));if(o()===b)return;if(m(M).view.hasFocus()){Eo+=1;return}const E=m(M).view.hasFocus(),{from:R}=m(M).state.selection,Q=++Eo;(async()=>{const z=Hr(o()||"");!m(M)||Q!==Eo||qn(m(M))===b&&m(M).chain().command(({tr:A})=>(A.setMeta("external-update",!0),!0)).setContent(z).command(({tr:A,state:Ee})=>{if(E)try{const Je=Ee.doc.content.size,q=Math.min(R,Je);A.setSelection(j.create(Ee.doc,q,q))}catch{}return!0}).run()})()}),pt(()=>{m(M)&&m(M).setEditable(m(rt),!1)}),pt(()=>{!m(M)||m(M).isDestroyed||m(M).view.dispatch(m(M).state.tr.setMeta(ti,ve()))}),pt(()=>{const b=m(M)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),m(_e)&&m(Pe)?(b.setAttribute("aria-controls",$t),b.setAttribute("aria-activedescendant",m(Pe))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var jp={flushScreenEvidence:Mt,showAutocompleteSuggestion:Ep,insertAtSymbol:Ap,insertText:Np,insertPlainText:Op,focus:Dp,focusEnd:Ip,focusAndSelectAll:Rp,getHTML:Lp,clear:Pp,setContent:_p,insertImage:zp,getInlineImages:$p,getTextContent:Bp,insertContextMention:Hp,insertMention:Fp,getMentions:Vp,getContextMentions:Wp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=re.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=re.chat_richInput_askAnything_placeholder()){l(b),P()},get reactivePlaceholder(){return c()},set reactivePlaceholder(b=!1){c(b),P()},get disabled(){return u()},set disabled(b=!1){u(b),P()},get editableWhileDisabled(){return d()},set editableWhileDisabled(b=!1){d(b),P()},get inputLocked(){return f()},set inputLocked(b=!1){f(b),P()},get class(){return h()},set class(b=""){h(b),P()},get editorClassName(){return p()},set editorClassName(b=""){p(b),P()},get workspace(){return g()},set workspace(b){g(b),P()},get repoPath(){return y()},set repoPath(b){y(b),P()},get autoFocus(){return v()},set autoFocus(b=!1){v(b),P()},get onUpdate(){return x()},set onUpdate(b){x(b),P()},get onSubmit(){return S()},set onSubmit(b){S(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return $()},set onEscape(b){$(b),P()},get onHistoryPrev(){return I()},set onHistoryPrev(b){I(b),P()},get onHistoryNext(){return C()},set onHistoryNext(b){C(b),P()},get onMentionStart(){return _()},set onMentionStart(b){_(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return F()},set onSelectionChange(b){F(b),P()},get contextItems(){return ge()},set contextItems(b=[]){ge(b),P()},get trailingHint(){return ve()},set trailingHint(b=null){ve(b),P()},get autocompleteContext(){return w()},set autocompleteContext(b=null){w(b),P()},get skills(){return N()},set skills(b=[]){N(b),P()},get skillsLoading(){return W()},set skillsLoading(b=!1){W(b),P()},get skillsError(){return Y()},set skillsError(b=null){Y(b),P()},get onSkillsRetry(){return Ae()},set onSkillsRetry(b){Ae(b),P()},get slashEmptyLabel(){return oe()},set slashEmptyLabel(b){oe(b),P()},get slashNotice(){return Ne()},set slashNotice(b){Ne(b),P()},get unavailableSkillTitle(){return $e()},set unavailableSkillTitle(b){$e(b),P()},get screenReferences(){return be()},set screenReferences(b){be(b),P()},get screenInsertions(){return je()},set screenInsertions(b=[]){je(b),P()},get screenInterim(){return Ke()},set screenInterim(b=[]){Ke(b),P()},get screenSpeechActive(){return Z()},set screenSpeechActive(b=!1){Z(b),P()},get onScreenInsertionApplied(){return Ue()},set onScreenInsertionApplied(b){Ue(b),P()},get onCompositionChange(){return nt()},set onCompositionChange(b){nt(b),P()},get onUserTextInput(){return O()},set onUserTextInput(b){O(b),P()},get onScreenReferencesEdited(){return K()},set onScreenReferencesEdited(b){K(b),P()},get minHeight(){return ye()},set minHeight(b=80){ye(b),P()},get maxHeight(){return Be()},set maxHeight(b=300){Be(b),P()},$set:Kt,$on:(b,E)=>Ut(e,b,E)},To=_M(),Hl=me(To),Kp=()=>m(_e),Up=b=>!b&&Hi();Do(Hl,()=>Og,(b,E)=>{E(b,{get open(){return Kp()},set open(R){Up(R)},children:(R,Q)=>{var z=Tr(),A=Rt(z);{let Ee=H(()=>ke?.target());Do(A,()=>pm,(Je,q)=>{q(Je,{get to(){return m(Ee)},children:(De,lt)=>{var Qe=Tr(),Bt=Rt(Qe);{let jn=H(()=>m(Le)??null);Do(Bt,()=>Ng,(Wr,qp)=>{qp(Wr,{get customAnchor(){return m(jn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:Rl,onCloseAutoFocus:Rl,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return m(Xe)},set ref(No){pe(Xe,No,!0)},children:(No,$M)=>{Dr(xp(No,{get listboxId(){return $t},get items(){return m(at)},get loading(){return W()},get error(){return Y()},get emptyLabel(){return oe()},get notice(){return Ne()},get onRetry(){return Ae()},onSelect:Cp,onDismiss:Hi,onActiveOptionChange:Oo=>pe(Pe,Oo,!0)}),Oo=>pe(vt,Oo,!0),()=>m(vt))},$$slots:{default:!0}})})}U(De,Qe)},$$slots:{default:!0}})})}U(R,z)},$$slots:{default:!0}})});var Ao=ie(Hl,2);let Fl;return Dr(Ao,b=>pe(Le,b),()=>m(Le)),le(To),ne(()=>{Fl=yn(Ao,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",Fl,{"placeholder-suppressed":m(Ot)}),yi(Ao,`--tt-min-height:${ye()}px;--tt-max-height:${Be()}px`)}),U(n,To),Jt(jp)}export{JC as A,cr as B,Qx as C,fr as D,_x as E,T as F,dp as G,pl as H,Bi as I,ml as J,hC as K,vE as L,hr as M,cp as N,Wf as O,Te as P,Me as Q,NS as R,se as S,Ew as T,ES as U,aS as V,lS as W,$r as X,t1 as a,eC as b,Va as c,ut as d,ue as e,We as f,cd as g,ot as h,G as i,Bx as j,Co as k,zS as l,ze as m,Cy as n,B as o,Dl as p,Tw as q,j as r,zM as s,Fd as t,Ce as u,zC as v,xE as w,bE as x,Bv as y,J as z};
175
+ `);if(Je.length>=5){const{state:De,dispatch:lt}=z,Qe=De.schema.nodes.pasteChip.create({content:Ee,lineCount:Je.length}),Bt=De.tr.replaceSelectionWith(Qe).setMeta("uiEvent","paste");return lt(Bt),!0}const q=A.clipboardData?.getData("text/html");if(q&&oM(q,Ee))return z.dispatch(z.state.tr.insertText(Ee).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Ee)){const{state:De,dispatch:lt}=z,Qe=Wu(De.schema,Ee);if(Qe.length>0){const Bt=new B(T.from(Qe),1,1);return lt(De.tr.replaceSelection(Bt).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,A)=>hC(A),handleKeyDown:(z,A)=>{if(z.composing||A.isComposing||A.keyCode===229)return!1;if(Sp(z,A)||Tp(A))return!0;if(A.key==="Escape"&&$())return A.preventDefault(),$()(),!0;const Ee=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Je=q=>Tg(A,Xl(q),Ee);if(Je("chat.mention-context")&&Xl("chat.mention-context")!=="@")return A.preventDefault(),m(M)?.chain().focus().insertContent("@").run(),!0;if(Ee&&A.ctrlKey&&!A.metaKey){if(A.key==="a"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.start();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="e"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.end();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="k"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.selection.$head,Qe=lt.pos,Bt=lt.end();return Qe<Bt&&De(q.tr.delete(Qe,Bt)),!0}if(A.key==="p"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","line"),!0}if(A.key==="n"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","line"),!0}if(A.key==="f"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","character"),!0}if(A.key==="b"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","character"),!0}}if(A.metaKey&&!A.ctrlKey&&!A.altKey){if(A.key==="ArrowLeft"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","backward","lineboundary"),!0}if(A.key==="ArrowRight"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","forward","lineboundary"),!0}if(A.key==="ArrowUp"){A.preventDefault();const{state:q,dispatch:De}=z,lt=1;if(A.shiftKey){const{from:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,lt,Qe)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}if(A.key==="ArrowDown"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.doc.content.size-1;if(A.shiftKey){const{to:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,Qe,lt)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}}if(Je("chat.force-send"))return A.preventDefault(),k()?.(),!0;if(Je("chat.new-line"))return A.preventDefault(),m(M)?.chain().setHardBreak().scrollIntoView().run(),!0;if(A.key==="ArrowUp"&&I()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:lt}=De.selection,Qe=lt<=1,Bt=De.doc.textContent.length===0;if(Qe||Bt){const jn=I()();if(jn!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(jn)).focus("end").run(),x()?.(jn),!0}}if(A.key==="ArrowDown"&&C()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:lt}=De.selection,Qe=De.doc.content.size-1,Bt=lt>=Qe,jn=De.doc.textContent.length===0;if(Bt||jn){const Wr=C()();if(Wr!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(Wr)).focus("end").run(),x()?.(Wr),!0}}return Je("chat.send")?Vr.pluginKey.getState(z.state)?.active?!1:S()?(A.preventDefault(),S()(),!0):!1:!1}}}),!0),R.addEventListener("mouseover",Pl),R.addEventListener("mouseout",_l),R.addEventListener("click",$l),m(M).view.dom.addEventListener("keydown",Bl)})(),()=>{b=!0}});function Pl(b){const E=b.target,R=Wl(E);if(R){const Q=E.getBoundingClientRect();if(!we){we=document.createElement("div"),(ke?.target()??document.body).appendChild(we);const z=R.type||"file",A=R.label||E.textContent||"",Ee={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};qe=ni(gp,{target:we,props:{mention:{id:R.id,type:z,label:A,uri:R.uri,meta:R.meta,icon:Ee[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}}});const Je=we.firstElementChild;Je instanceof HTMLElement&&(Ye=ke?.register(Je,wn)),we.addEventListener("mouseout",zl)}}}function _l(b){const E=b.target;b.relatedTarget?.closest(".mention-hover-preview")||E.hasAttribute("data-mention")&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}function zl(b){b.relatedTarget?.closest("[data-mention]")||qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}async function $l(b){const E=Wl(b.target);if(E&&E.type!=="member"){if(E.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./BiWBSez2.js");return{handleIntentLink:Q}},__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]),import.meta.url);await R(E.intentUrl);return}if(E.type==="note"&&E.note){if(b.preventDefault(),b.stopPropagation(),E.note.workspaceId){const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./BiWBSez2.js");return{handleIntentLink:Q}},__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]),import.meta.url);await R(kg(E.note.id,E.note.workspaceId))}else{const{navigateToNote:R}=await Vi(async()=>{const{navigateToNote:Q}=await import("./DpqgMZNx.js").then(z=>z.h);return{navigateToNote:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await R(E.note.id)}return}if(E.type==="file"&&E.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:R}=await Vi(async()=>{const{navigateToFile:Q}=await import("./DpqgMZNx.js").then(z=>z.h);return{navigateToFile:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await R(E.filePath);return}}}function Bl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!m(M))return;const{state:E,dispatch:R}=m(M).view;if(b.key==="ArrowLeft"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","backward","lineboundary")}else if(b.key==="ArrowRight"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","forward","lineboundary")}else if(b.key==="ArrowUp"){b.preventDefault(),b.stopPropagation();const Q=1;if(b.shiftKey){const{from:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,Q,z)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=E.doc.content.size-1;if(b.shiftKey){const{to:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,z,Q)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}}Yu(()=>{Fr.dispose(),m(M)&&(m(M).view.dom.removeEventListener("keydown",Bl),m(M).destroy()),m(Le)&&(m(Le).removeEventListener("mouseover",Pl),m(Le).removeEventListener("mouseout",_l),m(Le).removeEventListener("click",$l)),we&&we.removeEventListener("mouseout",zl),qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove())});let Eo=0;pt(()=>{if(!m(M))return;const b=qn(m(M));if(o()===b)return;if(m(M).view.hasFocus()){Eo+=1;return}const E=m(M).view.hasFocus(),{from:R}=m(M).state.selection,Q=++Eo;(async()=>{const z=Hr(o()||"");!m(M)||Q!==Eo||qn(m(M))===b&&m(M).chain().command(({tr:A})=>(A.setMeta("external-update",!0),!0)).setContent(z).command(({tr:A,state:Ee})=>{if(E)try{const Je=Ee.doc.content.size,q=Math.min(R,Je);A.setSelection(j.create(Ee.doc,q,q))}catch{}return!0}).run()})()}),pt(()=>{m(M)&&m(M).setEditable(m(rt),!1)}),pt(()=>{!m(M)||m(M).isDestroyed||m(M).view.dispatch(m(M).state.tr.setMeta(ti,ve()))}),pt(()=>{const b=m(M)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),m(_e)&&m(Pe)?(b.setAttribute("aria-controls",$t),b.setAttribute("aria-activedescendant",m(Pe))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var jp={flushScreenEvidence:Mt,showAutocompleteSuggestion:Ep,insertAtSymbol:Ap,insertText:Np,insertPlainText:Op,focus:Dp,focusEnd:Ip,focusAndSelectAll:Rp,getHTML:Lp,clear:Pp,setContent:_p,insertImage:zp,getInlineImages:$p,getTextContent:Bp,insertContextMention:Hp,insertMention:Fp,getMentions:Vp,getContextMentions:Wp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=re.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=re.chat_richInput_askAnything_placeholder()){l(b),P()},get reactivePlaceholder(){return c()},set reactivePlaceholder(b=!1){c(b),P()},get disabled(){return u()},set disabled(b=!1){u(b),P()},get editableWhileDisabled(){return d()},set editableWhileDisabled(b=!1){d(b),P()},get inputLocked(){return f()},set inputLocked(b=!1){f(b),P()},get class(){return h()},set class(b=""){h(b),P()},get editorClassName(){return p()},set editorClassName(b=""){p(b),P()},get workspace(){return g()},set workspace(b){g(b),P()},get repoPath(){return y()},set repoPath(b){y(b),P()},get autoFocus(){return v()},set autoFocus(b=!1){v(b),P()},get onUpdate(){return x()},set onUpdate(b){x(b),P()},get onSubmit(){return S()},set onSubmit(b){S(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return $()},set onEscape(b){$(b),P()},get onHistoryPrev(){return I()},set onHistoryPrev(b){I(b),P()},get onHistoryNext(){return C()},set onHistoryNext(b){C(b),P()},get onMentionStart(){return _()},set onMentionStart(b){_(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return F()},set onSelectionChange(b){F(b),P()},get contextItems(){return ge()},set contextItems(b=[]){ge(b),P()},get trailingHint(){return ve()},set trailingHint(b=null){ve(b),P()},get autocompleteContext(){return w()},set autocompleteContext(b=null){w(b),P()},get skills(){return N()},set skills(b=[]){N(b),P()},get skillsLoading(){return W()},set skillsLoading(b=!1){W(b),P()},get skillsError(){return Y()},set skillsError(b=null){Y(b),P()},get onSkillsRetry(){return Ae()},set onSkillsRetry(b){Ae(b),P()},get slashEmptyLabel(){return oe()},set slashEmptyLabel(b){oe(b),P()},get slashNotice(){return Ne()},set slashNotice(b){Ne(b),P()},get unavailableSkillTitle(){return $e()},set unavailableSkillTitle(b){$e(b),P()},get screenReferences(){return be()},set screenReferences(b){be(b),P()},get screenInsertions(){return je()},set screenInsertions(b=[]){je(b),P()},get screenInterim(){return Ke()},set screenInterim(b=[]){Ke(b),P()},get screenSpeechActive(){return Z()},set screenSpeechActive(b=!1){Z(b),P()},get onScreenInsertionApplied(){return Ue()},set onScreenInsertionApplied(b){Ue(b),P()},get onCompositionChange(){return nt()},set onCompositionChange(b){nt(b),P()},get onUserTextInput(){return O()},set onUserTextInput(b){O(b),P()},get onScreenReferencesEdited(){return K()},set onScreenReferencesEdited(b){K(b),P()},get minHeight(){return ye()},set minHeight(b=80){ye(b),P()},get maxHeight(){return Be()},set maxHeight(b=300){Be(b),P()},$set:Kt,$on:(b,E)=>Ut(e,b,E)},To=_M(),Hl=me(To),Kp=()=>m(_e),Up=b=>!b&&Hi();Do(Hl,()=>Og,(b,E)=>{E(b,{get open(){return Kp()},set open(R){Up(R)},children:(R,Q)=>{var z=Tr(),A=Rt(z);{let Ee=H(()=>ke?.target());Do(A,()=>pm,(Je,q)=>{q(Je,{get to(){return m(Ee)},children:(De,lt)=>{var Qe=Tr(),Bt=Rt(Qe);{let jn=H(()=>m(Le)??null);Do(Bt,()=>Ng,(Wr,qp)=>{qp(Wr,{get customAnchor(){return m(jn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:Rl,onCloseAutoFocus:Rl,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return m(Xe)},set ref(No){pe(Xe,No,!0)},children:(No,$M)=>{Dr(xp(No,{get listboxId(){return $t},get items(){return m(at)},get loading(){return W()},get error(){return Y()},get emptyLabel(){return oe()},get notice(){return Ne()},get onRetry(){return Ae()},onSelect:Cp,onDismiss:Hi,onActiveOptionChange:Oo=>pe(Pe,Oo,!0)}),Oo=>pe(vt,Oo,!0),()=>m(vt))},$$slots:{default:!0}})})}U(De,Qe)},$$slots:{default:!0}})})}U(R,z)},$$slots:{default:!0}})});var Ao=ie(Hl,2);let Fl;return Dr(Ao,b=>pe(Le,b),()=>m(Le)),le(To),ne(()=>{Fl=yn(Ao,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",Fl,{"placeholder-suppressed":m(Ot)}),yi(Ao,`--tt-min-height:${ye()}px;--tt-max-height:${Be()}px`)}),U(n,To),Jt(jp)}export{JC as A,cr as B,Qx as C,fr as D,_x as E,T as F,dp as G,pl as H,Bi as I,ml as J,hC as K,vE as L,hr as M,cp as N,Wf as O,Te as P,Me as Q,NS as R,se as S,Ew as T,ES as U,aS as V,lS as W,$r as X,t1 as a,eC as b,Va as c,ut as d,ue as e,We as f,cd as g,ot as h,G as i,Bx as j,Co as k,zS as l,ze as m,Cy as n,B as o,Dl as p,Tw as q,j as r,zM as s,Fd as t,Ce as u,zC as v,xE as w,bE as x,Bv as y,J as z};