ryugi-artifacts 1.121.1 → 1.121.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 (48) hide show
  1. package/dist/cli.cjs +54 -54
  2. package/dist/document-engine.cjs +2 -2
  3. package/dist/runtime/ryugi-report.js +2 -1
  4. package/dist/viewer/{ArtboardLayout-6tJS23QW.js → ArtboardLayout-C4SfKNrD.js} +3 -3
  5. package/dist/viewer/{DocumentLayout-BjURocqM.js → DocumentLayout-BQvL4hxv.js} +2 -2
  6. package/dist/viewer/{DocumentPage-H6a9SW4D.js → DocumentPage-CevLehCC.js} +1 -1
  7. package/dist/viewer/{PreviewLayout-C-sly_jL.js → PreviewLayout-CgZgREtY.js} +2 -2
  8. package/dist/viewer/{SnapshotDocument-TKnFyGcv.js → SnapshotDocument-wpaV_vFy.js} +1 -1
  9. package/dist/viewer/{VerifyLayout-DgokULV2.js → VerifyLayout-DpZYMcZ_.js} +1 -1
  10. package/dist/viewer/{VirtualizedEditor-uWe43zaI-BlOdeG0b.js → VirtualizedEditor-uWe43zaI-Ygx3kFhs.js} +1 -1
  11. package/dist/viewer/{VirtualizedRenderer-C_d95FXi-Bb6aPJaZ.js → VirtualizedRenderer-C_d95FXi-Cy5kUbtO.js} +1 -1
  12. package/dist/viewer/{channel-DST3ZfoT.js → channel-C4FlYe6r.js} +3 -3
  13. package/dist/viewer/{dist-B7GHMwWJ.js → dist-AtCs8Ac_.js} +1 -1
  14. package/dist/viewer/{dist-CEyDZYnP.js → dist-B1bCPRCC.js} +1 -1
  15. package/dist/viewer/{dist-Dr8Mok4z.js → dist-BCMQBMNV.js} +1 -1
  16. package/dist/viewer/{dist-CAQYce5C.js → dist-BGLWo-yk.js} +1 -1
  17. package/dist/viewer/{dist-CJicYh3N.js → dist-BLB83LMN.js} +1 -1
  18. package/dist/viewer/{dist-gLcMD1Nm.js → dist-Bt8gKTDd.js} +1 -1
  19. package/dist/viewer/{dist-Bw8MOHnL.js → dist-BuGXZft6.js} +1 -1
  20. package/dist/viewer/{dist-D32zdSlG.js → dist-ByWK_S-6.js} +1 -1
  21. package/dist/viewer/{dist-DV8S7O88.js → dist-C-70ebrb.js} +1 -1
  22. package/dist/viewer/dist-C4TwVfMo.js +1 -0
  23. package/dist/viewer/{dist-B9cyrbzi.js → dist-C4gob63X.js} +1 -1
  24. package/dist/viewer/{dist-CrYVEXMn.js → dist-CB0JDkTG.js} +1 -1
  25. package/dist/viewer/{dist-CLdHiTLp.js → dist-CE49yRAi.js} +1 -1
  26. package/dist/viewer/{dist-D26TaXjP.js → dist-CHkJJlnH.js} +1 -1
  27. package/dist/viewer/{dist-462HZ4sr.js → dist-C_cSpv_W.js} +1 -1
  28. package/dist/viewer/{dist-N6Hpo5Ed.js → dist-CaB2nVTP.js} +1 -1
  29. package/dist/viewer/{dist-opUfcW4x.js → dist-DIzctmKk.js} +1 -1
  30. package/dist/viewer/{dist-CNry8POH.js → dist-DWO10Qm_.js} +1 -1
  31. package/dist/viewer/{dist-Cfyg-ZFz.js → dist-DZS8BZv4.js} +1 -1
  32. package/dist/viewer/{dist-Dz80ecx_.js → dist-Dgb15Ckj.js} +1 -1
  33. package/dist/viewer/{dist-DUysbnVD.js → dist-DpjlLiVm.js} +1 -1
  34. package/dist/viewer/{dist-DlFC92UU.js → dist-IYw7p7AW.js} +1 -1
  35. package/dist/viewer/{dist-2resm9Wy.js → dist-Kyn4c3Uq.js} +1 -1
  36. package/dist/viewer/{dist-Bost_p8b.js → dist-jVyrk7pL.js} +1 -1
  37. package/dist/viewer/{editor-rLQcZykK.js → editor-yZwTWy-w.js} +4 -4
  38. package/dist/viewer/index.js +2 -2
  39. package/dist/viewer/{plugin-_bGVeqI0-C4RRMCGb.js → plugin-_bGVeqI0-Bsz7oxOL.js} +2 -2
  40. package/dist/viewer/preview.html +1 -1
  41. package/dist/viewer/preview.js +1 -1
  42. package/dist/viewer/{printDocument-BhGNF0gC.js → printDocument-GFcncwq5.js} +1 -1
  43. package/dist/viewer/route-messages-CxWq6xYk.js +1 -0
  44. package/dist/viewer/{split-CxmPPvad.js → split-Sl7JTYgL.js} +1 -1
  45. package/dist/viewer/{viewport-CFJHn_Y6-B_DJWWd0.js → viewport-CFJHn_Y6-CwlLMc7X.js} +1 -1
  46. package/package.json +1 -1
  47. package/dist/viewer/dist-CkWqj1vB.js +0 -1
  48. package/dist/viewer/route-messages-MxWI01S2.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VirtualizedEditor-uWe43zaI-BlOdeG0b.js","./rolldown-runtime-XKyaHtl9.js","./viewport-CFJHn_Y6-B_DJWWd0.js","./WhiteboardEditor-DrHOvXez-DTa-K6Xu.js","./route-i3jkzu-i.js","./bem-vbke-3KC.js","./react-DlmbjZJV.js","./jsx-runtime-LKYXHABd.js","./types-BCsOeYI6.js","./index2.css","./url-Buh8E05T.js","./useLayerZIndex-C75Wfz8T.js","./MotionConfigContext-BqjwrGj9.js","./is-html-element-DvgHo_1h.js","./Popover-DxR9Dpf_.js","./chevron-right-DBC0wrKu.js","./stringifyLocale-VcrwrbQl.js","./code-CTMZ5SpG.js","./SelectScrollUpArrow-bXyfVgGf.js","./zoom-out-Cz3087-F.js","./text-align-start-CO9CK_EW.js","./ruler-DmQbsUQf.js","./maximize-2-Deo2WY_L.js","./mouse-pointer-2-naHRayvu.js","./undo-2-BH3P-I_n.js","./plus-C3ivaMGn.js","./MenuSubmenuTrigger-CPcD7vNW.js","./index3.css","./katex-DuZJ-tFh.js","./dist-D26TaXjP.js","./dist-DV8S7O88.js","./dist-CLdHiTLp.js","./dist-2resm9Wy.js","./dist-Bost_p8b.js","./dist-462HZ4sr.js","./dist-Dr8Mok4z.js","./dist-B7GHMwWJ.js","./dist-CrYVEXMn.js","./dist-Bw8MOHnL.js","./dist-B9cyrbzi.js","./dist-CAQYce5C.js","./dist-opUfcW4x.js","./dist-CEyDZYnP.js","./dist-Dz80ecx_.js","./dist-N6Hpo5Ed.js","./dist-CJicYh3N.js","./dist-DUysbnVD.js","./dist-DlFC92UU.js","./dist-Cfyg-ZFz.js","./dist-D32zdSlG.js","./dockerfile-DJkHQgkl.js","./simple-mode-DXiLM1-G.js","./factor-LKH5gN8L.js","./nsis-viPvXFiq.js","./pug-BqCHZ5xT.js","./javascript-lS2r2ifg.js","./dist-gLcMD1Nm.js","./dist-CNry8POH.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,C as n,E as r,S as i,f as a,j as o}from"./route-i3jkzu-i.js";/* empty css */import{t as s}from"./react-DlmbjZJV.js";import{$n as c,Ar as l,B as u,Cr as d,Er as f,Qn as p,Sr as m,Tr as h,Xn as g,Zn as _,br as v,er as y,fr as b,gr as x,hr as S,jr as C,mt as w,vr as T,wr as E,z as D}from"./url-Buh8E05T.js";import{t as O}from"./jsx-runtime-LKYXHABd.js";import{En as k}from"./useLayerZIndex-C75Wfz8T.js";import{Dt as A,m as j}from"./MotionConfigContext-BqjwrGj9.js";import{$ as M,$i as N,$n as P,$r as F,$t as I,Aa as L,An as R,Ar as z,At as B,B as V,Ba as H,Bi as U,Bn as ee,Br as te,Bt as ne,Ca as re,Ci as ie,Cn as ae,Cr as W,Ct as oe,Da as se,Di as ce,Dn as le,Dr as ue,Dt as de,Ea as fe,Ei as pe,En as me,Er as he,Et as ge,F as _e,Fa as ve,Fi as ye,Fn as be,Fr as xe,Ft as Se,G as Ce,Ga as we,Gi as Te,Gn as Ee,Gr as De,Gt as Oe,H as ke,Ha as Ae,Hi as je,Hn as Me,Hr as Ne,Ht as Pe,I as Fe,Ia as Ie,Ii as Le,In as Re,Ir as ze,It as Be,J as Ve,Jn as He,Jr as Ue,Jt as We,K as Ge,Ki as Ke,Kn as qe,Kr as Je,Kt as Ye,L as Xe,La as eee,Li as tee,Ln as nee,Lr as Ze,Lt as ree,Ma as Qe,Mi as $e,Mn as iee,Mr as et,Mt as tt,Na as nt,Ni as rt,Nn as aee,Nr as it,Nt as at,Oa as oee,Oi as ot,On as st,Or as see,Ot as ct,P as cee,Pa as lt,Pi as ut,Pn as lee,Pr as dt,Pt as uee,Q as dee,Qi as fee,Qn as ft,Qr as pt,Qt as mt,Ra as ht,Ri as gt,Rn as _t,Rr as pee,Rt as mee,Sa as vt,Si as hee,Sn as yt,Sr as bt,St as xt,Ta as St,Ti as gee,Tn as _ee,Tr as Ct,Tt as vee,U as yee,Ua as bee,Ui as xee,Un as wt,Ur as Tt,Ut as Et,V as See,Va as Dt,Vi as Ot,Vn as kt,Vr as Cee,Vt as At,W as wee,Wa as jt,Wi as Mt,Wn as Nt,Wr as Pt,Wt as Tee,X as Eee,Xi as Ft,Xn as Dee,Xr as It,Xt as Lt,Y as Rt,Yi as zt,Yn as Bt,Yr as Vt,Yt as Ht,Z as Ut,Zi as Wt,Zn as Gt,Zr as Kt,Zt as qt,_ as Oee,_a as kee,_i as Jt,_n as Yt,_r as Xt,_t as Aee,aa as jee,ai as Mee,an as Zt,ar as Nee,at as Pee,ba as Fee,bi as Qt,bn as $t,br as Iee,bt as en,ca as tn,ci as nn,cn as rn,cr as an,ct as Lee,d as Ree,da as on,di as sn,dn as zee,dr as cn,dt as Bee,ea as ln,ei as un,en as dn,er as fn,et as pn,f as Vee,fa as Hee,fi as mn,fn as hn,ft as gn,g as Uee,ga as Wee,gi as _n,gn as Gee,gr as vn,gt as yn,h as bn,ha as xn,hi as Sn,hn as Cn,hr as Kee,ht as wn,ia as qee,ii as Tn,in as En,ir as Dn,it as On,ja as kn,ji as An,jn as Jee,jr as jn,jt as Mn,ka as Nn,ki as Yee,kn as Xee,kr as Pn,kt as Fn,la as Zee,li as Qee,ln as $ee,lr as In,lt as ete,ma as Ln,mi as Rn,mn as zn,mr as tte,mt as Bn,n as nte,na as Vn,ni as Hn,nn as rte,nr as Un,nt as ite,o as ate,oa as ote,oi as Wn,on as Gn,or as ste,ot as Kn,p as cte,pa as qn,pi as Jn,pn as Yn,pr as lte,pt as Xn,q as Zn,qi as Qn,qn as ute,qr as $n,qt as dte,r as fte,ra as er,ri as tr,rn as nr,rr as pte,rt as mte,s as hte,sa as rr,si as gte,sn as ir,sr as _te,st as ar,ta as or,ti as sr,tn as cr,tr as lr,tt as ur,ua as vte,ui as yte,un as dr,ur as bte,ut as xte,v as Ste,va as fr,vi as pr,vn as mr,vr as hr,vt as Cte,wa as gr,wn as _r,wr as vr,wt as wte,x as Tte,xa as yr,xi as br,xn as xr,xr as Sr,xt as Ete,y as Cr,ya as wr,yi as Tr,yn as Er,yr as Dte,yt as Ote,z as kte,za as Dr,zn as Or,zr as kr,zt as Ate}from"./WhiteboardEditor-DrHOvXez-DTa-K6Xu.js";import{a as jte}from"./Tooltip-CZKrDYnF.js";import{P as Mte,j as Nte,t as Pte}from"./Popover-DxR9Dpf_.js";import{n as Fte,r as Ar,t as jr}from"./pen-tool-B7HWrrcR.js";import{t as Ite}from"./chevron-right-DBC0wrKu.js";import{n as Mr,r as Nr}from"./stringifyLocale-VcrwrbQl.js";import{t as Pr}from"./code-CTMZ5SpG.js";import{a as Lte,i as Rte,n as zte,o as Bte,r as Fr,s as Vte,t as Hte}from"./underline-AY5gu1iN.js";import{F as Ir,P as Ute}from"./SelectScrollUpArrow-bXyfVgGf.js";import{a as Wte,n as Gte,o as Kte,r as qte,s as Jte,t as Yte}from"./text-align-start-CO9CK_EW.js";import{s as Xte}from"./route-messages-MxWI01S2.js";import{n as Zte,t as Qte}from"./table-2-F7QzFSYG.js";import{a as $te,r as ene}from"./ruler-DmQbsUQf.js";import{n as Lr,t as tne}from"./video-tvDNJEhe.js";import{t as nne}from"./maximize-2-Deo2WY_L.js";import{t as Rr}from"./message-square-BQbestX7.js";import{n as rne}from"./undo-2-BH3P-I_n.js";import{t as zr}from"./plus-C3ivaMGn.js";import{t as ine}from"./presentation-qzIErT_u.js";import{d as ane,o as Br,r as one,t as sne,u as cne}from"./ThreadView-D_g4kidg.js";import{t as lne}from"./search-EBZOryv1.js";import{t as une}from"./shield-check-TdIPOf4j.js";import{t as dne}from"./sliders-horizontal-DZKoxRty.js";import{t as fne}from"./upload-D0s2oA1h.js";import{r as Vr,t as pne}from"./agentLook-60JQrptF.js";import{t as Hr}from"./DotGrid-DKKr_PyM.js";import{t as Ur}from"./comments-CASb0ByE.js";import{a as mne,o as hne,r as gne,s as _ne,t as vne}from"./rounds-DC6Dulo5.js";import{n as yne}from"./useMedia-CFebB4XU.js";import{t as bne}from"./BottomSheet-BFtfrr58.js";import{a as Wr,i as Gr,n as xne,o as Kr}from"./motion-Cy65kd7X.js";import{n as Sne}from"./preference-oNdcNeml.js";import{a as qr,n as Jr,t as Yr}from"./ref-BrUHq8E2.js";import{n as Cne,t as wne}from"./useSandboxFrame-CJmSnwgG.js";var Xr={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]};Xr.node;var Tne=A(Xr),Zr={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`,key:`10wcwx`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`,key:`4p5bwg`}],[`path`,{d:`M22 22V2`,key:`12ipfv`}]]};Zr.node;var Ene=A(Zr),Qr={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`,key:`lpm2y7`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`,key:`rdj6ps`}],[`path`,{d:`M2 2v20`,key:`1ivd8o`}]]};Qr.node;var Dne=A(Qr),$r={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};$r.node;var One=A($r),ei={name:`arrow-left-to-line`,size:24,node:[[`path`,{d:`M3 19V5`,key:`rwsyhb`}],[`path`,{d:`m13 6-6 6 6 6`,key:`1yhaz7`}],[`path`,{d:`M7 12h14`,key:`uoisry`}]]};ei.node;var kne=A(ei),ti={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};ti.node;var Ane=A(ti),ni={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};ni.node;var jne=A(ni),ri={name:`chart-column-big`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`rect`,{x:`15`,y:`5`,width:`4`,height:`12`,rx:`1`,key:`q8uenq`}],[`rect`,{x:`7`,y:`8`,width:`4`,height:`9`,rx:`1`,key:`sr5ea`}]],aliases:[`bar-chart-big`]};ri.node;var ii=A(ri),ai={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};ai.node;var Mne=A(ai),oi={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};oi.node;var Nne=A(oi),si={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};si.node;var ci=A(si),li={name:`footprints`,size:24,node:[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`,key:`1dudjm`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`,key:`l2t8xc`}],[`path`,{d:`M16 17h4`,key:`1dejxt`}],[`path`,{d:`M4 13h4`,key:`1bwh8b`}]]};li.node;var Pne=A(li),ui={name:`heading-1`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]};ui.node;var Fne=A(ui),di={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};di.node;var Ine=A(di),fi={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};fi.node;var Lne=A(fi),pi={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};pi.node;var mi=A(pi),hi={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};hi.node;var gi=A(hi),_i={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};_i.node;var Rne=A(_i),vi={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};vi.node;var zne=A(vi),yi={name:`message-square-code`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`m14 14 3-3-3-3`,key:`1yrceu`}]]};yi.node;var Bne=A(yi),bi={name:`message-square-exclamation-point`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]],aliases:[`message-square-warning`,`message-square-alert`]};bi.node;var xi=A(bi),Si={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};Si.node;var Vne=A(Si),Ci={name:`octagon-exclamation-point`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`,`octagon-alert`]};Ci.node;var wi=A(Ci),Ti={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Ti.node;var Ei=A(Ti),Di={name:`rectangle-horizontal`,size:24,node:[[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]};Di.node;var Hne=A(Di),Oi={name:`redo`,size:24,node:[[`path`,{d:`M21 7v6h-6`,key:`3ptur4`}],[`path`,{d:`M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7`,key:`1kgawr`}]]};Oi.node;var Une=A(Oi),ki={name:`remove-formatting`,size:24,node:[[`path`,{d:`M4 7V4h16v3`,key:`9msm58`}],[`path`,{d:`M5 20h6`,key:`1h6pxn`}],[`path`,{d:`M13 4 8 20`,key:`kqq6aj`}],[`path`,{d:`m15 15 5 5`,key:`me55sn`}],[`path`,{d:`m20 15-5 5`,key:`11p7ol`}]]};ki.node;var Wne=A(ki),Ai={name:`replace`,size:24,node:[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]};Ai.node;var Gne=A(Ai),ji={name:`sigma`,size:24,node:[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]};ji.node;var Mi=A(ji),Ni={name:`subscript`,size:24,node:[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]};Ni.node;var Kne=A(Ni),Pi={name:`superscript`,size:24,node:[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]};Pi.node;var qne=A(Pi),Fi={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};Fi.node;var Jne=A(Fi),Ii={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Ii.node;var Li=A(Ii),Ri={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Ri.node;var Yne=A(Ri),zi={name:`undo`,size:24,node:[[`path`,{d:`M3 7v6h6`,key:`1v2h90`}],[`path`,{d:`M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13`,key:`1r6uu6`}]]};zi.node;var Xne=A(zi),Bi={name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]};Bi.node;var Vi=A(Bi),Hi={name:`vote`,size:24,node:[[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}],[`path`,{d:`M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z`,key:`1ezoue`}],[`path`,{d:`M22 19H2`,key:`nuriw5`}]]};Hi.node;var Zne=A(Hi),Ui={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Ui.node;var Wi=A(Ui),G=e(s(),1),K=O(),Gi=e(t(),1),Qne=[[`flowchart`,`flowchart-elk`,/^\s*flowchart-elk/],[`mindmap`,`mindmap`,/^\s*mindmap/],[`architecture`,`architecture`,/^\s*architecture/],[`agentflow`,`agentflow`,/^\s*agentflow-beta\b/],[`c4`,`c4`,/^\s*(?:C4Context|C4Container|C4Component|C4Dynamic|C4Deployment)/],[`kanban`,`kanban`,/^\s*kanban/],[`class`,`classDiagram`,/^\s*classDiagram/],[`er`,`er`,/^\s*erDiagram/],[`gantt`,`gantt`,/^\s*gantt/],[`info`,`info`,/^\s*info/],[`pie`,`pie`,/^\s*pie/],[`requirement`,`requirement`,/^\s*requirement(Diagram)?/],[`sequence`,`sequence`,/^\s*sequenceDiagram/],[`swimlane`,`swimlane`,/^\s*swimlane-beta\b/],[`flowchart`,`flowchart-v2`,/^\s*(graph|flowchart)/],[`timeline`,`timeline`,/^\s*timeline/],[`gitGraph`,`gitGraph`,/^\s*gitGraph/],[`state`,`stateDiagram`,/^\s*stateDiagram/],[`journey`,`journey`,/^\s*journey/],[`quadrantChart`,`quadrantChart`,/^\s*quadrantChart/],[`sankey`,`sankey`,/^\s*sankey(-beta)?/],[`packet`,`packet`,/^\s*packet(-beta)?/],[`xychart`,`xychart`,/^\s*xychart(-beta)?/],[`block`,`block`,/^\s*block(-beta)?/],[`eventmodeling`,`eventmodeling`,/^\s*eventmodeling/],[`treeView`,`treeView`,/^\s*treeView-beta/],[`radar`,`radar`,/^\s*radar-beta/],[`ishikawa`,`ishikawa`,/^\s*ishikawa(-beta)?\b/i],[`treemap`,`treemap`,/^\s*treemap/],[`railroad`,`railroad`,/^\s*railroad-beta/i],[`railroad`,`railroadEbnf`,/^\s*railroad-ebnf-beta/i],[`railroad`,`railroadAbnf`,/^\s*railroad-abnf-beta/i],[`railroad`,`railroadPeg`,/^\s*railroad-peg-beta/i],[`venn`,`venn`,/^\s*venn-beta/],[`wardley`,`wardley`,/^\s*wardley-beta/i],[`cynefin`,`cynefin`,/^\s*cynefin-beta(?:[\s:]|$)/],[`usecase`,`usecase`,/^\s*usecase-beta(?:\s|$)/]];function $ne(e){for(let[t,n,r]of Qne)if(r.test(e))return{type:t,mermaidType:n};return null}var Ki=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function qi(e,t,n){return Array.from(e.matchAll(t),e=>[e.index,e.index+e[0].length,n])}function ere(e,t){let n=0;for(let[r,i,a]of e){let e=r-n;if(t<e)break;if(t<e+a)return r+Math.min(t-e,i-r-1);n+=i-r-a}return t+n}function Ji(e,t){for(let n=e.length-1;n>=0;n--)t=ere(e[n],t);return t}var Yi;function tre(e,t){let n=Yi;Yi=e;try{return t()}finally{Yi=n}}function Xi(e,t){return Yi!==void 0&&e===Yi.parsed?Yi.find(t):[e,t]}function Zi(e,t){let n=e.trimEnd().length;n>0&&t>=n?([e,t]=Xi(e,n-1),t++):[e,t]=Xi(e,t);let r=1,i=0;for(let n=e.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VirtualizedEditor-uWe43zaI-Ygx3kFhs.js","./rolldown-runtime-XKyaHtl9.js","./viewport-CFJHn_Y6-CwlLMc7X.js","./WhiteboardEditor-DrHOvXez-DTa-K6Xu.js","./route-i3jkzu-i.js","./bem-vbke-3KC.js","./react-DlmbjZJV.js","./jsx-runtime-LKYXHABd.js","./types-BCsOeYI6.js","./index2.css","./url-Buh8E05T.js","./useLayerZIndex-C75Wfz8T.js","./MotionConfigContext-BqjwrGj9.js","./is-html-element-DvgHo_1h.js","./Popover-DxR9Dpf_.js","./chevron-right-DBC0wrKu.js","./stringifyLocale-VcrwrbQl.js","./code-CTMZ5SpG.js","./SelectScrollUpArrow-bXyfVgGf.js","./zoom-out-Cz3087-F.js","./text-align-start-CO9CK_EW.js","./ruler-DmQbsUQf.js","./maximize-2-Deo2WY_L.js","./mouse-pointer-2-naHRayvu.js","./undo-2-BH3P-I_n.js","./plus-C3ivaMGn.js","./MenuSubmenuTrigger-CPcD7vNW.js","./index3.css","./katex-DuZJ-tFh.js","./dist-CHkJJlnH.js","./dist-C-70ebrb.js","./dist-CE49yRAi.js","./dist-Kyn4c3Uq.js","./dist-jVyrk7pL.js","./dist-C_cSpv_W.js","./dist-BCMQBMNV.js","./dist-AtCs8Ac_.js","./dist-CB0JDkTG.js","./dist-BuGXZft6.js","./dist-C4gob63X.js","./dist-BGLWo-yk.js","./dist-DIzctmKk.js","./dist-B1bCPRCC.js","./dist-Dgb15Ckj.js","./dist-CaB2nVTP.js","./dist-BLB83LMN.js","./dist-DpjlLiVm.js","./dist-IYw7p7AW.js","./dist-DZS8BZv4.js","./dist-ByWK_S-6.js","./dockerfile-DJkHQgkl.js","./simple-mode-DXiLM1-G.js","./factor-LKH5gN8L.js","./nsis-viPvXFiq.js","./pug-BqCHZ5xT.js","./javascript-lS2r2ifg.js","./dist-Bt8gKTDd.js","./dist-DWO10Qm_.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,C as n,E as r,S as i,f as a,j as o}from"./route-i3jkzu-i.js";/* empty css */import{t as s}from"./react-DlmbjZJV.js";import{$n as c,Ar as l,B as u,Cr as d,Er as f,Qn as p,Sr as m,Tr as h,Xn as g,Zn as _,br as v,er as y,fr as b,gr as x,hr as S,jr as C,mt as w,vr as T,wr as E,z as D}from"./url-Buh8E05T.js";import{t as O}from"./jsx-runtime-LKYXHABd.js";import{En as k}from"./useLayerZIndex-C75Wfz8T.js";import{Dt as A,m as j}from"./MotionConfigContext-BqjwrGj9.js";import{$ as M,$i as N,$n as P,$r as F,$t as I,Aa as L,An as R,Ar as z,At as B,B as V,Ba as H,Bi as U,Bn as ee,Br as te,Bt as ne,Ca as re,Ci as ie,Cn as ae,Cr as W,Ct as oe,Da as se,Di as ce,Dn as le,Dr as ue,Dt as de,Ea as fe,Ei as pe,En as me,Er as he,Et as ge,F as _e,Fa as ve,Fi as ye,Fn as be,Fr as xe,Ft as Se,G as Ce,Ga as we,Gi as Te,Gn as Ee,Gr as De,Gt as Oe,H as ke,Ha as Ae,Hi as je,Hn as Me,Hr as Ne,Ht as Pe,I as Fe,Ia as Ie,Ii as Le,In as Re,Ir as ze,It as Be,J as Ve,Jn as He,Jr as Ue,Jt as We,K as Ge,Ki as Ke,Kn as qe,Kr as Je,Kt as Ye,L as Xe,La as eee,Li as tee,Ln as nee,Lr as Ze,Lt as ree,Ma as Qe,Mi as $e,Mn as iee,Mr as et,Mt as tt,Na as nt,Ni as rt,Nn as aee,Nr as it,Nt as at,Oa as oee,Oi as ot,On as st,Or as see,Ot as ct,P as cee,Pa as lt,Pi as ut,Pn as lee,Pr as dt,Pt as uee,Q as dee,Qi as fee,Qn as ft,Qr as pt,Qt as mt,Ra as ht,Ri as gt,Rn as _t,Rr as pee,Rt as mee,Sa as vt,Si as hee,Sn as yt,Sr as bt,St as xt,Ta as St,Ti as gee,Tn as _ee,Tr as Ct,Tt as vee,U as yee,Ua as bee,Ui as xee,Un as wt,Ur as Tt,Ut as Et,V as See,Va as Dt,Vi as Ot,Vn as kt,Vr as Cee,Vt as At,W as wee,Wa as jt,Wi as Mt,Wn as Nt,Wr as Pt,Wt as Tee,X as Eee,Xi as Ft,Xn as Dee,Xr as It,Xt as Lt,Y as Rt,Yi as zt,Yn as Bt,Yr as Vt,Yt as Ht,Z as Ut,Zi as Wt,Zn as Gt,Zr as Kt,Zt as qt,_ as Oee,_a as kee,_i as Jt,_n as Yt,_r as Xt,_t as Aee,aa as jee,ai as Mee,an as Zt,ar as Nee,at as Pee,ba as Fee,bi as Qt,bn as $t,br as Iee,bt as en,ca as tn,ci as nn,cn as rn,cr as an,ct as Lee,d as Ree,da as on,di as sn,dn as zee,dr as cn,dt as Bee,ea as ln,ei as un,en as dn,er as fn,et as pn,f as Vee,fa as Hee,fi as mn,fn as hn,ft as gn,g as Uee,ga as Wee,gi as _n,gn as Gee,gr as vn,gt as yn,h as bn,ha as xn,hi as Sn,hn as Cn,hr as Kee,ht as wn,ia as qee,ii as Tn,in as En,ir as Dn,it as On,ja as kn,ji as An,jn as Jee,jr as jn,jt as Mn,ka as Nn,ki as Yee,kn as Xee,kr as Pn,kt as Fn,la as Zee,li as Qee,ln as $ee,lr as In,lt as ete,ma as Ln,mi as Rn,mn as zn,mr as tte,mt as Bn,n as nte,na as Vn,ni as Hn,nn as rte,nr as Un,nt as ite,o as ate,oa as ote,oi as Wn,on as Gn,or as ste,ot as Kn,p as cte,pa as qn,pi as Jn,pn as Yn,pr as lte,pt as Xn,q as Zn,qi as Qn,qn as ute,qr as $n,qt as dte,r as fte,ra as er,ri as tr,rn as nr,rr as pte,rt as mte,s as hte,sa as rr,si as gte,sn as ir,sr as _te,st as ar,ta as or,ti as sr,tn as cr,tr as lr,tt as ur,ua as vte,ui as yte,un as dr,ur as bte,ut as xte,v as Ste,va as fr,vi as pr,vn as mr,vr as hr,vt as Cte,wa as gr,wn as _r,wr as vr,wt as wte,x as Tte,xa as yr,xi as br,xn as xr,xr as Sr,xt as Ete,y as Cr,ya as wr,yi as Tr,yn as Er,yr as Dte,yt as Ote,z as kte,za as Dr,zn as Or,zr as kr,zt as Ate}from"./WhiteboardEditor-DrHOvXez-DTa-K6Xu.js";import{a as jte}from"./Tooltip-CZKrDYnF.js";import{P as Mte,j as Nte,t as Pte}from"./Popover-DxR9Dpf_.js";import{n as Fte,r as Ar,t as jr}from"./pen-tool-B7HWrrcR.js";import{t as Ite}from"./chevron-right-DBC0wrKu.js";import{n as Mr,r as Nr}from"./stringifyLocale-VcrwrbQl.js";import{t as Pr}from"./code-CTMZ5SpG.js";import{a as Lte,i as Rte,n as zte,o as Bte,r as Fr,s as Vte,t as Hte}from"./underline-AY5gu1iN.js";import{F as Ir,P as Ute}from"./SelectScrollUpArrow-bXyfVgGf.js";import{a as Wte,n as Gte,o as Kte,r as qte,s as Jte,t as Yte}from"./text-align-start-CO9CK_EW.js";import{s as Xte}from"./route-messages-CxWq6xYk.js";import{n as Zte,t as Qte}from"./table-2-F7QzFSYG.js";import{a as $te,r as ene}from"./ruler-DmQbsUQf.js";import{n as Lr,t as tne}from"./video-tvDNJEhe.js";import{t as nne}from"./maximize-2-Deo2WY_L.js";import{t as Rr}from"./message-square-BQbestX7.js";import{n as rne}from"./undo-2-BH3P-I_n.js";import{t as zr}from"./plus-C3ivaMGn.js";import{t as ine}from"./presentation-qzIErT_u.js";import{d as ane,o as Br,r as one,t as sne,u as cne}from"./ThreadView-D_g4kidg.js";import{t as lne}from"./search-EBZOryv1.js";import{t as une}from"./shield-check-TdIPOf4j.js";import{t as dne}from"./sliders-horizontal-DZKoxRty.js";import{t as fne}from"./upload-D0s2oA1h.js";import{r as Vr,t as pne}from"./agentLook-60JQrptF.js";import{t as Hr}from"./DotGrid-DKKr_PyM.js";import{t as Ur}from"./comments-CASb0ByE.js";import{a as mne,o as hne,r as gne,s as _ne,t as vne}from"./rounds-DC6Dulo5.js";import{n as yne}from"./useMedia-CFebB4XU.js";import{t as bne}from"./BottomSheet-BFtfrr58.js";import{a as Wr,i as Gr,n as xne,o as Kr}from"./motion-Cy65kd7X.js";import{n as Sne}from"./preference-oNdcNeml.js";import{a as qr,n as Jr,t as Yr}from"./ref-BrUHq8E2.js";import{n as Cne,t as wne}from"./useSandboxFrame-CJmSnwgG.js";var Xr={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]};Xr.node;var Tne=A(Xr),Zr={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`,key:`10wcwx`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`,key:`4p5bwg`}],[`path`,{d:`M22 22V2`,key:`12ipfv`}]]};Zr.node;var Ene=A(Zr),Qr={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`,key:`lpm2y7`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`,key:`rdj6ps`}],[`path`,{d:`M2 2v20`,key:`1ivd8o`}]]};Qr.node;var Dne=A(Qr),$r={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};$r.node;var One=A($r),ei={name:`arrow-left-to-line`,size:24,node:[[`path`,{d:`M3 19V5`,key:`rwsyhb`}],[`path`,{d:`m13 6-6 6 6 6`,key:`1yhaz7`}],[`path`,{d:`M7 12h14`,key:`uoisry`}]]};ei.node;var kne=A(ei),ti={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};ti.node;var Ane=A(ti),ni={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};ni.node;var jne=A(ni),ri={name:`chart-column-big`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`rect`,{x:`15`,y:`5`,width:`4`,height:`12`,rx:`1`,key:`q8uenq`}],[`rect`,{x:`7`,y:`8`,width:`4`,height:`9`,rx:`1`,key:`sr5ea`}]],aliases:[`bar-chart-big`]};ri.node;var ii=A(ri),ai={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};ai.node;var Mne=A(ai),oi={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};oi.node;var Nne=A(oi),si={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};si.node;var ci=A(si),li={name:`footprints`,size:24,node:[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`,key:`1dudjm`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`,key:`l2t8xc`}],[`path`,{d:`M16 17h4`,key:`1dejxt`}],[`path`,{d:`M4 13h4`,key:`1bwh8b`}]]};li.node;var Pne=A(li),ui={name:`heading-1`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]};ui.node;var Fne=A(ui),di={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};di.node;var Ine=A(di),fi={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};fi.node;var Lne=A(fi),pi={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};pi.node;var mi=A(pi),hi={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};hi.node;var gi=A(hi),_i={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};_i.node;var Rne=A(_i),vi={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};vi.node;var zne=A(vi),yi={name:`message-square-code`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`m14 14 3-3-3-3`,key:`1yrceu`}]]};yi.node;var Bne=A(yi),bi={name:`message-square-exclamation-point`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]],aliases:[`message-square-warning`,`message-square-alert`]};bi.node;var xi=A(bi),Si={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};Si.node;var Vne=A(Si),Ci={name:`octagon-exclamation-point`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`,`octagon-alert`]};Ci.node;var wi=A(Ci),Ti={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Ti.node;var Ei=A(Ti),Di={name:`rectangle-horizontal`,size:24,node:[[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]};Di.node;var Hne=A(Di),Oi={name:`redo`,size:24,node:[[`path`,{d:`M21 7v6h-6`,key:`3ptur4`}],[`path`,{d:`M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7`,key:`1kgawr`}]]};Oi.node;var Une=A(Oi),ki={name:`remove-formatting`,size:24,node:[[`path`,{d:`M4 7V4h16v3`,key:`9msm58`}],[`path`,{d:`M5 20h6`,key:`1h6pxn`}],[`path`,{d:`M13 4 8 20`,key:`kqq6aj`}],[`path`,{d:`m15 15 5 5`,key:`me55sn`}],[`path`,{d:`m20 15-5 5`,key:`11p7ol`}]]};ki.node;var Wne=A(ki),Ai={name:`replace`,size:24,node:[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]};Ai.node;var Gne=A(Ai),ji={name:`sigma`,size:24,node:[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]};ji.node;var Mi=A(ji),Ni={name:`subscript`,size:24,node:[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]};Ni.node;var Kne=A(Ni),Pi={name:`superscript`,size:24,node:[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]};Pi.node;var qne=A(Pi),Fi={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};Fi.node;var Jne=A(Fi),Ii={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Ii.node;var Li=A(Ii),Ri={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Ri.node;var Yne=A(Ri),zi={name:`undo`,size:24,node:[[`path`,{d:`M3 7v6h6`,key:`1v2h90`}],[`path`,{d:`M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13`,key:`1r6uu6`}]]};zi.node;var Xne=A(zi),Bi={name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]};Bi.node;var Vi=A(Bi),Hi={name:`vote`,size:24,node:[[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}],[`path`,{d:`M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z`,key:`1ezoue`}],[`path`,{d:`M22 19H2`,key:`nuriw5`}]]};Hi.node;var Zne=A(Hi),Ui={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Ui.node;var Wi=A(Ui),G=e(s(),1),K=O(),Gi=e(t(),1),Qne=[[`flowchart`,`flowchart-elk`,/^\s*flowchart-elk/],[`mindmap`,`mindmap`,/^\s*mindmap/],[`architecture`,`architecture`,/^\s*architecture/],[`agentflow`,`agentflow`,/^\s*agentflow-beta\b/],[`c4`,`c4`,/^\s*(?:C4Context|C4Container|C4Component|C4Dynamic|C4Deployment)/],[`kanban`,`kanban`,/^\s*kanban/],[`class`,`classDiagram`,/^\s*classDiagram/],[`er`,`er`,/^\s*erDiagram/],[`gantt`,`gantt`,/^\s*gantt/],[`info`,`info`,/^\s*info/],[`pie`,`pie`,/^\s*pie/],[`requirement`,`requirement`,/^\s*requirement(Diagram)?/],[`sequence`,`sequence`,/^\s*sequenceDiagram/],[`swimlane`,`swimlane`,/^\s*swimlane-beta\b/],[`flowchart`,`flowchart-v2`,/^\s*(graph|flowchart)/],[`timeline`,`timeline`,/^\s*timeline/],[`gitGraph`,`gitGraph`,/^\s*gitGraph/],[`state`,`stateDiagram`,/^\s*stateDiagram/],[`journey`,`journey`,/^\s*journey/],[`quadrantChart`,`quadrantChart`,/^\s*quadrantChart/],[`sankey`,`sankey`,/^\s*sankey(-beta)?/],[`packet`,`packet`,/^\s*packet(-beta)?/],[`xychart`,`xychart`,/^\s*xychart(-beta)?/],[`block`,`block`,/^\s*block(-beta)?/],[`eventmodeling`,`eventmodeling`,/^\s*eventmodeling/],[`treeView`,`treeView`,/^\s*treeView-beta/],[`radar`,`radar`,/^\s*radar-beta/],[`ishikawa`,`ishikawa`,/^\s*ishikawa(-beta)?\b/i],[`treemap`,`treemap`,/^\s*treemap/],[`railroad`,`railroad`,/^\s*railroad-beta/i],[`railroad`,`railroadEbnf`,/^\s*railroad-ebnf-beta/i],[`railroad`,`railroadAbnf`,/^\s*railroad-abnf-beta/i],[`railroad`,`railroadPeg`,/^\s*railroad-peg-beta/i],[`venn`,`venn`,/^\s*venn-beta/],[`wardley`,`wardley`,/^\s*wardley-beta/i],[`cynefin`,`cynefin`,/^\s*cynefin-beta(?:[\s:]|$)/],[`usecase`,`usecase`,/^\s*usecase-beta(?:\s|$)/]];function $ne(e){for(let[t,n,r]of Qne)if(r.test(e))return{type:t,mermaidType:n};return null}var Ki=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function qi(e,t,n){return Array.from(e.matchAll(t),e=>[e.index,e.index+e[0].length,n])}function ere(e,t){let n=0;for(let[r,i,a]of e){let e=r-n;if(t<e)break;if(t<e+a)return r+Math.min(t-e,i-r-1);n+=i-r-a}return t+n}function Ji(e,t){for(let n=e.length-1;n>=0;n--)t=ere(e[n],t);return t}var Yi;function tre(e,t){let n=Yi;Yi=e;try{return t()}finally{Yi=n}}function Xi(e,t){return Yi!==void 0&&e===Yi.parsed?Yi.find(t):[e,t]}function Zi(e,t){let n=e.trimEnd().length;n>0&&t>=n?([e,t]=Xi(e,n-1),t++):[e,t]=Xi(e,t);let r=1,i=0;for(let n=e.indexOf(`
3
3
  `);n!==-1&&n<t;n=e.indexOf(`
4
4
  `,n+1))r++,i=n+1;let a=e.indexOf(`
5
5
  `,t);a===-1&&(a=e.length);let o=t-i+1,s=e.slice(i,a);return{line:r,column:o,snippet:s+`
@@ -169,7 +169,7 @@ but found: '${Qb(Jb)}'`);(Hb[Gb[Jb]]&zb)!==0;)Jb++;return Wb.slice(Kb[e],qb[Jb-1
169
169
  `)}static importJSON(t){let n=t,r=n.cols||2,i=n.gap,a=typeof i==`number`?`${i}px`:i;if(n.cells&&n.cells.length>0)return new e(r,a,n.cells).updateFromJSON(t);if(n.children){let i=n.children.map(e=>({root:{children:[e],direction:null,format:``,indent:0,type:`root`,version:1}}));return new e(r,a,i).updateFromJSON(t)}return new e(r,a).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`grid-container`,cols:this.__cols,gap:this.__gap,cells:this.__cellStates,version:1}}decorate(e,t){return(0,G.createElement)(BOe,{cols:this.__cols,gap:this.__gap,cellStates:this.__cellStates})}};function QP(e){return e instanceof ZP}var $P=class e extends wr{static getType(){return`link-card`}static clone(t){return new e({url:t.__url,source:t.__source,id:t.__id,title:t.__title,description:t.__description,favicon:t.__favicon,image:t.__image},t.__key)}constructor(e,t){super(t),tA(this,`__url`,void 0),tA(this,`__source`,void 0),tA(this,`__id`,void 0),tA(this,`__title`,void 0),tA(this,`__description`,void 0),tA(this,`__favicon`,void 0),tA(this,`__image`,void 0),this.__url=e.url,this.__source=e.source,this.__id=e.id,this.__title=e.title,this.__description=e.description,this.__favicon=e.favicon,this.__image=e.image}createDOM(e){let t=document.createElement(`div`);return t.className=`rich-link-card-wrapper`,t}updateDOM(){return!1}isInline(){return!1}static importJSON(e){let t=e;return eF({url:t.url,source:t.source,id:t.id,title:t.title,description:t.description,favicon:t.favicon,image:t.image}).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),type:`link-card`,url:this.__url,source:this.__source,id:this.__id,title:this.__title,description:this.__description,favicon:this.__favicon,image:this.__image,version:1}}getUrl(){return this.getLatest().__url}setUrl(e){let t=this.getWritable();t.__url=e}getSource(){return this.getLatest().__source}setSource(e){let t=this.getWritable();t.__source=e}getId(){return this.getLatest().__id}setId(e){let t=this.getWritable();t.__id=e}decorate(e,t){return qj(KEe,fOe,{url:this.__url,source:this.__source,id:this.__id,title:this.__title,description:this.__description,favicon:this.__favicon,image:this.__image})}};tA($P,`commandItems`,[{title:`Link Card`,icon:(0,G.createElement)(v,{size:20}),description:`Link preview card`,keywords:[`link`,`card`,`bookmark`,`embed`],section:`MEDIA`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([eF({url:``})])})}}]);function eF(e){return new $P(e)}function VOe(e){let t=``;for(let n of Array.from(e.childNodes)){if(n.nodeType===Node.TEXT_NODE){t+=n.textContent??``;continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let e=n,r=e.tagName.toLowerCase();r!==`rt`&&r!==`rp`&&(t+=e.textContent??``)}return t}var tF=class e extends $e{static getType(){return`ruby`}static clone(t){return new e(t.__reading,t.__key)}constructor(e,t){super(t),tA(this,`__reading`,void 0),this.__reading=e}static importJSON(e){let t=e;return nF(t.reading??``).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`ruby`,reading:this.__reading,version:1}}static importDOM(){return{ruby:()=>({conversion:e=>{if(!(e instanceof HTMLElement))return null;let t=e.querySelector(`rt`)?.textContent??``,n=VOe(e),r=nF(t);return n&&r.append(te(n)),{node:r}},priority:2})}}exportDOM(){let e=document.createElement(`ruby`);e.className=`${Nj.ruby} ${Pj.ruby}`;let t=this.getTextContent();if(t&&e.append(t),this.__reading){let t=document.createElement(`rt`);t.className=`${Nj.rubyRt} ${Pj.rubyRt}`,t.textContent=this.__reading,e.append(t)}return{element:e}}createDOM(e){let t=document.createElement(`span`);return t.className=`${Nj.ruby} ${Pj.ruby}`,this.__reading&&(t.dataset.ruby=this.__reading),t}updateDOM(e,t){return e.__reading!==this.__reading&&(this.__reading?t.dataset.ruby=this.__reading:delete t.dataset.ruby),!1}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!0}getReading(){return this.getLatest().__reading}setReading(e){let t=this.getWritable();t.__reading=e}};function nF(e){return new tF(e)}function rF(e){return e instanceof tF}function HOe({src:e,poster:t,width:n,height:r}){return(0,K.jsx)(`figure`,{className:`rich-video`,children:(0,K.jsx)(`video`,{controls:!0,height:r,poster:t,preload:`metadata`,src:e,style:{maxWidth:`100%`,height:`auto`},width:n})})}var iF=class e extends wr{static getType(){return`video`}static clone(t){return new e({src:t.__src,poster:t.__poster,width:t.__width,height:t.__height},t.__key)}constructor(e,t){super(t),tA(this,`__src`,void 0),tA(this,`__poster`,void 0),tA(this,`__width`,void 0),tA(this,`__height`,void 0),this.__src=e.src,this.__poster=e.poster,this.__width=e.width,this.__height=e.height}createDOM(e){let t=document.createElement(`div`);return t.className=`rich-video-wrapper`,t}updateDOM(){return!1}isInline(){return!1}static importJSON(e){let t=e;return aF({src:t.src,poster:t.poster,width:t.width,height:t.height}).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),type:`video`,src:this.__src,poster:this.__poster,width:this.__width,height:this.__height,version:1}}getSrc(){return this.getLatest().__src}setSrc(e){let t=this.getWritable();t.__src=e}decorate(e,t){return qj(JEe,HOe,{src:this.__src,poster:this.__poster,width:this.__width,height:this.__height})}};tA(iF,`commandItems`,[{title:`Video`,icon:(0,G.createElement)(tne,{size:20}),description:`Embed a video`,keywords:[`video`,`media`,`mp4`],section:`MEDIA`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([aF({src:``})])})}}]);function aF(e){return new iF(e)}var oF=[$t,mr,sP,{replace:mr,with:()=>new sP},Gn,En,dr,Cn,hA,dN,iM,dM,wP],UOe=[cP,eP,ZN,JN,UN,xN,RP,CN,YP,iF,qP,$P,HP,GP,ZP,LP,nP,tF,dP],WOe=[...oF,...UOe],sF=(0,G.createContext)(`light`);function cF({colorScheme:e,children:t}){return(0,K.jsx)(sF.Provider,{value:e,children:t})}function lF(){return(0,G.use)(sF)}function uF({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:i=!1}){let[a]=ht();(0,G.useEffect)(()=>{lN(a)!==r&&(MDe(a,r),a.update(fee))},[a,r]);let o=function(e){let[t]=(0,G.useState)(()=>Me(e));return t.peek()!==e&&(t.value=e),t}(i);return(0,G.useEffect)(()=>HDe(a,{hasNestedTables:o}),[a,o]),(0,G.useEffect)(()=>VDe(a,n),[a,n]),(0,G.useEffect)(()=>{if(!e)return BDe(a)},[a,e]),(0,G.useEffect)(()=>{if(!t)return a.registerNodeTransform(iM,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})},[a,t,e]),null}var GOe=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function KOe(e){let t=e?.trim();if(!t||/\s/.test(t))return null;try{return GOe.has(new URL(t).protocol)?t:null}catch{return null}}function dF(){let[e]=ht();return(0,G.useEffect)(()=>e.registerCommand(or,t=>{if(!(t instanceof ClipboardEvent))return!1;let n=kr();if(!Jn(n)||n.isCollapsed())return!1;let r=KOe(t.clipboardData?.getData(`text/plain`));if(!r)return!1;let i=n.getNodes().filter(it);if(i.length===0||i.some(e=>!e.isSimpleText()))return!1;let a=i[0].getTopLevelElement();return!a||i.some(e=>e.getTopLevelElement()!==a)?!1:(t.preventDefault(),e.dispatchCommand(hn,r),!0)},3),[e]),null}function fF(){let[e]=ht(),t=nA(),n=e.hasNodes([dN,dM,iM]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Lt,{}),(0,K.jsx)(qt,{}),(0,K.jsx)(dF,{}),n&&(0,K.jsx)(uF,{hasHorizontalScroll:!0}),t]})}function qOe(e,t,n){let r=JSON.stringify(t.getEditorState().toJSON());return t.registerUpdateListener(({dirtyElements:t,dirtyLeaves:i,editorState:a})=>{if(t.size===0&&i.size===0)return;let o=JSON.stringify(a.toJSON());o!==r&&(r=o,e.update(()=>{let e=Dn(n);e&&(L(un),L(z),e.markDirty())}))})}function pF(e,t){let[n]=ht();(0,G.useEffect)(()=>{let r=e.map(e=>qOe(n,e,t));return()=>r.forEach(e=>e())},[n,e,t])}function JOe({parentEditor:e,nodeKey:t}){let[n]=ht();return(0,G.useEffect)(()=>{let r=()=>{e.focus(()=>{e.update(()=>{let e=Dn(t);if(e){let t=e.getNextSibling();t&&t.selectStart()}})})},i=n=>{let i=Sr(),a=i.getLastChild(),o=n&&i.getChildrenSize()<=1;n&&a&&a.remove(),o?e.update(()=>{let e=Dn(t);if(e){let t=on();e.insertAfter(t),e.remove(),t.selectStart()}},{onUpdate:r}):e.update(()=>{let e=Dn(t);if(e){let t=e.getNextSibling();t&&yr(t)||(t=on(),e.insertAfter(t)),t.selectStart()}},{onUpdate:r})},a=()=>{let e=kr();if(!Jn(e)||!e.isCollapsed())return!1;let t=e.anchor.getNode().getTopLevelElement();return t&&yr(t)&&t.getTextContent()===``&&t.getNextSibling()===null},o=n.registerCommand(an,e=>e?.metaKey||e?.ctrlKey?(e.preventDefault(),i(!1),!0):a()?(e?.preventDefault(),i(!0),!0):!1,4),s=n.registerCommand(F,e=>a()?(e?.preventDefault(),i(!1),!0):!1,3);return()=>{o(),s()}},[n,e,t]),null}function YOe({nodeKey:e,alertType:t,contentEditor:n}){let[r]=ht();pF((0,G.useMemo)(()=>[n],[n]),e);let i=r.isEditable(),a=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);JDe(n)&&n.setAlertType(t)})},[r,e]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Kj,{defaultRenderer:yN,rendererKey:Lj,props:{type:t,editable:i,onTypeChange:i?a:void 0}}),(0,K.jsx)(`div`,{className:`rich-alert-content`,children:(0,K.jsxs)(pA,{initialEditor:n,children:[(0,K.jsx)(Yt,{ErrorBoundary:Nt,contentEditable:(0,K.jsx)(Ee,{"aria-placeholder":``,className:`rich-alert-content-editable`,placeholder:(0,K.jsx)(`span`,{style:{display:`none`}}),style:{outline:`none`}})}),(0,K.jsx)(fF,{}),(0,K.jsx)(JOe,{nodeKey:e,parentEditor:r})]})})]})}var XOe=[$t,mr,sP,{replace:mr,with:()=>new sP},Gn,En,dr,Cn,hA,wP,dN,iM,dM,cP,eP,CN,ZN,dP];function ZOe(){try{return Vn()}catch{return null}}function mF(e){return ZOe()?qn():qn({namespace:e,nodes:XOe,theme:mP,onError:t=>console.error(`[${e}]`,t)})}function QOe(){return mF(`AlertContent`)}var hF=class e extends xN{static clone(t){let n=new e(t.__alertType,t.__contentState,t.__key);return n.__contentEditor=t.__contentEditor,n}constructor(e,t,n){if(super(e,t,n),tA(this,`__contentEditor`,void 0),this.__contentEditor=QOe(),t){let e=this.__contentEditor.parseEditorState(t);this.__contentEditor.setEditorState(e)}}getContentEditor(){return this.__contentEditor}static importJSON(t){let n=t;return new e(n.alertType,n.content).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`alert-quote`,alertType:this.__alertType,content:this.__contentEditor.getEditorState().toJSON(),version:1}}decorate(e,t){return(0,G.createElement)(YOe,{nodeKey:this.__key,alertType:this.__alertType,contentEditor:this.__contentEditor})}};tA(hF,`commandItems`,[{title:`Callout`,icon:(0,G.createElement)(m,{size:20}),description:`Info callout block`,keywords:[`alert`,`note`,`info`,`callout`],section:`ADVANCED`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([gF(`note`)])})}},{title:`Tip`,icon:(0,G.createElement)(gi,{size:20}),description:`Highlight a useful tip`,keywords:[`alert`,`tip`,`hint`],section:`ADVANCED`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([gF(`tip`)])})}},{title:`Warning`,icon:(0,G.createElement)(x,{size:20}),description:`Warn about something`,keywords:[`alert`,`warning`,`caution`],section:`ADVANCED`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([gF(`warning`)])})}}]);function gF(e,t){return new hF(e,t)}function _F(e,t){return e.read(`latest`,()=>{let e=Dn(t);return e!==null&&e.isSelected()})}function vF(e){let[t]=ht(),[n,r]=(0,G.useState)(()=>_F(t,e));return(0,G.useEffect)(()=>{let n=!0,i=t.registerUpdateListener(()=>{n&&r(_F(t,e))});return()=>{n=!1,i()}},[t,e]),[n,(0,G.useCallback)(n=>{t.update(()=>{let t=kr();if(!Ue(t)){let r=n?null:Dn(e);if(r!==null&&!r.isSelected())return;t=sr(),Jt(t)}Ue(t)&&(n?t.add(e):t.delete(e))})},[t,e]),(0,G.useCallback)(()=>{t.update(()=>{let e=kr();Ue(e)&&e.clear()})},[t])]}var yF=new Map;function bF(e,t){yF.set(e,t)}function $Oe(e){let t=yF.get(e);return t?(yF.delete(e),t):null}function eke({nodeKey:e,bannerType:t,contentEditor:n}){let[r]=ht();pF((0,G.useMemo)(()=>[n],[n]),e);let i=r.isEditable(),a=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);AOe(n)&&n.setBannerType(t)})},[r,e]);return(0,K.jsxs)(`div`,{className:`rich-banner-inner`,children:[(0,K.jsx)(Kj,{defaultRenderer:PP,rendererKey:Rj,props:{type:t,editable:i,onTypeChange:i?a:void 0}}),(0,K.jsx)(`div`,{className:`rich-banner-content`,children:(0,K.jsxs)(pA,{initialEditor:n,children:[(0,K.jsx)(Yt,{ErrorBoundary:Nt,contentEditable:(0,K.jsx)(Ee,{"aria-placeholder":``,className:`rich-banner-content-editable`,placeholder:(0,K.jsx)(`span`,{style:{display:`none`}}),style:{outline:`none`}})}),(0,K.jsx)(fF,{})]})})]})}function tke(){return mF(`BannerContent`)}var xF=class e extends LP{static clone(t){let n=new e(t.__bannerType,t.__contentState,t.__key);return n.__contentEditor=t.__contentEditor,n}constructor(e,t,n){if(super(e,t,n),tA(this,`__contentEditor`,void 0),this.__contentEditor=tke(),t){let e=this.__contentEditor.parseEditorState(t);this.__contentEditor.setEditorState(e)}}getContentEditor(){return this.__contentEditor}static importJSON(t){let n=t,r=n,i=IP(n.bannerType);if(n.content)return new e(i,n.content).updateFromJSON(t);if(r.children){let n={root:{children:r.children,direction:null,format:``,indent:0,type:`root`,version:1}};return new e(i,n).updateFromJSON(t)}return new e(i).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`banner`,bannerType:this.__bannerType,content:this.__contentEditor.getEditorState().toJSON(),version:1}}decorate(e,t){return(0,G.createElement)(eke,{nodeKey:this.__key,bannerType:this.__bannerType,contentEditor:this.__contentEditor})}};tA(xF,`commandItems`,[{title:`Banner`,icon:(0,G.createElement)(ci,{size:20}),description:`Highlighted banner block`,keywords:[`banner`,`notice`,`announcement`],section:`ADVANCED`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([SF(`note`)])})}}]);function SF(e,t){return new xF(e,t)}function nke({code:e,language:t,showLineNumbers:n}){let r=Gj(),i=n??(r!==`comment`&&r!==`chat`),a=lF(),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1),u=(0,G.useRef)(void 0);(0,G.useEffect)(()=>{let n=!1;return s(null),ne(e,t,a===`dark`?`dark`:`light`).then(e=>{n||s(e)}).catch(()=>{n||s(null)}),()=>{n=!0}},[e,t,a]),(0,G.useEffect)(()=>()=>clearTimeout(u.current),[]);let d=(0,G.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),clearTimeout(u.current),u.current=setTimeout(()=>l(!1),2e3)}).catch(()=>{})},[e]),f=t?(0,K.jsxs)(`div`,{className:`rich-code-block-header`,children:[(0,K.jsx)(`span`,{className:`rich-code-block-lang`,children:t}),(0,K.jsx)(`button`,{"aria-label":c?`Copied to clipboard`:`Copy code`,className:`rich-code-block-copy`,type:`button`,onClick:d,children:c?`Copied`:`Copy`})]}):null,p=(0,G.useMemo)(()=>({"--rc-ln-digits":Math.max(2,String(e.split(`
170
170
  `).length).length)}),[e]),m=i?`rich-code-block rich-code-block-numbered`:`rich-code-block`;if(o)return(0,K.jsxs)(`div`,{className:m,style:p,children:[f,(0,K.jsx)(`div`,{dangerouslySetInnerHTML:{__html:o}})]});let h=e.split(`
171
171
  `);return(0,K.jsxs)(`div`,{className:m,style:p,children:[f,(0,K.jsx)(`pre`,{children:(0,K.jsx)(`code`,{children:h.map((e,t)=>(0,K.jsxs)(`span`,{className:`line`,children:[e,t<h.length-1?`
172
- `:``]},t))})})]})}function rke({nodeKey:e,code:t,language:n}){let[r]=ht(),[i]=vF(e),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(`start`),l=r.isEditable();(0,G.useEffect)(()=>{if(!l||!i){o(!1);return}let t=!1,n=`start`;r.getEditorState().read(()=>{let r=kr(),i=Ue(r)?r.getNodes():null;t=i!==null&&i.length===1&&i[0]?.getKey()===e,t&&(n=$Oe(e)??`start`)}),o(t),t&&c(n)},[l,r,i,e]),(0,G.useEffect)(()=>{if(l&&i)return r.registerCommand(br,t=>(t.key.length!==1||t.metaKey||t.ctrlKey||t.altKey||t.isComposing||!r.getEditorState().read(()=>{let t=kr();if(!Ue(t))return!1;let n=t.getNodes();return n.length===1&&n[0]?.getKey()===e})||r.getElementByKey(e)?.querySelector(`[contenteditable="true"]`)?.focus(),!1),3)},[l,r,i,e]);let u=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);BP(n)&&n.setCode(t)})},[r,e]),d=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);BP(n)&&n.setLanguage(t)})},[r,e]),f=(0,G.useCallback)(()=>{r.getRootElement()?.focus({preventScroll:!0}),r.update(()=>{let t=Dn(e);if(!t)return;let n=t.getPreviousSibling(),r=t.getNextSibling(),i=t.getParent();if(t.remove(),n){if(rr(n))n.selectEnd();else{je(n)&&n.getType()===`code-block`&&bF(n.getKey(),`end`);let e=sr();e.add(n.getKey()),Jt(e)}}else if(r){if(rr(r))r.selectStart();else{je(r)&&r.getType()===`code-block`&&bF(r.getKey(),`start`);let e=sr();e.add(r.getKey()),Jt(e)}}else if(i){let e=on();i.append(e),e.selectStart()}})},[r,e]),p=(0,G.useCallback)(t=>{r.getRootElement()?.focus({preventScroll:!0}),r.update(()=>{let n=Dn(e);if(!n)return;if(t===`before`){let e=n.getPreviousSibling();if(!e)return;if(rr(e))e.selectEnd();else{je(e)&&e.getType()===`code-block`&&bF(e.getKey(),`end`);let t=sr();t.add(e.getKey()),Jt(t)}return}let r=n.getNextSibling();if(!r){let e=on();n.insertAfter(e),r=e}if(rr(r))r.selectStart();else{je(r)&&r.getType()===`code-block`&&bF(r.getKey(),`start`);let e=sr();e.add(r.getKey()),Jt(e)}})},[r,e]);return(0,K.jsx)(Kj,{defaultRenderer:nke,rendererKey:zj,props:{code:t,language:n,editable:l,onCodeChange:l?u:void 0,onLanguageChange:l?d:void 0,onDelete:l?f:void 0,onExitBlock:l?p:void 0,selected:l?a:!1,cursorPlacement:l?s:`start`}})}var CF,wF=class e extends RP{static clone(t){return new e(t.__code,t.__language,t.__key)}static importJSON(t){let n=t;return new e(n.code,n.language).updateFromJSON(t)}decorate(e,t){return(0,G.createElement)(rke,{nodeKey:this.__key,code:this.__code,language:this.__language})}};CF=wF,tA(wF,`commandItems`,RP.commandItems.map(e=>({...e,onSelect:e=>{e.update(()=>{Un([new CF(``,`text`)])})}})));function ike(e,t){return new wF(e,t)}function ake({definitions:e}){let[t]=ht(),{displayNumberMap:n}=Xj(),r=Object.entries(e).sort(([e],[t])=>(n[e]??0)-(n[t]??0)),i=(0,G.useCallback)((e,n)=>{t.update(()=>{let t=xn(YP);t.length>0&&t[0].setDefinition(e,n)})},[t]),a=(0,G.useCallback)(e=>{t.update(()=>{let t=xn(YP);t.length>0&&t[0].removeDefinition(e)})},[t]);return r.length===0?null:(0,K.jsxs)(`div`,{role:`doc-endnotes`,className:Fj(`rich-footnote-section-content`,`rich-footnote-section-edit`,Nj.footnoteSection,Pj.footnoteSection),children:[(0,K.jsx)(`hr`,{className:Fj(Nj.footnoteSectionDivider,Pj.footnoteSectionDivider)}),(0,K.jsx)(`ol`,{className:Fj(Nj.footnoteSectionList,Pj.footnoteSectionList),children:r.map(([e,t])=>{let r=n[e]??e;return(0,K.jsxs)(`li`,{id:`footnote-${e}`,className:Fj(Nj.footnoteSectionItem,Pj.footnoteSectionItem,Nj.footnoteSectionItemEdit,Pj.footnoteSectionItemEdit),children:[(0,K.jsxs)(`span`,{className:Fj(Nj.footnoteSectionItemNum,Pj.footnoteSectionItemNum),children:[r,`.`]}),(0,K.jsx)(`input`,{placeholder:`Footnote content for [^${e}]`,type:`text`,value:t,className:Fj(Nj.footnoteSectionItemInput,Pj.footnoteSectionItemInput),onChange:t=>i(e,t.target.value)}),(0,K.jsx)(`button`,{"aria-label":`Remove footnote ${e}`,type:`button`,className:Fj(Nj.footnoteSectionItemRemove,Pj.footnoteSectionItemRemove),onClick:()=>a(e),children:`×`})]},e)})})]})}var oke=class e extends YP{static getType(){return`footnote-section`}static clone(t){return new e({...t.__definitions},t.__key)}static importJSON(t){return new e(t.definitions).updateFromJSON(t)}decorate(e,t){return(0,G.createElement)(ake,{definitions:this.__definitions,nodeKey:this.__key})}},ske=30;function cke(){let e=Sr().getFirstChild();rr(e)?e.selectStart():Sr().selectStart()}function lke({cellEditors:e,clearAutoFocusIntent:t,requestFrame:n=window.requestAnimationFrame.bind(window),cancelFrame:r=window.cancelAnimationFrame.bind(window),maxRootLookupAttempts:i=ske}){let a=!1,o=null,s=r=>{o=n(()=>{if(o=null,a)return;let n=e[0];n?!n.getRootElement()&&r<i?s(r+1):(t(),n.update(cke,{discrete:!0}),n.focus()):t()})};return s(0),()=>{a=!0,o!==null&&r(o)}}var uke=[1,2,3,4];function TF({children:e,className:t,label:n,pressed:r,onClick:i}){return(0,K.jsxs)(Mn,{children:[(0,K.jsx)(tt,{render:(0,K.jsx)(`button`,{"aria-label":n,"aria-pressed":r,className:t,type:`button`,onClick:i}),children:e}),(0,K.jsx)(Fn,{side:`top`,children:n})]})}function dke({nodeKey:e,autoFocusOnMount:t,cols:n,gap:r,cellEditors:i}){let[a]=ht(),[o,s]=(0,G.useState)(n);pF(i,e),(0,G.useEffect)(()=>a.registerUpdateListener(({editorState:t})=>{t.read(()=>{let t=Dn(e);QP(t)&&s(t.getCols())})}),[a,e]),(0,G.useEffect)(()=>{if(t)return lke({cellEditors:i,clearAutoFocusIntent:()=>{a.update(()=>{let t=Dn(e);OF(t)&&t.setShouldAutoFocusOnMount(!1)},{discrete:!0})}})},[t,i,a,e]);let c=(0,G.useCallback)(t=>{a.update(()=>{let n=Dn(e);QP(n)&&n.setCols(t)})},[a,e]),l=(0,G.useCallback)(()=>{a.update(()=>{let t=Dn(e);QP(t)&&t.addCells(t.getCols())})},[a,e]),u=(0,G.useCallback)(()=>{a.update(()=>{let t=Dn(e);if(!OF(t))return;let n=t.getCols(),r=t.getCellEditors();r.length<=n||r.slice(-n).every(e=>e.getEditorState().read(()=>Sr().getTextContentSize()===0))&&t.removeCells(n)})},[a,e]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{"aria-label":`Grid`,className:Fj(_P.toolbar,vP.toolbar),role:`toolbar`,onMouseDown:e=>e.preventDefault(),children:[(0,K.jsx)(`span`,{className:Fj(_P.toolbarIcon,vP.toolbarIcon),children:(0,K.jsx)(Lr,{size:16})}),uke.map(e=>(0,K.jsx)(TF,{label:`${e} columns`,pressed:e===o,className:Fj(_P.colButton,vP.colButton,e===o&&_P.colButtonActive,e===o&&vP.colButtonActive),onClick:()=>c(e),children:e},e)),(0,K.jsx)(`div`,{className:Fj(_P.toolbarDivider,vP.toolbarDivider)}),(0,K.jsx)(TF,{className:Fj(_P.actionButton,vP.actionButton),label:`Add row`,onClick:l,children:(0,K.jsx)(zr,{size:16})}),(0,K.jsx)(TF,{className:Fj(_P.actionButton,vP.actionButton),label:`Remove last row`,onClick:u,children:(0,K.jsx)(T,{size:16})})]}),(0,K.jsx)(`div`,{className:Fj(_P.inner,vP.inner),style:{gridTemplateColumns:`repeat(${o}, 1fr)`,gap:r},children:i.map((e,t)=>(0,K.jsx)(`div`,{className:Fj(_P.cell,vP.cell),children:(0,K.jsxs)(pA,{initialEditor:e,children:[(0,K.jsx)(Yt,{ErrorBoundary:Nt,contentEditable:(0,K.jsx)(Ee,{"aria-placeholder":``,className:Fj(_P.cellEditable,vP.cellEditable),placeholder:(0,K.jsx)(`span`,{style:{display:`none`}})})}),(0,K.jsx)(fF,{})]})},t))})]})}function EF(){return mF(`GridCell`)}var DF=class e extends ZP{static clone(t){let n=new e(t.__cols,t.__gap,t.__cellStates,t.__key,{autoFocusOnMount:t.__autoFocusOnMount});return n.__cellEditors=[...t.__cellEditors],n}constructor(e=2,t,n,r,i){super(e,t,n,r),tA(this,`__cellEditors`,void 0),tA(this,`__autoFocusOnMount`,void 0),this.__autoFocusOnMount=i?.autoFocusOnMount??!1,this.__cellEditors=this.__cellStates.map(e=>{let t=EF(),n=t.parseEditorState(e);return t.setEditorState(n),t})}getCellEditors(){return this.getLatest().__cellEditors}getShouldAutoFocusOnMount(){return this.getLatest().__autoFocusOnMount}setShouldAutoFocusOnMount(e){let t=this.getWritable();t.__autoFocusOnMount=e}setCols(e){let t=this.getWritable(),n=t.__cellEditors.length;if(t.__cols=e,e>n)for(let r=n;r<e;r++){let e=EF();t.__cellEditors.push(e),t.__cellStates.push({root:{children:[{type:`paragraph`,children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,version:1}],direction:null,format:``,indent:0,type:`root`,version:1}})}}addCells(e){let t=this.getWritable();for(let n=0;n<e;n++){let e=EF();t.__cellEditors.push(e),t.__cellStates.push({root:{children:[{type:`paragraph`,children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,version:1}],direction:null,format:``,indent:0,type:`root`,version:1}})}}removeCells(e){let t=this.getWritable(),n=t.__cellEditors,r=t.__cellStates,i=Math.min(e,n.length);for(let e=0;e<i;e++){let e=n.at(-1);if(!e||!e.getEditorState().read(()=>Sr().getTextContentSize()===0))break;n.pop(),r.pop()}}static importJSON(t){let n=t,r=n.cols||2,i=n.gap,a=typeof i==`number`?`${i}px`:i;if(n.cells&&n.cells.length>0)return new e(r,a,n.cells).updateFromJSON(t);if(n.children){let i=n.children.map(e=>({root:{children:[e],direction:null,format:``,indent:0,type:`root`,version:1}}));return new e(r,a,i).updateFromJSON(t)}return new e(r,a).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`grid-container`,cols:this.__cols,gap:this.__gap,cells:this.__cellEditors.map(e=>e.getEditorState().toJSON()),version:1}}decorate(e,t){return(0,G.createElement)(dke,{nodeKey:this.__key,cols:this.__cols,gap:this.__gap,cellEditors:this.__cellEditors,autoFocusOnMount:this.__autoFocusOnMount})}};tA(DF,`slashMenuItems`,[{title:`Grid`,icon:(0,G.createElement)(Lr,{size:20}),description:`Grid layout container`,keywords:[`grid`,`columns`,`layout`],nested:!1,section:`LAYOUT`,onSelect:e=>{e.update(()=>{Un([fke(2,void 0,{autoFocusOnMount:!0})])})}}]);function fke(e=2,t,n){return new DF(e,t,void 0,void 0,n)}function OF(e){return e instanceof DF}var pke=[cP,eP,ZN,JN,UN,hF,wF,CN,oke,iF,qP,$P,HP,GP,DF,xF,nP,tF,dP],kF=[...oF,...pke],AF=null;function mke(e){AF=e}function jF(){return AF??kF}var hke=[`/favicon.ico`,`/favicon.png`,`/favicon.svg`,`/apple-touch-icon.png`,`/apple-touch-icon-precomposed.png`],MF=new Map;function NF(e){try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`?null:t.hostname}catch{return null}}function gke(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(e),n.onerror=()=>t(null),n.src=e})}async function PF(e){let t=MF.get(e);if(t!==void 0)return t;for(let t of hke){let n=await gke(`https://${e}${t}`);if(n)return MF.set(e,n),n}return MF.set(e,null),null}var FF=()=>({children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,type:`paragraph`,version:1}),_ke=new Set([`root`,`quote`]);function IF(e){return typeof e==`object`&&!!e}function LF(e){return!IF(e)||e.type!==`text`||typeof e.text!=`string`?!1:e.text.trim()===``&&/[\n\r]/.test(e.text)}function vke(e){let t=0,n=e.length;for(;t<n&&LF(e[t]);)t+=1;for(;n>t&&LF(e[n-1]);)--n;return t===0&&n===e.length?e:e.slice(t,n)}function RF(e){if(!IF(e)||!Array.isArray(e.children))return e;let t=!1,n=e.children.map(e=>{let n=RF(e);return n!==e&&(t=!0),n});if(_ke.has(String(e.type))){let e=vke(n);e!==n&&(t=!0,n=e)}return t?{...e,children:n}:e}function zF(e){let t=e?.root,n=Array.isArray(t?.children)?[...t.children]:[];if(t?.type===`root`&&n.length>0){let n=RF(t);return n===t?e:{...e,root:n}}return e?{...e,root:RF({...t,children:n.length>0?n:[FF()],direction:t?.direction??null,format:typeof t?.format==`string`?t.format:``,indent:typeof t?.indent==`number`?t.indent:0,type:`root`,version:typeof t?.version==`number`?t.version:1})}:{root:{children:[FF()],direction:null,format:``,indent:0,type:`root`,version:1}}}var BF=(0,G.createContext)(null);function yke({children:e}){let[t]=ht(),[n,r]=(0,G.useState)(t),i=(0,G.useRef)(n);i.current=n;let a=(0,G.useRef)({undo:!1,redo:!1});(0,G.useEffect)(()=>{let e=(e,n)=>t.registerCommand(e,(r,o)=>{if(o!==t)return!1;a.current[n]=r;let s=i.current;return s&&s!==t&&s.dispatchCommand(e,r),!1},1),n=[e(Ke,`undo`),e(sn,`redo`)];return()=>n.forEach(e=>e())},[t]),(0,G.useEffect)(()=>{n&&n!==t&&(n.dispatchCommand(Ke,a.current.undo),n.dispatchCommand(sn,a.current.redo))},[n,t]);let[o,s]=(0,G.useState)(()=>new Map),[c,l]=(0,G.useState)(()=>new Map),u=(0,G.useCallback)((e,t,n)=>(s(r=>new Map(r).set(e,{surface:t,priority:n})),()=>s(t=>{let n=new Map(t);return n.delete(e),n})),[]),d=(0,G.useCallback)((e,t)=>(l(n=>new Map(n).set(e,t)),()=>l(t=>{let n=new Map(t);return n.delete(e),n})),[]),f=(0,G.useMemo)(()=>{let e;for(let t of o.values())(!e||t.priority>=e.priority)&&(e=t);return e?.surface??null},[o]),[p,m]=(0,G.useState)(0),h=(0,G.useRef)(0),g=(0,G.useRef)(null),_=p>0?g.current:f,v=(0,G.useRef)(_);v.current=_;let y=(0,G.useCallback)(()=>{h.current++===0&&(g.current=v.current),m(h.current);let e=!1;return()=>{e||(e=!0,m(--h.current))}},[]),b=(0,G.useMemo)(()=>[...c].map(([e,t])=>(0,K.jsx)(G.Fragment,{children:t},e)),[c]);(0,G.useLayoutEffect)(()=>r(_?null:t),[t,_]);let x=(0,G.useMemo)(()=>({surface:_,activeEditor:n,setActiveEditor:r,plugins:b,registerSurface:u,registerPlugins:d,retainSurface:y}),[_,n,b,u,d,y]);return(0,K.jsx)(BF,{value:x,children:e})}function VF(){let e=(0,G.use)(BF);if(!e)throw Error(`Editor surface extensions must be mounted inside RichEditor`);return e}function HF({surface:e,priority:t=0}){let n=(0,G.useId)(),{registerSurface:r}=VF();return(0,G.useLayoutEffect)(()=>r(n,e,t),[n,t,r,e]),null}function UF({children:e}){let t=(0,G.useId)(),{registerPlugins:n}=VF(),[r]=(0,G.useState)(()=>bke(e));return(0,G.useLayoutEffect)(()=>n(t,(0,K.jsx)(xke,{slot:r})),[t,n,r]),(0,G.useLayoutEffect)(()=>r.set(e),[e,r]),null}function bke(e){let t=e,n=new Set;return{get:()=>t,set:e=>{e!==t&&(t=e,n.forEach(e=>e()))},subscribe:e=>(n.add(e),()=>n.delete(e))}}function xke({slot:e}){return(0,G.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Ske(){return VF().activeEditor}function WF({children:e}){let[t,n]=ht(),r=Ske(),i=(0,G.useMemo)(()=>[r??t,n],[r,n,t]);return(0,K.jsx)(Dr,{value:i,children:e})}var Cke=(0,G.lazy)(()=>r(()=>import(`./VirtualizedEditor-uWe43zaI-BlOdeG0b.js`).then(e=>({default:e.VirtualizedEditor})),__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]),import.meta.url));function wke({scrollContainer:e,overscan:t,estimateBlockHeight:n,preserveCapacity:r,selectionMergeLimit:i,priority:a=0}){let o=(0,G.useMemo)(()=>{let a={scrollContainer:e,overscan:t,estimateBlockHeight:n,preserveCapacity:r,selectionMergeLimit:i};return function(e){return(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(`p`,{role:`status`,children:`Loading editor…`}),children:(0,K.jsx)(Cke,{...e,options:a})})}},[e,t,n,r,i]);return(0,K.jsx)(HF,{priority:a,surface:o})}function Tke({disableTakeFocusOnClick:e=!1}){let[t]=ht();return(0,G.useEffect)(()=>rte(t,{disableTakeFocusOnClick:e}),[t,e]),null}function Eke({maxIndent:e,$canIndent:t}){let[n]=ht();return(0,G.useEffect)(()=>mOe(n,e,t),[n,e,t]),null}function GF(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function KF(e){let t=GF(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var qF=/[!-/:-@[-`{-~\s]/,JF=/\s/,YF=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Dke=/^\s{0,3}$/;function XF(e){if(!yr(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&it(t)&&Dke.test(t.getTextContent())}function ZF(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function QF(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function $F(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r<e.length;)if(e[r]==="`"){let t=1;for(;r+t<e.length&&e[r+t]==="`";)t++;n.push({index:r,length:t}),r+=t}else r++;let i=[],a=0;for(;a<n.length;){let r=n[a];if(t(r.index)){a++;continue}let o=-1;for(let e=a+1;e<n.length;e++)if(n[e].length===r.length){o=e;break}if(o===-1){a++;continue}let s=n[o],c=e.slice(r.index+r.length,s.index);c.length>=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function eI(e,t,n,r,i){if(!tI(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!tI(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&YF.test(e)}return!0}function tI(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!JF.test(o)&&(!YF.test(o)||s===void 0||JF.test(s)||YF.test(s))}var nI=/^(\s*)(\d{1,})\.\s/,rI=/^(\s*)[-*+]\s/,iI=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,aI=/^(#{1,6})\s/,oI=/^>\s/,sI=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,cI=/^[ \t]*`{3,}$/,Oke=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,kke=/^(?:\|)(.+)(?:\|)\s?$/;function Ake(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n<t;){let t=n;for(e[t]===` `&&t++,e[t]===`:`&&t++;e[t]===`-`;)t++;if(e[t]===`:`&&t++,e[t]===` `&&t++,e[t]!==`|`)break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var lI=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,uI=/^<\/[a-z_][\w-]*\s*>/i,dI=e=>RegExp(`(?:${e.source})$`,e.flags),fI=Ft(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),pI=Ft(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),mI=Ft(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),jke=Ft(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function hI(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function gI(e){let t=ve(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!it(r))return null;let i=r.getTextContent(),a=hI(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(lr(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&kn(t,jke,n),t}function _I(e){return Er(e)}function vI(e,t){let n=0;for(;n<t&&(e[n]===` `||e[n]===` `);)n++;return e.slice(n)}function Mke(e,t){let n=e.getLastChild();t&&EP(n)&&kn(n,mI,t)}var yI=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function bI(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var xI=null,SI=!1,CI=e=>(t,n,r,i)=>{if(_r(t)||!i&&_I(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=ir(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==fI.parse(c)?void 0:c,u=xI,d=a;if(u!==null){if(SI)for(;d!==null&&XF(d);)d=d.getPreviousSibling();nr(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=bI(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(nr(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(nr(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=Zt(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!nr(r)||r.getListType()===t)return;let i=r.getParent();if(!cr(i))return;let a=Zt(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=ir();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&nr(p)&&kn(p,fI,l),u!==null&&function(e,t,n,r){for(let n=e.length;n<t;n++)e[n]=4*(n+1);e.length=t,e[t]=function(e,t){let n=e[0];if(t===`check`){let t=n.slice(e[1].length).match(/^[-*+]\s/);t&&(n=e[1]+t[0])}return Math.min(bI(n),bI(e[1])+4)}(n,r)}(u,f,r,e)},wI=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(cr(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(nr(e)){let a=wI(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Hn(e,fI),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
172
+ `:``]},t))})})]})}function rke({nodeKey:e,code:t,language:n}){let[r]=ht(),[i]=vF(e),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(`start`),l=r.isEditable();(0,G.useEffect)(()=>{if(!l||!i){o(!1);return}let t=!1,n=`start`;r.getEditorState().read(()=>{let r=kr(),i=Ue(r)?r.getNodes():null;t=i!==null&&i.length===1&&i[0]?.getKey()===e,t&&(n=$Oe(e)??`start`)}),o(t),t&&c(n)},[l,r,i,e]),(0,G.useEffect)(()=>{if(l&&i)return r.registerCommand(br,t=>(t.key.length!==1||t.metaKey||t.ctrlKey||t.altKey||t.isComposing||!r.getEditorState().read(()=>{let t=kr();if(!Ue(t))return!1;let n=t.getNodes();return n.length===1&&n[0]?.getKey()===e})||r.getElementByKey(e)?.querySelector(`[contenteditable="true"]`)?.focus(),!1),3)},[l,r,i,e]);let u=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);BP(n)&&n.setCode(t)})},[r,e]),d=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);BP(n)&&n.setLanguage(t)})},[r,e]),f=(0,G.useCallback)(()=>{r.getRootElement()?.focus({preventScroll:!0}),r.update(()=>{let t=Dn(e);if(!t)return;let n=t.getPreviousSibling(),r=t.getNextSibling(),i=t.getParent();if(t.remove(),n){if(rr(n))n.selectEnd();else{je(n)&&n.getType()===`code-block`&&bF(n.getKey(),`end`);let e=sr();e.add(n.getKey()),Jt(e)}}else if(r){if(rr(r))r.selectStart();else{je(r)&&r.getType()===`code-block`&&bF(r.getKey(),`start`);let e=sr();e.add(r.getKey()),Jt(e)}}else if(i){let e=on();i.append(e),e.selectStart()}})},[r,e]),p=(0,G.useCallback)(t=>{r.getRootElement()?.focus({preventScroll:!0}),r.update(()=>{let n=Dn(e);if(!n)return;if(t===`before`){let e=n.getPreviousSibling();if(!e)return;if(rr(e))e.selectEnd();else{je(e)&&e.getType()===`code-block`&&bF(e.getKey(),`end`);let t=sr();t.add(e.getKey()),Jt(t)}return}let r=n.getNextSibling();if(!r){let e=on();n.insertAfter(e),r=e}if(rr(r))r.selectStart();else{je(r)&&r.getType()===`code-block`&&bF(r.getKey(),`start`);let e=sr();e.add(r.getKey()),Jt(e)}})},[r,e]);return(0,K.jsx)(Kj,{defaultRenderer:nke,rendererKey:zj,props:{code:t,language:n,editable:l,onCodeChange:l?u:void 0,onLanguageChange:l?d:void 0,onDelete:l?f:void 0,onExitBlock:l?p:void 0,selected:l?a:!1,cursorPlacement:l?s:`start`}})}var CF,wF=class e extends RP{static clone(t){return new e(t.__code,t.__language,t.__key)}static importJSON(t){let n=t;return new e(n.code,n.language).updateFromJSON(t)}decorate(e,t){return(0,G.createElement)(rke,{nodeKey:this.__key,code:this.__code,language:this.__language})}};CF=wF,tA(wF,`commandItems`,RP.commandItems.map(e=>({...e,onSelect:e=>{e.update(()=>{Un([new CF(``,`text`)])})}})));function ike(e,t){return new wF(e,t)}function ake({definitions:e}){let[t]=ht(),{displayNumberMap:n}=Xj(),r=Object.entries(e).sort(([e],[t])=>(n[e]??0)-(n[t]??0)),i=(0,G.useCallback)((e,n)=>{t.update(()=>{let t=xn(YP);t.length>0&&t[0].setDefinition(e,n)})},[t]),a=(0,G.useCallback)(e=>{t.update(()=>{let t=xn(YP);t.length>0&&t[0].removeDefinition(e)})},[t]);return r.length===0?null:(0,K.jsxs)(`div`,{role:`doc-endnotes`,className:Fj(`rich-footnote-section-content`,`rich-footnote-section-edit`,Nj.footnoteSection,Pj.footnoteSection),children:[(0,K.jsx)(`hr`,{className:Fj(Nj.footnoteSectionDivider,Pj.footnoteSectionDivider)}),(0,K.jsx)(`ol`,{className:Fj(Nj.footnoteSectionList,Pj.footnoteSectionList),children:r.map(([e,t])=>{let r=n[e]??e;return(0,K.jsxs)(`li`,{id:`footnote-${e}`,className:Fj(Nj.footnoteSectionItem,Pj.footnoteSectionItem,Nj.footnoteSectionItemEdit,Pj.footnoteSectionItemEdit),children:[(0,K.jsxs)(`span`,{className:Fj(Nj.footnoteSectionItemNum,Pj.footnoteSectionItemNum),children:[r,`.`]}),(0,K.jsx)(`input`,{placeholder:`Footnote content for [^${e}]`,type:`text`,value:t,className:Fj(Nj.footnoteSectionItemInput,Pj.footnoteSectionItemInput),onChange:t=>i(e,t.target.value)}),(0,K.jsx)(`button`,{"aria-label":`Remove footnote ${e}`,type:`button`,className:Fj(Nj.footnoteSectionItemRemove,Pj.footnoteSectionItemRemove),onClick:()=>a(e),children:`×`})]},e)})})]})}var oke=class e extends YP{static getType(){return`footnote-section`}static clone(t){return new e({...t.__definitions},t.__key)}static importJSON(t){return new e(t.definitions).updateFromJSON(t)}decorate(e,t){return(0,G.createElement)(ake,{definitions:this.__definitions,nodeKey:this.__key})}},ske=30;function cke(){let e=Sr().getFirstChild();rr(e)?e.selectStart():Sr().selectStart()}function lke({cellEditors:e,clearAutoFocusIntent:t,requestFrame:n=window.requestAnimationFrame.bind(window),cancelFrame:r=window.cancelAnimationFrame.bind(window),maxRootLookupAttempts:i=ske}){let a=!1,o=null,s=r=>{o=n(()=>{if(o=null,a)return;let n=e[0];n?!n.getRootElement()&&r<i?s(r+1):(t(),n.update(cke,{discrete:!0}),n.focus()):t()})};return s(0),()=>{a=!0,o!==null&&r(o)}}var uke=[1,2,3,4];function TF({children:e,className:t,label:n,pressed:r,onClick:i}){return(0,K.jsxs)(Mn,{children:[(0,K.jsx)(tt,{render:(0,K.jsx)(`button`,{"aria-label":n,"aria-pressed":r,className:t,type:`button`,onClick:i}),children:e}),(0,K.jsx)(Fn,{side:`top`,children:n})]})}function dke({nodeKey:e,autoFocusOnMount:t,cols:n,gap:r,cellEditors:i}){let[a]=ht(),[o,s]=(0,G.useState)(n);pF(i,e),(0,G.useEffect)(()=>a.registerUpdateListener(({editorState:t})=>{t.read(()=>{let t=Dn(e);QP(t)&&s(t.getCols())})}),[a,e]),(0,G.useEffect)(()=>{if(t)return lke({cellEditors:i,clearAutoFocusIntent:()=>{a.update(()=>{let t=Dn(e);OF(t)&&t.setShouldAutoFocusOnMount(!1)},{discrete:!0})}})},[t,i,a,e]);let c=(0,G.useCallback)(t=>{a.update(()=>{let n=Dn(e);QP(n)&&n.setCols(t)})},[a,e]),l=(0,G.useCallback)(()=>{a.update(()=>{let t=Dn(e);QP(t)&&t.addCells(t.getCols())})},[a,e]),u=(0,G.useCallback)(()=>{a.update(()=>{let t=Dn(e);if(!OF(t))return;let n=t.getCols(),r=t.getCellEditors();r.length<=n||r.slice(-n).every(e=>e.getEditorState().read(()=>Sr().getTextContentSize()===0))&&t.removeCells(n)})},[a,e]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{"aria-label":`Grid`,className:Fj(_P.toolbar,vP.toolbar),role:`toolbar`,onMouseDown:e=>e.preventDefault(),children:[(0,K.jsx)(`span`,{className:Fj(_P.toolbarIcon,vP.toolbarIcon),children:(0,K.jsx)(Lr,{size:16})}),uke.map(e=>(0,K.jsx)(TF,{label:`${e} columns`,pressed:e===o,className:Fj(_P.colButton,vP.colButton,e===o&&_P.colButtonActive,e===o&&vP.colButtonActive),onClick:()=>c(e),children:e},e)),(0,K.jsx)(`div`,{className:Fj(_P.toolbarDivider,vP.toolbarDivider)}),(0,K.jsx)(TF,{className:Fj(_P.actionButton,vP.actionButton),label:`Add row`,onClick:l,children:(0,K.jsx)(zr,{size:16})}),(0,K.jsx)(TF,{className:Fj(_P.actionButton,vP.actionButton),label:`Remove last row`,onClick:u,children:(0,K.jsx)(T,{size:16})})]}),(0,K.jsx)(`div`,{className:Fj(_P.inner,vP.inner),style:{gridTemplateColumns:`repeat(${o}, 1fr)`,gap:r},children:i.map((e,t)=>(0,K.jsx)(`div`,{className:Fj(_P.cell,vP.cell),children:(0,K.jsxs)(pA,{initialEditor:e,children:[(0,K.jsx)(Yt,{ErrorBoundary:Nt,contentEditable:(0,K.jsx)(Ee,{"aria-placeholder":``,className:Fj(_P.cellEditable,vP.cellEditable),placeholder:(0,K.jsx)(`span`,{style:{display:`none`}})})}),(0,K.jsx)(fF,{})]})},t))})]})}function EF(){return mF(`GridCell`)}var DF=class e extends ZP{static clone(t){let n=new e(t.__cols,t.__gap,t.__cellStates,t.__key,{autoFocusOnMount:t.__autoFocusOnMount});return n.__cellEditors=[...t.__cellEditors],n}constructor(e=2,t,n,r,i){super(e,t,n,r),tA(this,`__cellEditors`,void 0),tA(this,`__autoFocusOnMount`,void 0),this.__autoFocusOnMount=i?.autoFocusOnMount??!1,this.__cellEditors=this.__cellStates.map(e=>{let t=EF(),n=t.parseEditorState(e);return t.setEditorState(n),t})}getCellEditors(){return this.getLatest().__cellEditors}getShouldAutoFocusOnMount(){return this.getLatest().__autoFocusOnMount}setShouldAutoFocusOnMount(e){let t=this.getWritable();t.__autoFocusOnMount=e}setCols(e){let t=this.getWritable(),n=t.__cellEditors.length;if(t.__cols=e,e>n)for(let r=n;r<e;r++){let e=EF();t.__cellEditors.push(e),t.__cellStates.push({root:{children:[{type:`paragraph`,children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,version:1}],direction:null,format:``,indent:0,type:`root`,version:1}})}}addCells(e){let t=this.getWritable();for(let n=0;n<e;n++){let e=EF();t.__cellEditors.push(e),t.__cellStates.push({root:{children:[{type:`paragraph`,children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,version:1}],direction:null,format:``,indent:0,type:`root`,version:1}})}}removeCells(e){let t=this.getWritable(),n=t.__cellEditors,r=t.__cellStates,i=Math.min(e,n.length);for(let e=0;e<i;e++){let e=n.at(-1);if(!e||!e.getEditorState().read(()=>Sr().getTextContentSize()===0))break;n.pop(),r.pop()}}static importJSON(t){let n=t,r=n.cols||2,i=n.gap,a=typeof i==`number`?`${i}px`:i;if(n.cells&&n.cells.length>0)return new e(r,a,n.cells).updateFromJSON(t);if(n.children){let i=n.children.map(e=>({root:{children:[e],direction:null,format:``,indent:0,type:`root`,version:1}}));return new e(r,a,i).updateFromJSON(t)}return new e(r,a).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`grid-container`,cols:this.__cols,gap:this.__gap,cells:this.__cellEditors.map(e=>e.getEditorState().toJSON()),version:1}}decorate(e,t){return(0,G.createElement)(dke,{nodeKey:this.__key,cols:this.__cols,gap:this.__gap,cellEditors:this.__cellEditors,autoFocusOnMount:this.__autoFocusOnMount})}};tA(DF,`slashMenuItems`,[{title:`Grid`,icon:(0,G.createElement)(Lr,{size:20}),description:`Grid layout container`,keywords:[`grid`,`columns`,`layout`],nested:!1,section:`LAYOUT`,onSelect:e=>{e.update(()=>{Un([fke(2,void 0,{autoFocusOnMount:!0})])})}}]);function fke(e=2,t,n){return new DF(e,t,void 0,void 0,n)}function OF(e){return e instanceof DF}var pke=[cP,eP,ZN,JN,UN,hF,wF,CN,oke,iF,qP,$P,HP,GP,DF,xF,nP,tF,dP],kF=[...oF,...pke],AF=null;function mke(e){AF=e}function jF(){return AF??kF}var hke=[`/favicon.ico`,`/favicon.png`,`/favicon.svg`,`/apple-touch-icon.png`,`/apple-touch-icon-precomposed.png`],MF=new Map;function NF(e){try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`?null:t.hostname}catch{return null}}function gke(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(e),n.onerror=()=>t(null),n.src=e})}async function PF(e){let t=MF.get(e);if(t!==void 0)return t;for(let t of hke){let n=await gke(`https://${e}${t}`);if(n)return MF.set(e,n),n}return MF.set(e,null),null}var FF=()=>({children:[],direction:null,format:``,indent:0,textFormat:0,textStyle:``,type:`paragraph`,version:1}),_ke=new Set([`root`,`quote`]);function IF(e){return typeof e==`object`&&!!e}function LF(e){return!IF(e)||e.type!==`text`||typeof e.text!=`string`?!1:e.text.trim()===``&&/[\n\r]/.test(e.text)}function vke(e){let t=0,n=e.length;for(;t<n&&LF(e[t]);)t+=1;for(;n>t&&LF(e[n-1]);)--n;return t===0&&n===e.length?e:e.slice(t,n)}function RF(e){if(!IF(e)||!Array.isArray(e.children))return e;let t=!1,n=e.children.map(e=>{let n=RF(e);return n!==e&&(t=!0),n});if(_ke.has(String(e.type))){let e=vke(n);e!==n&&(t=!0,n=e)}return t?{...e,children:n}:e}function zF(e){let t=e?.root,n=Array.isArray(t?.children)?[...t.children]:[];if(t?.type===`root`&&n.length>0){let n=RF(t);return n===t?e:{...e,root:n}}return e?{...e,root:RF({...t,children:n.length>0?n:[FF()],direction:t?.direction??null,format:typeof t?.format==`string`?t.format:``,indent:typeof t?.indent==`number`?t.indent:0,type:`root`,version:typeof t?.version==`number`?t.version:1})}:{root:{children:[FF()],direction:null,format:``,indent:0,type:`root`,version:1}}}var BF=(0,G.createContext)(null);function yke({children:e}){let[t]=ht(),[n,r]=(0,G.useState)(t),i=(0,G.useRef)(n);i.current=n;let a=(0,G.useRef)({undo:!1,redo:!1});(0,G.useEffect)(()=>{let e=(e,n)=>t.registerCommand(e,(r,o)=>{if(o!==t)return!1;a.current[n]=r;let s=i.current;return s&&s!==t&&s.dispatchCommand(e,r),!1},1),n=[e(Ke,`undo`),e(sn,`redo`)];return()=>n.forEach(e=>e())},[t]),(0,G.useEffect)(()=>{n&&n!==t&&(n.dispatchCommand(Ke,a.current.undo),n.dispatchCommand(sn,a.current.redo))},[n,t]);let[o,s]=(0,G.useState)(()=>new Map),[c,l]=(0,G.useState)(()=>new Map),u=(0,G.useCallback)((e,t,n)=>(s(r=>new Map(r).set(e,{surface:t,priority:n})),()=>s(t=>{let n=new Map(t);return n.delete(e),n})),[]),d=(0,G.useCallback)((e,t)=>(l(n=>new Map(n).set(e,t)),()=>l(t=>{let n=new Map(t);return n.delete(e),n})),[]),f=(0,G.useMemo)(()=>{let e;for(let t of o.values())(!e||t.priority>=e.priority)&&(e=t);return e?.surface??null},[o]),[p,m]=(0,G.useState)(0),h=(0,G.useRef)(0),g=(0,G.useRef)(null),_=p>0?g.current:f,v=(0,G.useRef)(_);v.current=_;let y=(0,G.useCallback)(()=>{h.current++===0&&(g.current=v.current),m(h.current);let e=!1;return()=>{e||(e=!0,m(--h.current))}},[]),b=(0,G.useMemo)(()=>[...c].map(([e,t])=>(0,K.jsx)(G.Fragment,{children:t},e)),[c]);(0,G.useLayoutEffect)(()=>r(_?null:t),[t,_]);let x=(0,G.useMemo)(()=>({surface:_,activeEditor:n,setActiveEditor:r,plugins:b,registerSurface:u,registerPlugins:d,retainSurface:y}),[_,n,b,u,d,y]);return(0,K.jsx)(BF,{value:x,children:e})}function VF(){let e=(0,G.use)(BF);if(!e)throw Error(`Editor surface extensions must be mounted inside RichEditor`);return e}function HF({surface:e,priority:t=0}){let n=(0,G.useId)(),{registerSurface:r}=VF();return(0,G.useLayoutEffect)(()=>r(n,e,t),[n,t,r,e]),null}function UF({children:e}){let t=(0,G.useId)(),{registerPlugins:n}=VF(),[r]=(0,G.useState)(()=>bke(e));return(0,G.useLayoutEffect)(()=>n(t,(0,K.jsx)(xke,{slot:r})),[t,n,r]),(0,G.useLayoutEffect)(()=>r.set(e),[e,r]),null}function bke(e){let t=e,n=new Set;return{get:()=>t,set:e=>{e!==t&&(t=e,n.forEach(e=>e()))},subscribe:e=>(n.add(e),()=>n.delete(e))}}function xke({slot:e}){return(0,G.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Ske(){return VF().activeEditor}function WF({children:e}){let[t,n]=ht(),r=Ske(),i=(0,G.useMemo)(()=>[r??t,n],[r,n,t]);return(0,K.jsx)(Dr,{value:i,children:e})}var Cke=(0,G.lazy)(()=>r(()=>import(`./VirtualizedEditor-uWe43zaI-Ygx3kFhs.js`).then(e=>({default:e.VirtualizedEditor})),__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]),import.meta.url));function wke({scrollContainer:e,overscan:t,estimateBlockHeight:n,preserveCapacity:r,selectionMergeLimit:i,priority:a=0}){let o=(0,G.useMemo)(()=>{let a={scrollContainer:e,overscan:t,estimateBlockHeight:n,preserveCapacity:r,selectionMergeLimit:i};return function(e){return(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(`p`,{role:`status`,children:`Loading editor…`}),children:(0,K.jsx)(Cke,{...e,options:a})})}},[e,t,n,r,i]);return(0,K.jsx)(HF,{priority:a,surface:o})}function Tke({disableTakeFocusOnClick:e=!1}){let[t]=ht();return(0,G.useEffect)(()=>rte(t,{disableTakeFocusOnClick:e}),[t,e]),null}function Eke({maxIndent:e,$canIndent:t}){let[n]=ht();return(0,G.useEffect)(()=>mOe(n,e,t),[n,e,t]),null}function GF(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function KF(e){let t=GF(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var qF=/[!-/:-@[-`{-~\s]/,JF=/\s/,YF=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Dke=/^\s{0,3}$/;function XF(e){if(!yr(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&it(t)&&Dke.test(t.getTextContent())}function ZF(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function QF(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function $F(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r<e.length;)if(e[r]==="`"){let t=1;for(;r+t<e.length&&e[r+t]==="`";)t++;n.push({index:r,length:t}),r+=t}else r++;let i=[],a=0;for(;a<n.length;){let r=n[a];if(t(r.index)){a++;continue}let o=-1;for(let e=a+1;e<n.length;e++)if(n[e].length===r.length){o=e;break}if(o===-1){a++;continue}let s=n[o],c=e.slice(r.index+r.length,s.index);c.length>=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function eI(e,t,n,r,i){if(!tI(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!tI(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&YF.test(e)}return!0}function tI(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!JF.test(o)&&(!YF.test(o)||s===void 0||JF.test(s)||YF.test(s))}var nI=/^(\s*)(\d{1,})\.\s/,rI=/^(\s*)[-*+]\s/,iI=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,aI=/^(#{1,6})\s/,oI=/^>\s/,sI=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,cI=/^[ \t]*`{3,}$/,Oke=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,kke=/^(?:\|)(.+)(?:\|)\s?$/;function Ake(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n<t;){let t=n;for(e[t]===` `&&t++,e[t]===`:`&&t++;e[t]===`-`;)t++;if(e[t]===`:`&&t++,e[t]===` `&&t++,e[t]!==`|`)break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var lI=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,uI=/^<\/[a-z_][\w-]*\s*>/i,dI=e=>RegExp(`(?:${e.source})$`,e.flags),fI=Ft(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),pI=Ft(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),mI=Ft(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),jke=Ft(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function hI(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function gI(e){let t=ve(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!it(r))return null;let i=r.getTextContent(),a=hI(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(lr(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&kn(t,jke,n),t}function _I(e){return Er(e)}function vI(e,t){let n=0;for(;n<t&&(e[n]===` `||e[n]===` `);)n++;return e.slice(n)}function Mke(e,t){let n=e.getLastChild();t&&EP(n)&&kn(n,mI,t)}var yI=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function bI(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var xI=null,SI=!1,CI=e=>(t,n,r,i)=>{if(_r(t)||!i&&_I(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=ir(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==fI.parse(c)?void 0:c,u=xI,d=a;if(u!==null){if(SI)for(;d!==null&&XF(d);)d=d.getPreviousSibling();nr(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=bI(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(nr(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(nr(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=Zt(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!nr(r)||r.getListType()===t)return;let i=r.getParent();if(!cr(i))return;let a=Zt(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=ir();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&nr(p)&&kn(p,fI,l),u!==null&&function(e,t,n,r){for(let n=e.length;n<t;n++)e[n]=4*(n+1);e.length=t,e[t]=function(e,t){let n=e[0];if(t===`check`){let t=n.slice(e[1].length).match(/^[-*+]\s/);t&&(n=e[1]+t[0])}return Math.min(bI(n),bI(e[1])+4)}(n,r)}(u,f,r,e)},wI=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(cr(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(nr(e)){let a=wI(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Hn(e,fI),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
173
173
  `)},Nke=yI(e=>{let t=`h`+e[1].length;return ae(t)}),Pke={dependencies:[$t],export:(e,t)=>{if(!_r(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:aI,replace:(e,t,n,r)=>!(!r&&_I(e))&&Nke(e,t,n,r),triggerOnEnter:!0,type:`element`},TI={dependencies:[mr],export:(e,t)=>{if(!Er(e))return null;let n=t(e).split(`
174
174
  `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
175
175
  `)},regExp:oI,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(Er(n))return n.splice(n.getChildrenSize(),0,[gI(n),...t]),void e.remove()}let i=xr();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},EI={dependencies:[wP],export:e=>{if(!EP(e))return null;let t=e.getTextContent(),n=Hn(e,pI);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?Hn(e,mI):``;return n+r+(i?` `+i:``)+(t?`
@@ -195,7 +195,7 @@ but found: '${Qb(Jb)}'`);(Hb[Gb[Jb]]&zb)!==0;)Jb++;return Wb.slice(Kb[e],qb[Jb-1
195
195
  `)}static importJSON(t){return new e(fU(t.steps)).updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:`steps`,steps:this.__steps,version:1}}decorate(e,t){return qj(YLe,KLe,{steps:this.__steps})}},gU={titleRow:`rich-steps-edit-title-row`,titleInput:`rich-steps-edit-title-input`,actions:`rich-steps-edit-actions`,action:`rich-steps-edit-action`,editable:`rich-steps-edit-content`},QLe=`_4rdxj50`,$Le=`_4rdxj51`,eRe=`_4rdxj52`,_U=`_4rdxj53`,vU=[`keydown`,`keyup`,`beforeinput`,`input`,`compositionstart`,`compositionend`,`paste`,`cut`,`copy`];function tRe({value:e,autoFocus:t,onValueChange:n,onEnter:r}){let[i,a]=(0,G.useState)(e),o=(0,G.useRef)(!1),s=(0,G.useRef)(null);return(0,G.useEffect)(()=>{let e=s.current;if(e){for(let t of vU)e.addEventListener(t,Ie);return()=>{for(let t of vU)e.removeEventListener(t,Ie)}}},[]),(0,G.useEffect)(()=>{o.current||a(e)},[e]),(0,K.jsx)(`input`,{"aria-label":`Step title`,autoFocus:t,className:`${$Le} ${gU.titleInput}`,placeholder:`Step title`,ref:s,value:i,onChange:e=>{a(e.target.value),o.current||n(e.target.value)},onCompositionEnd:e=>{o.current=!1,n(e.currentTarget.value)},onCompositionStart:()=>{o.current=!0},onKeyDown:e=>{let t=o.current||e.nativeEvent.isComposing||e.keyCode===229;e.key===`Enter`&&!t&&(e.preventDefault(),r())}})}function nRe({nodeKey:e,steps:t,stepEditors:n}){let[r]=ht(),[i,a]=(0,G.useState)(null);pF(n,e);let o=(0,G.useCallback)(t=>{r.update(()=>{let n=Dn(e);xU(n)&&t(n)})},[r,e]),s=(0,G.useCallback)(t=>{let n=null;r.update(()=>{let r=Dn(e);xU(r)&&(n=r.addStepAfter(t).id)},{discrete:!0}),a(n)},[r,e]);return(0,K.jsx)(`ol`,{className:`${rU} ${nU.root}`,children:t.map((e,r)=>{let a=n[r];return(0,K.jsxs)(`li`,{className:`${iU} ${nU.item}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`${aU} ${nU.marker}`,children:r+1}),(0,K.jsxs)(`div`,{className:`${QLe} ${gU.titleRow}`,children:[(0,K.jsx)(tRe,{autoFocus:i===e.id,value:e.title,onEnter:()=>a?.focus(),onValueChange:t=>o(n=>n.setStepTitle(e.id,t))}),(0,K.jsxs)(`div`,{className:`${eRe} ${gU.actions}`,onMouseDown:e=>e.preventDefault(),children:[(0,K.jsx)(`button`,{"aria-label":`Move step up`,className:_U,disabled:r===0,type:`button`,onClick:()=>o(t=>t.moveStep(e.id,-1)),children:(0,K.jsx)(Nte,{size:14})}),(0,K.jsx)(`button`,{"aria-label":`Move step down`,className:_U,disabled:r===t.length-1,type:`button`,onClick:()=>o(t=>t.moveStep(e.id,1)),children:(0,K.jsx)(Mte,{size:14})}),(0,K.jsx)(`button`,{"aria-label":`Add step below`,className:_U,type:`button`,onClick:()=>s(e.id),children:(0,K.jsx)(zr,{size:14})}),(0,K.jsx)(`button`,{"aria-label":`Delete step`,className:_U,type:`button`,onClick:()=>o(t=>t.removeStep(e.id)),children:(0,K.jsx)(Mr,{size:14})})]})]}),a&&(0,K.jsx)(`div`,{className:`_1m3xa5x4 ${nU.content}`,children:(0,K.jsxs)(pA,{initialEditor:a,children:[(0,K.jsx)(Yt,{ErrorBoundary:Nt,contentEditable:(0,K.jsx)(Ee,{"aria-placeholder":``,className:`_4rdxj54 ${gU.editable}`,placeholder:(0,K.jsx)(`span`,{style:{display:`none`}})})}),(0,K.jsx)(fF,{})]})})]},e.id)})})}function yU(e){let t=mF(`StepContent`);return t.setEditorState(t.parseEditorState(e.content)),t}var bU=class e extends hU{static clone(t){return new e(t.__steps,t.__key,t.__stepEditors)}constructor(e,t,n){super(e?.length?e:void 0,t),mU(this,`__stepEditors`,void 0),this.__stepEditors=n??this.__steps.map(yU)}getStepEditors(){return this.getLatest().__stepEditors}setSteps(e){let t=this.getWritable(),n=e.length?e:[dU()],r=new Map(t.__steps.map((e,n)=>[e.id,t.__stepEditors[n]]));t.__steps=n,t.__stepEditors=n.map(e=>r.get(e.id)??yU(e))}setStepTitle(e,t){let n=this.getWritable();n.__steps=n.__steps.map(n=>n.id===e?{...n,title:t}:n)}addStepAfter(e){let t=this.getWritable(),n=t.__steps.findIndex(t=>t.id===e),r=n===-1?t.__steps.length:n+1,i=dU();return t.__steps=[...t.__steps.slice(0,r),i,...t.__steps.slice(r)],t.__stepEditors=[...t.__stepEditors.slice(0,r),yU(i),...t.__stepEditors.slice(r)],i}removeStep(e){let t=this.getWritable(),n=t.__steps.findIndex(t=>t.id===e);if(n!==-1){if(t.__steps.length===1){let e=dU();t.__steps=[e],t.__stepEditors=[yU(e)]}else t.__steps=t.__steps.filter((e,t)=>t!==n),t.__stepEditors=t.__stepEditors.filter((e,t)=>t!==n)}}moveStep(e,t){let n=this.getLatest().__steps.findIndex(t=>t.id===e),r=n+t;if(n===-1||r<0||r>=this.getLatest().__steps.length)return;let i=this.getWritable(),a=[...i.__steps],o=[...i.__stepEditors];[a[n],a[r]]=[a[r],a[n]],[o[n],o[r]]=[o[r],o[n]],i.__steps=a,i.__stepEditors=o}static importJSON(t){return new e(fU(t.steps)).updateFromJSON(t)}exportJSON(){let e=this.__stepEditors;return{...super.exportJSON(),steps:this.__steps.map((t,n)=>({...t,content:e[n]?.getEditorState().toJSON()??t.content}))}}decorate(e,t){return(0,G.createElement)(nRe,{nodeKey:this.__key,steps:this.__steps,stepEditors:this.__stepEditors})}};mU(bU,`commandItems`,[{title:`Steps`,icon:(0,G.createElement)(bee,{size:20}),description:`Numbered steps with a title and content each`,keywords:[`steps`,`step`,`tutorial`,`guide`,`howto`],nested:!1,section:`LAYOUT`,placement:[`slash`,`toolbar`],group:`insert`,onSelect:e=>{e.update(()=>{Un([rRe()])})}}]);function rRe(e){return new bU(e)}function xU(e){return e instanceof bU}var iRe=[bU],SU=Object.defineProperty,CU=(e,t)=>{let n={};for(var r in e)SU(n,r,{get:e[r],enumerable:!0});return t||SU(n,Symbol.toStringTag,{value:`Module`}),n},aRe=`Whiteboard`,oRe=`_1xd3mo40`,wU=`_1xd3mo41`,sRe=`_1xd3mo42`,cRe=`_1xd3mo43`,lRe=`_1xd3mo44`,uRe=`_1xd3mo46`,dRe=`_1xd3mo47`,fRe=`_1xd3mo48`,pRe=`_1xd3mo49`,mRe=`_1xd3mo4b`,hRe=`_1xd3mo4h`,gRe=`_1xd3mo4i`,_Re=`_1xd3mo4j`,vRe=`_1xd3mo4l`,yRe=`_1xd3mo4q`,bRe=`_1xd3mo4r`,xRe=/^(?:\.{1,2}\/)?[\w-][\w./-]*\.excalidraw$/;function TU(e){return xRe.test(e)}function EU(e){if(!e||!e.trim())return null;try{let t=JSON.parse(e);if(t&&typeof t==`object`)return{type:`inline`,data:t}}catch{}let t=e.split(`
196
196
  `),n=t[0].trim();if(!n.startsWith(`http`)&&!n.startsWith(`blob:`)&&!n.startsWith(`ref:`)&&!TU(n))return null;let r=t.slice(1).join(`
197
197
  `).trim();if(r)try{let e=JSON.parse(r);if(e&&typeof e==`object`)return{type:`delta`,baseUrl:n,delta:e}}catch{}return{type:`remote`,url:n}}function SRe(e){switch(e.type){case`inline`:return JSON.stringify(e.data);case`remote`:return e.url;case`delta`:return[e.baseUrl,JSON.stringify(e.delta)].join(`
198
- `)}}var DU=(0,G.createContext)({});function CRe({apiUrl:e,fontCssHref:t,saveSnapshot:n,uploadFile:r,children:i}){let a=(0,G.useMemo)(()=>({apiUrl:e,fontCssHref:t,saveSnapshot:n,uploadFile:r}),[e,t,n,r]);return(0,K.jsx)(DU.Provider,{value:a,children:i})}function OU(){return(0,G.use)(DU)}function kU(e){return!e||typeof e!=`object`?null:!Array.isArray(e.elements)&&e.data!==void 0?kU(e.data):{type:`excalidraw`,elements:Array.isArray(e.elements)?e.elements:[],appState:e.appState??{},files:e.files??{}}}function AU(e){return e.elements.filter(e=>!e.isDeleted).length}function jU(e,t){let n=e;return e.startsWith(`http`)||e.startsWith(`blob:`)||TU(e)?{fetchUrl:e,refLine:n}:e.startsWith(`ref:`)&&t?{fetchUrl:`${t}/objects/${e.slice(4)}`,refLine:n}:{error:e.startsWith(`ref:`)?`Missing apiUrl for ref resolution`:`Unrecognized snapshot format`}}function MU(e,t){switch(e.type){case`inline`:return{type:`inline`,snapshot:e.data};case`remote`:{let n=jU(e.url,t);return`error`in n?{type:`error`,error:n.error}:{type:`remote`,fetchUrl:n.fetchUrl,refLine:n.refLine}}case`delta`:{let n=jU(e.baseUrl,t);return`error`in n?{type:`error`,error:n.error}:{type:`incremental`,fetchUrl:n.fetchUrl,refLine:n.refLine,delta:e.delta}}}}function wRe(e,t){if(!e.trim())return{type:`empty`};let n=EU(e);return n?MU(n,t):{type:`error`,error:`Unrecognized snapshot format`}}function NU(e){let{apiUrl:t}=OU(),n=(0,G.useMemo)(()=>e==null?{type:`empty`}:typeof e==`string`?wRe(e,t):MU(e,t),[e,t]),[i,a]=(0,G.useState)(),[o,s]=(0,G.useState)(),[c,l]=(0,G.useState)(n.type===`remote`||n.type===`incremental`),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(0),m=(0,G.useCallback)(()=>p(e=>e+1),[]);return(0,G.useEffect)(()=>{if(n.type!==`remote`&&n.type!==`incremental`)return;let{fetchUrl:e}=n,t=n.type===`incremental`?n.delta:void 0,i=!1;return l(!0),d(``),fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(async e=>{if(!i){if(s(e),(t?Object.keys(t):[]).length>0){let{patch:n}=await r(async()=>{let{patch:e}=await import(`./lib-DJrc3aG3.js`);return{patch:e}},[],import.meta.url);if(i)return;let o=n(structuredClone(e),t);a(o)}else a(e);l(!1)}}).catch(e=>{i||(d(e instanceof Error?e.message:`Failed to load`),l(!1))}),()=>{i=!0}},[n,f]),n.type===`inline`?{snapshot:n.snapshot,loading:!1,error:``,retry:m,retryable:!1}:n.type===`remote`||n.type===`incremental`?{snapshot:i,loading:c,error:u,retry:m,retryable:!!u,baseRef:n.refLine,baseData:o}:n.type===`error`?{snapshot:void 0,loading:!1,error:n.error,retry:m,retryable:!1}:{snapshot:void 0,loading:!1,error:``,retry:m,retryable:!1}}var TRe=`https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont/style.css`;function PU(){let{fontCssHref:e=TRe}=OU();(0,G.useEffect)(()=>{if(!e||typeof document>`u`||document.head.querySelector(`link[href="${CSS.escape(e)}"]`))return;let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=e,document.head.append(t)},[e])}var ERe=({elementCount:e})=>{let t=e?`Whiteboard · ${e} elements`:`Whiteboard`;return(0,K.jsxs)(`div`,{"aria-label":t,className:cRe,children:[(0,K.jsx)(Fr,{"aria-hidden":!0,className:lRe}),(0,K.jsx)(`span`,{children:t})]})},FU=()=>(0,K.jsx)(`div`,{"aria-busy":!0,className:uRe,children:(0,K.jsx)(`span`,{children:`Loading whiteboard…`})}),IU=()=>(0,K.jsx)(`div`,{className:dRe,children:(0,K.jsx)(`span`,{children:`Empty whiteboard`})}),LU=({message:e,onRetry:t})=>(0,K.jsxs)(`div`,{className:fRe,role:`alert`,children:[(0,K.jsx)(x,{"aria-hidden":!0,className:pRe}),(0,K.jsx)(`span`,{children:e}),t&&(0,K.jsx)(`button`,{className:`_1xd3mo4a`,type:`button`,onClick:t,children:`Retry`})]}),DRe=CU({WhiteboardDisplayRenderer:()=>RU}),RU=({onExpand:e,snapshot:t})=>{let n=lF(),{snapshot:r,loading:i,error:a,retry:o,retryable:s}=NU(t),c=(0,G.useMemo)(()=>kU(r),[r]);PU();let l=(0,G.useCallback)(t=>{e&&c&&e({content:(0,K.jsx)(bn,{mode:`fullscreen`,scene:c,theme:n}),elementCount:AU(c),target:t,theme:n})},[e,c,n]),u;return u=i?(0,K.jsx)(FU,{}):a?(0,K.jsx)(LU,{message:a,onRetry:s?o:void 0}):r?c?AU(c)===0?(0,K.jsx)(IU,{}):(0,K.jsx)(ORe,{fallback:(0,K.jsx)(LU,{message:`Failed to render whiteboard`}),children:(0,K.jsx)(bn,{scene:c,theme:n,onExpand:e?l:void 0})}):(0,K.jsx)(LU,{message:`Invalid whiteboard data`}):(0,K.jsx)(IU,{}),(0,K.jsx)(`div`,{className:oRe,"data-theme":n,children:u})},ORe=class extends G.Component{constructor(...e){super(...e),Cr(this,`state`,{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}},kRe=(0,G.lazy)(()=>Promise.resolve().then(()=>DRe).then(e=>({default:e.WhiteboardDisplayRenderer})));function ARe(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&Array.isArray(t.elements))return t.elements.filter(e=>!e?.isDeleted).length}catch{}}var zU=({snapshot:e})=>(0,K.jsx)(`div`,{className:sRe,children:(0,K.jsx)(ERe,{elementCount:ARe(e)})}),jRe=({onExpand:e,snapshot:t})=>(0,K.jsx)(at,{fallback:(0,K.jsx)(zU,{snapshot:t}),children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(zU,{snapshot:t}),children:(0,K.jsx)(kRe,{snapshot:t,onExpand:e})})}),BU=class e extends wr{static getType(){return`excalidraw`}static clone(t){return new e(t.__snapshot,t.__key)}constructor(e,t){super(t),Cr(this,`__snapshot`,void 0),this.__snapshot=e}createDOM(e){let t=document.createElement(`div`);return t.className=`rich-excalidraw-wrapper`,t}updateDOM(){return!1}isInline(){return!1}static importJSON(e){return MRe(e.snapshot).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),type:`excalidraw`,snapshot:this.__snapshot,version:1}}getSnapshot(){return this.__snapshot}setSnapshot(e){let t=this.getWritable();t.__snapshot=e}decorate(e,t){return qj(aRe,jRe,{snapshot:this.__snapshot})}};function MRe(e){return new BU(e)}function NRe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function PRe(e){var t=NRe(e,`string`);return typeof t==`symbol`?t:String(t)}function FRe(e,t,n){return t=PRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VU(Object(n),!0).forEach(function(t){FRe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UU(e,t){var n={};for(var r in e)n[r]=t(e[r],r);return n}var IRe=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},LRe=e=>{var t=t=>{var n=e.defaultClassName,r=HU(HU({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)IRe(c,r,e.defaultVariants)&&(n+=` `+l);return n};return t.variants=()=>Object.keys(e.variantClassNames),t.classNames={get base(){return e.defaultClassName.split(` `)[0]},get variants(){return UU(e.variantClassNames,e=>UU(e,e=>e.split(` `)[0]))}},t},WU={root:`rich-alert`,header:`rich-alert-header`,icon:`rich-alert-icon`,label:`rich-alert-label`,content:`rich-alert-content`,contentEditable:`rich-alert-content-editable`},GU={root:{note:`rich-alert-note`,tip:`rich-alert-tip`,important:`rich-alert-important`,warning:`rich-alert-warning`,caution:`rich-alert-caution`},header:{note:`rich-alert-header-note`,tip:`rich-alert-header-tip`,important:`rich-alert-header-important`,warning:`rich-alert-header-warning`,caution:`rich-alert-header-caution`}},KU=LRe({defaultClassName:`pq4lod1`,variantClassNames:{type:{note:`pq4lod2`,tip:`pq4lod3`,important:`pq4lod4`,warning:`pq4lod5`,caution:`pq4lod6`}},defaultVariants:{},compoundVariants:[]}),qU=`pq4lod7`,RRe=`pq4lod8`,zRe=`pq4lod9`,JU=`pq4loda`,YU=`pq4lodb`,BRe=`pq4lodc`,XU={note:m,tip:gi,important:xi,warning:x,caution:wi},ZU={note:`Note`,tip:`Tip`,important:`Important`,warning:`Warning`,caution:`Caution`},VRe=[`note`,`tip`,`important`,`warning`,`caution`],QU=({type:e})=>{let t=XU[e],n=ZU[e];return(0,K.jsxs)(`div`,{className:`${qU} ${KU({type:e})} ${WU.header} ${GU.header[e]}`,children:[(0,K.jsx)(t,{className:`${JU} ${WU.icon}`}),(0,K.jsx)(`span`,{className:`${YU} ${WU.label}`,children:n})]})},HRe=({type:e,editable:t,onTypeChange:n})=>{if(!t||!n)return(0,K.jsx)(QU,{type:e});let r=XU[e],i=ZU[e];return(0,K.jsx)(`div`,{className:`${qU} ${KU({type:e})} ${WU.header} ${GU.header[e]}`,children:(0,K.jsxs)(Zn,{children:[(0,K.jsxs)(On,{"aria-label":`Alert type: ${i}`,className:RRe,children:[(0,K.jsx)(r,{className:`${JU} ${WU.icon}`}),(0,K.jsx)(`span`,{className:`${YU} ${WU.label}`,children:i}),(0,K.jsx)(l,{className:zRe})]}),(0,K.jsx)(Rt,{align:`start`,sideOffset:8,children:(0,K.jsx)(M,{value:e,onValueChange:t=>{t!==e&&n(t)},children:VRe.map(e=>{let t=XU[e];return(0,K.jsxs)(pn,{value:e,children:[(0,K.jsx)(t,{className:`${BRe} ${KU({type:e})}`}),(0,K.jsx)(`span`,{children:ZU[e]})]},e)})})})]})})},$U={root:`rr-image-root`,frame:`rr-image-frame`,frameLoading:`rr-image-loading`,frameLoaded:`rr-image-loaded`,frameError:`rr-image-error`,image:`rr-image-img`,loader:`rr-image-loader`,errorBadge:`rr-image-error`,caption:`rr-image-caption`,editTrigger:`rr-image-edit-trigger`,editPlaceholder:`rr-image-edit-placeholder`,editToolbar:`rr-image-edit-toolbar`,editToolbarVisible:`rr-image-edit-toolbar-visible`,resizeHandle:`rr-image-resize-handle`,inspector:`rr-image-inspector`},eW=`_1n94osf0`,tW=`_1n94osf1`,nW=`_1n94osf3`,rW={loading:`_1n94osf4`,loaded:`_1n94osf5`,error:`_1n94osf6`},iW=`_1n94osf7`,aW=`_1n94osf8`,URe=`_1n94osf9`,WRe=`_1n94osfa`,GRe=`_1n94osfm`,KRe=`_1n94osfn`,qRe=`_1n94osfo`,JRe=`_1n94osfp`,oW=`_1n94osfq`,YRe=`_1n94osfr`,XRe=`_1n94osfs`,ZRe=`_1n94osft`,QRe=`_1n94osfv`,$Re=`_1n94osfw`,eze=`_1n94osfx`,tze=`_1n94osfy`,nze=`_1n94osfz`,rze=`_1n94osf10`,ize=`_1n94osf11`,aze=`_1n94osf12`,oze=`_1n94osf13`,sze=`_1n94osf14`,cze={loading:$U.frameLoading,loaded:$U.frameLoaded,error:$U.frameError};function lze(e,t){if(t)return t;if(e&&(e.startsWith(`!`)||e.startsWith(`¡`)))return e.slice(1)}function sW({src:e,altText:t,width:n,height:r,caption:i,thumbhash:a,accent:o,displayWidth:s,fixedWidth:c,fixedHeight:l,layout:u,onActivate:d,ref:f}){let[p,m]=(0,G.useState)(`loading`),h=(0,G.useRef)(null),g=(0,G.useMemo)(()=>lze(t,i),[t,i]),_=(0,G.useMemo)(()=>a?$j(a):void 0,[a]);if(!e)return null;let v=!!d,y=DN({displayWidth:s,fixedWidth:c,fixedHeight:l}),b=y.mode===`percent`||y.mode===`fixed-width`,x={backgroundColor:p!==`loaded`&&!_?o||Ht.color.bgTertiary:`transparent`,backgroundImage:_&&p!==`loaded`?`url(${_})`:void 0,backgroundSize:`cover`,width:b?`100%`:n?Math.min(n,1200):void 0,maxWidth:`100%`,maxHeight:y.mode===`fixed-height`?`${y.px}px`:void 0,...n&&r?{aspectRatio:`${n} / ${r}`}:{}},S=()=>{h.current&&d?.(h.current)},C=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S())},w=PN(y);return(0,K.jsxs)(`figure`,{className:`${eW} ${$U.root}`,"data-display":FN(y),"data-layout":u,ref:f,style:w,children:[(0,K.jsxs)(`div`,{"aria-label":v?`Open image: ${t||`image`}`:void 0,className:`${aW} ${v?``:WRe} ${$U.frame} ${rW[p]} ${cze[p]}`.trim(),role:v?`button`:void 0,style:x,tabIndex:v?0:void 0,onClick:v?S:void 0,onKeyDown:v?C:void 0,children:[(0,K.jsx)(`img`,{alt:t,className:`${nW} ${p===`loaded`?iW:``} ${$U.image}`,"data-state":p,height:r,loading:`lazy`,ref:h,src:e,width:n,style:y.mode===`fixed-height`?{width:`auto`,height:`auto`,maxWidth:`100%`,maxHeight:`100%`}:n&&r?{height:`100%`,objectFit:`cover`}:void 0,onError:()=>m(`error`),onLoad:()=>m(`loaded`)}),p===`loading`&&(0,K.jsx)(`span`,{className:`_1n94osfc ${$U.loader}`}),p===`error`&&(0,K.jsx)(`span`,{className:`_1n94osfd ${$U.errorBadge}`,children:`Image failed to load`})]}),g&&(0,K.jsx)(`figcaption`,{className:`_1n94osfe ${$U.caption}`,children:g})]})}var uze=0;function cW(e,t){let n=`atom${++uze}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=dze,r.write=fze),t&&(r.write=t),r}function dze(e){return e(this)}function fze(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function lW(e){return`init`in e}function pze(e){return typeof e.write==`function`}function mze(e){return!!e.onMount}function uW(e){return`v`in e||`e`in e}function dW(e){if(`e`in e)throw e.e;return e.v}function fW(e){return typeof e?.then==`function`}function hze(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function pW(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function mW(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function gze(e){return!!e.INTERNAL_onInit}var _ze=(e,t,n,...r)=>n.read(...r),vze=(e,t,n,...r)=>n.write(...r),yze=(e,t,n)=>n.INTERNAL_onInit(t),bze=(e,t,n,r)=>n.onMount?.(r),xze=(e,t,n)=>{let r=e.a,i=r.get(n);if(!i){let a=e.h,o=e.I;i={d:new Map,p:new Set,n:0},r.set(n,i),a.i?.(n),gze(n)&&o(e,t,n)}return i},Sze=(e,t)=>{let n=e.m,r=e.c,i=e.q,a=e.Q,o=e.h,s=e.C;if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw typeof AggregateError==`function`?AggregateError(c):Object.assign(Error(),{errors:c})},Cze=(e,t)=>{let n=e.m,r=e.i,i=e.c,a=e.e,o=e.r,s=e.D;if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o))f.pop(),p.pop();else if(u.has(o))r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();else{u.add(o);for(let r of mW(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},wze=(e,t,n)=>{let r=e.m,i=e.i,a=e.c,o=e.h,s=e.R,c=e.e,l=e.f,u=e.C,d=e.r,f=e.D,p=e.v,m=e.H,h=e.E,g=c(e,t,n),_=h[0];if(uW(g)){if(r.has(n)&&i.get(n)!==g.n||g.m===_)return g.m=_,g;let a=!1;for(let[n,r]of g.d)if(d(e,t,n).n!==r){a=!0;break}if(!a)return g.m=_,g}let v=!0,y=new Set(g.d.keys()),b=()=>{for(let e of y)g.d.delete(e)},x=()=>{if(r.has(n)){let r=!a.size;f(e,t,n),r&&(u(e,t),l(e,t))}},S=i=>{if(i===n){let n=c(e,t,i);if(!uW(n)){if(lW(i))p(e,t,i,i.init);else throw Error(`no atom init`)}return dW(n)}let a=d(e,t,i);try{return dW(a)}finally{y.delete(i),g.d.set(i,a.n),fW(g.v)&&pW(n,g.v,a),r.has(n)&&r.get(i)?.t.add(n),v||x()}},C,w={get signal(){return C||=new AbortController,C.signal}},T=g.n,E=i.get(n)===T;try{let r=s(e,t,n,S,w);if(p(e,t,n,r),fW(r)){m(e,t,r,()=>C?.abort());let n=()=>{b(),x()};r.then(n,n)}else b();return o.r?.(n),g.m=_,g}catch(e){if(hze(e))throw e;return delete g.v,g.e=e,++g.n,g.m=_,g}finally{v=!1,g.n!==T&&E&&(i.set(n,g.n),a.add(n),o.c?.(n))}},Tze=(e,t,n)=>{let r=e.m,i=e.i,a=e.e,o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of mW(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},Eze=(e,t,n,r)=>{let i=e.c,a=e.h,o=e.W,s=e.e,c=e.f,l=e.C,u=e.r,d=e.d,f=e.w,p=e.D,m=e.v,h=e.E,g=!0,_=n=>dW(u(e,t,n)),v=(r,...o)=>{let u=s(e,t,r);try{if(r===n){if(!lW(r))throw Error(`atom not writable`);let n=u.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==u.n&&(++h[0],i.add(r),d(e,t,r),a.c?.(r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},Dze=(e,t,n)=>{let r=e.m,i=e.c,a=e.h,o=e.e,s=e.d,c=e.t,l=e.T,u=o(e,t,n),d=r.get(n);if(d){for(let[r,l]of u.d)if(!d.d.has(r)){let u=o(e,t,r);c(e,t,r).t.add(n),d.d.add(r),l!==u.n&&(i.add(r),s(e,t,r),a.c?.(r))}for(let r of d.d)u.d.has(r)||(d.d.delete(r),l(e,t,r)?.t.delete(n))}},Oze=(e,t,n)=>{let r=e.m,i=e.q,a=e.h,o=e.M,s=e.e,c=e.f,l=e.C,u=e.r,d=e.w,f=e.t,p=s(e,t,n),m=r.get(n);if(!m){u(e,t,n);for(let r of p.d.keys())f(e,t,r).t.add(n);m={l:new Set,d:new Set(p.d.keys()),t:new Set},r.set(n,m),pze(n)&&mze(n)&&i.add(()=>{let r=!0,i=(...i)=>{try{return d(e,t,n,i)}finally{r||(l(e,t),c(e,t))}};try{let a=o(e,t,n,i);a&&(m.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),a.m?.(n)}return m},kze=(e,t,n)=>{let r=e.m,i=e.Q,a=e.h,o=e.e,s=e.T,c=o(e,t,n),l=r.get(n);if(!l||l.l.size)return l;let u=!1;for(let e of l.t)if(r.get(e)?.d.has(n)){u=!0;break}if(u)return l;l.u&&i.add(l.u),l=void 0,r.delete(n);for(let r of c.d.keys())s(e,t,r)?.t.delete(n);a.u?.(n)},Aze=(e,t,n,r)=>{let i=e.e,a=e.A,o=i(e,t,n),s=`v`in o,c=o.v;if(fW(r))for(let a of o.d.keys())pW(n,r,i(e,t,a));o.v=r,delete o.e,s&&Object.is(c,o.v)||(++o.n,fW(c)&&a(e,t,c))},jze=(e,t,n)=>{let r=e.r;return dW(r(e,t,n))},Mze=(e,t,n,...r)=>{let i=e.c,a=e.f,o=e.C,s=e.w,c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},Nze=(e,t,n,r)=>{let i=e.f,a=e.C,o=e.t,s=e.T,c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},Pze=(e,t,n,r)=>{let i=e.p,a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},Fze=(e,t,n)=>{e.p.get(n)?.forEach(e=>e())},hW=new WeakMap;function Ize(e){let t=hW.get(e),n=t.B;return n?n(t,e):t}function Lze(e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=Object.freeze({a:new WeakMap,m:new WeakMap,i:new WeakMap,c:new Set,q:new Set,Q:new Set,h:{},R:_ze,W:vze,I:yze,M:bze,e:xze,f:Sze,C:Cze,r:wze,d:Tze,w:Eze,D:Dze,t:Oze,T:kze,v:Aze,g:jze,s:Mze,b:Nze,B:void 0,p:new WeakMap,H:Pze,A:Fze,E:[0],...e});hW.set(t,n);let r=n.g,i=n.s,a=n.b;return t}function gW(){return Lze()}var _W;function Rze(){return _W||=gW(),_W}var vW=(0,G.createContext)(void 0);function yW(e){let t=(0,G.useContext)(vW);return e?.store||t||Rze()}function zze({children:e,store:t}){let n=(0,G.useRef)(null);return t?(0,G.createElement)(vW.Provider,{value:t},e):(n.current===null&&(n.current=gW()),(0,G.createElement)(vW.Provider,{value:n.current},e))}var bW=e=>typeof e?.then==`function`,xW=new WeakMap,Bze=(e,t,n)=>{let r=Ize(e),i=r.H,a=xW.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();bW(t)?(xW.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),xW.set(t,a)),a},SW=(e,t,n)=>[n,e,t,r=>{let i=e.sub(t,r),a=!0;try{a=!Object.is(n,e.get(t))}catch{}return a&&r(),i}];function Vze(e,t){let n=yW(t),[[r,i,a,o],s]=(0,G.useReducer)(t=>{let r=n.get(e);return t[1]===n&&t[2]===e?Object.is(t[0],r)?t:[r,n,e,t[3]]:SW(n,e,r)},void 0,()=>SW(n,e,n.get(e))),c=r;return(i!==n||a!==e)&&(s(),c=n.get(e)),(0,G.useEffect)(()=>o(s),[o]),(0,G.useDebugValue)(c),bW(c)?Bze(n,c,()=>n.get(e)):c}var CW=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Hze=G.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(CW(e),e)});function wW(e,t){let{unstable_promiseStatus:n=!G.use}=t||{},r=Vze(e,t);return bW(r)?(n&&CW(r),Hze(r)):r}function TW(e,t){let n=yW(t);return(0,G.useCallback)((...t)=>n.set(e,...t),[n,e])}function EW(e,t){return[wW(e,t),TW(e,t)]}function Uze(e,t){if(t)return t;if(e&&(e.startsWith(`!`)||e.startsWith(`¡`)))return e.slice(1)}var DW=cW(``),OW=cW(``),kW=cW(),AW=cW(),jW=cW(),MW=cW(),NW=cW(),PW=cW(),FW=cW(),IW=cW(),LW=cW(),RW=cW(`loading`),zW=cW(!1),BW=cW(!1),VW=cW(!1),Wze=cW(!1),Gze=cW(!1),HW=cW(!1),UW=cW(e=>e(zW)||e(BW)||e(VW)||e(Wze)||e(Gze)||e(HW)),WW=cW(!1),GW=cW({current:null}),Kze=cW({current:null}),qze=cW(e=>{let t=e(MW);return t?$j(t):void 0}),Jze=cW(e=>Uze(e(OW),e(jW))),Yze=cW(e=>{let t=e(qze),n=e(NW),r=e(RW),i=e(kW),a=e(AW),o=e(PW),s=e(FW),c=e(IW),l=o!==void 0||s!==void 0;return{backgroundColor:r!==`loaded`&&!t?n||`#f5f5f5`:`transparent`,backgroundImage:t&&r!==`loaded`?`url(${t})`:void 0,backgroundSize:`cover`,width:l?`100%`:i?Math.min(i,1200):void 0,maxWidth:`100%`,maxHeight:c===void 0?void 0:`${c}px`,...i&&a?{aspectRatio:`${i} / ${a}`}:{}}});function Xze({props:e,children:t}){let[n]=ht(),r=(0,G.useRef)(null),i=(0,G.useRef)(null),[a]=(0,G.useState)(()=>{let t=gW();return t.set(DW,e.src),t.set(OW,e.altText),t.set(kW,e.width),t.set(AW,e.height),t.set(jW,e.caption),t.set(MW,e.thumbhash),t.set(NW,e.accent),t.set(PW,e.displayWidth),t.set(FW,e.fixedWidth),t.set(IW,e.fixedHeight),t.set(LW,e.layout),t.set(GW,r),t.set(Kze,i),t.set(RW,e.src?`loading`:`error`),t.set(VW,!e.src&&!!e.autoOpenOnMount),t});return(0,G.useEffect)(()=>{a.set(DW,e.src),a.set(OW,e.altText),a.set(kW,e.width),a.set(AW,e.height),a.set(jW,e.caption),a.set(MW,e.thumbhash),a.set(NW,e.accent),a.set(PW,e.displayWidth),a.set(FW,e.fixedWidth),a.set(IW,e.fixedHeight),a.set(LW,e.layout)},[a,e.src,e.altText,e.width,e.height,e.caption,e.thumbhash,e.accent,e.displayWidth,e.fixedWidth,e.fixedHeight,e.layout]),(0,G.useEffect)(()=>{a.set(RW,e.src?`loading`:`error`)},[a,e.src]),(0,G.useEffect)(()=>{if(!e.autoOpenOnMount)return;let t=r.current;t&&n.update(()=>{let e=Bt(t);GN(e)&&e.setShouldAutoOpenOnMount(!1)},{tag:[un,pee]})},[n,e.autoOpenOnMount]),(0,K.jsx)(zze,{store:a,children:t})}var KW=e=>{e.preventDefault(),e.stopPropagation()};function qW({children:e,label:t,icon:n=!0,...r}){return(0,K.jsxs)(Mn,{children:[(0,K.jsx)(tt,{render:(0,K.jsx)(Fe,{"aria-label":t,icon:n,size:`md`,onMouseDown:KW,...r}),children:e}),(0,K.jsx)(Fn,{side:`top`,children:t})]})}function JW(){let e=yW(),[t]=ht(),n=(0,G.useCallback)(n=>{let r=e.get(GW);r.current&&t.update(()=>{let e=Bt(r.current);GN(e)&&n(e)},{tag:`skip-scroll-into-view`})},[t,e]),r=(0,G.useCallback)(()=>{e.set(VW,!1)},[e]),i=(0,G.useCallback)(()=>{let n=e.get(GW);n.current&&(t.update(()=>{let e=Bt(n.current);e&&e.remove()}),e.set(BW,!1),r())},[r,t,e]),a=(0,G.useCallback)(()=>{let t=e.get(DW);t&&window.open(t,`_blank`,`noopener,noreferrer`)},[e]),o=(0,G.useCallback)(()=>{let t=e.get(DW);if(!t)return;let n=document.createElement(`a`);n.href=t,n.download=e.get(OW)||`image`,n.click()},[e]),s=(0,G.useCallback)(()=>{n(e=>{let t=WN({src:e.getSrc(),altText:e.getAltText(),width:e.getWidth(),height:e.getHeight(),caption:e.getCaption(),thumbhash:e.getThumbhash(),accent:e.getAccent(),displayWidth:e.getDisplayWidth(),fixedWidth:e.getFixedWidth(),fixedHeight:e.getFixedHeight(),layout:e.getLayout()});e.insertAfter(t)})},[n]),c=(0,G.useCallback)(e=>{n(t=>{t.applyDisplaySize(e)})},[n]),l=(0,G.useCallback)(e=>{n(t=>{t.setLayout(e)})},[n]);return{closeReplacePanel:r,handleReplaceOpenChange:(0,G.useCallback)(t=>{e.set(VW,t),t||r()},[r,e]),handleOpen:a,handleDuplicate:s,handleDownload:o,handleDelete:i,handleSetDisplaySize:c,handleSetLayout:l}}function YW({onOpenChange:e}){let[t]=ht(),{handleDuplicate:n,handleOpen:r,handleDownload:i,handleDelete:a}=JW();return(0,K.jsxs)(Zn,{onOpenChange:t=>e?.(t),children:[(0,K.jsx)(On,{render:(0,K.jsx)(Fe,{icon:!0,"aria-label":`More actions`,size:`md`,onMouseDown:KW}),children:(0,K.jsx)(Nr,{})}),(0,K.jsxs)(Rt,{align:`end`,children:[(0,K.jsxs)(Ut,{onClick:n,children:[(0,K.jsx)(Vte,{}),`Duplicate`]}),(0,K.jsxs)(Ut,{onClick:r,children:[(0,K.jsx)(Xte,{}),`Open original`]}),(0,K.jsxs)(Ut,{onClick:i,children:[(0,K.jsx)(f,{}),`Download`]}),(0,K.jsx)(ur,{}),(0,K.jsxs)(Ut,{shortcut:`Backspace`,variant:`destructive`,onClick:()=>{a(),Pe({title:`Image deleted`,action:{label:`Undo`,onClick:()=>t.dispatchCommand(U,void 0)}})},children:[(0,K.jsx)(Mr,{}),`Delete`]})]})]})}var Zze=/^(?:javascript\s*:|vbscript\s*:|data\s*:(?!image\/))/i;function XW(e){return e.trim()!==``&&!Zze.test(e.trim())}function Qze({focus:e,menu:t,onApply:n,onKeyDown:r,onOpenChange:i,open:a,renderWidth:o,trigger:s,values:c}){let l=(0,G.useId)(),u=(0,G.useRef)(null),f=(0,G.useRef)(null),[p,m]=(0,G.useState)(c.altText),[h,g]=(0,G.useState)(c.caption),[_,v]=(0,G.useState)(c.src),{apply:y,revert:b}=Tee(c,a,n);(0,G.useEffect)(()=>{a&&(m(c.altText),g(c.caption),v(c.src))},[a]);let x=!XW(_),S=e===`caption`?f:e===`alt`?u:void 0;return(0,K.jsxs)(gn,{open:a,onOpenChange:(e,t)=>{!e&&t?.reason===`escape-key`&&b(),i(e)},children:[(0,K.jsx)(en,{render:s}),(0,K.jsxs)(yn,{flush:!0,className:`${QRe} ${$U.inspector}`,initialFocus:S,side:`bottom`,size:`md`,onKeyDown:r,children:[(0,K.jsx)(wn,{actions:t,icon:(0,K.jsx)(d,{}),title:`Image`}),(0,K.jsxs)(Xn,{children:[o?.(e=>y({size:e})),(0,K.jsx)(Kn,{id:`${l}-alt`,label:`Alt text`,children:(0,K.jsx)(ct,{id:`${l}-alt`,placeholder:`Describe the image`,ref:u,value:p,onChange:e=>{m(e.target.value),y({altText:e.target.value})}})}),(0,K.jsx)(Kn,{hint:`Optional`,id:`${l}-caption`,label:`Caption`,children:(0,K.jsx)(ct,{id:`${l}-caption`,ref:f,value:h,onChange:e=>{g(e.target.value),y({caption:e.target.value})}})}),(0,K.jsx)(Kn,{error:x?`Enter an image URL`:void 0,id:`${l}-src`,label:`Source URL`,children:(0,K.jsx)(ct,{"aria-describedby":x?`${l}-src-error`:void 0,id:`${l}-src`,invalid:x,type:`url`,value:_,onChange:e=>{v(e.target.value),XW(e.target.value)&&y({src:e.target.value.trim()})}})})]}),(0,K.jsxs)(Bn,{hint:`Changes apply as you type`,children:[(0,K.jsx)(ar,{keys:`Esc`,size:`sm`,tone:`muted`}),(0,K.jsx)(`span`,{className:$Re,children:`revert`})]})]})]})}function ZW(e){let t=e.closest(`.rich-image-wrapper`)?.parentElement??e.parentElement;if(!t)return;let n=getComputedStyle(t),r=t.clientWidth-Number.parseFloat(n.paddingLeft)-Number.parseFloat(n.paddingRight);return r>0?r:void 0}function $ze(e,t,n){if(!e)return;let r=ZW(e);if(!r)return;let i=e.querySelector(`.${$U.frame}`)?.getBoundingClientRect();return{containerWidth:r,intrinsicWidth:t,intrinsicHeight:n,renderedWidth:i?.width,renderedHeight:i?.height}}function eBe(e,t,n){let r=e.querySelector(`figure`),i=t===`float-left`||t===`float-right`,a=e.closest(`.rich-image-wrapper`);r?.style.removeProperty(`--rich-image-display-width`),r?.style.removeProperty(`--rich-image-display-height`);let o=PN(n);if(r&&o)for(let[e,t]of Object.entries(o))r.style.setProperty(e,t);i&&a&&(n.mode===`percent`?(a.style.width=`${n.value}%`,a.style.maxWidth=``):n.mode===`fixed-width`?(a.style.width=`${n.px}px`,a.style.maxWidth=`100%`):n.mode===`fixed-height`?(a.style.width=`auto`,a.style.maxWidth=`100%`):(a.style.width=``,a.style.maxWidth=``))}var QW=cW(null),tBe=[25,50,75,100],$W=10,eG=100,nBe=3,rBe=[{value:`auto`,label:`Auto`},{value:`percent`,label:`%`},{value:`px`,label:`px`}];function iBe(e){for(let t of tBe)if(Math.abs(e-t)<=nBe)return t;return e}function tG(e){switch(e.mode){case`percent`:return`${e.value}%`;case`fixed-width`:case`fixed-height`:return`${e.px}px`;default:return`Auto`}}function aBe(){let e=wW(PW),t=wW(FW),n=wW(IW);return(0,G.useMemo)(()=>DN({displayWidth:e,fixedWidth:t,fixedHeight:n}),[e,t,n])}function oBe(){let[e]=ht(),t=yW();return(0,G.useCallback)((n,r)=>{let i=t.get(GW).current;i&&e.update(()=>{let e=Bt(i);GN(e)&&(n.src!==void 0&&e.setSrc(n.src),n.altText!==void 0&&e.setAltText(n.altText),n.caption!==void 0&&e.setCaption(n.caption||void 0),n.size&&e.applyDisplaySize(n.size))},{tag:r?[un,`skip-scroll-into-view`]:`skip-scroll-into-view`})},[e,t])}function sBe({size:e,onChange:t}){let n=(0,G.useId)(),r=yW(),i=wW(kW),a=wW(AW),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(null);(0,G.useEffect)(()=>{s(null),l(null)},[e]);let u=()=>$ze(r.get(GW).current,i,a),d=e.mode===`auto`?`auto`:e.mode===`percent`?`percent`:`px`,f=n=>{if(n===d)return;if(n===`auto`){t({mode:`auto`});return}let r=u();if(n===`percent`){t(r?NN(e,`percent`,r):{mode:`percent`,value:100});return}if(r){t(NN(e,`fixed-width`,r));return}let a=EN(i);a&&t({mode:`fixed-width`,px:a})},p=e=>{let t=r.get(GW).current;t&&eBe(t,r.get(LW),e)},m=(()=>{if(e.mode===`percent`)return e.value;let t=u();if(!t)return;let{widthPx:n}=MN(e,t);return n?TN(n/t.containerWidth*100):void 0})(),h=o??m??eG,g=`${(h-$W)/90*100}%`,_=()=>{o!==null&&o!==m&&t({mode:`percent`,value:o})},v=e.mode===`fixed-width`||e.mode===`fixed-height`?e.px:void 0,y=e.mode===`fixed-height`?`Height in pixels`:`Width in pixels`;return(0,K.jsxs)(`div`,{className:aze,children:[(0,K.jsx)(`span`,{className:oze,id:`${n}-label`,children:`Width`}),(0,K.jsxs)(`div`,{"aria-labelledby":`${n}-label`,className:sze,role:`group`,children:[(0,K.jsx)(xt,{items:rBe,value:d,onChange:f}),d===`percent`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{"aria-label":`Width, percent of content width`,className:`_1n94osfu`,max:eG,min:$W,step:1,style:{"--fill":g},type:`range`,value:h,onBlur:_,onKeyUp:_,onPointerUp:_,onChange:e=>{let t=iBe(Number(e.target.value));s(t),p({mode:`percent`,value:t})}}),(0,K.jsx)(`span`,{className:`_1n94osf15`,children:`${h}%`})]}),d===`px`&&(0,K.jsxs)(`span`,{className:`_1n94osf17`,children:[(0,K.jsx)(ct,{"aria-label":y,autoComplete:`off`,inputMode:`numeric`,invalid:c!==null&&EN(Number(c))===void 0,spellCheck:!1,value:c??String(v??``),onChange:n=>{l(n.target.value);let r=EN(Number(n.target.value));r&&(e.mode===`fixed-width`||e.mode===`fixed-height`)&&t({mode:e.mode,px:r})}}),(0,K.jsx)(`span`,{className:`_1n94osf18`,children:`px`})]}),d===`auto`&&(0,K.jsx)(`span`,{className:`_1n94osf16`,children:`Natural size`})]})]})}function cBe(){let[e,t]=EW(BW),[n,r]=EW(QW),[i,a]=EW(WW),o=wW(DW),s=wW(OW),c=wW(jW),u=aBe(),d=oBe(),f=(0,G.useMemo)(()=>({src:o,altText:s,caption:c??``,size:u}),[o,s,c,u]);return(0,K.jsx)(Qze,{focus:i?`caption`:n,menu:(0,K.jsx)(YW,{}),open:e,renderWidth:e=>(0,K.jsx)(sBe,{size:u,onChange:e}),values:f,trigger:(0,K.jsxs)(Fe,{"aria-label":`Image size, ${tG(u)}`,className:rze,size:`md`,onClick:()=>r(null),onMouseDown:KW,children:[(0,K.jsx)(`span`,{children:tG(u)}),(0,K.jsx)(l,{className:ize})]}),onApply:d,onOpenChange:e=>{t(e),e||(r(null),a(!1))}})}var lBe=[{value:void 0,label:`Center`,Icon:Tne},{value:`align-left`,label:`Align left`,Icon:Dne},{value:`align-right`,label:`Align right`,Icon:Ene},{value:`float-left`,label:`Wrap left`,Icon:kne},{value:`float-right`,label:`Wrap right`,Icon:jte}];function uBe(){let e=wW(LW),{handleSetLayout:t}=JW();return(0,K.jsx)(`div`,{"aria-label":`Image layout`,className:eze,role:`group`,children:lBe.map(({value:n,label:r,Icon:i})=>(0,K.jsx)(qW,{"aria-pressed":e===n,label:r,onClick:()=>{e!==n&&t(n)},children:(0,K.jsx)(i,{})},n??`center`))})}var dBe=6e3;function nG(){let[e]=ht(),t=yW(),n=wje(),r=iL(),i=We(),a=(0,G.useRef)(!1);return(0,G.useCallback)(async()=>{if(a.current)return;a.current=!0;let o=t.get(GW).current,s=t=>{o&&e.update(()=>{let e=Bt(o);GN(e)&&t(e)},{tag:`skip-scroll-into-view`})};try{let e=hL(r),t=(await NL({editor:e,mode:`replace`,portalClassName:i.className,theme:i.theme}))?.[0];if(!t)return;if(t.kind===`url`){s(e=>{e.setSrc(t.src),e.setDimensions(t.width,t.height),e.setThumbhash(void 0)});return}let[a]=e?[t.file]:await lL([t.file],`replace`,r?.ref.current??null);if(!a)return;let o=async()=>{let e=Pe({title:`Uploading image…`,tone:`loading`});try{let t=n??IL,[r,i]=await Promise.all([PL(t,a),Qj(a)]);s(e=>{e.setSrc(r.src),e.setAltText(r.altText??a.name),e.setDimensions(r.width??i.width,r.height??i.height),e.setThumbhash(r.thumbhash??i.thumbhash)}),Et(e,{title:`Image replaced`,tone:`success`})}catch(t){console.error(`[ImageReplace]`,t),Et(e,{action:{label:`Retry`,onClick:()=>void o()},duration:dBe,title:`Image replace failed`,tone:`error`})}};await o()}finally{a.current=!1}},[e,i,r,t,n])}function fBe(){let[e]=ht(),t=yW(),[n,r]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{let n=t.get(GW).current;if(!n)return;let i=()=>e.read(()=>{let e=kr();if(!Ue(e))return!1;let t=Bt(n);return t!==null&&e.has(t.getKey())}),a=()=>{let e=i();r(e),e?n.dataset.selected=``:delete n.dataset.selected},o=t=>{t.target?.closest(`.${$U.editToolbar}`)||e.update(()=>{let e=Bt(n);if(!e)return;let t=sr();t.add(e.getKey()),Jt(t)},{tag:`skip-scroll-into-view`})};a(),n.addEventListener(`click`,o);let s=e.registerUpdateListener(a);return()=>{n.removeEventListener(`click`,o),s(),delete n.dataset.selected}},[e,t]),n}function rG(){return(0,K.jsx)(`span`,{"aria-hidden":!0,className:tze})}function pBe(){let e=wW(UW),t=fBe(),[n,r]=(0,G.useState)(!1),i=TW(BW),a=TW(QW),o=nG(),s=e||t||n;return(0,K.jsxs)(`div`,{"aria-label":`Image`,className:`${qRe} ${$U.editToolbar} ${s?`${JRe} ${$U.editToolbarVisible}`:``}`,role:`toolbar`,children:[(0,K.jsx)(cBe,{}),(0,K.jsx)(rG,{}),(0,K.jsx)(uBe,{}),(0,K.jsx)(rG,{}),(0,K.jsx)(qW,{className:nze,icon:!1,label:`Alt text`,onClick:()=>{a(`alt`),i(!0)},children:`Alt`}),(0,K.jsx)(qW,{label:`Replace image`,onClick:()=>void o(),children:(0,K.jsx)(Gne,{})}),(0,K.jsx)(rG,{}),(0,K.jsx)(YW,{onOpenChange:r})]})}function mBe(){let[e,t]=EW(VW),n=nG();return(0,G.useEffect)(()=>{e&&(t(!1),n())},[n,e,t]),(0,K.jsxs)(`button`,{className:`${KRe} ${$U.editPlaceholder}`,type:`button`,onClick:()=>void n(),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,K.jsx)(d,{size:24}),(0,K.jsx)(`span`,{children:`Click to add image`})]})}var hBe=3;function gBe(){let e=yW(),[t]=ht(),n=(0,G.useRef)(null);return(0,G.useEffect)(()=>()=>n.current?.(!1),[]),{handlePointerDown:(0,G.useCallback)((r,i)=>{let a=e.get(GW).current;if(!a)return;let o=a.querySelector(`.${$U.frame}`),s=a.querySelector(`figure`),c=a.closest(`.rich-image-wrapper`);if(!o||!s)return;let l=ZW(a),u=o.getBoundingClientRect().width;if(!l||l<=0||!u)return;r.preventDefault(),r.stopPropagation();let d=e.get(LW),f=d===void 0?2:1,p=d===`float-left`||d===`float-right`,m=r.clientX,h=r.currentTarget;try{h.setPointerCapture(r.pointerId)}catch{}e.set(HW,!0);let g=document.body.style.userSelect;document.body.style.userSelect=`none`;let _=o.getBoundingClientRect().height,v=u>0&&_>0?_/u:void 0,y=DN({displayWidth:e.get(PW),fixedWidth:e.get(FW),fixedHeight:e.get(IW)}).mode,b=IN(y,u,_,l),x=!1,S=e=>{let t=PN(e);if(s.style.removeProperty(`--rich-image-display-width`),s.style.removeProperty(`--rich-image-display-height`),t)for(let[e,n]of Object.entries(t))s.style.setProperty(e,n);p&&c&&(e.mode===`percent`?(c.style.width=`${e.value}%`,c.style.maxWidth=``):e.mode===`fixed-width`?(c.style.width=`${e.px}px`,c.style.maxWidth=`100%`):e.mode===`fixed-height`&&(c.style.width=`auto`,c.style.maxWidth=`100%`))},C=e=>{let t=e.clientX-m;if(!x&&Math.abs(t)<hBe)return;x=!0;let n=i===`left`?-t:t,r=u+n*f,a=v?r*v:_;b=IN(y,r,a,l),S(b)},w=r=>{n.current===w&&(n.current=null,h.removeEventListener(`pointermove`,C),h.removeEventListener(`pointerup`,T),h.removeEventListener(`pointercancel`,T),document.body.style.userSelect=g,e.set(HW,!1),r&&x&&t.update(()=>{let e=Bt(a);GN(e)&&e.applyDisplaySize(b)},{tag:`skip-scroll-into-view`}))},T=()=>w(!0);n.current=w,h.addEventListener(`pointermove`,C),h.addEventListener(`pointerup`,T),h.addEventListener(`pointercancel`,T)},[t,e])}}function _Be(){let e=wW(UW),{handlePointerDown:t}=gBe(),n=e?ZRe:``;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`${oW} ${YRe} ${n} ${$U.resizeHandle}`.trim(),onPointerDown:e=>t(e,`left`)}),(0,K.jsx)(`span`,{className:`${oW} ${XRe} ${n} ${$U.resizeHandle}`.trim(),onPointerDown:e=>t(e,`right`)})]})}var iG=`application/x-haklex-image-drag`;function aG(e,t){return t<e.left+e.width/2?`left`:`right`}function vBe(e){return e===`left`?`float-left`:`float-right`}function oG(e){return!!e?.types.includes(iG)}function sG(e,t){let n=e.getRootElement();if(!n)return null;let r=t;for(;r&&r!==n;){if(r.parentElement===n)return r;r=r.parentElement}return null}function yBe(e,t){let n=[...e.children].filter(e=>e instanceof HTMLElement);if(!n.length)return null;let r=null,i=1/0;for(let e of n){let n=e.getBoundingClientRect();if(n.height<=0)continue;if(t>=n.top&&t<=n.bottom)return e;let a=t<n.top?n.top-t:t-n.bottom;a<i&&(i=a,r=e)}return r}function cG(e,t,n){let r=t.getBoundingClientRect();if(r.width<=0||r.height<=0||n.clientY<r.top||n.clientY>r.bottom)return null;let i=[{x:n.clientX,y:n.clientY}],a=Math.min(r.right-1,Math.max(r.left+1,n.clientX));a!==n.clientX&&i.unshift({x:a,y:n.clientY});for(let t of i){let n=document.elementFromPoint(t.x,t.y);if(!(n instanceof HTMLElement))continue;let r=sG(e,n);if(r)return r}if(n.target instanceof HTMLElement){let t=sG(e,n.target);if(t)return t}return yBe(t,n.clientY)}var lG=new WeakMap;function bBe(e,t){let n=aG(e.getBoundingClientRect(),t.clientX);e.dataset.richImageDropSide=n}function uG(e){delete e.dataset.richImageDropSide}function xBe(e){let t=lG.get(e);if(t)return t.count+=1,()=>{--t.count,t.count>0||(t.unregister(),lG.delete(e))};let n=e.getRootElement();if(!n)return()=>{};let r=()=>uG(n),i=e.registerCommand(hr,t=>oG(t.dataTransfer)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=`move`),cG(e,n,t)?(bBe(n,t),!0):(uG(n),!0)):!1,3),a=e.registerCommand(dt,t=>{let r=t.dataTransfer?.getData(iG);if(!r)return!1;t.preventDefault(),uG(n);let i=cG(e,n,t);if(!i)return!0;let a=i.getBoundingClientRect(),o=e.getEditorState().read(()=>Bt(i)?.getKey()??null,{editor:e});if(!o)return!0;let s=vBe(aG(n.getBoundingClientRect(),t.clientX)),c=t.clientY<a.top+a.height/2;return e.update(()=>{let e=Dn(r);if(!GN(e)||(e.setLayout(s),r===o))return;e.remove();let t=Dn(o);t&&(c?t.insertBefore(e):t.insertAfter(e))},{tag:`skip-scroll-into-view`}),!0},3),o=e.registerCommand(Je,e=>oG(e.dataTransfer),3);window.addEventListener(`dragend`,r),window.addEventListener(`drop`,r);let s={count:1,unregister:()=>{i(),a(),o(),window.removeEventListener(`dragend`,r),window.removeEventListener(`drop`,r),uG(n)}};return lG.set(e,s),()=>{--s.count,s.count>0||(s.unregister(),lG.delete(e))}}function SBe(){let[e]=ht(),t=yW();(0,G.useEffect)(()=>xBe(e),[e]);let n=(0,G.useCallback)(n=>{let r=t.get(GW).current,i=r?.closest(`.rich-image-wrapper`);if(!r||!n.dataTransfer){n.preventDefault();return}let a=e.getEditorState().read(()=>{let e=Bt(r);return GN(e)?e.getKey():null},{editor:e});a?(n.dataTransfer.setData(iG,a),n.dataTransfer.effectAllowed=`move`,i?.classList.add(tW)):n.preventDefault()},[e,t]);return{draggable:!0,onDragEnd:(0,G.useCallback)(()=>{t.get(GW).current?.closest(`.rich-image-wrapper`)?.classList.remove(tW)},[t]),onDragStart:n}}var CBe={loading:$U.frameLoading,loaded:$U.frameLoaded,error:$U.frameError};function wBe(e){return XEe()===`editor`?(0,K.jsx)(TBe,{...e}):(0,K.jsx)(sW,{...e})}function TBe(e){let[t]=ht();return t.isEditable()?(0,K.jsx)(Xze,{props:e,children:(0,K.jsx)(EBe,{})}):(0,K.jsx)(sW,{...e})}function EBe(){let e=wW(GW),t=TW(zW),n=wW(DW),r=wW(RW),i=TW(RW),a=wW(Yze),o=wW(OW),s=wW(kW),c=wW(AW),l=wW(Jze),u=TW(BW),d=TW(VW),f=TW(WW),p=wW(PW),m=wW(FW),h=wW(IW),g=wW(LW),_=DN({displayWidth:p,fixedWidth:m,fixedHeight:h}),v=SBe(),y=(0,G.useCallback)(e=>{e.stopPropagation();let t=window.scrollY;d(!1),u(!0),f(!0),requestAnimationFrame(()=>{window.scrollTo({top:t})})},[u,d,f]),b=PN(_);return(0,K.jsxs)(`div`,{className:`${GRe} ${$U.editTrigger}`,ref:e,onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:[n?(0,K.jsxs)(`figure`,{className:`${eW} ${$U.root}`,"data-display":FN(_),"data-layout":g,style:b,...v,children:[(0,K.jsxs)(`div`,{className:`${aW} ${$U.frame} ${URe} ${rW[r]} ${CBe[r]}`.trim(),style:a,children:[(0,K.jsx)(`img`,{alt:o,className:`${nW} ${r===`loaded`?iW:``} ${$U.image}`,height:c,loading:`lazy`,src:n,width:s,style:_.mode===`fixed-height`?{width:`auto`,height:`auto`,maxWidth:`100%`,maxHeight:`100%`}:void 0,onError:()=>i(`error`),onLoad:()=>i(`loaded`)}),r===`loading`&&(0,K.jsx)(`span`,{className:`_1n94osfc ${$U.loader}`}),r===`error`&&(0,K.jsx)(`span`,{className:`_1n94osfd ${$U.errorBadge}`,children:`Image failed to load`}),(0,K.jsx)(_Be,{})]}),l&&(0,K.jsx)(`figcaption`,{className:`_1n94osfe ${$U.caption}`,onClick:y,children:l})]}):(0,K.jsx)(mBe,{}),n&&(0,K.jsx)(pBe,{})]})}function dG({children:e}){return(0,K.jsx)(CRe,{fontCssHref:``,children:e})}var DBe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=pG(e.state,n.from);return r.line?OBe(e):r.block?ABe(e):!1};function fG(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var OBe=fG(NBe,0),kBe=fG(hG,0),ABe=fG((e,t)=>hG(e,t,MBe(t)),0);function pG(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var mG=50;function jBe(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-mG,r),o=e.sliceDoc(i,i+mG),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+mG),d=e.sliceDoc(i-mG,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function MBe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function hG(e,t,n=t.selection.ranges){let r=n.map(e=>pG(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>jBe(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function NBe(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=pG(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var gG=dw.define(),PBe=dw.define(),FBe=HC.define(),_G=HC.define({combine(e){return xw(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),vG=JC.define({create(){return OG.empty},update(e,t){let n=t.state.facet(_G),r=t.annotation(gG);if(r){let i=SG.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?CG(o,o.length,n.minDepth,i):EG(o,t.startState.selection),new OG(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(PBe);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(pw.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=SG.fromTransaction(t),o=t.annotation(pw.time),s=t.annotation(pw.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new OG(e.done.map(SG.fromJSON),e.undone.map(SG.fromJSON))}});function IBe(e={}){return[vG,_G.of(e),vO.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?bG:e.inputType==`historyRedo`?xG:null;return n?(e.preventDefault(),n(t)):!1}})]}function yG(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(vG,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var bG=yG(0,!1),xG=yG(1,!1),LBe=yG(0,!0),RBe=yG(1,!0),SG=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&jC.fromJSON(t.changes),[],t.mapped&&AC.fromJSON(t.mapped),t.startSelection&&zC.fromJSON(t.startSelection),t.selectionsAfter.map(zC.fromJSON))}static fromTransaction(t,n){let r=TG;for(let e of t.startState.facet(FBe)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,TG)}static selection(t){return new e(void 0,TG,void 0,void 0,t)}};function CG(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function zBe(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function BBe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function wG(e,t){return e.length?t.length?e.concat(t):e:t}var TG=[],VBe=200;function EG(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-VBe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),CG(e,e.length-1,1e9,n.setSelAfter(r)))}return[SG.selection([t])]}function HBe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function DG(e,t){if(!e.length)return e;let n=e.length,r=TG;for(;n;){let i=UBe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[SG.selection(r)]:TG}function UBe(e,t,n){let r=wG(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):TG,n);if(!e.changes)return SG.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new SG(i,fw.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var WBe=/^(input\.type|delete)($|\.)/,OG=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||WBe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,zBe(s.changes,t.changes))||r==`input.type.compose`)?CG(o,o.length-1,i.minDepth,new SG(t.changes.compose(s.changes),wG(fw.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,TG)):CG(o,o.length,i.minDepth,t),new e(o,TG,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:TG;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&BBe(a[a.length-1],t)?this:new e(EG(this.done,t),this.undone,n,r)}addMapping(t){return new e(DG(this.done,t),DG(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:gG.of({side:e,rest:HBe(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?TG:r.slice(0,r.length-1);return i.mapped&&(n=DG(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:gG.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};OG.empty=new OG(TG,TG);var GBe=[{key:`Mod-z`,run:bG,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:xG,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:xG,preventDefault:!0},{key:`Mod-u`,run:LBe,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:RBe,preventDefault:!0}];function kG(e,t){return zC.create(e.ranges.map(t),e.mainIndex)}function AG(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function jG({state:e,dispatch:t},n){let r=kG(e.selection,n);return!r.eq(e.selection,!0)&&(t(AG(e,r)),!0)}function MG(e,t){return zC.cursor(t?e.to:e.from)}function NG(e,t){return jG(e,n=>n.empty?e.moveByChar(n,t):MG(n,t))}function PG(e){return e.textDirectionAt(e.state.selection.main.head)==qT.LTR}var FG=e=>NG(e,!PG(e)),IG=e=>NG(e,PG(e));function LG(e,t){return jG(e,n=>n.empty?e.moveByGroup(n,t):MG(n,t))}var KBe=e=>LG(e,!PG(e)),qBe=e=>LG(e,PG(e));typeof Intl<`u`&&Intl.Segmenter;function JBe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function RG(e,t,n){let r=gk(e).resolveInner(t.head),i=n?jS.closedBy:jS.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;JBe(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?zk(e,r.from,1):zk(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,zC.cursor(s,n?-1:1)}var YBe=e=>jG(e,t=>RG(e.state,t,!PG(e))),XBe=e=>jG(e,t=>RG(e.state,t,PG(e)));function zG(e,t){return jG(e,n=>{if(!n.empty)return MG(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var BG=e=>zG(e,!1),VG=e=>zG(e,!0);function HG(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(vO.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function UG(e,t){let n=HG(e),{state:r}=e,i=kG(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):MG(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=vO.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(AG(r,i),{effects:a}),!0}var WG=e=>UG(e,!1),GG=e=>UG(e,!0);function KG(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=zC.cursor(r.from+n))}return i}var ZBe=e=>jG(e,t=>KG(e,t,!0)),QBe=e=>jG(e,t=>KG(e,t,!1)),$Be=e=>jG(e,t=>KG(e,t,!PG(e))),eVe=e=>jG(e,t=>KG(e,t,PG(e))),tVe=e=>jG(e,t=>e.moveToLineBoundary(t,!1,!1)),nVe=e=>jG(e,t=>e.moveToLineBoundary(t,!0,!1));function rVe(e,t,n){let r=!1,i=kG(e.selection,t=>{let i=zk(e,t.head,-1)||zk(e,t.head,1)||t.head>0&&zk(e,t.head-1,1)||t.head<e.doc.length&&zk(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?zC.range(t.anchor,a):zC.cursor(a)});return r?(t(AG(e,i)),!0):!1}var iVe=({state:e,dispatch:t})=>rVe(e,t,!1);function qG(e,t,n){let r=kG(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=zC.range(e.head,e.anchor));let r=n(e);return zC.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(AG(e.state,r)),!0)}function JG(e,t){return qG(e,t,n=>e.moveByChar(n,t))}var YG=e=>JG(e,!PG(e)),XG=e=>JG(e,PG(e));function ZG(e,t){return qG(e,t,n=>e.moveByGroup(n,t))}var aVe=e=>ZG(e,!PG(e)),oVe=e=>ZG(e,PG(e)),sVe=e=>{let t=!PG(e);return qG(e,t,n=>RG(e.state,n,t))},cVe=e=>{let t=PG(e);return qG(e,t,n=>RG(e.state,n,t))};function QG(e,t){return qG(e,t,n=>e.moveVertically(n,t))}var $G=e=>QG(e,!1),eK=e=>QG(e,!0);function tK(e,t){return qG(e,t,n=>e.moveVertically(n,t,HG(e).height))}var nK=e=>tK(e,!1),rK=e=>tK(e,!0),lVe=e=>qG(e,!0,t=>KG(e,t,!0)),uVe=e=>qG(e,!1,t=>KG(e,t,!1)),dVe=e=>{let t=!PG(e);return qG(e,t,n=>KG(e,n,t))},fVe=e=>{let t=PG(e);return qG(e,t,n=>KG(e,n,t))},pVe=e=>qG(e,!1,t=>zC.cursor(e.lineBlockAt(t.head).from)),mVe=e=>qG(e,!0,t=>zC.cursor(e.lineBlockAt(t.head).to)),iK=({state:e,dispatch:t})=>(t(AG(e,{anchor:0})),!0),aK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.doc.length})),!0),oK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.selection.main.anchor,head:0})),!0),sK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hVe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),gVe=({state:e,dispatch:t})=>{let n=gK(e).map(({from:t,to:n})=>zC.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:zC.create(n),userEvent:`select`})),!0},_Ve=({state:e,dispatch:t})=>{let n=kG(e.selection,t=>{let n=gk(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return zC.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(AG(e,n)),!0)};function cK(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(AG(n,zC.create(i,i.length-1))),!0)}var vVe=e=>cK(e,!1),yVe=e=>cK(e,!0),bVe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=zC.create([n.main]):n.main.empty||(r=zC.create([zC.cursor(n.main.head)])),r?(t(AG(e,r)),!0):!1};function lK(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=uK(e,o,!1)):o>i&&(n=`delete.forward`,o=uK(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=uK(e,i,!1),a=uK(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:zC.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?vO.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function uK(e,t,n){if(e instanceof vO)for(let r of e.state.facet(vO.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var dK=(e,t,n)=>lK(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=zw(s,a.tabSize)%Ek(a)||Ek(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=DC(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=DC(o.text,c-o.from,!1,!1)+o.from);return c}),fK=e=>dK(e,!1,!0),pK=e=>dK(e,!0,!1),mK=(e,t)=>lK(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=DC(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),hK=e=>mK(e,!1),xVe=e=>mK(e,!0),SVe=e=>lK(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),CVe=e=>lK(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),wVe=e=>lK(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),TVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:vC.of([``,``])},range:zC.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},EVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:DC(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:DC(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:zC.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function gK(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function _K(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of gK(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(zC.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(zC.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:zC.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var DVe=({state:e,dispatch:t})=>_K(e,t,!1),OVe=({state:e,dispatch:t})=>_K(e,t,!0);function vK(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of gK(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var kVe=({state:e,dispatch:t})=>vK(e,t,!1),AVe=({state:e,dispatch:t})=>vK(e,t,!0),jVe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(gK(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=kG(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function MVe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=gk(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(jS.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var yK=bK(!1),NVe=bK(!0);function bK(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&MVe(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new kk(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=Ok(s,r);for(c??=zw(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Dk(t,c)];return o&&l.push(Dk(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:vC.of(l)},range:zC.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function xK(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:zC.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var PVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new kk(e,{overrideIndentation:e=>n[e]??-1}),i=xK(e,(t,i,a)=>{let o=Ok(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Dk(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},SK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(xK(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Tk)})}),{userEvent:`input.indent`})),!0),CK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(xK(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=zw(r,e.tabSize),a=0,o=Dk(e,Math.max(0,i-Ek(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),FVe=e=>(e.setTabFocusMode(),!0),IVe=[{key:`Ctrl-b`,run:FG,shift:YG,preventDefault:!0},{key:`Ctrl-f`,run:IG,shift:XG},{key:`Ctrl-p`,run:BG,shift:$G},{key:`Ctrl-n`,run:VG,shift:eK},{key:`Ctrl-a`,run:tVe,shift:pVe},{key:`Ctrl-e`,run:nVe,shift:mVe},{key:`Ctrl-d`,run:pK},{key:`Ctrl-h`,run:fK},{key:`Ctrl-k`,run:SVe},{key:`Ctrl-Alt-h`,run:hK},{key:`Ctrl-o`,run:TVe},{key:`Ctrl-t`,run:EVe},{key:`Ctrl-v`,run:GG}],LVe=[{key:`ArrowLeft`,run:FG,shift:YG,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:KBe,shift:aVe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:$Be,shift:dVe,preventDefault:!0},{key:`ArrowRight`,run:IG,shift:XG,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:qBe,shift:oVe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:eVe,shift:fVe,preventDefault:!0},{key:`ArrowUp`,run:BG,shift:$G,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:iK,shift:oK},{mac:`Ctrl-ArrowUp`,run:WG,shift:nK},{key:`ArrowDown`,run:VG,shift:eK,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:aK,shift:sK},{mac:`Ctrl-ArrowDown`,run:GG,shift:rK},{key:`PageUp`,run:WG,shift:nK},{key:`PageDown`,run:GG,shift:rK},{key:`Home`,run:QBe,shift:uVe,preventDefault:!0},{key:`Mod-Home`,run:iK,shift:oK},{key:`End`,run:ZBe,shift:lVe,preventDefault:!0},{key:`Mod-End`,run:aK,shift:sK},{key:`Enter`,run:yK,shift:yK},{key:`Mod-a`,run:hVe},{key:`Backspace`,run:fK,shift:fK,preventDefault:!0},{key:`Delete`,run:pK,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:hK,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:xVe,preventDefault:!0},{mac:`Mod-Backspace`,run:CVe,preventDefault:!0},{mac:`Mod-Delete`,run:wVe,preventDefault:!0}].concat(IVe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),RVe=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:YBe,shift:sVe},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:XBe,shift:cVe},{key:`Alt-ArrowUp`,run:DVe},{key:`Shift-Alt-ArrowUp`,run:kVe},{key:`Alt-ArrowDown`,run:OVe},{key:`Shift-Alt-ArrowDown`,run:AVe},{key:`Mod-Alt-ArrowUp`,run:vVe},{key:`Mod-Alt-ArrowDown`,run:yVe},{key:`Escape`,run:bVe},{key:`Mod-Enter`,run:NVe},{key:`Alt-l`,mac:`Ctrl-l`,run:gVe},{key:`Mod-i`,run:_Ve,preventDefault:!0},{key:`Mod-[`,run:CK},{key:`Mod-]`,run:SK},{key:`Mod-Alt-\\`,run:PVe},{key:`Shift-Mod-k`,run:jVe},{key:`Shift-Mod-\\`,run:iVe},{key:`Mod-/`,run:DBe},{key:`Alt-A`,mac:`Ctrl-A`,run:kBe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:FVe}].concat(LVe),zVe={key:`Tab`,run:SK,shift:CK};function wK(e){return new wk(sCe.define(e))}function TK(e){return r(()=>import(`./dist-D26TaXjP.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([29,30,31]),import.meta.url)}var BVe=[J.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return r(()=>import(`./dist-2resm9Wy.js`).then(e=>e.cpp()),__vite__mapDeps([32,30]),import.meta.url)}}),J.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return r(()=>import(`./dist-2resm9Wy.js`).then(e=>e.cpp()),__vite__mapDeps([32,30]),import.meta.url)}}),J.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return TK(`Cassandra`)}}),J.of({name:`CSS`,extensions:[`css`],load(){return r(()=>import(`./dist-Bost_p8b.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([33,1,30]),import.meta.url)}}),J.of({name:`Go`,extensions:[`go`],load(){return r(()=>import(`./dist-462HZ4sr.js`).then(e=>e.go()),__vite__mapDeps([34,30,31]),import.meta.url)}}),J.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return r(()=>import(`./dist-Dr8Mok4z.js`).then(e=>e.html()),__vite__mapDeps([35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`Java`,extensions:[`java`],load(){return r(()=>import(`./dist-CrYVEXMn.js`).then(e=>e.java()),__vite__mapDeps([37,30]),import.meta.url)}}),J.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return r(()=>import(`./dist-B7GHMwWJ.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return r(()=>import(`./dist-Bw8MOHnL.js`).then(e=>e.jinja()),__vite__mapDeps([38,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return r(()=>import(`./dist-B9cyrbzi.js`).then(e=>e.json()),__vite__mapDeps([39,30]),import.meta.url)}}),J.of({name:`JSX`,extensions:[`jsx`],load(){return r(()=>import(`./dist-B7GHMwWJ.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`LESS`,extensions:[`less`],load(){return r(()=>import(`./dist-CAQYce5C.js`).then(e=>e.less()),__vite__mapDeps([40,33,1,30]),import.meta.url)}}),J.of({name:`Liquid`,extensions:[`liquid`],load(){return r(()=>import(`./dist-opUfcW4x.js`).then(e=>e.liquid()),__vite__mapDeps([41,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`MariaDB SQL`,load(){return TK(`MariaSQL`)}}),J.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return r(()=>import(`./dist-CEyDZYnP.js`).then(e=>e.markdown()),__vite__mapDeps([42,31,35,30,33,1,36]),import.meta.url)}}),J.of({name:`MS SQL`,load(){return TK(`MSSQL`)}}),J.of({name:`MySQL`,load(){return TK(`MySQL`)}}),J.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return r(()=>import(`./dist-Dz80ecx_.js`).then(e=>e.php()),__vite__mapDeps([43,30,35,33,1,36,31]),import.meta.url)}}),J.of({name:`PLSQL`,extensions:[`pls`],load(){return TK(`PLSQL`)}}),J.of({name:`PostgreSQL`,load(){return TK(`PostgreSQL`)}}),J.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return r(()=>import(`./dist-N6Hpo5Ed.js`).then(e=>e.python()),__vite__mapDeps([44,30,31]),import.meta.url)}}),J.of({name:`Rust`,extensions:[`rs`],load(){return r(()=>import(`./dist-CJicYh3N.js`).then(e=>e.rust()),__vite__mapDeps([45,30]),import.meta.url)}}),J.of({name:`Sass`,extensions:[`sass`],load(){return r(()=>import(`./dist-DUysbnVD.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([46,30,33,1]),import.meta.url)}}),J.of({name:`SCSS`,extensions:[`scss`],load(){return r(()=>import(`./dist-DUysbnVD.js`).then(e=>e.sass()),__vite__mapDeps([46,30,33,1]),import.meta.url)}}),J.of({name:`SQL`,extensions:[`sql`],load(){return TK(`StandardSQL`)}}),J.of({name:`SQLite`,load(){return TK(`SQLite`)}}),J.of({name:`TSX`,extensions:[`tsx`],load(){return r(()=>import(`./dist-B7GHMwWJ.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return r(()=>import(`./dist-B7GHMwWJ.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return r(()=>import(`./dist-DlFC92UU.js`).then(e=>e.wast()),__vite__mapDeps([47,30]),import.meta.url)}}),J.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return r(()=>import(`./dist-Cfyg-ZFz.js`).then(e=>e.xml()),__vite__mapDeps([48,30]),import.meta.url)}}),J.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return r(()=>import(`./dist-D32zdSlG.js`).then(e=>e.yaml()),__vite__mapDeps([49,30]),import.meta.url)}}),J.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return r(()=>import(`./apl-gfMMiTNf.js`).then(e=>wK(e.apl)),[],import.meta.url)}}),J.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return r(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>wK(e.asciiArmor)),[],import.meta.url)}}),J.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return r(()=>import(`./asn1-DCl_8MCW.js`).then(e=>wK(e.asn1({}))),[],import.meta.url)}}),J.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return r(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>wK(e.asterisk)),[],import.meta.url)}}),J.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return r(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>wK(e.brainfuck)),[],import.meta.url)}}),J.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return r(()=>import(`./cobol-DHLQUbN7.js`).then(e=>wK(e.cobol)),[],import.meta.url)}}),J.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.csharp)),[],import.meta.url)}}),J.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`ClojureScript`,extensions:[`cljs`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return r(()=>import(`./css-CnaYoQib.js`).then(e=>wK(e.gss)),[],import.meta.url)}}),J.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return r(()=>import(`./cmake-84nbDH0I.js`).then(e=>wK(e.cmake)),[],import.meta.url)}}),J.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return r(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>wK(e.coffeeScript)),[],import.meta.url)}}),J.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return r(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>wK(e.commonLisp)),[],import.meta.url)}}),J.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return r(()=>import(`./cypher-p9eYesGn.js`).then(e=>wK(e.cypher)),[],import.meta.url)}}),J.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return r(()=>import(`./python-B_1Jd8HM.js`).then(e=>wK(e.cython)),[],import.meta.url)}}),J.of({name:`Crystal`,extensions:[`cr`],load(){return r(()=>import(`./crystal-Bl6YKCG_.js`).then(e=>wK(e.crystal)),[],import.meta.url)}}),J.of({name:`D`,extensions:[`d`],load(){return r(()=>import(`./d-DWkQyNnU.js`).then(e=>wK(e.d)),[],import.meta.url)}}),J.of({name:`Dart`,extensions:[`dart`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.dart)),[],import.meta.url)}}),J.of({name:`diff`,extensions:[`diff`,`patch`],load(){return r(()=>import(`./diff-ChtP43wD.js`).then(e=>wK(e.diff)),[],import.meta.url)}}),J.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return r(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>wK(e.dockerFile)),__vite__mapDeps([50,51]),import.meta.url)}}),J.of({name:`DTD`,extensions:[`dtd`],load(){return r(()=>import(`./dtd-DTF72YNO.js`).then(e=>wK(e.dtd)),[],import.meta.url)}}),J.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return r(()=>import(`./dylan-S7ucR4pR.js`).then(e=>wK(e.dylan)),[],import.meta.url)}}),J.of({name:`EBNF`,load(){return r(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>wK(e.ebnf)),[],import.meta.url)}}),J.of({name:`ECL`,extensions:[`ecl`],load(){return r(()=>import(`./ecl-BVIeWmwY.js`).then(e=>wK(e.ecl)),[],import.meta.url)}}),J.of({name:`edn`,extensions:[`edn`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`Eiffel`,extensions:[`e`],load(){return r(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>wK(e.eiffel)),[],import.meta.url)}}),J.of({name:`Elm`,extensions:[`elm`],load(){return r(()=>import(`./elm-Cshzl8qu.js`).then(e=>wK(e.elm)),[],import.meta.url)}}),J.of({name:`Erlang`,extensions:[`erl`],load(){return r(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>wK(e.erlang)),[],import.meta.url)}}),J.of({name:`Esper`,load(){return r(()=>import(`./sql-DuQMFDvy.js`).then(e=>wK(e.esper)),[],import.meta.url)}}),J.of({name:`Factor`,extensions:[`factor`],load(){return r(()=>import(`./factor-LKH5gN8L.js`).then(e=>wK(e.factor)),__vite__mapDeps([52,51]),import.meta.url)}}),J.of({name:`FCL`,load(){return r(()=>import(`./fcl-ClOhbFR7.js`).then(e=>wK(e.fcl)),[],import.meta.url)}}),J.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return r(()=>import(`./forth-D6RzAl64.js`).then(e=>wK(e.forth)),[],import.meta.url)}}),J.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return r(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>wK(e.fortran)),[],import.meta.url)}}),J.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.fSharp)),[],import.meta.url)}}),J.of({name:`Gas`,extensions:[`s`],load(){return r(()=>import(`./gas-BHEdbvp9.js`).then(e=>wK(e.gas)),[],import.meta.url)}}),J.of({name:`Gherkin`,extensions:[`feature`],load(){return r(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>wK(e.gherkin)),[],import.meta.url)}}),J.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return r(()=>import(`./groovy-CUrWKPia.js`).then(e=>wK(e.groovy)),[],import.meta.url)}}),J.of({name:`Haskell`,extensions:[`hs`],load(){return r(()=>import(`./haskell-BRsoo5mP.js`).then(e=>wK(e.haskell)),[],import.meta.url)}}),J.of({name:`Haxe`,extensions:[`hx`],load(){return r(()=>import(`./haxe-DjVOVvNP.js`).then(e=>wK(e.haxe)),[],import.meta.url)}}),J.of({name:`HXML`,extensions:[`hxml`],load(){return r(()=>import(`./haxe-DjVOVvNP.js`).then(e=>wK(e.hxml)),[],import.meta.url)}}),J.of({name:`HTTP`,load(){return r(()=>import(`./http-CLVgA2GD.js`).then(e=>wK(e.http)),[],import.meta.url)}}),J.of({name:`IDL`,extensions:[`pro`],load(){return r(()=>import(`./idl-BUZw3wgd.js`).then(e=>wK(e.idl)),[],import.meta.url)}}),J.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return r(()=>import(`./javascript-lS2r2ifg.js`).then(e=>wK(e.jsonld)),[],import.meta.url)}}),J.of({name:`Julia`,extensions:[`jl`],load(){return r(()=>import(`./julia-CQfgDRfP.js`).then(e=>wK(e.julia)),[],import.meta.url)}}),J.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.kotlin)),[],import.meta.url)}}),J.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return r(()=>import(`./livescript-BXxG0Yva.js`).then(e=>wK(e.liveScript)),[],import.meta.url)}}),J.of({name:`Lua`,extensions:[`lua`],load(){return r(()=>import(`./lua-DPCEkfD_.js`).then(e=>wK(e.lua)),[],import.meta.url)}}),J.of({name:`mIRC`,extensions:[`mrc`],load(){return r(()=>import(`./mirc-C9zpzAZU.js`).then(e=>wK(e.mirc)),[],import.meta.url)}}),J.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return r(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>wK(e.mathematica)),[],import.meta.url)}}),J.of({name:`Modelica`,extensions:[`mo`],load(){return r(()=>import(`./modelica-CqHI_q-D.js`).then(e=>wK(e.modelica)),[],import.meta.url)}}),J.of({name:`MUMPS`,extensions:[`mps`],load(){return r(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>wK(e.mumps)),[],import.meta.url)}}),J.of({name:`Mbox`,extensions:[`mbox`],load(){return r(()=>import(`./mbox-BEMVcqjs.js`).then(e=>wK(e.mbox)),[],import.meta.url)}}),J.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return r(()=>import(`./nginx-C-ORUuei.js`).then(e=>wK(e.nginx)),[],import.meta.url)}}),J.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return r(()=>import(`./nsis-viPvXFiq.js`).then(e=>wK(e.nsis)),__vite__mapDeps([53,51]),import.meta.url)}}),J.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return r(()=>import(`./ntriples-CzMBulkp.js`).then(e=>wK(e.ntriples)),[],import.meta.url)}}),J.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.objectiveC)),[],import.meta.url)}}),J.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.objectiveCpp)),[],import.meta.url)}}),J.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.oCaml)),[],import.meta.url)}}),J.of({name:`Octave`,extensions:[`m`],load(){return r(()=>import(`./octave-D2Q8cUp1.js`).then(e=>wK(e.octave)),[],import.meta.url)}}),J.of({name:`Oz`,extensions:[`oz`],load(){return r(()=>import(`./oz-BwTct_5T.js`).then(e=>wK(e.oz)),[],import.meta.url)}}),J.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return r(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>wK(e.pascal)),[],import.meta.url)}}),J.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return r(()=>import(`./perl-BkSkiI9m.js`).then(e=>wK(e.perl)),[],import.meta.url)}}),J.of({name:`Pig`,extensions:[`pig`],load(){return r(()=>import(`./pig-AF4Hwhju.js`).then(e=>wK(e.pig)),[],import.meta.url)}}),J.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return r(()=>import(`./powershell-D8WpQPaX.js`).then(e=>wK(e.powerShell)),[],import.meta.url)}}),J.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return r(()=>import(`./properties-C357ku5U.js`).then(e=>wK(e.properties)),[],import.meta.url)}}),J.of({name:`ProtoBuf`,extensions:[`proto`],load(){return r(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>wK(e.protobuf)),[],import.meta.url)}}),J.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return r(()=>import(`./pug-BqCHZ5xT.js`).then(e=>wK(e.pug)),__vite__mapDeps([54,55]),import.meta.url)}}),J.of({name:`Puppet`,extensions:[`pp`],load(){return r(()=>import(`./puppet-BZyAS7I4.js`).then(e=>wK(e.puppet)),[],import.meta.url)}}),J.of({name:`Q`,extensions:[`q`],load(){return r(()=>import(`./q-B9NhS7L_.js`).then(e=>wK(e.q)),[],import.meta.url)}}),J.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return r(()=>import(`./r-CxDmU1I4.js`).then(e=>wK(e.r)),[],import.meta.url)}}),J.of({name:`RPM Changes`,load(){return r(()=>import(`./rpm-gpDK5sbt.js`).then(e=>wK(e.rpmChanges)),[],import.meta.url)}}),J.of({name:`RPM Spec`,extensions:[`spec`],load(){return r(()=>import(`./rpm-gpDK5sbt.js`).then(e=>wK(e.rpmSpec)),[],import.meta.url)}}),J.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return r(()=>import(`./ruby-ChfNwlCY.js`).then(e=>wK(e.ruby)),[],import.meta.url)}}),J.of({name:`SAS`,extensions:[`sas`],load(){return r(()=>import(`./sas-C2OyD2Y6.js`).then(e=>wK(e.sas)),[],import.meta.url)}}),J.of({name:`Scala`,extensions:[`scala`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.scala)),[],import.meta.url)}}),J.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return r(()=>import(`./scheme-D9qYN0V5.js`).then(e=>wK(e.scheme)),[],import.meta.url)}}),J.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return r(()=>import(`./shell-DwuoZtxw.js`).then(e=>wK(e.shell)),[],import.meta.url)}}),J.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return r(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>wK(e.sieve)),[],import.meta.url)}}),J.of({name:`Smalltalk`,extensions:[`st`],load(){return r(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>wK(e.smalltalk)),[],import.meta.url)}}),J.of({name:`Solr`,load(){return r(()=>import(`./solr-B78wSQJQ.js`).then(e=>wK(e.solr)),[],import.meta.url)}}),J.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.sml)),[],import.meta.url)}}),J.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return r(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>wK(e.sparql)),[],import.meta.url)}}),J.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return r(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>wK(e.spreadsheet)),[],import.meta.url)}}),J.of({name:`Squirrel`,extensions:[`nut`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.squirrel)),[],import.meta.url)}}),J.of({name:`Stylus`,extensions:[`styl`],load(){return r(()=>import(`./stylus-BOVgKnng.js`).then(e=>wK(e.stylus)),[],import.meta.url)}}),J.of({name:`Swift`,extensions:[`swift`],load(){return r(()=>import(`./swift-DKB6_1j6.js`).then(e=>wK(e.swift)),[],import.meta.url)}}),J.of({name:`sTeX`,load(){return r(()=>import(`./stex-DNzd62Q_.js`).then(e=>wK(e.stex)),[],import.meta.url)}}),J.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return r(()=>import(`./stex-DNzd62Q_.js`).then(e=>wK(e.stex)),[],import.meta.url)}}),J.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return r(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>wK(e.verilog)),[],import.meta.url)}}),J.of({name:`Tcl`,extensions:[`tcl`],load(){return r(()=>import(`./tcl-BGfruO1u.js`).then(e=>wK(e.tcl)),[],import.meta.url)}}),J.of({name:`Textile`,extensions:[`textile`],load(){return r(()=>import(`./textile-C4jVoHG1.js`).then(e=>wK(e.textile)),[],import.meta.url)}}),J.of({name:`TiddlyWiki`,load(){return r(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>wK(e.tiddlyWiki)),[],import.meta.url)}}),J.of({name:`Tiki wiki`,load(){return r(()=>import(`./tiki-CvUEFusT.js`).then(e=>wK(e.tiki)),[],import.meta.url)}}),J.of({name:`TOML`,extensions:[`toml`],load(){return r(()=>import(`./toml-BPTmHmyx.js`).then(e=>wK(e.toml)),[],import.meta.url)}}),J.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return r(()=>import(`./troff-C2dAgh7P.js`).then(e=>wK(e.troff)),[],import.meta.url)}}),J.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return r(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>wK(e.ttcn)),[],import.meta.url)}}),J.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return r(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>wK(e.ttcnCfg)),[],import.meta.url)}}),J.of({name:`Turtle`,extensions:[`ttl`],load(){return r(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>wK(e.turtle)),[],import.meta.url)}}),J.of({name:`Web IDL`,extensions:[`webidl`],load(){return r(()=>import(`./webidl-D5jiJvOU.js`).then(e=>wK(e.webIDL)),[],import.meta.url)}}),J.of({name:`VB.NET`,extensions:[`vb`],load(){return r(()=>import(`./vb-BthdM_4N.js`).then(e=>wK(e.vb)),[],import.meta.url)}}),J.of({name:`VBScript`,extensions:[`vbs`],load(){return r(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>wK(e.vbScript)),[],import.meta.url)}}),J.of({name:`Velocity`,extensions:[`vtl`],load(){return r(()=>import(`./velocity-CqftRsjg.js`).then(e=>wK(e.velocity)),[],import.meta.url)}}),J.of({name:`Verilog`,extensions:[`v`],load(){return r(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>wK(e.verilog)),[],import.meta.url)}}),J.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return r(()=>import(`./vhdl-kS471soi.js`).then(e=>wK(e.vhdl)),[],import.meta.url)}}),J.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return r(()=>import(`./xquery-BKJx4mf9.js`).then(e=>wK(e.xQuery)),[],import.meta.url)}}),J.of({name:`Yacas`,extensions:[`ys`],load(){return r(()=>import(`./yacas-CXXgtw0p.js`).then(e=>wK(e.yacas)),[],import.meta.url)}}),J.of({name:`Z80`,extensions:[`z80`],load(){return r(()=>import(`./z80-Co3PbHdE.js`).then(e=>wK(e.z80)),[],import.meta.url)}}),J.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.mscgen)),[],import.meta.url)}}),J.of({name:`Xù`,extensions:[`xu`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.xu)),[],import.meta.url)}}),J.of({name:`MsGenny`,extensions:[`msgenny`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.msgenny)),[],import.meta.url)}}),J.of({name:`Vue`,extensions:[`vue`],load(){return r(()=>import(`./dist-gLcMD1Nm.js`).then(e=>e.vue()),__vite__mapDeps([56,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`Angular Template`,load(){return r(()=>import(`./dist-CNry8POH.js`).then(e=>e.angular()),__vite__mapDeps([57,35,30,33,1,36,31]),import.meta.url)}})],VVe={c:[`c`],cpp:[`c++`,`cpp`],cs:[`c#`,`csharp`],js:[`javascript`],jsx:[`javascript jsx`,`jsx`],md:[`markdown`],py:[`python`],sh:[`shell`,`bash`],ts:[`typescript`],tsx:[`typescript jsx`,`tsx`],yml:[`yaml`],zsh:[`shell`,`bash`]};function HVe(e){let t=e===`plaintext`?`text`:e;return[t,...VVe[t]??[]]}async function UVe(e){if(e===`text`)return[];let t=HVe(e);for(let e of t){let t=J.matchLanguageName(BVe,e,!0);if(t)try{return await t.load()}catch{}}return[]}function WVe(e){let{main:t}=e.state.selection;return t.empty?e.state.doc.lineAt(t.head).number===1:!1}function GVe(e){let{main:t}=e.state.selection;return t.empty?e.state.doc.lineAt(t.head).number===e.state.doc.lines:!1}var KVe=vO.theme({"&":{backgroundColor:`transparent`},"&.cm-editor":{outline:`none`},"&.cm-editor.cm-focused":{outline:`none`},"&.cm-editor .cm-gutters":{backgroundColor:`var(--cm-gutter-bg, transparent)`,border:`none`},".cm-scroller":{overflow:`auto`,fontFamily:`inherit`},".cm-content":{minHeight:`1.5em`},".cm-selectionBackground":{backgroundColor:`rgba(125, 125, 125, 0.26) !important`}});function qVe(e){return e&&e.trim().toLowerCase()||`text`}var JVe={"":!0,text:!0,plaintext:!0,plain:!0,txt:!0},YVe={sh:!0,bash:!0,shell:!0,zsh:!0,console:!0};function XVe(e,t){let n=e.trim().toLowerCase();return Object.hasOwn(JVe,n)?`text`:Object.hasOwn(YVe,n)&&!t.trimEnd().includes(`
198
+ `)}}var DU=(0,G.createContext)({});function CRe({apiUrl:e,fontCssHref:t,saveSnapshot:n,uploadFile:r,children:i}){let a=(0,G.useMemo)(()=>({apiUrl:e,fontCssHref:t,saveSnapshot:n,uploadFile:r}),[e,t,n,r]);return(0,K.jsx)(DU.Provider,{value:a,children:i})}function OU(){return(0,G.use)(DU)}function kU(e){return!e||typeof e!=`object`?null:!Array.isArray(e.elements)&&e.data!==void 0?kU(e.data):{type:`excalidraw`,elements:Array.isArray(e.elements)?e.elements:[],appState:e.appState??{},files:e.files??{}}}function AU(e){return e.elements.filter(e=>!e.isDeleted).length}function jU(e,t){let n=e;return e.startsWith(`http`)||e.startsWith(`blob:`)||TU(e)?{fetchUrl:e,refLine:n}:e.startsWith(`ref:`)&&t?{fetchUrl:`${t}/objects/${e.slice(4)}`,refLine:n}:{error:e.startsWith(`ref:`)?`Missing apiUrl for ref resolution`:`Unrecognized snapshot format`}}function MU(e,t){switch(e.type){case`inline`:return{type:`inline`,snapshot:e.data};case`remote`:{let n=jU(e.url,t);return`error`in n?{type:`error`,error:n.error}:{type:`remote`,fetchUrl:n.fetchUrl,refLine:n.refLine}}case`delta`:{let n=jU(e.baseUrl,t);return`error`in n?{type:`error`,error:n.error}:{type:`incremental`,fetchUrl:n.fetchUrl,refLine:n.refLine,delta:e.delta}}}}function wRe(e,t){if(!e.trim())return{type:`empty`};let n=EU(e);return n?MU(n,t):{type:`error`,error:`Unrecognized snapshot format`}}function NU(e){let{apiUrl:t}=OU(),n=(0,G.useMemo)(()=>e==null?{type:`empty`}:typeof e==`string`?wRe(e,t):MU(e,t),[e,t]),[i,a]=(0,G.useState)(),[o,s]=(0,G.useState)(),[c,l]=(0,G.useState)(n.type===`remote`||n.type===`incremental`),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(0),m=(0,G.useCallback)(()=>p(e=>e+1),[]);return(0,G.useEffect)(()=>{if(n.type!==`remote`&&n.type!==`incremental`)return;let{fetchUrl:e}=n,t=n.type===`incremental`?n.delta:void 0,i=!1;return l(!0),d(``),fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(async e=>{if(!i){if(s(e),(t?Object.keys(t):[]).length>0){let{patch:n}=await r(async()=>{let{patch:e}=await import(`./lib-DJrc3aG3.js`);return{patch:e}},[],import.meta.url);if(i)return;let o=n(structuredClone(e),t);a(o)}else a(e);l(!1)}}).catch(e=>{i||(d(e instanceof Error?e.message:`Failed to load`),l(!1))}),()=>{i=!0}},[n,f]),n.type===`inline`?{snapshot:n.snapshot,loading:!1,error:``,retry:m,retryable:!1}:n.type===`remote`||n.type===`incremental`?{snapshot:i,loading:c,error:u,retry:m,retryable:!!u,baseRef:n.refLine,baseData:o}:n.type===`error`?{snapshot:void 0,loading:!1,error:n.error,retry:m,retryable:!1}:{snapshot:void 0,loading:!1,error:``,retry:m,retryable:!1}}var TRe=`https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont/style.css`;function PU(){let{fontCssHref:e=TRe}=OU();(0,G.useEffect)(()=>{if(!e||typeof document>`u`||document.head.querySelector(`link[href="${CSS.escape(e)}"]`))return;let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=e,document.head.append(t)},[e])}var ERe=({elementCount:e})=>{let t=e?`Whiteboard · ${e} elements`:`Whiteboard`;return(0,K.jsxs)(`div`,{"aria-label":t,className:cRe,children:[(0,K.jsx)(Fr,{"aria-hidden":!0,className:lRe}),(0,K.jsx)(`span`,{children:t})]})},FU=()=>(0,K.jsx)(`div`,{"aria-busy":!0,className:uRe,children:(0,K.jsx)(`span`,{children:`Loading whiteboard…`})}),IU=()=>(0,K.jsx)(`div`,{className:dRe,children:(0,K.jsx)(`span`,{children:`Empty whiteboard`})}),LU=({message:e,onRetry:t})=>(0,K.jsxs)(`div`,{className:fRe,role:`alert`,children:[(0,K.jsx)(x,{"aria-hidden":!0,className:pRe}),(0,K.jsx)(`span`,{children:e}),t&&(0,K.jsx)(`button`,{className:`_1xd3mo4a`,type:`button`,onClick:t,children:`Retry`})]}),DRe=CU({WhiteboardDisplayRenderer:()=>RU}),RU=({onExpand:e,snapshot:t})=>{let n=lF(),{snapshot:r,loading:i,error:a,retry:o,retryable:s}=NU(t),c=(0,G.useMemo)(()=>kU(r),[r]);PU();let l=(0,G.useCallback)(t=>{e&&c&&e({content:(0,K.jsx)(bn,{mode:`fullscreen`,scene:c,theme:n}),elementCount:AU(c),target:t,theme:n})},[e,c,n]),u;return u=i?(0,K.jsx)(FU,{}):a?(0,K.jsx)(LU,{message:a,onRetry:s?o:void 0}):r?c?AU(c)===0?(0,K.jsx)(IU,{}):(0,K.jsx)(ORe,{fallback:(0,K.jsx)(LU,{message:`Failed to render whiteboard`}),children:(0,K.jsx)(bn,{scene:c,theme:n,onExpand:e?l:void 0})}):(0,K.jsx)(LU,{message:`Invalid whiteboard data`}):(0,K.jsx)(IU,{}),(0,K.jsx)(`div`,{className:oRe,"data-theme":n,children:u})},ORe=class extends G.Component{constructor(...e){super(...e),Cr(this,`state`,{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}},kRe=(0,G.lazy)(()=>Promise.resolve().then(()=>DRe).then(e=>({default:e.WhiteboardDisplayRenderer})));function ARe(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&Array.isArray(t.elements))return t.elements.filter(e=>!e?.isDeleted).length}catch{}}var zU=({snapshot:e})=>(0,K.jsx)(`div`,{className:sRe,children:(0,K.jsx)(ERe,{elementCount:ARe(e)})}),jRe=({onExpand:e,snapshot:t})=>(0,K.jsx)(at,{fallback:(0,K.jsx)(zU,{snapshot:t}),children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(zU,{snapshot:t}),children:(0,K.jsx)(kRe,{snapshot:t,onExpand:e})})}),BU=class e extends wr{static getType(){return`excalidraw`}static clone(t){return new e(t.__snapshot,t.__key)}constructor(e,t){super(t),Cr(this,`__snapshot`,void 0),this.__snapshot=e}createDOM(e){let t=document.createElement(`div`);return t.className=`rich-excalidraw-wrapper`,t}updateDOM(){return!1}isInline(){return!1}static importJSON(e){return MRe(e.snapshot).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),type:`excalidraw`,snapshot:this.__snapshot,version:1}}getSnapshot(){return this.__snapshot}setSnapshot(e){let t=this.getWritable();t.__snapshot=e}decorate(e,t){return qj(aRe,jRe,{snapshot:this.__snapshot})}};function MRe(e){return new BU(e)}function NRe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function PRe(e){var t=NRe(e,`string`);return typeof t==`symbol`?t:String(t)}function FRe(e,t,n){return t=PRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VU(Object(n),!0).forEach(function(t){FRe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UU(e,t){var n={};for(var r in e)n[r]=t(e[r],r);return n}var IRe=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},LRe=e=>{var t=t=>{var n=e.defaultClassName,r=HU(HU({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)IRe(c,r,e.defaultVariants)&&(n+=` `+l);return n};return t.variants=()=>Object.keys(e.variantClassNames),t.classNames={get base(){return e.defaultClassName.split(` `)[0]},get variants(){return UU(e.variantClassNames,e=>UU(e,e=>e.split(` `)[0]))}},t},WU={root:`rich-alert`,header:`rich-alert-header`,icon:`rich-alert-icon`,label:`rich-alert-label`,content:`rich-alert-content`,contentEditable:`rich-alert-content-editable`},GU={root:{note:`rich-alert-note`,tip:`rich-alert-tip`,important:`rich-alert-important`,warning:`rich-alert-warning`,caution:`rich-alert-caution`},header:{note:`rich-alert-header-note`,tip:`rich-alert-header-tip`,important:`rich-alert-header-important`,warning:`rich-alert-header-warning`,caution:`rich-alert-header-caution`}},KU=LRe({defaultClassName:`pq4lod1`,variantClassNames:{type:{note:`pq4lod2`,tip:`pq4lod3`,important:`pq4lod4`,warning:`pq4lod5`,caution:`pq4lod6`}},defaultVariants:{},compoundVariants:[]}),qU=`pq4lod7`,RRe=`pq4lod8`,zRe=`pq4lod9`,JU=`pq4loda`,YU=`pq4lodb`,BRe=`pq4lodc`,XU={note:m,tip:gi,important:xi,warning:x,caution:wi},ZU={note:`Note`,tip:`Tip`,important:`Important`,warning:`Warning`,caution:`Caution`},VRe=[`note`,`tip`,`important`,`warning`,`caution`],QU=({type:e})=>{let t=XU[e],n=ZU[e];return(0,K.jsxs)(`div`,{className:`${qU} ${KU({type:e})} ${WU.header} ${GU.header[e]}`,children:[(0,K.jsx)(t,{className:`${JU} ${WU.icon}`}),(0,K.jsx)(`span`,{className:`${YU} ${WU.label}`,children:n})]})},HRe=({type:e,editable:t,onTypeChange:n})=>{if(!t||!n)return(0,K.jsx)(QU,{type:e});let r=XU[e],i=ZU[e];return(0,K.jsx)(`div`,{className:`${qU} ${KU({type:e})} ${WU.header} ${GU.header[e]}`,children:(0,K.jsxs)(Zn,{children:[(0,K.jsxs)(On,{"aria-label":`Alert type: ${i}`,className:RRe,children:[(0,K.jsx)(r,{className:`${JU} ${WU.icon}`}),(0,K.jsx)(`span`,{className:`${YU} ${WU.label}`,children:i}),(0,K.jsx)(l,{className:zRe})]}),(0,K.jsx)(Rt,{align:`start`,sideOffset:8,children:(0,K.jsx)(M,{value:e,onValueChange:t=>{t!==e&&n(t)},children:VRe.map(e=>{let t=XU[e];return(0,K.jsxs)(pn,{value:e,children:[(0,K.jsx)(t,{className:`${BRe} ${KU({type:e})}`}),(0,K.jsx)(`span`,{children:ZU[e]})]},e)})})})]})})},$U={root:`rr-image-root`,frame:`rr-image-frame`,frameLoading:`rr-image-loading`,frameLoaded:`rr-image-loaded`,frameError:`rr-image-error`,image:`rr-image-img`,loader:`rr-image-loader`,errorBadge:`rr-image-error`,caption:`rr-image-caption`,editTrigger:`rr-image-edit-trigger`,editPlaceholder:`rr-image-edit-placeholder`,editToolbar:`rr-image-edit-toolbar`,editToolbarVisible:`rr-image-edit-toolbar-visible`,resizeHandle:`rr-image-resize-handle`,inspector:`rr-image-inspector`},eW=`_1n94osf0`,tW=`_1n94osf1`,nW=`_1n94osf3`,rW={loading:`_1n94osf4`,loaded:`_1n94osf5`,error:`_1n94osf6`},iW=`_1n94osf7`,aW=`_1n94osf8`,URe=`_1n94osf9`,WRe=`_1n94osfa`,GRe=`_1n94osfm`,KRe=`_1n94osfn`,qRe=`_1n94osfo`,JRe=`_1n94osfp`,oW=`_1n94osfq`,YRe=`_1n94osfr`,XRe=`_1n94osfs`,ZRe=`_1n94osft`,QRe=`_1n94osfv`,$Re=`_1n94osfw`,eze=`_1n94osfx`,tze=`_1n94osfy`,nze=`_1n94osfz`,rze=`_1n94osf10`,ize=`_1n94osf11`,aze=`_1n94osf12`,oze=`_1n94osf13`,sze=`_1n94osf14`,cze={loading:$U.frameLoading,loaded:$U.frameLoaded,error:$U.frameError};function lze(e,t){if(t)return t;if(e&&(e.startsWith(`!`)||e.startsWith(`¡`)))return e.slice(1)}function sW({src:e,altText:t,width:n,height:r,caption:i,thumbhash:a,accent:o,displayWidth:s,fixedWidth:c,fixedHeight:l,layout:u,onActivate:d,ref:f}){let[p,m]=(0,G.useState)(`loading`),h=(0,G.useRef)(null),g=(0,G.useMemo)(()=>lze(t,i),[t,i]),_=(0,G.useMemo)(()=>a?$j(a):void 0,[a]);if(!e)return null;let v=!!d,y=DN({displayWidth:s,fixedWidth:c,fixedHeight:l}),b=y.mode===`percent`||y.mode===`fixed-width`,x={backgroundColor:p!==`loaded`&&!_?o||Ht.color.bgTertiary:`transparent`,backgroundImage:_&&p!==`loaded`?`url(${_})`:void 0,backgroundSize:`cover`,width:b?`100%`:n?Math.min(n,1200):void 0,maxWidth:`100%`,maxHeight:y.mode===`fixed-height`?`${y.px}px`:void 0,...n&&r?{aspectRatio:`${n} / ${r}`}:{}},S=()=>{h.current&&d?.(h.current)},C=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S())},w=PN(y);return(0,K.jsxs)(`figure`,{className:`${eW} ${$U.root}`,"data-display":FN(y),"data-layout":u,ref:f,style:w,children:[(0,K.jsxs)(`div`,{"aria-label":v?`Open image: ${t||`image`}`:void 0,className:`${aW} ${v?``:WRe} ${$U.frame} ${rW[p]} ${cze[p]}`.trim(),role:v?`button`:void 0,style:x,tabIndex:v?0:void 0,onClick:v?S:void 0,onKeyDown:v?C:void 0,children:[(0,K.jsx)(`img`,{alt:t,className:`${nW} ${p===`loaded`?iW:``} ${$U.image}`,"data-state":p,height:r,loading:`lazy`,ref:h,src:e,width:n,style:y.mode===`fixed-height`?{width:`auto`,height:`auto`,maxWidth:`100%`,maxHeight:`100%`}:n&&r?{height:`100%`,objectFit:`cover`}:void 0,onError:()=>m(`error`),onLoad:()=>m(`loaded`)}),p===`loading`&&(0,K.jsx)(`span`,{className:`_1n94osfc ${$U.loader}`}),p===`error`&&(0,K.jsx)(`span`,{className:`_1n94osfd ${$U.errorBadge}`,children:`Image failed to load`})]}),g&&(0,K.jsx)(`figcaption`,{className:`_1n94osfe ${$U.caption}`,children:g})]})}var uze=0;function cW(e,t){let n=`atom${++uze}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=dze,r.write=fze),t&&(r.write=t),r}function dze(e){return e(this)}function fze(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function lW(e){return`init`in e}function pze(e){return typeof e.write==`function`}function mze(e){return!!e.onMount}function uW(e){return`v`in e||`e`in e}function dW(e){if(`e`in e)throw e.e;return e.v}function fW(e){return typeof e?.then==`function`}function hze(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function pW(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function mW(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function gze(e){return!!e.INTERNAL_onInit}var _ze=(e,t,n,...r)=>n.read(...r),vze=(e,t,n,...r)=>n.write(...r),yze=(e,t,n)=>n.INTERNAL_onInit(t),bze=(e,t,n,r)=>n.onMount?.(r),xze=(e,t,n)=>{let r=e.a,i=r.get(n);if(!i){let a=e.h,o=e.I;i={d:new Map,p:new Set,n:0},r.set(n,i),a.i?.(n),gze(n)&&o(e,t,n)}return i},Sze=(e,t)=>{let n=e.m,r=e.c,i=e.q,a=e.Q,o=e.h,s=e.C;if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw typeof AggregateError==`function`?AggregateError(c):Object.assign(Error(),{errors:c})},Cze=(e,t)=>{let n=e.m,r=e.i,i=e.c,a=e.e,o=e.r,s=e.D;if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o))f.pop(),p.pop();else if(u.has(o))r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();else{u.add(o);for(let r of mW(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},wze=(e,t,n)=>{let r=e.m,i=e.i,a=e.c,o=e.h,s=e.R,c=e.e,l=e.f,u=e.C,d=e.r,f=e.D,p=e.v,m=e.H,h=e.E,g=c(e,t,n),_=h[0];if(uW(g)){if(r.has(n)&&i.get(n)!==g.n||g.m===_)return g.m=_,g;let a=!1;for(let[n,r]of g.d)if(d(e,t,n).n!==r){a=!0;break}if(!a)return g.m=_,g}let v=!0,y=new Set(g.d.keys()),b=()=>{for(let e of y)g.d.delete(e)},x=()=>{if(r.has(n)){let r=!a.size;f(e,t,n),r&&(u(e,t),l(e,t))}},S=i=>{if(i===n){let n=c(e,t,i);if(!uW(n)){if(lW(i))p(e,t,i,i.init);else throw Error(`no atom init`)}return dW(n)}let a=d(e,t,i);try{return dW(a)}finally{y.delete(i),g.d.set(i,a.n),fW(g.v)&&pW(n,g.v,a),r.has(n)&&r.get(i)?.t.add(n),v||x()}},C,w={get signal(){return C||=new AbortController,C.signal}},T=g.n,E=i.get(n)===T;try{let r=s(e,t,n,S,w);if(p(e,t,n,r),fW(r)){m(e,t,r,()=>C?.abort());let n=()=>{b(),x()};r.then(n,n)}else b();return o.r?.(n),g.m=_,g}catch(e){if(hze(e))throw e;return delete g.v,g.e=e,++g.n,g.m=_,g}finally{v=!1,g.n!==T&&E&&(i.set(n,g.n),a.add(n),o.c?.(n))}},Tze=(e,t,n)=>{let r=e.m,i=e.i,a=e.e,o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of mW(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},Eze=(e,t,n,r)=>{let i=e.c,a=e.h,o=e.W,s=e.e,c=e.f,l=e.C,u=e.r,d=e.d,f=e.w,p=e.D,m=e.v,h=e.E,g=!0,_=n=>dW(u(e,t,n)),v=(r,...o)=>{let u=s(e,t,r);try{if(r===n){if(!lW(r))throw Error(`atom not writable`);let n=u.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==u.n&&(++h[0],i.add(r),d(e,t,r),a.c?.(r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},Dze=(e,t,n)=>{let r=e.m,i=e.c,a=e.h,o=e.e,s=e.d,c=e.t,l=e.T,u=o(e,t,n),d=r.get(n);if(d){for(let[r,l]of u.d)if(!d.d.has(r)){let u=o(e,t,r);c(e,t,r).t.add(n),d.d.add(r),l!==u.n&&(i.add(r),s(e,t,r),a.c?.(r))}for(let r of d.d)u.d.has(r)||(d.d.delete(r),l(e,t,r)?.t.delete(n))}},Oze=(e,t,n)=>{let r=e.m,i=e.q,a=e.h,o=e.M,s=e.e,c=e.f,l=e.C,u=e.r,d=e.w,f=e.t,p=s(e,t,n),m=r.get(n);if(!m){u(e,t,n);for(let r of p.d.keys())f(e,t,r).t.add(n);m={l:new Set,d:new Set(p.d.keys()),t:new Set},r.set(n,m),pze(n)&&mze(n)&&i.add(()=>{let r=!0,i=(...i)=>{try{return d(e,t,n,i)}finally{r||(l(e,t),c(e,t))}};try{let a=o(e,t,n,i);a&&(m.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),a.m?.(n)}return m},kze=(e,t,n)=>{let r=e.m,i=e.Q,a=e.h,o=e.e,s=e.T,c=o(e,t,n),l=r.get(n);if(!l||l.l.size)return l;let u=!1;for(let e of l.t)if(r.get(e)?.d.has(n)){u=!0;break}if(u)return l;l.u&&i.add(l.u),l=void 0,r.delete(n);for(let r of c.d.keys())s(e,t,r)?.t.delete(n);a.u?.(n)},Aze=(e,t,n,r)=>{let i=e.e,a=e.A,o=i(e,t,n),s=`v`in o,c=o.v;if(fW(r))for(let a of o.d.keys())pW(n,r,i(e,t,a));o.v=r,delete o.e,s&&Object.is(c,o.v)||(++o.n,fW(c)&&a(e,t,c))},jze=(e,t,n)=>{let r=e.r;return dW(r(e,t,n))},Mze=(e,t,n,...r)=>{let i=e.c,a=e.f,o=e.C,s=e.w,c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},Nze=(e,t,n,r)=>{let i=e.f,a=e.C,o=e.t,s=e.T,c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},Pze=(e,t,n,r)=>{let i=e.p,a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},Fze=(e,t,n)=>{e.p.get(n)?.forEach(e=>e())},hW=new WeakMap;function Ize(e){let t=hW.get(e),n=t.B;return n?n(t,e):t}function Lze(e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=Object.freeze({a:new WeakMap,m:new WeakMap,i:new WeakMap,c:new Set,q:new Set,Q:new Set,h:{},R:_ze,W:vze,I:yze,M:bze,e:xze,f:Sze,C:Cze,r:wze,d:Tze,w:Eze,D:Dze,t:Oze,T:kze,v:Aze,g:jze,s:Mze,b:Nze,B:void 0,p:new WeakMap,H:Pze,A:Fze,E:[0],...e});hW.set(t,n);let r=n.g,i=n.s,a=n.b;return t}function gW(){return Lze()}var _W;function Rze(){return _W||=gW(),_W}var vW=(0,G.createContext)(void 0);function yW(e){let t=(0,G.useContext)(vW);return e?.store||t||Rze()}function zze({children:e,store:t}){let n=(0,G.useRef)(null);return t?(0,G.createElement)(vW.Provider,{value:t},e):(n.current===null&&(n.current=gW()),(0,G.createElement)(vW.Provider,{value:n.current},e))}var bW=e=>typeof e?.then==`function`,xW=new WeakMap,Bze=(e,t,n)=>{let r=Ize(e),i=r.H,a=xW.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();bW(t)?(xW.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),xW.set(t,a)),a},SW=(e,t,n)=>[n,e,t,r=>{let i=e.sub(t,r),a=!0;try{a=!Object.is(n,e.get(t))}catch{}return a&&r(),i}];function Vze(e,t){let n=yW(t),[[r,i,a,o],s]=(0,G.useReducer)(t=>{let r=n.get(e);return t[1]===n&&t[2]===e?Object.is(t[0],r)?t:[r,n,e,t[3]]:SW(n,e,r)},void 0,()=>SW(n,e,n.get(e))),c=r;return(i!==n||a!==e)&&(s(),c=n.get(e)),(0,G.useEffect)(()=>o(s),[o]),(0,G.useDebugValue)(c),bW(c)?Bze(n,c,()=>n.get(e)):c}var CW=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Hze=G.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(CW(e),e)});function wW(e,t){let{unstable_promiseStatus:n=!G.use}=t||{},r=Vze(e,t);return bW(r)?(n&&CW(r),Hze(r)):r}function TW(e,t){let n=yW(t);return(0,G.useCallback)((...t)=>n.set(e,...t),[n,e])}function EW(e,t){return[wW(e,t),TW(e,t)]}function Uze(e,t){if(t)return t;if(e&&(e.startsWith(`!`)||e.startsWith(`¡`)))return e.slice(1)}var DW=cW(``),OW=cW(``),kW=cW(),AW=cW(),jW=cW(),MW=cW(),NW=cW(),PW=cW(),FW=cW(),IW=cW(),LW=cW(),RW=cW(`loading`),zW=cW(!1),BW=cW(!1),VW=cW(!1),Wze=cW(!1),Gze=cW(!1),HW=cW(!1),UW=cW(e=>e(zW)||e(BW)||e(VW)||e(Wze)||e(Gze)||e(HW)),WW=cW(!1),GW=cW({current:null}),Kze=cW({current:null}),qze=cW(e=>{let t=e(MW);return t?$j(t):void 0}),Jze=cW(e=>Uze(e(OW),e(jW))),Yze=cW(e=>{let t=e(qze),n=e(NW),r=e(RW),i=e(kW),a=e(AW),o=e(PW),s=e(FW),c=e(IW),l=o!==void 0||s!==void 0;return{backgroundColor:r!==`loaded`&&!t?n||`#f5f5f5`:`transparent`,backgroundImage:t&&r!==`loaded`?`url(${t})`:void 0,backgroundSize:`cover`,width:l?`100%`:i?Math.min(i,1200):void 0,maxWidth:`100%`,maxHeight:c===void 0?void 0:`${c}px`,...i&&a?{aspectRatio:`${i} / ${a}`}:{}}});function Xze({props:e,children:t}){let[n]=ht(),r=(0,G.useRef)(null),i=(0,G.useRef)(null),[a]=(0,G.useState)(()=>{let t=gW();return t.set(DW,e.src),t.set(OW,e.altText),t.set(kW,e.width),t.set(AW,e.height),t.set(jW,e.caption),t.set(MW,e.thumbhash),t.set(NW,e.accent),t.set(PW,e.displayWidth),t.set(FW,e.fixedWidth),t.set(IW,e.fixedHeight),t.set(LW,e.layout),t.set(GW,r),t.set(Kze,i),t.set(RW,e.src?`loading`:`error`),t.set(VW,!e.src&&!!e.autoOpenOnMount),t});return(0,G.useEffect)(()=>{a.set(DW,e.src),a.set(OW,e.altText),a.set(kW,e.width),a.set(AW,e.height),a.set(jW,e.caption),a.set(MW,e.thumbhash),a.set(NW,e.accent),a.set(PW,e.displayWidth),a.set(FW,e.fixedWidth),a.set(IW,e.fixedHeight),a.set(LW,e.layout)},[a,e.src,e.altText,e.width,e.height,e.caption,e.thumbhash,e.accent,e.displayWidth,e.fixedWidth,e.fixedHeight,e.layout]),(0,G.useEffect)(()=>{a.set(RW,e.src?`loading`:`error`)},[a,e.src]),(0,G.useEffect)(()=>{if(!e.autoOpenOnMount)return;let t=r.current;t&&n.update(()=>{let e=Bt(t);GN(e)&&e.setShouldAutoOpenOnMount(!1)},{tag:[un,pee]})},[n,e.autoOpenOnMount]),(0,K.jsx)(zze,{store:a,children:t})}var KW=e=>{e.preventDefault(),e.stopPropagation()};function qW({children:e,label:t,icon:n=!0,...r}){return(0,K.jsxs)(Mn,{children:[(0,K.jsx)(tt,{render:(0,K.jsx)(Fe,{"aria-label":t,icon:n,size:`md`,onMouseDown:KW,...r}),children:e}),(0,K.jsx)(Fn,{side:`top`,children:t})]})}function JW(){let e=yW(),[t]=ht(),n=(0,G.useCallback)(n=>{let r=e.get(GW);r.current&&t.update(()=>{let e=Bt(r.current);GN(e)&&n(e)},{tag:`skip-scroll-into-view`})},[t,e]),r=(0,G.useCallback)(()=>{e.set(VW,!1)},[e]),i=(0,G.useCallback)(()=>{let n=e.get(GW);n.current&&(t.update(()=>{let e=Bt(n.current);e&&e.remove()}),e.set(BW,!1),r())},[r,t,e]),a=(0,G.useCallback)(()=>{let t=e.get(DW);t&&window.open(t,`_blank`,`noopener,noreferrer`)},[e]),o=(0,G.useCallback)(()=>{let t=e.get(DW);if(!t)return;let n=document.createElement(`a`);n.href=t,n.download=e.get(OW)||`image`,n.click()},[e]),s=(0,G.useCallback)(()=>{n(e=>{let t=WN({src:e.getSrc(),altText:e.getAltText(),width:e.getWidth(),height:e.getHeight(),caption:e.getCaption(),thumbhash:e.getThumbhash(),accent:e.getAccent(),displayWidth:e.getDisplayWidth(),fixedWidth:e.getFixedWidth(),fixedHeight:e.getFixedHeight(),layout:e.getLayout()});e.insertAfter(t)})},[n]),c=(0,G.useCallback)(e=>{n(t=>{t.applyDisplaySize(e)})},[n]),l=(0,G.useCallback)(e=>{n(t=>{t.setLayout(e)})},[n]);return{closeReplacePanel:r,handleReplaceOpenChange:(0,G.useCallback)(t=>{e.set(VW,t),t||r()},[r,e]),handleOpen:a,handleDuplicate:s,handleDownload:o,handleDelete:i,handleSetDisplaySize:c,handleSetLayout:l}}function YW({onOpenChange:e}){let[t]=ht(),{handleDuplicate:n,handleOpen:r,handleDownload:i,handleDelete:a}=JW();return(0,K.jsxs)(Zn,{onOpenChange:t=>e?.(t),children:[(0,K.jsx)(On,{render:(0,K.jsx)(Fe,{icon:!0,"aria-label":`More actions`,size:`md`,onMouseDown:KW}),children:(0,K.jsx)(Nr,{})}),(0,K.jsxs)(Rt,{align:`end`,children:[(0,K.jsxs)(Ut,{onClick:n,children:[(0,K.jsx)(Vte,{}),`Duplicate`]}),(0,K.jsxs)(Ut,{onClick:r,children:[(0,K.jsx)(Xte,{}),`Open original`]}),(0,K.jsxs)(Ut,{onClick:i,children:[(0,K.jsx)(f,{}),`Download`]}),(0,K.jsx)(ur,{}),(0,K.jsxs)(Ut,{shortcut:`Backspace`,variant:`destructive`,onClick:()=>{a(),Pe({title:`Image deleted`,action:{label:`Undo`,onClick:()=>t.dispatchCommand(U,void 0)}})},children:[(0,K.jsx)(Mr,{}),`Delete`]})]})]})}var Zze=/^(?:javascript\s*:|vbscript\s*:|data\s*:(?!image\/))/i;function XW(e){return e.trim()!==``&&!Zze.test(e.trim())}function Qze({focus:e,menu:t,onApply:n,onKeyDown:r,onOpenChange:i,open:a,renderWidth:o,trigger:s,values:c}){let l=(0,G.useId)(),u=(0,G.useRef)(null),f=(0,G.useRef)(null),[p,m]=(0,G.useState)(c.altText),[h,g]=(0,G.useState)(c.caption),[_,v]=(0,G.useState)(c.src),{apply:y,revert:b}=Tee(c,a,n);(0,G.useEffect)(()=>{a&&(m(c.altText),g(c.caption),v(c.src))},[a]);let x=!XW(_),S=e===`caption`?f:e===`alt`?u:void 0;return(0,K.jsxs)(gn,{open:a,onOpenChange:(e,t)=>{!e&&t?.reason===`escape-key`&&b(),i(e)},children:[(0,K.jsx)(en,{render:s}),(0,K.jsxs)(yn,{flush:!0,className:`${QRe} ${$U.inspector}`,initialFocus:S,side:`bottom`,size:`md`,onKeyDown:r,children:[(0,K.jsx)(wn,{actions:t,icon:(0,K.jsx)(d,{}),title:`Image`}),(0,K.jsxs)(Xn,{children:[o?.(e=>y({size:e})),(0,K.jsx)(Kn,{id:`${l}-alt`,label:`Alt text`,children:(0,K.jsx)(ct,{id:`${l}-alt`,placeholder:`Describe the image`,ref:u,value:p,onChange:e=>{m(e.target.value),y({altText:e.target.value})}})}),(0,K.jsx)(Kn,{hint:`Optional`,id:`${l}-caption`,label:`Caption`,children:(0,K.jsx)(ct,{id:`${l}-caption`,ref:f,value:h,onChange:e=>{g(e.target.value),y({caption:e.target.value})}})}),(0,K.jsx)(Kn,{error:x?`Enter an image URL`:void 0,id:`${l}-src`,label:`Source URL`,children:(0,K.jsx)(ct,{"aria-describedby":x?`${l}-src-error`:void 0,id:`${l}-src`,invalid:x,type:`url`,value:_,onChange:e=>{v(e.target.value),XW(e.target.value)&&y({src:e.target.value.trim()})}})})]}),(0,K.jsxs)(Bn,{hint:`Changes apply as you type`,children:[(0,K.jsx)(ar,{keys:`Esc`,size:`sm`,tone:`muted`}),(0,K.jsx)(`span`,{className:$Re,children:`revert`})]})]})]})}function ZW(e){let t=e.closest(`.rich-image-wrapper`)?.parentElement??e.parentElement;if(!t)return;let n=getComputedStyle(t),r=t.clientWidth-Number.parseFloat(n.paddingLeft)-Number.parseFloat(n.paddingRight);return r>0?r:void 0}function $ze(e,t,n){if(!e)return;let r=ZW(e);if(!r)return;let i=e.querySelector(`.${$U.frame}`)?.getBoundingClientRect();return{containerWidth:r,intrinsicWidth:t,intrinsicHeight:n,renderedWidth:i?.width,renderedHeight:i?.height}}function eBe(e,t,n){let r=e.querySelector(`figure`),i=t===`float-left`||t===`float-right`,a=e.closest(`.rich-image-wrapper`);r?.style.removeProperty(`--rich-image-display-width`),r?.style.removeProperty(`--rich-image-display-height`);let o=PN(n);if(r&&o)for(let[e,t]of Object.entries(o))r.style.setProperty(e,t);i&&a&&(n.mode===`percent`?(a.style.width=`${n.value}%`,a.style.maxWidth=``):n.mode===`fixed-width`?(a.style.width=`${n.px}px`,a.style.maxWidth=`100%`):n.mode===`fixed-height`?(a.style.width=`auto`,a.style.maxWidth=`100%`):(a.style.width=``,a.style.maxWidth=``))}var QW=cW(null),tBe=[25,50,75,100],$W=10,eG=100,nBe=3,rBe=[{value:`auto`,label:`Auto`},{value:`percent`,label:`%`},{value:`px`,label:`px`}];function iBe(e){for(let t of tBe)if(Math.abs(e-t)<=nBe)return t;return e}function tG(e){switch(e.mode){case`percent`:return`${e.value}%`;case`fixed-width`:case`fixed-height`:return`${e.px}px`;default:return`Auto`}}function aBe(){let e=wW(PW),t=wW(FW),n=wW(IW);return(0,G.useMemo)(()=>DN({displayWidth:e,fixedWidth:t,fixedHeight:n}),[e,t,n])}function oBe(){let[e]=ht(),t=yW();return(0,G.useCallback)((n,r)=>{let i=t.get(GW).current;i&&e.update(()=>{let e=Bt(i);GN(e)&&(n.src!==void 0&&e.setSrc(n.src),n.altText!==void 0&&e.setAltText(n.altText),n.caption!==void 0&&e.setCaption(n.caption||void 0),n.size&&e.applyDisplaySize(n.size))},{tag:r?[un,`skip-scroll-into-view`]:`skip-scroll-into-view`})},[e,t])}function sBe({size:e,onChange:t}){let n=(0,G.useId)(),r=yW(),i=wW(kW),a=wW(AW),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(null);(0,G.useEffect)(()=>{s(null),l(null)},[e]);let u=()=>$ze(r.get(GW).current,i,a),d=e.mode===`auto`?`auto`:e.mode===`percent`?`percent`:`px`,f=n=>{if(n===d)return;if(n===`auto`){t({mode:`auto`});return}let r=u();if(n===`percent`){t(r?NN(e,`percent`,r):{mode:`percent`,value:100});return}if(r){t(NN(e,`fixed-width`,r));return}let a=EN(i);a&&t({mode:`fixed-width`,px:a})},p=e=>{let t=r.get(GW).current;t&&eBe(t,r.get(LW),e)},m=(()=>{if(e.mode===`percent`)return e.value;let t=u();if(!t)return;let{widthPx:n}=MN(e,t);return n?TN(n/t.containerWidth*100):void 0})(),h=o??m??eG,g=`${(h-$W)/90*100}%`,_=()=>{o!==null&&o!==m&&t({mode:`percent`,value:o})},v=e.mode===`fixed-width`||e.mode===`fixed-height`?e.px:void 0,y=e.mode===`fixed-height`?`Height in pixels`:`Width in pixels`;return(0,K.jsxs)(`div`,{className:aze,children:[(0,K.jsx)(`span`,{className:oze,id:`${n}-label`,children:`Width`}),(0,K.jsxs)(`div`,{"aria-labelledby":`${n}-label`,className:sze,role:`group`,children:[(0,K.jsx)(xt,{items:rBe,value:d,onChange:f}),d===`percent`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{"aria-label":`Width, percent of content width`,className:`_1n94osfu`,max:eG,min:$W,step:1,style:{"--fill":g},type:`range`,value:h,onBlur:_,onKeyUp:_,onPointerUp:_,onChange:e=>{let t=iBe(Number(e.target.value));s(t),p({mode:`percent`,value:t})}}),(0,K.jsx)(`span`,{className:`_1n94osf15`,children:`${h}%`})]}),d===`px`&&(0,K.jsxs)(`span`,{className:`_1n94osf17`,children:[(0,K.jsx)(ct,{"aria-label":y,autoComplete:`off`,inputMode:`numeric`,invalid:c!==null&&EN(Number(c))===void 0,spellCheck:!1,value:c??String(v??``),onChange:n=>{l(n.target.value);let r=EN(Number(n.target.value));r&&(e.mode===`fixed-width`||e.mode===`fixed-height`)&&t({mode:e.mode,px:r})}}),(0,K.jsx)(`span`,{className:`_1n94osf18`,children:`px`})]}),d===`auto`&&(0,K.jsx)(`span`,{className:`_1n94osf16`,children:`Natural size`})]})]})}function cBe(){let[e,t]=EW(BW),[n,r]=EW(QW),[i,a]=EW(WW),o=wW(DW),s=wW(OW),c=wW(jW),u=aBe(),d=oBe(),f=(0,G.useMemo)(()=>({src:o,altText:s,caption:c??``,size:u}),[o,s,c,u]);return(0,K.jsx)(Qze,{focus:i?`caption`:n,menu:(0,K.jsx)(YW,{}),open:e,renderWidth:e=>(0,K.jsx)(sBe,{size:u,onChange:e}),values:f,trigger:(0,K.jsxs)(Fe,{"aria-label":`Image size, ${tG(u)}`,className:rze,size:`md`,onClick:()=>r(null),onMouseDown:KW,children:[(0,K.jsx)(`span`,{children:tG(u)}),(0,K.jsx)(l,{className:ize})]}),onApply:d,onOpenChange:e=>{t(e),e||(r(null),a(!1))}})}var lBe=[{value:void 0,label:`Center`,Icon:Tne},{value:`align-left`,label:`Align left`,Icon:Dne},{value:`align-right`,label:`Align right`,Icon:Ene},{value:`float-left`,label:`Wrap left`,Icon:kne},{value:`float-right`,label:`Wrap right`,Icon:jte}];function uBe(){let e=wW(LW),{handleSetLayout:t}=JW();return(0,K.jsx)(`div`,{"aria-label":`Image layout`,className:eze,role:`group`,children:lBe.map(({value:n,label:r,Icon:i})=>(0,K.jsx)(qW,{"aria-pressed":e===n,label:r,onClick:()=>{e!==n&&t(n)},children:(0,K.jsx)(i,{})},n??`center`))})}var dBe=6e3;function nG(){let[e]=ht(),t=yW(),n=wje(),r=iL(),i=We(),a=(0,G.useRef)(!1);return(0,G.useCallback)(async()=>{if(a.current)return;a.current=!0;let o=t.get(GW).current,s=t=>{o&&e.update(()=>{let e=Bt(o);GN(e)&&t(e)},{tag:`skip-scroll-into-view`})};try{let e=hL(r),t=(await NL({editor:e,mode:`replace`,portalClassName:i.className,theme:i.theme}))?.[0];if(!t)return;if(t.kind===`url`){s(e=>{e.setSrc(t.src),e.setDimensions(t.width,t.height),e.setThumbhash(void 0)});return}let[a]=e?[t.file]:await lL([t.file],`replace`,r?.ref.current??null);if(!a)return;let o=async()=>{let e=Pe({title:`Uploading image…`,tone:`loading`});try{let t=n??IL,[r,i]=await Promise.all([PL(t,a),Qj(a)]);s(e=>{e.setSrc(r.src),e.setAltText(r.altText??a.name),e.setDimensions(r.width??i.width,r.height??i.height),e.setThumbhash(r.thumbhash??i.thumbhash)}),Et(e,{title:`Image replaced`,tone:`success`})}catch(t){console.error(`[ImageReplace]`,t),Et(e,{action:{label:`Retry`,onClick:()=>void o()},duration:dBe,title:`Image replace failed`,tone:`error`})}};await o()}finally{a.current=!1}},[e,i,r,t,n])}function fBe(){let[e]=ht(),t=yW(),[n,r]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{let n=t.get(GW).current;if(!n)return;let i=()=>e.read(()=>{let e=kr();if(!Ue(e))return!1;let t=Bt(n);return t!==null&&e.has(t.getKey())}),a=()=>{let e=i();r(e),e?n.dataset.selected=``:delete n.dataset.selected},o=t=>{t.target?.closest(`.${$U.editToolbar}`)||e.update(()=>{let e=Bt(n);if(!e)return;let t=sr();t.add(e.getKey()),Jt(t)},{tag:`skip-scroll-into-view`})};a(),n.addEventListener(`click`,o);let s=e.registerUpdateListener(a);return()=>{n.removeEventListener(`click`,o),s(),delete n.dataset.selected}},[e,t]),n}function rG(){return(0,K.jsx)(`span`,{"aria-hidden":!0,className:tze})}function pBe(){let e=wW(UW),t=fBe(),[n,r]=(0,G.useState)(!1),i=TW(BW),a=TW(QW),o=nG(),s=e||t||n;return(0,K.jsxs)(`div`,{"aria-label":`Image`,className:`${qRe} ${$U.editToolbar} ${s?`${JRe} ${$U.editToolbarVisible}`:``}`,role:`toolbar`,children:[(0,K.jsx)(cBe,{}),(0,K.jsx)(rG,{}),(0,K.jsx)(uBe,{}),(0,K.jsx)(rG,{}),(0,K.jsx)(qW,{className:nze,icon:!1,label:`Alt text`,onClick:()=>{a(`alt`),i(!0)},children:`Alt`}),(0,K.jsx)(qW,{label:`Replace image`,onClick:()=>void o(),children:(0,K.jsx)(Gne,{})}),(0,K.jsx)(rG,{}),(0,K.jsx)(YW,{onOpenChange:r})]})}function mBe(){let[e,t]=EW(VW),n=nG();return(0,G.useEffect)(()=>{e&&(t(!1),n())},[n,e,t]),(0,K.jsxs)(`button`,{className:`${KRe} ${$U.editPlaceholder}`,type:`button`,onClick:()=>void n(),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,K.jsx)(d,{size:24}),(0,K.jsx)(`span`,{children:`Click to add image`})]})}var hBe=3;function gBe(){let e=yW(),[t]=ht(),n=(0,G.useRef)(null);return(0,G.useEffect)(()=>()=>n.current?.(!1),[]),{handlePointerDown:(0,G.useCallback)((r,i)=>{let a=e.get(GW).current;if(!a)return;let o=a.querySelector(`.${$U.frame}`),s=a.querySelector(`figure`),c=a.closest(`.rich-image-wrapper`);if(!o||!s)return;let l=ZW(a),u=o.getBoundingClientRect().width;if(!l||l<=0||!u)return;r.preventDefault(),r.stopPropagation();let d=e.get(LW),f=d===void 0?2:1,p=d===`float-left`||d===`float-right`,m=r.clientX,h=r.currentTarget;try{h.setPointerCapture(r.pointerId)}catch{}e.set(HW,!0);let g=document.body.style.userSelect;document.body.style.userSelect=`none`;let _=o.getBoundingClientRect().height,v=u>0&&_>0?_/u:void 0,y=DN({displayWidth:e.get(PW),fixedWidth:e.get(FW),fixedHeight:e.get(IW)}).mode,b=IN(y,u,_,l),x=!1,S=e=>{let t=PN(e);if(s.style.removeProperty(`--rich-image-display-width`),s.style.removeProperty(`--rich-image-display-height`),t)for(let[e,n]of Object.entries(t))s.style.setProperty(e,n);p&&c&&(e.mode===`percent`?(c.style.width=`${e.value}%`,c.style.maxWidth=``):e.mode===`fixed-width`?(c.style.width=`${e.px}px`,c.style.maxWidth=`100%`):e.mode===`fixed-height`&&(c.style.width=`auto`,c.style.maxWidth=`100%`))},C=e=>{let t=e.clientX-m;if(!x&&Math.abs(t)<hBe)return;x=!0;let n=i===`left`?-t:t,r=u+n*f,a=v?r*v:_;b=IN(y,r,a,l),S(b)},w=r=>{n.current===w&&(n.current=null,h.removeEventListener(`pointermove`,C),h.removeEventListener(`pointerup`,T),h.removeEventListener(`pointercancel`,T),document.body.style.userSelect=g,e.set(HW,!1),r&&x&&t.update(()=>{let e=Bt(a);GN(e)&&e.applyDisplaySize(b)},{tag:`skip-scroll-into-view`}))},T=()=>w(!0);n.current=w,h.addEventListener(`pointermove`,C),h.addEventListener(`pointerup`,T),h.addEventListener(`pointercancel`,T)},[t,e])}}function _Be(){let e=wW(UW),{handlePointerDown:t}=gBe(),n=e?ZRe:``;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`${oW} ${YRe} ${n} ${$U.resizeHandle}`.trim(),onPointerDown:e=>t(e,`left`)}),(0,K.jsx)(`span`,{className:`${oW} ${XRe} ${n} ${$U.resizeHandle}`.trim(),onPointerDown:e=>t(e,`right`)})]})}var iG=`application/x-haklex-image-drag`;function aG(e,t){return t<e.left+e.width/2?`left`:`right`}function vBe(e){return e===`left`?`float-left`:`float-right`}function oG(e){return!!e?.types.includes(iG)}function sG(e,t){let n=e.getRootElement();if(!n)return null;let r=t;for(;r&&r!==n;){if(r.parentElement===n)return r;r=r.parentElement}return null}function yBe(e,t){let n=[...e.children].filter(e=>e instanceof HTMLElement);if(!n.length)return null;let r=null,i=1/0;for(let e of n){let n=e.getBoundingClientRect();if(n.height<=0)continue;if(t>=n.top&&t<=n.bottom)return e;let a=t<n.top?n.top-t:t-n.bottom;a<i&&(i=a,r=e)}return r}function cG(e,t,n){let r=t.getBoundingClientRect();if(r.width<=0||r.height<=0||n.clientY<r.top||n.clientY>r.bottom)return null;let i=[{x:n.clientX,y:n.clientY}],a=Math.min(r.right-1,Math.max(r.left+1,n.clientX));a!==n.clientX&&i.unshift({x:a,y:n.clientY});for(let t of i){let n=document.elementFromPoint(t.x,t.y);if(!(n instanceof HTMLElement))continue;let r=sG(e,n);if(r)return r}if(n.target instanceof HTMLElement){let t=sG(e,n.target);if(t)return t}return yBe(t,n.clientY)}var lG=new WeakMap;function bBe(e,t){let n=aG(e.getBoundingClientRect(),t.clientX);e.dataset.richImageDropSide=n}function uG(e){delete e.dataset.richImageDropSide}function xBe(e){let t=lG.get(e);if(t)return t.count+=1,()=>{--t.count,t.count>0||(t.unregister(),lG.delete(e))};let n=e.getRootElement();if(!n)return()=>{};let r=()=>uG(n),i=e.registerCommand(hr,t=>oG(t.dataTransfer)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=`move`),cG(e,n,t)?(bBe(n,t),!0):(uG(n),!0)):!1,3),a=e.registerCommand(dt,t=>{let r=t.dataTransfer?.getData(iG);if(!r)return!1;t.preventDefault(),uG(n);let i=cG(e,n,t);if(!i)return!0;let a=i.getBoundingClientRect(),o=e.getEditorState().read(()=>Bt(i)?.getKey()??null,{editor:e});if(!o)return!0;let s=vBe(aG(n.getBoundingClientRect(),t.clientX)),c=t.clientY<a.top+a.height/2;return e.update(()=>{let e=Dn(r);if(!GN(e)||(e.setLayout(s),r===o))return;e.remove();let t=Dn(o);t&&(c?t.insertBefore(e):t.insertAfter(e))},{tag:`skip-scroll-into-view`}),!0},3),o=e.registerCommand(Je,e=>oG(e.dataTransfer),3);window.addEventListener(`dragend`,r),window.addEventListener(`drop`,r);let s={count:1,unregister:()=>{i(),a(),o(),window.removeEventListener(`dragend`,r),window.removeEventListener(`drop`,r),uG(n)}};return lG.set(e,s),()=>{--s.count,s.count>0||(s.unregister(),lG.delete(e))}}function SBe(){let[e]=ht(),t=yW();(0,G.useEffect)(()=>xBe(e),[e]);let n=(0,G.useCallback)(n=>{let r=t.get(GW).current,i=r?.closest(`.rich-image-wrapper`);if(!r||!n.dataTransfer){n.preventDefault();return}let a=e.getEditorState().read(()=>{let e=Bt(r);return GN(e)?e.getKey():null},{editor:e});a?(n.dataTransfer.setData(iG,a),n.dataTransfer.effectAllowed=`move`,i?.classList.add(tW)):n.preventDefault()},[e,t]);return{draggable:!0,onDragEnd:(0,G.useCallback)(()=>{t.get(GW).current?.closest(`.rich-image-wrapper`)?.classList.remove(tW)},[t]),onDragStart:n}}var CBe={loading:$U.frameLoading,loaded:$U.frameLoaded,error:$U.frameError};function wBe(e){return XEe()===`editor`?(0,K.jsx)(TBe,{...e}):(0,K.jsx)(sW,{...e})}function TBe(e){let[t]=ht();return t.isEditable()?(0,K.jsx)(Xze,{props:e,children:(0,K.jsx)(EBe,{})}):(0,K.jsx)(sW,{...e})}function EBe(){let e=wW(GW),t=TW(zW),n=wW(DW),r=wW(RW),i=TW(RW),a=wW(Yze),o=wW(OW),s=wW(kW),c=wW(AW),l=wW(Jze),u=TW(BW),d=TW(VW),f=TW(WW),p=wW(PW),m=wW(FW),h=wW(IW),g=wW(LW),_=DN({displayWidth:p,fixedWidth:m,fixedHeight:h}),v=SBe(),y=(0,G.useCallback)(e=>{e.stopPropagation();let t=window.scrollY;d(!1),u(!0),f(!0),requestAnimationFrame(()=>{window.scrollTo({top:t})})},[u,d,f]),b=PN(_);return(0,K.jsxs)(`div`,{className:`${GRe} ${$U.editTrigger}`,ref:e,onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:[n?(0,K.jsxs)(`figure`,{className:`${eW} ${$U.root}`,"data-display":FN(_),"data-layout":g,style:b,...v,children:[(0,K.jsxs)(`div`,{className:`${aW} ${$U.frame} ${URe} ${rW[r]} ${CBe[r]}`.trim(),style:a,children:[(0,K.jsx)(`img`,{alt:o,className:`${nW} ${r===`loaded`?iW:``} ${$U.image}`,height:c,loading:`lazy`,src:n,width:s,style:_.mode===`fixed-height`?{width:`auto`,height:`auto`,maxWidth:`100%`,maxHeight:`100%`}:void 0,onError:()=>i(`error`),onLoad:()=>i(`loaded`)}),r===`loading`&&(0,K.jsx)(`span`,{className:`_1n94osfc ${$U.loader}`}),r===`error`&&(0,K.jsx)(`span`,{className:`_1n94osfd ${$U.errorBadge}`,children:`Image failed to load`}),(0,K.jsx)(_Be,{})]}),l&&(0,K.jsx)(`figcaption`,{className:`_1n94osfe ${$U.caption}`,onClick:y,children:l})]}):(0,K.jsx)(mBe,{}),n&&(0,K.jsx)(pBe,{})]})}function dG({children:e}){return(0,K.jsx)(CRe,{fontCssHref:``,children:e})}var DBe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=pG(e.state,n.from);return r.line?OBe(e):r.block?ABe(e):!1};function fG(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var OBe=fG(NBe,0),kBe=fG(hG,0),ABe=fG((e,t)=>hG(e,t,MBe(t)),0);function pG(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var mG=50;function jBe(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-mG,r),o=e.sliceDoc(i,i+mG),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+mG),d=e.sliceDoc(i-mG,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function MBe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function hG(e,t,n=t.selection.ranges){let r=n.map(e=>pG(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>jBe(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function NBe(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=pG(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var gG=dw.define(),PBe=dw.define(),FBe=HC.define(),_G=HC.define({combine(e){return xw(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),vG=JC.define({create(){return OG.empty},update(e,t){let n=t.state.facet(_G),r=t.annotation(gG);if(r){let i=SG.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?CG(o,o.length,n.minDepth,i):EG(o,t.startState.selection),new OG(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(PBe);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(pw.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=SG.fromTransaction(t),o=t.annotation(pw.time),s=t.annotation(pw.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new OG(e.done.map(SG.fromJSON),e.undone.map(SG.fromJSON))}});function IBe(e={}){return[vG,_G.of(e),vO.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?bG:e.inputType==`historyRedo`?xG:null;return n?(e.preventDefault(),n(t)):!1}})]}function yG(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(vG,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var bG=yG(0,!1),xG=yG(1,!1),LBe=yG(0,!0),RBe=yG(1,!0),SG=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&jC.fromJSON(t.changes),[],t.mapped&&AC.fromJSON(t.mapped),t.startSelection&&zC.fromJSON(t.startSelection),t.selectionsAfter.map(zC.fromJSON))}static fromTransaction(t,n){let r=TG;for(let e of t.startState.facet(FBe)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,TG)}static selection(t){return new e(void 0,TG,void 0,void 0,t)}};function CG(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function zBe(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function BBe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function wG(e,t){return e.length?t.length?e.concat(t):e:t}var TG=[],VBe=200;function EG(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-VBe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),CG(e,e.length-1,1e9,n.setSelAfter(r)))}return[SG.selection([t])]}function HBe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function DG(e,t){if(!e.length)return e;let n=e.length,r=TG;for(;n;){let i=UBe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[SG.selection(r)]:TG}function UBe(e,t,n){let r=wG(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):TG,n);if(!e.changes)return SG.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new SG(i,fw.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var WBe=/^(input\.type|delete)($|\.)/,OG=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||WBe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,zBe(s.changes,t.changes))||r==`input.type.compose`)?CG(o,o.length-1,i.minDepth,new SG(t.changes.compose(s.changes),wG(fw.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,TG)):CG(o,o.length,i.minDepth,t),new e(o,TG,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:TG;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&BBe(a[a.length-1],t)?this:new e(EG(this.done,t),this.undone,n,r)}addMapping(t){return new e(DG(this.done,t),DG(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:gG.of({side:e,rest:HBe(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?TG:r.slice(0,r.length-1);return i.mapped&&(n=DG(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:gG.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};OG.empty=new OG(TG,TG);var GBe=[{key:`Mod-z`,run:bG,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:xG,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:xG,preventDefault:!0},{key:`Mod-u`,run:LBe,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:RBe,preventDefault:!0}];function kG(e,t){return zC.create(e.ranges.map(t),e.mainIndex)}function AG(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function jG({state:e,dispatch:t},n){let r=kG(e.selection,n);return!r.eq(e.selection,!0)&&(t(AG(e,r)),!0)}function MG(e,t){return zC.cursor(t?e.to:e.from)}function NG(e,t){return jG(e,n=>n.empty?e.moveByChar(n,t):MG(n,t))}function PG(e){return e.textDirectionAt(e.state.selection.main.head)==qT.LTR}var FG=e=>NG(e,!PG(e)),IG=e=>NG(e,PG(e));function LG(e,t){return jG(e,n=>n.empty?e.moveByGroup(n,t):MG(n,t))}var KBe=e=>LG(e,!PG(e)),qBe=e=>LG(e,PG(e));typeof Intl<`u`&&Intl.Segmenter;function JBe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function RG(e,t,n){let r=gk(e).resolveInner(t.head),i=n?jS.closedBy:jS.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;JBe(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?zk(e,r.from,1):zk(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,zC.cursor(s,n?-1:1)}var YBe=e=>jG(e,t=>RG(e.state,t,!PG(e))),XBe=e=>jG(e,t=>RG(e.state,t,PG(e)));function zG(e,t){return jG(e,n=>{if(!n.empty)return MG(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var BG=e=>zG(e,!1),VG=e=>zG(e,!0);function HG(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(vO.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function UG(e,t){let n=HG(e),{state:r}=e,i=kG(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):MG(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=vO.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(AG(r,i),{effects:a}),!0}var WG=e=>UG(e,!1),GG=e=>UG(e,!0);function KG(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=zC.cursor(r.from+n))}return i}var ZBe=e=>jG(e,t=>KG(e,t,!0)),QBe=e=>jG(e,t=>KG(e,t,!1)),$Be=e=>jG(e,t=>KG(e,t,!PG(e))),eVe=e=>jG(e,t=>KG(e,t,PG(e))),tVe=e=>jG(e,t=>e.moveToLineBoundary(t,!1,!1)),nVe=e=>jG(e,t=>e.moveToLineBoundary(t,!0,!1));function rVe(e,t,n){let r=!1,i=kG(e.selection,t=>{let i=zk(e,t.head,-1)||zk(e,t.head,1)||t.head>0&&zk(e,t.head-1,1)||t.head<e.doc.length&&zk(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?zC.range(t.anchor,a):zC.cursor(a)});return r?(t(AG(e,i)),!0):!1}var iVe=({state:e,dispatch:t})=>rVe(e,t,!1);function qG(e,t,n){let r=kG(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=zC.range(e.head,e.anchor));let r=n(e);return zC.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(AG(e.state,r)),!0)}function JG(e,t){return qG(e,t,n=>e.moveByChar(n,t))}var YG=e=>JG(e,!PG(e)),XG=e=>JG(e,PG(e));function ZG(e,t){return qG(e,t,n=>e.moveByGroup(n,t))}var aVe=e=>ZG(e,!PG(e)),oVe=e=>ZG(e,PG(e)),sVe=e=>{let t=!PG(e);return qG(e,t,n=>RG(e.state,n,t))},cVe=e=>{let t=PG(e);return qG(e,t,n=>RG(e.state,n,t))};function QG(e,t){return qG(e,t,n=>e.moveVertically(n,t))}var $G=e=>QG(e,!1),eK=e=>QG(e,!0);function tK(e,t){return qG(e,t,n=>e.moveVertically(n,t,HG(e).height))}var nK=e=>tK(e,!1),rK=e=>tK(e,!0),lVe=e=>qG(e,!0,t=>KG(e,t,!0)),uVe=e=>qG(e,!1,t=>KG(e,t,!1)),dVe=e=>{let t=!PG(e);return qG(e,t,n=>KG(e,n,t))},fVe=e=>{let t=PG(e);return qG(e,t,n=>KG(e,n,t))},pVe=e=>qG(e,!1,t=>zC.cursor(e.lineBlockAt(t.head).from)),mVe=e=>qG(e,!0,t=>zC.cursor(e.lineBlockAt(t.head).to)),iK=({state:e,dispatch:t})=>(t(AG(e,{anchor:0})),!0),aK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.doc.length})),!0),oK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.selection.main.anchor,head:0})),!0),sK=({state:e,dispatch:t})=>(t(AG(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hVe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),gVe=({state:e,dispatch:t})=>{let n=gK(e).map(({from:t,to:n})=>zC.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:zC.create(n),userEvent:`select`})),!0},_Ve=({state:e,dispatch:t})=>{let n=kG(e.selection,t=>{let n=gk(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return zC.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(AG(e,n)),!0)};function cK(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(AG(n,zC.create(i,i.length-1))),!0)}var vVe=e=>cK(e,!1),yVe=e=>cK(e,!0),bVe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=zC.create([n.main]):n.main.empty||(r=zC.create([zC.cursor(n.main.head)])),r?(t(AG(e,r)),!0):!1};function lK(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=uK(e,o,!1)):o>i&&(n=`delete.forward`,o=uK(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=uK(e,i,!1),a=uK(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:zC.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?vO.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function uK(e,t,n){if(e instanceof vO)for(let r of e.state.facet(vO.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var dK=(e,t,n)=>lK(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=zw(s,a.tabSize)%Ek(a)||Ek(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=DC(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=DC(o.text,c-o.from,!1,!1)+o.from);return c}),fK=e=>dK(e,!1,!0),pK=e=>dK(e,!0,!1),mK=(e,t)=>lK(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=DC(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),hK=e=>mK(e,!1),xVe=e=>mK(e,!0),SVe=e=>lK(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),CVe=e=>lK(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),wVe=e=>lK(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),TVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:vC.of([``,``])},range:zC.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},EVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:DC(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:DC(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:zC.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function gK(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function _K(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of gK(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(zC.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(zC.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:zC.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var DVe=({state:e,dispatch:t})=>_K(e,t,!1),OVe=({state:e,dispatch:t})=>_K(e,t,!0);function vK(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of gK(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var kVe=({state:e,dispatch:t})=>vK(e,t,!1),AVe=({state:e,dispatch:t})=>vK(e,t,!0),jVe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(gK(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=kG(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function MVe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=gk(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(jS.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var yK=bK(!1),NVe=bK(!0);function bK(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&MVe(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new kk(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=Ok(s,r);for(c??=zw(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Dk(t,c)];return o&&l.push(Dk(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:vC.of(l)},range:zC.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function xK(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:zC.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var PVe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new kk(e,{overrideIndentation:e=>n[e]??-1}),i=xK(e,(t,i,a)=>{let o=Ok(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Dk(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},SK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(xK(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Tk)})}),{userEvent:`input.indent`})),!0),CK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(xK(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=zw(r,e.tabSize),a=0,o=Dk(e,Math.max(0,i-Ek(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),FVe=e=>(e.setTabFocusMode(),!0),IVe=[{key:`Ctrl-b`,run:FG,shift:YG,preventDefault:!0},{key:`Ctrl-f`,run:IG,shift:XG},{key:`Ctrl-p`,run:BG,shift:$G},{key:`Ctrl-n`,run:VG,shift:eK},{key:`Ctrl-a`,run:tVe,shift:pVe},{key:`Ctrl-e`,run:nVe,shift:mVe},{key:`Ctrl-d`,run:pK},{key:`Ctrl-h`,run:fK},{key:`Ctrl-k`,run:SVe},{key:`Ctrl-Alt-h`,run:hK},{key:`Ctrl-o`,run:TVe},{key:`Ctrl-t`,run:EVe},{key:`Ctrl-v`,run:GG}],LVe=[{key:`ArrowLeft`,run:FG,shift:YG,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:KBe,shift:aVe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:$Be,shift:dVe,preventDefault:!0},{key:`ArrowRight`,run:IG,shift:XG,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:qBe,shift:oVe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:eVe,shift:fVe,preventDefault:!0},{key:`ArrowUp`,run:BG,shift:$G,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:iK,shift:oK},{mac:`Ctrl-ArrowUp`,run:WG,shift:nK},{key:`ArrowDown`,run:VG,shift:eK,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:aK,shift:sK},{mac:`Ctrl-ArrowDown`,run:GG,shift:rK},{key:`PageUp`,run:WG,shift:nK},{key:`PageDown`,run:GG,shift:rK},{key:`Home`,run:QBe,shift:uVe,preventDefault:!0},{key:`Mod-Home`,run:iK,shift:oK},{key:`End`,run:ZBe,shift:lVe,preventDefault:!0},{key:`Mod-End`,run:aK,shift:sK},{key:`Enter`,run:yK,shift:yK},{key:`Mod-a`,run:hVe},{key:`Backspace`,run:fK,shift:fK,preventDefault:!0},{key:`Delete`,run:pK,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:hK,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:xVe,preventDefault:!0},{mac:`Mod-Backspace`,run:CVe,preventDefault:!0},{mac:`Mod-Delete`,run:wVe,preventDefault:!0}].concat(IVe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),RVe=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:YBe,shift:sVe},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:XBe,shift:cVe},{key:`Alt-ArrowUp`,run:DVe},{key:`Shift-Alt-ArrowUp`,run:kVe},{key:`Alt-ArrowDown`,run:OVe},{key:`Shift-Alt-ArrowDown`,run:AVe},{key:`Mod-Alt-ArrowUp`,run:vVe},{key:`Mod-Alt-ArrowDown`,run:yVe},{key:`Escape`,run:bVe},{key:`Mod-Enter`,run:NVe},{key:`Alt-l`,mac:`Ctrl-l`,run:gVe},{key:`Mod-i`,run:_Ve,preventDefault:!0},{key:`Mod-[`,run:CK},{key:`Mod-]`,run:SK},{key:`Mod-Alt-\\`,run:PVe},{key:`Shift-Mod-k`,run:jVe},{key:`Shift-Mod-\\`,run:iVe},{key:`Mod-/`,run:DBe},{key:`Alt-A`,mac:`Ctrl-A`,run:kBe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:FVe}].concat(LVe),zVe={key:`Tab`,run:SK,shift:CK};function wK(e){return new wk(sCe.define(e))}function TK(e){return r(()=>import(`./dist-CHkJJlnH.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([29,30,31]),import.meta.url)}var BVe=[J.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return r(()=>import(`./dist-Kyn4c3Uq.js`).then(e=>e.cpp()),__vite__mapDeps([32,30]),import.meta.url)}}),J.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return r(()=>import(`./dist-Kyn4c3Uq.js`).then(e=>e.cpp()),__vite__mapDeps([32,30]),import.meta.url)}}),J.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return TK(`Cassandra`)}}),J.of({name:`CSS`,extensions:[`css`],load(){return r(()=>import(`./dist-jVyrk7pL.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([33,1,30]),import.meta.url)}}),J.of({name:`Go`,extensions:[`go`],load(){return r(()=>import(`./dist-C_cSpv_W.js`).then(e=>e.go()),__vite__mapDeps([34,30,31]),import.meta.url)}}),J.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return r(()=>import(`./dist-BCMQBMNV.js`).then(e=>e.html()),__vite__mapDeps([35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`Java`,extensions:[`java`],load(){return r(()=>import(`./dist-CB0JDkTG.js`).then(e=>e.java()),__vite__mapDeps([37,30]),import.meta.url)}}),J.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return r(()=>import(`./dist-AtCs8Ac_.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return r(()=>import(`./dist-BuGXZft6.js`).then(e=>e.jinja()),__vite__mapDeps([38,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return r(()=>import(`./dist-C4gob63X.js`).then(e=>e.json()),__vite__mapDeps([39,30]),import.meta.url)}}),J.of({name:`JSX`,extensions:[`jsx`],load(){return r(()=>import(`./dist-AtCs8Ac_.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`LESS`,extensions:[`less`],load(){return r(()=>import(`./dist-BGLWo-yk.js`).then(e=>e.less()),__vite__mapDeps([40,33,1,30]),import.meta.url)}}),J.of({name:`Liquid`,extensions:[`liquid`],load(){return r(()=>import(`./dist-DIzctmKk.js`).then(e=>e.liquid()),__vite__mapDeps([41,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`MariaDB SQL`,load(){return TK(`MariaSQL`)}}),J.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return r(()=>import(`./dist-B1bCPRCC.js`).then(e=>e.markdown()),__vite__mapDeps([42,31,35,30,33,1,36]),import.meta.url)}}),J.of({name:`MS SQL`,load(){return TK(`MSSQL`)}}),J.of({name:`MySQL`,load(){return TK(`MySQL`)}}),J.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return r(()=>import(`./dist-Dgb15Ckj.js`).then(e=>e.php()),__vite__mapDeps([43,30,35,33,1,36,31]),import.meta.url)}}),J.of({name:`PLSQL`,extensions:[`pls`],load(){return TK(`PLSQL`)}}),J.of({name:`PostgreSQL`,load(){return TK(`PostgreSQL`)}}),J.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return r(()=>import(`./dist-CaB2nVTP.js`).then(e=>e.python()),__vite__mapDeps([44,30,31]),import.meta.url)}}),J.of({name:`Rust`,extensions:[`rs`],load(){return r(()=>import(`./dist-BLB83LMN.js`).then(e=>e.rust()),__vite__mapDeps([45,30]),import.meta.url)}}),J.of({name:`Sass`,extensions:[`sass`],load(){return r(()=>import(`./dist-DpjlLiVm.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([46,30,33,1]),import.meta.url)}}),J.of({name:`SCSS`,extensions:[`scss`],load(){return r(()=>import(`./dist-DpjlLiVm.js`).then(e=>e.sass()),__vite__mapDeps([46,30,33,1]),import.meta.url)}}),J.of({name:`SQL`,extensions:[`sql`],load(){return TK(`StandardSQL`)}}),J.of({name:`SQLite`,load(){return TK(`SQLite`)}}),J.of({name:`TSX`,extensions:[`tsx`],load(){return r(()=>import(`./dist-AtCs8Ac_.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return r(()=>import(`./dist-AtCs8Ac_.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([36,1,30,31]),import.meta.url)}}),J.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return r(()=>import(`./dist-IYw7p7AW.js`).then(e=>e.wast()),__vite__mapDeps([47,30]),import.meta.url)}}),J.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return r(()=>import(`./dist-DZS8BZv4.js`).then(e=>e.xml()),__vite__mapDeps([48,30]),import.meta.url)}}),J.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return r(()=>import(`./dist-ByWK_S-6.js`).then(e=>e.yaml()),__vite__mapDeps([49,30]),import.meta.url)}}),J.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return r(()=>import(`./apl-gfMMiTNf.js`).then(e=>wK(e.apl)),[],import.meta.url)}}),J.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return r(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>wK(e.asciiArmor)),[],import.meta.url)}}),J.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return r(()=>import(`./asn1-DCl_8MCW.js`).then(e=>wK(e.asn1({}))),[],import.meta.url)}}),J.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return r(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>wK(e.asterisk)),[],import.meta.url)}}),J.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return r(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>wK(e.brainfuck)),[],import.meta.url)}}),J.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return r(()=>import(`./cobol-DHLQUbN7.js`).then(e=>wK(e.cobol)),[],import.meta.url)}}),J.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.csharp)),[],import.meta.url)}}),J.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`ClojureScript`,extensions:[`cljs`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return r(()=>import(`./css-CnaYoQib.js`).then(e=>wK(e.gss)),[],import.meta.url)}}),J.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return r(()=>import(`./cmake-84nbDH0I.js`).then(e=>wK(e.cmake)),[],import.meta.url)}}),J.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return r(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>wK(e.coffeeScript)),[],import.meta.url)}}),J.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return r(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>wK(e.commonLisp)),[],import.meta.url)}}),J.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return r(()=>import(`./cypher-p9eYesGn.js`).then(e=>wK(e.cypher)),[],import.meta.url)}}),J.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return r(()=>import(`./python-B_1Jd8HM.js`).then(e=>wK(e.cython)),[],import.meta.url)}}),J.of({name:`Crystal`,extensions:[`cr`],load(){return r(()=>import(`./crystal-Bl6YKCG_.js`).then(e=>wK(e.crystal)),[],import.meta.url)}}),J.of({name:`D`,extensions:[`d`],load(){return r(()=>import(`./d-DWkQyNnU.js`).then(e=>wK(e.d)),[],import.meta.url)}}),J.of({name:`Dart`,extensions:[`dart`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.dart)),[],import.meta.url)}}),J.of({name:`diff`,extensions:[`diff`,`patch`],load(){return r(()=>import(`./diff-ChtP43wD.js`).then(e=>wK(e.diff)),[],import.meta.url)}}),J.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return r(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>wK(e.dockerFile)),__vite__mapDeps([50,51]),import.meta.url)}}),J.of({name:`DTD`,extensions:[`dtd`],load(){return r(()=>import(`./dtd-DTF72YNO.js`).then(e=>wK(e.dtd)),[],import.meta.url)}}),J.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return r(()=>import(`./dylan-S7ucR4pR.js`).then(e=>wK(e.dylan)),[],import.meta.url)}}),J.of({name:`EBNF`,load(){return r(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>wK(e.ebnf)),[],import.meta.url)}}),J.of({name:`ECL`,extensions:[`ecl`],load(){return r(()=>import(`./ecl-BVIeWmwY.js`).then(e=>wK(e.ecl)),[],import.meta.url)}}),J.of({name:`edn`,extensions:[`edn`],load(){return r(()=>import(`./clojure-BflJGmDX.js`).then(e=>wK(e.clojure)),[],import.meta.url)}}),J.of({name:`Eiffel`,extensions:[`e`],load(){return r(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>wK(e.eiffel)),[],import.meta.url)}}),J.of({name:`Elm`,extensions:[`elm`],load(){return r(()=>import(`./elm-Cshzl8qu.js`).then(e=>wK(e.elm)),[],import.meta.url)}}),J.of({name:`Erlang`,extensions:[`erl`],load(){return r(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>wK(e.erlang)),[],import.meta.url)}}),J.of({name:`Esper`,load(){return r(()=>import(`./sql-DuQMFDvy.js`).then(e=>wK(e.esper)),[],import.meta.url)}}),J.of({name:`Factor`,extensions:[`factor`],load(){return r(()=>import(`./factor-LKH5gN8L.js`).then(e=>wK(e.factor)),__vite__mapDeps([52,51]),import.meta.url)}}),J.of({name:`FCL`,load(){return r(()=>import(`./fcl-ClOhbFR7.js`).then(e=>wK(e.fcl)),[],import.meta.url)}}),J.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return r(()=>import(`./forth-D6RzAl64.js`).then(e=>wK(e.forth)),[],import.meta.url)}}),J.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return r(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>wK(e.fortran)),[],import.meta.url)}}),J.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.fSharp)),[],import.meta.url)}}),J.of({name:`Gas`,extensions:[`s`],load(){return r(()=>import(`./gas-BHEdbvp9.js`).then(e=>wK(e.gas)),[],import.meta.url)}}),J.of({name:`Gherkin`,extensions:[`feature`],load(){return r(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>wK(e.gherkin)),[],import.meta.url)}}),J.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return r(()=>import(`./groovy-CUrWKPia.js`).then(e=>wK(e.groovy)),[],import.meta.url)}}),J.of({name:`Haskell`,extensions:[`hs`],load(){return r(()=>import(`./haskell-BRsoo5mP.js`).then(e=>wK(e.haskell)),[],import.meta.url)}}),J.of({name:`Haxe`,extensions:[`hx`],load(){return r(()=>import(`./haxe-DjVOVvNP.js`).then(e=>wK(e.haxe)),[],import.meta.url)}}),J.of({name:`HXML`,extensions:[`hxml`],load(){return r(()=>import(`./haxe-DjVOVvNP.js`).then(e=>wK(e.hxml)),[],import.meta.url)}}),J.of({name:`HTTP`,load(){return r(()=>import(`./http-CLVgA2GD.js`).then(e=>wK(e.http)),[],import.meta.url)}}),J.of({name:`IDL`,extensions:[`pro`],load(){return r(()=>import(`./idl-BUZw3wgd.js`).then(e=>wK(e.idl)),[],import.meta.url)}}),J.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return r(()=>import(`./javascript-lS2r2ifg.js`).then(e=>wK(e.jsonld)),[],import.meta.url)}}),J.of({name:`Julia`,extensions:[`jl`],load(){return r(()=>import(`./julia-CQfgDRfP.js`).then(e=>wK(e.julia)),[],import.meta.url)}}),J.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.kotlin)),[],import.meta.url)}}),J.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return r(()=>import(`./livescript-BXxG0Yva.js`).then(e=>wK(e.liveScript)),[],import.meta.url)}}),J.of({name:`Lua`,extensions:[`lua`],load(){return r(()=>import(`./lua-DPCEkfD_.js`).then(e=>wK(e.lua)),[],import.meta.url)}}),J.of({name:`mIRC`,extensions:[`mrc`],load(){return r(()=>import(`./mirc-C9zpzAZU.js`).then(e=>wK(e.mirc)),[],import.meta.url)}}),J.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return r(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>wK(e.mathematica)),[],import.meta.url)}}),J.of({name:`Modelica`,extensions:[`mo`],load(){return r(()=>import(`./modelica-CqHI_q-D.js`).then(e=>wK(e.modelica)),[],import.meta.url)}}),J.of({name:`MUMPS`,extensions:[`mps`],load(){return r(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>wK(e.mumps)),[],import.meta.url)}}),J.of({name:`Mbox`,extensions:[`mbox`],load(){return r(()=>import(`./mbox-BEMVcqjs.js`).then(e=>wK(e.mbox)),[],import.meta.url)}}),J.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return r(()=>import(`./nginx-C-ORUuei.js`).then(e=>wK(e.nginx)),[],import.meta.url)}}),J.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return r(()=>import(`./nsis-viPvXFiq.js`).then(e=>wK(e.nsis)),__vite__mapDeps([53,51]),import.meta.url)}}),J.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return r(()=>import(`./ntriples-CzMBulkp.js`).then(e=>wK(e.ntriples)),[],import.meta.url)}}),J.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.objectiveC)),[],import.meta.url)}}),J.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.objectiveCpp)),[],import.meta.url)}}),J.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.oCaml)),[],import.meta.url)}}),J.of({name:`Octave`,extensions:[`m`],load(){return r(()=>import(`./octave-D2Q8cUp1.js`).then(e=>wK(e.octave)),[],import.meta.url)}}),J.of({name:`Oz`,extensions:[`oz`],load(){return r(()=>import(`./oz-BwTct_5T.js`).then(e=>wK(e.oz)),[],import.meta.url)}}),J.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return r(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>wK(e.pascal)),[],import.meta.url)}}),J.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return r(()=>import(`./perl-BkSkiI9m.js`).then(e=>wK(e.perl)),[],import.meta.url)}}),J.of({name:`Pig`,extensions:[`pig`],load(){return r(()=>import(`./pig-AF4Hwhju.js`).then(e=>wK(e.pig)),[],import.meta.url)}}),J.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return r(()=>import(`./powershell-D8WpQPaX.js`).then(e=>wK(e.powerShell)),[],import.meta.url)}}),J.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return r(()=>import(`./properties-C357ku5U.js`).then(e=>wK(e.properties)),[],import.meta.url)}}),J.of({name:`ProtoBuf`,extensions:[`proto`],load(){return r(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>wK(e.protobuf)),[],import.meta.url)}}),J.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return r(()=>import(`./pug-BqCHZ5xT.js`).then(e=>wK(e.pug)),__vite__mapDeps([54,55]),import.meta.url)}}),J.of({name:`Puppet`,extensions:[`pp`],load(){return r(()=>import(`./puppet-BZyAS7I4.js`).then(e=>wK(e.puppet)),[],import.meta.url)}}),J.of({name:`Q`,extensions:[`q`],load(){return r(()=>import(`./q-B9NhS7L_.js`).then(e=>wK(e.q)),[],import.meta.url)}}),J.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return r(()=>import(`./r-CxDmU1I4.js`).then(e=>wK(e.r)),[],import.meta.url)}}),J.of({name:`RPM Changes`,load(){return r(()=>import(`./rpm-gpDK5sbt.js`).then(e=>wK(e.rpmChanges)),[],import.meta.url)}}),J.of({name:`RPM Spec`,extensions:[`spec`],load(){return r(()=>import(`./rpm-gpDK5sbt.js`).then(e=>wK(e.rpmSpec)),[],import.meta.url)}}),J.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return r(()=>import(`./ruby-ChfNwlCY.js`).then(e=>wK(e.ruby)),[],import.meta.url)}}),J.of({name:`SAS`,extensions:[`sas`],load(){return r(()=>import(`./sas-C2OyD2Y6.js`).then(e=>wK(e.sas)),[],import.meta.url)}}),J.of({name:`Scala`,extensions:[`scala`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.scala)),[],import.meta.url)}}),J.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return r(()=>import(`./scheme-D9qYN0V5.js`).then(e=>wK(e.scheme)),[],import.meta.url)}}),J.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return r(()=>import(`./shell-DwuoZtxw.js`).then(e=>wK(e.shell)),[],import.meta.url)}}),J.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return r(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>wK(e.sieve)),[],import.meta.url)}}),J.of({name:`Smalltalk`,extensions:[`st`],load(){return r(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>wK(e.smalltalk)),[],import.meta.url)}}),J.of({name:`Solr`,load(){return r(()=>import(`./solr-B78wSQJQ.js`).then(e=>wK(e.solr)),[],import.meta.url)}}),J.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return r(()=>import(`./mllike-B45xgp2S.js`).then(e=>wK(e.sml)),[],import.meta.url)}}),J.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return r(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>wK(e.sparql)),[],import.meta.url)}}),J.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return r(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>wK(e.spreadsheet)),[],import.meta.url)}}),J.of({name:`Squirrel`,extensions:[`nut`],load(){return r(()=>import(`./clike-xvONpD0Z.js`).then(e=>wK(e.squirrel)),[],import.meta.url)}}),J.of({name:`Stylus`,extensions:[`styl`],load(){return r(()=>import(`./stylus-BOVgKnng.js`).then(e=>wK(e.stylus)),[],import.meta.url)}}),J.of({name:`Swift`,extensions:[`swift`],load(){return r(()=>import(`./swift-DKB6_1j6.js`).then(e=>wK(e.swift)),[],import.meta.url)}}),J.of({name:`sTeX`,load(){return r(()=>import(`./stex-DNzd62Q_.js`).then(e=>wK(e.stex)),[],import.meta.url)}}),J.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return r(()=>import(`./stex-DNzd62Q_.js`).then(e=>wK(e.stex)),[],import.meta.url)}}),J.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return r(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>wK(e.verilog)),[],import.meta.url)}}),J.of({name:`Tcl`,extensions:[`tcl`],load(){return r(()=>import(`./tcl-BGfruO1u.js`).then(e=>wK(e.tcl)),[],import.meta.url)}}),J.of({name:`Textile`,extensions:[`textile`],load(){return r(()=>import(`./textile-C4jVoHG1.js`).then(e=>wK(e.textile)),[],import.meta.url)}}),J.of({name:`TiddlyWiki`,load(){return r(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>wK(e.tiddlyWiki)),[],import.meta.url)}}),J.of({name:`Tiki wiki`,load(){return r(()=>import(`./tiki-CvUEFusT.js`).then(e=>wK(e.tiki)),[],import.meta.url)}}),J.of({name:`TOML`,extensions:[`toml`],load(){return r(()=>import(`./toml-BPTmHmyx.js`).then(e=>wK(e.toml)),[],import.meta.url)}}),J.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return r(()=>import(`./troff-C2dAgh7P.js`).then(e=>wK(e.troff)),[],import.meta.url)}}),J.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return r(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>wK(e.ttcn)),[],import.meta.url)}}),J.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return r(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>wK(e.ttcnCfg)),[],import.meta.url)}}),J.of({name:`Turtle`,extensions:[`ttl`],load(){return r(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>wK(e.turtle)),[],import.meta.url)}}),J.of({name:`Web IDL`,extensions:[`webidl`],load(){return r(()=>import(`./webidl-D5jiJvOU.js`).then(e=>wK(e.webIDL)),[],import.meta.url)}}),J.of({name:`VB.NET`,extensions:[`vb`],load(){return r(()=>import(`./vb-BthdM_4N.js`).then(e=>wK(e.vb)),[],import.meta.url)}}),J.of({name:`VBScript`,extensions:[`vbs`],load(){return r(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>wK(e.vbScript)),[],import.meta.url)}}),J.of({name:`Velocity`,extensions:[`vtl`],load(){return r(()=>import(`./velocity-CqftRsjg.js`).then(e=>wK(e.velocity)),[],import.meta.url)}}),J.of({name:`Verilog`,extensions:[`v`],load(){return r(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>wK(e.verilog)),[],import.meta.url)}}),J.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return r(()=>import(`./vhdl-kS471soi.js`).then(e=>wK(e.vhdl)),[],import.meta.url)}}),J.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return r(()=>import(`./xquery-BKJx4mf9.js`).then(e=>wK(e.xQuery)),[],import.meta.url)}}),J.of({name:`Yacas`,extensions:[`ys`],load(){return r(()=>import(`./yacas-CXXgtw0p.js`).then(e=>wK(e.yacas)),[],import.meta.url)}}),J.of({name:`Z80`,extensions:[`z80`],load(){return r(()=>import(`./z80-Co3PbHdE.js`).then(e=>wK(e.z80)),[],import.meta.url)}}),J.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.mscgen)),[],import.meta.url)}}),J.of({name:`Xù`,extensions:[`xu`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.xu)),[],import.meta.url)}}),J.of({name:`MsGenny`,extensions:[`msgenny`],load(){return r(()=>import(`./mscgen-qgSLujhx.js`).then(e=>wK(e.msgenny)),[],import.meta.url)}}),J.of({name:`Vue`,extensions:[`vue`],load(){return r(()=>import(`./dist-Bt8gKTDd.js`).then(e=>e.vue()),__vite__mapDeps([56,35,30,33,1,36,31]),import.meta.url)}}),J.of({name:`Angular Template`,load(){return r(()=>import(`./dist-DWO10Qm_.js`).then(e=>e.angular()),__vite__mapDeps([57,35,30,33,1,36,31]),import.meta.url)}})],VVe={c:[`c`],cpp:[`c++`,`cpp`],cs:[`c#`,`csharp`],js:[`javascript`],jsx:[`javascript jsx`,`jsx`],md:[`markdown`],py:[`python`],sh:[`shell`,`bash`],ts:[`typescript`],tsx:[`typescript jsx`,`tsx`],yml:[`yaml`],zsh:[`shell`,`bash`]};function HVe(e){let t=e===`plaintext`?`text`:e;return[t,...VVe[t]??[]]}async function UVe(e){if(e===`text`)return[];let t=HVe(e);for(let e of t){let t=J.matchLanguageName(BVe,e,!0);if(t)try{return await t.load()}catch{}}return[]}function WVe(e){let{main:t}=e.state.selection;return t.empty?e.state.doc.lineAt(t.head).number===1:!1}function GVe(e){let{main:t}=e.state.selection;return t.empty?e.state.doc.lineAt(t.head).number===e.state.doc.lines:!1}var KVe=vO.theme({"&":{backgroundColor:`transparent`},"&.cm-editor":{outline:`none`},"&.cm-editor.cm-focused":{outline:`none`},"&.cm-editor .cm-gutters":{backgroundColor:`var(--cm-gutter-bg, transparent)`,border:`none`},".cm-scroller":{overflow:`auto`,fontFamily:`inherit`},".cm-content":{minHeight:`1.5em`},".cm-selectionBackground":{backgroundColor:`rgba(125, 125, 125, 0.26) !important`}});function qVe(e){return e&&e.trim().toLowerCase()||`text`}var JVe={"":!0,text:!0,plaintext:!0,plain:!0,txt:!0},YVe={sh:!0,bash:!0,shell:!0,zsh:!0,console:!0};function XVe(e,t){let n=e.trim().toLowerCase();return Object.hasOwn(JVe,n)?`text`:Object.hasOwn(YVe,n)&&!t.trimEnd().includes(`
199
199
  `)?`shell-line`:`code`}var ZVe=QSe(KO([{tag:[ck.keyword,ck.bool,ck.null,ck.atom],class:`ryugi-tok-kw`},{tag:ck.number,class:`ryugi-tok-num`},{tag:[ck.string,ck.regexp,ck.character],class:`ryugi-tok-str`},{tag:ck.comment,class:`ryugi-tok-cm`},{tag:[ck.punctuation,ck.operator],class:`ryugi-tok-punc`}])),EK=uee.map(({id:e,name:t})=>({id:e,name:t})),QVe=()=>`$`;function DK(e,t){return t||e===`text`?[]:e===`shell-line`?zO({formatNumber:QVe}):zO()}function $Ve({language:e,onChange:t}){let[n,r]=(0,G.useState)(``),a=(0,G.useMemo)(()=>EK.find(t=>t.id===e)??(e===`text`?null:{id:e,name:e}),[e]),o=(0,G.useMemo)(()=>{let e=a&&!EK.includes(a)?[...EK,a]:EK,t=n.trim().toLowerCase();return!t||e.some(e=>e.id===t)?e:[...e,{id:t,name:t}]},[n,a]);return(0,K.jsxs)(V,{autoHighlight:!0,itemToStringLabel:e=>e.id,itemToStringValue:e=>e.id,items:o,value:a,onInputValueChange:r,onValueChange:e=>e&&t?.(e.id),children:[(0,K.jsx)(yee,{"aria-label":i(`codeblock.language`),className:`ryugi-codeblock-picker`,placeholder:i(`codeblock.language`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(See,{align:`start`,side:`bottom`,sideOffset:6,children:[(0,K.jsx)(ke,{children:i(`codeblock.noLanguage`)}),(0,K.jsx)(Ce,{children:e=>(0,K.jsx)(wee,{value:e,children:e.name},e.id)})]})]})}function OK({code:e,language:t,editable:n=!1,selected:r=!1,cursorPlacement:a=`start`,onCodeChange:o,onLanguageChange:s,onDelete:c,onExitBlock:u}){let d=Gj(),f=d===`comment`||d===`chat`,p=lF()===`dark`,m=qVe(t),h=XVe(m,e),g=e.split(`
200
200
  `).length,_=(0,G.useRef)(null),v=(0,G.useRef)(null),y=(0,G.useRef)(null),[b,x]=(0,G.useState)(!1),[S,w]=(0,G.useState)(!1),[T,E]=(0,G.useState)(!1),[D,O]=(0,G.useState)(!1),k=(0,G.useRef)({editable:n,onCodeChange:o,onDelete:c,onExitBlock:u,suppress:!1});(0,G.useLayoutEffect)(()=>{k.current={...k.current,editable:n,onCodeChange:o,onDelete:c,onExitBlock:u}});let A=(0,G.useMemo)(()=>({dark:new $C,editable:new $C,gutter:new $C,language:new $C}),[]);(0,G.useEffect)(()=>{let t=ZC.high(vO.domEventHandlers({keydown:(e,t)=>{let n=k.current;if(!n.editable)return!1;e.stopPropagation();let r=t=>(e.preventDefault(),n.onExitBlock?.(t),!0);return(e.metaKey||e.ctrlKey)&&e.key===`Enter`?r(`after`):e.key===`ArrowUp`&&WVe(t)?r(`before`):e.key===`ArrowDown`&&GVe(t)?r(`after`):e.key===`Backspace`&&t.state.doc.length===0&&(e.preventDefault(),n.onDelete?.(),!0)}})),r=new vO({parent:_.current,state:bw.create({doc:e,extensions:[IBe(),CO.of([...RVe,...GBe,zVe]),vO.updateListener.of(e=>{e.docChanged&&!k.current.suppress&&k.current.onCodeChange?.(e.state.doc.toString())}),t,A.editable.of([vO.editable.of(n),bw.readOnly.of(!n)]),A.gutter.of(DK(h,f)),A.language.of([]),A.dark.of(vO.darkTheme.of(p)),KVe,ZVe]})});return y.current=r,x(!0),()=>{r.destroy(),y.current=null,x(!1)}},[]),(0,G.useEffect)(()=>{y.current?.dispatch({effects:A.editable.reconfigure([vO.editable.of(n),bw.readOnly.of(!n)])})},[A,n]),(0,G.useEffect)(()=>{y.current?.dispatch({effects:A.gutter.reconfigure(DK(h,f))})},[A,h,f]),(0,G.useEffect)(()=>{y.current?.dispatch({effects:A.dark.reconfigure(vO.darkTheme.of(p))})},[A,p]),(0,G.useEffect)(()=>{let t=y.current;if(!t)return;let n=t.state.doc.toString();n!==e&&(k.current.suppress=!0,t.dispatch({changes:{from:0,to:n.length,insert:e}}),k.current.suppress=!1)},[e]),(0,G.useEffect)(()=>{let e=!1;return UVe(m).then(t=>{e||y.current?.dispatch({effects:A.language.reconfigure(t)})}),()=>{e=!0}},[A,m]),(0,G.useEffect)(()=>{let e=y.current;if(!n||!r||!e)return;let t=requestAnimationFrame(()=>{e.hasFocus||(e.focus(),e.dispatch({selection:zC.cursor(a===`end`?e.state.doc.length:0),scrollIntoView:!0}))});return()=>cancelAnimationFrame(t)},[a,n,b,r]);let j=h!==`shell-line`,M=n&&r;(0,G.useEffect)(()=>{M&&O(!0)},[M]),(0,G.useLayoutEffect)(()=>{E(j&&(v.current?.scrollHeight??0)>=window.innerHeight/2)},[e,j,b]);let N=j&&T&&!D&&!M;return(0,K.jsxs)(`div`,{className:`ryugi-codeblock`,"data-compact":f?``:void 0,"data-editable":n?``:void 0,"data-folded":N?``:void 0,"data-kind":h,onFocusCapture:n?e=>{v.current?.contains(e.target)&&O(!0)}:void 0,children:[(0,K.jsxs)(`div`,{className:`ryugi-codeblock-head`,children:[n?(0,K.jsx)($Ve,{language:m,onChange:s}):h===`code`&&(0,K.jsx)(`span`,{className:`ryugi-codeblock-lang`,children:m}),(0,K.jsx)(`span`,{className:`ryugi-codeblock-spacer`}),(0,K.jsxs)(`button`,{"aria-label":i(S?`common.copied`:`codeblock.copy`),className:`ryugi-codeblock-copy`,type:`button`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{w(!0),setTimeout(()=>w(!1),2e3)})},children:[S?(0,K.jsx)(C,{size:14}):(0,K.jsx)(Ir,{size:14}),(0,K.jsx)(`span`,{children:i(S?`common.copied`:`codeblock.copyShort`)})]})]}),(0,K.jsxs)(`div`,{className:`ryugi-codeblock-body`,ref:v,children:[!b&&(0,K.jsx)(`pre`,{className:`ryugi-codeblock-fallback`,children:(0,K.jsx)(`code`,{children:e})}),(0,K.jsx)(`div`,{ref:_})]}),N&&(0,K.jsxs)(`button`,{className:`ryugi-codeblock-expand`,type:`button`,onClick:()=>O(!0),children:[(0,K.jsx)(`span`,{children:i(`codeblock.expand`,{count:g})}),(0,K.jsx)(l,{size:14})]})]})}var eHe=[[`flowchart`,`flowchart-elk`,/^\s*flowchart-elk/],[`mindmap`,`mindmap`,/^\s*mindmap/],[`architecture`,`architecture`,/^\s*architecture/],[`agentflow`,`agentflow`,/^\s*agentflow-beta\b/],[`c4`,`c4`,/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/],[`kanban`,`kanban`,/^\s*kanban/],[`class`,`classDiagram`,/^\s*classDiagram/],[`er`,`er`,/^\s*erDiagram/],[`gantt`,`gantt`,/^\s*gantt/],[`info`,`info`,/^\s*info/],[`pie`,`pie`,/^\s*pie/],[`requirement`,`requirement`,/^\s*requirement(Diagram)?/],[`sequence`,`sequence`,/^\s*sequenceDiagram/],[`swimlane`,`swimlane`,/^\s*swimlane-beta\b/],[`flowchart`,`flowchart-v2`,/^\s*(graph|flowchart)/],[`timeline`,`timeline`,/^\s*timeline/],[`gitGraph`,`gitGraph`,/^\s*gitGraph/],[`state`,`stateDiagram`,/^\s*stateDiagram/],[`journey`,`journey`,/^\s*journey/],[`quadrantChart`,`quadrantChart`,/^\s*quadrantChart/],[`sankey`,`sankey`,/^\s*sankey(-beta)?/],[`packet`,`packet`,/^\s*packet(-beta)?/],[`xychart`,`xychart`,/^\s*xychart(-beta)?/],[`block`,`block`,/^\s*block(-beta)?/],[`eventmodeling`,`eventmodeling`,/^\s*eventmodeling/],[`treeView`,`treeView`,/^\s*treeView-beta/],[`radar`,`radar`,/^\s*radar-beta/],[`ishikawa`,`ishikawa`,/^\s*ishikawa(-beta)?\b/i],[`treemap`,`treemap`,/^\s*treemap/],[`railroad`,`railroad`,/^\s*railroad-beta/i],[`railroad`,`railroadEbnf`,/^\s*railroad-ebnf-beta/i],[`railroad`,`railroadAbnf`,/^\s*railroad-abnf-beta/i],[`railroad`,`railroadPeg`,/^\s*railroad-peg-beta/i],[`venn`,`venn`,/^\s*venn-beta/],[`wardley`,`wardley`,/^\s*wardley-beta/i],[`cynefin`,`cynefin`,/^\s*cynefin-beta(?:[\s:]|$)/],[`usecase`,`usecase`,/^\s*usecase-beta(?:\s|$)/]];function tHe(e){for(let[t,n,r]of eHe)if(r.test(e))return{type:t,mermaidType:n};return null}var kK=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function AK(e,t){let n=1,r=0;for(let i=e.indexOf(`
201
201
  `);i!==-1&&i<t;i=e.indexOf(`