@netnodeag/kraftwerk 0.38.1 → 0.39.0
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.
- package/dist/cli/init.js +1 -0
- package/dist/cli/kraftwerk.js +2 -0
- package/dist/cli/vibeables.d.ts +2 -0
- package/dist/cli/vibeables.js +89 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.js +29 -10
- package/dist/inspector/chat/sessions.d.ts +11 -0
- package/dist/inspector/chat/sessions.js +86 -10
- package/dist/inspector/chat/types.d.ts +2 -0
- package/dist/inspector/git.js +5 -3
- package/dist/inspector/mtime.d.ts +3 -0
- package/dist/inspector/mtime.js +31 -0
- package/dist/inspector/repos.d.ts +2 -0
- package/dist/inspector/repos.js +5 -1
- package/dist/inspector/server.js +90 -1
- package/dist/inspector/settings.d.ts +3 -1
- package/dist/inspector/settings.js +19 -8
- package/dist/inspector/vibeables.d.ts +152 -0
- package/dist/inspector/vibeables.js +509 -0
- package/inspector/dist/assets/apl-gfMMiTNf.js +1 -0
- package/inspector/dist/assets/asciiarmor-C_eisQCp.js +1 -0
- package/inspector/dist/assets/asn1-DCl_8MCW.js +1 -0
- package/inspector/dist/assets/asterisk-BEn0Cwpx.js +1 -0
- package/inspector/dist/assets/brainfuck-D5EjA2JK.js +1 -0
- package/inspector/dist/assets/clike-D_6L3tnO.js +1 -0
- package/inspector/dist/assets/clojure-BflJGmDX.js +1 -0
- package/inspector/dist/assets/cmake-84nbDH0I.js +1 -0
- package/inspector/dist/assets/cobol-DHLQUbN7.js +1 -0
- package/inspector/dist/assets/coffeescript-De_zI4J0.js +1 -0
- package/inspector/dist/assets/commonlisp-DgAKBe0r.js +1 -0
- package/inspector/dist/assets/crystal-Bsdphhtm.js +1 -0
- package/inspector/dist/assets/css-CnaYoQib.js +1 -0
- package/inspector/dist/assets/cypher-p9eYesGn.js +1 -0
- package/inspector/dist/assets/d-DWkQyNnU.js +1 -0
- package/inspector/dist/assets/diff-ChtP43wD.js +1 -0
- package/inspector/dist/assets/dist-3Nzkrylv.js +1 -0
- package/inspector/dist/assets/dist-5wk4daHl.js +1 -0
- package/inspector/dist/assets/dist-BCM6ehYa.js +1 -0
- package/inspector/dist/assets/dist-BECiZEqH.js +1 -0
- package/inspector/dist/assets/dist-BbhR2mEU.js +1 -0
- package/inspector/dist/assets/dist-CF7An11X.js +1 -0
- package/inspector/dist/assets/dist-CI-2-8Tz.js +23 -0
- package/inspector/dist/assets/dist-CPlSMtdY.js +1 -0
- package/inspector/dist/assets/dist-CXS6W3P9.js +9 -0
- package/inspector/dist/assets/dist-Ceimhh7q.js +1 -0
- package/inspector/dist/assets/dist-D3tgdU3w.js +1 -0
- package/inspector/dist/assets/dist-D8nmL5S9.js +1 -0
- package/inspector/dist/assets/dist-DNBDudvB.js +1 -0
- package/inspector/dist/assets/dist-DTW4FhJ_.js +1 -0
- package/inspector/dist/assets/dist-DXIk6Ebu.js +1 -0
- package/inspector/dist/assets/dist-DaG9QYNU.js +1 -0
- package/inspector/dist/assets/dist-Dd-u7fXY.js +1 -0
- package/inspector/dist/assets/dist-DwyxsFyN.js +1 -0
- package/inspector/dist/assets/dist-H3rerbMg.js +13 -0
- package/inspector/dist/assets/dist-ZMc9InB9.js +1 -0
- package/inspector/dist/assets/dist-nc_mc1w0.js +1 -0
- package/inspector/dist/assets/dist-rE2oRtJp.js +11 -0
- package/inspector/dist/assets/dist-yFKhRrHN.js +2 -0
- package/inspector/dist/assets/dockerfile-DJkHQgkl.js +1 -0
- package/inspector/dist/assets/dtd-DTF72YNO.js +1 -0
- package/inspector/dist/assets/dylan-BCDoL_-p.js +1 -0
- package/inspector/dist/assets/ebnf-D4c0_ac3.js +1 -0
- package/inspector/dist/assets/ecl-BVIeWmwY.js +1 -0
- package/inspector/dist/assets/editor-6yCJBeDg.js +120 -0
- package/inspector/dist/assets/editor-B1Jq9YIq.css +1 -0
- package/inspector/dist/assets/eiffel-BEjRio4Q.js +1 -0
- package/inspector/dist/assets/elm-Cshzl8qu.js +1 -0
- package/inspector/dist/assets/erlang-BV0c4Hdn.js +1 -0
- package/inspector/dist/assets/factor-LKH5gN8L.js +1 -0
- package/inspector/dist/assets/fcl-ClOhbFR7.js +1 -0
- package/inspector/dist/assets/forth-D6RzAl64.js +1 -0
- package/inspector/dist/assets/fortran-Bt6PBEDR.js +1 -0
- package/inspector/dist/assets/gas-BHEdbvp9.js +1 -0
- package/inspector/dist/assets/gherkin-oBAE_ms0.js +1 -0
- package/inspector/dist/assets/groovy-CUpZ7dEl.js +1 -0
- package/inspector/dist/assets/haskell-BRsoo5mP.js +1 -0
- package/inspector/dist/assets/haxe-DjVOVvNP.js +1 -0
- package/inspector/dist/assets/http-CLVgA2GD.js +1 -0
- package/inspector/dist/assets/idl-BUZw3wgd.js +1 -0
- package/inspector/dist/assets/index-Dom87GNV.css +1 -0
- package/inspector/dist/assets/index-DurTvcNI.js +218 -0
- package/inspector/dist/assets/javascript-Bu8mWwtz.js +1 -0
- package/inspector/dist/assets/julia-CQfgDRfP.js +1 -0
- package/inspector/dist/assets/livescript-BXxG0Yva.js +1 -0
- package/inspector/dist/assets/lua-DPCEkfD_.js +1 -0
- package/inspector/dist/assets/material-symbols-rounded-DzDTtRam.woff2 +0 -0
- package/inspector/dist/assets/mathematica-u8YMmbU0.js +1 -0
- package/inspector/dist/assets/mbox-BEMVcqjs.js +1 -0
- package/inspector/dist/assets/{mirc-CjQqDB4T.js → mirc-C9zpzAZU.js} +1 -1
- package/inspector/dist/assets/mllike-B45xgp2S.js +1 -0
- package/inspector/dist/assets/modelica-CqHI_q-D.js +1 -0
- package/inspector/dist/assets/mscgen-qgSLujhx.js +1 -0
- package/inspector/dist/assets/mumps-BSzj6Xyz.js +1 -0
- package/inspector/dist/assets/{nginx-DdIZxoE0.js → nginx-8H7HVH4w.js} +1 -1
- package/inspector/dist/assets/nsis-viPvXFiq.js +1 -0
- package/inspector/dist/assets/ntriples-B9h1VB_g.js +1 -0
- package/inspector/dist/assets/octave-D2Q8cUp1.js +1 -0
- package/inspector/dist/assets/oz-BwTct_5T.js +1 -0
- package/inspector/dist/assets/pascal-Dp_KdFgX.js +1 -0
- package/inspector/dist/assets/perl-BkSkiI9m.js +1 -0
- package/inspector/dist/assets/pig-AF4Hwhju.js +1 -0
- package/inspector/dist/assets/powershell-BcIto6Sf.js +1 -0
- package/inspector/dist/assets/properties-C357ku5U.js +1 -0
- package/inspector/dist/assets/protobuf-D1ij_kNL.js +1 -0
- package/inspector/dist/assets/pug-3K-JMW4g.js +1 -0
- package/inspector/dist/assets/puppet-BZyAS7I4.js +1 -0
- package/inspector/dist/assets/python-B_1Jd8HM.js +1 -0
- package/inspector/dist/assets/q-B9NhS7L_.js +1 -0
- package/inspector/dist/assets/r-CxDmU1I4.js +1 -0
- package/inspector/dist/assets/rpm-gpDK5sbt.js +1 -0
- package/inspector/dist/assets/ruby-ChfNwlCY.js +1 -0
- package/inspector/dist/assets/{sas-B4kiWyti.js → sas-C2OyD2Y6.js} +1 -1
- package/inspector/dist/assets/scheme-D9qYN0V5.js +1 -0
- package/inspector/dist/assets/shell-DwuoZtxw.js +1 -0
- package/inspector/dist/assets/sieve-tLWDfEkZ.js +1 -0
- package/inspector/dist/assets/simple-mode-DXiLM1-G.js +1 -0
- package/inspector/dist/assets/smalltalk-BLp5-jwC.js +1 -0
- package/inspector/dist/assets/solr-B78wSQJQ.js +1 -0
- package/inspector/dist/assets/sparql-Dz-mlCAC.js +1 -0
- package/inspector/dist/assets/spreadsheet-CTIncYxj.js +1 -0
- package/inspector/dist/assets/sql-DuQMFDvy.js +1 -0
- package/inspector/dist/assets/stex-DNzd62Q_.js +1 -0
- package/inspector/dist/assets/stylus-BOVgKnng.js +1 -0
- package/inspector/dist/assets/swift-DKB6_1j6.js +1 -0
- package/inspector/dist/assets/tcl-BGfruO1u.js +1 -0
- package/inspector/dist/assets/textile-C4jVoHG1.js +1 -0
- package/inspector/dist/assets/tiddlywiki-VlUiK86J.js +1 -0
- package/inspector/dist/assets/tiki-AK6FwT8q.js +1 -0
- package/inspector/dist/assets/toml-BPTmHmyx.js +1 -0
- package/inspector/dist/assets/troff-C2dAgh7P.js +1 -0
- package/inspector/dist/assets/ttcn-PPSTk1ow.js +1 -0
- package/inspector/dist/assets/ttcn-cfg-2b4Gb5sE.js +1 -0
- package/inspector/dist/assets/turtle-Cx3rYX2g.js +1 -0
- package/inspector/dist/assets/vb-BthdM_4N.js +1 -0
- package/inspector/dist/assets/vbscript-D9f6rSsU.js +1 -0
- package/inspector/dist/assets/velocity-CqftRsjg.js +1 -0
- package/inspector/dist/assets/verilog-CjI9Y6RI.js +1 -0
- package/inspector/dist/assets/vhdl-kS471soi.js +1 -0
- package/inspector/dist/assets/webidl-D5jiJvOU.js +1 -0
- package/inspector/dist/assets/xquery-BKJx4mf9.js +1 -0
- package/inspector/dist/assets/yacas-CXXgtw0p.js +1 -0
- package/inspector/dist/assets/z80-Co3PbHdE.js +1 -0
- package/inspector/dist/index.html +2 -2
- package/package.json +6 -6
- package/inspector/dist/assets/apl-B4CMkyY2.js +0 -1
- package/inspector/dist/assets/asciiarmor-Df11BRmG.js +0 -1
- package/inspector/dist/assets/asn1-EdZsLKOL.js +0 -1
- package/inspector/dist/assets/asterisk-B-8jnY81.js +0 -1
- package/inspector/dist/assets/brainfuck-C4LP7Hcl.js +0 -1
- package/inspector/dist/assets/clike-B9uivgTg.js +0 -1
- package/inspector/dist/assets/clojure-BMjYHr_A.js +0 -1
- package/inspector/dist/assets/cmake-BQqOBYOt.js +0 -1
- package/inspector/dist/assets/cobol-CWcv1MsR.js +0 -1
- package/inspector/dist/assets/coffeescript-S37ZYGWr.js +0 -1
- package/inspector/dist/assets/commonlisp-DBKNyK5s.js +0 -1
- package/inspector/dist/assets/crystal-SjHAIU92.js +0 -1
- package/inspector/dist/assets/css-BnMrqG3P.js +0 -1
- package/inspector/dist/assets/cypher-C_CwsFkJ.js +0 -1
- package/inspector/dist/assets/d-pRatUO7H.js +0 -1
- package/inspector/dist/assets/diff-DbItnlRl.js +0 -1
- package/inspector/dist/assets/dockerfile-BKs6k2Af.js +0 -1
- package/inspector/dist/assets/dtd-DF_7sFjM.js +0 -1
- package/inspector/dist/assets/dylan-DwRh75JA.js +0 -1
- package/inspector/dist/assets/ebnf-CDyGwa7X.js +0 -1
- package/inspector/dist/assets/ecl-Cabwm37j.js +0 -1
- package/inspector/dist/assets/editor-9rr2cQaW.css +0 -1
- package/inspector/dist/assets/editor-CONb__vl.js +0 -144
- package/inspector/dist/assets/eiffel-CnydiIhH.js +0 -1
- package/inspector/dist/assets/elm-vLlmbW-K.js +0 -1
- package/inspector/dist/assets/erlang-BNw1qcRV.js +0 -1
- package/inspector/dist/assets/factor-kuTfRLto.js +0 -1
- package/inspector/dist/assets/fcl-Kvtd6kyn.js +0 -1
- package/inspector/dist/assets/forth-Ffai-XNe.js +0 -1
- package/inspector/dist/assets/fortran-DYz_wnZ1.js +0 -1
- package/inspector/dist/assets/gas-Bneqetm1.js +0 -1
- package/inspector/dist/assets/gherkin-heZmZLOM.js +0 -1
- package/inspector/dist/assets/groovy-D9Dt4D0W.js +0 -1
- package/inspector/dist/assets/haskell-Cw1EW3IL.js +0 -1
- package/inspector/dist/assets/haxe-H-WmDvRZ.js +0 -1
- package/inspector/dist/assets/http-DBlCnlav.js +0 -1
- package/inspector/dist/assets/idl-BEugSyMb.js +0 -1
- package/inspector/dist/assets/index-6VtYKf_K.js +0 -1
- package/inspector/dist/assets/index-B_BJEGG5.js +0 -1
- package/inspector/dist/assets/index-BkznuDSS.js +0 -1
- package/inspector/dist/assets/index-BrGHSw5I.js +0 -1
- package/inspector/dist/assets/index-BuiRW-03.js +0 -1
- package/inspector/dist/assets/index-C1tY1uK0.js +0 -1
- package/inspector/dist/assets/index-CDY-uFno.js +0 -7
- package/inspector/dist/assets/index-CcGsEtey.js +0 -1
- package/inspector/dist/assets/index-CntcQxRr.js +0 -1
- package/inspector/dist/assets/index-CpDzWqX0.js +0 -3
- package/inspector/dist/assets/index-Cw6eNCH7.js +0 -1
- package/inspector/dist/assets/index-D1_Glu0y.css +0 -1
- package/inspector/dist/assets/index-DMWUqEQi.js +0 -217
- package/inspector/dist/assets/index-DfK1f9gz.js +0 -1
- package/inspector/dist/assets/index-IosqBxL0.js +0 -1
- package/inspector/dist/assets/index-iRFYcgNN.js +0 -1
- package/inspector/dist/assets/index-p5w5E19N.js +0 -1
- package/inspector/dist/assets/index-rAZqRLhj.js +0 -2
- package/inspector/dist/assets/index-yGDq5Egm.js +0 -1
- package/inspector/dist/assets/javascript-iXu5QeM3.js +0 -1
- package/inspector/dist/assets/julia-DuME0IfC.js +0 -1
- package/inspector/dist/assets/livescript-BwQOo05w.js +0 -1
- package/inspector/dist/assets/lua-VAEuO923.js +0 -1
- package/inspector/dist/assets/material-symbols-rounded-DxXFL64Y.woff2 +0 -0
- package/inspector/dist/assets/mathematica-DTrFuWx2.js +0 -1
- package/inspector/dist/assets/mbox-CNhZ1qSd.js +0 -1
- package/inspector/dist/assets/mllike-CXdrOF99.js +0 -1
- package/inspector/dist/assets/modelica-Dc1JOy9r.js +0 -1
- package/inspector/dist/assets/mscgen-BA5vi2Kp.js +0 -1
- package/inspector/dist/assets/mumps-BT43cFF4.js +0 -1
- package/inspector/dist/assets/nsis-LY0VT_u5.js +0 -1
- package/inspector/dist/assets/ntriples-BfvgReVJ.js +0 -1
- package/inspector/dist/assets/octave-Ck1zUtKM.js +0 -1
- package/inspector/dist/assets/oz-BzwKVEFT.js +0 -1
- package/inspector/dist/assets/pascal--L3eBynH.js +0 -1
- package/inspector/dist/assets/perl-CdXCOZ3F.js +0 -1
- package/inspector/dist/assets/pig-CevX1Tat.js +0 -1
- package/inspector/dist/assets/powershell-CFHJl5sT.js +0 -1
- package/inspector/dist/assets/properties-C78fOPTZ.js +0 -1
- package/inspector/dist/assets/protobuf-ChK-085T.js +0 -1
- package/inspector/dist/assets/pug-DeIclll2.js +0 -1
- package/inspector/dist/assets/puppet-DMA9R1ak.js +0 -1
- package/inspector/dist/assets/python-BuPzkPfP.js +0 -1
- package/inspector/dist/assets/q-pXgVlZs6.js +0 -1
- package/inspector/dist/assets/r-B6wPVr8A.js +0 -1
- package/inspector/dist/assets/rpm-CTu-6PCP.js +0 -1
- package/inspector/dist/assets/ruby-BK5aLJev.js +0 -1
- package/inspector/dist/assets/scheme-C41bIUwD.js +0 -1
- package/inspector/dist/assets/shell-CjFT_Tl9.js +0 -1
- package/inspector/dist/assets/sieve-C3Gn_uJK.js +0 -1
- package/inspector/dist/assets/simple-mode-GW_nhZxv.js +0 -1
- package/inspector/dist/assets/smalltalk-CnHTOXQT.js +0 -1
- package/inspector/dist/assets/solr-DehyRSwq.js +0 -1
- package/inspector/dist/assets/sparql-DkYu6x3z.js +0 -1
- package/inspector/dist/assets/spreadsheet-BCZA_wO0.js +0 -1
- package/inspector/dist/assets/sql-D0XecflT.js +0 -1
- package/inspector/dist/assets/stex-C3f8Ysf7.js +0 -1
- package/inspector/dist/assets/stylus-B533Al4x.js +0 -1
- package/inspector/dist/assets/swift-BzpIVaGY.js +0 -1
- package/inspector/dist/assets/tcl-DVfN8rqt.js +0 -1
- package/inspector/dist/assets/textile-CnDTJFAw.js +0 -1
- package/inspector/dist/assets/tiddlywiki-DO-Gjzrf.js +0 -1
- package/inspector/dist/assets/tiki-DGYXhP31.js +0 -1
- package/inspector/dist/assets/toml-Bm5Em-hy.js +0 -1
- package/inspector/dist/assets/troff-wAsdV37c.js +0 -1
- package/inspector/dist/assets/ttcn-CfJYG6tj.js +0 -1
- package/inspector/dist/assets/ttcn-cfg-B9xdYoR4.js +0 -1
- package/inspector/dist/assets/turtle-B1tBg_DP.js +0 -1
- package/inspector/dist/assets/vb-CmGdzxic.js +0 -1
- package/inspector/dist/assets/vbscript-BuJXcnF6.js +0 -1
- package/inspector/dist/assets/velocity-D8B20fx6.js +0 -1
- package/inspector/dist/assets/verilog-C6RDOZhf.js +0 -1
- package/inspector/dist/assets/vhdl-lSbBsy5d.js +0 -1
- package/inspector/dist/assets/webidl-ZXfAyPTL.js +0 -1
- package/inspector/dist/assets/xquery-DzFWVndE.js +0 -1
- package/inspector/dist/assets/yacas-BJ4BC0dw.js +0 -1
- package/inspector/dist/assets/z80-Hz9HOZM7.js +0 -1
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-rAZqRLhj.js","assets/index-DMWUqEQi.js","assets/index-D1_Glu0y.css","assets/index-p5w5E19N.js","assets/index-CDY-uFno.js","assets/index-BrGHSw5I.js","assets/index-CcGsEtey.js","assets/index-CntcQxRr.js","assets/index-C1tY1uK0.js","assets/index-IosqBxL0.js","assets/index-Cw6eNCH7.js","assets/index-CpDzWqX0.js","assets/index-yGDq5Egm.js","assets/index-iRFYcgNN.js","assets/index-BuiRW-03.js","assets/index-BkznuDSS.js","assets/index-B_BJEGG5.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LY0VT_u5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js","assets/index-6VtYKf_K.js","assets/index-DfK1f9gz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Gw=t=>{throw TypeError(t)};var Kw=(t,e,n)=>e.has(t)||Gw("Cannot "+n);var Fn=(t,e,n)=>(Kw(t,e,"read from private field"),n?n.call(t):e.get(t)),Jw=(t,e,n)=>e.has(t)?Gw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),MO=(t,e,n,r)=>(Kw(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{r as C,R as _,j as V,a as b6,g as wE,b as Vc,_ as W,s as ek,I as tk,n as v6}from"./index-DMWUqEQi.js";var S6=Object.defineProperty,w6=(t,e,n)=>e in t?S6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Co=(t,e,n)=>w6(t,typeof e!="symbol"?e+"":e,n);let k6=class kE{constructor(e=new Map){this.map=e}clone(){return new kE(new Map(this.map))}increment(e){const n=this.map.get(e)??0;this.map.set(e,n+1)}decrement(e,n){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&n())}};class Kh{constructor(){Co(this,"map",new Map)}getOrCreate(e){let n=this.map.get(e);return n===void 0&&(n=new Set,this.map.set(e,n)),n}get(e){return this.map.get(e)}use(e,n){const r=this.get(e);r!==void 0&&n(r)}delete(e){return this.map.delete(e)}}function Wa(t,e){return e(t),t}function wb(){}const CE="cell";function nk(t,e){return t===e}const hm=new Map;let C6=class{constructor(e={}){Co(this,"subscriptions",new Kh),Co(this,"singletonSubscriptions",new Map),Co(this,"graph",new Kh),Co(this,"state",new Map),Co(this,"distinctNodes",new Map),Co(this,"executionMaps",new Map),Co(this,"definitionRegistry",new Set),Co(this,"combinedCells",[]);for(const n of Object.getOwnPropertySymbols(e))this.state.set(n,e[n])}cellInstance(e,n=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),n!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,n===!0?nk:n),r}signalInstance(e=!0,n=Symbol()){return e!==!1&&this.distinctNodes.set(n,e===!0?nk:e),n}sub(e,n){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(n),()=>r.delete(n)}singletonSub(e,n){return this.register(e),n===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,n),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,n){const r=this.signalInstance();return this.connect({map:i=>(...o)=>{i(o)},sink:r,sources:e}),this.sub(r,n)}pubIn(e){var n;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),o=i.refCount.clone(),s=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:f,sink:h}of u)f.has(c)&&o.decrement(h,()=>{s.splice(s.indexOf(h),1),a(h)})})};for(;;){const c=s.shift();if(c===void 0)break;const u=c;let f=!1;const h=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){f=!1;return}f=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?h(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(h)(...g)}}),f){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(n=this.singletonSubscriptions.get(u))==null||n(d)}else a(u)}}connect({sources:e,pulls:n=[],map:r,sink:i}){const o={map:r,pulls:new Set(n),sink:this.register(i),sources:new Set(e)};for(const s of[...e,...n])this.register(s),this.graph.getOrCreate(s).add(o);this.executionMaps.clear()}pub(e,n){this.pubIn({[e]:n})}pipe(e,...n){return this.combineOperators(...n)(e)}transformer(...e){return n=>Wa(this.signalInstance(),r=>(this.link(this.pipe(r,...e),n),r))}link(e,n){this.connect({map:r=>i=>{r(i)},sink:n,sources:[e]})}combine(...e){return Wa(this.signalInstance(),n=>{this.connect({map:r=>(...i)=>{r(i)},sink:n,sources:e})})}combineCells(...e){const n=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((o,s)=>o===i.sources[s]));if(n)return n.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...o)=>{i(o)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(n=>this.getValue(n))}register(e){const n=hm.get(e);return n===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),Wa(n.type===CE?this.cellInstance(n.initial,n.distinct,e):this.signalInstance(n.distinct,e),r=>{this.inContext(()=>{n.init(this,r)})}))}inContext(e){return e()}changeWith(e,n,r){this.connect({sources:[n],pulls:[e],sink:e,map:i=>(o,s)=>{i(r(s,o))}})}calculateExecutionMap(e){const n=[],r=new Set,i=new Kh,o=new k6,s=new Kh,l=(a,c=0)=>{o.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(f=>n.indexOf(f)))+1}),this.graph.use(a,u=>{for(const f of u)f.sources.has(a)?(s.getOrCreate(f.sink).add(f),l(f.sink,c)):i.getOrCreate(f.sink).add(a)}),r.add(a),n.splice(c,0,a))};return e.forEach(l),{participatingNodes:n,pendingPulls:i,projections:s,refCount:o}}getExecutionMap(e){let n=e;if(e.length===1){n=e[0];const i=this.executionMaps.get(n);if(i!==void 0)return i}else for(const[i,o]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(s=>e.includes(s)))return o;const r=this.calculateExecutionMap(e);return this.executionMaps.set(n,r),r}combineOperators(...e){return n=>{for(const r of e)n=r(n,this);return n}}};function we(t,e=wb,n=!0){return Wa(Symbol(),r=>{hm.set(r,{type:CE,distinct:n,initial:t,init:e})})}function Nn(t=wb,e=!1){return Wa(Symbol(),n=>{hm.set(n,{type:"signal",distinct:e,init:t})})}function Bc(t=wb){return Wa(Symbol(),e=>{hm.set(e,{type:"signal",distinct:!1,init:t})})}const _E=C.createContext(null);function yh(){const t=C.useContext(_E);if(t===null)throw new Error("useRealm must be used within a RealmContextProvider");return t}function wn(t){const e=yh();e.register(t);const n=C.useCallback(r=>e.sub(t,r),[e,t]);return C.useSyncExternalStore(n,()=>e.getValue(t),()=>e.getValue(t))}function Vn(...t){const e=yh(),n=C.useMemo(()=>e.combineCells.apply(e,t),[e,...t]);return wn(n)}function Zt(t){const e=yh();return e.register(t),C.useCallback(n=>{e.pub(t,n)},[e,t])}function Rl(t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{i(t(o))},sink:r,sources:[e]}),r}}function rn(...t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:i=>(...o)=>{i(o)},pulls:t,sink:r,sources:[e]}),r}}function dm(t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{t(o)&&i(o)},sink:r,sources:[e]}),r}}function TE(t,e){return(n,r)=>{const i=r.signalInstance();return r.connect({map:o=>s=>{o(e=t(e,s))},sink:i,sources:[n]}),i}}const Zp=new WeakMap;function rk(t,e){let n=Zp.get(t);return n||(n=new Set,Zp.set(t,n)),n.add(e),()=>{n.delete(e)}}function ik(t){const e=Zp.get(t);if(Zp.delete(t),!e)return;let n=!1,r;for(const i of[...e].reverse())try{i()}catch(o){n||(n=!0,r=o)}if(n)throw r instanceof Error?r:new Error("Realm cleanup failed with a non-Error value")}function Zr(t){return function(e){return{init:n=>{var r;return(r=t.init)==null?void 0:r.call(t,n,e)},postInit:n=>{var r;return(r=t.postInit)==null?void 0:r.call(t,n,e)},update:n=>{var r;return(r=t.update)==null?void 0:r.call(t,n,e)}}}}function _6({children:t,plugins:e}){const[n,r]=_.useState(null);return _.useEffect(()=>{var i,o;const s=new C6;try{for(const l of e)(i=l.init)==null||i.call(l,s);for(const l of e)(o=l.postInit)==null||o.call(l,s)}catch(l){try{ik(s)}catch(a){throw new AggregateError([l,a],"Realm plugin initialization and cleanup both failed")}throw l}return r(s),()=>{ik(s)}},[]),_.useEffect(()=>{var i;if(n)for(const o of e)(i=o.update)==null||i.call(o,n)}),n?_.createElement(_E.Provider,{value:n},t):null}function q(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function PE(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);n.search=r.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const cr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,T6=cr&&"documentMode"in document?document.documentMode:null,ki=cr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ho=cr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pc=!(!cr||!("InputEvent"in window)||T6)&&"getTargetRanges"in new window.InputEvent("input"),Ms=cr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,EE=cr&&/Android/.test(navigator.userAgent),xh=cr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!EE,$E=cr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zp=cr&&EE&&$E,bh=cr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ki&&!$E,P6=0,E6=1,$6=2,ok=1,sk=2,lk=4,ak=8,A6=16,RO=32,LO=64,kb=128,Q6=1,M6=2,R6=3,L6=4,I6=5,D6=6,yf=xh||Ms||bh?" ":"",bl=`
|
|
3
|
-
|
|
4
|
-
`,Cb=Ho?" ":yf,qo={bold:1,capitalize:1024,code:16,highlight:kb,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},N6={directionless:1,unmergeable:2},jp={center:2,end:6,justify:4,left:1,right:3,start:5},V6={[M6]:"center",[D6]:"end",[L6]:"justify",[Q6]:"left",[R6]:"right",[I6]:"start"},B6={normal:0,segmented:2,token:1},F6={[P6]:"normal",[$6]:"segmented",[E6]:"token"},ck="$config";function uk(){return Mt()._blockCursorElement}function Z6(t){return t!==null&&t.nodeType===1&&t.hasAttribute("data-lexical-slot")}let AE=class ip{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new ip(this.element,e,this.after)}withAfter(e){return new ip(this.element,this.before,e)}withElement(e){return this.element===e?this:new ip(e,this.before,this.after)}insertChild(e){const n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&q(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&q(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&q(359),this.element.replaceChild(e,n),this}getFirstChild(){const e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";const i=fk(e,this.element);if(i===null)return"after";const o=Array.prototype.indexOf.call(e.childNodes,i);if(o<0)return"after";if(n===e)return r<=o?"before":"after";const s=fk(e,n);if(s===null)return"after";const l=Array.prototype.indexOf.call(e.childNodes,s);return l>=0&&l<=o?"before":"after"}getInsertionAnchor(){return this.before}};function fk(t,e){let n=e;for(;n!==null&&n.parentNode!==t;)n=n.parentNode;return n}let QE=class op extends AE{withBefore(e){return new op(this.element,e,this.after)}withAfter(e){return new op(this.element,this.before,e)}withElement(e){return this.element===e?this:new op(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;for(;Z6(n);)e=n,n=n.nextSibling;const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===uk()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{const n=e==="decorator"&&(bh||Ms||xh);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,o=Tt().createElement("br");if(o.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(o,i),e){const s=Tt().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,o),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=o}getFirstChildOffset(){const e=this.getFirstChild(),n=this.getInsertionAnchor();let r=0;for(let i=this.element.firstChild;i!==null&&i!==e&&i!==n;i=i.nextSibling)r++;return r}resolveChildIndex(e,n,r,i){if(r===this.element){const a=this.getFirstChildOffset(),c=uk(),u=this.element.childNodes,f=Math.min(i,u.length);let h=0;for(let d=a;d<f;d++)u[d]!==c&&h++;return[e,Math.min(h,e.getChildrenSize())]}const o=hk(n,r);o.push(i);const s=hk(n,this.element);let l=e.getIndexWithinParent();for(let a=0;a<s.length;a++){const c=o[a],u=s[a];if(c===void 0||c<u)break;if(c>u){l+=1;break}}return[e.getParentOrThrow(),l]}};function hk(t,e){const n=[];let r=e;for(;r!==t&&r!==null;r=r.parentNode){let i=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)i++;n.push(i)}return r!==t&&q(225),n.reverse()}let ME;try{ME="0.48.0+prod.esm"}catch{}const RE=ME??'"<unknown>+source"';let Ou=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const sl=null;function LE(t,e=1e3){return t instanceof R0?t.clone():t.size<e?new Map(t):new R0().init(new Map(t),void 0,t.size)}let R0=class IE{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new IE().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){const n=this.getWithTombstone(e);return n===sl?void 0:n}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const n=new Map(this._old);for(const[r,i]of this._nursery)i!==sl?n.set(r,i):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){const r=this.getWithTombstone(e);if(r===n)return this;const i=this.getNursery();return r!==sl&&r!==void 0||(this._size++,r===sl&&i.delete(e)),i.set(e,n),this}delete(e){const n=this.has(e);return n&&(this.getNursery().set(e,sl),this._size--),n}getOrInsert(e,n){const r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){const r=this.get(e);if(r!==void 0)return r;const i=n(e);return this.set(e,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,n=this._old;if(n)for(const r of n){const i=r[0],o=e?e.get(i):void 0;o!==sl&&(o!==void 0&&(r[1]=o),yield r)}if(e)for(const r of e)r[1]===sl||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(const[r,i]of this.entries())e(i,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Xp(t,e,n,r,i,o){if(N(t)){let s=t.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&((N(s)||Do(s)&&s.__slots!==null)&&Xp(s,l,n,r,i,o),n.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}for(const s of Do(t)&&t.__slots!==null?t.__slots.values():[]){const l=r.get(s);l!==void 0&&Fl(l)&&l.__slotHost===e&&((N(l)||Do(l)&&l.__slots!==null)&&Xp(l,s,n,r,i,o),n.has(s)||o.delete(s),i.push(s))}}let L0=!1,_b=0;function z6(t){_b=t.timeStamp}function IO(t,e,n){const r=t.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(t===i||r&&t.previousSibling===i)||r&&jc(t,n)!==void 0}function j6(t,e,n){const r=ur(kr(n)),i=r&&ai(r,n._rootElement);let o=null,s=null;i!==null&&i.anchorNode===t&&(o=i.anchorOffset,s=i.focusOffset);const l=t.nodeValue;l!==null&&Wb(e,l,o,s,!1)}function X6(t,e,n){if(X(t)){const r=t.anchor.getNode();if(r.is(n)&&t.format!==r.getFormat())return!1}return wr(e)&&n.isAttached()}function W6(t,e,n){for(let r=t;r&&!cA(r);r=Us(r)){const i=jc(r,e);if(i!==void 0){const o=Ge(i,n);if(o)return Fe(o)||!Qe(r)?void 0:[r,o]}}}function DE(t,e,n){L0=!0;const r=performance.now()-_b>100;try{ni(t,()=>{const i=ne()||(function(f){return f.read("latest",()=>{const h=ne();return h!==null?h.clone():null})})(t),o=new Map,s=t._editorState,l=t._blockCursorElement;let a=!1,c="";for(let f=0;f<e.length;f++){const h=e[f],d=h.type,p=h.target,g=W6(p,t,s);if(!g)continue;const[m,O]=g;if(d==="characterData")r&&Y(O)&&wr(p)&&X6(i,p,O)&&j6(p,O,t);else if(d==="childList"){a=!0;const y=h.addedNodes;for(let S=0;S<y.length;S++){const v=y[S],w=U$(v),k=v.parentNode;if(!(k==null||v===l||w!==null||IO(v,k,t)||t._slotsUsed&&Qe(v)&&v.hasAttribute("data-lexical-slot")||cA(v))){if(Ho){const P=(Qe(v)?v.innerText:null)||v.nodeValue;P&&(c+=P)}k.removeChild(v)}}const x=h.removedNodes,b=x.length;if(b>0){let S=0;for(let v=0;v<b;v++){const w=x[v];(IO(w,p,t)||l===w)&&(p.appendChild(w),S++)}b!==S&&o.set(m,O)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,t);const u=n.takeRecords();if(u.length>0){for(let f=0;f<u.length;f++){const h=u[f],d=h.addedNodes,p=h.target;for(let g=0;g<d.length;g++){const m=d[g],O=m.parentNode;O==null||m.nodeName!=="BR"||IO(m,p,t)||O.removeChild(m)}}n.takeRecords()}i!==null&&(a&&Vt(i),Ho&&nA(t)&&i.insertRawText(c))})}finally{L0=!1}}function NE(t){const e=t._observer;e!==null&&DE(t,e.takeRecords(),e)}function VE(t){(function(e){_b===0&&kr(e).addEventListener("textInput",z6,!0)})(t),t._observer=new MutationObserver((e,n)=>{DE(t,e,n)})}const dk="latest";let H6=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||U6).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function vh(t,e){return new H6(t,e)}function pm(t,e,n=dk){const r=(n===dk?t.getLatest():t).__state;return r?r.getValue(e):e.defaultValue}function Ha(t,e,n){let r;if(On(),typeof n=="function"){const o=t.getLatest(),s=pm(o,e);if(r=n(s),e.isEqual(s,r))return o}else r=n;const i=t.getWritable();return FE(i).updateFromKnown(e,r),i}function q6(t){const e=new Map,n=new Set;for(const{ownNodeConfig:r}of Kb(typeof t=="function"?t:t.replace))if(r&&r.stateConfigs)for(const i of r.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&n.add(o.key)):o=i,e.set(o.key,o)}return{flatKeys:n,sharedConfigMap:e}}const pk=new Set(["__proto__","constructor","prototype"]);let Y6=class BE{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,i=new Map,o=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,l=o!==void 0?o:(function(a,c,u){let f=u.size;if(c)for(const h in c){const d=a.get(h);d&&u.has(d)||f++}return f})(s,r,i);this.size=l}getValue(e){const n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},n={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return gk(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new BE(e,n,(function(o,s,l){let a;if(l)for(const[c,u]of Object.entries(l)){if(pk.has(c))continue;const f=o.get(c);f?s.has(f)||s.set(f,f.parse(u)):(a=a||{},a[c]=u)}return a})(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:o}=this;i.has(e)||o&&r in o||(o&&(delete o[r],this.unknownState=gk(o)),this.size++),i.set(e,n)}updateFromUnknown(e,n){if(pk.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=n)}updateFromJSON(e){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function FE(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Y6(e,ZE(e));return e.__state=n,n}function ZE(t){return t.__state?t.__state.sharedNodeState:H$(Mt(),t.getType()).sharedNodeState}function gk(t){if(t)for(const e in t)return t}function U6(t){return t}function mk(t,e,n){for(const[r,i]of e.knownState){if(t.has(r.key))continue;t.add(r.key);const o=n?n.getValue(r):r.defaultValue;if(o!==i&&!r.isEqual(o,i))return!0}return!1}function Ok(t,e,n){const{unknownState:r}=e,i=n?n.unknownState:void 0;if(r){for(const[o,s]of Object.entries(r))if(!t.has(o)&&(t.add(o),s!==(i?i[o]:void 0)))return!0}return!1}function yk(t,e){const n=t.__state;return n&&n.node===t?n.getWritable(e):n}function xk(t,e){const n=t.__mode,r=t.__format,i=t.__style,o=e.__mode,s=e.__format,l=e.__style,a=t.__state,c=e.__state;return(n===null||n===o)&&(r===null||r===s)&&(i===null||i===l)&&(t.__state===null||a===c||(function(u,f){if(u===f)return!0;const h=new Set;return!(u&&mk(h,u,f)||f&&mk(h,f,u)||u&&Ok(h,u,f)||f&&Ok(h,f,u))})(a,c))}function bk(t,e){const n=t.mergeWithSibling(e),r=at()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function vk(t){let e,n,r=t;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&Y(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(xk(e,r)){r=bk(e,r);break}break}e.remove()}for(;(n=r.getNextSibling())!==null&&Y(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(xk(r,n)){r=bk(r,n);break}break}n.remove()}}else r.remove()}function Ki(t){return Sk(t.anchor),Sk(t.focus),t}function Sk(t){for(;t.type==="element";){const e=t.getNode(),n=t.offset;let r,i;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),i=!0):(r=e.getChildAtIndex(n),i=!1),Y(r)){t.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!N(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const xf=Symbol.for("@lexical/CachedTextSize");function wk(t,e){return D0.read(()=>{let n=0,r=t;for(let i=0;i<e&&r!==null;i++){const o=Ei.get(r);if(o===void 0&&q(345,r),N(o)){const s=Rt.get(r);if(s!==void 0&&N(s)&&s.__parent!==o.__parent)n+=o.getTextContentSize();else{const l=Ll.get(r),a=l&&l.__lexicalTextContent;typeof a!="string"&&q(346,o.getType()),n+=a.length}i<e-1&&!o.isInline()&&(n+=2)}else{const s=o[xf];s===void 0&&q(347,o.getType(),r),n+=s}r=o.__next}return n},{editor:nt})}function zE(t){N(t)||t[xf]===void 0&&(t[xf]=Y(t)?t.__text.length:t.getTextContentSize())}const G6=4;let bf,nt,vf,Xe="",jt=null,zn=null,$n=null;function Ji(){return{firstTextKey:$n,format:jt,style:zn}}function Hr(t){t.firstTextKey!==null&&(jt=t.format,zn=t.style,$n=t.firstTextKey)}function I0(t){if($n!==null)return;const e=t.__lexicalFirstTextKey;if(e===void 0&&q(348),e===null)return;const n=Rt.get(e);Y(n)&&(jt=n.getFormat(),zn=n.getStyle(),$n=e)}let gm,Hu,qu,Ei,D0,Rt,Ll,N0,Sf,Il,$o=!1,Wp=!1;function Es(t,e){const n=Ei.get(t),r=Rt.has(t);if(e!==null){const i=z0(t);i.parentNode===e&&e.removeChild(i)}if(!r){if(nt._keyToDOMMap.delete(t),N(n)){const i=cg(n,Ei);V0(i,0,i.length-1,null)}if(n!==void 0){for(const i of Lr(n).values()){const o=F0(i);Es(i,null),o!==null&&o.remove()}Hb(Sf,vf,gm,n,"destroyed")}}}function V0(t,e,n,r){for(let i=e;i<=n;++i){const o=t[i];o!==void 0&&Es(o,r)}}function ll(t,e){t.setProperty("text-align",e)}const K6="40px";function jE(t,e){const n=bf.theme.indent;if(typeof n=="string"){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}t.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${K6}))`)}function XE(t,e){const n=t.style;e===0?ll(n,""):e===1?ll(n,"left"):e===2?ll(n,"center"):e===3?ll(n,"right"):e===4?ll(n,"justify"):e===5?ll(n,"start"):e===6&&ll(n,"end")}function B0(t,e){const n=(function(r){const i=r.__dir;if(i!==null)return i;if(Nt(r))return null;const o=r.getParent();return o===null||gt(o)&&o.__dir===null?"auto":null})(e);n!==null?t.dir=n:t.removeAttribute("dir")}function WE(t){const e=Tt().createElement("div");return e.setAttribute("data-lexical-slot",t),e.style.display="none",e}function HE(t,e,n){e||t.contentEditable==="false"?aN(n,nt):n.removeAttribute("contenteditable")}function kk(t,e,n){const r=Xe,i=Ji();Xe="";let o="";const s=Fe(t);for(const[l,a]of n){const c=WE(l);HE(e,s,c),e.appendChild(c),Xe="";const u=Ji();$s(a,ci(t,c,nt)),Hr(u),qE(t,l,e,c),o+=Xe}return Hr(i),Xe=r,o}function Lr(t){return Do(t)&&t.__slots!==null?t.__slots:hA}function qE(t,e,n,r){const i=Il.$getSlotTargetElement(t,e,n,nt);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function F0(t){const e=Ll.get(t);return e!==void 0?e.parentElement:null}function Ck(t,e,n){const r=Lr(t),i=Lr(e);for(const[u,f]of r)if(!i.has(u)){const h=F0(f);Es(f,null),h!==null&&h.remove()}const o=Xe,s=Ji();let l="",a=null;const c=Fe(e);for(const[u,f]of i){const h=r.get(u);let d=h!==void 0?F0(h):null;Xe="";const p=Ji();if(d===null){d=WE(u);let g=null;for(const m of n.children)if(!m.hasAttribute("data-lexical-slot")){g=m;break}n.insertBefore(d,g),$s(f,ci(e,d,nt))}else h===f?Po(f,d):(h!==void 0&&Es(h,d),$s(f,ci(e,d,nt)));if(Hr(p),HE(n,c,d),qE(e,u,n,d),l+=Xe,d.parentElement===n){const g=a===null?n.firstChild:a.nextSibling;g!==d&&n.insertBefore(d,g),a=d}}return Hr(s),Xe=o,l}function $s(t,e){const n=Rt.get(t);if(n===void 0&&q(60),e!==null){const i=Ei.get(t);if(i!==void 0){const o=Ll.get(t);if(o!==void 0){const s=Fl(i)?i.__slotHost:null,l=Fl(n)?n.__slotHost:null,a=i.__parent!==n.__parent||s!==l,c=l!==null&&o.parentElement!==e.element;if(a||c)return e.insertChild(o),Po(t,e.element)}}}const r=Il.$createDOM(n,nt);if((function(i,o,s){const l=s._keyToDOMMap;G$(o,s,i),l.set(i,o)})(t,r,nt),Y(n)?r.setAttribute("data-lexical-text","true"):Fe(n)&&(r.setAttribute("data-lexical-decorator","true"),lN(r,{captureSelection:!0})),N(n)){const i=n.__indent,o=n.__size;B0(r,n),i!==0&&jE(r,i);const s=Lr(n),l=s.size>0?kk(n,r,s):"";if(o===0)r.__lexicalTextContent=l,r.__lexicalFirstTextKey=null,Xe+=l,s.size>0&&(r.__lexicalSlotTextLength=l.length);else{const c=Xe,u=o-1;if(Z0(cg(n,Rt),n,0,u,ci(n,r,nt)),l!==""){const f=r.__lexicalTextContent||"";r.__lexicalTextContent=l+f,Xe=c+l+f}s.size>0&&(r.__lexicalSlotTextLength=l.length)}const a=n.__format;a!==0&&XE(r,a),n.isInline()||YE(null,n,r)}else{const i=n.getTextContent();if(Fe(n)){const o=n.decorate(nt,bf);o!==null&&UE(t,o),r.contentEditable="false";const s=Lr(n);s.size>0&&kk(n,r,s)}Xe+=i}return e!==null&&e.insertChild(r),Il.$decorateDOM(n,null,r,nt),zE(n),Hb(Sf,vf,gm,n,"created"),r}function Z0(t,e,n,r,i){const o=Xe,s=Ji();Xe="",jt=null,zn=null,$n=null;let l=n;for(;l<=r;++l){const c=Ji();$s(t[l],i);const u=Rt.get(t[l]);u!==null&&Y(u)?jt===null&&(jt=u.getFormat(),zn=u.getStyle(),$n=u.__key):N(u)&&l<r&&!u.isInline()&&(Xe+=bl),Hr(c)}const a=nt._keyToDOMMap.get(e.__key);a===void 0&&q(349,e.__key),a.__lexicalTextContent=Xe,a.__lexicalFirstTextKey=$n,Xe=o+Xe,Hr(s)}function YE(t,e,n){const r=ci(e,n,nt),i=r.element.__lexicalLastChildKind??null,o=(function(s,l){if(s){const a=s.__last;if(a){const c=l.get(a);if(c)return kn(c)?"line-break":Fe(c)&&c.isInline()?"decorator":null}return Lr(s).size>0?null:"empty"}return null})(e,Rt);i!==o&&r.setManagedLineBreak(o)}function J6(t,e,n){var r;jt=null,zn=null,$n=null,(function(i,o,s){const l=Xe,a=i.__size,c=o.__size;Xe="";const u=s.element,f=nt._keyToDOMMap.get(o.__key);f===void 0&&q(351,o.__key);const h=c-a;if(!$o&&Math.abs(h)<=1&&a>=G6&&i.__first===o.__first&&(h!==0||!nt._cloneNotNeeded.has(i.__key))){const d=f.__lexicalTextContent,p=N0.get(i.__key);if(!$o&&typeof d=="string"&&p!==void 0){const g=(function(m,O){const y=O.size;if(y===0||y>=m.__size)return null;let x=m.__last,b=null,S=0;for(;x!==null&&S<y;){if(!O.has(x))return null;b=x;const v=Rt.get(x);if(v===void 0)return null;x=v.__prev,S++}return S!==y||x!==null&&O.has(x)?null:b})(o,p);if(g!==null){const m=p.size;if(h===0){const O=wk(g,m);let y=g,x=0;for(;y!==null&&x<m;){const k=Rt.get(y);if(k===void 0)break;const P=Ji();Po(y,u),Y(k)&&jt===null&&(jt=k.getFormat(),zn=k.getStyle(),$n=k.__key),Hr(P),y=k.__next,x++}let b="";for(y=g,x=0;y!==null&&x<m;){const k=Rt.get(y);if(k===void 0)break;let P;if(N(k)){const T=nt._keyToDOMMap.get(y),M=T&&T.__lexicalTextContent;typeof M!="string"&&q(352,k.getType()),P=M}else P=k.getTextContent();b+=P,x<m-1&&N(k)&&!k.isInline()&&(b+=bl),y=k.__next,x++}const S=f.__lexicalSlotTextLength||0,v=S>0?d.slice(S):d,w=v.slice(0,v.length-O)+b;return f.__lexicalTextContent=w,Xe=l+w,void _k(o,f,p)}if((function(O,y,x,b,S,v,w,k){if(k!==1&&k!==-1||w!==(k===1?2:1))return!1;const T=w-k;let M=O.__last;for(let pe=0;pe<T-1;pe++){if(M===null)return!1;const he=Ei.get(M);if(he===void 0)return!1;M=he.__prev}if(M===null)return!1;const I=Rt.get(v),$=Ei.get(M);if(I===void 0||$===void 0||I.__prev!==$.__prev)return!1;const D=[];let Z=v;for(let pe=0;pe<w;pe++){if(Z===null)return!1;D.push(Z);const he=Rt.get(Z);Z=he?he.__next:null}const G=[];Z=M;for(let pe=0;pe<T;pe++){if(Z===null)return!1;G.push(Z);const he=Ei.get(Z);Z=he?he.__next:null}const z=new Set(G),ee=new Set(D),oe=[];let Q=0,ve=0;for(;Q<T&&ve<w;)if(D[ve]===G[Q])oe.push({key:D[ve],kind:"reconcile"}),Q++,ve++;else if(ee.has(G[Q])){if(z.has(D[ve]))return!1;oe.push({key:D[ve],kind:"create",nextIndex:ve}),ve++}else oe.push({key:G[Q],kind:"destroy"}),Q++;for(;Q<T;)oe.push({key:G[Q++],kind:"destroy"});for(;ve<w;)oe.push({key:D[ve],kind:"create",nextIndex:ve}),ve++;const _e=wk(M,T);for(const pe of oe){const he=Ji();if(pe.kind==="reconcile")Po(pe.key,x.element);else if(pe.kind==="destroy")Es(pe.key,x.element);else{let J=null;for(let ue=pe.nextIndex+1;ue<w;ue++){const Se=nt._keyToDOMMap.get(D[ue]);if(Se!==void 0){J=Se;break}}$s(pe.key,x.withBefore(J??x.before))}if(pe.kind!=="destroy"){const J=Rt.get(pe.key);J&&Y(J)&&jt===null&&(jt=J.getFormat(),zn=J.getStyle(),$n=J.__key)}Hr(he)}let L="";for(let pe=0;pe<w;pe++){const he=Rt.get(D[pe]);if(he===void 0)return!1;let J;if(N(he)){const ue=nt._keyToDOMMap.get(D[pe]),Se=ue&&ue.__lexicalTextContent;typeof Se!="string"&&q(350,he.getType()),J=Se}else J=he.getTextContent();L+=J,pe<w-1&&N(he)&&!he.isInline()&&(L+=bl)}const Ie=b.__lexicalSlotTextLength||0,Be=Ie>0?S.slice(Ie):S;return b.__lexicalTextContent=Be.slice(0,Be.length-_e)+L,!0})(i,0,s,f,d,g,m,h)){const O=f.__lexicalTextContent;return typeof O!="string"&&q(353),Xe=l+O,void _k(o,f,p)}}}if(h===0){let g=i.__first,m=0;for(;g!==null;){const O=Rt.get(g);if(O===void 0)break;const y=$o||qu.has(g)||Hu.has(g),x=Ji();if(y)Po(g,u);else{let b,S;if(N(O)){S=Ll.get(g);const v=S&&S.__lexicalTextContent;typeof v!="string"&&q(354,O.getType()),b=v}else b=O.getTextContent();Xe+=b,S!==void 0&&I0(S)}Y(O)?jt===null&&(jt=O.getFormat(),zn=O.getStyle(),$n=O.__key):N(O)&&m<c-1&&!O.isInline()&&(Xe+=bl),Hr(x),g=O.__next,m++}return f.__lexicalTextContent=Xe,f.__lexicalFirstTextKey=$n,void(Xe=l+Xe)}}if(a===1&&c===1){const d=i.__first,p=o.__first;if(d===p)Po(d,u);else{const m=z0(d),O=$s(p,null);try{m.parentNode===u?u.replaceChild(O,m):s.insertChild(O)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${u.tagName}, new child: {tag: ${O.tagName} key: ${p}}, old child: {tag: ${m.tagName}, key: ${d}}.`;throw new Error(x)}throw y}Es(d,null)}const g=Rt.get(p);Y(g)&&jt===null&&(jt=g.getFormat(),zn=g.getStyle(),$n=g.__key)}else{const d=cg(i,Ei),p=cg(o,Rt);if(d.length!==a&&q(227),p.length!==c&&q(228),a===0)c!==0&&Z0(p,o,0,c-1,s);else if(c===0){if(a!==0){const g=s.after==null&&s.before==null&&Lr(o).size===0&&s.element.__lexicalLineBreak==null;V0(d,0,a-1,g?null:u),g&&(u.textContent="")}}else(function(g,m,O,y,x,b){const S=y-1,v=x-1;let w,k,P=b.getFirstChild(),T=0,M=0;for(;T<=S&&M<=v;){const D=m[T],Z=O[M],G=Ji();if(D===Z)P=DO(Po(Z,b.element)),T++,M++;else{if(k===void 0&&(k=Tk(O,M)),w===void 0)w=Tk(m,T);else if(!w.has(D)){T++,Hr(G);continue}if(!k.has(D)){P=DO(z0(D)),Es(D,b.element),T++,w.delete(D),Hr(G);continue}if(w.has(Z)){const ee=yc(nt,Z);ee!==P&&b.withBefore(P??b.before).insertChild(ee),P=DO(Po(Z,b.element)),T++,M++}else $s(Z,b.withBefore(P??b.before)),M++}const z=Rt.get(Z);z!==null&&Y(z)?jt===null&&(jt=z.getFormat(),zn=z.getStyle(),$n=z.__key):N(z)&&M<=v&&!z.isInline()&&(Xe+=bl),Hr(G)}const I=T>S,$=M>v;if(I&&!$){const D=O[v+1],Z=D===void 0?null:nt.getElementByKey(D);Z0(O,g,M,v,b.withBefore(Z??b.before))}else $&&!I&&V0(m,T,S,b.element)})(o,d,p,a,c,s)}f.__lexicalTextContent=Xe,f.__lexicalFirstTextKey=$n,Xe=l+Xe})(t,e,ci(e,n,nt)),gt(e)||(r=e,jt==null||jt===r.__textFormat||Wp||r.setTextFormat(jt),(function(i){zn==null||zn===i.__textStyle||Wp||i.setTextStyle(zn)})(e))}function _k(t,e,n){const r=e.__lexicalFirstTextKey;if(r!=null){const i=t.__key;let o=r;for(;o!==null;){const s=Rt.get(o);if(s===void 0){o=null;break}if(s.__parent===i)break;o=s.__parent}if(o!==null&&!n.has(o)){const s=Rt.get(r);if(Y(s))return jt=s.getFormat(),void(zn=s.getStyle())}}e.__lexicalFirstTextKey=$n}function Po(t,e){const n=Ei.get(t);let r=Rt.get(t);n!==void 0&&r!==void 0||q(61);const i=$o||qu.has(t)||Hu.has(t),o=yc(nt,t);if(n===r&&!i){let s;if(N(n)){const l=o.__lexicalTextContent;typeof l!="string"&&q(355,n.getType()),s=l,I0(o)}else s=n.getTextContent();return Xe+=s,o}if(n!==r&&i&&Hb(Sf,vf,gm,r,"updated"),Il.$updateDOM(r,n,o,nt)){const s=$s(t,null);return e===null&&q(62),e.replaceChild(s,o),Es(t,null),s}if(N(n)){N(r)||q(334,t);const s=r.__indent;($o||s!==n.__indent)&&jE(o,s);const l=r.__format;($o||l!==n.__format)&&XE(o,l);const a=i&&(Lr(r).size>0||Lr(n).size>0)?Ck(n,r,o):"";if(i){const c=Xe;if(J6(n,r,o),Nt(r)||r.isInline()||YE(0,r,o),a!==""){const u=o.__lexicalTextContent||"";o.__lexicalTextContent=a+u,Xe=c+a+u,o.__lexicalSlotTextLength=a.length}else(Lr(r).size>0||Lr(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const c=o.__lexicalTextContent;typeof c!="string"&&q(356,n.getType()),Xe+=c,I0(o)}if(($o||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(B0(o,r),Nt(r)&&!$o))for(const c of r.getChildren())N(c)&&B0(yc(nt,c.getKey()),c)}else{const s=r.getTextContent();if(Fe(r)){const l=r.decorate(nt,bf);l!==null&&UE(t,l),i&&(Lr(r).size>0||Lr(n).size>0)&&Ck(n,r,o)}Xe+=s}if(!Wp&&Nt(r)){const s=r.getLatest();if(s.__cachedText!==Xe){const l=s.getWritable();l.__cachedText=Xe,r=l}}return Il.$decorateDOM(r,n,o,nt),zE(r),o}function UE(t,e){let n=nt._pendingDecorators;const r=nt._decorators;if(n===null){if(r[t]===e)return;n=K$(nt)}n[t]=e}function DO(t){let e=t.nextSibling;return e!==null&&e===nt._blockCursorElement&&(e=e.nextSibling),e}function Tk(t,e){const n=new Set;for(let r=e;r<t.length;r++)n.add(t[r]);return n}function eD(t,e,n,r,i,o){Xe="",jt=null,zn=null,$n=null,$o=r===2,nt=n,bf=n._config,Il=n._config.dom||ig,vf=n._nodes,gm=nt._listeners.mutation,Hu=i,qu=o,Ei=t._nodeMap,D0=t,Rt=e._nodeMap,Wp=e._readOnly,Ll=LE(n._keyToDOMMap),N0=(function(){const l=new Map,a=c=>{for(const u of c){const f=Rt.get(u);if(f===void 0)continue;const h=f.__parent;if(h===null)continue;let d=l.get(h);d===void 0&&(d=new Set,l.set(h,d)),d.add(u)}};return a(Hu.keys()),a(qu),l})();const s=new Map;return Sf=s,Po("root",null),nt=void 0,vf=void 0,Hu=void 0,qu=void 0,Ei=void 0,D0=void 0,Rt=void 0,bf=void 0,Ll=void 0,N0=void 0,Sf=void 0,Il=ig,s}function z0(t){const e=Ll.get(t);return e===void 0&&q(75,t),e}function Pe(t){return{type:t}}const Tb=Pe("SELECTION_CHANGE_COMMAND"),tD=Pe("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Pb=Pe("CLICK_COMMAND"),GE=Pe("BEFORE_INPUT_COMMAND"),KE=Pe("INPUT_COMMAND"),JE=Pe("COMPOSITION_START_COMMAND"),e$=Pe("COMPOSITION_END_COMMAND"),Cl=Pe("DELETE_CHARACTER_COMMAND"),qa=Pe("INSERT_LINE_BREAK_COMMAND"),wf=Pe("INSERT_PARAGRAPH_COMMAND"),Ya=Pe("CONTROLLED_TEXT_INSERTION_COMMAND"),mm=Pe("PASTE_COMMAND"),sp=Pe("REMOVE_TEXT_COMMAND"),kf=Pe("DELETE_WORD_COMMAND"),Cf=Pe("DELETE_LINE_COMMAND"),Qo=Pe("FORMAT_TEXT_COMMAND"),nD=Pe("SET_TEXT_FORMAT_COMMAND"),Om=Pe("UNDO_COMMAND"),ym=Pe("REDO_COMMAND"),xm=Pe("KEYDOWN_COMMAND"),t$=Pe("KEY_ARROW_RIGHT_COMMAND"),n$=Pe("MOVE_TO_END"),Eb=Pe("KEY_ARROW_LEFT_COMMAND"),r$=Pe("MOVE_TO_START"),$b=Pe("KEY_ARROW_UP_COMMAND"),Ab=Pe("KEY_ARROW_DOWN_COMMAND"),gc=Pe("KEY_ENTER_COMMAND"),Qb=Pe("KEY_SPACE_COMMAND"),Mb=Pe("KEY_BACKSPACE_COMMAND"),bm=Pe("KEY_ESCAPE_COMMAND"),i$=Pe("KEY_DELETE_COMMAND"),vm=Pe("KEY_TAB_COMMAND"),o$=Pe("INSERT_TAB_COMMAND"),Hp=Pe("INDENT_CONTENT_COMMAND"),j0=Pe("OUTDENT_CONTENT_COMMAND"),s$=Pe("DROP_COMMAND"),rD=Pe("FORMAT_ELEMENT_COMMAND"),l$=Pe("DRAGSTART_COMMAND"),a$=Pe("DRAGOVER_COMMAND"),iD=Pe("DRAGEND_COMMAND"),Sm=Pe("COPY_COMMAND"),Rb=Pe("CUT_COMMAND"),c$=Pe("SELECT_ALL_COMMAND"),oD=Pe("CLEAR_EDITOR_COMMAND"),sD=Pe("CLEAR_HISTORY_COMMAND"),vl=Pe("CAN_REDO_COMMAND"),Sl=Pe("CAN_UNDO_COMMAND"),wm=Pe("FOCUS_COMMAND"),Lb=Pe("BLUR_COMMAND"),lD=Pe("KEY_MODIFIER_COMMAND");function aD(t){const e=new Map;return{dispose(){for(const n of e.values())n.dispose();e.clear()},register(n,r){let i=e.get(n);i===void 0&&(i={dispose:t(n,r),holders:new Set},e.set(n,i));const o=()=>{const s=e.get(n);s&&s.holders.delete(o)&&s.holders.size===0&&(e.delete(n),s.dispose())};return i.holders.add(o),o}}}function Ib(t,e,n,r){return t.addEventListener(e,n,r),t.removeEventListener.bind(t,e,n,r)}const bo=Object.freeze({}),X0=[["keydown",function(t,e){const n=e._inputState;n.lastKeyDownTimeStamp=t.timeStamp,n.lastKeyCode=t.key,t.key!=="Backspace"&&_f(n),!e.isComposing()&&be(e,xm,t)}],["pointerdown",function(t,e){const n=Ub(t),r=t.pointerType;Xc(n)&&r!=="touch"&&r!=="pen"&&t.button===0&&ni(e,()=>{ag(n,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(t,e){be(e,JE,t)}],["compositionend",function(t,e){const n=e._inputState;Ho?n.compositionPhase="ending-firefox":Ms||!xh&&!bh?be(e,e$,t):(n.compositionPhase="ending-safari",n.compositionEndData=t.data)}],["input",function(t,e){t.stopPropagation();const n=e._inputState;_f(n),ni(e,()=>{d$(t,e)||e.dispatchCommand(KE,t)},{event:t}),n.unprocessedBeforeInputData=null}],["click",function(t,e){ni(e,()=>{const n=ne(),r=ur(kr(e)),i=aa();if(r){if(X(n)){const o=n.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&n.isCollapsed()&&!Nt(s)&&ut().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(t.pointerType==="touch"||t.pointerType==="pen"){const o=ai(r,e._rootElement).anchorNode;(Qe(o)||wr(o))&&Vt(Nb(i,r,e,t))}}be(e,Pb,t)})}],["cut",bo],["copy",bo],["dragstart",bo],["dragover",bo],["dragend",bo],["paste",bo],["focus",bo],["blur",bo],["drop",bo]];pc&&X0.push(["beforeinput",(t,e)=>(function(n,r){const i=n.inputType;i==="deleteCompositionText"||Ho&&nA(r)||i!=="insertCompositionText"&&ni(r,()=>{d$(n,r)||be(r,GE,n)},{event:n})})(t,e)]);const W0=new WeakMap,qp=new WeakMap,cD=aD(t=>(t.addEventListener("selectionchange",Qk),()=>t.removeEventListener("selectionchange",Qk)));function u$(t,e,n,r,i,o){const s=t.anchor,l=t.focus,a=s.getNode(),c=at();let u;if(o!==void 0)u=o;else{const g=ur(kr(c));u=g!==null?ai(g,c._rootElement):null}const f=u!==null?u.anchorNode:null,h=s.key,d=c.getElementByKey(h),p=n.length;return h!==l.key||!Y(a)||(!i&&(!pc||c._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||a.isDirty()&&p<2||J$(n))&&s.offset!==l.offset&&!a.isComposing()||Dr(a)||a.isDirty()&&p>1||(i||!pc)&&d!==null&&!a.isComposing()&&f!==As(a,d,c)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||!a.isComposing()&&(a.getFormat()!==t.format||a.getStyle()!==t.style)||(function(g,m){if(m.isSegmented())return!0;if(!g.isCollapsed())return!1;const O=g.anchor.offset,y=m.getParentOrThrow(),x=Pl(m);return O===0?!m.canInsertTextBefore()||!y.canInsertTextBefore()&&!m.isComposing()||x||(function(b){const S=b.getPreviousSibling();return(Y(S)||N(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):O===m.getTextContentSize()&&(!m.canInsertTextAfter()||!y.canInsertTextAfter()&&!m.isComposing()||x)})(t,a)}function Pk(t,e){return wr(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function Ek(t,e,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=ai(t,e._rootElement),l=e._inputState;l.isSelectionChangeFromDOMUpdate&&(l.isSelectionChangeFromDOMUpdate=!1,Pk(r,i)&&Pk(o,s)&&!l.postDeleteSelectionToRestore)||ni(e,()=>{if(!n)return void Vt(null);if(!kh(e,r,o))return;let a=ne();if(l.postDeleteSelectionToRestore&&X(a)&&a.isCollapsed()){const c=a.anchor,u=l.postDeleteSelectionToRestore.anchor;(c.key===u.key&&c.offset===u.offset+1||c.offset===1&&u.getNode().is(c.getNode().getPreviousSibling()))&&(a=l.postDeleteSelectionToRestore.clone(),Vt(a))}if(l.postDeleteSelectionToRestore=null,X(a)){const c=a.anchor,u=c.getNode();if(a.isCollapsed()){t.type==="Range"&&r===o&&(a.dirty=!0);const f=kr(e).event,h=f?f.timeStamp:performance.now(),{format:d,style:p,offset:g,key:m,timeStamp:O}=l.collapsedSelectionFormat,y=ut(),x=e.isComposing()===!1&&y.getTextContent()==="";if(h<O+200&&c.offset===g&&c.key===m)lp(a,d,p);else if(c.type==="text")Y(u)||q(141),f$(a,u);else if(c.type==="element"&&!x){N(u)||q(259);const b=c.getNode();b.isEmpty()?(function(S,v){const w=v.getTextFormat(),k=v.getTextStyle();lp(S,w,k)})(a,b):lp(a,a.format,"")}}else{const f=c.key,h=a.focus.key,d=a.getNodes(),p=d.length,g=a.isBackward(),m=g?s:i,O=g?i:s,y=g?h:f,x=g?f:h;let b=2047,S=!1;for(let v=0;v<p;v++){const w=d[v],k=w.getTextContentSize();if(Y(w)&&k!==0&&!(v===0&&w.__key===y&&m===k||v===p-1&&w.__key===x&&O===0)&&(S=!0,b&=w.getFormat(),b===0))break}a.format=S?b:0}}be(e,Tb,void 0)})}function lp(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function f$(t,e){lp(t,e.getFormat(),e.getStyle())}function h$(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return e.length===0?null:e[0]}function $k(t){const{lastKeyCode:e}=at()._inputState;if(t==null||t.length<=1||e==null)return;const n=e.length===1?e:e==="Enter"?`
|
|
5
|
-
`:e==="Tab"?" ":null;if(!n)return;const r=ne();if(!X(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!Y(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const s=i.getNextSibling();if(n===`
|
|
6
|
-
`){if(kn(s))s.selectEnd();else if(!s){const l=lt(i,Nl),a=l&&l.getNextSibling();N(a)&&a.selectStart()}}else n===" "?Dl(s)&&s.selectEnd():Y(s)&&s.getTextContent()[0]===n&&s.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}function _f(t){t.isInsertTextAfterHandledSelectionCommand=!1,t.handledSelectionCommandTimeoutId!==null&&(clearTimeout(t.handledSelectionCommandTimeoutId),t.handledSelectionCommandTimeoutId=null)}function Ak(t){_f(t),t.isInsertTextAfterHandledSelectionCommand=!0,t.handledSelectionCommandTimeoutId=setTimeout(()=>_f(t),0)}function d$(t,e){const n=Ub(t);if(Qe(n)&&ag(n,e))return!0;const r=e.getRootElement();if(r===null)return!1;const i=bc(r.ownerDocument);return i!==null&&r.contains(i)&&ag(i,e)}function uD(t){const e=t.inputType,n=h$(t),r=at(),i=r._inputState,o=ne();if(e==="insertText"&&t.data&&i.isInsertTextAfterHandledSelectionCommand){if(_f(i),t.preventDefault(),X(o)&&!o.isCollapsed()){const f=o.isBackward()?o.anchor:o.focus;o.anchor.set(f.key,f.offset,f.type),o.focus.set(f.key,f.offset,f.type)}return!0}if(e==="deleteContentBackward"){if(o===null){const f=aa();if(!X(f))return!0;Vt(f.clone())}if(X(o)){const f=o.anchor.key===o.focus.key;if((function(h,d){return h.lastKeyCode==="MediaLast"&&d<h.lastKeyDownTimeStamp+30})(i,t.timeStamp)&&r.isComposing()&&f){if(yn(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{ni(r,()=>{yn(null)})},30),X(o)){const h=o.anchor.getNode();h.markDirty(),Y(h)||q(142),f$(o,h)}}else{if(yn(null),Ms&&n!==null&&!n.collapsed&&(o.applyDOMRange(n),!o.isCollapsed()))return t.preventDefault(),o.removeText(),!0;t.preventDefault();const h=o.anchor.getNode(),d=h.getTextContent(),p=h.canInsertTextAfter(),g=o.anchor.offset===0&&o.focus.offset===d.length;let m=zp&&f&&!g&&p;if(m&&o.isCollapsed()&&(m=!Fe(WD(o.anchor,!0))),!m){be(r,Cl,!0);const O=ne();zp&&X(O)&&O.isCollapsed()&&(i.postDeleteSelectionToRestore=O,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!X(o))return!0;const s=t.data;i.unprocessedBeforeInputData!==null&&Xb(!1,r,i.unprocessedBeforeInputData),o.dirty&&i.unprocessedBeforeInputData===null||!o.isCollapsed()||Nt(o.anchor.getNode())||n===null||o.applyDOMRange(n),i.unprocessedBeforeInputData=null;const l=o.anchor,a=o.focus,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(s===`
|
|
7
|
-
`)t.preventDefault(),be(r,qa,!1);else if(s===bl)t.preventDefault(),be(r,wf,void 0);else if(s==null&&t.dataTransfer){const f=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(f)}else s!=null&&u$(o,n,s,t.timeStamp,!0)?(t.preventDefault(),be(r,Ya,s),$k(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":be(r,Ya,t),$k((t.dataTransfer?t.dataTransfer.getData("text/plain"):null)??t.data);break;case"insertFromComposition":{const f=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const h=r._compositionKey;yn(null),f||be(r,Ya,t),ap(h);break}case"insertLineBreak":yn(null),be(r,qa,!1);break;case"insertParagraph":yn(null),i.isInsertLineBreak&&!Ms?(i.isInsertLineBreak=!1,be(r,qa,!1)):be(r,wf,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":be(r,mm,t);break;case"deleteByComposition":(function(f,h){return f!==h||N(f)||N(h)||!Pl(f)||!Pl(h)})(c,u)&&be(r,sp,t);break;case"deleteByDrag":Yo(Gp),be(r,sp,t);break;case"deleteByCut":be(r,sp,t);break;case"deleteContent":be(r,Cl,!1);break;case"deleteWordBackward":be(r,kf,!0);break;case"deleteWordForward":be(r,kf,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":be(r,Cf,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":be(r,Cf,!1);break;case"formatStrikeThrough":be(r,Qo,"strikethrough");break;case"formatBold":be(r,Qo,"bold");break;case"formatItalic":be(r,Qo,"italic");break;case"formatUnderline":be(r,Qo,"underline");break;case"historyUndo":be(r,Om,void 0);break;case"historyRedo":be(r,ym,void 0)}return!0}function fD(t){const e=at(),n=e._inputState,r=ne(),i=t.data,o=h$(t);let s=!1;if(i!=null&&X(r)){const l=ur(kr(e)),a=l!==null?ai(l,e._rootElement):null,c=t.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!e.isComposing();c&&(n.hadOrphanedCompositionEvents=!0);const u=r.anchor.getNode(),f=t.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&e.isComposing()&&Y(u)&&Dr(u);if(!c&&!f&&u$(r,o,i,t.timeStamp,!1,a)){if(s=!0,n.compositionPhase==="ending-firefox"){const O=Yp(e,i);if(n.compositionPhase="idle",O)return Yo(Tf),rC(),!0}const h=r.anchor.getNode();if(l===null||a===null)return!0;const d=r.isBackward(),p=d?r.anchor.offset:r.focus.offset,g=d?r.focus.offset:r.anchor.offset;pc&&!r.isCollapsed()&&Y(h)&&a.anchorNode!==null&&h.getTextContent().slice(0,p)+i+h.getTextContent().slice(p+g)===tA(a.anchorNode)||be(e,Ya,i);const m=i.length;Ho&&m>1&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(r.anchor.offset-=m,r._cachedNodes=null,r._cachedIsBackward=null),zp&&e.isComposing()&&(n.lastKeyDownTimeStamp=0,yn(null))}}return s||(Xb(!1,e,i!==null?i:void 0),n.compositionPhase==="ending-firefox"&&(Yp(e,i||void 0),Yo(Tf),n.compositionPhase="idle")),rC(),!0}function hD(t){const e=at(),n=e._inputState,r=ne();if(X(r)&&!e.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(yn(i.key),Yo(S$),t.timeStamp<n.lastKeyDownTimeStamp+30||i.type==="element"||!r.isCollapsed()||!zp&&(o.getFormat()!==r.format||Y(o)&&o.getStyle()!==r.style)||Y(o)&&(Dr(o)||i.offset===0&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){be(e,Ya,Cb);const s=ne();X(s)&&yn(s.anchor.key)}}return!0}function dD(t){const e=at();return e._inputState.compositionPhase="idle",Yp(e,t.data),Yo(Tf),!0}function ap(t){if(t===null)return;const e=Ge(t);if(!Y(e)||e.getType()==="text"||Dr(e)||!e.isAttached())return;const n=ne(),r=X(n)&&n.anchor.key===t?n.anchor.offset:null,i=bt(e.getTextContent());if(i.setFormat(e.getFormat()),i.setStyle(e.getStyle()),e.replace(i),r!==null){const o=Math.min(r,i.getTextContentSize());i.select(o,o)}}function Yp(t,e){const n=t._compositionKey;if(yn(null),n!==null&&e!=null){if(e===""){const i=Ge(n),o=t.getElementByKey(n),s=o!==null&&Y(i)?As(i,o,t):null;if(s!==null&&s.nodeValue!==null&&Y(i)){const l=ur(kr(t)),a=l&&ai(l,t._rootElement);let c=null,u=null;a!==null&&a.anchorNode===s&&(c=a.anchorOffset,u=a.focusOffset),Wb(i,s.nodeValue,c,u,!0)}return ap(n),!1}if(e[e.length-1]===`
|
|
8
|
-
`){const i=ne();if(X(i)||it(i)){if(X(i)){const o=i.focus;i.anchor.set(o.key,o.offset,o.type)}return be(t,gc,null),ap(n),!1}}const r=Ge(n);if(r!==null&&Y(r)&&Dr(r)){r.markDirty();const i=ne(),o=r.getTextContentSize(),s=X(i)&&i.anchor.key===n?i.anchor.offset:o;return r.select(s,s).insertText(e),!0}}return Xb(!0,t,e),ap(n),!1}function pD(t){const e=at(),n=e._inputState;if(t.key==null)return!0;if(n.compositionPhase==="ending-safari"){const r=oC(t);if(r&&ni(e,()=>{Yp(e,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if((function(r){return pt(r,"ArrowRight",{shiftKey:"any"})})(t))be(e,t$,t);else if((function(r){return pt(r,"ArrowRight",{...So,shiftKey:"any"})})(t))be(e,n$,t);else if((function(r){return pt(r,"ArrowLeft",{shiftKey:"any"})})(t))be(e,Eb,t);else if((function(r){return pt(r,"ArrowLeft",{...So,shiftKey:"any"})})(t))be(e,r$,t);else if((function(r){return pt(r,"ArrowUp",{altKey:"any",shiftKey:"any"})})(t))be(e,$b,t);else if((function(r){return pt(r,"ArrowDown",{altKey:"any",shiftKey:"any"})})(t))be(e,Ab,t);else if((function(r){return pt(r,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(t))n.isInsertLineBreak=!0,be(e,gc,t);else if((function(r){return r.key===" "})(t))be(e,Qb,t);else if((function(r){return ki&&pt(r,"o",{ctrlKey:!0})})(t))t.preventDefault(),n.isInsertLineBreak=!0,be(e,qa,!0);else if((function(r){return pt(r,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(t))n.isInsertLineBreak=!1,be(e,gc,t);else if((function(r){return pt(r,"Backspace",{shiftKey:"any"})||ki&&pt(r,"h",{ctrlKey:!0})})(t))oC(t)?be(e,Mb,t)&&Ak(n):(t.preventDefault(),be(e,Cl,!0));else if((function(r){return r.key==="Escape"})(t))be(e,bm,t);else if((function(r){return pt(r,"Delete",{})||ki&&pt(r,"d",{ctrlKey:!0})})(t))(function(r){return r.key==="Delete"})(t)?be(e,i$,t):(t.preventDefault(),be(e,Cl,!1));else if((function(r){return pt(r,"Backspace",iC)})(t))t.preventDefault(),be(e,kf,!0);else if((function(r){return pt(r,"Delete",iC)})(t))t.preventDefault(),be(e,kf,!1);else if((function(r){return ki&&pt(r,"Backspace",{metaKey:!0})})(t))t.preventDefault(),be(e,Cf,!0);else if((function(r){return ki&&(pt(r,"Delete",{metaKey:!0})||pt(r,"k",{ctrlKey:!0}))})(t))t.preventDefault(),be(e,Cf,!1);else if((function(r){return pt(r,"b",So)})(t))t.preventDefault(),be(e,Qo,"bold");else if((function(r){return pt(r,"u",So)})(t))t.preventDefault(),be(e,Qo,"underline");else if((function(r){return pt(r,"i",So)})(t))t.preventDefault(),be(e,Qo,"italic");else if((function(r){return pt(r,"Tab",{shiftKey:"any"})})(t))be(e,vm,t);else if((function(r){return pt(r,"z",So)})(t))t.preventDefault(),be(e,Om,void 0);else if((function(r){return ki?pt(r,"z",{metaKey:!0,shiftKey:!0}):pt(r,"y",{ctrlKey:!0})||pt(r,"z",{ctrlKey:!0,shiftKey:!0})})(t))t.preventDefault(),be(e,ym,void 0);else{const r=e._editorState._selection;(function(i){return pt(i,"a",So)})(t)?(t.preventDefault(),be(e,c$,t)&&Ak(n)):r===null||X(r)||((function(i){return pt(i,"c",So)})(t)?(t.preventDefault(),be(e,Sm,t)):(function(i){return pt(i,"x",So)})(t)&&(t.preventDefault(),be(e,Rb,t)))}return(function(r){return r.ctrlKey||r.shiftKey||r.altKey||r.metaKey})(t)&&e.dispatchCommand(lD,t),!0}function p$(t){let e=t.__lexicalEventHandles;return e===void 0&&(e=[],t.__lexicalEventHandles=e),e}const Ua=new Map;function Qk(t){const e=UD(t.target);if(e===null)return;const n=qb(t.target);let r=null,i=null;const o=n!==null?qp.get(n):void 0;if(n!==null){if(o!==void 0){const f=o.editors;let h=o.hasShadowEditor;if(h===void 0){h=!1;for(const d of f)if(d._rootElement!==null&&Uo(d._rootElement.getRootNode())){h=!0;break}o.hasShadowEditor=h}if(h){let d=null,p=null;for(const g of f){const m=g._rootElement;if(m===null)continue;const O=ai(e,m).anchorNode;if(O!==null&&Tl(O)===g){if(Uo(m.getRootNode())){r=g,i=O;break}d===null&&(d=g,p=O)}}r===null&&d!==null&&(r=d,i=p)}else{const d=e.anchorNode;d===null||Qe(d)&&d.shadowRoot!==null||(r=Tl(d),r!==null&&(i=d))}}if(r===null){const f=bc(n);r=f!==null?Tl(f):null}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(o!==void 0)for(const f of o.editors)f._inputState.isSelectionChangeFromMouseDown=!1;ni(r,()=>{const f=aa(),h=i??ai(e,r._rootElement).anchorNode;(Qe(h)||wr(h))&&Vt(Nb(f,e,r,t))})}const s=jb(r),l=s[s.length-1],a=l._key,c=Ua.get(a),u=c||l;u!==r&&Ek(e,u,!1),Ek(e,r,!0),r!==l?Ua.set(a,r):c&&Ua.delete(a)}function Mk(t){t._lexicalHandled=!0}function Rk(t){return t._lexicalHandled===!0}function gD(t){const e=W0.get(t);if(e===void 0)return;const n=qp.get(e);if(n===void 0)return;W0.delete(t);const r=zc(t);Ch(r)?((function(o){if(o._parentEditor!==null){const s=jb(o),l=s[s.length-1]._key;Ua.get(l)===o&&Ua.delete(l)}else Ua.delete(o._key)})(r),n.editors.delete(r),n.hasShadowEditor=void 0,t.__lexicalEditor=null):r&&q(198);const i=p$(t);for(let o=0;o<i.length;o++)i[o]();t.__lexicalEventHandles=[]}function H0(t,e,n){On();const r=t.__key,i=t.getParent();if(i===null)return void(Ln(t)!==null&&q(367,r,String(Ln(t))));const o=(function(l){const a=ne();if(!X(a)||!N(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),h=u.getNode();return xc(f,l)&&c.set(l.__key,0,"element"),xc(h,l)&&u.set(l.__key,0,"element"),a})(t);let s=!1;if(X(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Jp(l,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0),a.key===r&&(Jp(a,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else it(o)&&e&&t.isSelected()&&t.selectPrevious();if(X(o)&&e&&!s){const l=t.getIndexWithinParent();Mo(t),gl(o,i,l,-1)}else Mo(t);n||gt(i)||i.canBeEmpty()||!i.isEmpty()||H0(i,e),e&&o&&Nt(i)&&i.isEmpty()&&i.selectEnd()}const g$=Symbol.for("ephemeral");function Up(t){return t[g$]||!1}const Lk={configurable:!0,enumerable:!1,value:void 0,writable:!0};class Br{__type;__key;__parent;__prev;__next;__state;[xf];static getType(){const{ownNodeType:e}=Gb(this);return e===void 0&&q(64,this.name),e}static clone(e){q(65,this.name)}$config(){return{}}config(e,n){const r=n.extends||fA(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Lk),Object.defineProperty(this,xf,Lk),Y$(this,e)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const n=Ge(e);if(n===null)break;e=n.__parent!==null?n.__parent:Ln(n)}return!1}isSelected(e){const n=e||ne();if(n==null)return!1;const r=n.getNodes().some(i=>i.__key===this.__key);if(Y(this))return r;if(X(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const i=this.getParent();if(Fe(this)&&this.isInline()&&i){const o=n.isBackward()?n.focus:n.anchor;if(i.is(o.getNode())&&o.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Ge(e)}getParentOrThrow(){const e=this.getParent();return e===null&&q(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const n=e.getParent();if(gt(n)||Ln(e)!==null)return N(e)||e===this&&Fe(e)||q(194),e;e=n}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&q(67,this.__key),e}getParents(){const e=[];let n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){const e=[];let n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Ge(e)}getPreviousSiblings(){const e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Ge(e)}getNextSiblings(){const e=[];let n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){const n=N(this)?this:this.getParent(),r=N(e)?e:e.getParent(),i=n&&r?ny(n,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const n=ny(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?OA(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(e){return xc(e,this)}getNodesBetween(e){const n=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=N(o)?n?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=n?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&q(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return n||r.reverse(),r}isDirty(){const e=at()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Up(this))return this;const e=Ge(this.__key);return e===null&&q(113),e}getWritable(){if(Up(this))return this;On();const e=as(),n=at(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=n._cloneNotNeeded,l=ne();if(l!==null&&l.setCachedNodes(null),s.has(i))return og(o),o;const a=aA(o);return s.add(i),og(a),r.set(i,a),a}getTextContent(){return dA(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){q(70)}updateDOM(e,n,r){q(71)}getDOMSlot(e){return new AE(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){q(18,this.name)}updateFromJSON(e){return(function(n,r){const i=n.getWritable(),o=r.$;let s=o;for(const l of ZE(i).flatKeys)l in r&&(s!==void 0&&s!==o||(s={...o}),s[l]=r[l]);return(i.__state||s)&&FE(n).updateFromJSON(s),i})(this,e)}static transform(){return null}remove(e){H0(this,!0,e)}replace(e,n){On();let r=ne();r!==null&&(r=r.clone()),WO(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size,u=l.getParent(),f=u!==null?l.getIndexWithinParent():-1;Mo(l),u!==null&&X(r)&&gl(r,u,f,-1);const h=i.getPreviousSibling(),d=i.getNextSibling(),p=i.__prev,g=i.__next,m=i.__parent;H0(i,!1,!0),h===null?a.__first=s:h.getWritable().__next=s,l.__prev=p,d===null?a.__last=s:d.getWritable().__prev=s,l.__next=g,l.__parent=m,a.__size=c;let O=0;n&&(N(this)&&N(l)||q(139),O=l.getChildrenSize(),l.splice(O,0,this.getChildren()));const y=ri(this);if(y.length>0){Do(this)&&Do(l)||q(368,this.__key,l.__key);for(const x of y){const b=Zl(this,x);b!==null&&(pN(this,x),pA(l,x,b))}}if(X(r)){Vt(r);const x=r.anchor,b=r.focus;x.key===o&&(n&&x.type==="element"?x.set(l.__key,O+x.offset,"element"):Vk(x,l)),b.key===o&&(n&&b.type==="element"?b.set(l.__key,O+b.offset,"element"):Vk(b,l))}return Ro()===o&&yn(s),l}insertAfter(e,n=!0){On(),WO(this,e);const r=this.getWritable(),i=e.getWritable();this.getParentOrThrow();const o=i.getParent(),s=ne();let l=!1,a=!1;if(o!==null){const d=e.getIndexWithinParent();if(X(s)){const p=o.__key,g=s.anchor,m=s.focus;l=g.type==="element"&&g.key===p&&g.offset===d+1,a=m.type==="element"&&m.key===p&&m.offset===d+1}Mo(i),n&&X(s)&&gl(s,o,d,-1)}else Mo(i);const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,h=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=h,i.__prev=r.__key,i.__parent=r.__parent,n&&X(s)){const d=this.getIndexWithinParent();gl(s,u,d+1);const p=u.__key;l&&s.anchor.set(p,d+2,"element"),a&&s.focus.set(p,d+2,"element")}return e}insertBefore(e,n=!0){On(),WO(this,e);const r=this.getWritable(),i=e.getWritable();this.getParentOrThrow();const o=i.__key,s=ne(),l=i.getParent(),a=l!==null?i.getIndexWithinParent():-1;Mo(i),l!==null&&n&&X(s)&&gl(s,l,a,-1);const c=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),f=r.__prev,h=this.getIndexWithinParent();return c===null?u.__first=o:c.getWritable().__next=o,u.__size++,r.__prev=o,i.__prev=f,i.__next=r.__key,i.__parent=r.__parent,n&&X(s)&&gl(s,this.getParentOrThrow(),h),e}isParentRequired(){return!1}createParentElementNode(){return He()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){On();const r=$i(this);if(r!==null)return r.selectPrevious(e,n);const i=this.getPreviousSibling(),o=this.getParentOrThrow();if(i===null)return o.select(0,0);if(N(i))return i.select();if(!Y(i)){const s=i.getIndexWithinParent()+1;return o.select(s,s)}return i.select(e,n)}selectNext(e,n){On();const r=$i(this);if(r!==null)return r.selectNext(e,n);const i=this.getNextSibling(),o=this.getParentOrThrow();if(i===null)return o.select();if(N(i))return i.select(0,0);if(!Y(i)){const s=i.getIndexWithinParent();return o.select(s,s)}return i.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function m$(t){return t instanceof Br}const _l="historic",O$="history-push",Yu="history-merge",y$="paste",x$="cut",b$="collaboration",mD="skip-scroll-into-view",v$="skip-dom-selection",Gp="skip-selection-focus",S$="composition-start",Tf="composition-end",OD="!important";function Kp(t){const e={};if(!t)return e;let n="",r="",i=null,o=!1,s=!1,l=!1,a=0;const c=t.length;let u=-1;for(let d=0;d<c;d++){const p=t[d];if(o)p==="*"&&t[d+1]==="/"&&(o=!1,d++);else if(s)u===-1&&(u=d),s=!1;else if(i===null)if(p!=="/"||t[d+1]!=="*")if(p!=='"'&&p!=="'")if(p!=="(")if(p!==")")if(l||p!==":"||a!==0){if(p===";"&&a===0){u!==-1&&(l?r+=t.slice(u,d):n+=t.slice(u,d),u=-1);const g=n.trim(),m=r.trim();g!==""&&m!==""&&(e[g]=m),n="",r="",l=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=t.slice(u,d),u=-1),l=!0;else u===-1&&(u=d),a=Math.max(0,a-1);else u===-1&&(u=d),a++;else u===-1&&(u=d),i=p;else u!==-1&&(l?r+=t.slice(u,d):n+=t.slice(u,d),u=-1),o=!0,d++;else u===-1&&(u=d),p==="\\"?s=!0:p===i&&(i=null)}u!==-1&&(l?r+=t.slice(u,c):n+=t.slice(u,c));const f=n.trim(),h=r.trim();return f!==""&&h!==""&&(e[f]=h),e}function yD(t,e,n){const r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===OD?t.setProperty(e,r.slice(0,i).trim(),"important"):t.setProperty(e,n,"")}function Ga(t,e,n=""){if(e===n)return;const r=Kp(n),i=Kp(e);for(const o in i)delete r[o],yD(t,o,i[o]);for(const o in r)t.removeProperty(o)}function NO(t,e){return 16&e?"code":e&kb?"mark":32&e?"sub":64&e?"sup":null}function VO(t,e){return 1&e?"strong":2&e?"em":"span"}function w$(t,e,n,r,i){const o=r.classList;let s=Ka(i,"base");s!==void 0&&o.add(...s),s=Ka(i,"underlineStrikethrough");let l=!1;const a=8&e&&4&e;s!==void 0&&(8&n&&4&n?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in qo){const u=qo[c];if(s=Ka(i,c),s!==void 0)if(n&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}((e&u)===0||a&&c==="underline"||c==="strikethrough")&&o.add(...s)}else e&u&&o.remove(...s)}}function k$(t,e,n){const r=n.isComposing(),i=t+(r?yf:""),o=Mt(),s=Em(o).$getDOMSlot(n,e,o),l=s.getFirstChild();if(l===null||l.nodeType!==Node.TEXT_NODE)return void s.insertChild(Tt().createTextNode(i));const a=l,c=a.nodeValue;if(c!==i)if(r||Ho){const[u,f,h]=(function(d,p){const g=d.length,m=p.length;let O=0,y=0;for(;O<g&&O<m&&d[O]===p[O];)O++;for(;y+O<g&&y+O<m&&d[g-y-1]===p[m-y-1];)y++;return[O,g-O-y,p.slice(O,m-y)]})(c,i);f!==0&&a.deleteData(u,f),a.insertData(u,h)}else a.nodeValue=i}function Ik(t,e,n,r,i,o){k$(i,t,e);const s=o.theme.text;s!==void 0&&w$(0,0,r,t,s)}function Jh(t,e){const n=Tt().createElement(e);return n.appendChild(t),n}function q0(t){return t!=null&&t.__isInlineFormattable===!0}class hi extends Br{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(e){return new hi(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",n){super(n),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return F6[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ro()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const n=qo[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Bl(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){const r=this.__format,i=NO(0,r),o=VO(0,r),s=i===null?o:i,l=Tt().createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=Tt().createElement(o),l.appendChild(a)),Ik(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&Ga(l.style,c),l}updateDOM(e,n,r){const i=this.__text,o=e.__format,s=this.__format,l=NO(0,o),a=NO(0,s),c=VO(0,o),u=VO(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const g=n.firstChild;g==null&&q(48);const m=Tt().createElement(u);return Ik(m,this,0,s,i,r),n.replaceChild(m,g),!1}let f=n;a!==null&&l!==null&&(f=n.firstChild,f==null&&q(49)),k$(i,f,this);const h=r.theme.text;h!==void 0&&o!==s&&w$(0,o,s,f,h);const d=e.__style,p=this.__style;return d!==p&&Ga(n.style,p,d),!1}static importDOM(){return{"#text":()=>({conversion:SD,priority:0}),b:()=>({conversion:bD,priority:0}),code:()=>({conversion:vo,priority:0}),em:()=>({conversion:vo,priority:0}),i:()=>({conversion:vo,priority:0}),mark:()=>({conversion:vo,priority:0}),s:()=>({conversion:vo,priority:0}),span:()=>({conversion:xD,priority:0}),strong:()=>({conversion:vo,priority:0}),sub:()=>({conversion:vo,priority:0}),sup:()=>({conversion:vo,priority:0}),u:()=>({conversion:vo,priority:0})}}static importJSON(e){return bt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return Qe(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=Jh(n,"b")),this.hasFormat("italic")&&(n=Jh(n,"i")),this.hasFormat("strikethrough")&&(n=Jh(n,"s")),this.hasFormat("underline")&&(n=Jh(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){const n=this.getWritable();return n.__format=typeof e=="string"?qo[e]:e,n}setDetail(e){const n=this.getWritable();return n.__detail=typeof e=="string"?N6[e]:e,n}setStyle(e){const n=this.getWritable();return n.__style=e,n}toggleFormat(e){const n=Bl(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const n=B6[e];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;const n=this.getWritable();return n.__text=e,n}select(e,n){On();let r=e,i=n;const o=ne(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!X(o))return L$(l,r,l,i,"text","text");{const a=Ro();a!==o.anchor.key&&a!==o.focus.key||yn(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=ne();if(i&&X(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+n);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){On();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const i=n.__key,o=Ro(),s=r.length;e.sort((k,P)=>k-P),e.push(s);const l=[],a=e.length;for(let k=0,P=0;k<s&&P<=a;P++){const T=e[P];T>k&&(l.push(r.slice(k,T)),k=T)}const c=l.length;if(c===1)return[n];const u=l[0],f=n.getParent();let h;const d=n.getFormat(),p=n.getStyle(),g=n.__detail;let m=!1,O=null,y=null;const x=ne();if(X(x)){const[k,P]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];k.type==="text"&&k.key===i&&(O=k),P.type==="text"&&P.key===i&&(y=P)}n.isSegmented()?(h=bt(u),h.__format=d,h.__style=p,h.__detail=g,h.__state=yk(n,h),m=!0):h=n.setTextContent(u);const b=[h];for(let k=1;k<c;k++){const P=bt(l[k]);P.__format=d,P.__style=p,P.__detail=g,P.__state=yk(n,P);const T=P.__key;o===i&&yn(T),b.push(P)}const S=O?O.offset:null,v=y?y.offset:null;let w=0;for(const k of b){if(!O&&!y)break;const P=w+k.getTextContentSize();if(O!==null&&S!==null&&S<=P&&S>=w&&(O.set(k.getKey(),S-w,"text"),S<P&&(O=null)),y!==null&&v!==null&&v<=P&&v>=w){y.set(k.getKey(),v-w,"text");break}w=P}if(f!==null){(function(T){const M=T.getPreviousSibling(),I=T.getNextSibling();M!==null&&og(M),I!==null&&og(I)})(this);const k=f.getWritable(),P=this.getIndexWithinParent();m?(k.splice(P,0,b),this.remove()):k.splice(P,1,b),X(x)&&gl(x,f,P,c-1)}return b}mergeWithSibling(e){const n=e===this.getPreviousSibling();n||e===this.getNextSibling()||q(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Ro()===i&&yn(r);const l=ne();if(X(l)){const f=l.anchor,h=l.focus;f!==null&&f.key===i&&Wk(f,n,r,e,s),h!==null&&h.key===i&&Wk(h,n,r,e,s)}const a=e.__text,c=n?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function xD(t){return{forChild:Db(t.style),node:null}}function bD(t){const e=t,n=e.style.fontWeight==="normal";return{forChild:Db(e.style,n?void 0:"bold"),node:null}}const Dk=new WeakMap;function vD(t){if(!Qe(t))return!1;if(t.nodeName==="PRE")return!0;const e=t.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function SD(t){const e=t;t.parentElement===null&&q(129);let n=e.textContent||"";if((function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Dk.get(o))===void 0&&!vD(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Dk.set(s[a],l);return l})(e)!==null)return{node:Pf(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Nk(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Nk(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:bt(n)}}function Nk(t,e){let n=t;for(;;){let r;for(;(r=e?n.nextSibling:n.previousSibling)===null;){const o=n.parentElement;if(o===null)return null;n=o}if(n=r,Qe(n)){const o=n.style.display;if(o===""&&!lg(n)||o!==""&&!o.startsWith("inline"))return null}let i=n;for(;(i=e?n.firstChild:n.lastChild)!==null;)n=i;if(wr(n))return n;if(n.nodeName==="BR")return null}}const wD={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function vo(t){const e=wD[t.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Db(t.style,e),node:null}}function bt(t=""){return zr(new hi(t))}function Y(t){return t instanceof hi}function Db(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),i=n==="700"||n==="bold",o=r.includes("line-through"),s=t.fontStyle==="italic",l=r.includes("underline"),a=t.verticalAlign;return c=>((Y(c)||q0(c))&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class sa extends hi{static getType(){return"tab"}static clone(e){return new sa(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const n=super.createDOM(e),r=Ka(e.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(e){return Sh().updateFromJSON(e)}setTextContent(e){return super.setTextContent(" ")}spliceText(e,n,r,i){return r===""&&n===0||r===" "&&n===1||q(286),this}setDetail(e){return e!==2&&q(127),this}setMode(e){return e!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Sh(){return zr(new sa)}function Dl(t){return t instanceof sa}class kD{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Af(Wn(Hn(this,"next")),Wn(Hn(e,"next")))<0}getNode(){const e=Ge(this.key);return e===null&&q(20),e}set(e,n,r,i){const o=this._selection,s=this.key;i&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,mc()||(Ro()===s&&yn(e),o!==null&&(o.setCachedNodes(null),X(o)&&(o._cachedIsBackward=null),o.dirty=!0)))}}function ao(t,e,n){return new kD(t,e,n)}function BO(t,e){let n=e.__key,r=t.offset,i="element";if(Y(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!N(e)){const o=e.getNextSibling();if(Y(o))n=o.__key,r=0,i="text";else{const s=e.getParent();s&&(n=s.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,i)}function Vk(t,e){if(N(e)){const n=e.getLastDescendant();N(n)||Y(n)?BO(t,n):BO(t,e)}else BO(t,e)}class km{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!it(e))return!1;const n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new km(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const n=this.getNodes().filter(s=>Ln(s)===null),r=n.length;if(r===0)return;const i=n[r-1];let o;if(Y(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const n=this._nodes,r=[];for(const i of n){const o=Ge(i);o!==null&&r.push(o)}return mc()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){const e=this.getNodes().filter(n=>Ln(n)===null);if((ne()||aa())===this&&e[0]){const n=ot(e[0],"next");Sc(Mi(n,n))}for(const n of e)n.remove();C$()}}function C$(){const t=ut();if(t.isEmpty()){const e=He();t.append(e),e.select()}}function X(t){return t instanceof la}class la{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,i){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!X(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const n=(function(r){const i=[],[o,s]=r.getTextSlices();o&&i.push(o.caret.origin);const l=new Set,a=new Set;for(const c of r)if(Fr(c)){const{origin:u}=c;i.length===0?l.add(u):(a.add(u),i.push(u))}else{const{origin:u}=c;N(u)&&a.has(u)||i.push(u)}if(s&&i.push(s.caret.origin),Go(r.focus)&&N(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=lr(r.focus.origin,"previous");Fr(c)&&l.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(i[i.length-1]);c=Qm(c))l.delete(c.origin),i.pop();for(;i.length>1;){const c=i[i.length-1];if(!N(c)||a.has(c)||c.isEmpty()||l.has(c))break;i.pop()}if(i.length===0&&r.isCollapsed()){const c=Wn(r.anchor),u=Wn(r.anchor.getFlipped()),f=d=>ii(d)?d.origin:d.getNodeAtCaret(),h=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);i.push(h)}return i})(rv(ry(this),"next"));return mc()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,i){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,i,"text"),this}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const n=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=Y0(this);let c="",u=!0;for(let f=0;f<e.length;f++){const h=e[f];if(N(h)&&!h.isInline()){u||(c+=`
|
|
9
|
-
`);let d="";for(const p of ri(h)){const g=Zl(h,p);g!==null&&(d+=g.getTextContent())}d!==""?(c+=d,u=!1):u=!h.isEmpty()}else if(u=!1,Y(h)){let d=h.getTextContent();h===n?h===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(d=l<a?d.slice(l,a):d.slice(a,l)):d=s?d.slice(l):d.slice(a):h===r&&(d=s?d.slice(0,a):d.slice(0,l)),c+=d}else!Fe(h)&&!kn(h)||h===r&&this.isCollapsed()||(c+=h.getTextContent())}return c}applyDOMRange(e){const n=at(),r=n.getEditorState()._selection,i=R$(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(i===null)return;const[o,s,l]=i;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(s.key,s.offset,s.type,!0),l&&(this.dirty=!0),Ki(this)}clone(){const e=this.anchor,n=this.focus;return new la(ao(e.key,e.offset,e.type),ao(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Bl(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const n=qo[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(Pf(e))}insertText(e){const n=this.anchor,r=this.focus,i=this.format,o=this.style;let s=n,l=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,l=n),s.type==="element"&&(function(m,O,y,x){const b=m.getNode(),S=b.getChildAtIndex(m.offset),v=bt();if(v.setFormat(y),v.setStyle(x),Zc(S))S.splice(0,0,[v]);else if(S!==null){const w=gt(b)?He().append(v):v;S.insertBefore(w)}else if(gt(b)){const w=b.getLastChild();N(w)&&!w.isInline()&&w.isEmpty()?w.append(v):b.append(He().append(v))}else b.append(v);m.is(O)&&O.set(v.__key,0,"text"),m.set(v.__key,0,"text")})(s,l,i,o),l.type==="element"&&Ls(l,Wn(Hn(l,"next")));const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let h=u[0];Y(h)||q(26);const d=h.getTextContent().length,p=h.getParentOrThrow();let g=u[f-1];if(f===1&&l.type==="element"&&(c=d,l.set(s.key,c,"text")),this.isCollapsed()&&a===d&&(Dr(h)||!h.canInsertTextAfter()||!p.canInsertTextAfter()&&h.getNextSibling()===null)){const m=h.getNextSibling();let O;if(Y(m)&&m.canInsertTextBefore()&&!Dr(m)?O=m:(O=bt(),O.setFormat(i),O.setStyle(o),p.canInsertTextAfter()?h.insertAfter(O):p.insertAfter(O)),O.select(0,0),h=O,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(Dr(h)||!h.canInsertTextBefore()||!p.canInsertTextBefore()&&h.getPreviousSibling()===null)){const m=h.getPreviousSibling();let O;if(!Y(m)||Dr(m)?(O=bt(),O.setFormat(i),p.canInsertTextBefore()?h.insertBefore(O):p.insertBefore(O)):O=m,O.select(),h=O,e!=="")return void this.insertText(e)}else if(h.isSegmented()&&a!==d)if(Ro()!==null)h=h.setMode("normal").setFormat(i).setStyle(o);else{const m=bt(h.getTextContent());m.setFormat(i),h.replace(m),h=m}else if(!this.isCollapsed()&&e!==""){const m=g.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||N(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),A$(this.anchor,this.focus),void this.insertText(e)}if(f===1){if(Pl(h)){const x=bt(e);return x.select(),void h.replace(x)}const m=h.getFormat(),O=h.getStyle();if(a!==c||m===i&&O===o){if(Dl(h)){const x=bt(e);return x.setFormat(i),x.setStyle(o),x.select(),void h.replace(x)}}else{if(h.getTextContent()!==""){const x=bt(e);if(x.setFormat(i),x.setStyle(o),x.select(),a===0)h.insertBefore(x,!1);else{const[b]=h.splitText(a);b.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}h.setFormat(i),h.setStyle(o)}const y=c-a;h=h.spliceText(a,y,e,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=m,this.style=O,h.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{const m=new Set([...h.getParentKeys(),...g.getParentKeys()]),O=N(h)?h:h.getParentOrThrow();let y=N(g)?g:g.getParentOrThrow(),x=g;if(!O.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||g.getTextContent()==="")||l.type==="element"&&g.getIndexWithinParent()<c)if(Y(g)&&!Pl(g)&&c!==g.getTextContentSize()){if(g.isSegmented()){const k=bt(g.getTextContent());g.replace(k),g=k}Nt(l.getNode())||l.type!=="text"||(Y(g)||q(395),g=g.spliceText(0,c,"")),m.add(g.__key)}else{const k=g.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?g.remove():k.remove()}else m.add(g.__key);const b=y.getChildren(),S=new Set(u),v=O.is(y),w=O.isInline()&&h.getNextSibling()===null?O:h;for(let k=b.length-1;k>=0;k--){const P=b[k];if(P.is(h)||N(P)&&P.isParentOf(h))break;P.isAttached()&&(!S.has(P)||P.is(x)?v||w.insertAfter(P,!1):P.remove())}if(!v){let k=y,P=null;for(;k!==null;){const T=k.getChildren(),M=T.length;(M===0||T[M-1].is(P))&&(m.delete(k.__key),P=k),k=k.getParent()}}if(Pl(h))if(a===d)h.select();else{const k=bt(e);k.select(),h.replace(k)}else h=h.spliceText(a,d-a,e,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=h.getFormat(),this.style=h.getStyle(),h.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let k=1;k<f;k++){const P=u[k],T=P.__key;m.has(T)||P.remove()}}}removeText(){const e=ne()===this;hp(this,SN(ry(this))),e&&ne()!==this&&Vt(this)}formatText(e,n=null){T$(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();const n=this.anchor.getNode();if(this.anchor.type==="element"&&N(n)&&Ln(n)!==null){let g=n.isShadowRoot()?n.getFirstChild()??n.append(He()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&g!==null&&!N(g)){const m=He();g.insertBefore(m),g=m}if(g!==null){g.selectStart();const m=ne();return X(m)||q(369),m.insertNodes(e)}}if(this.anchor.type==="element"&>(n)){const g=ZO(e),m=g.getLastDescendant();return n.splice(this.anchor.offset,0,g.getChildren()),void(m!==null&&m.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),i=lt(r,An);const o=e[e.length-1];if(N(i)&&"__language"in i){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=yu(this);i.splice(g,0,e),o.selectEnd()}return}if(!e.some(g=>(N(g)||Fe(g))&&!g.isInline())){N(i)||q(211,r.constructor.name,r.getType());const g=yu(this);return i.splice(g,0,e),void o.selectEnd()}if(N(i)&&Ln(i)!==null){const g=yu(this),m=G0(e);i.splice(g,0,m);const O=m[m.length-1];return void(O!==void 0?O.selectEnd():i.select(g,g))}if(i===null){const g=ZO(e),m=g.getLastDescendant();let O=Hn(this.anchor,"next");for(const y of g.getChildren())O=Rm(y,O);return void(m!==null&&m.selectEnd())}if(N(i)&&!i.isParentRequired()&&!gt(i.getParentOrThrow())){const g=yu(this),m=G0(e);i.splice(g,0,m);const O=m[m.length-1];return void(O!==void 0?O.selectEnd():i.select(g,g))}const s=ZO(e),l=s.getLastDescendant(),a=s.getChildren(),c=!N(i)||!i.isEmpty()?this.insertParagraph():null;c&&!i.isAttached()&&(r=this.anchor.getNode(),i=lt(r,An));const u=a[a.length-1];let f=a[0];var h;N(h=f)&&An(h)&&!h.isEmpty()&&N(i)&&(!i.isEmpty()||i.canMergeWhenEmpty())&&(N(i)||q(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=a[1]),f&&(i===null&&q(212,r.constructor.name,r.getType()),(function(g,m){const O=m.getParentOrThrow().getLastChild();let y=m;const x=[m];for(;y!==O;)y.getNextSibling()||q(140),y=y.getNextSibling(),x.push(y);let b=g;for(const S of x)b=b.insertAfter(S)})(i,f));const d=lt(l,An);c&&N(d)&&(c.canMergeWhenEmpty()||An(u))&&(d.append(...c.getChildren()),c.remove()),N(i)&&i.isEmpty()&&i.remove(),l.selectEnd();const p=N(i)?i.getLastChild():null;kn(p)&&d!==i&&p.remove()}insertParagraph(){const e=this.anchor.getNode();if(this.anchor.type==="element"&>(e)){const l=He();return e.splice(this.anchor.offset,0,[l]),l.select(),l}const n=yu(this),r=lt(this.anchor.getNode(),An);if(r!==null&&Ln(r)!==null)return null;N(r)||q(213);const i=r.getChildAtIndex(n),o=i?[i,...i.getNextSiblings()]:[],s=r.insertNewAfter(this,!1);return s?(s.append(...o),s.selectStart(),s):null}insertLineBreak(e){const n=Sr();if(this.insertNodes([n]),e){const r=n.getParentOrThrow(),i=n.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],n=e.length;let r=e[0],i=e[n-1];const[o,s]=Y0(this),l=this.isBackward(),[a,c]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=l?[s,o]:[o,s];if(n===0)return[];if(n===1){if(Y(r)&&!this.isCollapsed()){const h=r.splitText(u,f),d=u===0?h[0]:h[1];return d?(a.set(d.getKey(),0,"text"),c.set(d.getKey(),d.getTextContentSize(),"text"),[d]):[]}return[r]}if(Y(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,a.set(r.getKey(),0,"text"))),Y(i)){const h=i.getTextContent().length;f===0?e.pop():f!==h&&([i]=i.splitText(f),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,n,r){if(tg(this,e,n,r))return;const i=e==="move",o=at(),s=ur(kr(o));if(!s)return;const l=o._blockCursorElement,a=o._rootElement,c=this.focus.getNode();a===null||l===null||!N(c)||c.isInline()||c.canBeEmpty()||sg(l,o,a);const u=yc(o,this.focus.key);let f=u;if(this.focus.type==="text"&&(f=Y(c)?As(c,u,o):null),this.dirty){const h=yc(o,this.anchor.key);let d=h;if(this.anchor.type==="text"){const p=this.anchor.getNode();d=Y(p)?As(p,h,o):null}d&&f&&eg(s,d,this.anchor.offset,f,this.focus.offset)}if(r==="character"&&Y(c)&&c.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){const h=ot(c,n?"previous":"next").getNodeAtCaret();if(Y(h)){if(!i){const d=h.getTextContentSize();return n?this.focus.set(h.__key,d-1,"text"):this.focus.set(h.__key,1,"text"),void(this.dirty=!0)}{const d=o.getElementByKey(h.getKey()),p=d?As(h,d,o):null;if(p){const g=n?p.length:0;eg(s,p,g,p,g)}}}}if(E$(s,e,n?"backward":"forward",r),s.rangeCount>0){const h=Pm(s,o._rootElement),d=h||s.getRangeAt(0),p=this.anchor.getNode(),g=Nt(p)?p:rA(p);this.applyDOMRange(d),this.dirty=!0,!i&&($$(this,n,g),(h?s.direction!=="backward":s.anchorNode===d.startContainer&&s.anchorOffset===d.startOffset)||P$(this))}r==="lineboundary"&&tg(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&N(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){const i=n.getParent(),o=n.getNextSibling()||(i===null?null:i.getNextSibling());if(N(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=Mm(Hn(r,e?"previous":"next"));if(o.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(const a of o.iterNodeCarets("shadowRoot"))if(Fr(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(N(o.anchor.origin)&&o.anchor.origin.isEmpty()){const c=Wn(a);hp(this,Mi(c,c)),o.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Go(a)){if(N(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(o.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(Fe(a.origin)){if(!a.origin.isIsolated())if(ri(a.origin).length>0){if(N(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const c=Vl();c.add(a.origin.getKey()),Vt(c)}}else if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&N(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const c=Vl();c.add(a.origin.getKey()),Vt(c)}else a.origin.remove();return}break}}if(l.type==="merge-block"){const{caret:a,block:c}=l;return ri(c).length>0?void 0:a.origin.isEmpty()&&!c.isEmpty()&&a.origin.getParent()===c.getParent()?void a.origin.remove(!0):(hp(this,Mi(!a.origin.isEmpty()&&c.isEmpty()?Ks(ot(c,a.direction)):o.anchor,a)),this.removeText())}for(let a=r.getNode();a!==null;){if(Ln(a)!==null)return;if(N(a)&&a.isShadowRoot())break;a=a.getParent()}}const s=this.focus;if(FO(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Fk(this,r.getNode()))return}else{const l=s.type==="text"?s.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=s.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Zk(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Zk(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,h=u.getNode(),d=f.getNode();if(h===d&&u.type==="text"&&f.type==="text"){const p=u.offset,g=f.offset,m=p<g,O=m?p:g,y=m?g:p,x=y-1;O!==x&&(function(b){return!(J$(b)||_D(b))})(h.getTextContent().slice(O,y))&&(c?f.set(f.key,x,f.type):u.set(u.key,x,u.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Nt(r.getParent())&&r.getPreviousSibling()===null&&Fk(this,r),C$()}}deleteLine(e){const n=U0(this.anchor);if(n!==null&&Fe($i(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&FO(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):lt(this.anchor.getNode(),An)!==lt(this.focus.getNode(),An)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;FO(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){const e=this._cachedIsBackward;if(e!==null)return e;const n=this.focus.isBefore(this.anchor);return mc()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function it(t){return t instanceof km}function _$(t,e){if(it(t)){for(const O of t.getNodes())q0(O)&&O.setFormat(e(O.getFormat()));return}if(t.isCollapsed())return t.setFormat(e(t.format)),void yn(null);const n=[];for(const O of t.getNodes())Y(O)?n.push(O):N(O)?O.setTextFormat(e(O.getTextFormat())):q0(O)&&O.setFormat(e(O.getFormat()));const r=n.length;if(r===0)return t.setFormat(e(t.format)),void yn(null);const i=t.anchor,o=t.focus,s=t.isBackward(),l=s?o:i,a=s?i:o;let c=0,u=n[0],f=l.type==="element"?0:l.offset;if(l.type==="text"&&f===u.getTextContentSize()&&(c=1,u=n[1],f=0),u==null)return;const h=r-1;let d=n[h];const p=a.type==="text"?a.offset:d.getTextContentSize();if(u.is(d)){if(f===p)return;const O=e(u.getFormat());if(Dr(u)||f===0&&p===u.getTextContentSize())u.setFormat(O);else{const y=u.splitText(f,p),x=f===0?y[0]:y[1];x.setFormat(O),l.type==="text"&&l.set(x.__key,0,"text"),a.type==="text"&&a.set(x.__key,p-f,"text")}return void(t.format=O)}f===0||Dr(u)||([,u]=u.splitText(f),f=0);const g=e(u.getFormat());u.setFormat(g);const m=e(d.getFormat());p>0&&(p===d.getTextContentSize()||Dr(d)||([d]=d.splitText(p)),d.setFormat(m));for(let O=c+1;O<h;O++){const y=n[O];y.setFormat(e(y.getFormat()))}l.type==="text"&&l.set(u.__key,f,"text"),a.type==="text"&&a.set(d.__key,p,"text"),t.format=g|m}function CD(t,e){const n=[];for(const[r,i]of Object.entries(e))typeof i=="boolean"&&n.push([r,i]);n.length!==0&&_$(t,r=>{for(const[i,o]of n)r=Bl(r,i,o?qo[i]:0);return r})}function T$(t,e,n=null){const r=n===null&&X(t)?Bl(t.format,e,null):n;_$(t,i=>Bl(i,e,r))}function Bk(t){const e=t.offset;if(t.type==="text")return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Y0(t){const e=t.getStartEndPoints();if(e===null)return[0,0];const[n,r]=e;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Bk(n),Bk(r)]}function Fk(t,e){for(let n=e;n;n=n.getParent()){if(N(n)){if(n.collapseAtStart(t))return!0;if(gt(n))break}if(n.getPreviousSibling())break}return!1}function P$(t){const e=t.focus,n=t.anchor,r=n.key,i=n.offset,o=n.type;n.set(e.key,e.offset,e.type,!0),e.set(r,i,o,!0)}function E$(t,e,n,r){t.modify(e,n,r)}function $$(t,e,n){const r=t.getNodes(),i=r.filter(l=>xc(l,n));if(i.length===0||i.length===r.length)return!1;const o=e?i[0]:i[i.length-1],s=N(o)?o:o.getParentOrThrow();return e?s.selectStart():s.selectEnd(),!0}function FO(t,e,n){if(tg(t,"extend",e,n))return;const r=at(),i=ur(kr(r));if(!i||typeof i.modify!="function")return;const o=r._blockCursorElement,s=r._rootElement,l=t.anchor,a=t.focus.getNode();s===null||o===null||!N(a)||a.isInline()||a.canBeEmpty()||sg(o,r,s);const c=P=>{const T=P.getNode(),M=r.getElementByKey(P.key);return M!==null&&P.type==="text"&&Y(T)?As(T,M,r):M},u=l.getNode(),f=c(l);if(f===null)return;const h=l.offset,d=t.isCollapsed(),p=t.focus,g=d?f:c(p);if(g===null)return;const m=p.offset;if(eg(i,g,m,g,m),E$(i,"move",e?"backward":"forward",n),i.rangeCount===0)return;const O=Pm(i,s)||i.getRangeAt(0),y=O.startContainer,x=O.startOffset;if(d&&n==="character"&&l.type==="text"&&Y(u)&&u.isUnmergeable()&&h===(e?0:u.getTextContentSize())){const P=ot(u,e?"previous":"next").getNodeAtCaret();if(Y(P)){const T=e?P.getTextContentSize()-1:1;return t.focus.set(P.__key,T,"text"),void(t.dirty=!0)}}if(d&&n==="character"&&l.type==="text"){const P=e?0:u.getTextContentSize(),T=y===f?x:h!==P?P:-1;if(T>=0)return void(T!==h&&(t.focus.set(l.key,T,"text"),t.dirty=!0))}const[b,S,v,w]=e?[y,x,f,h]:[f,h,y,x],k=Nt(u)?u:rA(u);t.applyDOMRange({collapsed:!1,endContainer:v,endOffset:w,startContainer:b,startOffset:S}),t.dirty=!0,!$$(t,e,k)&&e&&P$(t),n==="lineboundary"&&tg(t,"extend",e,n,"decorators")}const _D=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Zk(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===n||s>n||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function zk(t,e,n,r){let i,o=e,s=!1;if(Qe(t)){let l=!1;const a=t.childNodes,c=a.length,u=r._blockCursorElement;o===c&&c>0&&(l=!0,o=c-1),jc(t,r)!==void 0||ag(t,r)||(s=!0);let f=a[o],h=!1;if(f===u)f=a[o+1],h=!0;else if(u!==null){const d=u.parentNode;t===d&&e>Array.prototype.indexOf.call(d.children,u)&&o--}if(i=Na(f),Y(i))o=so(i,l?"next":"previous");else{let d=Na(t);if(d===null)return null;if(N(d)){const p=r.getElementByKey(d.getKey());p===null&&q(214),[d,o]=ci(d,p,r).resolveChildIndex(d,p,t,e),N(d)||q(215),l&&o>=d.getChildrenSize()&&(o=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(o);if(N(m)&&(function(O,y,x){const b=O.getParent();return x===null||b===null||!b.canBeEmpty()||b!==x.getNode()})(m,0,n)){const O=l?m.getLastDescendant():m.getFirstDescendant();O===null?d=m:(m=O,d=N(m)?m:m.getParentOrThrow()),o=0}Y(m)?(i=m,d=null,o=so(m,l?"next":"previous")):m!==d&&l&&!h&&(N(d)||q(216),o=Math.min(d.getChildrenSize(),o+1))}else{const p=$i(d),g=p!==null?p:d,m=g.getIndexWithinParent(),O=r.getElementByKey(d.getKey());let y="after";if(O!==null&&Na(t)===d){const x=ci(d,O,r);x.element!==O?y=x.resolveLeafPosition(O,t,e):e===0&&Fe(d)&&(y="before")}o=y==="before"?m:m+1,d=g.getParentOrThrow()}if(N(d))return[ao(d.__key,o,"element"),s]}}else i=Na(t);return Y(i)?[ao(i.__key,so(i,o,"clamp"),"text"),s]:null}function jk(t,e,n){const r=t.offset,i=t.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((n||!e)&&o===null&&N(s)&&s.isInline()){const l=s.getPreviousSibling();Y(l)&&t.set(l.__key,l.getTextContent().length,"text")}}else N(o)&&!n&&o.isInline()?t.set(o.__key,o.getChildrenSize(),"element"):Y(o)&&!i.isUnmergeable()&&t.set(o.__key,o.getTextContent().length,"text")}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&N(o)&&o.isInline())t.set(o.__key,0,"element");else if((n||e)&&o===null&&N(s)&&s.isInline()&&!s.canInsertTextAfter()&&s.getTextContentSize()>1){const l=s.getNextSibling();Y(l)&&t.set(l.__key,0,"text")}}}function A$(t,e,n){if(t.type==="text"&&e.type==="text"){const r=t.isBefore(e),i=t.is(e);jk(t,r,i),jk(e,!r,i),i&&e.set(t.key,t.offset,t.type)}}function U0(t){const e=Ge(t.key);return e===null?null:$m(e)}function Q$(t,e,n){const r=U0(t),i=U0(e);if(r===i||r!==null&&i!==null&&r.is(i))return!1;const o=n(r,i);if(r!==null)return N(r)?e.set(r.getKey(),o?r.getChildrenSize():0,"element"):e.set(r.getKey(),o?r.getTextContentSize():0,"text"),!0;const s=$i(i);if(s===null)return!1;const l=s.getParent();if(l===null)return!1;const a=s.getIndexWithinParent();return e.set(l.getKey(),o?a+1:a,"element"),!0}function M$(t){const e=Q$(t.anchor,t.focus,(n,r)=>(function(i,o,s,l){if(s!==null&&l!==null){const u=$i(s),f=$i(l);if(u!==null&&u.is(f)){for(const h of Am(u).values()){if(h===s.getKey())return!0;if(h===l.getKey())return!1}return!0}return u===null||f===null||u.isBefore(f)}if(s!==null){const u=$i(s),f=Ge(o.key);return u===null||f===null||!(!u.is(f)&&!u.isParentOf(f))||u.isBefore(f)}const a=$i(l),c=Ge(i.key);return a!==null&&c!==null&&!a.is(c)&&!a.isParentOf(c)&&c.isBefore(a)})(t.anchor,t.focus,n,r));return e&&(t.dirty=!0),e}function R$(t,e,n,r,i,o){if(t===null||n===null||!kh(i,t,n))return null;const s=zk(t,e,X(o)?o.anchor:null,i);if(s===null)return null;const l=zk(n,r,X(o)?o.focus:null,i);if(l===null)return null;const[a,c]=s,[u,f]=l;if(a.type==="element"&&u.type==="element"){const d=Na(t),p=Na(n);if(Fe(d)&&Fe(p))return null}const h=i._slotsUsed&&Q$(a,u,()=>(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return A$(a,u),[a,u,c||f||h]}function Nl(t){return N(t)&&!t.isInline()}function L$(t,e,n,r,i,o){const s=as(),l=new la(ao(t,e,i),ao(n,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Cm(){const t=ao("root",0,"element"),e=ao("root",0,"element");return new la(t,e,0,"")}function Vl(){return new km(new Set)}function Nb(t,e,n,r){const i=n._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!L0&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,h;if(X(t)&&!a)return t.clone();{if(e===null)return null;const b=ai(e,n._rootElement);if(c=b.anchorNode,u=b.focusNode,f=b.anchorOffset,h=b.focusOffset,(l||s===void 0)&&X(t)&&!kh(n,c,u))return t.clone()}const d=R$(c,f,u,h,n,t);if(d===null)return null;const[p,g,m]=d;let O=0,y="";if(X(t)){const b=t.anchor;if(p.key===b.key)O=t.format,y=t.style;else{const S=p.getNode();Y(S)?(O=S.getFormat(),y=S.getStyle()):N(S)&&(O=S.getTextFormat(),y=S.getTextStyle())}}const x=new la(p,g,O,y);return m&&(x.dirty=!0),x}function ne(){return as()._selection}function aa(){return at()._editorState._selection}function gl(t,e,n,r=1){const i=t.anchor,o=t.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(t.isCollapsed()){const c=i.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Xk(t)}}else{const c=t.isBackward(),u=c?o:i,f=u.getNode(),h=c?i:o,d=h.getNode();if(e.is(f)){const p=u.offset;(n<=p&&r>0||n<p&&r<0)&&u.set(a,Math.max(0,p+r),"element")}if(e.is(d)){const p=h.offset;(n<=p&&r>0||n<p&&r<0)&&h.set(a,Math.max(0,p+r),"element")}}Xk(t)}function Xk(t){const e=t.anchor,n=e.offset,r=t.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!N(o))return;const l=o.getChildrenSize(),a=n>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(n);if(Y(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(N(o)){const l=o.getChildrenSize(),a=n>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(n);if(Y(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(N(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(Y(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Jp(t,e,n,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,Y(r)?(s=r.getTextContentSize(),l="text"):N(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,Y(i)?l="text":N(i)&&(l="element")),o!==null&&l!==null?t.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function Wk(t,e,n,r,i){t.type==="text"?t.set(n,t.offset+(e?0:i),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function eg(t,e,n,r,i){try{t.setBaseAndExtent(e,n,r,i)}catch{}}function Hk(t,e,n){const r=yc(t,e.getKey());if(N(e)){const i=ci(e,r,t);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function TD(t,e,n,r,i,o){const s=o.getRootNode(),l=fa(s)||Uo(s)?bc(s):null;if(i.has(b$)&&l!==o||l!==null&&zb(l,l))return;const a=ai(r,o);let c;if(!X(e))return void(t!==null&&kh(n,a.anchorNode,a.focusNode)&&r.removeAllRanges());const u=e.anchor,f=e.focus,h=u.getNode(),d=f.getNode(),[p,g]=Hk(n,h,u.offset),[m,O]=Hk(n,d,f.offset),y=e.format,x=e.style,b=e.isCollapsed();let S=p,v=m,w=!1;if(u.type==="text"?(S=Y(h)?As(h,p,n):null,w=h.getFormat()!==y||h.getStyle()!==x):X(t)&&t.anchor.type==="text"&&(w=!0),f.type==="text"&&(v=Y(d)?As(d,m,n):null),S!==null&&v!==null){if(b&&(t===null||w||X(t)&&(t.format!==y||t.style!==x))&&(function(k,P,T,M,I,$){k._inputState.collapsedSelectionFormat={format:P,key:I,offset:M,style:T,timeStamp:$}})(n,y,x,g,u.key,performance.now()),(r.type!=="Range"||!b)&&a.anchorOffset===g&&a.focusOffset===O&&a.anchorNode===S&&a.focusNode===v){if(l===null||!o.contains(l)){const k=l!==null?Tl(l):null;k!==null&&k!==n||i.has(Gp)||o.focus({preventScroll:!0})}if(u.type!=="element")return}if(eg(r,S,g,v,O),Ho&&e.isCollapsed()&&o!==null&&!i.has(Gp)){const k=Ef(o);if(k===null||!o.contains(k)){const P=bc(o.ownerDocument),T=P!==null?Tl(P):null;T!==null&&T!==n||o.focus({preventScroll:!0})}}if(!i.has(mD)&&e.isCollapsed()&&o!==null&&o===Ef(o)){const k=X(e)&&e.anchor.type==="element"?S.childNodes[g]||null:(c===void 0&&(c=KD(r,o)),c);if(k!==null){let P;if(wr(k)){const T=k.ownerDocument.createRange();T.selectNode(k),P=T.getBoundingClientRect()}else P=k.getBoundingClientRect();(function(T,M,I){const $=qb(I),D=Yb($);if($===null||D===null)return;const Z=I.getBoundingClientRect();if(M.bottom<Z.top)return;let{top:G,bottom:z}=M,ee=0,oe=0,Q=I;for(;Q!==null;){const ve=Q===$.body;if(ve){const L=D.visualViewport;if(L){const he=L.offsetTop;ee=he,oe=he+L.height}else ee=0,oe=kr(T).innerHeight;const Ie=D.getComputedStyle($.documentElement),Be=parseFloat(Ie.scrollPaddingTop),pe=parseFloat(Ie.scrollPaddingBottom);isFinite(Be)&&(ee+=Be),isFinite(pe)&&(oe-=pe)}else{const L=Q===I?Z:Q.getBoundingClientRect();ee=L.top,oe=L.bottom}let _e=0;if(G<ee?_e=-(ee-G):z>oe&&(_e=z-oe),_e!==0)if(ve)D.scrollBy(0,_e);else{const L=Q.scrollTop;Q.scrollTop+=_e;const Ie=Q.scrollTop-L;G-=Ie,z-=Ie}if(ve)break;Q=Us(Q)}})(n,P,o)}}(function(k){k._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function _m(t){let e=ne()||aa();e===null&&(e=ut().selectEnd()),e.insertNodes(t)}function I$(t,e){for(const n of t.split(/(\r?\n|\t)/))n===`
|
|
10
|
-
`||n===`\r
|
|
11
|
-
`?e.linebreak():n===" "?e.tab():n!==""&&e.text(n)}function Pf(t){const e=[];return I$(t,{linebreak:()=>e.push(Sr()),tab:()=>e.push(Sh()),text:n=>e.push(bt(n))}),e}function G0(t){const e=[];for(const n of t)kn(n)||(!N(n)&&!Fe(n)||n.isInline()?e.push(n):N(n)&&e.push(...G0(n.getChildren())));return e}function yu(t){let e=t;t.isCollapsed()||e.removeText();const n=ne();X(n)&&(e=n),X(e)||q(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!An(i)&&Ln(i)===null;){const s=i;if([i,o]=PD(i,o),s.is(i))break}return o}function PD(t,e){const n=t.getParent();if(!n){const i=He();return ut().append(i),i.select(),[ut(),0]}if(Y(t)){const i=t.splitText(e);if(i.length===0)return[n,t.getIndexWithinParent()];const o=e===0?0:1;return[n,i[0].getIndexWithinParent()+o]}if(!N(t)||e===0)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const i=new la(ao(t.__key,e,"element"),ao(t.__key,e,"element"),0,""),o=t.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function qk(t){return kn(t)||qD(t)||Y(t)||t.isParentRequired()}function ZO(t){const e=He();let n=null;for(let r=0;r<t.length;r++){const i=t[r];if(qk(i)){if(n===null){n=i.createParentElementNode(),e.append(n);const o=t[r+1];if(kn(i)&&(o===void 0||!qk(o)))continue}n.append(i)}else e.append(i),n=null}return e}function tg(t,e,n,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!t.isCollapsed()){const[u,f]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return f.set(u.key,u.offset,u.type),!0}const o=Hn(t.focus,n?"previous":"next"),s=r==="lineboundary",l=e==="move";let a=o,c=i==="decorators-and-blocks";if(!nv(a)){for(const u of a){c=!1;const{origin:f}=u;if(!Fe(f)||f.isIsolated()||(a=u,!s||!f.isInline()))break}if(c)for(const u of Mm(o).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(Fr(u))u.origin.isInline()||(a=u);else{if(N(u.origin))continue;Fe(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===o)return!1;if(l&&!s&&Fe(a.origin)&&a.origin.isKeyboardSelectable()){const u=Vl();return u.add(a.origin.getKey()),Vt(u),!0}return a=Wn(a),l&&Ls(t.anchor,a),Ls(t.focus,a),c||!s}let bn=null,Ut=null,br=!1,zO=!1,cp=!1;const jO=new Set;let up=0;const Yk={characterData:!0,childList:!0,subtree:!0};function mc(){return br||bn!==null&&bn._readOnly}function On(){br&&q(13)}function D$(){up>99&&q(14)}function as(){return bn===null&&q(195,N$()),bn}function ED(t){as()!==null&&Ut===null&&(Ut=t),Ut!==t&&PE(378)}function at(){return Ut===null&&q(337,N$()),Ut}function $D(){at()._dirtyType=2}function N$(){let t=0;const e=new Set,n=Oc.version;if(typeof window<"u")for(const i of oA(document)){const o=zc(i);if(Ch(o))t++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function V$(){return Ut}function Uk(t,e,n){const r=e.__type,i=H$(t,r);let o=n.get(r);o===void 0&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function Gk(t,e){return t!==void 0&&t.__key!==e&&t.isAttached()}function B$(t,e){if(!e)return;const n=t._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)n.add(i)}function AD(t){return ng(t,at()._nodes)}function ng(t,e){const n=t.type,r=e.get(n);r===void 0&&q(17,n);const i=r.klass;t.type!==i.getType()&&q(18,i.name);const o=i.importJSON(t),s=t.children;if(N(o)&&Array.isArray(s))for(let a=0;a<s.length;a++){const c=ng(s[a],e);o.append(c)}const l=t.$slots;if(l){Do(o)||q(379,i.name);for(const a in l)pA(o,a,ng(l[a],e))}return o}function Kk(t,e,n){const r=bn,i=br,o=Ut;bn=e,br=!0,Ut=t;try{return n()}finally{bn=r,br=i,Ut=o}}function ks(t,e){const n=cp;cp=!0;try{(function(r,i){const o=r._pendingEditorState,s=r._rootElement,l=r._headless||s===null;if(o===null)return void(!r._updating&&r._deferred.length>0&&Jk(r,r._deferred));const a=r._editorState,c=a._selection,u=o._selection,f=r._dirtyType!==0,h=bn,d=br,p=Ut,g=r._updating,m=r._observer;let O=null;if(r._pendingEditorState=null,r._editorState=o,!l&&f&&m!==null){Ut=r,bn=o,br=!1,r._updating=!0;try{const k=r._dirtyType,P=r._dirtyElements,T=r._dirtyLeaves;m.disconnect(),O=eD(a,o,r,k,P,T)}catch(k){if(k instanceof Error&&r._onError(k),zO)throw k;return X$(r,null,s,o),VE(r),r._dirtyType=2,zO=!0,ks(r,a),void(zO=!1)}finally{m.observe(s,Yk),r._updating=g,bn=h,br=d,Ut=p}}o._readOnly||(o._readOnly=!0);const y=r._dirtyLeaves,x=r._dirtyElements,b=r._normalizedNodes,S=r._updateTags;f&&(r._dirtyType=0,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set),r._updateTags=new Set,(function(k,P){const T=k._decorators;let M=k._pendingDecorators||T;const I=P._nodeMap;let $;for($ in M)I.has($)||(M===T&&(M=K$(k)),delete M[$])})(r,o);const v=l?null:ur(kr(r));if(r._editable&&v!==null&&(f||u===null||u.dirty||!u.is(c))&&s!==null&&!S.has(v$)){Ut=r,bn=o;try{if(m!==null&&m.disconnect(),f||u===null||u.dirty){const k=r._blockCursorElement;k!==null&&sg(k,r,s),TD(c,u,r,v,S,s)}(function(k,P,T){let M=k._blockCursorElement;if(X(T)&&T.isCollapsed()&&T.anchor.type==="element"&&P.contains(Ef(P))){const I=T.anchor,$=I.getNode(),D=I.offset;let Z=!1,G=null;if(D===$.getChildrenSize())fp($.getChildAtIndex(D-1))&&(Z=!0);else{const z=$.getChildAtIndex(D);if(z!==null&&fp(z)){const ee=z.getPreviousSibling();(ee===null||fp(ee))&&(Z=!0,G=k.getElementByKey(z.__key))}}if(Z){const z=ci($,k.getElementByKey($.__key),k).element;return M===null&&(k._blockCursorElement=M=(function(ee){const oe=ee.theme,Q=Tt().createElement("div");Q.contentEditable="false",Q.setAttribute("data-lexical-cursor","true");let ve=oe.blockCursor;if(ve!==void 0){if(typeof ve=="string"){const _e=No(ve);ve=oe.blockCursor=_e}ve!==void 0&&Q.classList.add(...ve)}return Q})(k._config)),P.style.caretColor="transparent",void(G===null?z.appendChild(M):z.insertBefore(M,G))}}M!==null&&sg(M,k,P)})(r,s,u)}finally{m!==null&&m.observe(s,Yk),Ut=p,bn=h}}O!==null&&(function(k,P,T,M,I){const $=Array.from(k._listeners.mutation),D=$.length;for(let Z=0;Z<D;Z++){const[G,z]=$[Z];for(const ee of z){const oe=P.get(ee);oe!==void 0&&G(oe,{dirtyLeaves:M,prevEditorState:I,updateTags:T})}}})(r,O,S,y,a),X(u)||u===null||c!==null&&c.is(u)||r.dispatchCommand(Tb,void 0);const w=r._pendingDecorators;w!==null&&(r._decorators=w,r._pendingDecorators=null,Uu("decorator",r,!0,w)),(function(k,P,T){const M=nC(P),I=nC(T);M!==I&&Uu("textcontent",k,!0,I)})(r,i||a,o),Uu("update",r,!0,{dirtyElements:x,dirtyLeaves:y,editorState:o,mutatedNodes:O,normalizedNodes:b,prevEditorState:i||a,tags:S}),!g&&Jk(r,r._deferred),(function(k){const P=k._updates;if(P.length===0)return void(k._cascadeCount=0);if((function(M){jO.has(M)||(jO.add(M),setTimeout(()=>{jO.delete(M),M._cascadeCount=0},0))})(k),k._cascadeCount++>99)return k._updates=[],k._cascadeCount=0,void k._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${k._config.namespace}`));const T=P.shift();if(T){const[M,I]=T;Tm(k,M,I)}})(r)})(t,e)}finally{cp=n}}function Uu(t,e,n,...r){const i=e._updating;e._updating=n;try{const o=e._listeners[t],s=Array.from(o);for(const[l,a]of s){a&&a();const c=l(...r);o.has(l)?o.set(l,c):c&&c()}}finally{e._updating=i}}function F$(t,e,n,r){const i=jb(t);let o;if(!cp)for(let s=0;s<i.length;s++)i[s]._updating||(i[s]._cascadeCount=0);for(let s=4;s>=0;s--)for(let l=0;l<i.length;l++){const a=i[l];if(l>0&&a._updating){o=a;break}const c=a._commands.get(e);if(c!==void 0){const u=c[s];if(u.size>0){let f=!1;if(ni(a,()=>{for(const h of u)if(h(n,r))return void(f=!0)}),f)return f}}}return o&&o.update(()=>{F$(o,e,n,r)}),!1}function Jk(t,e){if(t._deferred=[],e.length!==0){const n=t._updating;t._updating=!0;try{for(let r=0;r<e.length;r++)e[r]()}finally{t._updating=n}}}function eC(t,e){const n=t._updates;let r=e||!1;for(;n.length!==0;){const i=n.shift();if(i){const[o,s]=i,l=t._pendingEditorState;let a;s!==void 0&&(a=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(l===null&&q(191),l._flushSync=!0),a&&t._deferred.push(a),B$(t,s.tag)),l==null?Tm(t,o,s):o()}}return r}function Tm(t,e,n){const r=t._updateTags;let i,o=!1,s=!1;n!==void 0&&(i=n.onUpdate,B$(t,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),i&&t._deferred.push(i);const l=t._editorState;let a=t._pendingEditorState,c=!1;(a===null||a._readOnly)&&(a=t._pendingEditorState=Z$(a||l),c=!0),a._flushSync=s;const u=bn,f=br,h=Ut,d=t._updating;bn=a,br=!1,t._updating=!0,Ut=t;const p=t._headless||t.getRootElement()===null;Fb(null);try{c&&(p?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(y,x){const b=y.getEditorState()._selection,S=ur(kr(y));return X(b)||b==null?Nb(b,S,y,x):b.clone()})(t,n&&n.event||null));const m=t._compositionKey;e(),o=eC(t,o),(function(y,x){const b=x.getEditorState()._selection,S=y._selection;if(X(S)){const v=S.anchor,w=S.focus;let k;if(v.type==="text"&&(k=v.getNode(),k.selectionTransform(b,S)),w.type==="text"){const P=w.getNode();k!==P&&P.selectionTransform(b,S)}}})(a,t),t._dirtyType!==0&&(o?(function(y,x){const b=x._dirtyLeaves,S=y._nodeMap;for(const v of b){const w=S.get(v);Y(w)&&w.isAttached()&&w.isSimpleText()&&!w.isUnmergeable()&&vk(w)}})(a,t):(function(y,x){const b=x._dirtyLeaves,S=x._dirtyElements,v=y._nodeMap,w=Ro(),k=new Map;let P=b,T=P.size,M=S,I=M.size;for(;T>0||I>0;){if(T>0){x._dirtyLeaves=new Set;for(const $ of P){const D=v.get($);Y(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&vk(D),D!==void 0&&Gk(D,w)&&Uk(x,D,k),b.add($)}if(P=x._dirtyLeaves,T=P.size,T>0){up++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,M.delete("root")&&M.set("root",!0);for(const $ of M){const D=$[0],Z=$[1];if(S.set(D,Z),!Z)continue;const G=v.get(D);G!==void 0&&Gk(G,w)&&Uk(x,G,k)}P=x._dirtyLeaves,T=P.size,M=x._dirtyElements,I=M.size,up++}x._dirtyLeaves=b,x._dirtyElements=S})(a,t),eC(t),(function(y,x,b,S){const v=y._nodeMap,w=x._nodeMap,k=[];for(const[M]of S){const I=w.get(M);I!==void 0&&(I.isAttached()||(N(I)&&Xp(I,M,v,w,k,S),v.has(M)||S.delete(M),k.push(M)))}for(const M of b){const I=w.get(M);I===void 0||I.isAttached()||(Do(I)&&I.__slots!==null&&Xp(I,M,v,w,k,b),v.has(M)||b.delete(M),k.push(M))}for(const M of k)w.delete(M);const P=at(),T=P._compositionKey;T===null||w.has(T)||(P._compositionKey=null)})(l,a,t._dirtyLeaves,t._dirtyElements)),m!==t._compositionKey&&(a._flushSync=!0);const O=a._selection;if(X(O)){t._slotsUsed&&M$(O);const y=a._nodeMap,x=O.anchor.key,b=O.focus.key;y.get(x)!==void 0&&y.get(b)!==void 0||q(19)}else it(O)&&O._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&t._onError(m),t._pendingEditorState=l,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void ks(t)}finally{bn=u,br=f,Ut=h,t._updating=d,up=0}t._dirtyType!==0||t._deferred.length>0||(function(m,O){const y=O.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(a,t)?a._flushSync?(a._flushSync=!1,ks(t)):c&&ZD(()=>{ks(t)}):(a._flushSync=!1,c&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function ni(t,e,n){Ut===t&&n===void 0?e():Tm(t,e,n)}function QD(t){if(gt(t)){let e=null;for(const n of t.getChildren())e=n.isInline()?(e||n.replace(n.createParentElementNode())).append(n):null}}class sr extends Br{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:QD,extends:Br})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&q(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return V6[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){const e=[];let n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&ri(this).length===0}isDirty(){const e=at()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){const e=[];for(const r of ri(this)){const i=Zl(this,r);N(i)&&e.push(...i.getAllTextNodes())}let n=this.getFirstChild();for(;n!==null;){if(Y(n)&&e.push(n),N(n)){const r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;N(e);){const n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;N(e);){const n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){const n=this.getChildren(),r=n.length;if(e>=r){const o=n[r-1];return N(o)&&o.getLastDescendant()||o||null}const i=n[e];return N(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Ge(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&q(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Ge(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&q(96,this.__key),e}getChildAtIndex(e){const n=this.getChildrenSize();let r,i;if(e<n/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=n-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e=dA(this);const n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){const o=n[i];e+=o.getTextContent(),N(o)&&i!==r-1&&!o.isInline()&&(e+=bl)}return e}getTextContentSize(){let e=(function(i){let o=0;for(const s of ri(i)){const l=Zl(i,s);l!==null&&(o+=l.getTextContentSize())}return o})(this);const n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){const o=n[i];e+=o.getTextContentSize(),N(o)&&i!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const n=jp[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){const n=qo[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return Bl(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){On();const r=ne();let i=e,o=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){const a=this.getFirstChild();if(Y(a)||N(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||n!==void 0&&n!==s)){const a=this.getLastChild();if(Y(a)||N(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return X(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):L$(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(n=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""&&jp[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){const n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){Up(this)&&q(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();e+n<=i||q(226,String(e),String(n),String(i));for(const d of r);const s=o.__key,l=[],a=[],c=this.getChildAtIndex(e+n);let u=null,f=i-n+r.length;if(e!==0)if(e===i)u=this.getLastChild();else{const d=this.getChildAtIndex(e);d!==null&&(u=d.getPreviousSibling())}if(n>0){let d=u===null?this.getFirstChild():u.getNextSibling();for(let p=0;p<n;p++){d===null&&q(100);const g=d.getNextSibling(),m=d.__key;Mo(d.getWritable()),a.push(m),d=g}}let h=u;for(const d of r){h!==null&&d.is(h)&&(u=h=h.getPreviousSibling());const p=d.getWritable();p.__parent===s&&f--,Mo(p);const g=d.__key;if(h===null)o.__first=g,p.__prev=null;else{const m=h.getWritable();m.__next=g,p.__prev=m.__key}d.__key===s&&q(76),p.__parent=s,l.push(g),h=d}if(e+n===i)h!==null&&(h.getWritable().__next=null,o.__last=h.__key);else if(c!==null){const d=c.getWritable();if(h!==null){const p=h.getWritable();d.__prev=h.__key,p.__next=c.__key}else d.__prev=null}if(o.__size=f,a.length){const d=ne();if(X(d)){const p=new Set(a),g=new Set(l),{anchor:m,focus:O}=d;tC(m,p,g)&&Jp(m,m.getNode(),this,u,c),tC(O,p,g)&&Jp(O,O.getNode(),this,u,c),f!==0||this.canBeEmpty()||gt(this)||this.remove()}}return o}getDOMSlot(e){return new QE(e)}exportDOM(e){const{element:n}=super.exportDOM(e);if(Qe(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px",n.setAttribute("data-lexical-indent",String(r)));const i=this.getDirection();i&&(n.dir=i)}return{element:n}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||gt(this)||this.getChildren().some(Y)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){const r=ci(this,e,n);let i=r.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const s=n.getElementByKey(o.getKey());s!==null&&(i==null?(r.insertChild(s),i=s):i!==s&&r.replaceChild(s,i),i=i.nextSibling)}}}function N(t){return t instanceof sr}function tC(t,e,n){let r=t.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!n.has(i))return!0;r=r.getParent()}return!1}class Fc extends Br{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&q(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Fe(t){return t instanceof Fc}class ca extends sr{__cachedText;static getType(){return"root"}static clone(){return new ca}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){const e=this.__cachedText;return e===null||!mc()&&at()._dirtyType!==0?super.getTextContent():e}remove(){q(52)}replace(e){q(53)}insertBefore(e){q(54)}insertAfter(e){q(55)}updateDOM(e,n){return!1}splice(e,n,r){for(const i of r)N(i)||Fe(i)||q(282);return super.splice(e,n,r)}static importJSON(e){return ut().updateFromJSON(e)}collapseAtStart(){return!0}}function Nt(t){return t instanceof ca}function Z$(t){return new wh(LE(t._nodeMap),null,t._slotsUsed)}function Vb(){return new wh(new Map([["root",new ca]]),null,!1)}function K0(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&q(130,n.name),N(t)){const i=e.children;Array.isArray(i)||q(59,n.name);const o=t.getChildren();for(let s=0;s<o.length;s++){const l=K0(o[s]);i.push(l)}}const r=ri(t);if(r.length>0){const i={};for(const o of r){const s=Zl(t,o);s===null&&q(366,n.name,o),i[o]=K0(s)}e.$slots=i}return e}function MD(t){return t instanceof wh}class wh{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,n=null,r=!1){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,n){return Kk(n&&n.editor||null,this,e)}clone(e){const n=new wh(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return Kk(null,this,()=>({root:K0(ut())}))}}class Bb extends sr{static getType(){return"artificial"}createDOM(e){return Tt().createElement("div")}}class ua extends Br{static getType(){return"linebreak"}static clone(e){return new ua(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
12
|
-
`}createDOM(){return Tt().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>z$(e)||j$(e)?null:{conversion:RD,priority:0}}}static importJSON(e){return Sr().updateFromJSON(e)}}function RD(t){return{node:Sr()}}function Sr(){return zr(new ua)}function kn(t){return t instanceof ua}function z$(t){const e=t.parentElement;if(e!==null&&vc(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&rg(n)){const r=e.lastChild;if(r===t||r.previousSibling===t&&rg(r))return!0}}return!1}function j$(t){const e=t.parentElement;if(e!==null&&vc(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&rg(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&rg(r))return!0}return!1}function rg(t){return wr(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}class Ys extends sr{static getType(){return"paragraph"}static clone(e){return new Ys(e.__key)}createDOM(e){const n=Tt().createElement("p"),r=Ka(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(e,n,r){return!1}static importDOM(){return{p:e=>({conversion:LD,priority:0})}}exportDOM(e){const{element:n}=super.exportDOM(e);if(Qe(n)){this.isEmpty()&&n.append(Tt().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(e){return He().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const n=this.getChildren().find(Y);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){const r=He();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||Y(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function LD(t){const e=He();if(go(e,t),ha(t,e),e.getFormatType()===""){const n=t.getAttribute("align");n&&n&&n in jp&&e.setFormat(n)}return di(e,t),{node:e}}function He(){return zr(new Ys)}function Zc(t){return t instanceof Ys}function ID(t){console.warn(t)}const Ne=0,fn=1,DD=3,co=4,ND=-8;function X$(t,e,n,r,i){const o=t._keyToDOMMap;o.clear(),t._editorState=Vb(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(t._updateTags=new Set,t._updates=[],t._cascadeCount=0),t._blockCursorElement=null,t._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(t._inputState.handledSelectionCommandTimeoutId),t._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};const s=t._observer;s!==null&&(s.disconnect(),t._observer=null),e!==null&&(e.textContent="",(function(l,a){const c=`__lexicalKey_${a._key}`;delete l[c]})(e,t)),n!==null&&(n.textContent="",o.set("root",n),G$(n,t,"root"))}function VD(t){const e=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of Kb(t)){const o=r.transform;if(!n.has(o)){n.add(o);const s=r.transform();s&&e.add(s)}if(i){const s=i.$transform;s&&e.add(s)}}return e}const ig={$createDOM:(t,e)=>t.createDOM(e._config,e),$decorateDOM:(t,e,n,r)=>{},$exportDOM:(t,e)=>{const n=Zb(e,t.getType());return n&&n.exportDOM!==void 0?n.exportDOM(e,t):t.exportDOM(e)},$extractWithChild:(t,e,n,r,i)=>N(t)&&t.extractWithChild(e,n,r),$getDOMSlot:(t,e,n)=>t.getDOMSlot(e),$getSlotTargetElement:(t,e,n,r)=>null,$shouldExclude:(t,e,n)=>N(t)&&t.excludeFromCopy("html"),$shouldInclude:(t,e,n)=>!e||t.isSelected(e),$updateDOM:(t,e,n,r)=>t.updateDOM(e,n,r._config)};function W$(t){const e=t||{},n=V$(),r=e.theme||{},i=t===void 0?n:e.parentEditor||null,o=e.disableEvents||!1,s=Vb(),l=e.namespace||(i!==null?i._config.namespace:eA()),a=e.editorState,c=[ca,hi,ua,sa,Ys,Bb,...e.nodes||[]],{onError:u,onWarn:f,html:h}=e,d=e.editable===void 0||e.editable;let p;if(t===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<c.length;m++){let O=c[m],y=null,x=null;if(O&&typeof O=="object"){const v=O;O=v.replace,y=v.with,x=v.withKlass||null}if(typeof O!="function"||!O.prototype||!(O===Br||O.prototype instanceof Br)){let v="<unknown>";try{v=JSON.parse(RE)}catch{}q(365,String(m-c.length+(e.nodes?e.nodes.length:0)),typeof O=="function"?`${O.name}${typeof O.getType=="function"?` (type ${String(O.getType())})`:""}`:String(O),String(v))}Gb(O);const b=O.getType(),S=VD(O);p.set(b,{exportDOM:h&&h.export?h.export.get(O):void 0,klass:O,replace:y,replaceWithKlass:x,sharedNodeState:q6(c[m]),transforms:S})}}const g=new Oc(s,i,p,{disableEvents:o,dom:{...ig,...t&&t.dom},namespace:l,theme:r},u||console.error,f||ID,(function(m,O){const y=new Map,x=new Set,b=S=>{Object.keys(S).forEach(v=>{let w=y.get(v);w===void 0&&(w=[],y.set(v,w)),w.push(S[v])})};return m.forEach(S=>{const v=S.klass.importDOM;if(v==null||x.has(v))return;x.add(v);const w=v.call(S.klass);w!==null&&b(w)}),O&&b(O),y})(p,h?h.import:void 0),d,t);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=2),(function(m){m.registerCommand(GE,uD,Ne),m.registerCommand(KE,fD,Ne),m.registerCommand(JE,hD,Ne),m.registerCommand(e$,dD,Ne),m.registerCommand(xm,pD,Ne)})(g),g}function BD(t,e){const n=t.get(e);t.delete(e),n&&n()}function xu(t,e,n){return t.set(e,n),BD.bind(null,t,e)}class Oc{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,n,r,i,o,s,l,a,c){this._createEditorArgs=c,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new R0,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=eA(),this._onError=o,this._onWarn=s,this._htmlConversions=l,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return xu(this._listeners.update,e)}registerEditableListener(e){return xu(this._listeners.editable,e)}registerDecoratorListener(e){return xu(this._listeners.decorator,e)}registerTextContentListener(e){return xu(this._listeners.textcontent,e)}registerRootListener(e){const n=this._listeners.root;return ln(xu(n,e,e(this._rootElement,null)||void 0),()=>(function(r,i,o){const s=r.get(i);s&&s(),r.set(i,i(...o)||void 0)})(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&q(35);const i=this._commands;i.has(e)||i.set(e,[new Ou,new Ou,new Ou,new Ou,new Ou]);const o=i.get(e);o===void 0&&q(36,String(e));const s=(function(a){return 7&a})(r),l=o[s];return s!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),o.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,n,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;let s=o.get(n);s===void 0&&(s=new Set,o.set(n,s)),s.add(i);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,i),()=>{s.delete(i),s.size===0&&o.delete(n)}}getRegisteredNode(e){const n=this._nodes.get(e.getType());return n===void 0&&q(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){const r=this._editorState,i=aC(r).get(n.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){const r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){const r=this.registerNodeTransformToKlass(e,n),i=[r],o=r.replaceWithKlass;if(o!=null){const s=this.registerNodeTransformToKlass(o,n);i.push(s)}return(function(s,l){const a=aC(s.getEditorState()),c=[];for(const u of l){const f=a.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const h=Ge(f);h&&h.markDirty()}},s._pendingEditorState===null?{tag:Yu}:void 0)})(this,i.map(s=>s.klass.getType())),()=>{i.forEach(s=>s.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,n){return be(this,e,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const n=this._rootElement;if(e!==n){const r=Ka(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,X$(this,n,e,i,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||gD(n),r!=null&&n.classList.remove(...r)),e!==null){const o=Yb(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=2,VE(this),this._updateTags.add(Yu),ks(this),this._config.disableEvents||(function(l,a){const c=l.ownerDocument;W0.set(l,c);let u=qp.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},qp.set(c,u)),u.editors.add(a),u.hasShadowEditor=void 0,l.__lexicalEditor=a;const f=p$(l);f.push(cD.register(c));for(let h=0;h<X0.length;h++){const[d,p]=X0[h],g=typeof p=="function"?m=>{Rk(m)||(Mk(m),(a.isEditable()||d==="click")&&p(m,a))}:m=>{if(Rk(m))return;Mk(m);const O=a.isEditable();switch(d){case"cut":return O&&be(a,Rb,m);case"copy":return be(a,Sm,m);case"paste":return O&&be(a,mm,m);case"dragstart":return O&&be(a,l$,m);case"dragover":return O&&be(a,a$,m);case"dragend":return O&&be(a,iD,m);case"focus":return O&&be(a,wm,m);case"blur":return O&&be(a,Lb,m);case"drop":return O&&be(a,s$,m)}};f.push(Ib(l,d,g))}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Yu),ks(this);Uu("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&q(38);let r=e;r._readOnly&&(r=Z$(e),r._selection=e._selection?e._selection.clone():null),NE(this);const i=this._pendingEditorState,o=n!==void 0?n.tag:null;i===null||i.isEmpty()||(o!=null&&this._updateTags.add(o),ks(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,ni(this,()=>{if(o&&this._updateTags.add(o),e._parsed)for(const[s,l]of r._nodeMap.entries())N(l)?this._dirtyElements.set(s,!0):this._dirtyLeaves.add(s)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return(function(r,i,o){const s=Vb(),l=bn,a=br,c=Ut,u=i._dirtyElements,f=i._dirtyLeaves,h=i._cloneNotNeeded,d=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,bn=s,br=!1,Ut=i,Fb(null);try{const p=i._nodes;ng(r.root,p),o&&o(),s._readOnly=!0,s._parsed=!0}catch(p){p instanceof Error&&i._onError(p)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=h,i._dirtyType=d,bn=l,br=a,Ut=c}return s})(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){const[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&ks(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,i,o){r._updating?r._updates.push([i,o]):Tm(r,i,o)})(this,e,n)}focus(e,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ni(this,()=>{const i=ne(),o=ut();i!==null?i.dirty||Vt(i.clone()):o.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?o.selectStart():o.selectEnd()),Yo("focus"),HD(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const n=ur(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Uu("editable",this,!0,e),this._slotsUsed&&this.update(()=>$D()))}toJSON(){return{editorState:this._editorState.toJSON()}}}Oc.version=RE;let J0=null;function Fb(t){J0=t}let FD=1;function H$(t,e){const n=Zb(t,e);return n===void 0&&q(30,e),n}function Zb(t,e){return t._nodes.get(e)}const ZD=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)};function zb(t,e){const n=e!==void 0?e:(()=>{const o=t.getRootNode();return fa(o)||Uo(o)?bc(o):null})();if(!Qe(n)||n.hasAttribute("data-lexical-slot"))return!1;const r=Li(n),i=n.nodeName;return m$(r)&&(i==="INPUT"||i==="TEXTAREA"||n.contentEditable==="true"&&zc(n)==null)}function kh(t,e,n){const r=t.getRootElement();if(!r)return!1;try{if(!e||!r.contains(e)||!r.contains(n))return!1}catch{return!1}return Tl(e)===t&&t.read("latest",()=>!zb(e))}function Ch(t){return t instanceof Oc}function Tl(t){let e=t;for(;e!=null;){const n=zc(e);if(Ch(n))return n;e=Us(e)}return null}function zc(t){return t?t.__lexicalEditor:null}function Pl(t){return Dl(t)||t.isToken()}function Dr(t){return Pl(t)||t.isSegmented()}function wr(t){return Xc(t)&&t.nodeType===3}function fa(t){return Xc(t)&&t.nodeType===9}function zD(t){let e=t;for(;e!=null;){if(wr(e))return e;e=e.firstChild}return null}function Bl(t,e,n){const r=qo[e];if(n!==null&&(t&r)===(n&r))return t;let i=t^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function q$(t){return Y(t)||kn(t)||Fe(t)}function Y$(t,e){const n=(function(){const s=J0;return J0=null,s})();if((e=e||n&&n.__key)!=null)return void(t.__key=e);On(),D$();const r=at(),i=as(),o=""+FD++;i._nodeMap.set(o,t),N(t)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType===0&&(r._dirtyType=1),t.__key=o}function Mo(t){Ln(t)!==null&&q(380,t.__key,String(Ln(t)));const e=t.getParent();if(e!==null){const n=t.getWritable(),r=e.getWritable(),i=t.getPreviousSibling(),o=t.getNextSibling(),s=o!==null?o.__key:null,l=i!==null?i.__key:null,a=i!==null?i.getWritable():null,c=o!==null?o.getWritable():null;i===null&&(r.__first=s),o===null&&(r.__last=l),a!==null&&(a.__next=s),c!==null&&(c.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function og(t){D$(),Up(t)&&q(323,t.__key,t.__type);const e=t.getLatest(),n=e.__parent!==null?e.__parent:Fl(e)?e.__slotHost:null,r=as(),i=at(),o=r._nodeMap,s=i._dirtyElements;n!==null&&(function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const h=c.get(f);if(h===void 0)break;u.set(f,!1),f=h.__parent!==null?h.__parent:Fl(h)?h.__slotHost:null}})(n,o,s);const l=e.__key;i._dirtyType===0&&(i._dirtyType=1),N(t)?s.set(l,!0):i._dirtyLeaves.add(l)}function yn(t){On();const e=at(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,n!==null){const r=Ge(n);r!==null&&r.getWritable()}if(t!==null){const r=Ge(t);r!==null&&r.getWritable()}}}function Ro(){return mc()?null:at()._compositionKey}function Ge(t,e){const n=(e||as())._nodeMap.get(t);return n===void 0?null:n}function U$(t,e){const n=jc(t,at());return n!==void 0?Ge(n,e):null}function G$(t,e,n){t[`__lexicalKey_${e._key}`]=n}function jc(t,e){return t[`__lexicalKey_${e._key}`]}function Li(t,e){let n=t;for(;n!=null;){const r=U$(n,e);if(r!==null)return r;n=Us(n)}return null}function K$(t){const e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function nC(t){return t.read(()=>ut().getTextContent())}function ut(){return as()._nodeMap.get("root")}function Vt(t){On();const e=as();t!==null&&(t.dirty=!0,t.setCachedNodes(null),X(t)&&at()._slotsUsed&&M$(t)),e._selection=t}function rC(){On(),NE(at())}function Na(t){const e=(function(n,r){let i=n;for(;i!=null;){const o=jc(i,r);if(o!==void 0)return o;i=Us(i)}return null})(t,at());return e===null?null:Ge(e)}function J$(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function jb(t){const e=[];for(let n=t;n!==null;n=n._parentEditor)e.push(n);return e}function eA(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function tA(t){return wr(t)?t.nodeValue:null}function Xb(t,e,n){const r=ur(kr(e));if(r===null)return;const i=ai(r,e._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:l}=i;if(o!==null){let a=tA(o);const c=Li(o);if(a!==null&&Y(c)){if((a===yf||a===Cb)&&n){const u=n.length;a=n,s=u,l=u}a!==null&&Wb(c,a,s,l,t)}}}function Wb(t,e,n,r,i){let o=t;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();if(o.isToken()&&s)return;let l=e;if((s||i)&&(e.endsWith(yf)&&(l=e.slice(0,-yf.length)),i)){const c=Cb;let u;for(;(u=l.indexOf(c))!==-1;)l=l.slice(0,u)+l.slice(u+c.length),n!==null&&n>u&&(n=Math.max(u,n-c.length)),r!==null&&r>u&&(r=Math.max(u,r-c.length))}const a=o.getTextContent();if(i||l!==a){const c=ne();if(l===""){if(yn(null),xh||Ms||bh)o.remove();else{const g=at();XO(o,"",c),setTimeout(()=>{g.update(()=>{o.isAttached()&&o.getTextContent()===""&&o.remove()})},20)}return}const u=o.getParent(),f=aa(),h=o.getTextContentSize(),d=Ro(),p=o.getKey();if(o.isToken()&&!s||d!==null&&p===d&&!s||X(f)&&(u!==null&&!u.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===t.__key&&f.anchor.offset===0&&!o.canInsertTextBefore()&&!s||f.focus.key===t.__key&&f.focus.offset===h&&!o.canInsertTextAfter()&&!s))return void o.markDirty();if(!X(c)||n===null||r===null)return void XO(o,l,c);if(c.setTextNodeRange(o,n,o,r),o.isSegmented()){const g=bt(o.getTextContent());o.replace(g),o=g}XO(o,l,c)}}}function XO(t,e,n){if(t.setTextContent(e),X(n)){const r=t.getKey();let i=!1;for(const o of["anchor","focus"]){const s=n[o];s.type==="text"&&s.key===r&&(s.offset=so(t,s.offset,"clamp"),i=!0)}i&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function ed(t,e,n){const r=e[n]||!1;return r==="any"||r===t[n]}function jD(t,e){return ed(t,e,"altKey")&&ed(t,e,"ctrlKey")&&ed(t,e,"shiftKey")&&ed(t,e,"metaKey")}function pt(t,e,n){if(!jD(t,n))return!1;if(t.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1||t.key.length===1&&t.key.charCodeAt(0)<=127)return!1;if(t.code.startsWith("Digit")&&/^\d$/.test(e))return t.code===`Digit${e}`;const r="Key"+e.toUpperCase();return t.code===r}const So={ctrlKey:!ki,metaKey:ki},iC={altKey:ki,ctrlKey:!ki};function oC(t){return t.key==="Backspace"}function XD(t){const e=ut();if(X(t)){const n=t.anchor,r=t.focus,i=n.getNode();if(Nt(i))return n.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),Ki(t),t;const o=i.getTopLevelElementOrThrow(),s=o.getParent();if(s===null)return N(o)&&(n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ki(t)),t;const l=s;return n.set(l.getKey(),0,"element"),r.set(l.getKey(),l.getChildrenSize(),"element"),Ki(t),t}{const n=e.select(0,e.getChildrenSize());return Vt(Ki(n)),n}}function Ka(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(r!==void 0)return r;const i=t[e];if(typeof i=="string"){const o=No(i);return n[e]=o,o}return i}function Hb(t,e,n,r,i){if(n.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&q(33,o);const a=l.klass;let c=t.get(a);c===void 0&&(c=new Map,t.set(a,c));const u=c.get(s),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"updated":i)}function sC(t,e,n){const r=t.getParent();let i=n,o=t;return r!==null&&(n===0&&(i=o.getIndexWithinParent(),o=r)),o.getChildAtIndex(i-1)}function WD(t,e){const n=t.offset;if(t.type==="element")return sC(t.getNode(),e,n);{const r=t.getNode();if(n===0||!e){const i=r.getPreviousSibling();return i===null?sC(r.getParentOrThrow(),e,r.getIndexWithinParent()+0):i}}return null}function nA(t){const e=kr(t).event,n=e&&e.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function be(t,e,n){return F$(t,e,n,t)}function yc(t,e){const n=t._keyToDOMMap.get(e);return n===void 0&&q(75,e),n}function Us(t){const e=t.assignedSlot||t.parentElement;if(e!==null)return e;const n=t.parentNode;return Uo(n)?n.host:null}function qb(t){return fa(t)?t:Qe(t)?t.ownerDocument:null}function Yo(t){On(),at()._updateTags.add(t)}function HD(t){On(),at()._deferred.push(t)}function xc(t,e){let n=t.getParent();for(;n!==null;){if(n.is(e))return!0;n=n.getParent()}return!1}function Yb(t){const e=qb(t);return e?e.defaultView:null}function kr(t){const e=t._window;return e===null&&q(78),e}function qD(t){return N(t)&&t.isInline()||Fe(t)&&t.isInline()}function rA(t){let e=t.getLatest();for(;e!==null;){if(Ln(e)!==null&&N(e))return e;const n=e.getParentOrThrow();if(gt(n))return n;e=n}return e}function Ja(t){return N(t)&&t.isShadowRoot()}function gt(t){return Nt(t)||Ja(t)}function Rn(t,e=!1){const n=t.constructor.clone(t);return Y$(n,null),n.afterCloneFrom(t),e||n.resetOnCopyNodeFrom(t),n}function zr(t){const e=at(),n=t.getType(),r=Zb(e,n);r===void 0&&q(200,t.constructor.name,n);const{replace:i,replaceWithKlass:o}=r;if(i!==null){const s=i(t),l=s.constructor;return o!==null?s instanceof o||q(201,o.name,o.getType(),l.name,l.getType(),t.constructor.name,n):s instanceof t.constructor&&l!==t.constructor||q(202,l.name,l.getType(),t.constructor.name,n),s.__key===t.__key&&q(203,t.constructor.name,n,l.name,l.getType()),s}return t}function WO(t,e){!Nt(t.getParent())||N(e)||Fe(e)||q(99)}function YD(t){const e=Ge(t);return e===null&&q(63,t),e}function fp(t){if(!t||t.isInline())return!1;if(Fe(t))return!0;if(N(t)){if(t.isShadowRoot()){const e=t.getParent();return!(N(e)&&e.isShadowRoot())}return!t.canBeEmpty()}return!1}function sg(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;r!==null&&r.removeChild(t)}function ur(t){return cr?(t||window).getSelection():null}function UD(t){const e=Yb(t);return e?e.getSelection():null}function Uo(t){return ey(t)&&"host"in t}const GD=[];function iA(t){const e=t.getRootNode();if(e===t||!Uo(e))return GD;const n=[e];let r=e.host;for(;;){const i=r.getRootNode();if(i===r||!Uo(i))break;n.push(i),r=i.host}return n}function*oA(t){const e=[t];let n;for(;n=e.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const r=(fa(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let i;for(;i=r.nextNode();)i.shadowRoot&&e.push(i.shadowRoot)}}function sA(t){return t!==null?t.ownerDocument:document}function Tt(){const t=V$();return sA(t!==null?t._rootElement:null)}function Pm(t,e){if(e===null||typeof t.getComposedRanges!="function")return null;const n=iA(e);if(n.length===0)return null;const r=t.getComposedRanges;try{const i=r.call(t,{shadowRoots:n})[0];if(i!==void 0)return i}catch{}try{const i=r.apply(t,n)[0];if(i!==void 0)return i}catch{}return null}function KD(t,e){const n=Pm(t,e);if(n!==null){const r=JD(n);if(r!==null)return r}return t.rangeCount>0?t.getRangeAt(0):null}function ai(t,e){const n=Pm(t,e);return n===null?t:eN(n,tN(t))}function JD(t){const e=t.startContainer.ownerDocument;if(e===null)return null;const n=e.createRange();try{return n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),n}catch{return null}}function eN(t,e){const{startContainer:n,startOffset:r,endContainer:i,endOffset:o}=t;return e==="backward"?{anchorNode:i,anchorOffset:o,direction:e,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:e,focusNode:i,focusOffset:o}}function tN(t){return t.direction}function Ef(t){const e=t.getRootNode();return fa(e)||Uo(e)?e.activeElement:null}function bc(t){let e=t.activeElement;for(;e!==null&&e.shadowRoot!==null;){const n=e.shadowRoot.activeElement;if(n===null)break;e=n}return e}function Ub(t){const e=t.target;if(e!==null&&Qe(e)&&e.shadowRoot!==null&&typeof t.composedPath=="function"){const n=t.composedPath();if(n.length>0)return n[0]}return e}function lA(t){return Qe(t)&&t.tagName==="A"}function Qe(t){return Xc(t)&&t.nodeType===1}function Xc(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"}function ey(t){return Xc(t)&&t.nodeType===11}const nN=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function lg(t){return!(!Qe(t)||!t.style.display.startsWith("inline"))||nN.test(t.nodeName)}const rN=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function vc(t){return(!Qe(t)||!t.style.display.startsWith("inline"))&&rN.test(t.nodeName)}function An(t){if(Fe(t)&&!t.isInline())return!0;if(!N(t)||gt(t))return!1;const e=t.getFirstChild(),n=e===null||kn(e)||Y(e)||e.isInline();return!t.isInline()&&t.canBeEmpty()!==!1&&n}function Mt(){return at()}function Em(t=Mt()){return t._config.dom||ig}function ci(t,e,n=Mt()){const r=Em(n).$getDOMSlot(t,e,n);return N(t)&&(iN(r)||q(344,t.getKey(),t.getType())),r}function iN(t){return t instanceof QE}function As(t,e,n=Mt()){return zD(ci(t,e,n).element)}const lC=new WeakMap,oN=new Map;function aC(t){if(!t._readOnly&&t.isEmpty())return oN;t._readOnly||q(192);let e=lC.get(t);return e||(e=(function(n){const r=new Map;for(const[i,o]of n._nodeMap){const s=o.__type;let l=r.get(s);l||(l=new Map,r.set(s,l)),l.set(i,o)}return r})(t),lC.set(t,e)),e}function aA(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function sN(t){return(e=aA(t))[g$]=!0,e;var e}function ha(t,e){const n=t.getAttribute("data-lexical-indent");if(n!==null){const o=parseInt(n,10);if(Number.isFinite(o)&&o>=0)return void e.setIndent(o)}const r=parseInt(t.style.paddingInlineStart,10)||0,i=Math.round(r/40);e.setIndent(i)}function di(t,e){const n=e.getAttribute("dir");return n==="ltr"||n==="rtl"?t.setDirection(n):t}function go(t,e){const n=e.style.textAlign;return n&&n in jp?t.setFormat(n):t}function lN(t,e){t.__lexicalUnmanaged=!0,e&&e.captureSelection!==void 0&&(t.__lexicalCapturedSelection=e.captureSelection)}function cA(t){return t.__lexicalUnmanaged===!0}function aN(t,e=Mt()){const n=e.isEditable();t.contentEditable=n?"true":"false",n?t.__lexicalEditor=e:delete t.__lexicalEditor}function ag(t,e){let n=t;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(Qe(n)&&n.hasAttribute("data-lexical-slot")||jc(n,e)!==void 0)return!1;n=Us(n)}return!1}function bu(t,e){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(t,e)&&t[e]!==Br[e]}const cC=new WeakMap;function Gb(t){const e=cC.get(t);if(e)return e;const n=t.prototype!=null&&ck in t.prototype?t.prototype[ck]():void 0,r=(function(a){if(!(a===Br||a.prototype instanceof Br)){let c="<unknown>",u="<unknown>";try{c=a.getType()}catch{}try{Oc.version&&(u=JSON.parse(Oc.version))}catch{}q(290,a.name,c,u)}return a===Fc||a===sr||a===Br})(t),i=!r&&bu(t,"getType")?t.getType():void 0;let o,s=i;if(n)if(i)o=n[i];else{for(const[a,c]of Object.entries(n))s=a,o=c;if(!o)for(const a of Object.getOwnPropertySymbols(n)){const c=n[a];if(c){o=c;break}}}if(!r&&s&&(bu(t,"getType")||(t.getType=()=>s),bu(t,"clone")||(t.clone=a=>(Fb(a),new t)),bu(t,"importJSON")||(t.importJSON=o&&o.$importJSON||(a=>new t().updateFromJSON(a))),!bu(t,"importDOM")&&o)){const{importDOM:a}=o;a&&(t.importDOM=()=>a)}const l={klass:t,ownNodeConfig:o,ownNodeType:s};return cC.set(t,l),l}function*Kb(t){for(let e=t;e&&(e===Br||m$(e.prototype));){const n=Gb(e);yield n,e=n.ownNodeConfig&&n.ownNodeConfig.extends||fA(e)}}function uA(t){const e=Mt();return On(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t))).klass}const lt=(t,e)=>{let n=t;for(;n!=null&&!Nt(n);){if(e(n))return n;n=n.getParent()}return null};function cg(t,e){const n=[];let r=t.__first;for(;r!==null;){const i=e===null?Ge(r):e.get(r);i==null&&q(174),n.push(r),r=i.__next}return n}function fA(t){const e=Object.getPrototypeOf(t);if(typeof e=="function"&&e!==Function.prototype)return e;const n=t.prototype&&Object.getPrototypeOf(t.prototype);return n?n.constructor:null}const hA=new Map;function Do(t){return N(t)||Fe(t)}function Fl(t){return N(t)||Fe(t)}function Ln(t){const e=t.getLatest();return Fl(e)?e.__slotHost:null}function $i(t){const e=Ln(t);if(e===null)return null;const n=Ge(e);return N(n)||Fe(n)||q(370),n}function cN(t){const e=$i(t);if(e===null)return null;const n=t.getLatest().__key;for(const[r,i]of Am(e))if(i===n)return r;return null}function $m(t){let e=t.getLatest();for(;e!==null;){if(Ln(e)!==null)return e;e=e.getParent()}return null}function Am(t){const e=t.getLatest();return Do(e)&&e.__slots!==null?e.__slots:hA}function ri(t){return Array.from(Am(t).keys())}function Zl(t,e){const n=Am(t).get(e);return n===void 0?null:Ge(n)}const uN=["__proto__","constructor","prototype"],uC=Symbol("slotMapOwner");function ty(t){let e=t.__slots;return e!==null&&e[uC]===t||(e=new Map(e),e[uC]=t,t.__slots=e),e}const fC=new WeakMap,fN=[];function hN(t){for(const{ownNodeConfig:e}of Kb(t)){const n=e&&e.slots;if(n)return n}return fN}function dA(t){let e="";for(const n of ri(t)){const r=Zl(t,n);r!==null&&(e+=r.getTextContent())}return e}function hC(t,e,n){const r=n.get(t),i=n.get(e);return r!==void 0?i!==void 0?r-i:-1:i!==void 0?1:t<e?-1:t>e?1:0}function dN(t){const e=t.__slots;if(e===null||e.size<2)return;const n=(function(s){let l=fC.get(s);if(l===void 0){const a=hN(s),c=new Map;for(const u of a)uN.includes(u)&&q(371,s.name,u),c.has(u)&&q(372,s.name,u),c.set(u,c.size);l=c,fC.set(s,l)}return l})(t.constructor);let r=null,i=!0;for(const s of e.keys()){if(r!==null&&hC(r,s,n)>0){i=!1;break}r=s}if(i)return;const o=Array.from(e).sort(([s],[l])=>hC(s,l,n));e.clear();for(const[s,l]of o)e.set(s,l)}function pA(t,e,n){e!=="__proto__"&&e!=="constructor"&&e!=="prototype"||q(373,e);const r=t.getLatest();if(r.__slots!==null&&r.__slots.get(e)===n.getLatest().__key)return r;(!N(n)&&!Fe(n)||n.isInline())&&q(374,n.__key);const i=t.getWritable(),o=ty(i),s=o.get(e);s!==void 0&&gA(s);const l=n.getWritable(),a=$i(l);if(a!==null){const c=cN(l);c!==null&&ty(a.getWritable()).delete(c),l.__slotHost=null}return Mo(l),l.__slotHost=i.__key,o.set(e,l.__key),dN(i),(function(){const c=Mt();c._slotsUsed=!0,c._pendingEditorState&&(c._pendingEditorState._slotsUsed=!0)})(),i}function pN(t,e){const n=t.getWritable();if(n.__slots===null)return n;const r=n.__slots.get(e);return r!==void 0&&(gA(r),ty(n).delete(e)),n}function gA(t){const e=Ge(t);if(e===null)return;const n=e.getWritable();Fl(n)||q(377,t),n.__slotHost=null,n.remove()}const gN={next:"previous",previous:"next"};class Jb{origin;constructor(e){this.origin=e}[Symbol.iterator](){return mA({hasNext:Go,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ot(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ot(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){const i=r===this.direction?n:Array.from(n).reverse();let o=this;const s=this.getParentAtCaret(),l=new Map;for(let a=o.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const c=a.origin.getWritable();l.set(c.getKey(),c)}for(const a of i){if(l.size>0){const c=o.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||o.origin.is(a))){const u=a.getParent();u&&u.is(s)&&a.remove(),c.replace(a)}}else c===null&&q(263,Array.from(l).join(" "))}else o.insert(a);o=ot(a,this.direction)}for(const a of l.values())a.remove();return this}}class $f extends Jb{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:lr(e,this.direction)}getParentCaret(e="root"){return ot(ev(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Gs(this.direction);return ot(this.getNodeAtCaret(),e)||lr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof $f&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const mN={root:Nt,shadowRoot:gt};function Gs(t){return gN[t]}function ev(t,e="root"){return t===null||mN[e](t)?null:Ln(t)===null?t:null}class zl extends Jb{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ot(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return N(this.origin)?lr(this.origin,this.direction):null}getParentCaret(e="root"){return ot(ev(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Gs(this.direction);return ot(this.getNodeAtCaret(),e)||lr(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof zl&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof zl||e instanceof jl)&&this.direction===e.direction&&this.origin.is(e.origin)}}class jl extends Jb{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Rs(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ot(ev(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Rs(this.origin,Gs(this.direction),this.offset)}isSamePointCaret(e){return e instanceof jl&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof zl||e instanceof jl)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ot(this.origin,this.direction)}}function ii(t){return t instanceof jl}function Go(t){return t instanceof zl}function Fr(t){return t instanceof $f}const ON={next:class extends jl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends jl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},yN={next:class extends zl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends zl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},xN={next:class extends $f{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends $f{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function ot(t,e){return t?new yN[e](t):null}function Rs(t,e,n){return t?new ON[e](t,so(t,n)):null}function so(t,e,n="error"){const r=t.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(n!=="clamp"&&PE(284,String(e),String(r),t.getKey()),i=i<0?0:r),i}function dC(t,e){return new vN(t,e)}function lr(t,e){return N(t)?new xN[e](t):null}function bN(t){return t&&t.getChildCaret()||t}function Qm(t){return t&&bN(t.getAdjacentCaret())}class tv{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){const e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new tv(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const o=this[i].getLatest();return ii(o)?(function(s,l){const{direction:a,origin:c}=s,u=so(c,l==="focus"?Gs(a):a);return dC(s,u-s.offset)})(o,i):null},n=e("anchor"),r=e("focus");if(n&&r){const{caret:i}=n,{caret:o}=r;if(i.isSameNodeCaret(o))return[dC(i,o.offset-i.offset),null]}return[n,r]}iterNodeCarets(e="root"){const n=ii(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=ii(r),o=s=>s.isSameNodeCaret(r)?null:Qm(s)||s.getParentCaret(e);return mA({hasNext:s=>s!==null&&!(i&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:o(n),map:s=>s,step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class vN{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){const{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){const[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:n}}=this,[r,i]=this.getSliceIndices(),o=e.getTextContent();return Rs(e.setTextContent(o.slice(0,r)+o.slice(i)),n,r)}}function Mm(t){return Mi(t,ot(ut(),t.direction))}function _h(t){return Mi(t,t)}function Mi(t,e){return t.direction!==e.direction&&q(265),new tv(t,e,t.direction)}function mA(t){const{initial:e,hasNext:n,step:r,map:i}=t;let o=e;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const s={done:!1,value:i(o)};return o=r(o),s}}}function Af(t,e){const n=ny(t.origin,e.origin);switch(n===null&&q(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{const r=t.type==="text",i=e.type==="text";return r&&i?(function(o,s){return Math.sign(o-s)})(t.offset,e.offset):t.type===e.type?0:r?-1:i?1:t.type==="child"?-1:1}case"ancestor":return t.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return OA(n)}}function OA(t){const{a:e,b:n}=t,r=e.__key,i=n.__key;let o=e,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return o===null?1:-1}function td(t,e){return e.is(t)}function pC(t){return N(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function ny(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[r,i]=pC(t);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=pC(e);r;i=r,r=r.getParent()){const o=n.get(r);if(o!==void 0)return o===null?(td(t,r)||q(276),{commonAncestor:r,type:"ancestor"}):i===null?(td(e,r)||q(277),{commonAncestor:r,type:"descendant"}):((N(o)||td(t,o))&&(N(i)||td(e,i))&&r.is(o.getParent())&&r.is(i.getParent())||q(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function Hn(t,e){const{type:n,key:r,offset:i}=t,o=YD(t.key);return n==="text"?(Y(o)||q(266,o.getType(),r),Rs(o,e,i)):(N(o)||q(267,o.getType(),r),iy(o,t.offset,e))}function Ls(t,e){const{origin:n,direction:r}=e,i=r==="next";ii(e)?t.set(n.getKey(),e.offset,"text"):Go(e)?Y(n)?t.set(n.getKey(),so(n,r),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(Fr(e)&&N(n)||q(268),t.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Sc(t){const e=ne(),n=X(e)?e:Cm();return hp(n,t),Vt(n),n}function hp(t,e){Ls(t.anchor,e.anchor),Ls(t.focus,e.focus)}function ry(t){const{anchor:e,focus:n}=t,r=Hn(e,"next"),i=Hn(n,"next"),o=Af(r,i)<=0?"next":"previous";return Mi(Ko(r,o),Ko(i,o))}function Ks(t){const{direction:e,origin:n}=t,r=ot(n,Gs(e)).getNodeAtCaret();return r?ot(r,e):lr(n.getParentOrThrow(),e)}function gC(t,e="root"){const n=[t];for(let r=Fr(t)?t.getParentCaret(e):t.getSiblingCaret();r!==null;r=r.getParentCaret(e))n.push(Ks(r));return n}function HO(t){return!!t&&t.origin.isAttached()}function SN(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",r="next";let i=e;const o=rv(t,r),s=gC(o.anchor,n),l=gC(o.focus.getFlipped(),n),a=new Set,c=[];for(const p of o.iterNodeCarets(n))if(Fr(p))a.add(p.origin.getKey());else if(Go(p)){const{origin:g}=p;N(g)&&!a.has(g.getKey())||c.push(g)}for(const p of c)p.remove();for(const p of o.getTextSlices()){if(!p)continue;const{origin:g}=p.caret,m=g.getTextContentSize(),O=Ks(ot(g,r)),y=g.getMode();if(Math.abs(p.distance)===m&&i==="removeEmptySlices"||y==="token"&&p.distance!==0)O.remove();else if(p.distance!==0){i="removeEmptySlices";let x=p.removeTextSlice();const b=p.caret.origin;if(y==="segmented"){const S=x.origin,v=bt(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());O.replaceOrInsert(v),x=Rs(v,r,x.offset)}b.is(s[0].origin)&&(s[0]=x),b.is(l[0].origin)&&(l[0]=x.getFlipped())}}let u,f;for(const p of s)if(HO(p)){u=Wn(p);break}for(const p of l)if(HO(p)){f=Wn(p);break}const h=(function(p,g,m){if(!p||!g)return null;const O=p.getParentAtCaret(),y=g.getParentAtCaret();if(!O||!y)return null;const x=O.getParents().reverse();x.push(O);const b=y.getParents().reverse();b.push(y);const S=Math.min(x.length,b.length);let v;for(v=0;v<S&&x[v]===b[v];v++);const w=(T,M)=>{let I;for(let $=v;$<T.length;$++){const D=T[$];if(gt(D))return;!I&&M(D)&&(I=D)}return I},k=w(x,An),P=k&&w(b,T=>m.has(T.getKey())&&An(T));return P&&ri(P).length>0?null:k&&P?[k,P]:null})(u,f,a);if(h){const[p,g]=h;lr(p,"previous").splice(0,g.getChildren());let m=g.getParent();for(g.remove(!0);m&&m.isEmpty();){const O=m;m=m.getParent(),O.remove(!0)}}else if(f){const p=(function(O){if(Fr(O)){const y=O.origin;if(An(y))return y}else{const y=O.getParentAtCaret();if(y&&An(y))return y}return null})(f),g=p&&p.getParent(),m=p&&p.getParents().findLast(Ja);if(p&&g&&!Nt(g)&&p.isEmpty()&&a.has(p.getKey())&&ri(p).length===0&&(!m||a.has(m.getKey()))){p.remove(!0);let O=g;for(;O&&!Nt(O)&&O.isEmpty();){const y=O.getParent();if(y&&Nt(y)&&y.getChildrenSize()<=1)break;const x=O;O=y,x.remove(!0)}}}const d=[u,f,...s,...l].find(HO);if(d)return _h(Ko(Wn(d),t.direction));q(269,JSON.stringify(s.map(p=>p.origin.__key)))}function Wn(t){const e=(function(i){let o=i;for(;Fr(o);){const s=Qm(o);if(!Fr(s))break;o=s}return o})(t.getLatest()),{direction:n}=e;if(Y(e.origin))return ii(e)?e:Rs(e.origin,n,n);const r=e.getAdjacentCaret();return Go(r)&&Y(r.origin)?Rs(r.origin,n,Gs(n)):e}function nv(t){return ii(t)&&t.offset!==so(t.origin,t.direction)}function Ko(t,e){return t.direction===e?t:t.getFlipped()}function rv(t,e){return t.direction===e?t:Mi(Ko(t.focus,e),Ko(t.anchor,e))}function iy(t,e,n){let r=lr(t,"next");for(let i=0;i<e;i++){const o=r.getAdjacentCaret();if(o===null)break;r=o}return Ko(r,n)}function wN(t){const{origin:e,offset:n,direction:r}=t;if(n===so(e,r))return t.getSiblingCaret();if(n===so(e,Gs(r)))return Ks(t.getSiblingCaret());const[i]=e.splitText(n);return Y(i)||q(281),Ko(ot(i,"next"),r)}function kN(t,e){return!0}function yA(t,{$copyElementNode:e=Rn,$splitTextPointCaretNext:n=wN,rootMode:r="shadowRoot",$shouldSplit:i=kN,removeEmptyDestination:o=!1}={}){if(ii(t))return n(t);const s=t.getParentCaret(r);if(s){const{origin:l}=s;if(Fr(t)){const c=Ks(s);if(o&&l.isEmpty())return l.remove(),c;if(!l.canBeEmpty()||!i(l,"first"))return c}const a=(function(c){const u=[];for(let f=c.getAdjacentCaret();f;f=f.getAdjacentCaret())u.push(f.origin);return u})(t);(a.length>0||!o&&l.canBeEmpty()&&i(l,"last"))&&s.insert(e(l).splice(0,0,a))}return s}function Rm(t,e,n){let r=Ko(e,"next");ii(r)&&(r.offset===0?r=ot(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=ot(r.origin,"next"))),r.origin.is(t)&&(Go(r)||q(342,t.getKey(),t.getType()),r=Ks(r)),(t.is(r.getNodeAtCaret())||t.is(r.getFlipped().getNodeAtCaret()))&&t.remove(!0);for(let i=r;i;i=yA(i,n))r=i;return ii(r)&&q(283),r.insert(t.isInline()?He().append(t):t),Ko(ot(t.getLatest(),"next"),e.direction)}function Va(...t){return t}function CN(t,e){return[t,e]}function Lm(t,e){if(!e||t===e)return t;for(const n in e)if(t[n]!==e[n])return{...t,...e};return t}function No(...t){const e=[];for(const n of t)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))e.push(r);return e}function Ii(t,...e){const n=No(...e);n.length>0&&t.classList.add(...n)}function Im(t,...e){const n=No(...e);n.length>0&&t.classList.remove(...n)}function ln(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function mC(t,e,n){return ln(...Object.entries(e).map(([r,i])=>Ib(t,r,i,n)))}function _N(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function xA(t){const e=Mt().getElementByKey(t.getKey());if(e===null)return null;const n=e.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(e)}function bA(t){return xA(Nt(t)?t:t.getParentOrThrow())}function nd(t){const e=bA(t);return e!==null&&e.direction==="rtl"}function vA(t,e,n="self"){const r=t.getStartEndPoints();if(e.isSelected(t)&&!Dr(e)&&r!==null){const[i,o]=r,s=t.isBackward(),l=i.getNode(),a=o.getNode(),c=e.is(l),u=e.is(a);if(c||u){const[f,h]=Y0(t),d=l.is(a),p=e.is(s?a:l),g=e.is(s?l:a);let m,O=0;d?(O=f>h?h:f,m=f>h?f:h):p?(O=s?h:f,m=void 0):g&&(O=0,m=s?f:h);const y=e.__text.slice(O,m);y!==e.__text&&(n==="clone"&&(e=sN(e)),e.__text=y)}}return e}function OC(t){if(t.type==="text")return t.offset===t.getNode().getTextContentSize();const e=t.getNode();return N(e)||_N(177),t.offset===e.getChildrenSize()}function TN(t,e){const n=t.getFormatType(),r=t.getIndent();n!==e.getFormatType()&&e.setFormat(n),r!==e.getIndent()&&e.setIndent(r)}function PN(t,e,n){let r=Hn(t,n);if(nv(r))return!1;for(;r;r=r.getParentCaret()){const i=r.getParentAtCaret();if(!i||r.getNodeAtCaret())return!1;if(e.is(i))return!0}return!1}function EN(t,e,n=TN){if(!t)return;const r=t.getStartEndPoints();let i=!1,o=null;const s=new Map;if(r){const[l,a]=r,c=lt(l.getNode(),An);o=lt(a.getNode(),An);const u=t.isBackward()?"previous":"next";i=N(o)&&!o.is(c)&&(function(f,h,d){const p=f.getNode();return(!N(p)||!p.isEmpty())&&PN(f,h,d)})(a,o,Gs(u)),N(c)&&s.set(c.getKey(),c),N(o)&&!i&&s.set(o.getKey(),o)}for(const l of t.getNodes())if(N(l)&&An(l)){if(i&&l.is(o))continue;s.set(l.getKey(),l)}else if(!r){const a=lt(l,An);N(a)&&s.set(a.getKey(),a)}for(const l of s.values()){const a=e();n(l,a),l.replace(a,!0)}}function SA(t){const e=wA(t);return e!==null&&e.writingMode==="vertical-rl"}function wA(t){const e=t.anchor.getNode();return N(e)?xA(e):bA(e)}function yC(t,e){let n=SA(t)?!e:e;kA(t)&&(n=!n);const r=Hn(t.focus,n?"previous":"next");if(nv(r))return!1;if(ii(r)&&!Dl(r.origin)&&r.origin.isUnmergeable()){const i=r.getNodeAtCaret();if(Y(i)&&!Dl(i))return!0}for(const i of Mm(r)){if(Fr(i))return!i.origin.isInline();if(!N(i.origin)){if(Fe(i.origin))return!0;break}}return!1}function $N(t,e,n,r){t.modify(e?"extend":"move",n,r)}function kA(t){const e=wA(t);return e!==null&&e.direction==="rtl"}function xC(t,e,n){const r=kA(t);let i;i=SA(t)||r?!n:n,$N(t,e,i,"character")}function AN(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function CA(t,e){let n=t;for(;n!=null;){if(n instanceof e)return n;n=n.getParent()}return null}function _A(t){const e=lt(t,n=>N(n)&&!n.isInline());return N(e)||AN(4,t.__key),e}function TA(t){const e=ne()||aa();let n;if(X(e))n=Hn(e.focus,"next");else{if(e!=null){const s=e.getNodes(),l=s[s.length-1];l&&(n=ot(l,"next"))}n=n||lr(ut(),"previous").getFlipped().insert(He())}const r=Rm(t,n),i=Qm(r),o=Fr(i)?Wn(i):r;return Sc(_h(o)),t.getLatest()}function QN(t,e){const n=e();return t.replace(n),n.append(t),n}function Lo(t,e){return t!==null&&Object.getPrototypeOf(t).constructor.name===e.name}function rd(t){let e=null;if(Lo(t,DragEvent)?e=t.dataTransfer:Lo(t,ClipboardEvent)&&(e=t.clipboardData),e===null)return[!1,[],!1];const n=e.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),i]}function oy(t){const e=ne();if(!X(e))return!1;const n=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(n.has(s))continue;const l=lt(o,c=>N(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!n.has(a)&&(n.add(a),t(l))}return n.size>0}let qO=!(Ho||!cr)&&void 0;function MN(t,e=!1){let n=1;if((function(){if(qO===void 0){const r=document.createElement("div");r.style.position="absolute",r.style.opacity="0",r.style.width="100px",r.style.left="-1000px",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),qO=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return qO})()||e){const r=t&&t.ownerDocument.defaultView||window;for(;t;)n*=Number(r.getComputedStyle(t).getPropertyValue("zoom")),t=Us(t)}return n}const RN=Symbol.for("preact-signals");function Dm(){if(Vo>1)return void Vo--;let t,e=!1;for(!(function(){let n=ug;for(ug=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o})();Gu!==void 0;){let n=Gu;for(Gu=void 0,fg++;n!==void 0;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&EA(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(fg=0,Vo--,e)throw t}function PA(t){if(Vo>0)return t();sy=++LN,Vo++;try{return t()}finally{Dm()}}let ht,Gu;function bC(t){const e=ht;ht=void 0;try{return t()}finally{ht=e}}let ug,Vo=0,fg=0,LN=0,sy=0,dp=0;function vC(t){if(ht===void 0)return;let e=t.n;return e===void 0||e.t!==ht?(e={i:0,S:t,p:ht.s,n:void 0,t:ht,e:void 0,x:void 0,r:e},ht.s!==void 0&&(ht.s.n=e),ht.s=e,t.n=e,32&ht.f&&t.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ht.s,e.n=void 0,ht.s.n=e,ht.s=e),e):void 0}function Jn(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Qf(t,e){return new Jn(t,e)}function EA(t){for(let e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function SC(t){for(let e=t.s;e!==void 0;e=e.n){const n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function $A(t){let e,n=t.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):e=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}t.s=e}function ba(t,e){Jn.call(this,void 0),this.x=t,this.s=void 0,this.g=dp-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function AA(t){const e=t.m;if(t.m=void 0,typeof e=="function"){Vo++;const n=ht;ht=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,iv(t),r}finally{ht=n,Dm()}}}function iv(t){for(let e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,AA(t)}function IN(t){if(ht!==this)throw new Error("Out-of-order effect");$A(this),ht=t,this.f&=-2,8&this.f&&iv(this),Dm()}function Aa(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name}function Wc(t,e){const n=new Aa(t,e);try{n.c()}catch(i){throw n.d(),i}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Nm(t,e={}){const n={};for(const r in t){const i=e[r],o=Qf(i===void 0?t[r]:i);n[r]=o}return n}Jn.prototype.brand=RN,Jn.prototype.h=function(){return!0},Jn.prototype.S=function(t){const e=this.t;e!==t&&t.e===void 0&&(t.x=e,this.t=t,e!==void 0?e.e=t:bC(()=>{var n;(n=this.W)==null||n.call(this)}))},Jn.prototype.U=function(t){if(this.t!==void 0){const e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&bC(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Jn.prototype.subscribe=function(t){return Wc(()=>{const e=this.value,n=ht;ht=void 0;try{t(e)}finally{ht=n}},{name:"sub"})},Jn.prototype.valueOf=function(){return this.value},Jn.prototype.toString=function(){return this.value+""},Jn.prototype.toJSON=function(){return this.value},Jn.prototype.peek=function(){const t=ht;ht=void 0;try{return this.value}finally{ht=t}},Object.defineProperty(Jn.prototype,"value",{get(){const t=vC(this);return t!==void 0&&(t.i=this.i),this.v},set(t){if(t!==this.v){if(fg>100)throw new Error("Cycle detected");(function(e){Vo!==0&&fg===0&&e.l!==sy&&(e.l=sy,ug={S:e,v:e.v,i:e.i,o:ug})})(this),this.v=t,this.i++,dp++,Vo++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Dm()}}}}),ba.prototype=new Jn,ba.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===dp))return!0;if(this.g=dp,this.f|=1,this.i>0&&!EA(this))return this.f&=-2,!0;const t=ht;try{SC(this),ht=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ht=t,$A(this),this.f&=-2,!0},ba.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Jn.prototype.S.call(this,t)},ba.prototype.U=function(t){if(this.t!==void 0&&(Jn.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ba.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(ba.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const t=vC(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),Aa.prototype.c=function(){const t=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}},Aa.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,AA(this),SC(this),Vo++;const t=ht;return ht=this,IN.bind(this,t)},Aa.prototype.N=function(){2&this.f||(this.f|=2,this.u=Gu,Gu=this)},Aa.prototype.d=function(){this.f|=8,1&this.f||iv(this)},Aa.prototype.dispose=function(){this.d()};function DN(t){return(typeof t.nodes=="function"?t.nodes():t.nodes)||[]}function NN(t,e){let n;return Qf(t(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=t(),n=e(this)}})}function yt(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let QA;try{QA="0.48.0+prod.esm"}catch{}const VN=QA??'"<unknown>+source"',BN=new Set(["__proto__","constructor","prototype"]);function MA(t,e){if(t&&e&&!Array.isArray(e)&&typeof t=="object"&&typeof e=="object"){const n=t,r=e;for(const i in r)!BN.has(i)&&Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=MA(n[i],r[i]));return t}return e}const ov=0,ly=1,RA=2,YO=3,id=4,va=5,UO=6,vu=7;function GO(t){return t.id===ov}function LA(t){return t.id===RA}function FN(t){return(function(e){return e.id===ly})(t)||yt(305,String(t.id),String(ly)),Object.assign(t,{id:RA})}const ZN=new Set;let zN=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:ov}}mergeConfigs(){let e=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Lm;for(const r of this.configs)e=n(e,r);return e}init(e){const n=this.state;LA(n)||yt(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=(function(l,a,c){return Object.assign(l,{config:a,id:YO,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=o,this.extension.init&&(s=this.extension.init(e,o.config,r)),this.state=(function(l,a,c){return Object.assign(l,{id,initResult:a,registerState:c})})(o,s,i)}build(e){const n=this.state;let r;n.id!==id&&yt(307,String(n.id),String(va)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));const i={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(o,s,l){return Object.assign(o,{id:va,output:s,registerState:l})})(n,r,i)}register(e,n){this._signal=n;const r=this.state;r.id!==va&&yt(308,String(r.id),String(va));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(o){return Object.assign(o,{id:UO})})(r),()=>{const o=this.state;o.id!==vu&&yt(309,String(r.id),String(vu)),this.state=(function(s){return Object.assign(s,{id:va})})(o),i&&i()}}afterRegistration(e){const n=this.state;let r;return n.id!==UO&&yt(310,String(n.id),String(UO)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=(function(i){return Object.assign(i,{id:vu})})(n),r}getSignal(){return this._signal===void 0&&yt(311),this._signal}getInitResult(){this.extension.init===void 0&&yt(312,this.extension.name);const e=this.state;return(function(n){return n.id>=id})(e)||yt(313,String(e.id),String(id)),e.initResult}getInitPeer(e){const n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(n){return n.id>=YO})(e)||yt(314,String(e.id),String(YO)),{config:e.config}}getPeer(e){const n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){const n=this.builder.getExtensionRep(e);return n===void 0&&yt(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){const n=this.builder.getExtensionRep(e);return n===void 0&&yt(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){const e=this.state;return(function(n){return n.id>=vu})(e)||yt(316,String(e.id),String(vu)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ZN}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(n){return n.id>=va})(e)||yt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const wC={tag:Yu};function jN(){const t=ut();t.isEmpty()&&t.append(He())}const IA={config:{setOptions:wC,updateOptions:wC},init:({$initialEditorState:t=jN})=>({$initialEditorState:t,initialized:!1}),afterRegistration(t,{updateOptions:e,setOptions:n},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:o}=i;if(MD(o))t.setEditorState(o,n);else if(typeof o=="function")t.update(()=>{o(t)},e);else if(o&&(typeof o=="string"||typeof o=="object")){const s=t.parseEditorState(o);t.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[ca,hi,ua,sa,Ys]},kC=Symbol.for("@lexical/extension/LexicalBuilder");function XN(...t){return Bo.fromExtensions(t).buildEditor()}function CC(){}function WN(t){throw t}function od(t){return Array.isArray(t)?t:[t]}const KO=VN;class Bo{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=KO,this.roots=e;for(const n of e)this.addExtension(n)}static fromExtensions(e){const n=[od(IA)];for(const r of e)n.push(od(r));return new Bo(n)}static maybeFromEditor(e){const n=e[kC];return n&&(n.PACKAGE_VERSION!==KO&&yt(292,n.PACKAGE_VERSION,KO),n instanceof Bo||yt(293)),n}static fromEditor(e){const n=Bo.maybeFromEditor(e);return n===void 0&&yt(294),n}constructEditor(){const{$initialEditorState:e,onError:n,onWarn:r,...i}=this.buildCreateEditorArgs(),o=Object.assign(W$({...i,...n?{onError:s=>{n(s,o)}}:{},...r?{onWarn:s=>{r(s,o)}}:{}}),{[kC]:this});for(const s of this.sortedExtensionReps())s.build(o);return o}buildEditor(){let e=CC;function n(){try{e()}finally{e=CC}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=ln(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&yt(295,e.name),n}addEdge(e,n,r){const i=this.outgoingConfigEdges.get(e);i?i.set(n,r):this.outgoingConfigEdges.set(e,new Map([[n,r]]));const o=this.incomingEdges.get(n);o?o.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&yt(296);const n=od(e),[r]=n;typeof r.name!="string"&&yt(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&yt(298,r.name),!i){i=new zN(this,r),this.extensionNameMap.set(r.name,i);const o=this.conflicts.get(r.name);typeof o=="string"&&yt(299,r.name,o);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&yt(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const l=od(s);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[s,l]of r.peerDependencies||[])this.addEdge(r.name,s,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],n=(r,i)=>{let o=r.state;if(LA(o))return;const s=r.extension.name;var l;GO(o)||yt(300,s,i||"[unknown]"),GO(l=o)||yt(304,String(l.id),String(ov)),o=Object.assign(l,{id:ly}),r.state=o;const a=this.outgoingConfigEdges.get(s);if(a)for(const c of a.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}o=FN(o),r.state=o,e.push(r)};for(const r of this.extensionNameMap.values())GO(r.state)&&n(r);for(const r of e)for(const[i,o]of this.outgoingConfigEdges.get(r.extension.name)||[])if(o.length>0){const s=this.extensionNameMap.get(i);if(s)for(const l of o)s.configs.add(l)}for(const[r,...i]of this.roots)if(i.length>0){const o=this.extensionNameMap.get(r.name);o===void 0&&yt(301,r.name);for(const s of i)o.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const n=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],o=r.signal;for(const s of n){const l=s.register(e,o);l&&i.push(l)}for(const s of n){const l=s.afterRegistration(e);l&&i.push(l)}return ln(...i)}buildCreateEditorArgs(){const e={},n=new Set,r=new Map,i=new Map,o={},s={},l=this.sortedExtensionReps();for(const u of l){const{extension:f}=u;if(f.onError!==void 0&&(e.onError=f.onError),f.onWarn!==void 0&&(e.onWarn=f.onWarn),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const h of DN(f)){if(typeof h!="function"){const d=r.get(h.replace);d&&yt(302,f.name,h.replace.name,d.extension.name),r.set(h.replace,u)}n.add(h)}if(f.html){if(f.html.export)for(const[h,d]of f.html.export.entries())i.set(h,d);f.html.import&&Object.assign(o,f.html.import)}f.theme&&MA(s,f.theme)}Object.keys(s).length>0&&(e.theme=s),n.size&&(e.nodes=[...n]);const a=Object.keys(o).length>0,c=i.size>0;(a||c)&&(e.html={},a&&(e.html.import=o),c&&(e.html.export=i));for(const u of l)u.init(e);return e.onError||(e.onError=WN),e}}function HN(t,e){const n=Bo.fromEditor(t).getExtensionRep(e);return n===void 0&&yt(303,e.name),n.getExtensionDependency()}function da(t,e){const n=Bo.maybeFromEditor(t);if(!n)return;const r=n.extensionNameMap.get(e);return r?r.getExtensionDependency():void 0}function qN(t){return da(Mt(),t)}const DA=Pe("INSERT_HORIZONTAL_RULE_COMMAND");class pa extends Fc{static getType(){return"horizontalrule"}static clone(e){return new pa(e.__key)}static importJSON(e){return Vm().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:YN,priority:0})}}exportDOM(){return{element:Tt().createElement("hr")}}createDOM(e){const n=Tt().createElement("hr");return Ii(n,e.theme.hr),n}getTextContent(){return`
|
|
13
|
-
`}isInline(){return!1}updateDOM(){return!1}}function YN(){return{node:Vm()}}function Vm(){return uA(pa)}function NA(t){return t instanceof pa}const UN={build:(t,e)=>Nm({inheritEditableFromParent:e.inheritEditableFromParent}),config:{$getParentEditor:function(){const t=Mt();return Bo.fromEditor(t),t},inheritEditableFromParent:!1},init:(t,e,n)=>{const r=e.$getParentEditor();t.parentEditor=r,t.theme=t.theme||r._config.theme},name:"@lexical/extension/NestedEditor",register:(t,e,n)=>Wc(()=>{const r=t._parentEditor;if(r&&n.getOutput().inheritEditableFromParent.value)return t.setEditable(r.isEditable()),r.registerEditableListener(t.setEditable.bind(t))})};function GN(t){return t.canIndent()}function KN(t,e,n=GN){return ln(t.registerCommand(vm,r=>{const i=ne();if(!X(i))return!1;r.preventDefault();const o=(function(s){if(s.getNodes().filter(h=>Nl(h)&&h.canIndent()).length>0)return!0;const l=s.anchor,a=s.focus,c=a.isBefore(l)?a:l,u=c.getNode(),f=_A(u);if(f.canIndent()){const h=f.getKey();let d=Cm();if(d.anchor.set(h,0,"element"),d.focus.set(h,0,"element"),d=Ki(d),d.anchor.is(c))return!0}return!1})(i)?r.shiftKey?j0:Hp:o$;return t.dispatchCommand(o,void 0)},Ne),t.registerCommand(Hp,()=>{const r=typeof e=="number"?e:e?e.peek():null,i=ne();if(!X(i))return!1;const o=typeof n=="function"?n:n.peek();return oy(s=>{if(o(s)){const l=s.getIndent()+1;(!r||l<r)&&s.setIndent(l)}})},co))}function JN(t,e,n,r,i){if(t===null||n.size===0&&r.size===0&&!i)return 0;const o=e._selection,s=t._selection;if(i)return 1;if(!(X(o)&&X(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const l=(function(O,y,x){const b=O._nodeMap,S=[];for(const v of y){const w=b.get(v);w!==void 0&&S.push(w)}for(const[v,w]of x){if(!w)continue;const k=b.get(v);k===void 0||Nt(k)||S.push(k)}return S})(e,n,r);if(l.length===0)return 0;if(l.length>1){const O=e._nodeMap,y=O.get(o.anchor.key),x=O.get(s.anchor.key);return y&&x&&!t._nodeMap.has(y.__key)&&Y(y)&&y.__text.length===1&&o.anchor.offset===1?2:0}const a=l[0],c=t._nodeMap.get(a.__key);if(!Y(c)||!Y(a)||c.__mode!==a.__mode)return 0;const u=c.__text,f=a.__text;if(u===f)return 0;const h=o.anchor,d=s.anchor;if(h.key!==d.key||h.type!=="text")return 0;const p=h.offset,g=d.offset,m=f.length-u.length;return m===1&&g===p-1?2:m===-1&&g===p+1?3:m===-1&&g===p?4:0}function eV(t,e,n){let r=n(),i=0,o=r,s=0,l=null;return(a,c,u,f,h,d)=>{const p=n();if(d.has(S$)&&(o=r,s=i,l=a),d.has(_l))return i=0,r=p,2;d.has(Tf)&&l&&(r=o,i=s,a=l);const g=d.has(y$)||d.has(x$)?0:JN(a,c,f,h,t.isComposing()),m=(()=>{const O=u===null||u.editor===t,y=d.has(O$);if(!y&&O&&d.has(Yu))return 0;if(g===1)return 2;if(a===null)return 1;const x=c._selection;if(!(f.size>0||h.size>0))return x!==null?0:2;const b=typeof e=="number"?e:e.peek();return y===!1&&g!==0&&g===i&&p<r+b&&O||f.size===1&&(function(S,v,w){const k=v._nodeMap.get(S),P=w._nodeMap.get(S),T=v._selection,M=w._selection;return!(X(T)&&X(M)&&T.anchor.type==="element"&&T.focus.type==="element"&&M.anchor.type==="text"&&M.focus.type==="text"||!Y(k)||!Y(P)||k.__parent!==P.__parent)&&JSON.stringify(v.read(()=>k.exportJSON()))===JSON.stringify(w.read(()=>P.exportJSON()))})(Array.from(f)[0],a,c)?0:1})();return r=p,i=g,m}}function _C(t,e){t.undoStack=[],t.redoStack=[],t.current=null,e&&e(t)}function tV(t,e,n,r=Date.now,i,o=null){const s=eV(t,n,r),l=()=>{i&&i(e)};return l(),ln(t.registerCommand(Om,()=>((function(a,c,u){const f=c.redoStack,h=c.undoStack;if(h.length!==0){const d=c.current,p=h.pop();d!==null&&(f.push(d),a.dispatchCommand(vl,!0)),h.length===0&&a.dispatchCommand(Sl,!1),c.current=p||null,u&&u(c),p&&p.editor.setEditorState(p.editorState,{tag:_l})}})(t,e,i),!0),Ne),t.registerCommand(ym,()=>((function(a,c,u){const f=c.redoStack,h=c.undoStack;if(f.length!==0){const d=c.current;d!==null&&(h.push(d),a.dispatchCommand(Sl,!0));const p=f.pop();f.length===0&&a.dispatchCommand(vl,!1),c.current=p||null,u&&u(c),p&&p.editor.setEditorState(p.editorState,{tag:_l})}})(t,e,i),!0),Ne),t.registerCommand(oD,()=>(_C(e,i),!1),Ne),t.registerCommand(sD,()=>(_C(e,i),t.dispatchCommand(vl,!1),t.dispatchCommand(Sl,!1),!0),Ne),t.registerUpdateListener(({editorState:a,prevEditorState:c,dirtyLeaves:u,dirtyElements:f,tags:h})=>{const d=e.current,p=e.redoStack,g=e.undoStack,m=d===null?null:d.editorState;if(d!==null&&a===m)return;const O=s(c,a,d,u,f,h);if(O===1){if(p.length!==0&&(e.redoStack=[],t.dispatchCommand(vl,!1)),d!==null){g.push({...d});const y=typeof o=="number"||o===null?o:o.peek();y!==null&&g.length>y&&g.splice(0,g.length-y),t.dispatchCommand(Sl,!0)}}else if(O===2)return;e.current={editor:t,editorState:a},l()}))}function sv(){return{current:null,redoStack:[],undoStack:[]}}const ec={build:(t,{delay:e,createInitialHistoryState:n,disabled:r,maxDepth:i,now:o},s)=>({...Nm({delay:e,disabled:r,historyState:n(t),maxDepth:i,now:o}),...s.getInitResult()}),config:{createInitialHistoryState:sv,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now},init:()=>({canRedo:Qf(!1),canUndo:Qf(!1)}),name:"@lexical/history/History",register:(t,e,n)=>{const{canUndo:r,canRedo:i}=n.getInitResult(),o=n.getOutput(),s=l=>PA(()=>{r.value=l!=null&&l.undoStack.length>0,i.value=l!=null&&l.redoStack.length>0});return Wc(()=>{if(!o.disabled.value)return tV(t,o.historyState.value,o.delay,()=>o.now.peek()(),s,o.maxDepth);s(null)})}},nV={build:(t,{disabled:e,parentEditor:n})=>Nm({disabled:e,parentEditor:n||t._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[Va(ec,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(t,e,n)=>Wc(()=>{const{disabled:r,parentEditor:i}=n.getOutput();if(!r.value){const{output:o}=n.getDependency(ec),s=(function(a){return a?da(a,ec.name):null})(i.value);if(!s)return;const l=s.output;PA(()=>{o.delay.value=l.delay.value,o.historyState.value=l.historyState.value,o.now.value=l.now.value,o.disabled.value=l.disabled.value})}})};function Hc(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let tc;function VA(t,e){const{key:n}=e;return t&&n in t?t[n]:e.defaultValue}function BA(t){return tc&&tc.editor===t?tc:void 0}function rV(t,e){if("cfg"in e){const{cfg:n,updater:r}=e;return[n,r(VA(t,n))]}return e}function iV(t,e){let n=e;for(const r of t){const[i,o]=rV(n,r),s=i.key;if(n===e&&VA(n,i)===o)continue;const l=n===e||n===void 0?oV(e):n;l[s]=o,n=l}return n}function oV(t){return Object.create(t||null)}function FA(t,e){return[t,e]}function sV(t,e,n,r=Mt()){const i=tc,o=BA(r);try{return tc={...o,editor:r,[t]:e},n()}finally{tc=i}}function lV(t,e=()=>{}){return(n,r=Mt())=>i=>{const o=BA(r),s=o&&o[t],l=iV(n,s||e(r));return l&&l!==s?sV(t,l,i,r):i()}}function ZA(t,e,n,r){return Object.assign(vh(Symbol(e),{isEqual:r,parse:n}),{[t]:!0})}function aV(t){if(!fa(t))return;const e=t;if(e.querySelector("style")===null)return;const n=new Map;function r(i){let o=n.get(i);if(o===void 0){o=new Set;for(let s=0;s<i.style.length;s++)o.add(i.style[s]);n.set(i,o)}return o}try{for(const i of Array.from(e.styleSheets)){let o;try{o=i.cssRules}catch{continue}for(const s of Array.from(o)){if(!Lo(s,CSSStyleRule))continue;let l;try{l=e.querySelectorAll(s.selectorText)}catch{continue}for(const a of Array.from(l)){if(!Qe(a))continue;const c=r(a);for(let u=0;u<s.style.length;u++){const f=s.style[u];c.has(f)||a.style.setProperty(f,s.style.getPropertyValue(f),s.style.getPropertyPriority(f))}}}}}catch{}}const zA="@lexical/html/DOM",jA=Symbol.for("@lexical/html/DOMExportContext"),cV=Symbol.for("@lexical/html/DOMImportContext");function uV(t,e,n){return ZA(jA,t,e,n)}const fV=uV("isExport",Boolean);function hV(t){const e=da(t,zA);return e?e.output.defaults:void 0}function dV(t){const e=da(t,zA);return e?e.output.runtime:void 0}function pV(t=Mt()){const e=dV(t);return e?e.getSessionConfig():Em(t)}const gV=lV(jA,hV),Bm=Symbol.for("@lexical/html/SelectorImpl");function Mf(t,e){const n={kind:"element",predicate:(r=e,r.length===0?Qe:r.length===1?r[0]:(o,s)=>{for(const l of r)if(!l(o,s))return!1;return!0}),tags:t};var r;const i=o=>Mf(t,[...e,o]);return{[Bm]:n,attr:(o,s,l)=>i(ay(o,s,l)),classAll:(...o)=>i(WA(o)),classAny:(...o)=>i((function(s){const l=XA(s);return l.length===0?()=>!1:a=>{if(!Qe(a))return!1;const c=a.classList;for(const u of l)if(c.contains(u))return!0;return!1}})(o)),styleAny:(o,s,l)=>i((function(a,c,u){if(typeof c=="string")return f=>Qe(f)&&f.style.getPropertyValue(a)===c;if(c instanceof RegExp){const f=u&&u.capture,h=c;return(d,p)=>{if(!Qe(d))return!1;const g=d.style.getPropertyValue(a);if(!g)return!1;const m=g.match(h);return m!==null&&(f!==void 0&&(p[f]=m),!0)}}Hc(362,JSON.stringify(a))})(o,s,l))}}function XA(t){const e=[];for(const n of t)n&&e.push(n);return e}function WA(t){const e=XA(t);return e.length===0?()=>!0:n=>{if(!Qe(n))return!1;const r=n.classList;for(const i of e)if(!r.contains(i))return!1;return!0}}function ay(t,e,n){if(e===!0)return r=>Qe(r)&&r.hasAttribute(t);if(typeof e=="string")return r=>Qe(r)&&r.getAttribute(t)===e;if(e instanceof RegExp){const r=n&&n.capture,i=e;return(o,s)=>{if(!Qe(o))return!1;const l=o.getAttribute(t);if(l==null)return!1;const a=l.match(i);return a!==null&&(r!==void 0&&(s[r]=a),!0)}}Hc(361,JSON.stringify(t))}const mV={kind:"text",predicate:wr,tags:new Set},OV={[Bm]:mV},yV={kind:"comment",predicate:t=>t.nodeType===8,tags:new Set},xV={[Bm]:yV},Ba={any:()=>Mf(new Set,[]),comment:()=>xV,tag(...t){t.length>0||Hc(363);const e=new Set;for(const n of t)e.add(n.toUpperCase());return Mf(e,[])},text:()=>OV};function HA(t,e){return Qe(t)&&t.nodeName===e.toUpperCase()}const qA=/[A-Za-z0-9_-]/;let bV=class{constructor(e,n){this.source=e,this.pos=n}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){const e=this.pos;for(;!this.eof()&&qA.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){const e=this.consume();this.assert(e==='"'||e==="'","expected quote");const n=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");const r=this.source.slice(n,this.pos);return this.pos++,r.replace(/\\(.)/g,"$1")}assert(e,n){e||Hc(364,String(this.pos+1),n,this.source)}};function vV(t){const e=new Set,n=[],r=[];if(t.skipWhitespace(),t.peek()==="*")t.consume();else if(qA.test(t.peek())){const i=t.readIdent();i&&e.add(i.toUpperCase())}for(;!t.eof();){const i=t.peek();if(i==="."){t.consume();const o=t.readIdent();t.assert(o!=="",'expected class name after "."'),r.push(o)}else if(i==="#"){t.consume();const o=t.readIdent();t.assert(o!=="",'expected id after "#"'),n.push(ay("id",o))}else{if(i!=="[")break;{t.consume(),t.skipWhitespace();const o=t.readIdent();t.assert(o!=="",'expected attribute name after "["'),t.skipWhitespace();let s=!0;if(t.peek()==="="){t.consume(),t.skipWhitespace();const l=t.peek();l==='"'||l==="'"?s=t.readQuoted():(s=t.readIdent(),t.assert(s!=="","expected attribute value")),t.skipWhitespace()}t.assert(t.peek()==="]",'expected "]"'),t.consume(),n.push(ay(o,s))}}}return r.length>0&&n.push(WA(r)),{predicates:n,tags:e}}function SV(t){const e=new bV(t,0),n=[];for(;;){const i=vV(e);if(n.push(i),e.skipWhitespace(),e.eof())break;e.assert(e.peek()===",",'expected "," (selector lists are the only supported combinator)'),e.consume(),e.skipWhitespace()}if(n.length===1)return Mf(n[0].tags,n[0].predicates);const r=new Set;for(const i of n)for(const o of i.tags)r.add(o);return Mf(r,[(i,o)=>{for(const s of n){const l=i.nodeName;if(s.tags.size>0&&!s.tags.has(l))continue;let a=!0;for(const c of s.predicates)if(!c(i,o)){a=!1;break}if(a)return!0}return!1}])}function lv(t,e,n){return ZA(cV,t,e,n)}const cy=lv("textFormat",()=>0),wV=lv("textStyle",()=>({}));function kV(t){if(!Qe(t))return!1;if(t.nodeName==="PRE")return!0;const e=t.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function CV(t){if(wr(t))return!0;if(!Qe(t))return!1;const e=t.style.display;return e?e.startsWith("inline"):!vc(t)&&lg(t)}const _V=lv("whitespaceConfig",()=>({isInline:CV,preservesWhitespace:kV}));function av(t){return Nl(t)||Fe(t)&&!t.isInline()}function YA(t,e){const n=[];let r=[];const i=()=>{r.length!==0&&(n.push(e().splice(0,0,r)),r=[])};for(const o of t)if(av(o)){if(i(),N(o)){const s=YA(o.getChildren(),e);o.splice(0,o.getChildrenSize(),s)}n.push(o)}else r.push(o);return i(),n}function UA(t,e){if(!Qe(e))return t;const n=e.style.textAlign;if(!cv(n))return t;for(const r of t)Nl(r)&&r.getFormatType()===""&&r.setFormat(n);return t}function TV(t,e,n){t.length===1&&kn(t[0])&&(t=[]);const r=He();if(Qe(n)){const i=n.style.textAlign;cv(i)&&r.setFormat(i)}return[r.splice(0,0,t)]}const GA={$accepts:av,$packageRun:TV,name:"BlockSchema"},ga=Ba,PV=new Set(["center","end","justify","left","right","start"]);function cv(t){return PV.has(t)}const EV={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},$V={CODE:A6,MARK:kb},AV=new Set(["font-weight","font-style","text-decoration","vertical-align"]),QV={$import:(t,e)=>{const n=t.get(cy),r=EV[e.nodeName],i=(function(h){return{fontStyle:h.style.fontStyle,fontWeight:h.style.fontWeight,textDecoration:h.style.textDecoration,verticalAlign:h.style.verticalAlign}})(e),o=r?(s=r,{fontStyle:(l=i).fontStyle||s.fontStyle,fontWeight:l.fontWeight||s.fontWeight,textDecoration:l.textDecoration||s.textDecoration,verticalAlign:l.verticalAlign||s.verticalAlign}):i;var s,l;let a=(c=n,u=(function(h){let d=0,p=0;const{fontWeight:g,fontStyle:m,textDecoration:O,verticalAlign:y}=h;if(g==="700"||g==="bold"?d|=ok:g!=="normal"&&g!=="400"||(p|=ok),m==="italic"?d|=sk:m==="normal"&&(p|=sk),O){const x=O.split(" ");x.includes("underline")&&(d|=ak),x.includes("line-through")&&(d|=lk),x.includes("none")&&(p|=ak|lk)}return y==="sub"?(d|=RO,p|=LO):y==="super"?(d|=LO,p|=RO):y==="baseline"&&(p|=RO|LO),{clear:p,set:d}})(o),c&~u.clear|u.set);var c,u;const f=$V[e.nodeName];return f&&(a|=f),a===n?t.$importChildren(e):t.$importChildren(e,{context:[FA(cy,a)]})},match:ga.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function TC(t,e,n){let r=t;for(;;){let i=null;for(;(i=e?r.nextSibling:r.previousSibling)===null;){const s=r.parentNode;if(s===null)return null;r=s}if(r=i,!n.isInline(r))return null;let o=r;for(;(o=e?r.firstChild:r.lastChild)!==null;)r=o;if(wr(r))return r;if(r.nodeName==="BR")return null}}function PC(t,e){return e!==0&&Y(t)?t.setFormat(e):t}function EC(t,e){if(Y(t)){const n=(function(r){let i="";for(const o in r)AV.has(o)||(i+=`${o}: ${r[o]}; `);return i.trimEnd()})(e);n!==""&&t.setStyle(n)}return t}const MV={$import:(t,e)=>{const n=t.get(cy),r=t.get(wV),i=t.get(_V);if((function(l,a){let c=l.parentNode;for(;c!==null;){if(a.preservesWhitespace(c))return!0;c=c.parentNode}return!1})(e,i)){const l=Pf(e.textContent||"");for(const a of l)PC(a,n),EC(a,r);return l}const o=(function(l,a){let c=(l.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(c.length===0)return"";if(c[0]===" "){let u=l,f=!0;for(;u!==null&&(u=TC(u,!1,a))!==null;){const h=u.textContent||"";if(h.length>0){/[ \t\n]$/.test(h)&&(c=c.slice(1)),f=!1;break}}f&&(c=c.slice(1))}if(c.length>0&&c[c.length-1]===" "){let u=l,f=!0;for(;u!==null&&(u=TC(u,!0,a))!==null;)if((u.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(c=c.slice(0,-1))}return c})(e,i);if(o==="")return[];const s=bt(o);return PC(s,n),EC(s,r),[s]},match:ga.text(),name:"@lexical/html/#text"},RV={$import:()=>[],match:ga.tag("script","style"),name:"@lexical/html/script-style-ignore"},LV={$import:(t,e)=>z$(e)||j$(e)?[]:[Sr()],match:ga.tag("br"),name:"@lexical/html/br"},IV={$import:(t,e)=>{const n=He();if(go(n,e),ha(e,n),n.getFormatType()===""){const r=e.getAttribute("align");r&&cv(r)&&n.setFormat(r)}return di(n,e),[n.splice(0,0,t.$importChildren(e))]},match:ga.tag("p"),name:"@lexical/html/p"},DV={$import:(t,e,n)=>Mt().hasNode(pa)?[Vm()]:n(),match:ga.tag("hr"),name:"@lexical/html/hr"};ga.any();function NV(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;)t[r]<=e[i]?n.push(t[r++]):n.push(e[i++]);for(;r<t.length;)n.push(t[r++]);for(;i<e.length;)n.push(e[i++]);return n}function VV(t){const e=[],n=new Map,r=[],i=[],o=[],s=new Set;t.forEach((a,c)=>{const u=(function(h){const d=h[Bm];return d===void 0&&Hc(360),d})(a.match),f=a.name||(function(h,d){return h.kind==="text"?`#text@${d}`:h.kind==="comment"?`#comment@${d}`:h.tags.size===0?`*@${d}`:`${Array.from(h.tags).join(",").toLowerCase()}@${d}`})(u,c);if(a.name&&s.add(a.name),e.push({$import:a.$import,name:f,predicate:u.predicate}),u.kind==="text")i.push(c);else if(u.kind==="comment")o.push(c);else if(u.tags.size===0)r.push(c);else for(const h of u.tags){let d=n.get(h);d||(d=[],n.set(h,d)),d.push(c)}});const l=new Map;if(r.length===0)for(const[a,c]of n)l.set(a,c);else for(const[a,c]of n)l.set(a,NV(c,r));return{byTag:l,commentIndices:o,rules:e,textIndices:i,wildcardIndices:r}}function BV(t){const e=[];for(const n of t)if(FV(n))for(const r of n.rules)e.push(r);else e.push(n);return e}function FV(t){return typeof t=="object"&&t!==null&&"__type"in t&&t.__type==="CompiledOverlayRules"}function KA(t){const e=BV(t);return{__type:"CompiledOverlayRules",dispatch:VV(e),rules:e}}Ba.any();const Cn={any:Ba.any,comment:Ba.comment,css:SV,tag:Ba.tag,text:Ba.text},JA=new Set(["STYLE","SCRIPT"]);function ZV(t,e){aV(e);const n=fa(e)?e.body.childNodes:e.childNodes,r=[],i=[];for(const o of n)if(!JA.has(o.nodeName)){const s=t3(o,t,i,!1);if(s!==null)for(const l of s)r.push(l)}return(function(o){for(const s of o)s.getParent()&&s.getNextSibling()instanceof Bb&&s.insertAfter(Sr());for(const s of o){const l=s.getParent();l&&l.splice(s.getIndexWithinParent(),1,s.getChildren())}})(i),r}function zV(t,e=null,n=Mt()){return gV([FA(fV,!0)],n)(()=>{const r=ut(),i=pV(n),o=X(e)?$m(e.anchor.getNode()):null,s=t.append.bind(t);for(const l of(N(o)?o:r).getChildren())e3(n,l,s,e,i);return t})}function jV(t,e=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hc(338),ED(t),zV(Tt().createElement("div"),e,t).innerHTML}function e3(t,e,n,r=null,i=Em(t)){let o=i.$shouldInclude(e,r,t);const s=i.$shouldExclude(e,r,t);let l=e;r!==null&&Y(e)&&(l=vA(r,e,"clone"));const a=i.$exportDOM(l,t),{element:c,after:u,append:f,$getChildNodes:h}=a;if(!c)return!1;const d=Tt().createDocumentFragment(),p=h?h():N(l)?l.getChildren():[],g=o&&it(r)&&N(e)?null:r,m=d.append.bind(d);for(const O of p){const y=e3(t,O,m,g,i);!o&&y&&i.$extractWithChild(e,O,r,"html",t)&&(o=!0)}if(o&&!s){if((Qe(c)||ey(c))&&(f?f(d):c.append(d)),n(c),u){const O=u.call(l,c);O&&(ey(c)?c.replaceChildren(O):c.replaceWith(O))}}else n(d);return o}function t3(t,e,n,r,i=new Map,o){const s=[];if(JA.has(t.nodeName))return s;let l=null;const a=(function(p,g){const{nodeName:m}=p,O=g._htmlConversions.get(m.toLowerCase());let y=null;if(O!==void 0)for(const x of O){const b=x(p);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(t,e),c=a?a(t):null;let u=null;if(c!==null){u=c.after;const p=c.node;if(l=Array.isArray(p)?p[p.length-1]:p,l!==null){for(const[,g]of i)if(l=g(l,o),!l)break;l&&s.push(...Array.isArray(p)?p:[l])}c.forChild!=null&&i.set(t.nodeName,c.forChild)}const f=t.childNodes;let h=[];const d=(l==null||!gt(l))&&(l!=null&&Nl(l)||r);for(let p=0;p<f.length;p++)h.push(...t3(f[p],e,n,d,new Map(i),l));if(u!=null&&(h=u(h)),vc(t)&&(h=XV(t,h,d?()=>{const p=new Bb;return n.push(p),p}:He)),l==null)if(h.length>0)for(const p of h)s.push(p);else vc(t)&&(function(p){return p.nextSibling==null||p.previousSibling==null?!1:lg(p.nextSibling)&&lg(p.previousSibling)})(t)&&s.push(Sr());else N(l)&&l.append(...h);return s}function XV(t,e,n){const r=t.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Nl(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Nl(e[s+1])){const a=n();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function hg(t,e,n=null){const r=sA(n),i=n?iA(n):[],o=n!==null&&i.length>0;if(o&&typeof r.caretPositionFromPoint=="function"){const s=r.caretPositionFromPoint(t,e,{shadowRoots:i});if(s!==null&&(function(l,a){for(let c=l;c!==null;){if(c===a)return!0;c=Us(c)}return!1})(s.offsetNode,n))return{node:s.offsetNode,offset:s.offset}}if(o){const s=n.getRootNode();if(Uo(s)){const l=s.elementFromPoint(t,e);if(l!==null&&n.contains(l)){const a=(function(c,u,f,h){const d=h.createRange(),p=w=>u<w.top?w.top-u:u>w.bottom?u-w.bottom:0,g=w=>c<w.left?w.left-c:c>w.right?c-w.right:0,m=h.createTreeWalker(f,NodeFilter.SHOW_TEXT);let O=null,y=1/0,x=1/0;for(let w=m.nextNode();w;w=m.nextNode()){d.selectNodeContents(w);for(const k of d.getClientRects()){const P=p(k),T=g(k);(P<y||P===y&&T<x)&&(y=P,x=T,O=w)}}if(O===null)return null;let b=0,S=1/0,v=1/0;for(let w=0;w<=O.length;w++){d.setStart(O,w),d.collapse(!0);const k=d.getBoundingClientRect(),P=p(k),T=Math.abs(c-k.left);(P<S||P===S&&T<v)&&(S=P,v=T,b=w)}return{node:O,offset:b}})(t,e,l,r);if(a!==null)return a}}}if(typeof r.caretRangeFromPoint=="function"){const s=r.caretRangeFromPoint(t,e);return s===null?null:{node:s.startContainer,offset:s.startOffset}}if(typeof r.caretPositionFromPoint=="function"){const s=r.caretPositionFromPoint(t,e);return s===null?null:{node:s.offsetNode,offset:s.offset}}return null}function Fa(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const uy={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function WV(t){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(t):t}const $C=(t,e)=>{if(!X(e))return e.insertRawText(t),!0;const n=r=>{const i=ne();X(i)&&r(i)};return I$(t,{linebreak:()=>n(r=>r.insertParagraph()),tab:()=>n(r=>r.insertNodes([Sh()])),text:r=>n(i=>i.insertText(r))}),!0},fy={"application/x-lexical-editor":[(t,e,n)=>{try{const r=Mt(),i=JSON.parse(t);if(i&&i.namespace===r._config.namespace&&Array.isArray(i.nodes))return AC(r,l3(i.nodes),e),!0}catch(r){console.error(r)}return n()}],"text/html":[(t,e,n)=>{try{const r=Mt(),i=new DOMParser().parseFromString(WV(t),"text/html");return AC(r,ZV(r,i),e),!0}catch(r){return console.error(r),n()}}],"text/plain":[$C],"text/uri-list":[$C]};function HV(t,e,n,r){if(!t)return!1;const i=o=>!!t[o]&&t[o](e,n,i.bind(null,o-1),r);return i(t.length-1)}function n3(t,e,n){const r=e.getData("text/plain");for(const i of(function(o){return Object.keys(o.$importMimeType).filter(s=>o.$importMimeType[s]!==void 0).sort((s,l)=>{const a=o.priority[s],c=o.priority[l];return a===void 0&&c===void 0?s<l?-1:s>l?1:0:a===void 0?1:c===void 0?-1:a-c})})(t)){const o=e.getData(i);if(o&&(i!=="text/html"||o!==r)&&HV(t.$importMimeType[i],o,n,e))return!0}return!1}const qV={$importMimeType:fy,$insertDataTransfer:(t,e)=>n3({$importMimeType:fy,priority:uy},t,e),priority:uy},YV={build:(t,e)=>({$importMimeType:e.$importMimeType,$insertDataTransfer:(n,r)=>n3(e,n,r),priority:e.priority}),config:{$importMimeType:fy,priority:uy},mergeConfig(t,e){const n=Lm(t,e);if(e.$importMimeType){const r={...t.$importMimeType};for(const[i,o]of Object.entries(e.$importMimeType))if(o){const s=r[i];r[i]=s?[...s,...o]:o}n.$importMimeType=r}return e.priority&&(n.priority={...t.priority,...e.priority}),n},name:"@lexical/clipboard/Import"};function r3(t,e=ne()){return e==null&&Fa(166),X(e)&&e.isCollapsed()||e.getNodes().length===0?"":jV(t,e)}function i3(t,e=ne()){return e==null&&Fa(166),X(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(s3(t,e))}function hy(t,e,n){(function(){const r=qN(YV.name);return r?r.output:qV})().$insertDataTransfer(t,e)}const o3="application/x-lexical-drag";function UV(t,e){const n={editorKey:e.getKey()};t.setData(o3,JSON.stringify(n))}function GV(t,e,n){const r=t.dataTransfer;if(r===null)return!1;const i=(function(c){const u=c.getData(o3);if(!u)return null;let f;try{f=JSON.parse(u)}catch{return null}return(h=f)!==null&&typeof h=="object"&&"editorKey"in h&&typeof h.editorKey=="string"?f:null;var h})(r);if(i===null)return!1;const o=(function(c,u){const f=hg(c.clientX,c.clientY,u.getRootElement());if(f===null)return null;const h=Li(f.node);if(h===null)return null;if(Y(h))return Rs(h,"next",f.offset);if(N(h))return iy(h,f.offset,"next");const d=h.getParent();return d===null?null:iy(d,h.getIndexWithinParent()+1,"next")})(t,e);if(o===null)return!1;const s=yA(o);if(s===null)return!1;const l=i.editorKey===e.getKey(),a=ne();if(l){if(!X(a)||a.isCollapsed())return!1;if((function(c,u){const{anchor:f,focus:h}=rv(ry(u),"next");return Af(f,c)<0&&Af(c,h)<0})(o,a))return t.preventDefault(),!0;a.removeText()}if(!s.origin.isAttached())return t.preventDefault(),!0;if(n(r,Sc(_h(s)),e),!l){const c=e.getRootElement(),u=c?c.ownerDocument:null,f=u?(function(h,d){for(const p of oA(d)){const g=zc(p);if(Ch(g)&&g.getKey()===h&&Qe(p))return p}return null})(i.editorKey,u):null;f!==null&&f.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return t.preventDefault(),!0}function KV(t,e){return GV(t,e,hy)}function AC(t,e,n){t.dispatchCommand(tD,{nodes:e,selection:n})||(n.insertNodes(e),(function(r){if(X(r)&&r.isCollapsed()){const i=r.anchor;let o=null;const s=Hn(i,"previous");if(s)if(ii(s))o=s.origin;else{const l=Mi(s,lr(ut(),"next").getFlipped());for(const a of l){if(Y(a.origin)){o=a.origin;break}if(N(a.origin)&&!a.origin.isInline())break}}if(o&&Y(o)){const l=o.getFormat(),a=o.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(n))}function dy(t,e,n,r=[]){let i=e===null||n.isSelected(e);const o=N(n)&&n.excludeFromCopy("html");let s=n;e!==null&&Y(s)&&(s=vA(e,s,"clone"));const l=N(s)?s.getChildren():[],a=(function(u){const f=u.exportJSON(),h=u.constructor;if(f.type!==h.getType()&&Fa(58,h.name),N(u)){const d=f.children;Array.isArray(d)||Fa(59,h.name)}return f})(s);Y(s)&&s.getTextContentSize()===0&&(i=!1);const c=i&&it(e)&&N(n)?null:e;for(let u=0;u<l.length;u++){const f=l[u],h=dy(t,c,f,a.children);!i&&N(n)&&h&&n.extractWithChild(f,e,"clone")&&(i=!0)}if(i&&!o){const u=ri(s);if(u.length>0){const f={};for(const h of u){const d=Zl(s,h);d===null&&Fa(366,s.constructor.name,h);const p=[];dy(t,null,d,p),p.length===1&&p[0].type===d.getType()||Fa(385,h,s.constructor.name,String(p.length),String(p.length>0?p[0].type:"none")),f[h]=p[0]}a.$slots=f}}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const f=a.children[u];r.push(f)}return i}function s3(t,e){const n=[],r=ut(),i=X(e)?e.anchor.getNode():it(e)?e.getNodes()[0]??null:null,o=i!==null?$m(i):null,s=(N(o)?o:r).getChildren();for(let l=0;l<s.length;l++)dy(t,e,s[l],n);return{namespace:t._config.namespace,nodes:n}}function l3(t){const e=[];for(const n of t)e.push(AD(n));return e}let Sa=null;async function QC(t,e,n){if(Sa!==null)return!1;if(e!==null)return new Promise((c,u)=>{t.update(()=>{c(MC(t,e,n))})});const r=t.getRootElement(),i=t._window||window,o=i.document,s=ur(i);if(r===null||s===null)return!1;const l=o.createElement("span");l.style.position="fixed",l.style.top="-1000px",l.append(o.createTextNode("#")),r.append(l);const a=o.createRange();return a.setStart(l,0),a.setEnd(l,1),s.removeAllRanges(),s.addRange(a),new Promise((c,u)=>{const f=t.registerCommand(Sm,h=>(Lo(h,ClipboardEvent)&&(f(),Sa!==null&&(i.clearTimeout(Sa),Sa=null),c(MC(t,h,n))),!0),co);Sa=i.setTimeout(()=>{f(),Sa=null,c(!1)},50),o.execCommand("copy"),l.remove()})}function MC(t,e,n){if(n===void 0){const i=ur(t._window),o=ne();if(!o||o.isCollapsed()||!i)return!1;const s=ai(i,t.getRootElement()),l=s.anchorNode,a=s.focusNode;if(l!==null&&a!==null&&!kh(t,l,a))return!1;n=a3(o)}e.preventDefault();const r=e.clipboardData;return r!==null&&(c3(r,n),!0)}const JV=[["text/html",r3],["application/x-lexical-editor",i3]];function a3(t=ne()){return(function(e,n){const r={"text/plain":""};for(const[i,o]of Object.entries(e))if(o){const s=tB(o,n);s!==null&&(r[i]=s)}return r})(eB(),t)}function c3(t,e){for(const[n]of JV)e[n]===void 0&&t.setData(n,"");for(const n in e){const r=e[n];r!==void 0&&t.setData(n,r)}}function eB(t=Mt()){const e=da(t,nB.name);return e?e.output:u3}const u3={"application/x-lexical-editor":[(t,e)=>t?i3(Mt(),t):e()],"text/html":[(t,e)=>t?r3(Mt(),t):e()],"text/plain":[(t,e)=>t?t.getTextContent():e()]};function tB(t,e){const n=r=>t[r]?t[r](e,n.bind(null,r-1)):null;return n(t.length-1)}const nB={build:(t,e,n)=>e.$exportMimeType,config:{$exportMimeType:u3},mergeConfig(t,e){const n=Lm(t,e);if(e.$exportMimeType){const r={...t.$exportMimeType};for(const[i,o]of Object.entries(e.$exportMimeType))if(o){const s=r[i];r[i]=s?[...s,...o]:o}n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"},rB={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},dg=Symbol.for("@lexical/dragon/WindowState");function iB(t,e,n){const r=(function(i){let o=i[dg];return o===void 0&&(o={dispose:()=>{},editors:new Map,installs:new Set},i[dg]=o),o})(t);if(r.installs.size===0){const i=lB.bind(t);t.addEventListener("message",i,!0),r.dispose=()=>{t.removeEventListener("message",i,!0)}}if(r.installs.add(e),n){const i=r.editors.get(n)||new Set;i.add(e),r.editors.set(n,i)}return oB.bind(null,t,r,e,n)}function oB(t,e,n,r){if(r){const i=e.editors.get(r);i&&i.delete(n)&&i.size===0&&e.editors.delete(r)}e.installs.delete(n)&&e.installs.size===0&&(e.dispose(),delete t[dg])}function RC(t){return t&&t.ownerDocument.defaultView}function sB(t){const e=NN(()=>RC(t.getRootElement()),n=>t.registerRootListener(r=>{n.value=RC(r)}));return Wc(()=>{const n=e.value;if(n)return iB(n,Symbol("@lexical/dragon/editorInstall"),t)})}function lB(t){if(t.origin!==this.location.origin)return;const e=(function(r){const i=r[dg];if(i===void 0)return null;const o=zc(bc(r.document));return Ch(o)&&i.editors.has(o)?o:null})(this);if(e===null)return;const n=t.data;if(typeof n=="string"){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol==="nuanria_messaging"&&r.type==="request"){const i=r.payload;if(i&&i.functionId==="makeChanges"){const o=i.args;if(Array.isArray(o)){const[s,l,a,c,u,f]=o;if(![s,l,c,u].every(Number.isFinite)||typeof a!="string"&&a!==-1)return;e.update(()=>{const h=ne();if(X(h)){const d=h.anchor;let p=d.getNode(),g=0,m=0;if(Y(p)&&s>=0&&l>=0&&(g=s,m=s+l,h.setTextNodeRange(p,g,p,m)),typeof a!="string"||g===m&&a===""||(h.insertRawText(a),p=d.getNode()),Y(p)){const O=p.getTextContentSize();g=Math.min(Math.max(c,0),O),m=c<0||u<0?g:Math.min(c+u,O),h.setTextNodeRange(p,g,p,m)}if(typeof f=="string"&&u>0&&!h.isCollapsed()){const O=rB[f];O!==void 0&&h.formatText(O)}t.stopImmediatePropagation()}})}}}}}const aB={$import:(t,e)=>{const n=Ri(e.nodeName.toLowerCase());return ha(e,n),go(n,e),di(n,e),[n.splice(0,0,t.$importChildren(e))]},match:Cn.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},cB={$import:(t,e)=>{const n=ma();return go(n,e),ha(e,n),di(n,e),[n.splice(0,0,t.$importChildren(e))]},match:Cn.tag("blockquote"),name:"@lexical/rich-text/blockquote"};Cn.tag("blockquote");Cn.tag("p"),Cn.tag("span");const LC=Pe("DRAG_DROP_PASTE_FILE"),JO=vh("shadowRoot",{parse:Boolean});let Fm=class f3 extends sr{static getType(){return"quote"}static clone(e){return new f3(e.__key)}$config(){return this.config("quote",{extends:sr,stateConfigs:[{flat:!0,stateConfig:JO}]})}isShadowRoot(){return pm(this,JO)}setIsShadowRoot(e){return Ha(this,JO,e)}createDOM(e){const n=Tt().createElement("blockquote");return Ii(n,e.theme.quote),n}updateDOM(e,n){return!1}static importDOM(){return{blockquote:e=>({conversion:uB,priority:0})}}exportDOM(e){const{element:n}=super.exportDOM(e);if(Qe(n)){this.isEmpty()&&n.append(Tt().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const i=this.getDirection();i&&(n.dir=i)}return{element:n}}static importJSON(e){return ma().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,n){const r=He(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(const n of this.getChildren())this.insertBefore(n);return this.remove(),!0}const e=He();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function ma(t){const e=zr(new Fm);return t&&t.shadowRoot?e.setIsShadowRoot(!0):e}function py(t){return t instanceof Fm}let Th=class h3 extends sr{__tag;static getType(){return"heading"}static clone(e){return new h3(e.__tag,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){const n=this.getWritable();return n.__tag=e,n}createDOM(e){const n=this.__tag,r=Tt().createElement(n),i=e.theme.heading;if(i!==void 0){const o=i[n];Ii(r,o)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:wa,priority:0}),h2:e=>({conversion:wa,priority:0}),h3:e=>({conversion:wa,priority:0}),h4:e=>({conversion:wa,priority:0}),h5:e=>({conversion:wa,priority:0}),h6:e=>({conversion:wa,priority:0}),p:e=>{const n=e.firstChild;return n!==null&&IC(n)?{conversion:()=>({node:null}),priority:3}:null},span:e=>IC(e)?{conversion:n=>({node:Ri("h1")}),priority:3}:null}}exportDOM(e){const{element:n}=super.exportDOM(e);if(Qe(n)){this.isEmpty()&&n.append(Tt().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const i=this.getDirection();i&&(n.dir=i)}return{element:n}}static importJSON(e){return Ri(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),o=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?He():Ri(this.getTag()),s=this.getDirection();if(o.setDirection(s),this.insertAfter(o,n),r===0&&!this.isEmpty()&&e){const l=He();l.select(),this.replace(l,!0)}return o}collapseAtStart(){if(this.isEmpty()){const e=He();this.getChildren().forEach(n=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}};function IC(t){return t.nodeName.toLowerCase()==="span"&&t.style.fontSize==="26pt"}function wa(t){const e=t.nodeName.toLowerCase();let n=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(n=Ri(e),ha(t,n),go(n,t),di(n,t)),{node:n}}function uB(t){const e=ma();return go(e,t),ha(t,e),di(e,t),{node:e}}function Ri(t="h1"){return zr(new Th(t))}function Zm(t){return t instanceof Th}function DC(t){const e=Li(t);return Fe(e)}function ka(t,e,n,r){let i=!1,o=null;if(t.isCollapsed()&&t.anchor.type==="text"){const l=t.anchor.getNode();if(Y(l)){o=l;const a=t.anchor.offset,c=a===l.getTextContentSize()&&l.getNextSibling()===null,u=a===0&&l.getPreviousSibling()===null;i=n==="end"&&c||n==="start"&&u||n==="both"&&(c||u)}}let s=!1;for(const[l,a]of Object.entries(r)){if(a==null||!a[e])continue;const c=l;if(a.onlyAtBoundary){if(!(i&&o&&Y(o)&&o.hasFormat(c)))continue;s=!0}t.hasFormat(c)&&t.toggleFormat(c)}s&&t.setStyle("")}const fB={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function sd(t,e){return(function(n,r){if(!n.isCollapsed())return!1;const i=Hn(n.focus,r),o=lt(i.origin,Ja);if(!o)return!1;const s=n.focus.getNode();if(!o.is(s)&&!xc(s,o))return!1;const l=Mi(i,ot(o,r));if(l.getTextSlices().some(f=>f&&f.getTextContentSize()>0))return!1;const a=Mi(l.anchor.getSiblingCaret(),l.focus);let c=a.anchor.origin;for(const f of a){if(!Go(f)||!f.origin.is(c.getParent()))return!1;c=f.origin}let u=o;for(const f of Mm(ot(o,r))){if(!f.origin.is(u.getParent())){if(fp(f.origin)){const h=ot(u,r);return Sc(Mi(h,h)),!0}break}if(!Ja(f.origin))break;u=f.origin}return!1})(t,e)||(function(n,r){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;const i=Hn(n.anchor,r).getNodeAtCaret();return!(!Ja(i)||i.isInline()||(Sc(_h(Wn(lr(i,r)))),0))})(t,e)}function NC(t){return Fe(t)&&!t.isInline()&&!t.isIsolated()&&t.isKeyboardSelectable()}function ld(t){const e=Vl();e.add(t),Vt(e)}function VC(t,e){if(!t.isCollapsed())return!1;const n=t.focus,r=n.getNode(),i=e?"previous":"next",o=Hn(n,i);if(n.type==="element"&&N(r)&&(Nt(r)||Ja(r))){const O=o.getNodeAtCaret();return!(O===null||!NC(O))&&(ld(O.__key),!0)}const s=lt(N(r)?r:r.getParentOrThrow(),O=>N(O)&&!O.isInline()&>(O.getParent()));if(s===null)return!1;const l=ot(s,i).getNodeAtCaret();if(l===null||!NC(l))return!1;if(s.getTextContentSize()===0)return ld(l.__key),!0;const a=Mt().getRootElement();if(a===null)return!1;const c=ur(a.ownerDocument.defaultView);if(c===null||c.rangeCount===0)return!1;const u=c.anchorNode,f=c.anchorOffset,h=c.focusNode,d=c.focusOffset;c.modify("move",e?"backward":"forward","line");const p=c.anchorNode,g=c.anchorOffset;if(p===null)return BC(c,u,f,h,d),!1;const m=Li(p);return BC(c,u,f,h,d),m===null?!1:(p===u&&g===f||!m.is(s)&&!xc(m,s))&&(ld(l.__key),!0)}function BC(t,e,n,r,i){e!==null&&r!==null&&t.setBaseAndExtent(e,n,r,i)}function FC(t,e){if(!t.isCollapsed())return!1;const n=t.focus.getNode(),r=lt(N(n)?n:n.getParentOrThrow(),m=>N(m)&&!m.isInline());if(r===null)return!1;const i=Mt(),o=i.getRootElement();if(o===null)return!1;const s=o.ownerDocument.defaultView;if(s===null)return!1;let l=!1;for(const m of r.getChildren())if(N(m)&&m.isInline()){const O=i.getElementByKey(m.getKey());if(O!==null){const y=s.getComputedStyle(O).display;if(y==="inline-grid"||y==="inline-flex"){l=!0;break}}}if(!l)return!1;const a=ot(r,e?"previous":"next").getNodeAtCaret();if(a===null||!N(a)){if(e){const m=r.getFirstDescendant();Y(m)?m.select(0,0):r.select(0,0)}else{const m=r.getLastDescendant();if(Y(m)){const O=m.getTextContentSize();m.select(O,O)}else{const O=r.getChildrenSize();r.select(O,O)}}return!0}const c=i.getElementByKey(a.getKey());if(c===null)return!1;const u=ur(s);if(u===null||u.rangeCount===0)return!1;const f=u.getRangeAt(0).cloneRange();f.collapse(!0);const h=f.getBoundingClientRect(),d=c.getBoundingClientRect(),p=d.top+d.height/2;if(h.height>0){const m=hg(h.left,p,o);if(m!==null&&c.contains(m.node)){const O=o.ownerDocument.createRange();return O.setStart(m.node,m.offset),O.collapse(!0),t.applyDOMRange(O),t.dirty=!0,!0}}const g=e?a.getLastDescendant():a.getFirstDescendant();if(Y(g)){const m=e?g.getTextContentSize():0;g.select(m,m)}else{const m=a.getChildrenSize();a.select(e?m:0,e?m:0)}return!0}function ad(t,e){const n=ot(t,e),r=n.getAdjacentCaret();r!==null&&N(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Sc(_h(n)):e==="next"?t.selectNext(0,0):t.selectPrevious()}function ZC(t,e,n){n.preventDefault(),n.stopPropagation();const r=t.getNodes();if(r.length===0)return!0;const i=r.map(a=>ot(a,"next")).sort(Af),o=(e?i[0]:i[i.length-1]).origin,s=lt(o,a=>a!==o&&N(a)&&!a.isInline())??ut(),l=e?0:s.getChildrenSize();return s.select(l,l),!0}function hB(t,e=Qf(fB)){return ln(t.registerCommand(Pb,()=>{const n=ne();return it(n)?(n.clear(),!0):(X(n)&&ka(n,"click","both",e.peek()),!1)},Ne),t.registerCommand(Cl,n=>{const r=ne();return X(r)?(r.deleteCharacter(n),!0):!!it(r)&&(r.deleteNodes(),!0)},Ne),t.registerCommand(kf,n=>{const r=ne();return!!X(r)&&(r.deleteWord(n),!0)},Ne),t.registerCommand(Cf,n=>{const r=ne();return!!X(r)&&(r.deleteLine(n),!0)},Ne),t.registerCommand(Ya,n=>{const r=ne();if(typeof n=="string")r!==null&&r.insertText(n);else{if(r===null)return!1;const i=n.dataTransfer;if(i!=null)hy(i,r);else if(X(r)){const o=n.data;return o&&r.insertText(o),!0}}return!0},Ne),t.registerCommand(sp,()=>{const n=ne();return!!X(n)&&(n.removeText(),!0)},Ne),t.registerCommand(Qo,n=>{const r=ne();return!(!X(r)&&!it(r))&&(T$(r,n),!0)},Ne),t.registerCommand(nD,n=>{const r=ne();return!(!X(r)&&!it(r))&&(CD(r,n),!0)},Ne),t.registerCommand(rD,n=>{const r=ne();if(!X(r)&&!it(r))return!1;const i=r.getNodes();for(const o of i){const s=lt(o,l=>N(l)&&!l.isInline());s!==null&&s.setFormat(n)}return!0},Ne),t.registerCommand(qa,n=>{const r=ne();return!!X(r)&&(r.insertLineBreak(n),!0)},Ne),t.registerCommand(wf,()=>{const n=ne();return!!X(n)&&(n.insertParagraph(),!0)},Ne),t.registerCommand(o$,()=>{const n=Sh(),r=ne();return X(r)&&(n.setFormat(r.format),n.setStyle(r.style)),_m([n]),!0},Ne),t.registerCommand(Hp,()=>oy(n=>{const r=n.getIndent();n.setIndent(r+1)}),Ne),t.registerCommand(j0,()=>oy(n=>{const r=n.getIndent();r>0&&n.setIndent(Math.max(0,r-1))}),Ne),t.registerCommand($b,n=>{const r=ne();if(it(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),ad(i[0],"previous"),!0}else if(X(r)&&(!n.shiftKey&&sd(r,"previous")||!n.shiftKey&&VC(r,!0)||!n.shiftKey&&FC(r,!0)))return n.preventDefault(),!0;return!1},Ne),t.registerCommand(Ab,n=>{const r=ne();if(it(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),ad(i[0],"next"),!0}else if(X(r)&&((function(i){const o=i.focus;return o.key==="root"&&o.offset===ut().getChildrenSize()})(r)||!n.shiftKey&&sd(r,"next")||!n.shiftKey&&VC(r,!1)||!n.shiftKey&&FC(r,!1)))return n.preventDefault(),!0;return!1},Ne),t.registerCommand(Eb,n=>{const r=ne();if(it(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),ad(i[0],nd(i[0])?"next":"previous"),!0}if(!X(r))return!1;if(!n.shiftKey&&sd(r,nd(r.anchor.getNode())?"next":"previous"))return n.preventDefault(),!0;if(n.shiftKey||ka(r,"arrow","start",e.peek()),yC(r,!0)){const i=n.shiftKey;return n.preventDefault(),xC(r,i,!0),!0}return!1},Ne),t.registerCommand(t$,n=>{const r=ne();if(it(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),ad(i[0],nd(i[0])?"previous":"next"),!0}if(!X(r))return!1;if(!n.shiftKey&&sd(r,nd(r.anchor.getNode())?"previous":"next"))return n.preventDefault(),!0;if(n.shiftKey||ka(r,"arrow","end",e.peek()),yC(r,!1)){const i=n.shiftKey;return n.preventDefault(),xC(r,i,!1),!0}return!1},Ne),t.registerCommand(Mb,n=>{const r=ne();if(!it(r)&&DC(n.target))return!1;if(X(r)){if((function(i){if(!i.isCollapsed())return!1;const{anchor:o}=i;if(o.offset!==0)return!1;const s=o.getNode();if(Nt(s))return!1;const l=_A(s);return l.getIndent()>0&&(l.is(s)||s.is(l.getFirstDescendant()))})(r))return n.preventDefault(),t.dispatchCommand(j0,void 0);if(Ms&&pc)return!1}else if(!it(r))return!1;return n.preventDefault(),t.dispatchCommand(Cl,!0)},Ne),t.registerCommand(i$,n=>{const r=ne();return!(!it(r)&&DC(n.target))&&!(!X(r)&&!it(r))&&(n.preventDefault(),t.dispatchCommand(Cl,!1))},Ne),t.registerCommand(gc,n=>{let r=ne();if(it(r)){const i=r.getNodes();i.length===1&&Fe(i[0])&&!i[0].isInline()&&(r=i[0].selectNext())}if(!X(r))return!1;if(ka(r,"enter","both",e.peek()),n!==null){if((Ms||xh||bh)&&pc)return!1;if(n.preventDefault(),n.shiftKey)return t.dispatchCommand(qa,!1)}return t.dispatchCommand(wf,void 0)},Ne),t.registerCommand(bm,()=>{const n=ne();return!!X(n)&&(t.blur(),!0)},Ne),t.registerCommand(s$,n=>{const[,r]=rd(n);if(r.length>0){const i=n.clientX,o=n.clientY,s=hg(i,o,t.getRootElement());if(s!==null){const{offset:l,node:a}=s,c=Li(a);if(c!==null){const u=Cm();if(Y(c))u.anchor.set(c.getKey(),l,"text"),u.focus.set(c.getKey(),l,"text");else{const h=c.getParentOrThrow().getKey(),d=c.getIndexWithinParent()+1;u.anchor.set(h,d,"element"),u.focus.set(h,d,"element")}const f=Ki(u);Vt(f)}t.dispatchCommand(LC,r)}return n.preventDefault(),!0}return KV(n,t)},Ne),t.registerCommand(l$,n=>{const[r]=rd(n),i=ne();return!(r&&!X(i))&&(X(i)&&!i.isCollapsed()&&n.dataTransfer!==null&&(c3(n.dataTransfer,a3(i)),UV(n.dataTransfer,t)),!0)},Ne),t.registerCommand(a$,n=>{const[r]=rd(n),i=ne();if(r&&!X(i))return!1;const o=n.clientX,s=n.clientY,l=hg(o,s,t.getRootElement());if(l!==null){const a=Li(l.node);Fe(a)&&n.preventDefault()}return!0},Ne),t.registerCommand(c$,()=>{const n=ne();return XD(X(n)&&$m(n.anchor.getNode())!==null?n:null),!0},Ne),t.registerCommand(Sm,n=>(QC(t,Lo(n,ClipboardEvent)?n:null),!0),Ne),t.registerCommand(Rb,n=>((async function(r,i){await QC(i,Lo(r,ClipboardEvent)?r:null),i.update(()=>{const o=ne();X(o)?o.removeText():it(o)&&o.getNodes().forEach(s=>s.remove())},{tag:x$})})(n,t),!0),Ne),t.registerCommand(mm,n=>{const[,r,i]=rd(n);return r.length>0&&!i?(t.dispatchCommand(LC,r),!0):Xc(n.target)&&zb(n.target)?!1:ne()!==null&&((function(o,s){o.preventDefault(),s.update(()=>{const l=ne(),a=Lo(o,InputEvent)||Lo(o,KeyboardEvent)?null:o.clipboardData;a!=null&&l!==null&&hy(a,l)},{tag:y$})})(n,t),!0)},Ne),t.registerCommand(Qb,()=>{const n=ne();return X(n)&&ka(n,"space","both",e.peek()),!1},Ne),t.registerCommand(vm,()=>{const n=ne();return X(n)&&ka(n,"tab","both",e.peek()),!1},Ne),t.registerCommand(n$,n=>{const r=ne();if(it(r))return ZC(r,!1,n);if(!X(r))return!1;const{anchor:i}=r;if(i.type!=="element"||i.offset!==0)return!1;const o=i.getNode();if(!N(o))return!1;const s=o.getFirstChild();if(!Fe(s)||!s.isInline())return!1;const l=o.getKey(),a=o.selectEnd();return n.shiftKey&&a.anchor.set(l,0,"element"),n.preventDefault(),n.stopPropagation(),!0},Ne),t.registerCommand(r$,n=>{const r=ne();if(it(r))return ZC(r,!0,n);if(!X(r))return!1;const{anchor:i,focus:o}=r,s=lt(o.getNode(),c=>N(c)&&!c.isInline());if(s===null)return!1;const l=s.getFirstChild();if(!Fe(l)||!l.isInline()||lt(i.getNode(),c=>N(c)&&!c.isInline())!==s)return!1;const a=s.getKey();return(o.type!=="element"||o.key!==a||o.offset!==0)&&(r.focus.set(a,0,"element"),n.shiftKey||r.anchor.set(a,0,"element"),n.preventDefault(),n.stopPropagation(),!0)},Ne))}function qn(t,e,n,r){const i=t.length;let o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function qr(t,e){return t.length>0?(qn(t,t.length,0,e),t):e}const qi=Js(/[A-Za-z]/),Ai=Js(/[\dA-Za-z]/),dB=Js(/[#-'*+\--9=?A-Z^-~]/);function gy(t){return t!==null&&(t<32||t===127)}const my=Js(/\d/),pB=Js(/[\dA-Fa-f]/),gB=Js(/[!-/:-@[-`{-~]/);function Ce(t){return t!==null&&t<-2}function It(t){return t!==null&&(t<0||t===32)}function je(t){return t===-2||t===-1||t===32}const mB=Js(new RegExp("\\p{P}|\\p{S}","u")),_o=Js(/\s/);function Js(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Is(t){if(t===null||It(t)||_o(t))return 1;if(mB(t))return 2}function Ph(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}function OB(t){let n={}.singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let a=-1;for(;++a<s.length;)if(s[a][0]==="enter"&&s[a][1].type==="strikethroughSequenceTemporary"&&s[a][1]._close){let c=a;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[a][1].end.offset-s[a][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[a][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[a][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[a][1].start)},h=[["enter",u,l],["enter",s[c][1],l],["exit",s[c][1],l],["enter",f,l]],d=l.parser.constructs.insideSpan.null;d&&qn(h,h.length,0,Ph(d,s.slice(c+1,a),l)),qn(h,h.length,0,[["exit",f,l],["enter",s[a][1],l],["exit",s[a][1],l],["exit",u,l]]),qn(s,c-1,a-c+3,h),a=c+h.length-2;break}}for(a=-1;++a<s.length;)s[a][1].type==="strikethroughSequenceTemporary"&&(s[a][1].type="data");return s}function o(s,l,a){const c=this.previous,u=this.events;let f=0;return h;function h(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?a(p):(s.enter("strikethroughSequenceTemporary"),d(p))}function d(p){const g=Is(c);if(p===126)return f>1?a(p):(s.consume(p),f++,d);if(f<2&&!n)return a(p);const m=s.exit("strikethroughSequenceTemporary"),O=Is(p);return m._open=!O||O===2&&!!g,m._close=!g||g===2&&!!O,l(p)}}}const yB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];d3.peek=wB;function xB(){return{canContainEols:["delete"],enter:{strikethrough:vB},exit:{strikethrough:SB}}}function bB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yB}],handlers:{delete:d3}}}function vB(t){this.enter({type:"delete",children:[]},t)}function SB(t){this.exit(t)}function d3(t,e,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function wB(){return"~"}p3.peek=EB;var kB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],CB={canContainEols:["highlight"],enter:{highlight:_B},exit:{highlight:TB}};function _B(t){this.enter({type:"highlight",children:[]},t)}function TB(t){this.exit(t)}var PB={unsafe:[{character:"=",inConstruct:"phrasing",notInConstruct:kB}],handlers:{highlight:p3}};function p3(t,e,n,r){const o=n.createTracker(r),s=n.enter("highlight");let l=o.move("==");return l+=o.move(n.containerPhrasing(t,{before:l,after:"=",...o.current()})),l+=o.move("=="),s(),l}function EB(){return"="}function zC(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}const $B=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],jC={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function g3(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function AB(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function QB(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function XC(t){return QB(t)||g3(t)}const WC=document.createElement("i");function Rf(t){const e="&"+t+";";WC.innerHTML=e;const n=WC.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}const MB=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function RB(t,e){const n=e||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let o=0,s=-1,l="",a,c;n.position&&("start"in n.position||"indent"in n.position?(c=n.position.indent,a=n.position.start):a=n.position);let u=(a?a.line:0)||1,f=(a?a.column:0)||1,h=p(),d;for(o--;++o<=t.length;)if(d===10&&(f=(c?c[s]:0)||1),d=t.charCodeAt(o),d===38){const O=t.charCodeAt(o+1);if(O===9||O===10||O===12||O===32||O===38||O===60||Number.isNaN(O)||r&&O===r){l+=String.fromCharCode(d),f++;continue}const y=o+1;let x=y,b=y,S;if(O===35){b=++x;const $=t.charCodeAt(b);$===88||$===120?(S="hexadecimal",b=++x):S="decimal"}else S="named";let v="",w="",k="";const P=S==="named"?XC:S==="decimal"?g3:AB;for(b--;++b<=t.length;){const $=t.charCodeAt(b);if(!P($))break;k+=String.fromCharCode($),S==="named"&&$B.includes(k)&&(v=k,w=Rf(k))}let T=t.charCodeAt(b)===59;if(T){b++;const $=S==="named"?Rf(k):!1;$&&(v=k,w=$)}let M=1+b-y,I="";if(!(!T&&n.nonTerminated===!1))if(!k)S!=="named"&&g(4,M);else if(S==="named"){if(T&&!w)g(5,1);else if(v!==k&&(b=x+v.length,M=1+b-x,T=!1),!T){const $=v?1:3;if(n.attribute){const D=t.charCodeAt(b);D===61?(g($,M),w=""):XC(D)?w="":g($,M)}else g($,M)}I=w}else{T||g(2,M);let $=Number.parseInt(k,S==="hexadecimal"?16:10);if(LB($))g(7,M),I="�";else if($ in jC)g(6,M),I=jC[$];else{let D="";IB($)&&g(6,M),$>65535&&($-=65536,D+=String.fromCharCode($>>>10|55296),$=56320|$&1023),I=D+String.fromCharCode($)}}if(I){m(),h=p(),o=b-1,f+=b-y+1,i.push(I);const $=p();$.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,I,{start:h,end:$},t.slice(y-1,b)),h=$}else k=t.slice(y-1,b),l+=k,f+=k.length,o=b-1}else d===10&&(u++,s++,f=0),Number.isNaN(d)?m():(l+=String.fromCharCode(d),f++);return i.join("");function p(){return{line:u,column:f,offset:o+((a?a.offset:0)||0)}}function g(O,y){let x;n.warning&&(x=p(),x.column+=y,x.offset+=y,n.warning.call(n.warningContext||void 0,MB[O],x,O))}function m(){l&&(i.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:h,end:p()}),l="")}}function LB(t){return t>=55296&&t<=57343||t>1114111}function IB(t){return t>=1&&t<=8||t===11||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534}const DB=/["&'<>`]/g,NB=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,VB=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,BB=/[|\\{}()[\]^$+*?.]/g,HC=new WeakMap;function FB(t,e){if(t=t.replace(e.subset?ZB(e.subset):DB,r),e.subset||e.escapeOnly)return t;return t.replace(NB,n).replace(VB,r);function n(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function r(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function ZB(t){let e=HC.get(t);return e||(e=zB(t),HC.set(t,e)),e}function zB(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(BB,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function jB(t){return"&#x"+t.toString(16).toUpperCase()+";"}function XB(t,e){return FB(t,Object.assign({format:jB},e))}function Io(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?qC(t.position):"start"in t||"end"in t?qC(t):"line"in t||"column"in t?Oy(t):""}function Oy(t){return YC(t&&t.line)+":"+YC(t&&t.column)}function qC(t){return Oy(t&&t.start)+"-"+Oy(t&&t.end)}function YC(t){return t&&typeof t=="number"?t:1}class vt extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Io(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const m3=" ";function WB(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:h,mdxJsxFlowTagAttributeValueLiteral:t,mdxJsxFlowTagAttributeValueExpression:t,mdxJsxFlowTagSelfClosingMarker:s,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:h,mdxJsxTextTagAttributeValueLiteral:t,mdxJsxTextTagAttributeValueExpression:t,mdxJsxTextTagSelfClosingMarker:s},exit:{mdxJsxFlowTagClosingMarker:l,mdxJsxFlowTagNamePrimary:a,mdxJsxFlowTagNameMember:c,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:d,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:p,mdxJsxFlowTagAttributeNameLocal:g,mdxJsxFlowTagAttributeValueLiteral:m,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:O,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:y,mdxJsxFlowTag:x,mdxJsxTextTagClosingMarker:l,mdxJsxTextTagNamePrimary:a,mdxJsxTextTagNameMember:c,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:d,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:p,mdxJsxTextTagAttributeNameLocal:g,mdxJsxTextTagAttributeValueLiteral:m,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:O,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:y,mdxJsxTextTag:x}};function t(){this.buffer()}function e(w){return{line:w.line,column:w.column,offset:w.offset}}function n(w){this.config.enter.data.call(this,w),this.config.exit.data.call(this,w)}function r(w){const k={name:void 0,attributes:[],close:!1,selfClosing:!1,start:w.start,end:w.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=k,this.buffer()}function i(w){if(this.data.mdxJsxTagStack.length===0)throw new vt("Unexpected closing slash `/` in tag, expected an open tag first",{start:w.start,end:w.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function o(w){if(this.data.mdxJsxTag.close)throw new vt("Unexpected attribute in closing tag, expected the end of the tag",{start:w.start,end:w.end},"mdast-util-mdx-jsx:unexpected-attribute")}function s(w){if(this.data.mdxJsxTag.close)throw new vt("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:w.start,end:w.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function l(){const w=this.data.mdxJsxTag;w.close=!0}function a(w){const k=this.data.mdxJsxTag;k.name=this.sliceSerialize(w)}function c(w){const k=this.data.mdxJsxTag;k.name+="."+this.sliceSerialize(w)}function u(w){const k=this.data.mdxJsxTag;k.name+=":"+this.sliceSerialize(w)}function f(w){const k=this.data.mdxJsxTag;o.call(this,w),k.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:e(w.start),end:void 0}})}function h(w){const k=this.data.mdxJsxTag;o.call(this,w),k.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:e(w.start),end:void 0}}),this.buffer()}function d(w){const k=this.data.mdxJsxTag,P=k.attributes[k.attributes.length-1];P.type;const T=w.estree;P.value=this.resume(),P.position,P.position.end=e(w.end),T&&(P.data={estree:T})}function p(w){const k=this.data.mdxJsxTag,P=k.attributes[k.attributes.length-1];P.type,P.name=this.sliceSerialize(w),P.position,P.position.end=e(w.end)}function g(w){const k=this.data.mdxJsxTag,P=k.attributes[k.attributes.length-1];P.type,P.name+=":"+this.sliceSerialize(w),P.position,P.position.end=e(w.end)}function m(w){const k=this.data.mdxJsxTag,P=k.attributes[k.attributes.length-1];P.value=RB(this.resume(),{nonTerminated:!1}),P.position,P.position.end=e(w.end)}function O(w){const k=this.data.mdxJsxTag,P=k.attributes[k.attributes.length-1];P.type;const T={type:"mdxJsxAttributeValueExpression",value:this.resume()},M=w.estree;M&&(T.data={estree:M}),P.value=T,P.position,P.position.end=e(w.end)}function y(){const w=this.data.mdxJsxTag;w.selfClosing=!0}function x(w){const k=this.data.mdxJsxTag,P=this.data.mdxJsxTagStack,T=P[P.length-1];if(k.close&&T.name!==k.name)throw new vt("Unexpected closing tag `"+v(k)+"`, expected corresponding closing tag for `"+v(T)+"` ("+Io(T)+")",{start:w.start,end:w.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),k.close?P.pop():this.enter({type:w.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:k.name||null,attributes:k.attributes,children:[]},w,b),k.selfClosing||k.close?this.exit(w,S):P.push(k)}function b(w,k){const P=this.data.mdxJsxTagStack,T=P[P.length-1],M=w?" before the end of `"+w.type+"`":"",I=w?{start:w.start,end:w.end}:void 0;throw new vt("Expected a closing tag for `"+v(T)+"` ("+Io({start:k.start,end:k.end})+")"+M,I,"mdast-util-mdx-jsx:end-tag-mismatch")}function S(w,k){const P=this.data.mdxJsxTag;throw new vt("Expected the closing tag `"+v(P)+"` either after the end of `"+k.type+"` ("+Io(k.end)+") or another opening tag after the start of `"+k.type+"` ("+Io(k.start)+")",{start:w.start,end:w.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function v(w){return"<"+(w.close?"/":"")+(w.name||"")+">"}}function HB(t){const e={},n=e.quote||'"',r=e.quoteSmart||!1,i=e.tightSelfClosing||!1,o=e.printWidth||Number.POSITIVE_INFINITY,s=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return l.peek=YB,{handlers:{mdxJsxFlowElement:l,mdxJsxTextElement:l},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function l(a,c,u,f){const h=a.type==="mdxJsxFlowElement",d=a.name?!a.children||a.children.length===0:!1,p=O3(u),g=y3(p),m=u.createTracker(f),O=u.createTracker(f),y=[],x=(h?g:"")+"<"+(a.name||""),b=u.enter(a.type);if(m.move(x),O.move(x),a.attributes&&a.attributes.length>0){if(!a.name)throw new Error("Cannot serialize fragment w/ attributes");let P=-1;for(;++P<a.attributes.length;){const T=a.attributes[P];let M;if(T.type==="mdxJsxExpressionAttribute")M="{"+(T.value||"")+"}";else{if(!T.name)throw new Error("Cannot serialize attribute w/o name");const I=T.value,$=T.name;let D="";if(I!=null)if(typeof I=="object")D="{"+(I.value||"")+"}";else{const Z=r&&zC(I,n)>zC(I,s)?s:n;D=Z+XB(I,{subset:[Z]})+Z}M=$+(D?"=":"")+D}y.push(M)}}let S=!1;const v=y.join(" ");h&&(/\r?\n|\r/.test(v)||m.current().now.column+v.length+(d?i?2:3:1)>o)&&(S=!0);let w=m,k=x;if(S){w=O;let P=-1;for(;++P<y.length;)y[P]=g+m3+y[P];k+=w.move(`
|
|
14
|
-
`+y.join(`
|
|
15
|
-
`)+`
|
|
16
|
-
`+g)}else v&&(k+=w.move(" "+v));return d&&(k+=w.move((i||S?"":" ")+"/")),k+=w.move(">"),a.children&&a.children.length>0&&(a.type==="mdxJsxTextElement"?k+=w.move(u.containerPhrasing(a,{...w.current(),before:">",after:"<"})):(w.shift(2),k+=w.move(`
|
|
17
|
-
`),k+=w.move(qB(a,u,w.current())),k+=w.move(`
|
|
18
|
-
`))),d||(k+=w.move((h?g:"")+"</"+(a.name||"")+">")),b(),k}}function qB(t,e,n){const r=e.indexStack,i=t.children,o=e.createTracker(n),s=y3(O3(e)),l=[];let a=-1;for(r.push(-1);++a<i.length;){const c=i[a];r[r.length-1]=a;const u={before:`
|
|
19
|
-
`,after:`
|
|
20
|
-
`,...o.current()},f=e.handle(c,t,e,u),h=c.type==="mdxJsxFlowElement"?f:e.indentLines(f,function(d,p,g){return(g?"":s)+d});l.push(o.move(h)),c.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&l.push(o.move(`
|
|
21
|
-
|
|
22
|
-
`))}return r.pop(),l.join("")}function O3(t){let e=0,n=t.stack.length;for(;--n>-1;){const r=t.stack[n];if(r==="blockquote"||r==="listItem")break;r==="mdxJsxFlowElement"&&e++}return e}function y3(t){return m3.repeat(t)}function YB(){return"<"}var UC=Object.prototype.hasOwnProperty;function GC(t,e,n){for(n of t.keys())if(Ku(n,e))return n}function Ku(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Ku(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=GC(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=GC(e,i),!i)||!Ku(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(UC.call(t,n)&&++r&&!UC.call(e,n)||!(n in e)||!Ku(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var UB={};let yy,x3,b3,v3,S3=!0;typeof process<"u"&&({FORCE_COLOR:yy,NODE_DISABLE_COLORS:x3,NO_COLOR:b3,TERM:v3}=UB||{},S3=process.stdout&&process.stdout.isTTY);const Ke={enabled:!x3&&b3==null&&v3!=="dumb"&&(yy!=null&&yy!=="0"||S3),reset:Pt(0,0),bold:Pt(1,22),dim:Pt(2,22),italic:Pt(3,23),underline:Pt(4,24),inverse:Pt(7,27),hidden:Pt(8,28),strikethrough:Pt(9,29),black:Pt(30,39),red:Pt(31,39),green:Pt(32,39),yellow:Pt(33,39),blue:Pt(34,39),magenta:Pt(35,39),cyan:Pt(36,39),white:Pt(37,39),gray:Pt(90,39),grey:Pt(90,39),bgBlack:Pt(40,49),bgRed:Pt(41,49),bgGreen:Pt(42,49),bgYellow:Pt(43,49),bgBlue:Pt(44,49),bgMagenta:Pt(45,49),bgCyan:Pt(46,49),bgWhite:Pt(47,49)};function KC(t,e){let n=0,r,i="",o="";for(;n<t.length;n++)r=t[n],i+=r.open,o+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return i+e+o}function GB(t,e){let n={has:t,keys:e};return n.reset=Ke.reset.bind(n),n.bold=Ke.bold.bind(n),n.dim=Ke.dim.bind(n),n.italic=Ke.italic.bind(n),n.underline=Ke.underline.bind(n),n.inverse=Ke.inverse.bind(n),n.hidden=Ke.hidden.bind(n),n.strikethrough=Ke.strikethrough.bind(n),n.black=Ke.black.bind(n),n.red=Ke.red.bind(n),n.green=Ke.green.bind(n),n.yellow=Ke.yellow.bind(n),n.blue=Ke.blue.bind(n),n.magenta=Ke.magenta.bind(n),n.cyan=Ke.cyan.bind(n),n.white=Ke.white.bind(n),n.gray=Ke.gray.bind(n),n.grey=Ke.grey.bind(n),n.bgBlack=Ke.bgBlack.bind(n),n.bgRed=Ke.bgRed.bind(n),n.bgGreen=Ke.bgGreen.bind(n),n.bgYellow=Ke.bgYellow.bind(n),n.bgBlue=Ke.bgBlue.bind(n),n.bgMagenta=Ke.bgMagenta.bind(n),n.bgCyan=Ke.bgCyan.bind(n),n.bgWhite=Ke.bgWhite.bind(n),n}function Pt(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:Ke.enabled?KC(this.keys,r+""):r+""):r===void 0?GB([t],[n]):Ke.enabled?KC([n],r+""):r+""}}function el(){}el.prototype={diff:function(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.callback;typeof i=="function"&&(o=i,i={}),this.options=i;var s=this;function l(b){return o?(setTimeout(function(){o(void 0,b)},0),!0):b}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var a=n.length,c=e.length,u=1,f=a+c;i.maxEditLength&&(f=Math.min(f,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,d=Date.now()+h,p=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(p[0],n,e,0);if(p[0].oldPos+1>=c&&g+1>=a)return l([{value:this.join(n),count:n.length}]);var m=-1/0,O=1/0;function y(){for(var b=Math.max(m,-u);b<=Math.min(O,u);b+=2){var S=void 0,v=p[b-1],w=p[b+1];v&&(p[b-1]=void 0);var k=!1;if(w){var P=w.oldPos-b;k=w&&0<=P&&P<a}var T=v&&v.oldPos+1<c;if(!k&&!T){p[b]=void 0;continue}if(!T||k&&v.oldPos+1<w.oldPos?S=s.addToPath(w,!0,void 0,0):S=s.addToPath(v,void 0,!0,1),g=s.extractCommon(S,n,e,b),S.oldPos+1>=c&&g+1>=a)return l(KB(s,S.lastComponent,n,e,s.useLongestToken));p[b]=S,S.oldPos+1>=c&&(O=Math.min(O,b-1)),g+1>=a&&(m=Math.max(m,b+1))}u++}if(o)(function b(){setTimeout(function(){if(u>f||Date.now()>d)return o();y()||b()},0)})();else for(;u<=f&&Date.now()<=d;){var x=y();if(x)return x}},addToPath:function(e,n,r,i){var o=e.lastComponent;return o&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}},extractCommon:function(e,n,r,i){for(var o=n.length,s=r.length,l=e.oldPos,a=l-i,c=0;a+1<o&&l+1<s&&this.equals(n[a+1],r[l+1]);)a++,l++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=l,a},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function KB(t,e,n,r,i){for(var o=[],s;e;)o.push(e),s=e.previousComponent,delete e.previousComponent,e=s;o.reverse();for(var l=0,a=o.length,c=0,u=0;l<a;l++){var f=o[l];if(f.removed){if(f.value=t.join(r.slice(u,u+f.count)),u+=f.count,l&&o[l-1].added){var d=o[l-1];o[l-1]=o[l],o[l]=d}}else{if(!f.added&&i){var h=n.slice(c,c+f.count);h=h.map(function(g,m){var O=r[u+m];return O.length>g.length?O:g}),f.value=t.join(h)}else f.value=t.join(n.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}var p=o[a-1];return a>1&&typeof p.value=="string"&&(p.added||p.removed)&&t.equals("",p.value)&&(o[a-2].value+=p.value,o.pop()),o}var JC=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,e_=/\S/,w3=new el;w3.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!e_.test(t)&&!e_.test(e)};w3.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&JC.test(e[n])&&JC.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var k3=new el;k3.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
23
|
-
`));var e=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),e.push(i))}return e};var JB=new el;JB.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var eF=new el;eF.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function pp(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pp=function(e){return typeof e}:pp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pp(t)}var tF=Object.prototype.toString,Lf=new el;Lf.useLongestToken=!0;Lf.tokenize=k3.tokenize;Lf.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,i=r===void 0?function(o,s){return typeof s>"u"?n:s}:r;return typeof t=="string"?t:JSON.stringify(xy(t,null,null,i),i," ")};Lf.equals=function(t,e){return el.prototype.equals.call(Lf,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function xy(t,e,n,r,i){e=e||[],n=n||[],r&&(t=r(i,t));var o;for(o=0;o<e.length;o+=1)if(e[o]===t)return n[o];var s;if(tF.call(t)==="[object Array]"){for(e.push(t),s=new Array(t.length),n.push(s),o=0;o<t.length;o+=1)s[o]=xy(t[o],e,n,r,i);return e.pop(),n.pop(),s}if(t&&t.toJSON&&(t=t.toJSON()),pp(t)==="object"&&t!==null){e.push(t),s={},n.push(s);var l=[],a;for(a in t)t.hasOwnProperty(a)&&l.push(a);for(l.sort(),o=0;o<l.length;o+=1)a=l[o],s[a]=xy(t[a],e,n,r,a);e.pop(),n.pop()}else s=t;return s}var by=new el;by.tokenize=function(t){return t.slice()};by.join=by.removeEmpty=function(t){return t};Ke.red,Ke.grey,Ke.green;Ke.dim().italic;Ke.dim("→");Ke.dim("·");Ke.dim("↵");function pg(t){t=t.replace(/\r?\n/g,`
|
|
24
|
-
`);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(e||[]).length;for(;n<i;n++)r=Math.min(r,e[n].length);return i&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class nF extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function oi(t,e,n,r,i,o,s){if(t)return;let l=s||o;if(s instanceof Error)throw s;let a=i;throw new nF({actual:e,expects:n,operator:r,message:l,details:a,generated:!s})}function rF(t,e){oi(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function Jo(t,e){oi(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}Jo.ok=Jo;Jo.equal=function(t,e,n){oi(!Ku(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};Jo.type=function(t,e,n){let r=typeof t;oi(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};Jo.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";oi(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};Jo.snapshot=function(t,e,n){t=pg(t),e=pg(e),oi(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};Jo.fixture=function(t,e,n){t=pg(t),e=pg(e),oi(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};Jo.match=function(t,e,n){typeof e=="string"?oi(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):oi(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};Jo.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?oi(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?oi(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||oi(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const Su={equalsTo:61},t_={attentionSideAfter:2},n_={data:"data",characterEscape:"characterEscape"};var wu="highlightSequenceTemporary",r_="highlightSequence",iF="highlight",oF="highlightText";function sF(){const t={name:"highlight",tokenize:n,resolveAll:e};return{text:{[Su.equalsTo]:t},insideSpan:{null:[t]},attentionMarkers:{null:[Su.equalsTo]}};function e(r,i){let o=-1;for(;++o<r.length;)if(r[o][0]==="enter"&&r[o][1].type===wu&&r[o][1]._close){let s=o;for(;s--;)if(r[s][0]==="exit"&&r[s][1].type===wu&&r[s][1]._open&&r[o][1].end.offset-r[o][1].start.offset===r[s][1].end.offset-r[s][1].start.offset){r[o][1].type=r_,r[s][1].type=r_;const l={type:iF,start:Object.assign({},r[s][1].start),end:Object.assign({},r[o][1].end)},a={type:oF,start:Object.assign({},r[s][1].end),end:Object.assign({},r[o][1].start)},c=[["enter",l,i],["enter",r[s][1],i],["exit",r[s][1],i],["enter",a,i]],u=i.parser.constructs.insideSpan.null;u&&qn(c,c.length,0,Ph(u,r.slice(s+1,o),i)),qn(c,c.length,0,[["exit",a,i],["enter",r[o][1],i],["exit",r[o][1],i],["exit",l,i]]),qn(r,s-1,o-s+3,c),o=s+c.length-2;break}}for(o=-1;++o<r.length;)r[o][1].type===wu&&(r[o][1].type=n_.data);return r}function n(r,i,o){const s=this.previous,l=this.events;let a=0;return c;function c(f){return rF(f===Su.equalsTo,"expected `=`"),s===Su.equalsTo&&l[l.length-1][1].type!==n_.characterEscape?o(f):(r.enter(wu),u(f))}function u(f){const h=Is(s);if(f===Su.equalsTo)return a>1?o(f):(r.consume(f),a++,u);if(a<2)return o(f);const d=r.exit(wu),p=Is(f);return d._open=!p||p===t_.attentionSideAfter&&!!h,d._close=!h||h===t_.attentionSideAfter&&!!p,i(f)}}}const lF=/[$_\p{ID_Start}]/u,aF=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,cF=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,uF={};function xi(t){return t?lF.test(String.fromCodePoint(t)):!1}function ku(t,e){const r=(e||uF).jsx?cF:aF;return t?r.test(String.fromCodePoint(t)):!1}function et(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(a){return je(a)?(t.enter(n),l(a)):e(a)}function l(a){return je(a)&&o++<i?(t.consume(a),l):(t.exit(n),e(a))}}const fF={}.hasOwnProperty,hF=Symbol("continue"),e1=Symbol("exit"),dF=Symbol("skip");function pF(t,e){let n,r;typeof e=="function"?n=e:e&&typeof e=="object"&&(e.enter&&(n=e.enter),e.leave&&(r=e.leave)),i(t,void 0,void 0,[])();function i(o,s,l,a){return t1(o)&&(c.displayName="node ("+o.type+")"),c;function c(){const u=n?i_(n(o,s,l,a)):[];if(u[0]===e1)return u;if(u[0]!==dF){let f;for(f in o)if(fF.call(o,f)&&o[f]&&typeof o[f]=="object"&&f!=="data"&&f!=="position"){const h=a.concat(o),d=o[f];if(Array.isArray(d)){const p=d;let g=0;for(;g>-1&&g<p.length;){const m=p[g];if(t1(m)){const O=i(m,f,g,h)();if(O[0]===e1)return O;g=typeof O[1]=="number"?O[1]:g+1}else g++}}else if(t1(d)){const p=i(d,f,void 0,h)();if(p[0]===e1)return p}}}return r?i_(r(o,s,l,a)):u}}}function i_(t){return Array.isArray(t)?t:typeof t=="number"?[hF,t]:[t]}function t1(t){return!!(t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.length>0)}function gF(t,e){const n=e.prefix||"",r=e.suffix||"",i=Object.assign({},e.acornOptions),o=[],s=[],l=i.onComment,a=i.onToken;let c=!1,u,f;const h=Object.assign({},i,{onComment:o,preserveParens:!0});a&&(h.onToken=s);const d=mF(t,e.tokenTypes),p=d.value,g=n+p+r,m=o_(p);if(m&&!e.allowEmpty)throw new vt("Unexpected empty expression",{place:y(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{u=e.expression&&!m?e.acorn.parseExpressionAt(g,0,h):e.acorn.parse(g,h)}catch(x){const b=x,S=y(b.pos);b.message=String(b.message).replace(/ \(\d+:\d+\)$/,""),b.pos=S.offset,b.loc={line:S.line,column:S.column-1},f=b,c=b.raisedAt>=n.length+p.length||b.message==="Unterminated comment"}if(u&&e.expression&&!m)if(o_(g.slice(u.end,g.length-r.length)))u={type:"Program",start:0,end:n.length+p.length,body:[{type:"ExpressionStatement",expression:u,start:0,end:n.length+p.length}],sourceType:"module",comments:[]};else{const x=y(u.end),b=new Error("Unexpected content after expression");b.pos=x.offset,b.loc={line:x.line,column:x.column-1},f=b,u=void 0}if(u){if(u.comments=o,pF(u,function(x,b,S,v){let w=v[v.length-1],k=b;x.type==="ParenthesizedExpression"&&w&&k&&(typeof S=="number"&&(w=w[k],k=S),w[k]=x.expression),O(x)}),Array.isArray(l))l.push(...o);else if(typeof l=="function")for(const x of o)l(x.type==="Block",x.value,x.start,x.end,x.loc.start,x.loc.end);for(const x of s)x.end<=n.length||x.start-n.length>=p.length||(O(x),Array.isArray(a)?a.push(x):a(x))}return{estree:u,error:f,swallow:c};function O(x){const b=y(x.start),S=y(x.end);x.start=b.offset,x.end=S.offset,x.loc={start:{line:b.line,column:b.column-1,offset:b.offset},end:{line:S.line,column:S.column-1,offset:S.offset}},x.range=[x.start,x.end]}function y(x){let b=x-n.length;b<0?b=0:b>p.length&&(b=p.length);let S=OF(d.stops,b);return S||(S={line:e.start.line,column:e.start.column,offset:e.start.offset}),S}}function o_(t){return/^\s*$/.test(t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function mF(t,e){const n={value:"",stops:[]};let r=-1;for(;++r<t.length;){const i=t[r];if(i[0]==="enter"){const o=i[1].type;if(o==="lineEnding"||e.includes(o)){const s=i[2].sliceStream(i[1]);for(;s.length>0&&s[0]===-1;)s.shift();const l=yF(s);n.stops.push([n.value.length,i[1].start]),n.value+=l,n.stops.push([n.value.length,i[1].end])}}}return n}function OF(t,e){let n=0;for(;n<t.length&&t[n][0]<=e;)n+=1;if(n===0)return;const[r,i]=t[n-1],o=e-r;return{line:i.line,column:i.column+o,offset:i.offset+o}}function yF(t){let e=-1;const n=[];let r;for(;++e<t.length;){const i=t[e];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
|
|
25
|
-
`;break}case-3:{o=`\r
|
|
26
|
-
`;break}case-2:{o=" ";break}case-1:{if(r)continue;o=" ";break}default:o=String.fromCharCode(i)}r=i===-2,n.push(o)}return n.join("")}function n1(t){const e=t||{},n=e.loc||{},r=e.range||[void 0,void 0],i=s_(n.start,r[0]||e.start),o=s_(n.end,r[1]||e.end);if(i&&o)return{start:i,end:o}}function s_(t,e){if(t&&typeof t=="object"){const n="line"in t?r1(t.line):void 0,r="column"in t?r1(t.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:r1(e)}}}function r1(t){return typeof t=="number"&&t>-1?t:void 0}const xF=2,Za="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",bF="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",vF="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",l_="#unexpected-type-in-code-expected-an-object-spread-spread",SF="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",wF="#could-not-parse-expression-with-acorn";function a_(t,e,n,r,i,o,s,l,a,c,u){const f=this,h=this.events.length+3;let d=0,p,g;return m;function m(b){return t.enter(n),t.enter(r),t.consume(b),t.exit(r),p=f.now(),O}function O(b){if(b===null){if(g)throw g;const S=new vt("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:f.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw S.url=Za+bF,S}if(Ce(b))return t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),x;if(b===125&&d===0){const S=o?kF.call(f,o,s,i,h,p,c||!1,a||!1):{type:"ok",estree:void 0};if(S.type==="ok"){t.enter(r),t.consume(b),t.exit(r);const v=t.exit(n);return l&&S.estree&&Object.assign(v,{estree:S.estree}),e}return g=S.message,t.enter(i),t.consume(b),y}return t.enter(i),y(b)}function y(b){return b===125&&d===0||b===null||Ce(b)?(t.exit(i),O(b)):(b===123&&!o?d+=1:b===125&&(d-=1),t.consume(b),y)}function x(b){const S=f.now();if(S.line!==p.line&&!u&&f.parser.lazy[S.line]){const v=new vt("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:f.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw v.url=Za+vF,v}return je(b)?et(t,O,"linePrefix",xF+1)(b):O(b)}}function kF(t,e,n,r,i,o,s){const l=gF(this.events.slice(r),{acorn:t,tokenTypes:[n],acornOptions:e,start:i,expression:!0,allowEmpty:o,prefix:s?"({":"",suffix:s?"})":""}),a=l.estree;if(s&&a){const c=a.body[0];if(c.type!=="ExpressionStatement"||c.expression.type!=="ObjectExpression"){const u=n1(c),f=new vt("Unexpected `"+c.type+"` in code: expected an object spread (`{...spread}`)",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=Za+l_,f}if(c.expression.properties[1]){const u=n1(c.expression.properties[1]),f=new vt("Unexpected extra content in spread: only a single spread is supported",{place:u.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw f.url=Za+SF,f}if(c.expression.properties[0]&&c.expression.properties[0].type!=="SpreadElement"){const u=n1(c.expression.properties[0]),f=new vt("Unexpected `"+c.expression.properties[0].type+"` in code: only spread elements are supported",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=Za+l_,f}}if(l.error){const c=new vt("Could not parse expression with acorn",{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return c.url=Za+wF,{type:"nok",message:c}}return{type:"ok",estree:a}}const c_="https://github.com/micromark/micromark-extension-mdx-jsx";function C3(t,e,n,r,i,o,s,l,a,c,u,f,h,d,p,g,m,O,y,x,b,S,v,w,k,P,T,M,I,$,D,Z){const G=this;let z,ee;return oe;function oe(E){return t.enter(l),t.enter(a),t.consume(E),t.exit(a),Q}function Q(E){return It(E)?n(E):(z=ve,ft(E))}function ve(E){if(E===47)return t.enter(c),t.consume(E),t.exit(c),z=_e,ft;if(E===62)return _r(E);if(E!==null&&E>=0&&xi(E))return t.enter(f),t.enter(h),t.consume(E),L;re(E,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(E===33?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function _e(E){if(E===62)return _r(E);if(E!==null&&E>=0&&xi(E))return t.enter(f),t.enter(h),t.consume(E),L;re(E,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(E===42||E===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function L(E){if(E!==null&&E>=0&&ku(E,{jsx:!0}))return t.consume(E),L;if(E===46||E===47||E===58||E===62||E===123||It(E)||_o(E))return t.exit(h),z=Ie,ft(E);re(E,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(E===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function Ie(E){if(E===46)return t.enter(d),t.consume(E),t.exit(d),z=Be,ft;if(E===58)return t.enter(g),t.consume(E),t.exit(g),z=J,ft;if(E===47||E===62||E===123||E!==null&&E>=0&&xi(E))return t.exit(f),Ae(E);re(E,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Be(E){if(E!==null&&E>=0&&xi(E))return t.enter(p),t.consume(E),pe;re(E,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(E){if(E!==null&&E>=0&&ku(E,{jsx:!0}))return t.consume(E),pe;if(E===46||E===47||E===62||E===123||It(E)||_o(E))return t.exit(p),z=he,ft(E);re(E,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(E===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function he(E){if(E===46)return t.enter(d),t.consume(E),t.exit(d),z=Be,ft;if(E===47||E===62||E===123||E!==null&&E>=0&&xi(E))return t.exit(f),Ae(E);re(E,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function J(E){if(E!==null&&E>=0&&xi(E))return t.enter(m),t.consume(E),ue;re(E,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+(E===43||E!==null&&E>46&&E<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function ue(E){if(E!==null&&E>=0&&ku(E,{jsx:!0}))return t.consume(E),ue;if(E===47||E===62||E===123||It(E)||_o(E))return t.exit(m),z=Se,ft(E);re(E,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se(E){if(E===47||E===62||E===123||E!==null&&E>=0&&xi(E))return t.exit(f),Ae(E);re(E,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ae(E){if(E===47)return t.enter(u),t.consume(E),t.exit(u),z=Oi,ft;if(E===62)return _r(E);if(E===123)return a_.call(G,t,Ze,O,y,x,r,i,o,!0,!1,s)(E);if(E!==null&&E>=0&&xi(E))return t.enter(b),t.enter(S),t.enter(v),t.consume(E),Ue;re(E,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ze(E){return z=Ae,ft(E)}function Ue(E){if(E!==null&&E>=0&&ku(E,{jsx:!0}))return t.consume(E),Ue;if(E===47||E===58||E===61||E===62||E===123||It(E)||_o(E))return t.exit(v),z=Qt,ft(E);re(E,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Qt(E){if(E===58)return t.enter(w),t.consume(E),t.exit(w),z=st,ft;if(E===61)return t.exit(S),t.enter(P),t.consume(E),t.exit(P),z=fr,ft;if(E===47||E===62||E===123||It(E)||_o(E)||E!==null&&E>=0&&xi(E))return t.exit(S),t.exit(b),z=Ae,ft(E);re(E,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function st(E){if(E!==null&&E>=0&&xi(E))return t.enter(k),t.consume(E),Gt;re(E,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Gt(E){if(E!==null&&E>=0&&ku(E,{jsx:!0}))return t.consume(E),Gt;if(E===47||E===61||E===62||E===123||It(E)||_o(E))return t.exit(k),t.exit(S),z=Kt,ft(E);re(E,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Kt(E){if(E===61)return t.enter(P),t.consume(E),t.exit(P),z=fr,ft;if(E===47||E===62||E===123||E!==null&&E>=0&&xi(E))return t.exit(b),Ae(E);re(E,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function fr(E){if(E===34||E===39)return t.enter(T),t.enter(M),t.consume(E),t.exit(M),ee=E,Cr;if(E===123)return a_.call(G,t,Tn,$,D,Z,r,i,o,!1,!1,s)(E);re(E,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+(E===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function Tn(E){return t.exit(b),z=Ae,ft(E)}function Cr(E){return E===null&&re(E,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(ee)+"`"),E===ee?(t.enter(M),t.consume(E),t.exit(M),t.exit(T),t.exit(b),ee=void 0,z=Ae,ft):Ce(E)?(z=Cr,ft(E)):(t.enter(I),un(E))}function un(E){return E===null||E===ee||Ce(E)?(t.exit(I),Cr(E)):(t.consume(E),un)}function Oi(E){if(E===62)return _r(E);re(E,"after self-closing slash","`>` to end the tag"+(E===42||E===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function _r(E){return t.enter(a),t.consume(E),t.exit(a),t.exit(l),e}function ft(E){return Ce(E)?(t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),U):je(E)||_o(E)?(t.enter("esWhitespace"),Kn(E)):z(E)}function Kn(E){return Ce(E)?(t.exit("esWhitespace"),ft(E)):je(E)||_o(E)?(t.consume(E),Kn):(t.exit("esWhitespace"),z(E))}function U(E){if(!s&&G.parser.lazy[G.now().line]){const Me=new vt("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",G.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw Me.url=c_+"#unexpected-lazy-line-in-container-expected-line-to-be",Me}return ft(E)}function re(E,Me,We){const kt=new vt("Unexpected "+(E===null?"end of file":"character `"+(E===96?"` ` `":String.fromCodePoint(E))+"` ("+CF(E)+")")+" "+Me+", expected "+We,G.now(),"micromark-extension-mdx-jsx:unexpected-"+(E===null?"eof":"character"));throw kt.url=c_+(E===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),kt}}function CF(t){return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function _F(t,e){return{name:"mdxJsxTextTag",tokenize:n};function n(r,i,o){return C3.call(this,r,i,o,t,e.acornOptions,e.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}function TF(t,e){return{concrete:!0,name:"mdxJsxFlowTag",tokenize:n};function n(r,i,o){const s=this;return l;function l(f){return a(f)}function a(f){return C3.call(s,r,c,o,t,e.acornOptions,e.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(f)}function c(f){return je(f)?et(r,u,"whitespace")(f):u(f)}function u(f){const h=s.parser.constructs.flow[123],d=Array.isArray(h)?h:h?[h]:[];let p;for(const g of d)if(g.name==="mdxFlowExpression"){p=g;break}return f===60?l(f):f===123&&p?r.attempt(p,u,o)(f):f===null||Ce(f)?i(f):o(f)}}}function PF(t){const e={},n=e.acorn;let r;if(n){if(!n.parse||!n.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions,{locations:!0})}else if(e.acornOptions||e.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:TF(n||void 0,{acornOptions:r,addResult:e.addResult||void 0})},text:{60:_F(n||void 0,{acornOptions:r,addResult:e.addResult||void 0})}}}function EF(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}const u_={}.hasOwnProperty;function $F(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const l=r.handlers;if(i&&u_.call(i,t)){const a=String(i[t]);s=u_.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const AF={}.hasOwnProperty;function _3(t,e){let n=-1,r;if(e.extensions)for(;++n<e.extensions.length;)_3(t,e.extensions[n]);for(r in e)if(AF.call(e,r))switch(r){case"extensions":break;case"unsafe":{f_(t[r],e[r]);break}case"join":{f_(t[r],e[r]);break}case"handlers":{QF(t[r],e[r]);break}default:t.options[r]=e[r]}return t}function f_(t,e){e&&t.push(...e)}function QF(t,e){e&&Object.assign(t,e)}function MF(t,e,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(t,o.current()),RF);return i(),s}function RF(t,e,n){return">"+(n?"":" ")+t}function T3(t,e){return h_(t,e.inConstruct,!0)&&!h_(t,e.notInConstruct,!1)}function h_(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function d_(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
27
|
-
`&&T3(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
28
|
-
`}function LF(t,e){const n=String(t);let r=n.indexOf(e),i=r,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+e.length,r=n.indexOf(e,i);return s}function vy(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function IF(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function DF(t,e,n,r){const i=IF(n),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(vy(t,n)){const f=n.enter("codeIndented"),h=n.indentLines(o,NF);return f(),h}const l=n.createTracker(r),a=i.repeat(Math.max(LF(o,i)+1,3)),c=n.enter("codeFenced");let u=l.move(a);if(t.lang){const f=n.enter(`codeFencedLang${s}`);u+=l.move(n.safe(t.lang,{before:u,after:" ",encode:["`"],...l.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${s}`);u+=l.move(" "),u+=l.move(n.safe(t.meta,{before:u,after:`
|
|
29
|
-
`,encode:["`"],...l.current()})),f()}return u+=l.move(`
|
|
30
|
-
`),o&&(u+=l.move(o+`
|
|
31
|
-
`)),u+=l.move(a),c(),u}function NF(t,e,n){return(n?"":" ")+t}function uv(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function VF(t,e,n,r){const i=uv(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const a=n.createTracker(r);let c=a.move("[");return c+=a.move(n.safe(n.associationId(t),{before:c,after:"]",...a.current()})),c+=a.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(t.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(t.url,{before:c,after:t.title?" ":`
|
|
32
|
-
`,...a.current()}))),l(),t.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(t.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),s(),c}function BF(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Ds(t){return"&#x"+t.toString(16).toUpperCase()+";"}function gg(t,e,n){const r=Is(t),i=Is(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}P3.peek=FF;function P3(t,e,n,r){const i=BF(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let a=s.move(n.containerPhrasing(t,{after:i,before:l,...s.current()}));const c=a.charCodeAt(0),u=gg(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(a=Ds(c)+a.slice(1));const f=a.charCodeAt(a.length-1),h=gg(r.after.charCodeAt(0),f,i);h.inside&&(a=a.slice(0,-1)+Ds(f));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},l+a+d}function FF(t,e,n){return n.options.emphasis||"*"}const fv=(function(t){if(t==null)return XF;if(typeof t=="function")return zm(t);if(typeof t=="object")return Array.isArray(t)?ZF(t):zF(t);if(typeof t=="string")return jF(t);throw new Error("Expected function, string, or object as test")});function ZF(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=fv(t[n]);return zm(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function zF(t){const e=t;return zm(n);function n(r){const i=r;let o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function jF(t){return zm(e);function e(n){return n&&n.type===t}}function zm(t){return e;function e(n,r,i){return!!(WF(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function XF(){return!0}function WF(t){return t!==null&&typeof t=="object"&&"type"in t}const E3=[],HF=!0,Sy=!1,qF="skip";function YF(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const o=fv(i),s=r?-1:1;l(t,void 0,[])();function l(a,c,u){const f=a&&typeof a=="object"?a:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(a.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=E3,p,g,m;if((!e||o(a,c,u[u.length-1]||void 0))&&(d=UF(n(a,u)),d[0]===Sy))return d;if("children"in a&&a.children){const O=a;if(O.children&&d[0]!==qF)for(g=(r?O.children.length:-1)+s,m=u.concat(O);g>-1&&g<O.children.length;){const y=O.children[g];if(p=l(y,g,m)(),p[0]===Sy)return p;g=typeof p[1]=="number"?p[1]:g+s}}return d}}}function UF(t){return Array.isArray(t)?t:typeof t=="number"?[HF,t]:t==null?E3:[t]}function GF(t,e,n,r){let i,o,s;typeof e=="function"&&typeof n!="function"?(o=void 0,s=e,i=n):(o=e,s=n,i=r),YF(t,o,l,i);function l(a,c){const u=c[c.length-1],f=u?u.children.indexOf(a):void 0;return s(a,f,u)}}const KF={};function hv(t,e){const n=KF,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $3(t,r,i)}function $3(t,e,n){if(JF(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return p_(t.children,e,n)}return Array.isArray(t)?p_(t,e,n):""}function p_(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=$3(t[i],e,n);return r.join("")}function JF(t){return!!(t&&typeof t=="object")}function A3(t,e){let n=!1;return GF(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Sy}),!!((!t.depth||t.depth<3)&&hv(t)&&(e.options.setext||n))}function eZ(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),o=n.createTracker(r);if(A3(t,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(t,{...o.current(),before:`
|
|
33
|
-
`,after:`
|
|
34
|
-
`});return f(),u(),h+`
|
|
35
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
36
|
-
`))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),a=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
|
|
37
|
-
`,...o.current()});return/^[\t ]/.test(c)&&(c=Ds(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),a(),l(),c}Q3.peek=tZ;function Q3(t){return t.value||""}function tZ(){return"<"}M3.peek=nZ;function M3(t,e,n,r){const i=uv(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const a=n.createTracker(r);let c=a.move("![");return c+=a.move(n.safe(t.alt,{before:c,after:"]",...a.current()})),c+=a.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(t.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(t.url,{before:c,after:t.title?" ":")",...a.current()}))),l(),t.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(t.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function nZ(){return"!"}R3.peek=rZ;function R3(t,e,n,r){const i=t.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let a=l.move("![");const c=n.safe(t.alt,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:a,after:"]",...l.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==f?a+=l.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function rZ(){return"!"}L3.peek=iZ;function L3(t,e,n){let r=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let a;if(s.atBreak)for(;a=l.exec(r);){let c=a.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(a.index+1)}}return i+r+i}function iZ(){return"`"}function I3(t,e){const n=hv(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}D3.peek=oZ;function D3(t,e,n,r){const i=uv(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,a;if(I3(t,n)){const u=n.stack;n.stack=[],l=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),l(),n.stack=u,f}l=n.enter("link"),a=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(a=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),a(),t.title&&(a=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(t.title,{before:c,after:i,...s.current()})),c+=s.move(i),a()),c+=s.move(")"),l(),c}function oZ(t,e,n){return I3(t,n)?"<":"["}N3.peek=sZ;function N3(t,e,n,r){const i=t.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let a=l.move("[");const c=n.containerPhrasing(t,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:a,after:"]",...l.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==f?a+=l.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function sZ(){return"["}function dv(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function lZ(t){const e=dv(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function aZ(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function V3(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function cZ(t,e,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=t.ordered?aZ(n):dv(n);const l=t.ordered?s==="."?")":".":lZ(n);let a=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(a=!0),V3(n)===s&&u){let f=-1;for(;++f<t.children.length;){const h=t.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(s=l),n.bulletCurrent=s;const c=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function uZ(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function fZ(t,e,n,r){const i=uZ(n);let o=n.bulletCurrent||dv(n);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const a=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,l.current()),u);return a(),c;function u(f,h,d){return h?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function hZ(t,e,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(t,r);return o(),i(),s}const dZ=fv(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pZ(t,e,n,r){return(t.children.some(function(s){return dZ(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function gZ(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}B3.peek=mZ;function B3(t,e,n,r){const i=gZ(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let a=s.move(n.containerPhrasing(t,{after:i,before:l,...s.current()}));const c=a.charCodeAt(0),u=gg(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(a=Ds(c)+a.slice(1));const f=a.charCodeAt(a.length-1),h=gg(r.after.charCodeAt(0),f,i);h.inside&&(a=a.slice(0,-1)+Ds(f));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},l+a+d}function mZ(t,e,n){return n.options.strong||"*"}function OZ(t,e,n,r){return n.safe(t.value,r)}function yZ(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function xZ(t,e,n){const r=(V3(n)+(n.options.ruleSpaces?" ":"")).repeat(yZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const pv={blockquote:MF,break:d_,code:DF,definition:VF,emphasis:P3,hardBreak:d_,heading:eZ,html:Q3,image:M3,imageReference:R3,inlineCode:L3,link:D3,linkReference:N3,list:cZ,listItem:fZ,paragraph:hZ,root:pZ,strong:B3,text:OZ,thematicBreak:xZ},bZ=[vZ];function vZ(t,e,n,r){if(e.type==="code"&&vy(e,r)&&(t.type==="list"||t.type===e.type&&vy(t,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&A3(e,r))?void 0:n.spread?1:0}const al=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],SZ=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
38
|
-
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:al},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
39
|
-
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:al},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
40
|
-
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:al},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
41
|
-
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
42
|
-
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
43
|
-
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:al},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:al},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:al},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:al},{atBreak:!0,character:"~"}];function F3(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const wZ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z3(t){return t.replace(wZ,kZ)}function kZ(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return F3(n.slice(o?2:1),o?16:10)}return Rf(n)||t}function CZ(t){return t.label||!t.identifier?t.label||"":Z3(t.identifier)}function _Z(t){if(!t._compiled){const e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function TZ(t,e,n){const r=e.indexStack,i=t.children||[],o=[];let s=-1,l=n.before,a;r.push(-1);let c=e.createTracker(n);for(;++s<i.length;){const u=i[s];let f;if(r[r.length-1]=s,s+1<i.length){let p=e.handle.handlers[i[s+1].type];p&&p.peek&&(p=p.peek),f=p?p(i[s+1],t,e,{before:"",after:"",...c.current()}).charAt(0):""}else f=n.after;o.length>0&&(l==="\r"||l===`
|
|
44
|
-
`)&&u.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),l=" ",c=e.createTracker(n),c.move(o.join("")));let h=e.handle(u,t,e,{...c.current(),after:f,before:l});a&&a===h.slice(0,1)&&(h=Ds(a.charCodeAt(0))+h.slice(1));const d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,a=void 0,d&&(o.length>0&&d.before&&l===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+Ds(l.charCodeAt(0))),d.after&&(a=f)),c.move(h),o.push(h),l=h.slice(-1)}return r.pop(),o.join("")}function PZ(t,e,n){const r=e.indexStack,i=t.children||[],o=e.createTracker(n),s=[];let l=-1;for(r.push(-1);++l<i.length;){const a=i[l];r[r.length-1]=l,s.push(o.move(e.handle(a,t,e,{before:`
|
|
45
|
-
`,after:`
|
|
46
|
-
`,...o.current()}))),a.type!=="list"&&(e.bulletLastUsed=void 0),l<i.length-1&&s.push(o.move(EZ(a,i[l+1],t,e)))}return r.pop(),s.join("")}function EZ(t,e,n,r){let i=r.join.length;for(;i--;){const o=r.join[i](t,e,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
47
|
-
`.repeat(1+o);if(o===!1)return`
|
|
48
|
-
|
|
49
|
-
<!---->
|
|
50
|
-
|
|
51
|
-
`}return`
|
|
52
|
-
|
|
53
|
-
`}const $Z=/\r?\n|\r/g;function AZ(t,e){const n=[];let r=0,i=0,o;for(;o=$Z.exec(t);)s(t.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(t.slice(r)),n.join("");function s(l){n.push(e(l,i,!l))}}function QZ(t,e,n){const r=(n.before||"")+(e||"")+(n.after||""),i=[],o=[],s={};let l=-1;for(;++l<t.unsafe.length;){const u=t.unsafe[l];if(!T3(t.stack,u))continue;const f=t.compilePattern(u);let h;for(;h=f.exec(r);){const d="before"in u||!!u.atBreak,p="after"in u,g=h.index+(d?h[1].length:0);i.includes(g)?(s[g].before&&!d&&(s[g].before=!1),s[g].after&&!p&&(s[g].after=!1)):(i.push(g),s[g]={before:d,after:p})}}i.sort(MZ);let a=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(l=-1;++l<i.length;){const u=i[l];u<a||u>=c||u+1<c&&i[l+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||i[l-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(a!==u&&o.push(g_(r.slice(a,u),"\\")),a=u,/[!-/:-@[-`{-~]/.test(r.charAt(u))&&(!n.encode||!n.encode.includes(r.charAt(u)))?o.push("\\"):(o.push(Ds(r.charCodeAt(u))),a++))}return o.push(g_(r.slice(a,c),n.after)),o.join("")}function MZ(t,e){return t-e}function g_(t,e){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=t+e;let s=-1,l=0,a;for(;a=n.exec(o);)r.push(a.index);for(;++s<r.length;)l!==r[s]&&i.push(t.slice(l,r[s])),i.push("\\"),l=r[s];return i.push(t.slice(l)),i.join("")}function RZ(t){const e=t||{},n=e.now||{};let r=e.lineShift||0,i=n.line||1,o=n.column||1;return{move:a,current:s,shift:l};function s(){return{now:{line:i,column:o},lineShift:r}}function l(c){r+=c}function a(c){const u=c||"",f=u.split(/\r?\n|\r/g),h=f[f.length-1];return i+=f.length-1,o=f.length===1?o+h.length:1+h.length+r,u}}function z3(t,e){const n=e||{},r={associationId:CZ,containerPhrasing:NZ,containerFlow:VZ,createTracker:RZ,compilePattern:_Z,enter:o,handlers:{...pv},handle:void 0,indentLines:AZ,indexStack:[],join:[...bZ],options:{},safe:BZ,stack:[],unsafe:[...SZ]};_3(r,n),r.options.tightDefinitions&&r.join.push(DZ),r.handle=$F("type",{invalid:LZ,unknown:IZ,handlers:r.handlers});let i=r.handle(t,void 0,r,{before:`
|
|
54
|
-
`,after:`
|
|
55
|
-
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
56
|
-
`),i;function o(s){return r.stack.push(s),l;function l(){r.stack.pop()}}}function LZ(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function IZ(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function DZ(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function NZ(t,e){return TZ(t,this,e)}function VZ(t,e){return PZ(t,this,e)}function BZ(t,e){return QZ(this,t,e)}const FZ=["mdxJsxTextElement","mdxJsxFlowElement"];function j3(t){return FZ.includes(t.type)&&ZZ.includes(t.name)}const ZZ=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function zZ(t,e){const n=m_(t),r=m_(e),i={...n,...r};return jZ(i)}function m_(t){const e={};return t.split(";").filter(r=>r.trim()!=="").forEach(r=>{const[i,o]=r.split(":").map(s=>s.trim());e[i]=o}),e}function jZ(t){return Object.entries(t).map(([e,n])=>`${e}: ${n}`).join("; ")}function XZ(t){return t.children instanceof Array}function X3({root:t,visitors:e,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let o=null;const s=new Set,l=new Map;e=[...e].sort((O,y)=>(y.priority??0)-(O.priority??0)),f(t,null);function a(O,y){s.add(O),y&&l.set(O,{...y})}function c(O,y){if(o===null)return o=y,o;if(!XZ(O))throw new Error("Attempting to append children to a non-parent");const x=O.children,b=x.at(-1);if(b){const S=e.find(v=>{var w;return(w=v.shouldJoin)==null?void 0:w.call(v,b,y)});if(S){const v=S.join(b,y);return x.splice(x.length-1,1,v),v}}return x.push(y),y}function u(O,y){O.getChildren().forEach(x=>{f(x,y)})}function f(O,y,x=null){var b;const S=e.find((v,w)=>{var k;return x?.has(w)?!1:(k=v.testLexicalNode)==null?void 0:k.call(v,O)});if(!S)throw new Error(`no lexical visitor found for ${O.getType()}`,{cause:O});(b=S.visitLexicalNode)==null||b.call(S,{lexicalNode:O,mdastParent:y,actions:{addAndStepInto(v,w={},k=!0){const P={type:v,...w,...k?{children:[]}:{}};c(y,P),N(O)&&k&&u(O,P)},appendToParent:c,visitChildren:u,visit:f,registerReferredComponent:a,nextVisitor(){f(O,y,(x??new Set).add(e.indexOf(S)))}}})}if(o===null)throw new Error("traversal ended with no root element");const h=new Map,d=new Map;for(const O of s){const y=n.find(x=>x.name===O)??l.get(O)??n.find(x=>x.name==="*");if(!y)throw new Error(`Component ${O} is used but not imported`);if(y.source)if(y.defaultExport)d.set(O,y.source);else{const{source:x}=y,b=h.get(x);b?b.push(O):h.set(x,[O])}}if(!i){for(const[O,y]of h.entries()){const x=y.filter(b=>l.has(b));x.length>0?h.set(O,x):h.delete(O)}for(const O of d.keys())l.has(O)||d.delete(O)}const p=Array.from(h).map(([O,y])=>({type:"mdxjsEsm",value:`import { ${y.join(", ")} } from '${O}'`}));p.push(...Array.from(d).map(([O,y])=>({type:"mdxjsEsm",value:`import ${O} from '${y}'`})));const g=o,m=g.children.find(O=>O.type==="yaml");return m?g.children.splice(g.children.indexOf(m)+1,0,...p):g.children.unshift(...p),gp(g,[]),W3(g),r||H3(g),g}function W3(t){if("children"in t&&t.children.length>0){if(j3(t)&&t.children.length===1){const e=t.children[0];e.type==="mdxJsxTextElement"&&e.name==="span"&&(e.attributes.forEach(n=>{if(n.type==="mdxJsxAttribute"){const r=t.attributes.find(i=>i.type==="mdxJsxAttribute"&&i.name===n.name);if(r)if(n.name==="className"){const i=new Set([...r.value.split(" "),...n.value.split(" ")]);r.value=Array.from(i).join(" ")}else n.name==="style"&&(r.value=zZ(r.value,n.value));else t.attributes.push(n)}}),t.children=e.children)}t.children.forEach(e=>{W3(e)})}}function H3(t){if(Object.hasOwn(t,"children")){const e=t,n=[];e.children.forEach(r=>{r.type==="mdxJsxTextElement"&&r.name==="u"?n.push({type:"html",value:"<u>"},...r.children,{type:"html",value:"</u>"}):(n.push(r),H3(r))}),e.children=n}}const O_=/\s+$/,y_=/^\s+/;function gp(t,e){if(t.type==="strong"||t.type==="emphasis"){const n=t.children.at(-1);if(n?.type==="text"){const i=O_.exec(n.value);if(i){n.value=n.value.replace(O_,"");const o=e.at(-1);o&&(o.children.splice(o.children.indexOf(t)+1,0,{type:"text",value:i[0]}),gp(o,e.slice(0,-1)))}}const r=t.children.at(0);if(r?.type==="text"){const i=y_.exec(r.value);if(i){r.value=r.value.replace(y_,"");const o=e.at(-1);o&&(o.children.splice(o.children.indexOf(t),0,{type:"text",value:i[0]}),gp(o,e.slice(0,-1)))}}}if("children"in t&&t.children.length>0){const n=t;n.children.forEach(r=>{gp(r,[...e,n])})}}function q3({root:t,toMarkdownOptions:e,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:o}){return z3(X3({root:t,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:o}),{extensions:n,...e})+`
|
|
57
|
-
`}const x_={}.hasOwnProperty;function WZ(t){const e={};let n=-1;for(;++n<t.length;)HZ(e,t[n]);return e}function HZ(t,e){let n;for(n in e){const i=(x_.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let s;if(o)for(s in o){x_.call(i,s)||(i[s]=[]);const l=o[s];qZ(i[s],Array.isArray(l)?l:l?[l]:[])}}}function qZ(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);qn(t,0,0,r)}function nc(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const YZ={tokenize:UZ};function UZ(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),et(t,e,"linePrefix")}function i(l){return t.enter("paragraph"),o(l)}function o(l){const a=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,s(l)}function s(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return Ce(l)?(t.consume(l),t.exit("chunkText"),o):(t.consume(l),s)}}const GZ={tokenize:KZ},b_={tokenize:JZ};function KZ(t){const e=this,n=[];let r=0,i,o,s;return l;function l(x){if(r<n.length){const b=n[r];return e.containerState=b[1],t.attempt(b[0].continuation,a,c)(x)}return c(x)}function a(x){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&y();const b=e.events.length;let S=b,v;for(;S--;)if(e.events[S][0]==="exit"&&e.events[S][1].type==="chunkFlow"){v=e.events[S][1].end;break}O(r);let w=b;for(;w<e.events.length;)e.events[w][1].end={...v},w++;return qn(e.events,S+1,0,e.events.slice(b)),e.events.length=w,c(x)}return l(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(b_,u,f)(x)}function u(x){return i&&y(),O(r),h(x)}function f(x){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,p(x)}function h(x){return e.containerState={},t.attempt(b_,d,p)(x)}function d(x){return r++,n.push([e.currentConstruct,e.containerState]),h(x)}function p(x){if(x===null){i&&y(),O(0),t.consume(x);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),g(x)}function g(x){if(x===null){m(t.exit("chunkFlow"),!0),O(0),t.consume(x);return}return Ce(x)?(t.consume(x),m(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(x),g)}function m(x,b){const S=e.sliceStream(x);if(b&&S.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(S),e.parser.lazy[x.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<s&&(!i.events[v][1].end||i.events[v][1].end.offset>s))return;const w=e.events.length;let k=w,P,T;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){if(P){T=e.events[k][1].end;break}P=!0}for(O(r),v=w;v<e.events.length;)e.events[v][1].end={...T},v++;qn(e.events,k+1,0,e.events.slice(w)),e.events.length=v}}function O(x){let b=n.length;for(;b-- >x;){const S=n[b];e.containerState=S[1],S[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function JZ(t,e,n){return et(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const wy={name:"attention",resolveAll:ez,tokenize:tz};function ez(t,e){let n=-1,r,i,o,s,l,a,c,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;a=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},h={...t[n][1].start};v_(f,-a),v_(h,a),s={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},o={type:a>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},t[r][1].end={...s.start},t[n][1].start={...l.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=qr(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=qr(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=qr(c,Ph(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=qr(c,[["exit",o,e],["enter",l,e],["exit",l,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=qr(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,qn(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function tz(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Is(r);let o;return s;function s(a){return o=a,t.enter("attentionSequence"),l(a)}function l(a){if(a===o)return t.consume(a),l;const c=t.exit("attentionSequence"),u=Is(a),f=!u||u===2&&i||n.includes(a),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?f:f&&(i||!h)),c._close=!!(o===42?h:h&&(u||!f)),e(a)}}function v_(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const nz={name:"autolink",tokenize:rz};function rz(t,e,n){let r=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return qi(d)?(t.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||Ai(d)?(r=1,l(d)):c(d)}function l(d){return d===58?(t.consume(d),r=0,a):(d===43||d===45||d===46||Ai(d))&&r++<32?(t.consume(d),l):(r=0,c(d))}function a(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||gy(d)?n(d):(t.consume(d),a)}function c(d){return d===64?(t.consume(d),u):dB(d)?(t.consume(d),c):n(d)}function u(d){return Ai(d)?f(d):n(d)}function f(d){return d===46?(t.consume(d),r=0,u):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):h(d)}function h(d){if((d===45||Ai(d))&&r++<63){const p=d===45?h:f;return t.consume(d),p}return n(d)}}const jm={partial:!0,tokenize:iz};function iz(t,e,n){return r;function r(o){return je(o)?et(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ce(o)?e(o):n(o)}}const Y3={continuation:{tokenize:sz},exit:lz,name:"blockQuote",tokenize:oz};function oz(t,e,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return n(s)}function o(s){return je(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function sz(t,e,n){const r=this;return i;function i(s){return je(s)?et(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(Y3,e,n)(s)}}function lz(t){t.exit("blockQuote")}const U3={name:"characterEscape",tokenize:az};function az(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return gB(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const G3={name:"characterReference",tokenize:cz};function cz(t,e,n){const r=this;let i=0,o,s;return l;function l(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),a}function a(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),o=31,s=Ai,u(f))}function c(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=pB,u):(t.enter("characterReferenceValue"),o=7,s=my,u(f))}function u(f){if(f===59&&i){const h=t.exit("characterReferenceValue");return s===Ai&&!Rf(r.sliceSerialize(h))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),u):n(f)}}const S_={partial:!0,tokenize:fz},w_={concrete:!0,name:"codeFenced",tokenize:uz};function uz(t,e,n){const r=this,i={partial:!0,tokenize:S};let o=0,s=0,l;return a;function a(v){return c(v)}function c(v){const w=r.events[r.events.length-1];return o=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,l=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(v)}function u(v){return v===l?(s++,t.consume(v),u):s<3?n(v):(t.exit("codeFencedFenceSequence"),je(v)?et(t,f,"whitespace")(v):f(v))}function f(v){return v===null||Ce(v)?(t.exit("codeFencedFence"),r.interrupt?e(v):t.check(S_,g,b)(v)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||Ce(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(v)):je(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),et(t,d,"whitespace")(v)):v===96&&v===l?n(v):(t.consume(v),h)}function d(v){return v===null||Ce(v)?f(v):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||Ce(v)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(v)):v===96&&v===l?n(v):(t.consume(v),p)}function g(v){return t.attempt(i,b,m)(v)}function m(v){return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),O}function O(v){return o>0&&je(v)?et(t,y,"linePrefix",o+1)(v):y(v)}function y(v){return v===null||Ce(v)?t.check(S_,g,b)(v):(t.enter("codeFlowValue"),x(v))}function x(v){return v===null||Ce(v)?(t.exit("codeFlowValue"),y(v)):(t.consume(v),x)}function b(v){return t.exit("codeFenced"),e(v)}function S(v,w,k){let P=0;return T;function T(Z){return v.enter("lineEnding"),v.consume(Z),v.exit("lineEnding"),M}function M(Z){return v.enter("codeFencedFence"),je(Z)?et(v,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):I(Z)}function I(Z){return Z===l?(v.enter("codeFencedFenceSequence"),$(Z)):k(Z)}function $(Z){return Z===l?(P++,v.consume(Z),$):P>=s?(v.exit("codeFencedFenceSequence"),je(Z)?et(v,D,"whitespace")(Z):D(Z)):k(Z)}function D(Z){return Z===null||Ce(Z)?(v.exit("codeFencedFence"),w(Z)):k(Z)}}}function fz(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const i1={name:"codeIndented",tokenize:dz},hz={partial:!0,tokenize:pz};function dz(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),et(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?a(c):Ce(c)?t.attempt(hz,s,a)(c):(t.enter("codeFlowValue"),l(c))}function l(c){return c===null||Ce(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),l)}function a(c){return t.exit("codeIndented"),e(c)}}function pz(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ce(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):et(t,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(s):Ce(s)?i(s):n(s)}}const gz={name:"codeText",previous:Oz,resolve:mz,tokenize:yz};function mz(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Oz(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yz(t,e,n){let r=0,i,o;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),l(f)}function l(f){return f===96?(t.consume(f),r++,l):(t.exit("codeTextSequence"),a(f))}function a(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),a):f===96?(o=t.enter("codeTextSequence"),i=0,u(f)):Ce(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),a):(t.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Ce(f)?(t.exit("codeTextData"),a(f)):(t.consume(f),c)}function u(f){return f===96?(t.consume(f),i++,u):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(o.type="codeTextData",c(f))}}class xz{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Cu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Cu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Cu(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Cu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Cu(this.left,n.reverse())}}}function Cu(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function K3(t){const e={};let n=-1,r,i,o,s,l,a,c;const u=new xz(t);for(;++n<u.length;){for(;n in e;)n=e[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,bz(u,n)),n=e[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},l=u.slice(i,n),l.unshift(r),u.splice(i,n-i+1,l))}}return qn(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function bz(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,a=[],c={};let u,f,h=-1,d=n,p=0,g=0;const m=[g];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(u=r.sliceStream(d),d.next||u.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(g=h+1,m.push(g),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):m.pop(),h=m.length;h--;){const O=l.slice(m[h],m[h+1]),y=o.pop();a.push([y,y+O.length-1]),t.splice(y,2,O)}for(a.reverse(),h=-1;++h<a.length;)c[p+a[h][0]]=p+a[h][1],p+=a[h][1]-a[h][0]-1;return c}const vz={resolve:wz,tokenize:kz},Sz={partial:!0,tokenize:Cz};function wz(t){return K3(t),t}function kz(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):Ce(l)?t.check(Sz,s,o)(l):(t.consume(l),i)}function o(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function s(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Cz(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),et(t,o,"linePrefix")}function o(s){if(s===null||Ce(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function J3(t,e,n,r,i,o,s,l,a){const c=a||Number.POSITIVE_INFINITY;let u=0;return f;function f(O){return O===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(O),t.exit(o),h):O===null||O===32||O===41||gy(O)?n(O):(t.enter(r),t.enter(s),t.enter(l),t.enter("chunkString",{contentType:"string"}),g(O))}function h(O){return O===62?(t.enter(o),t.consume(O),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),d(O))}function d(O){return O===62?(t.exit("chunkString"),t.exit(l),h(O)):O===null||O===60||Ce(O)?n(O):(t.consume(O),O===92?p:d)}function p(O){return O===60||O===62||O===92?(t.consume(O),d):d(O)}function g(O){return!u&&(O===null||O===41||It(O))?(t.exit("chunkString"),t.exit(l),t.exit(s),t.exit(r),e(O)):u<c&&O===40?(t.consume(O),u++,g):O===41?(t.consume(O),u--,g):O===null||O===32||O===40||gy(O)?n(O):(t.consume(O),O===92?m:g)}function m(O){return O===40||O===41||O===92?(t.consume(O),g):g(O)}}function e9(t,e,n,r,i,o){const s=this;let l=0,a;return c;function c(d){return t.enter(r),t.enter(i),t.consume(d),t.exit(i),t.enter(o),u}function u(d){return l>999||d===null||d===91||d===93&&!a||d===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):Ce(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||Ce(d)||l++>999?(t.exit("chunkString"),u(d)):(t.consume(d),a||(a=!je(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(t.consume(d),l++,f):f(d)}}function t9(t,e,n,r,i,o){let s;return l;function l(h){return h===34||h===39||h===40?(t.enter(r),t.enter(i),t.consume(h),t.exit(i),s=h===40?41:h,a):n(h)}function a(h){return h===s?(t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):(t.enter(o),c(h))}function c(h){return h===s?(t.exit(o),a(s)):h===null?n(h):Ce(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),et(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||Ce(h)?(t.exit("chunkString"),c(h)):(t.consume(h),h===92?f:u)}function f(h){return h===s||h===92?(t.consume(h),u):u(h)}}function Ju(t,e){let n;return r;function r(i){return Ce(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):je(i)?et(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const _z={name:"definition",tokenize:Pz},Tz={partial:!0,tokenize:Ez};function Pz(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return e9.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function l(d){return i=nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),a):n(d)}function a(d){return It(d)?Ju(t,c)(d):c(d)}function c(d){return J3(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return t.attempt(Tz,f,f)(d)}function f(d){return je(d)?et(t,h,"whitespace")(d):h(d)}function h(d){return d===null||Ce(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Ez(t,e,n){return r;function r(l){return It(l)?Ju(t,i)(l):n(l)}function i(l){return t9(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return je(l)?et(t,s,"whitespace")(l):s(l)}function s(l){return l===null||Ce(l)?e(l):n(l)}}const $z={name:"hardBreakEscape",tokenize:Az};function Az(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Ce(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Qz={name:"headingAtx",resolve:Mz,tokenize:Rz};function Mz(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},qn(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Rz(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||It(u)?(t.exit("atxHeadingSequence"),l(u)):n(u)}function l(u){return u===35?(t.enter("atxHeadingSequence"),a(u)):u===null||Ce(u)?(t.exit("atxHeading"),e(u)):je(u)?et(t,l,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function a(u){return u===35?(t.consume(u),a):(t.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||It(u)?(t.exit("atxHeadingText"),l(u)):(t.consume(u),c)}}const Lz=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],k_=["pre","script","style","textarea"],Iz={concrete:!0,name:"htmlFlow",resolveTo:Vz,tokenize:Bz},Dz={partial:!0,tokenize:Zz},Nz={partial:!0,tokenize:Fz};function Vz(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bz(t,e,n){const r=this;let i,o,s,l,a;return c;function c(L){return u(L)}function u(L){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(L),f}function f(L){return L===33?(t.consume(L),h):L===47?(t.consume(L),o=!0,g):L===63?(t.consume(L),i=3,r.interrupt?e:Q):qi(L)?(t.consume(L),s=String.fromCharCode(L),m):n(L)}function h(L){return L===45?(t.consume(L),i=2,d):L===91?(t.consume(L),i=5,l=0,p):qi(L)?(t.consume(L),i=4,r.interrupt?e:Q):n(L)}function d(L){return L===45?(t.consume(L),r.interrupt?e:Q):n(L)}function p(L){const Ie="CDATA[";return L===Ie.charCodeAt(l++)?(t.consume(L),l===Ie.length?r.interrupt?e:I:p):n(L)}function g(L){return qi(L)?(t.consume(L),s=String.fromCharCode(L),m):n(L)}function m(L){if(L===null||L===47||L===62||It(L)){const Ie=L===47,Be=s.toLowerCase();return!Ie&&!o&&k_.includes(Be)?(i=1,r.interrupt?e(L):I(L)):Lz.includes(s.toLowerCase())?(i=6,Ie?(t.consume(L),O):r.interrupt?e(L):I(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):o?y(L):x(L))}return L===45||Ai(L)?(t.consume(L),s+=String.fromCharCode(L),m):n(L)}function O(L){return L===62?(t.consume(L),r.interrupt?e:I):n(L)}function y(L){return je(L)?(t.consume(L),y):T(L)}function x(L){return L===47?(t.consume(L),T):L===58||L===95||qi(L)?(t.consume(L),b):je(L)?(t.consume(L),x):T(L)}function b(L){return L===45||L===46||L===58||L===95||Ai(L)?(t.consume(L),b):S(L)}function S(L){return L===61?(t.consume(L),v):je(L)?(t.consume(L),S):x(L)}function v(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),a=L,w):je(L)?(t.consume(L),v):k(L)}function w(L){return L===a?(t.consume(L),a=null,P):L===null||Ce(L)?n(L):(t.consume(L),w)}function k(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||It(L)?S(L):(t.consume(L),k)}function P(L){return L===47||L===62||je(L)?x(L):n(L)}function T(L){return L===62?(t.consume(L),M):n(L)}function M(L){return L===null||Ce(L)?I(L):je(L)?(t.consume(L),M):n(L)}function I(L){return L===45&&i===2?(t.consume(L),G):L===60&&i===1?(t.consume(L),z):L===62&&i===4?(t.consume(L),ve):L===63&&i===3?(t.consume(L),Q):L===93&&i===5?(t.consume(L),oe):Ce(L)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Dz,_e,$)(L)):L===null||Ce(L)?(t.exit("htmlFlowData"),$(L)):(t.consume(L),I)}function $(L){return t.check(Nz,D,_e)(L)}function D(L){return t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),Z}function Z(L){return L===null||Ce(L)?$(L):(t.enter("htmlFlowData"),I(L))}function G(L){return L===45?(t.consume(L),Q):I(L)}function z(L){return L===47?(t.consume(L),s="",ee):I(L)}function ee(L){if(L===62){const Ie=s.toLowerCase();return k_.includes(Ie)?(t.consume(L),ve):I(L)}return qi(L)&&s.length<8?(t.consume(L),s+=String.fromCharCode(L),ee):I(L)}function oe(L){return L===93?(t.consume(L),Q):I(L)}function Q(L){return L===62?(t.consume(L),ve):L===45&&i===2?(t.consume(L),Q):I(L)}function ve(L){return L===null||Ce(L)?(t.exit("htmlFlowData"),_e(L)):(t.consume(L),ve)}function _e(L){return t.exit("htmlFlow"),e(L)}}function Fz(t,e,n){const r=this;return i;function i(s){return Ce(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function Zz(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(jm,e,n)}}const zz={name:"htmlText",tokenize:jz};function jz(t,e,n){const r=this;let i,o,s;return l;function l(Q){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(Q),a}function a(Q){return Q===33?(t.consume(Q),c):Q===47?(t.consume(Q),S):Q===63?(t.consume(Q),x):qi(Q)?(t.consume(Q),k):n(Q)}function c(Q){return Q===45?(t.consume(Q),u):Q===91?(t.consume(Q),o=0,p):qi(Q)?(t.consume(Q),y):n(Q)}function u(Q){return Q===45?(t.consume(Q),d):n(Q)}function f(Q){return Q===null?n(Q):Q===45?(t.consume(Q),h):Ce(Q)?(s=f,z(Q)):(t.consume(Q),f)}function h(Q){return Q===45?(t.consume(Q),d):f(Q)}function d(Q){return Q===62?G(Q):Q===45?h(Q):f(Q)}function p(Q){const ve="CDATA[";return Q===ve.charCodeAt(o++)?(t.consume(Q),o===ve.length?g:p):n(Q)}function g(Q){return Q===null?n(Q):Q===93?(t.consume(Q),m):Ce(Q)?(s=g,z(Q)):(t.consume(Q),g)}function m(Q){return Q===93?(t.consume(Q),O):g(Q)}function O(Q){return Q===62?G(Q):Q===93?(t.consume(Q),O):g(Q)}function y(Q){return Q===null||Q===62?G(Q):Ce(Q)?(s=y,z(Q)):(t.consume(Q),y)}function x(Q){return Q===null?n(Q):Q===63?(t.consume(Q),b):Ce(Q)?(s=x,z(Q)):(t.consume(Q),x)}function b(Q){return Q===62?G(Q):x(Q)}function S(Q){return qi(Q)?(t.consume(Q),v):n(Q)}function v(Q){return Q===45||Ai(Q)?(t.consume(Q),v):w(Q)}function w(Q){return Ce(Q)?(s=w,z(Q)):je(Q)?(t.consume(Q),w):G(Q)}function k(Q){return Q===45||Ai(Q)?(t.consume(Q),k):Q===47||Q===62||It(Q)?P(Q):n(Q)}function P(Q){return Q===47?(t.consume(Q),G):Q===58||Q===95||qi(Q)?(t.consume(Q),T):Ce(Q)?(s=P,z(Q)):je(Q)?(t.consume(Q),P):G(Q)}function T(Q){return Q===45||Q===46||Q===58||Q===95||Ai(Q)?(t.consume(Q),T):M(Q)}function M(Q){return Q===61?(t.consume(Q),I):Ce(Q)?(s=M,z(Q)):je(Q)?(t.consume(Q),M):P(Q)}function I(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(t.consume(Q),i=Q,$):Ce(Q)?(s=I,z(Q)):je(Q)?(t.consume(Q),I):(t.consume(Q),D)}function $(Q){return Q===i?(t.consume(Q),i=void 0,Z):Q===null?n(Q):Ce(Q)?(s=$,z(Q)):(t.consume(Q),$)}function D(Q){return Q===null||Q===34||Q===39||Q===60||Q===61||Q===96?n(Q):Q===47||Q===62||It(Q)?P(Q):(t.consume(Q),D)}function Z(Q){return Q===47||Q===62||It(Q)?P(Q):n(Q)}function G(Q){return Q===62?(t.consume(Q),t.exit("htmlTextData"),t.exit("htmlText"),e):n(Q)}function z(Q){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(Q),t.exit("lineEnding"),ee}function ee(Q){return je(Q)?et(t,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):oe(Q)}function oe(Q){return t.enter("htmlTextData"),s(Q)}}const gv={name:"labelEnd",resolveAll:qz,resolveTo:Yz,tokenize:Uz},Xz={tokenize:Gz},Wz={tokenize:Kz},Hz={tokenize:Jz};function qz(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&qn(t,0,t.length,n),t}function Yz(t,e){let n=t.length,r=0,i,o,s,l;for(;n--;)if(i=t[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const a={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},u={type:"labelText",start:{...t[o+r+2][1].end},end:{...t[s-2][1].start}};return l=[["enter",a,e],["enter",c,e]],l=qr(l,t.slice(o+1,o+r+3)),l=qr(l,[["enter",u,e]]),l=qr(l,Ph(e.parser.constructs.insideSpan.null,t.slice(o+r+4,s-3),e)),l=qr(l,[["exit",u,e],t[s-2],t[s-1],["exit",c,e]]),l=qr(l,t.slice(s+1)),l=qr(l,[["exit",a,e]]),qn(t,o,t.length,l),t}function Uz(t,e,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(nc(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),a):n(h)}function a(h){return h===40?t.attempt(Xz,u,s?u:f)(h):h===91?t.attempt(Wz,u,s?c:f)(h):s?u(h):f(h)}function c(h){return t.attempt(Hz,u,f)(h)}function u(h){return e(h)}function f(h){return o._balanced=!0,n(h)}}function Gz(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return It(f)?Ju(t,o)(f):o(f)}function o(f){return f===41?u(f):J3(t,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return It(f)?Ju(t,a)(f):u(f)}function l(f){return n(f)}function a(f){return f===34||f===39||f===40?t9(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return It(f)?Ju(t,u)(f):u(f)}function u(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function Kz(t,e,n){const r=this;return i;function i(l){return e9.call(r,t,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function s(l){return n(l)}}function Jz(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const ej={name:"labelStartImage",resolveAll:gv.resolveAll,tokenize:tj};function tj(t,e,n){const r=this;return i;function i(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),o}function o(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const nj={name:"labelStartLink",resolveAll:gv.resolveAll,tokenize:rj};function rj(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const o1={name:"lineEnding",tokenize:ij};function ij(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),et(t,e,"linePrefix")}}const mp={name:"thematicBreak",tokenize:oj};function oj(t,e,n){let r=0,i;return o;function o(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,l(c)}function l(c){return c===i?(t.enter("thematicBreakSequence"),a(c)):r>=3&&(c===null||Ce(c))?(t.exit("thematicBreak"),e(c)):n(c)}function a(c){return c===i?(t.consume(c),r++,a):(t.exit("thematicBreakSequence"),je(c)?et(t,l,"whitespace")(c):l(c))}}const hr={continuation:{tokenize:cj},exit:fj,name:"list",tokenize:aj},sj={partial:!0,tokenize:hj},lj={partial:!0,tokenize:uj};function aj(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:my(d)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(mp,n,c)(d):c(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),a(d)}return n(d)}function a(d){return my(d)&&++s<10?(t.consume(d),a):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),c(d)):n(d)}function c(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(jm,r.interrupt?n:u,t.attempt(sj,h,f))}function u(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function f(d){return je(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function cj(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(jm,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(t,e,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!je(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(lj,e,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(t,t.attempt(hr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function uj(t,e,n){const r=this;return et(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function fj(t){t.exit(this.containerState.type)}function hj(t,e,n){const r=this;return et(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!je(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const C_={name:"setextUnderline",resolveTo:dj,tokenize:pj};function dj(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function pj(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(t.consume(c),l):(t.exit("setextHeadingLineSequence"),je(c)?et(t,a,"lineSuffix")(c):a(c))}function a(c){return c===null||Ce(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const gj={tokenize:mj};function mj(t){const e=this,n=t.attempt(jm,r,t.attempt(this.parser.constructs.flowInitial,i,et(t,t.attempt(this.parser.constructs.flow,i,t.attempt(vz,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Oj={resolveAll:r9()},yj=n9("string"),xj=n9("text");function n9(t){return{resolveAll:r9(t==="text"?bj:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,l);return s;function s(u){return c(u)?o(u):l(u)}function l(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),a}function a(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),a)}function c(u){if(u===null)return!0;const f=i[u];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function r9(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function bj(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let o=i.length,s=-1,l=0,a;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)a=!0,l++;else if(c!==-1){o++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const c={type:n===t.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const vj={42:hr,43:hr,45:hr,48:hr,49:hr,50:hr,51:hr,52:hr,53:hr,54:hr,55:hr,56:hr,57:hr,62:Y3},Sj={91:_z},wj={[-2]:i1,[-1]:i1,32:i1},kj={35:Qz,42:mp,45:[C_,mp],60:Iz,61:C_,95:mp,96:w_,126:w_},Cj={38:G3,92:U3},_j={[-5]:o1,[-4]:o1,[-3]:o1,33:ej,38:G3,42:wy,60:[nz,zz],91:nj,92:[$z,U3],93:gv,95:wy,96:gz},Tj={null:[wy,Oj]},Pj={null:[42,95]},Ej={null:[]},$j=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Pj,contentInitial:Sj,disable:Ej,document:vj,flow:kj,flowInitial:wj,insideSpan:Tj,string:Cj,text:_j},Symbol.toStringTag,{value:"Module"}));function Aj(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const a={attempt:w(S),check:w(v),consume:y,enter:x,exit:b,interrupt:w(v,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:t,previous:null,sliceSerialize:h,sliceStream:d,write:f};let u=e.tokenize.call(c,a);return e.resolveAll&&o.push(e),c;function f(M){return s=qr(s,M),m(),s[s.length-1]!==null?[]:(k(e,0),c.events=Ph(o,c.events,c),c.events)}function h(M,I){return Mj(d(M),I)}function d(M){return Qj(s,M)}function p(){const{_bufferIndex:M,_index:I,line:$,column:D,offset:Z}=r;return{_bufferIndex:M,_index:I,line:$,column:D,offset:Z}}function g(M){i[M.line]=M.column,T()}function m(){let M;for(;r._index<s.length;){const I=s[r._index];if(typeof I=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<I.length;)O(I.charCodeAt(r._bufferIndex));else O(I)}}function O(M){u=u(M)}function y(M){Ce(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,T()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function x(M,I){const $=I||{};return $.type=M,$.start=p(),c.events.push(["enter",$,c]),l.push($),$}function b(M){const I=l.pop();return I.end=p(),c.events.push(["exit",I,c]),I}function S(M,I){k(M,I.from)}function v(M,I){I.restore()}function w(M,I){return $;function $(D,Z,G){let z,ee,oe,Q;return Array.isArray(D)?_e(D):"tokenize"in D?_e([D]):ve(D);function ve(pe){return he;function he(J){const ue=J!==null&&pe[J],Se=J!==null&&pe.null,Ae=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return _e(Ae)(J)}}function _e(pe){return z=pe,ee=0,pe.length===0?G:L(pe[ee])}function L(pe){return he;function he(J){return Q=P(),oe=pe,pe.partial||(c.currentConstruct=pe),pe.name&&c.parser.constructs.disable.null.includes(pe.name)?Be():pe.tokenize.call(I?Object.assign(Object.create(c),I):c,a,Ie,Be)(J)}}function Ie(pe){return M(oe,Q),Z}function Be(pe){return Q.restore(),++ee<z.length?L(z[ee]):G}}}function k(M,I){M.resolveAll&&!o.includes(M)&&o.push(M),M.resolve&&qn(c.events,I,c.events.length-I,M.resolve(c.events.slice(I),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function P(){const M=p(),I=c.previous,$=c.currentConstruct,D=c.events.length,Z=Array.from(l);return{from:D,restore:G};function G(){r=M,c.previous=I,c.currentConstruct=$,c.events.length=D,l=Z,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Qj(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,o)];else{if(s=t.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function Mj(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
58
|
-
`;break}case-3:{s=`\r
|
|
59
|
-
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Rj(t){const r={constructs:WZ([$j,...(t||{}).extensions||[]]),content:i(YZ),defined:[],document:i(GZ),flow:i(gj),lazy:{},string:i(yj),text:i(xj)};return r;function i(o){return s;function s(l){return Aj(r,o,l)}}}function Lj(t){for(;!K3(t););return t}const __=/[\0\t\n\r]/g;function Ij(){let t=1,e="",n=!0,r;return i;function i(o,s,l){const a=[];let c,u,f,h,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(__.lastIndex=f,c=__.exec(o),h=c&&c.index!==void 0?c.index:o.length,d=o.charCodeAt(h),!c){e=o.slice(f);break}if(d===10&&f===h&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),f<h&&(a.push(o.slice(f,h)),t+=h-f),d){case 0:{a.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,a.push(-2);t++<u;)a.push(-1);break}case 10:{a.push(-4),t=1;break}default:r=!0,t=1}f=h+1}return l&&(r&&a.push(-5),e&&a.push(e),a.push(null)),a}}const i9={}.hasOwnProperty;function Dj(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),Nj(n)(Lj(Rj(n).document().write(Ij()(t,e,!0))))}function Nj(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Tn),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(st),blockQuote:o(Se),characterEscape:P,characterReference:P,codeFenced:o(Ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ae,s),codeText:o(Ze,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(Ue),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Qt),hardBreakEscape:o(Gt),hardBreakTrailing:o(Gt),htmlFlow:o(Kt,s),htmlFlowData:P,htmlText:o(Kt,s),htmlTextData:P,image:o(fr),label:s,link:o(Tn),listItem:o(un),listItemValue:h,listOrdered:o(Cr,f),listUnordered:o(Cr),paragraph:o(Oi),reference:L,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(st),strong:o(_r),thematicBreak:o(Kn)},exit:{atxHeading:a(),atxHeadingSequence:S,autolink:a(),autolinkEmail:ue,autolinkProtocol:J,blockQuote:a(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Be,characterReferenceMarkerNumeric:Be,characterReferenceValue:pe,characterReference:he,codeFenced:a(m),codeFencedFence:g,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:T,codeIndented:a(O),codeText:a(Z),codeTextData:T,data:T,definition:a(),definitionDestinationString:b,definitionLabelString:y,definitionTitleString:x,emphasis:a(),hardBreakEscape:a(I),hardBreakTrailing:a(I),htmlFlow:a($),htmlFlowData:T,htmlText:a(D),htmlTextData:T,image:a(z),label:oe,labelText:ee,lineEnding:M,link:a(G),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:Ie,resourceDestinationString:Q,resourceTitleString:ve,resource:_e,setextHeading:a(k),setextHeadingLineSequence:w,setextHeadingText:v,strong:a(),thematicBreak:a()}};o9(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(U){let re={type:"root",children:[]};const E={stack:[re],tokenStack:[],config:e,enter:l,exit:c,buffer:s,resume:u,data:n},Me=[];let We=-1;for(;++We<U.length;)if(U[We][1].type==="listOrdered"||U[We][1].type==="listUnordered")if(U[We][0]==="enter")Me.push(We);else{const kt=Me.pop();We=i(U,kt,We)}for(We=-1;++We<U.length;){const kt=e[U[We][0]];i9.call(kt,U[We][1].type)&&kt[U[We][1].type].call(Object.assign({sliceSerialize:U[We][2].sliceSerialize},E),U[We][1])}if(E.tokenStack.length>0){const kt=E.tokenStack[E.tokenStack.length-1];(kt[1]||T_).call(E,void 0,kt[0])}for(re.position={start:ps(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:ps(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<e.transforms.length;)re=e.transforms[We](re)||re;return re}function i(U,re,E){let Me=re-1,We=-1,kt=!1,Wr,R,F,B;for(;++Me<=E;){const K=U[Me];switch(K[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{K[0]==="enter"?We++:We--,B=void 0;break}case"lineEndingBlank":{K[0]==="enter"&&(Wr&&!B&&!We&&!F&&(F=Me),B=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:B=void 0}if(!We&&K[0]==="enter"&&K[1].type==="listItemPrefix"||We===-1&&K[0]==="exit"&&(K[1].type==="listUnordered"||K[1].type==="listOrdered")){if(Wr){let ie=Me;for(R=void 0;ie--;){const ae=U[ie];if(ae[1].type==="lineEnding"||ae[1].type==="lineEndingBlank"){if(ae[0]==="exit")continue;R&&(U[R][1].type="lineEndingBlank",kt=!0),ae[1].type="lineEnding",R=ie}else if(!(ae[1].type==="linePrefix"||ae[1].type==="blockQuotePrefix"||ae[1].type==="blockQuotePrefixWhitespace"||ae[1].type==="blockQuoteMarker"||ae[1].type==="listItemIndent"))break}F&&(!R||F<R)&&(Wr._spread=!0),Wr.end=Object.assign({},R?U[R][1].start:K[1].end),U.splice(R||Me,0,["exit",Wr,K[2]]),Me++,E++}if(K[1].type==="listItemPrefix"){const ie={type:"listItem",_spread:!1,start:Object.assign({},K[1].start),end:void 0};Wr=ie,U.splice(Me,0,["enter",ie,K[2]]),Me++,E++,F=void 0,B=!0}}}return U[re][1]._spread=kt,E}function o(U,re){return E;function E(Me){l.call(this,U(Me),Me),re&&re.call(this,Me)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(U,re,E){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([re,E||void 0]),U.position={start:ps(re.start),end:void 0}}function a(U){return re;function re(E){U&&U.call(this,E),c.call(this,E)}}function c(U,re){const E=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==U.type&&(re?re.call(this,U,Me[0]):(Me[1]||T_).call(this,U,Me[0]));else throw new Error("Cannot close `"+U.type+"` ("+Io({start:U.start,end:U.end})+"): it’s not open");E.position.end=ps(U.end)}function u(){return hv(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const re=this.stack[this.stack.length-2];re.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),re=this.stack[this.stack.length-1];re.lang=U}function p(){const U=this.resume(),re=this.stack[this.stack.length-1];re.meta=U}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function O(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const re=this.resume(),E=this.stack[this.stack.length-1];E.label=re,E.identifier=nc(this.sliceSerialize(U)).toLowerCase()}function x(){const U=this.resume(),re=this.stack[this.stack.length-1];re.title=U}function b(){const U=this.resume(),re=this.stack[this.stack.length-1];re.url=U}function S(U){const re=this.stack[this.stack.length-1];if(!re.depth){const E=this.sliceSerialize(U).length;re.depth=E}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function w(U){const re=this.stack[this.stack.length-1];re.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const E=this.stack[this.stack.length-1].children;let Me=E[E.length-1];(!Me||Me.type!=="text")&&(Me=ft(),Me.position={start:ps(U.start),end:void 0},E.push(Me)),this.stack.push(Me)}function T(U){const re=this.stack.pop();re.value+=this.sliceSerialize(U),re.position.end=ps(U.end)}function M(U){const re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const E=re.children[re.children.length-1];E.position.end=ps(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(re.type)&&(P.call(this,U),T.call(this,U))}function I(){this.data.atHardBreak=!0}function $(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function D(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function Z(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function G(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=re,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function z(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=re,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function ee(U){const re=this.sliceSerialize(U),E=this.stack[this.stack.length-2];E.label=Z3(re),E.identifier=nc(re).toLowerCase()}function oe(){const U=this.stack[this.stack.length-1],re=this.resume(),E=this.stack[this.stack.length-1];if(this.data.inReference=!0,E.type==="link"){const Me=U.children;E.children=Me}else E.alt=re}function Q(){const U=this.resume(),re=this.stack[this.stack.length-1];re.url=U}function ve(){const U=this.resume(),re=this.stack[this.stack.length-1];re.title=U}function _e(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function Ie(U){const re=this.resume(),E=this.stack[this.stack.length-1];E.label=re,E.identifier=nc(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function Be(U){this.data.characterReferenceType=U.type}function pe(U){const re=this.sliceSerialize(U),E=this.data.characterReferenceType;let Me;E?(Me=F3(re,E==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=Rf(re);const We=this.stack[this.stack.length-1];We.value+=Me}function he(U){const re=this.stack.pop();re.position.end=ps(U.end)}function J(U){T.call(this,U);const re=this.stack[this.stack.length-1];re.url=this.sliceSerialize(U)}function ue(U){T.call(this,U);const re=this.stack[this.stack.length-1];re.url="mailto:"+this.sliceSerialize(U)}function Se(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function Ze(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qt(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:0,children:[]}}function Gt(){return{type:"break"}}function Kt(){return{type:"html",value:""}}function fr(){return{type:"image",title:null,url:"",alt:null}}function Tn(){return{type:"link",title:null,url:"",children:[]}}function Cr(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function un(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Oi(){return{type:"paragraph",children:[]}}function _r(){return{type:"strong",children:[]}}function ft(){return{type:"text",value:""}}function Kn(){return{type:"thematicBreak"}}}function ps(t){return{line:t.line,column:t.column,offset:t.offset}}function o9(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?o9(t,r):Vj(t,r)}}function Vj(t,e){let n;for(n in e)if(i9.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function T_(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Io({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Io({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Io({start:e.start,end:e.end})+") is still open")}class ml extends Error{constructor(e,n,r,i){const o=e.name??"Fragment",s=e.type==="mdxJsxFlowElement"?"flow":"text",l=i?` ${i}`:"";super(`JSX component "${o}" was parsed as ${s} but is declared as ${n.kind} (kindMismatchPolicy: "${r}").${l}`),this.name="JsxKindMismatchError"}}const Bj=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell","footnote","mdxJsxTextElement","textDirective","leafDirective"]),Fj=new Set(["root","blockquote","listItem","footnoteDefinition","mdxJsxFlowElement","containerDirective"]);function Op(t){return t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement"}function s9(t,e){return e.find(n=>n.name===t.name)??e.find(n=>n.name==="*")}function yp(t,e){return(t.type==="mdxJsxFlowElement"?"flow":"text")!==e.kind}function l9(t,e,n){if(Op(t)){const r=s9(t,e);if(r&&n(t)&&yp(t,r))throw new ml(t,r,"error")}"children"in t&&t.children.forEach(r=>{l9(r,e,n)})}function Zj(t,e,n){const r=f=>n(f)?s9(f,e):void 0;function i(f){const h=Bj.has(f.type)?"phrasing":Fj.has(f.type)?"flow":"structural";return h==="phrasing"?f.children=f.children.flatMap(d=>l(d,f.type)):h==="flow"?f.children=f.children.flatMap(d=>c(d)):f.children=f.children.map(d=>s(d,f.type)),f}function o(f){return"children"in f&&i(f),f}function s(f,h){if(Op(f)){const d=r(f);if(d&&yp(f,d))throw new ml(f,d,"normalize",`The ${h} parent does not declare whether its children are flow or phrasing content.`)}return o(f)}function l(f,h){if(!Op(f))return[o(f)];const d=r(f);if(!d||!yp(f,d))return[o(f)];if(f.type==="mdxJsxTextElement")throw new ml(f,d,"normalize",`It cannot be lifted from ${h} without changing surrounding phrasing content.`);const p=u(f,d);return[o(p)]}function a(f){const h=f.children.find(g=>{if(g.type!=="mdxJsxTextElement")return!1;const m=r(g);return m?.kind==="flow"});if(!h)return[i(f)];const d=r(h);if(f.children.length!==1)throw new ml(h,d,"normalize","It has surrounding phrasing content, and normalization would need to split the paragraph.");const p={...h,type:"mdxJsxFlowElement",children:h.children.length===0?[]:[{type:"paragraph",children:h.children}]};return[o(p)]}function c(f){if(f.type==="paragraph")return a(f);if(!Op(f))return[o(f)];const h=r(f);if(!h||!yp(f,h))return[o(f)];if(f.type==="mdxJsxTextElement")throw new ml(f,h,"normalize","A text JSX node can be normalized to flow only when it is the sole child of a paragraph.");return[{type:"paragraph",children:[o(u(f,h))]}]}function u(f,h){if(f.children.length===0)return{...f,type:"mdxJsxTextElement",children:[]};if(f.children.length!==1||f.children[0].type!=="paragraph")throw new ml(f,h,"normalize","Its block children cannot be represented as one phrasing-content sequence without data loss.");return{...f,type:"mdxJsxTextElement",children:f.children[0].children}}return i(t)}function zj(t,e,n,r=()=>!0){return n==="source"?t:n==="error"?(l9(t,e,r),t):Zj(structuredClone(t),e,r)}function _u(t){return t.children instanceof Array}class ky extends Error{constructor(e,n){super(e),this.name="MarkdownParseError",this.cause=n}}class Cy extends Error{constructor(e){super(e),this.name="UnrecognizedMarkdownConstructError"}}function jj(t){const e=new Map;return t.type!=="root"?{importDeclarations:{}}:(t.children.filter(r=>r.type==="mdxjsEsm").filter(r=>r.value.startsWith("import ")).forEach(r=>{var i,o;(((o=(i=r.data)==null?void 0:i.estree)==null?void 0:o.body)??[]).forEach(s=>{s.type==="ImportDeclaration"&&s.specifiers.forEach(l=>{e.set(l.local.name,{source:`${s.source.value}`,defaultExport:l.type==="ImportDefaultSpecifier"})})})}),{importDeclarations:Object.fromEntries(e.entries())})}function Xj({root:t,markdown:e,visitors:n,syntaxExtensions:r,mdastExtensions:i,...o}){var s;let l;try{l=Dj(e,{extensions:r,mdastExtensions:i})}catch(a){throw a instanceof Error?new ky(`Error parsing markdown: ${a.message}`,a):new ky(`Error parsing markdown: ${a}`,a)}l.children.length===0&&l.children.push({type:"paragraph",children:[]}),((s=l.children.at(-1))==null?void 0:s.type)!=="paragraph"&&l.children.push({type:"paragraph",children:[]}),a9({root:t,mdastRoot:l,visitors:n,...o})}function a9({root:t,mdastRoot:e,visitors:n,...r}){n=n.sort((u,f)=>(f.priority??0)-(u.priority??0));function i(u,f=null){return n.find((h,d)=>f?.has(d)?!1:typeof h.testNode=="string"?h.testNode===u.type:h.testNode(u,r))}e=zj(e,r.jsxComponentDescriptors,r.jsxKindMismatchPolicy??"source",u=>{var f;return((f=i(u))==null?void 0:f.jsxKindReconciliationOwner)===!0});const o=new WeakMap,s=new WeakMap,l=jj(e);function a(u,f){if(!_u(u))throw new Error("Attempting to visit children of a non-parent");u.children.forEach(h=>{c(h,f,u)})}function c(u,f,h,d=null){const p=i(u,d);if(!p)try{throw new Cy(`Unsupported markdown syntax: ${z3(u)}`)}catch{throw new Cy(`Parsing of the following markdown structure failed: ${JSON.stringify({type:u.type,name:"name"in u?u.name:"N/A"})}`)}p.visitNode({mdastNode:u,lexicalParent:f,mdastParent:h,descriptors:r,metaData:l,actions:{visitChildren:a,nextVisitor(){c(u,f,h,(d??new Set).add(n.indexOf(p)))},addAndStepInto(g){f.append(g),_u(u)&&a(u,g)},addFormatting(g,m){m||_u(u)&&(m=u),m&&o.set(m,g|(o.get(h)??0))},removeFormatting(g,m){m||_u(u)&&(m=u),m&&o.set(m,g^(o.get(h)??0))},getParentFormatting(){return o.get(h)??0},addStyle(g,m){m||_u(u)&&(m=u),m&&s.set(m,g)},getParentStyle(){return s.get(h)??""}}})}c(e,t,null)}function El(){}var Wj=Object.defineProperty,Hj=(t,e,n)=>e in t?Wj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,s1=(t,e,n)=>Hj(t,typeof e!="symbol"?e+"":e,n);const P_="generic-html";class Eh extends sr{constructor(e,n,r,i){super(i),s1(this,"__tag"),s1(this,"__nodeType"),s1(this,"__attributes"),this.__tag=e,this.__nodeType=n,this.__attributes=r}static getType(){return P_}static clone(e){return new Eh(e.__tag,e.__nodeType,e.__attributes,e.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){const n=this.getWritable();n.__attributes=e}getStyle(){var e;return(e=this.__attributes.find(n=>n.name==="style"))==null?void 0:e.value}createDOM(){const e=this.__tag,n=document.createElement(e);return this.__attributes.forEach(r=>{n.setAttribute(r.name,r.value)}),n}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){const{element:n}=super.exportDOM(e);return{element:n}}static importJSON(e){const n=c9(e.tag,e.mdxType,e.attributes);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:P_,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType==="mdxJsxTextElement"}}function c9(t,e,n){return zr(new Eh(t,e,n))}function qj(t){return t instanceof Eh}const Yj={testLexicalNode:qj,visitLexicalNode({actions:t,lexicalNode:e}){t.addAndStepInto("mdxJsxTextElement",{name:e.getTag(),type:e.getNodeType(),attributes:e.getAttributes()})},priority:-100},Uj={testLexicalNode:kn,visitLexicalNode:({mdastParent:t,actions:e})=>{e.appendToParent(t,{type:"text",value:`
|
|
60
|
-
`})}},Gj={testLexicalNode:Zc,visitLexicalNode:({actions:t})=>{t.addAndStepInto("paragraph")}},Kj={testLexicalNode:Nt,visitLexicalNode:({actions:t})=>{t.addAndStepInto("root")}},ef=1,tf=2,xp=4,nf=8,Xm=16,bp=32,vp=64,Sp=128;function E_(t){return t.type==="text"}const Jj=["u","span","sub","sup"],eX={shouldJoin:(t,e)=>{if(["text","emphasis","strong","highlight"].includes(t.type))return t.type===e.type;if(t.type==="mdxJsxTextElement"&&e.type==="mdxJsxTextElement"&&Jj.includes(e.name)){const n=e;return t.name===n.name&&JSON.stringify(t.attributes)===JSON.stringify(n.attributes)}return!1},join(t,e){return E_(t)&&E_(e)?{type:"text",value:t.value+e.value}:{...t,children:[...t.children,...e.children]}},testLexicalNode:Y,visitLexicalNode:({lexicalNode:t,mdastParent:e,actions:n})=>{const r=t.getPreviousSibling(),i=Y(r)?r.getFormat():0,o=t.getTextContent(),s=t.getFormat(),l=t.getStyle();let a=e;if(l&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"span",children:[],attributes:[{type:"mdxJsxAttribute",name:"style",value:l}]})),i&s&nf&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),i&s&vp&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),i&s&bp&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),i&s&tf&&(a=n.appendToParent(a,{type:"emphasis",children:[]})),i&s&ef&&(a=n.appendToParent(a,{type:"strong",children:[]})),i&s&xp&&(a=n.appendToParent(a,{type:"delete",children:[]})),i&s&Sp&&(a=n.appendToParent(a,{type:"highlight",children:[]})),s&nf&&!(i&nf)&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),s&vp&&!(i&vp)&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),s&bp&&!(i&bp)&&(a=n.appendToParent(a,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),s&tf&&!(i&tf)&&(a=n.appendToParent(a,{type:"emphasis",children:[]})),s&ef&&!(i&ef)&&(a=n.appendToParent(a,{type:"strong",children:[]})),s&xp&&!(i&xp)&&(a=n.appendToParent(a,{type:"delete",children:[]})),s&Sp&&!(i&Sp)&&(a=n.appendToParent(a,{type:"highlight",children:[]})),s&Xm){n.appendToParent(a,{type:"inlineCode",value:o});return}n.appendToParent(a,{type:"text",value:o})}},tX={testNode:"break",visitNode:function({lexicalParent:t}){t.append(Sr())}};function cd(t,e){return[{testNode:n=>n.type==="mdxJsxTextElement"&&n.name===t,visitNode({actions:n,mdastNode:r,lexicalParent:i}){n.addFormatting(e),n.visitChildren(r,i)}},{testNode:n=>n.type==="html"&&n.value===`<${t}>`,visitNode({actions:n,mdastParent:r}){n.addFormatting(e,r)}},{testNode:n=>n.type==="html"&&n.value===`</${t}>`,visitNode({actions:n,mdastParent:r}){n.removeFormatting(e,r)}}]}const nX={testNode:"delete",visitNode({mdastNode:t,actions:e,lexicalParent:n}){e.addFormatting(xp),e.visitChildren(t,n)}},rX={testNode:"highlight",visitNode({mdastNode:t,actions:e,lexicalParent:n}){e.addFormatting(Sp),e.visitChildren(t,n)}},iX={testNode:"inlineCode",visitNode({mdastNode:t,actions:e}){e.addAndStepInto(bt(t.value).setFormat(e.getParentFormatting()|Xm))}},oX={testNode:"emphasis",visitNode({mdastNode:t,actions:e,lexicalParent:n}){e.addFormatting(tf),e.visitChildren(t,n)}},sX={testNode:"strong",visitNode({mdastNode:t,actions:e,lexicalParent:n}){e.addFormatting(ef),e.visitChildren(t,n)}},lX=[oX,sX,...cd("u",nf),...cd("code",Xm),iX,nX,rX,...cd("sup",vp),...cd("sub",bp)],aX={testNode:j3,visitNode:function({mdastNode:t,actions:e,lexicalParent:n}){t.name==="span"&&t.attributes.length===1&&t.attributes[0].type==="mdxJsxAttribute"&&t.attributes[0].name==="style"?(e.addStyle(t.attributes[0].value,t),e.visitChildren(t,n)):e.addAndStepInto(c9(t.name,t.type,t.attributes))},priority:-100},cX=["listitem","admonition"],uX={testNode:"paragraph",visitNode:function({mdastNode:t,mdastParent:e,lexicalParent:n,actions:r}){const i=n.getType();if(cX.includes(i)){const o=e?.children.indexOf(t)??-1,s=o>0?e?.children.at(o-1):void 0;i==="listitem"&&s?.type==="paragraph"&&n.append(Sr(),Sr()),r.visitChildren(t,n)}else r.addAndStepInto(He())}},fX={testNode:"root",visitNode({actions:t,mdastNode:e,lexicalParent:n}){t.visitChildren(e,n)}},hX={testNode:"text",visitNode({mdastNode:t,actions:e}){const n=bt(t.value);n.setFormat(e.getParentFormatting());const r=e.getParentStyle();r!==""&&n.setStyle(r),e.addAndStepInto(n)}},bi={dash:45,eof:null,exclamationMark:33,greaterThan:62},cl={data:"data",lineEnding:"lineEnding",linePrefix:"linePrefix"};function dX(t){return{canContainEols:["comment"],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}const $_=(t,e,n)=>{return r;function r(p){return t.enter("comment"),t.consume(p),i}function i(p){return p===bi.exclamationMark?(t.consume(p),o):n(p)}function o(p){return p===bi.dash?(t.consume(p),s):n(p)}function s(p){return p===bi.dash?(t.consume(p),l):n(p)}function l(p){return p===bi.greaterThan?n(p):Ce(p)?u(p):(t.enter(cl.data),p===bi.dash?(t.consume(p),a):c(p))}function a(p){return p===bi.greaterThan?n(p):c(p)}function c(p){return p===bi.eof?n(p):p===bi.dash?(t.consume(p),h):Ce(p)?(t.exit(cl.data),u(p)):(t.consume(p),c)}function u(p){return t.enter(cl.lineEnding),t.consume(p),t.exit(cl.lineEnding),et(t,f,cl.linePrefix)}function f(p){return Ce(p)?u(p):(t.enter(cl.data),c(p))}function h(p){return p===bi.dash?(t.consume(p),d):c(p)}function d(p){return p===bi.greaterThan?(t.exit(cl.data),t.enter("commentEnd"),t.consume(p),t.exit("commentEnd"),t.exit("comment"),e(p)):p===bi.dash?(t.consume(p),d):c(p)}},pX={flow:{60:{tokenize:$_,concrete:!0}},text:{60:{tokenize:$_}}},gX="_bold_6j9u9_10",mX="_italic_6j9u9_14",OX="_underline_6j9u9_18",yX="_strikethrough_6j9u9_34",xX="_underlineStrikethrough_6j9u9_38",bX="_subscript_6j9u9_42",vX="_superscript_6j9u9_47",SX="_code_6j9u9_52",wX="_quote_6j9u9_59",kX="_nestedListItem_6j9u9_66",CX="_listitem_6j9u9_76",_X="_listItemChecked_6j9u9_80",TX="_listItemUnchecked_6j9u9_81",PX="_admonitionDanger_6j9u9_158",EX="_admonitionInfo_6j9u9_159",$X="_admonitionNote_6j9u9_160",AX="_admonitionTip_6j9u9_161",QX="_admonitionCaution_6j9u9_162",dn={bold:gX,italic:mX,underline:OX,strikethrough:yX,underlineStrikethrough:xX,subscript:bX,superscript:vX,code:SX,quote:wX,nestedListItem:kX,listitem:CX,listItemChecked:_X,listItemUnchecked:TX,admonitionDanger:PX,admonitionInfo:EX,admonitionNote:$X,admonitionTip:AX,admonitionCaution:QX},u9={quote:dn.quote,text:{bold:dn.bold,italic:dn.italic,underline:dn.underline,code:dn.code,strikethrough:dn.strikethrough,subscript:dn.subscript,superscript:dn.superscript,underlineStrikethrough:dn.underlineStrikethrough},list:{listitem:dn.listitem,listitemChecked:dn.listItemChecked,listitemUnchecked:dn.listItemUnchecked,nested:{listitem:dn.nestedListItem}},admonition:{danger:dn.admonitionDanger,info:dn.admonitionInfo,note:dn.admonitionNote,tip:dn.admonitionTip,caution:dn.admonitionCaution}},f9=C.createContext(null);function jr(){const t=C.useContext(f9);return t==null&&(function(e,...n){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const o of n)i.append("v",o);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),t}function MX(){return ut().getTextContent()}function RX(t,e=!0){if(t)return!1;let n=MX();return e&&(n=n.trim()),n===""}function LX(t){if(!RX(t,!1))return!1;const e=ut().getChildren(),n=e.length;if(n>1)return!1;for(let r=0;r<n;r++){const i=e[r];if(Fe(i))return!1;if(N(i)){if(!Zc(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!Y(a))return!1}}}return!0}function h9(t){return()=>LX(t)}const d9=cr?C.useLayoutEffect:C.useEffect;function IX({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:o,ariaExpanded:s,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:h,autoCapitalize:d,className:p,id:g,role:m="textbox",spellCheck:O=!0,style:y,tabIndex:x,"data-testid":b,...S},v){const[w,k]=C.useState(t.isEditable()),P=C.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?t.setRootElement(M):t.setRootElement(null)},[t]),T=C.useMemo(()=>(function(...M){return I=>{for(const $ of M)typeof $=="function"?$(I):$!=null&&($.current=I)}})(v,P),[P,v]);return d9(()=>(k(t.isEditable()),t.registerEditableListener(M=>{k(M)})),[t]),V.jsx("div",{"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?r:void 0,"aria-describedby":i,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":w&&m==="combobox"?!!s:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":c,"aria-multiline":u,"aria-owns":w?f:void 0,"aria-readonly":!w||void 0,"aria-required":h,autoCapitalize:d,className:p,contentEditable:w,"data-testid":b,id:g,ref:T,role:m,spellCheck:O,style:y,tabIndex:x??(w?void 0:-1),...S})}const DX=C.forwardRef(IX);function A_(t){return t.read("latest",h9(t.isComposing()))}const mv=C.forwardRef(NX);function NX(t,e){const{placeholder:n,...r}=t,[i]=jr();return V.jsxs(V.Fragment,{children:[V.jsx(DX,{editor:i,...r,ref:e}),n!=null&&V.jsx(VX,{editor:i,content:n})]})}function VX({content:t,editor:e}){const n=(function(s){const[l,a]=C.useState(()=>A_(s));return d9(()=>{function c(){const u=A_(s);a(u)}return c(),ln(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l})(e),[r,i]=C.useState(e.isEditable());if(C.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!n)return null;let o=null;return typeof t=="function"?o=t(r):t!==null&&(o=t),o===null?null:V.jsx("div",{"aria-hidden":!0,children:o})}let BX=class extends C.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:new Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Ov({children:t,fallback:e,onError:n}){return V.jsx(BX,{fallback:e===void 0?V.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):e,onError:n,children:t})}const mg={name:"@lexical/react/ReactProvider"};var Ns=b6();function FX(t,e){const[n]=e,r=t.decorators.map(i=>typeof i=="function"?V.jsx(i,{context:e}):i);return function(i){const{EditorChildrenComponent:o=t.EditorChildrenComponent,ErrorBoundary:s=t.ErrorBoundary,contentEditable:l=t.contentEditable,children:a}=i,c=(function(f,h){const[d,p]=C.useMemo(()=>[m=>f.registerDecoratorListener(m),()=>f.getDecorators()],[f]),g=C.useSyncExternalStore(d,p,p);return C.useMemo(()=>{const m=[];for(const O in g){const y=f.getElementByKey(O);if(y!==null){const x=V.jsx(h,{onError:b=>{f._onError(b)},children:V.jsx(C.Suspense,{fallback:null,children:g[O]})});m.push(Ns.createPortal(x,y,O))}}return m},[h,g,f])})(n,s),u=C.useMemo(()=>r.map((f,h)=>V.jsx(s,{onError:d=>{n._onError(d)},children:V.jsx(C.Suspense,{fallback:null,children:f})},h)),[s]);return V.jsx(f9.Provider,{value:e,children:V.jsxs(o,{context:e,contentEditable:l,children:[a,u,c]})})}}function ZX({contentEditable:t,children:e}){return V.jsxs(V.Fragment,{children:[t,e]})}const zX={EditorChildrenComponent:ZX,ErrorBoundary:Ov,contentEditable:V.jsx(mv,{}),decorators:[]},p9={build(t,e,n){n.getPeer(mg.name)||(function(i,...o){const s=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",i);for(const a of o)l.append("v",a);throw s.search=l.toString(),Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(321,[...n.getDirectDependentNames()].join(" "));const r=[t,{getTheme:()=>t._config.theme}];return{Component:FX(e,r),context:r}},config:zX,mergeConfig(t,e){const n=Lm(t,e);return e.decorators&&(n.decorators=e.decorators.length>0?[...t.decorators,...e.decorators]:t.decorators),n},name:"@lexical/react/React",peerDependencies:[CN(mg.name)]},jX=new WeakSet,XX=new WeakMap,WX=new Set([ca,hi,ua,sa,Ys]),ul=new WeakMap;function HX(t){return Va(ec,{createInitialHistoryState:()=>t,disabled:!1})}function g9({name:t,namespace:e,nodes:n,theme:r,editable:i=!0,parentEditor:o,historyMode:s,historyState:l,initialEditorState:a,onError:c=u=>{throw u}}){const u=[mg,Va(p9,{contentEditable:null}),Va(IA,{setOptions:{tag:_l},updateOptions:{tag:_l}})];if(o&&u.push(Va(UN,{$getParentEditor:()=>o,inheritEditableFromParent:!0})),s==="nested-shared")u.push(nV);else if(s==="root-shared"||s==="nested-external"){if(!l)throw new Error(`${s} requires a historyState`);u.push(HX(l))}else s==="table-local"&&u.push(Va(ec,{disabled:!1}));const f={name:t,namespace:e,nodes:n?.filter(b=>!WX.has(b)),theme:r,editable:i,$initialEditorState:a,onError:c,dependencies:u},h=XN(f),d=da(h,ec.name),p=d?.output.historyState.value;p&&XX.set(h,p),p&&(ul.has(p)||ul.set(p,p.current));const g=p?h.registerUpdateListener(({dirtyElements:b,dirtyLeaves:S,tags:v})=>{const w=p.current;if(v.has(_l)){ul.set(p,w);return}if(b.size>0||S.size>0){ul.set(p,w);return}const k=ul.get(p);w?.editor===h&&k&&k.editor!==h&&(p.undoStack.push({...k}),p.redoStack=[],h.dispatchCommand(Sl,!0),h.dispatchCommand(vl,!1)),ul.set(p,w)}):()=>{},m=new Set,O=p?h.registerCommand(wm,()=>{const b=setTimeout(()=>{m.delete(b),h.dispatchCommand(Sl,p.undoStack.length>0),h.dispatchCommand(vl,p.redoStack.length>0)});return m.add(b),!1},fn):()=>{},y=h.dispose.bind(h);let x=!1;return h.dispose=()=>{x||(x=!0,m.forEach(clearTimeout),m.clear(),O(),g(),y())},s==="root-shared"&&jX.add(h),h}const If=Pe("NESTED_EDITOR_UPDATED_COMMAND"),cs=we(null),zt=we(null),_y=we(""),Ty=we(!0),ui=we(!1,t=>{t.sub(t.pipe(ui,rn(cs)),([e,n])=>{n?.setEditable(!e)})}),Py=we(""),Q_=we(!1),Df=we(!1),yv=we(0),Nf=we(null),Ey=Nn(t=>{t.link(t.pipe(Nf,dm(e=>e!==null)),Ey)}),xv=Nn(t=>{t.sub(t.pipe(xv,rn(zt)),([e,n])=>{n?.dispatchCommand(Qo,e)})}),wc=we(null,t=>{t.sub(t.pipe(wc,rn(zt)),([e,n])=>{if(!e||!n)return;const r=e.anchor.getNode();let i=r.getKey()==="root"?r:lt(r,l=>{const a=l.getParent();return a!==null&>(a)});i??(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null){const l=Zm(i)?i.getTag():i.getType();t.pub(L9,l)}})}),m9=we(""),uo=we(""),Og=we(!1),Wm=Nn(t=>{t.link(uo,Wm),t.sub(m9,e=>{t.pubIn({[Og]:!0,[uo]:e})})}),$y=Nn(t=>{t.link(t.pipe(Wm,rn(Ay),dm(([,e])=>!e),Rl(([e])=>e)),$y)},!0),bv=we([]),vv=we([]),O9=we([]),y9=we([]),Hm=we([]),Sv=we([]),yg=we({}),wv=we(!1),qm=we([]),qX=we("source"),x9=we([]),$h=we([]),kc=we(""),qc=we(null),YX=we(null),b9=we(null),tl=Un(vv),es=Un(bv),xg=Un(O9),bg=Un(y9),nl=Un(Hm),kv=Un(Sv),Ay=we(!1),Cv=Nn(t=>{t.sub(t.pipe(Cv,rn(uo,cs,Df),dm(([e,n])=>e.trim()!==n.trim())),([e,,n,r])=>{t.pub(Ay,!0),n?.update(()=>{ut().clear(),_v(t,ut(),e),r?n.focus():Vt(null)},{onUpdate:()=>{t.pub(Ay,!1)}})})}),v9=Nn(t=>{t.sub(t.pipe(v9,rn(zt,Df)),([e,n,r])=>{n?.update(()=>{const i=ne();if(i!==null){const o={children:[],append(s){this.children.push(s)},getType(){return i.getNodes()[0].getType()}};_v(t,o,e),_m(o.children)}r?n.focus():Vt(null)})})});function S9(){return TE((t,[e,n])=>(t.forEach(r=>{if(!r)throw new Error("You have a subscription that does not return a teardown");r()}),n?e.map(r=>r(n)):[]),[])}const w9=we(null),k9=we([],t=>{t.pipe(t.combine(k9,zt),S9())}),C9=we([],t=>{t.pipe(t.combine(C9,cs),S9())}),_9=we(null,El,(t,e)=>!!(t&&e&&t.editorRef===e.editorRef)),Vf=Nn(),Bn=we(t=>{throw new Error(`No icon component for ${t}`)});function Un(t,e){return Nn((n,r)=>{n.changeWith(t,r,(i,o)=>{Array.isArray(o)||(o=[o]);let s=i;for(const l of o)i.includes(l)||(s=[...s,l]);return s}),e?.(n,r)})}function T9(t){const e=ne();X(e)&&t.pubIn({[wc]:e,[yv]:e.format})}const P9=Un(C9,(t,e)=>{t.pub(e,[n=>n.registerCommand(Tb,(r,i)=>(t.pubIn({[zt]:i,[Df]:!0}),i._parentEditor===null&&i.getEditorState().read(()=>{t.pub(_9,{rootNode:ut(),editorType:"lexical",editorRef:i})}),T9(t),!1),co),n=>n.registerUpdateListener(({dirtyElements:r,dirtyLeaves:i,editorState:o})=>{if(t.getValue(Nf)!==null||r.size===0&&i.size===0)return;let l;o.read(()=>{ut().getLastChild()instanceof Fc&&n.update(()=>{ut().append(He())},{discrete:!0}),l=q3({root:ut(),visitors:t.getValue(Hm),jsxComponentDescriptors:t.getValue(qm),toMarkdownExtensions:t.getValue(Sv),toMarkdownOptions:t.getValue(yg),jsxIsAvailable:t.getValue(wv)})}),t.pub(uo,l.trim()),t.pub(Og,!1)}),n=>n.registerCommand(wm,()=>(t.pub(Df,!0),!1),co)])}),vg=Un(k9,(t,e)=>{t.pub(e,[n=>n.registerUpdateListener(({editorState:r})=>{r.read(()=>{T9(t)})}),n=>n.registerCommand(Lb,r=>{var i;const o=t.getValue(cs);return o&&!((i=o.getRootElement())!=null&&i.contains(r.relatedTarget))&&t.pubIn({[Df]:!1,[Vf]:r}),!1},co)])});function _v(t,e,n){try{Xj({root:e,visitors:t.getValue(bv),mdastExtensions:t.getValue(y9),markdown:n,syntaxExtensions:t.getValue(O9),jsxComponentDescriptors:t.getValue(qm),jsxKindMismatchPolicy:t.getValue(qX),directiveDescriptors:t.getValue(x9),codeBlockEditorDescriptors:t.getValue($h),defaultCodeBlockLanguage:t.getValue(kc)}),t.pub(Nf,null)}catch(r){if(r instanceof ky||r instanceof Cy||r instanceof ml)t.pubIn({[uo]:n,[Nf]:{error:r.message,source:n}});else throw r}}const E9=we([]),Ah=Un(E9),$9=we([]),UX=Un($9),A9=we([]),GX=Un(A9),Q9=we([]),KX=Un(Q9),JX=we([]),Tv=Un(JX),M9=we([]),R9=Un(M9),Pv=we(!1,t=>{t.link(t.pipe(zt,Rl(e=>{var n,r;return["td","th"].includes(((r=(n=e?.getRootElement())==null?void 0:n.parentNode)==null?void 0:r.nodeName.toLowerCase())??"")})),Pv)}),M_=we(sv()),L9=we("");Nn();const Sg=Nn(t=>{t.sub(t.pipe(Sg,rn(zt)),([e,n])=>{n?.update(()=>{const r=ne();X(r)&&(EN(r,e),setTimeout(()=>{n.focus()}))})})}),Ev=Nn(t=>{t.sub(t.pipe(Ev,rn(zt)),([e,n])=>{n?.focus(()=>{n.getEditorState().read(()=>{const r=ne();X(r)&&(n.update(()=>{const i=e();i.isInline()?(_m([i]),gt(i.getParentOrThrow())&&QN(i,He).selectEnd()):TA(i),setTimeout(()=>{"select"in i&&typeof i.select=="function"&&i.select()})}),setTimeout(()=>{n.dispatchCommand(If,void 0)}))})},{defaultSelection:"rootEnd"})})}),ts=we("rich-text",t=>{function e(){return TE((n,r)=>({current:n.next,next:r}),{current:"rich-text",next:"rich-text"})}t.sub(t.pipe(ts,e(),rn(Xl)),([{current:n},r])=>{(n==="source"||n==="diff")&&t.pub(Cv,r)}),t.sub(t.pipe(ts,e(),dm(n=>n.current==="rich-text"),rn(zt)),([,n])=>{n?.dispatchCommand(If,void 0)})}),Xl=we("",t=>{t.link(uo,Xl),t.link(Xl,Wm)},!0),$v=we([]),Yc=Un($v),I9=we(()=>{throw new Error("No translation function provided")}),R_=we(u9),eW=Zr({init(t,e){const n=e?.initialMarkdown??"";t.register(P9),t.register(vg),t.register(Wm),t.register(Xl),t.pubIn({[m9]:e?.trim?n.trim():n,[Bn]:e?.iconComponentFor,[es]:[fX,uX,hX,tX,...lX],[tl]:[Ys,hi,Eh],[nl]:[Kj,Gj,eX,Uj,Yj],[_y]:e?.contentEditableClassName,[Ty]:e?.spellCheck,[yg]:e?.toMarkdownOptions,[Q_]:e?.autoFocus,[Py]:e?.placeholder,[ui]:e?.readOnly,[I9]:e?.translation,[M_]:sv(),[bg]:[xB(),CB],[xg]:[OB(),sF()],[kv]:[HB(),bB(),PB],[R_]:e?.lexicalTheme??u9}),t.singletonSub(Ey,e?.onError),t.singletonSub($y,r=>{e?.onChange(r,t.getValue(Og))}),t.singletonSub(Vf,e?.onBlur),e?.suppressHtmlProcessing||t.pubIn({[bg]:[WB(),dX()],[xg]:[PF(),EF(),pX],[es]:aX})},postInit(t,e){const n=g9({name:"@mdxeditor/root",editable:e?.readOnly!==!0,namespace:e?.lexicalEditorNamespace??"MDXEditor",nodes:[...t.getValue(vv),...e?.additionalLexicalNodes??[]],theme:t.getValue(R_),historyMode:e?.suppressSharedHistory?"none":"root-shared",historyState:t.getValue(M_),initialEditorState:e?.editorState===null?null:()=>{const i=e?.initialMarkdown.trim()??"";_v(t,ut(),i)}});rk(t,()=>{n.dispose()});const r=e?.autoFocus;if(e?.editorState!==null&&r){const i=setTimeout(()=>{n.focus(El,{defaultSelection:r===!0?"rootStart":r.defaultSelection??"rootStart"})});rk(t,()=>{clearTimeout(i)})}t.pub(cs,n),t.pub(zt,n)},update(t,e){t.pubIn({[_y]:e?.contentEditableClassName,[Ty]:e?.spellCheck,[yg]:e?.toMarkdownOptions,[Q_]:e?.autoFocus,[Py]:e?.placeholder,[ui]:e?.readOnly}),t.singletonSub($y,n=>{e?.onChange(n,t.getValue(Og))}),t.singletonSub(Vf,e?.onBlur),t.singletonSub(Ey,e?.onError)}});function _n(){return wn(I9)}function D9({initialEditor:t,children:e}){const{Component:n}=HN(t,p9).output;return V.jsx(n,{children:e})}const tW=cr?C.useLayoutEffect:C.useEffect;function nW(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}function rW(){return(function(t){const[e]=jr(),n=C.useMemo(()=>t(e),[e,t]),[r,i]=C.useState(()=>n.initialValueFn()),o=C.useRef(r);return tW(()=>{const{initialValueFn:s,subscribe:l}=n,a=s();return o.current!==a&&(o.current=a,i(a)),l(c=>{o.current=c,i(c)})},[n,t]),r})(nW)}function iW(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Av=cr?C.useLayoutEffect:C.useEffect;function oW({editor:t,ErrorBoundary:e}){return(function(n,r){const[i,o]=C.useState(()=>n.getDecorators());return Av(()=>n.registerDecoratorListener(s=>{Ns.flushSync(()=>{o(s)})}),[n]),C.useEffect(()=>{o(n.getDecorators())},[n]),C.useMemo(()=>{const s=[],l=Object.keys(i);for(let a=0;a<l.length;a++){const c=l[a],u=V.jsx(r,{onError:h=>n._onError(h),children:V.jsx(C.Suspense,{fallback:null,children:i[c]})}),f=n.getElementByKey(c);f!==null&&s.push(Ns.createPortal(u,f,c))}return s},[r,i,n])})(t,e)}function sW({editor:t,ErrorBoundary:e}){return(function(n){const r=Bo.maybeFromEditor(n);if(r&&r.hasExtensionByName(mg.name)){for(const i of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(i)&&iW(320,i);return!0}return!1})(t)?null:V.jsx(oW,{editor:t,ErrorBoundary:e})}function L_(t){return t.read("latest",h9(t.isComposing()))}function N9({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[r]=jr();return(function(i){Av(()=>ln(hB(i),sB(i)),[i])})(r),V.jsxs(V.Fragment,{children:[t,V.jsx(lW,{content:e}),V.jsx(sW,{editor:r,ErrorBoundary:n})]})}function lW({content:t}){const[e]=jr(),n=(function(i){const[o,s]=C.useState(()=>L_(i));return Av(()=>{function l(){const a=L_(i);s(a)}return l(),ln(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o})(e),r=rW();return n?typeof t=="function"?t(r):t:null}var l1={exports:{}};var I_;function aW(){return I_||(I_=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(o=i(o,r(l)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var l in o)e.call(o,l)&&o[l]&&(s=i(s,l));return s}function i(o,s){return s?o?o+" "+s:o+s:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(l1)),l1.exports}var cW=aW();const sn=wE(cW),uW={undo:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z",fill:"currentColor"})),redo:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z",fill:"currentColor"})),format_bold:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z",fill:"currentColor"})),format_italic:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z",fill:"currentColor"})),format_underlined:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z",fill:"currentColor"})),format_highlight:_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"},_.createElement("path",{d:"m9 11-6 6v3h9l3-3"}),_.createElement("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})),code:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z",fill:"currentColor"})),strikeThrough:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z",fill:"currentColor"})),superscript:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z",fill:"currentColor"})),subscript:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z",fill:"currentColor"})),format_list_bulleted:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z",fill:"currentColor"})),format_list_numbered:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z",fill:"currentColor"})),format_list_checked:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z",fill:"currentColor"})),link:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z",fill:"currentColor"})),add_photo:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z",fill:"currentColor"})),table:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z",fill:"currentColor"})),horizontal_rule:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M4.5 12.75V11.25H19.5V12.75H4.5Z",fill:"currentColor"})),frontmatter:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M4.5 8.75V7.25H8.5V8.75H4.5Z",fill:"currentColor"}),_.createElement("path",{d:"M4.5 14.75V13.25H8.5V14.75H4.5Z",fill:"currentColor"}),_.createElement("path",{d:"M9.5 8.75V7.25H13.5V8.75H9.5Z",fill:"currentColor"}),_.createElement("path",{d:"M9.5 14.75V13.25H13.5V14.75H9.5Z",fill:"currentColor"}),_.createElement("path",{d:"M14.5 8.75V7.25H18.5V8.75H14.5Z",fill:"currentColor"}),_.createElement("path",{d:"M14.5 14.75V13.25H18.5V14.75H14.5Z",fill:"currentColor"})),frame_source:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z",fill:"currentColor"})),arrow_drop_down:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:"currentColor"})),admonition:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z",fill:"currentColor"})),rich_text:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z",fill:"currentColor"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z",fill:"currentColor"}),_.createElement("path",{d:"M12.5 7H17.5V8.25H12.5V7Z",fill:"currentColor"}),_.createElement("path",{d:"M12.5 9.25H17.5V10.5H12.5V9.25Z",fill:"currentColor"})),difference:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),_.createElement("rect",{x:"9",y:"10",width:"5.5",height:"1.5",fill:"currentColor"}),_.createElement("rect",{x:"9",y:"15",width:"5.5",height:"1.5",fill:"currentColor"}),_.createElement("rect",{x:"11",y:"8",width:"1.5",height:"5.5",fill:"currentColor"})),markdown:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),_.createElement("path",{d:"M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z",fill:"currentColor"}),_.createElement("path",{d:"M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z",fill:"currentColor"})),open_in_new:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z",fill:"currentColor"})),link_off:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z",fill:"currentColor"})),edit:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z",fill:"currentColor"})),content_copy:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z",fill:"currentColor"})),more_horiz:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z",fill:"currentColor"})),more_vert:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z",fill:"currentColor"})),close:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z",fill:"currentColor"})),settings:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})),delete_big:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),delete_small:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),format_align_center:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_left:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_right:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z",fill:"currentColor"})),add_row:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z",fill:"currentColor"}),_.createElement("path",{d:"M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z",fill:"currentColor"})),add_column:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z",fill:"currentColor"}),_.createElement("path",{d:"M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z",fill:"currentColor"})),insert_col_left:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z",fill:"currentColor"})),insert_row_above:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z",fill:"currentColor"})),insert_row_below:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z",fill:"currentColor"})),insert_col_right:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z",fill:"currentColor"})),check:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z",fill:"currentColor"}))},fW="_editorRoot_er3ed_53",hW="_editorWrapper_er3ed_155",dW="_toolbarRoot_er3ed_162",pW="_readOnlyToolbarRoot_er3ed_189",gW="_toolbarToggleItem_er3ed_208",mW="_toolbarGroupOfGroups_er3ed_219",OW="_toolbarToggleSingleGroup_er3ed_224",yW="_toolbarButton_er3ed_239",xW="_selectContainer_er3ed_288",bW="_selectItem_er3ed_301",vW="_selectTrigger_er3ed_308",SW="_selectDropdownArrow_er3ed_373",wW="_contentEditable_er3ed_379",kW="_codeMirrorWrapper_er3ed_391",CW="_codeMirrorToolbar_er3ed_408",_W="_iconButton_er3ed_456",TW="_primaryButton_er3ed_506",PW="_secondaryButton_er3ed_507",EW="_linkDialogEditForm_er3ed_540",$W="_linkDialogAnchor_er3ed_586",AW="_linkDialogPopoverContent_er3ed_600",QW="_tableColumnEditorPopoverContent_er3ed_601",MW="_popoverArrow_er3ed_649",RW="_linkDialogPreviewAnchor_er3ed_653",LW="_tooltipTrigger_er3ed_676",IW="_tooltipContent_er3ed_680",DW="_actionButton_er3ed_694",NW="_tableEditor_er3ed_713",VW="_toolCell_er3ed_724",BW="_tableColumnEditorTrigger_er3ed_743",FW="_addRowButton_er3ed_745",ZW="_addColumnButton_er3ed_746",zW="_tableColumnEditorToolbar_er3ed_788",jW="_toggleGroupRoot_er3ed_801",XW="_tableToolsColumn_er3ed_819",WW="_leftAlignedCell_er3ed_828",HW="_rightAlignedCell_er3ed_832",qW="_centeredCell_er3ed_836",YW="_diffSourceToggleWrapper_er3ed_985",UW="_ggDiffSourceToggle_er3ed_993",GW="_diffSourceToggle_er3ed_985",KW="_toolbarTitleMode_er3ed_1026",JW="_placeholder_er3ed_1105",eH="_rootContentEditableWrapper_er3ed_1118",tH="_downshiftInputWrapper_er3ed_1128",nH="_downshiftInput_er3ed_1128",rH="_downshiftAutocompleteContainer_er3ed_1159",iH="_textInput_er3ed_1205",oH="_multiFieldForm_er3ed_1213",sH="_formField_er3ed_1219",lH="_markdownParseError_er3ed_1230",aH="_popupContainer_er3ed_1239",xe={editorRoot:fW,editorWrapper:hW,toolbarRoot:dW,readOnlyToolbarRoot:pW,toolbarToggleItem:gW,toolbarGroupOfGroups:mW,toolbarToggleSingleGroup:OW,toolbarButton:yW,selectContainer:xW,selectItem:bW,selectTrigger:vW,selectDropdownArrow:SW,contentEditable:wW,codeMirrorWrapper:kW,codeMirrorToolbar:CW,iconButton:_W,primaryButton:TW,secondaryButton:PW,linkDialogEditForm:EW,linkDialogAnchor:$W,linkDialogPopoverContent:AW,tableColumnEditorPopoverContent:QW,popoverArrow:MW,linkDialogPreviewAnchor:RW,tooltipTrigger:LW,tooltipContent:IW,actionButton:DW,tableEditor:NW,toolCell:VW,tableColumnEditorTrigger:BW,addRowButton:FW,addColumnButton:ZW,tableColumnEditorToolbar:zW,toggleGroupRoot:jW,tableToolsColumn:XW,leftAlignedCell:WW,rightAlignedCell:HW,centeredCell:qW,diffSourceToggleWrapper:YW,ggDiffSourceToggle:UW,diffSourceToggle:GW,toolbarTitleMode:KW,placeholder:JW,rootContentEditableWrapper:eH,downshiftInputWrapper:tH,downshiftInput:nH,downshiftAutocompleteContainer:rH,textInput:iH,multiFieldForm:oH,formField:sH,markdownParseError:lH,popupContainer:aH};function cH(t){try{const e=t.anchor,n=t.focus,r=t.anchor.getNode(),i=t.focus.getNode();return r===i?r:t.isBackward()?OC(n)?r:i:OC(e)?r:i}catch{return null}}const uH=["transform","perspective","filter","backdrop-filter","contain","container-type"],fH=["layout","paint","strict","content"];function hH(t){let e=t?.parentElement;for(;e;){const n=window.getComputedStyle(e),i=n.willChange.split(",").map(s=>s.trim()).some(s=>uH.includes(s));if(n.transform!=="none"||n.perspective!=="none"||n.filter!=="none"||n.backdropFilter!=="none"||fH.includes(n.contain)||n.containerType!=="normal"||n.contentVisibility==="auto"||i)return e;e=e.parentElement}return null}function V9(t,e){const n=hH(e);if(n){const r=n.getBoundingClientRect();return{top:Math.round(t.top-r.top),left:Math.round(t.left-r.left),width:Math.round(t.width),height:Math.round(t.height)}}return{top:Math.round(t.top),left:Math.round(t.left),width:Math.round(t.width),height:Math.round(t.height)}}function B9(t,e){const n=t.getRootElement(),r=t.getElementByKey(e);return n===null||r===null?null:V9(r.getBoundingClientRect(),n)}function F9(t){const e=ne(),n=window.getSelection(),r=document.activeElement,i=t.getRootElement();if(e!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&t.isEditable()){const o=n.getRangeAt(0);let s;if(n.isCollapsed){let l=n.anchorNode;l?.nodeType==3&&(l=l.parentNode),s=l.getBoundingClientRect(),s.width=0}else if(n.anchorNode===i){let l=i;for(;l.firstElementChild!=null;)l=l.firstElementChild;s=l.getBoundingClientRect()}else s=o.getBoundingClientRect();return V9(s,i)}else if(r?.className!=="link-input")return null;return null}function dH(t,e){let n=null,r=[],i="";t.getEditorState().read(()=>{const l=ne();!l||X(l)&&l.isCollapsed()||l.getNodes().length===0||(r=s3(t,l).nodes,r.length>0&&(n=W$()))},{editor:t});const o=n;if(!o||r.length===0)return"";const s={error:void 0,failed:!1};if(o.update(()=>{try{const l=ut(),a=l3(r);let c=He();const u=()=>{c.isEmpty()||(l.append(c),c=He())};for(const f of a)f.isInline()?c.append(f):(u(),l.append(f));u(),i=q3({root:l,...e})}catch(l){s.failed=!0,s.error=l}},{discrete:!0,skipTransforms:!0}),s.failed)throw s.error;return i.replace(/\n+$/u,"")}const pH=({children:t})=>{const e=wn(cs);return _.createElement(D9,{initialEditor:e},t)},gH=()=>{const t=_n(),e=Zt(b9),n=Zt(w9),r=f=>{n(f),e(f?{current:f}:null)},[i,o,s,l,a,c,u]=Vn(_y,Ty,E9,$9,Q9,Py,A9);return _.createElement(_.Fragment,null,l.map((f,h)=>_.createElement(f,{key:h})),_.createElement(Z9,{wrappers:a},_.createElement("div",{className:sn(xe.rootContentEditableWrapper,"mdxeditor-root-contenteditable")},_.createElement(N9,{contentEditable:_.createElement("div",{ref:r,className:"mdxeditor-contenteditable-wrapper"},_.createElement(mv,{className:sn(xe.contentEditable,i),ariaLabel:t("contentArea.editableMarkdown","editable markdown"),spellCheck:o})),placeholder:_.createElement("div",{className:sn(xe.contentEditable,xe.placeholder,i)},_.createElement("p",null,c)),ErrorBoundary:Ov}))),s.map((f,h)=>_.createElement(f,{key:h})),u.map((f,h)=>_.createElement(f,{key:h})))},mH={listItemIndent:"one"},OH=t=>uW[t];function yH(t,e,n={}){let r=e;for(const[i,o]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(o));return r}const Z9=({wrappers:t,children:e})=>{if(t.length===0)return _.createElement(_.Fragment,null,e);const n=t[0];return _.createElement(n,null,_.createElement(Z9,{wrappers:t.slice(1)},e))},xH=({children:t,className:e,overlayContainer:n})=>{const r=_.useRef(null),i=_.useRef(null),o=Zt(qc),s=Zt(YX);return _.useEffect(()=>{const l=document.createElement("div");return l.classList.add("mdxeditor-popup-container",xe.editorRoot,xe.popupContainer,...(e??"").trim().split(" ").filter(Boolean)),(n??document.body).appendChild(l),r.current=l,o(r),s(i),()=>{l.remove()}},[e,r,n,o,s]),_.createElement("div",{className:sn("mdxeditor",xe.editorRoot,xe.editorWrapper,e),ref:i},t)};function bH(t){return{getMarkdown:()=>{const e=t.getValue(ts);return e==="source"||e==="diff"?t.getValue(Xl):t.getValue(uo)},setMarkdown:e=>{t.pub(Cv,e)},insertMarkdown:e=>{t.pub(v9,e)},focus:(e,n)=>{var r;(r=t.getValue(cs))==null||r.focus(e,n)},getContentEditableHTML:()=>{var e;return((e=t.getValue(b9))==null?void 0:e.current.innerHTML)??""},getSelectionMarkdown:()=>{const e=t.getValue(ts);if(e==="source"||e==="diff")return"";const n=t.getValue(zt);if(!n)return"";const r=t.getValue(Hm),i=t.getValue(Sv),o=t.getValue(yg),s=t.getValue(qm),l=t.getValue(wv);return dH(n,{visitors:r,toMarkdownExtensions:i,toMarkdownOptions:o,jsxComponentDescriptors:s,jsxIsAvailable:l})}}}const vH=({onReady:t,onDispose:e})=>{const n=yh(),r=_.useMemo(()=>bH(n),[n]);return _.useLayoutEffect(()=>(t(r),()=>{e(r)}),[r,e,t]),null},SH=_.forwardRef((t,e)=>{const n=_.useRef(null),r=_.useRef(null),i=_.useRef([]),o=_.useRef(t.trim===!1?t.markdown:t.markdown.trim()),s=_.useCallback(u=>{const f=n.current;f&&r.current===null?u(f):i.current.push(u)},[]),l=_.useMemo(()=>({getMarkdown:()=>{var u;return((u=n.current)==null?void 0:u.getMarkdown())??o.current},setMarkdown:u=>{o.current=u,s(f=>{f.setMarkdown(u)})},insertMarkdown:u=>{s(f=>{f.insertMarkdown(u)})},focus:(u,f)=>{s(h=>{h.focus(u,f)})},getContentEditableHTML:()=>{var u;return((u=n.current)==null?void 0:u.getContentEditableHTML())??""},getSelectionMarkdown:()=>{var u;return((u=n.current)==null?void 0:u.getSelectionMarkdown())??""}}),[s]),a=_.useCallback(u=>{if(n.current=u,r.current===u)return;if(i.current.length===0){o.current=u.getMarkdown();return}r.current=u;const f=()=>{if(n.current!==u){r.current===u&&(r.current=null);return}const h=i.current.shift();if(!h){r.current=null,o.current=u.getMarkdown();return}h(u),queueMicrotask(f)};f()},[]),c=_.useCallback(u=>{n.current===u&&(o.current=u.getMarkdown(),n.current=null)},[]);return _.useImperativeHandle(e,()=>l,[l]),_.createElement(_6,{plugins:[eW({contentEditableClassName:t.contentEditableClassName??"",spellCheck:t.spellCheck??!0,initialMarkdown:t.markdown,onChange:t.onChange??El,onBlur:t.onBlur??El,toMarkdownOptions:t.toMarkdownOptions??mH,autoFocus:t.autoFocus??!1,placeholder:t.placeholder??"",readOnly:!!t.readOnly,iconComponentFor:t.iconComponentFor??OH,suppressHtmlProcessing:t.suppressHtmlProcessing??!1,onError:t.onError??El,translation:t.translation??yH,trim:t.trim??!0,lexicalTheme:t.lexicalTheme,..."editorState"in t?{editorState:t.editorState}:{},suppressSharedHistory:t.suppressSharedHistory??!1,additionalLexicalNodes:t.additionalLexicalNodes??[],lexicalEditorNamespace:t.lexicalEditorNamespace??"MDXEditor"}),...t.plugins??[]]},_.createElement(xH,{className:t.className,overlayContainer:t.overlayContainer},_.createElement(pH,null,_.createElement(gH,null))),_.createElement(vH,{onReady:a,onDispose:c}))}),wH=typeof window<"u"&&typeof window.document.createElement<"u",wg=wH&&(()=>{var t;const e=(t=navigator.userAgentData)==null?void 0:t.platform;return e?/mac/i.test(e):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function kH(t,e){return wg?t:e}const CH={testLexicalNode:Zm,visitLexicalNode:({lexicalNode:t,actions:e})=>{const n=parseInt(t.getTag()[1],10);e.addAndStepInto("heading",{depth:n})}},_H={testNode:"heading",visitNode:function({mdastNode:t,actions:e}){e.addAndStepInto(Ri(`h${t.depth}`))}},TH=["Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6"],Qy=[1,2,3,4,5,6],PH={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},Bf=we(Qy,t=>{t.pub(P9,e=>e.registerCommand(xm,n=>{const{code:r,ctrlKey:i,metaKey:o,altKey:s}=n;return TH.includes(r)&&kH(o,i)&&s?(n.preventDefault(),e.update(()=>{if(r==="Digit0")t.pub(Sg,()=>He());else{const l=t.getValue(Bf),a=PH[r];l.includes(a)&&t.pub(Sg,()=>Ri(`h${a}`))}}),!0):!1},fn))}),EH=Zr({init(t,e){t.pubIn({[Yc]:"headings",[es]:_H,[tl]:Th,[nl]:CH}),t.pub(Bf,e?.allowedHeadingLevels??Qy)},update(t,e){t.pub(Bf,e?.allowedHeadingLevels??Qy)}});function D_(t,e){return t.read("latest",()=>{const n=Ge(e);return n!==null&&n.isSelected()})}function $H(t){const[e]=jr(),[n,r]=C.useState(()=>D_(e,t));return C.useEffect(()=>{let i=!0;const o=e.registerUpdateListener(()=>{i&&r(D_(e,t))});return()=>{i=!1,o()}},[e,t]),[n,C.useCallback(i=>{e.update(()=>{let o=ne();it(o)||(o=Vl(),Vt(o)),it(o)&&(i?o.add(t):o.delete(t))})},[e,t]),C.useCallback(()=>{e.update(()=>{const i=ne();it(i)&&i.clear()})},[e])]}function AH({nodeKey:t}){const[e]=jr(),[n,r,i]=$H(t);return C.useEffect(()=>ln(e.registerCommand(Pb,o=>{const s=e.getElementByKey(t);return Ub(o)===s&&(o.shiftKey||i(),r(!n),!0)},fn)),[i,e,n,t,r]),C.useEffect(()=>{const o=e.getElementByKey(t),s=e._config.theme.hrSelected??"selected";o!==null&&(n?Ii(o,s):Im(o,s))},[e,n,t]),null}class Uc extends pa{static getType(){return"horizontalrule"}static clone(e){return new Uc(e.__key)}static importJSON(e){return Qh().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:QH,priority:0})}}decorate(){return V.jsx(AH,{nodeKey:this.__key})}}function QH(){return{node:Qh()}}function Qh(){return zr(new Uc)}function MH(){const[t]=jr();return C.useEffect(()=>t.registerCommand(DA,e=>{const n=ne();if(!X(n))return!1;if(n.focus.getNode()!==null){const r=Qh();TA(r)}return!0},Ne),[t]),null}const RH={testLexicalNode:t=>t instanceof Uc,visitLexicalNode({actions:t}){t.addAndStepInto("thematicBreak")}},LH={testNode:"thematicBreak",visitNode({actions:t}){t.addAndStepInto(Qh())}},z9=Bc(t=>{t.sub(t.pipe(z9,rn(zt)),([,e])=>{e?.dispatchCommand(DA,void 0)})}),IH=Zr({init(t){t.pubIn({[Yc]:"thematicBreak",[es]:LH,[tl]:Uc,[nl]:RH,[Ah]:MH})}});function vs(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ff(t){let e=1,n=t.getParent();for(;n!=null;){if(De(n)){const r=n.getParent();if($e(r)){e++,n=r.getParent();continue}vs(40)}return e}return e}function My(t){const e=t.getParent();$e(e)||vs(40);let n=e,r=e;for(;r!==null;)r=r.getParent(),$e(r)&&(n=r);return n}function j9(t){let e=[];const n=t.getChildren().filter(De);for(let r=0;r<n.length;r++){const i=n[r],o=i.getFirstChild();$e(o)?e=e.concat(j9(o)):e.push(i)}return e}function Yr(t){return De(t)&&$e(t.getFirstChild())}function X9(t,e){return De(t)&&(e.length===0||e.length===1&&t.is(e[0])&&t.getChildrenSize()===0)}function Ry(t){const e=ne();if(e!==null){let n=e.getNodes();if(X(e)){const[i]=e.getStartEndPoints(),o=i.getNode(),s=o.getParent();if(gt(o)){const l=o.getFirstChild();if(l)n=l.selectStart().getNodes();else{const a=He();o.append(a),n=a.select().getNodes()}}else if(X9(o,n)){const l=si(t);if(gt(s)){o.replace(l);const a=fi();N(o)&&(a.setFormat(o.getFormatType()),a.setIndent(o.getIndent())),l.append(a)}else if(De(o)){const a=o.getParentOrThrow();Wl(l,a.getChildren()),a.replace(l)}return}}const r=new Set;for(let i=0;i<n.length;i++){const o=n[i];if(N(o)&&o.isEmpty()&&!De(o)&&!r.has(o.getKey())){N_(o,t);continue}let s=q$(o)?o.getParent():De(o)&&o.isEmpty()?o:null;for(;s!=null;){const l=s.getKey();if($e(s)){if(!r.has(l)){const a=si(t);Wl(a,s.getChildren()),s.replace(a),r.add(l)}break}{const a=s.getParent();if(gt(a)&&!r.has(l)){r.add(l),N_(s,t);break}s=a}}}}}function Wl(t,e){t.splice(t.getChildrenSize(),0,e)}function N_(t,e){if($e(t))return t;const n=t.getPreviousSibling(),r=t.getNextSibling(),i=fi();let o;if(Wl(i,t.getChildren()),$e(n)&&e===n.getListType())n.append(i),$e(r)&&e===r.getListType()&&(Wl(n,r.getChildren()),r.remove()),o=n;else if($e(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const l=si(e);l.append(i),t.replace(l),o=l}i.setFormat(t.getFormatType()),i.setIndent(t.getIndent());const s=ne();return X(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),t.remove(),o}function Qv(t,e){const n=t.getLastChild(),r=e.getFirstChild();n&&r&&Yr(n)&&Yr(r)&&(Qv(n.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&t.append(...i),e.remove()}function DH(){const t=ne();if(X(t)){const e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(X9(r,n))e.add(My(r));else for(let i=0;i<n.length;i++){const o=n[i];if(q$(o)){const s=CA(o,us);s!=null&&e.add(My(s))}}for(const i of e){let o=i;const s=j9(i);for(const l of s){const a=He().setTextStyle(t.style).setTextFormat(t.format);Wl(a,l.getChildren()),o.insertAfter(a),o=a,l.__key===t.anchor.key&&Ls(t.anchor,Wn(lr(a,"next"))),l.__key===t.focus.key&&Ls(t.focus,Wn(lr(a,"next"))),l.remove()}i.remove()}}}function W9(t){const e=t.getListType()!=="check";let n=t.getStart();for(const r of t.getChildren())De(r)&&(r.getValue()!==n&&r.setValue(n),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),$e(r.getFirstChild())||n++)}function NH(t){const e=new Set;if(Yr(t)||e.has(t.getKey()))return;const n=t.getParent(),r=t.getNextSibling(),i=t.getPreviousSibling();if(Yr(r)&&Yr(i)){const o=i.getFirstChild();if($e(o)){o.append(t);const s=r.getFirstChild();$e(s)&&(Wl(o,s.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Yr(r)){const o=r.getFirstChild();if($e(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(t)}}else if(Yr(i)){const o=i.getFirstChild();$e(o)&&o.append(t)}else if($e(n)){const o=Rn(t),s=Rn(n);o.append(s),s.append(t),i?i.insertAfter(o):r?r.insertBefore(o):n.append(o)}}function V_(t){if(Yr(t))return;const e=t.getParent(),n=e?e.getParent():void 0;if($e(n?n.getParent():void 0)&&De(n)&&$e(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(t.is(r))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(i))n.insertAfter(t),e.isEmpty()&&n.remove();else{const o=Rn(t),s=Rn(e);o.append(s),t.getPreviousSiblings().forEach(c=>s.append(c));const l=Rn(t),a=Rn(e);l.append(a),Wl(a,t.getNextSiblings()),n.insertBefore(o),n.insertAfter(l),n.replace(t)}}}function VH(t=!1){const e=ne();if(!X(e)||!e.isCollapsed())return!1;const n=e.anchor.getNode();let r=null;if(De(n)&&n.getChildrenSize()===0)r=n;else if(Y(n)){const c=n.getParent();De(c)&&c.getChildren().every(u=>Y(u)&&u.getTextContent().trim()==="")&&(r=c)}if(r===null)return!1;const i=My(r),o=r.getParent();$e(o)||vs(40);const s=o.getParent();let l;if(gt(s))l=He(),i.insertAfter(l);else{if(!De(s))return!1;l=Rn(s),s.insertAfter(l)}l.setTextStyle(e.style).setTextFormat(e.format).select();const a=r.getNextSiblings();if(a.length>0){const c=t?(function(f,h){return f.getStart()+h.getIndexWithinParent()})(o,r):1,u=Rn(o).setStart(c);if(De(l)){const f=Rn(l);f.append(u),l.insertAfter(f)}else l.insertAfter(u);u.append(...a)}return(function(c){let u=c;for(;u.getNextSibling()==null&&u.getPreviousSibling()==null;){const f=u.getParent();if(f==null||!De(f)&&!$e(f))break;u=f}u.remove()})(r),!0}let us=class extends sr{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const n=e.getParent();if($e(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){const r=e.createParentElementNode();$e(r)||vs(340);const i=[e];for(const o of["previous","next"]){i.reverse();for(const{origin:s}of ot(e,o)){if(!De(s))break;i.push(s)}}e.insertBefore(r),r.splice(0,0,i),gt(n)||(Rm(r,Ks(ot(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:sr,importDOM:{li:()=>({conversion:BH,priority:0})}})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const n=Tt().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(s,l){const a=l.getParent();!$e(a)||a.getListType()!=="check"||$e(l.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),s.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,(function(s,l,a){const c=l.list;if(!c)return;const u=c.listitem,f=c.nested&&c.nested.listitem,h=a.getParent(),d=$e(h)&&h.getListType()==="check",p=a.getChecked(),g=a.getChildren().some(y=>$e(y)),m=[];c.listitemChecked!==void 0&&m.push(c.listitemChecked),c.listitemUnchecked!==void 0&&m.push(c.listitemUnchecked),f!==void 0&&m.push(...No(f)),m.length>0&&Im(s,...m);const O=[];if(u!==void 0&&O.push(...No(u)),d){const y=p?c.listitemChecked:c.listitemUnchecked;y!==void 0&&O.push(y)}f!==void 0&&g&&O.push(...No(f)),O.length>0&&Ii(s,...O)})(n,r.theme,this);const i=e?e.__style:"",o=this.__style;i!==o&&Ga(n.style,o,i),(function(s,l,a){const c=l.__textStyle,u=a?a.__textStyle:"";if(a!==null&&u===c)return;const f=Kp(c);for(const h in f)s.style.setProperty(`--listitem-marker-${h}`,f[h]);if(u!=="")for(const h in Kp(u))h in f||s.style.removeProperty(`--listitem-marker-${h}`)})(n,this,e)}updateDOM(e,n,r){const i=n;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);const i=this.getDirection();return i&&(n.dir=i),Yr(this)?{after(o){if(Qe(o)){const s=o.previousElementSibling;if(Qe(s)&&s.nodeName==="LI"){for(;o.firstChild;)s.append(o.firstChild);o.remove()}}return o},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){const r=e[n];if(N(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,n){if(De(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!$e(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const s=Rn(r);let l=this.getNextSibling();for(;l;){const a=l;l=l.getNextSibling(),s.append(a)}r.insertAfter(e),e.insertAfter(s)}const i=this.__key;let o=0;if(n&&(N(e)||vs(139),o=e.getChildrenSize(),e.splice(o,0,this.getChildren())),n&&N(e)){const s=ne();if(X(s))for(const l of s.getStartEndPoints())l.key===i&&l.type==="element"&&l.set(e.getKey(),o+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){const r=this.getParentOrThrow();if($e(r)||vs(39),De(e))return super.insertAfter(e,n);const i=this.getNextSiblings();if(r.insertAfter(e,n),i.length!==0){const o=Rn(r);i.forEach(s=>o.append(s)),e.insertAfter(o,n)}return e}remove(e){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Yr(n)&&Yr(r)&&(Qv(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){const r=Rn(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(Yr(this))return!1;const n=this.getParentOrThrow();if(De(n.getParentOrThrow()))return V_(this),!0;const r=He().append(...this.getChildren()),i=this.getNextSiblings();if(i.length>0){const o=Rn(n);o.append(...i),n.insertAfter(o)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){const n=this.getWritable();return n.__value=e,n}getChecked(){const e=this.getLatest();let n;const r=this.getParent();return $e(r)&&(n=r.getListType()),n==="check"?!!e.__checked:void 0}setChecked(e){const n=this.getWritable();return n.__checked=e,n}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let n=e.getParentOrThrow(),r=0;for(;De(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&vs(117),(e=Math.floor(e))>=0||vs(199);let n=this.getIndent();for(;n!==e;)n<e?(NH(this),n++):(V_(this),n--);return this}canInsertAfter(e){return De(e)}canReplaceWith(e){return De(e)}canMergeWith(e){return De(e)||Zc(e)}extractWithChild(e,n){if(!X(n))return!1;const r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return si("bullet")}canMergeWhenEmpty(){return!0}};function BH(t){if(t.classList.contains("task-list-item")){for(const r of t.children)if(r.tagName==="INPUT")return B_(r)}if(t.classList.contains("joplin-checkbox")){for(const r of t.children)if(r.classList.contains("checkbox-wrapper")&&r.children.length>0&&r.children[0].tagName==="INPUT")return B_(r.children[0])}const e=t.getAttribute("aria-checked"),n=fi(e==="true"||e!=="false"&&void 0);return go(n,t),{after:H9.bind(null,n),node:di(n,t)}}function B_(t){if(t.getAttribute("type")!=="checkbox")return{node:null};const e=fi(t.hasAttribute("checked"));return{after:H9.bind(null,e),node:e}}function H9(t,e){const n=e[0];return e.length===1&&Zc(n)&&!t.getFormatType()&&n.getFormatType()?(t.setFormat(n.getFormatType()),n.getChildren()):e}function fi(t){return zr(new us(void 0,t))}function De(t){return t instanceof us}let fs=class extends sr{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(n){const r=n.getNextSibling();$e(r)&&n.getListType()===r.getListType()&&Qv(n,r)})(e),W9(e)},extends:sr,importDOM:{ol:()=>({conversion:Z_,priority:0}),ul:()=>({conversion:Z_,priority:0})}})}constructor(e="number",n=1,r){super(r);const i=FH[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const n=this.getWritable();return n.__start=e,n}createDOM(e,n){const r=this.__tag,i=Tt().createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,F_(i,e.theme,this),i}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(F_(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const n=this.createDOM(e._config,e);return Qe(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let i=r;for(let o=0;o<r.length;o++){const s=r[o];De(s)||(i===r&&(i=[...r]),i[o]=this.createListItemNode().append(!N(s)||$e(s)||s.isInline()?s:bt(s.getTextContent())))}return super.splice(e,n,i)}extractWithChild(e){return De(e)}createListItemNode(){return fi()}};function F_(t,e,n){const r=[],i=[],o=e.list;if(o!==void 0){const s=o[`${n.__tag}Depth`]||[],l=Ff(n)-1,a=l%s.length,c=s[a],u=o[n.__tag];let f;const h=o.nested,d=o.checklist;if(h!==void 0&&h.list&&(f=h.list),u!==void 0&&r.push(u),d!==void 0&&n.__listType==="check"&&r.push(d),c!==void 0){r.push(...No(c));for(let p=0;p<s.length;p++)p!==a&&i.push(n.__tag+p)}if(f!==void 0){const p=No(f);l>1?r.push(...p):i.push(...p)}}i.length>0&&Im(t,...i),r.length>0&&Ii(t,...r)}function Z_(t){let e;if((function(n){return Qe(n)&&n.nodeName.toLowerCase()==="ol"})(t)){const n=t.start;e=si("number",n)}else e=(function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list")||n.getAttribute("data-is-checklist")==="1")return!0;for(const r of n.childNodes)if(Qe(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(t)?si("check"):si("bullet");return di(e,t),{after:n=>(function(r,i){const o=i.createListItemNode.bind(i),s=[];for(let l=0;l<r.length;l++){const a=r[l];if(De(a)){s.push(a);const c=a.getChildren();c.length>1&&c.forEach(u=>{$e(u)&&s.push(o().append(u))})}else s.push(o().append(a))}return s})(n,e),node:e}}const FH={ol:"number",ul:"bullet"};function si(t="number",e=1){return zr(new fs(t,e))}function $e(t){return t instanceof fs}const q9=Pe("INSERT_CHECK_LIST_COMMAND");function ZH(t,e){const n=e&&e.disableTakeFocusOnClick||!1,r=typeof n=="boolean"?()=>n:n.peek.bind(n),i=c=>{const u=c.target;if(!Qe(u))return!1;const f=u.__lexicalCheckListLastHandled;return f!==void 0&&c.timeStamp-f<500},o=c=>{const u=c.target;Qe(u)&&(u.__lexicalCheckListLastHandled=c.timeStamp)},s=c=>{i(c)||(o(c),z_(c,r()))},l=c=>{c.pointerType==="touch"&&(i(c)||(o(c),z_(c,r())))},a=c=>{(function(u,f){Y9(u,()=>{u.preventDefault(),f&&u.stopPropagation()})})(c,r())};return ln(t.registerCommand(q9,()=>(Ry("check"),!0),fn),t.registerCommand(Ab,c=>j_(c,t,!1),fn),t.registerCommand($b,c=>j_(c,t,!0),fn),t.registerCommand(bm,()=>{if(Ly(t)!=null){const c=t.getRootElement();return c?.focus(),!0}return!1},fn),t.registerCommand(Qb,c=>{const u=Ly(t);return!(u==null||!t.isEditable())&&(t.update(()=>{const f=Li(u);De(f)&&(c.preventDefault(),f.toggleChecked())}),!0)},fn),t.registerCommand(Eb,c=>t.read("latest",()=>{const u=ne();if(X(u)&&u.isCollapsed()){const{anchor:f}=u,h=f.type==="element";if(h||f.offset===0){const d=f.getNode(),p=lt(d,g=>N(g)&&!g.isInline());if(De(p)){const g=p.getParent();if($e(g)&&g.getListType()==="check"&&(h||p.getFirstDescendant()===d)){const m=t.getElementByKey(p.__key);if(m!=null&&Ef(m)!==m)return m.focus(),c.preventDefault(),!0}}}}return!1}),fn),t.registerRootListener(c=>{if(c!==null)return ln(mC(c,{click:s,pointerup:l}),mC(c,{mousedown:a,pointerdown:a},{capture:!0}),Ib(c,"touchstart",a,{capture:!0,passive:!1}))}))}function Y9(t,e){const n=t.target;if(!Qe(n))return;const r=n.firstChild;if(Qe(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=n.parentNode;if(!i||i.__lexicalListType!=="check")return;let o=null,s=null;if("clientX"in t)o=t.clientX;else if("touches"in t){const d=t.touches;d.length>0&&(o=d[0].clientX,s="touch")}if(o==null)return;const l=n.getBoundingClientRect(),a=o/MN(n),c=n.ownerDocument.defaultView,u=c?c.getComputedStyle(n,"::before"):{width:"0px"},f=parseFloat(u.width),h=s==="touch"||"pointerType"in t&&t.pointerType==="touch"?32:0;(n.dir==="rtl"?a<l.right+h&&a>l.right-f-h:a>l.left-h&&a<l.left+f+h)&&e()}function z_(t,e){Y9(t,()=>{if(Qe(t.target)){const n=t.target,r=Tl(n);r!=null&&r.isEditable()&&r.update(()=>{const i=Li(n);De(i)&&(e?(Yo(Gp),Yo(v$)):n.focus(),i.toggleChecked())})}})}function Ly(t){const e=t.getRootElement(),n=e?Ef(e):null;return Qe(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function j_(t,e,n){const r=Ly(e);return r!=null&&e.update(()=>{const i=Li(r);if(!De(i))return;const o=(function(s,l){let a=l?s.getPreviousSibling():s.getNextSibling(),c=s;for(;a==null&&De(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;De(a);){const u=l?a.getLastChild():a.getFirstChild();if(!$e(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,n);if(o!=null){o.selectStart();const s=e.getElementByKey(o.__key);s!=null&&(t.preventDefault(),setTimeout(()=>{s.focus()},0))}}),!1}function zH(t){const e=[];for(const n of t)if(De(n)){e.push(n);const r=n.getChildren();if(r.length>1)for(const i of r)$e(i)&&e.push(fi().append(i))}else e.push(fi().append(n));return e}const jH={$import:(t,e)=>{let n;var r;return HA(e,"ol")?n=si("number",e.start):n=(r=e).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||r.querySelector(":scope > [aria-checked]")!==null?si("check"):si("bullet"),di(n,e),[n.splice(0,0,UA(zH(t.$importChildren(e)),e))]},match:Cn.tag("ol","ul"),name:"@lexical/list/list"};function U9(t,e){if(e.length!==1)return e;const n=e[0];return Zc(n)&&!t.getFormatType()&&n.getFormatType()?(t.setFormat(n.getFormatType()),n.getChildren()):e}function G9(t){const e=s=>av(s)&&!$e(s);if(!t.some(e))return t;const n=[];let r=[];const i=()=>{r.length>0&&(n.push(r),r=[])};for(const s of t)e(s)?(i(),n.push(N(s)?s.getChildren():[s])):r.push(s);i();const o=[];for(const s of n)o.length>0&&o.push(Sr()),o.push(...s);return o}const XH={$import:(t,e)=>{const n=e.getAttribute("aria-checked"),r=fi(n==="true"||n!=="false"&&void 0);return go(r,e),di(r,e),[r.splice(0,0,G9(U9(r,t.$importChildren(e))))]},match:Cn.tag("li"),name:"@lexical/list/li"};function X_(t,e,n){const r=HA(n,"input")?n:n.querySelector('input[type="checkbox"]');if(!r||r.getAttribute("type")!=="checkbox")return[];const i=fi(r.hasAttribute("checked"));return go(i,e),di(i,e),[i.splice(0,0,G9(U9(i,t.$importChildren(e))))]}Cn.tag("li").classAll("task-list-item"),Cn.tag("li").classAll("joplin-checkbox");const WH=Pe("UPDATE_LIST_START_COMMAND"),K9=Pe("INSERT_UNORDERED_LIST_COMMAND"),J9=Pe("INSERT_ORDERED_LIST_COMMAND"),eQ=Pe("REMOVE_LIST_COMMAND");function W_(t,e){return ln(t.registerCommand(J9,()=>(Ry("number"),!0),fn),t.registerCommand(WH,n=>{const{listNodeKey:r,newStart:i}=n,o=Ge(r);return!!$e(o)&&(o.getListType()==="number"&&(o.setStart(i),W9(o)),!0)},fn),t.registerCommand(K9,()=>(Ry("bullet"),!0),fn),t.registerCommand(eQ,()=>(DH(),!0),fn),t.registerCommand(wf,()=>VH(!!(e&&e.restoreNumbering)),fn),t.registerCommand(Mb,n=>{if((function(){const s=ne();if(!X(s)||!s.isCollapsed()||s.anchor.offset!==0)return!1;const l=s.anchor.getNode(),a=lt(l,De);if(!De(a))return!1;const c=a.getFirstDescendant();if(c===null||!a.is(l)&&!c.is(l))return!1;const u=a.getParent();if(!$e(u)||!a.is(u.getFirstChild()))return!1;const f=u.getPreviousSibling();if(!Fe(f)||f.isIsolated()||!f.isKeyboardSelectable()&&f.isInline())return!1;const h=He().append(...a.getChildren());return u.insertBefore(h),a.remove(),u.isEmpty()&&u.remove(),h.selectStart(),!0})())return n.preventDefault(),!0;const r=ne();if(!X(r)||!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;let o=i.getNode();for(;!De(o);){if(o.getPreviousSibling()!==null)return!1;const s=o.getParent();if(s===null)return!1;o=s}return!(!De(o)||!o.collapseAtStart(r))&&(n.preventDefault(),!0)},ND),t.registerNodeTransform(us,n=>{const r=n.getFirstChild();if(r){if(Y(r)){const i=r.getStyle(),o=r.getFormat();n.getTextStyle()!==i&&n.setTextStyle(i),n.getTextFormat()!==o&&n.setTextFormat(o)}}else{const i=ne();X(i)&&(i.style!==n.getTextStyle()||i.format!==n.getTextFormat())&&i.isCollapsed()&&n.is(i.anchor.getNode())&&n.setTextStyle(i.style).setTextFormat(i.format)}}),t.registerNodeTransform(hi,n=>{const r=n.getParent();if(De(r)&&n.is(r.getFirstChild())){const i=n.getStyle(),o=n.getFormat();i===r.getTextStyle()&&o===r.getTextFormat()||r.setTextStyle(i).setTextFormat(o)}}))}function HH(t){const e=n=>{const r=n.getParent();if($e(n.getFirstChild())||!$e(r))return;const i=lt(n,o=>De(o)&&$e(o.getParent())&&De(o.getPreviousSibling()));if(i===null&&n.getIndent()>0)n.setIndent(0);else if(De(i)){const o=i.getPreviousSibling();if(De(o)){const s=(function(a){let c=a,u=c.getFirstChild();for(;$e(u);){const f=u.getLastChild();if(!De(f))break;c=f,u=c.getFirstChild()}return c})(o),l=s.getParent();if($e(l)){const a=Ff(l);a+1<Ff(r)&&n.setIndent(a)}}}};return t.registerNodeTransform(fs,n=>{const r=[n];for(;r.length>0;){const i=r.shift();if($e(i)){for(const o of i.getChildren())if(De(o)){e(o);const s=o.getFirstChild();$e(s)&&r.push(s)}}}})}const qH={testNode:"list",visitNode:function({mdastNode:t,lexicalParent:e,actions:n}){const r=t.children.some(o=>typeof o.checked=="boolean")?"check":t.ordered?"number":"bullet",i=si(r);if(De(e)){const o=fi();o.append(i),e.insertAfter(o)}else e.append(i);n.visitChildren(t,i)}},YH={testNode:"listItem",visitNode({mdastNode:t,actions:e,lexicalParent:n}){const r=n.getListType()==="check"?t.checked??!1:void 0;e.addAndStepInto(fi(r))}},UH={testLexicalNode:$e,visitLexicalNode:({lexicalNode:t,actions:e})=>{e.addAndStepInto("list",{ordered:t.getListType()==="number",spread:!1})}},GH={testLexicalNode:De,visitLexicalNode:({lexicalNode:t,mdastParent:e,actions:n})=>{const r=t.getChildren(),i=r[0];if(r.length===1&&$e(i)){const o=e.children.at(-1);o?n.visitChildren(t,o):n.visitChildren(i,e)}else{const o=t.getParent(),s=n.appendToParent(e,{type:"listItem",checked:o.getListType()==="check"?!!t.getChecked():void 0,spread:!1,children:[]});let l=null;for(const a of t.getChildren())Y(a)||kn(a)||a.isInline()&&(N(a)||Fe(a))?(l??(l=n.appendToParent(s,{type:"paragraph",children:[]})),n.visit(a,l)):(l=null,n.visit(a,s))}}};function H_({maxIndent:t,$canIndent:e}){const[n]=jr();return C.useEffect(()=>KN(n,t,e),[n,t,e]),null}function q_({disableTakeFocusOnClick:t=!1}){const[e]=jr();return C.useEffect(()=>ZH(e,{disableTakeFocusOnClick:t}),[e,t]),null}function Y_({hasStrictIndent:t=!1,shouldPreserveNumbering:e=!1}){const[n]=jr();return C.useEffect(()=>{if(!n.hasNodes([fs,us]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),C.useEffect(()=>ln(W_(n,{restoreNumbering:e}),t?HH(n):()=>{}),[n,t,e]),(function(r){C.useEffect(()=>W_(r),[r])})(n),null}const KH={name:"tasklistCheck",tokenize:eq};function JH(){return{text:{91:KH}}}function eq(t,e,n){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(a),t.exit("taskListCheckMarker"),o)}function o(a){return It(a)?(t.enter("taskListCheckValueUnchecked"),t.consume(a),t.exit("taskListCheckValueUnchecked"),s):a===88||a===120?(t.enter("taskListCheckValueChecked"),t.consume(a),t.exit("taskListCheckValueChecked"),s):n(a)}function s(a){return a===93?(t.enter("taskListCheckMarker"),t.consume(a),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(a)}function l(a){return Ce(a)?e(a):je(a)?t.check({tokenize:tq},e,n)(a):n(a)}}function tq(t,e,n){return et(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function nq(){return{exit:{taskListCheckValueChecked:U_,taskListCheckValueUnchecked:U_,paragraph:iq}}}function rq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oq}}}function U_(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function iq(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function oq(t,e,n,r){const i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let a=pv.listItem(t,e,n,{...r,...l.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(u){return u+s}}const sq=new Map([["number",J9],["bullet",K9],["check",q9],["",eQ]]),Iy=we("",t=>{t.sub(t.pipe(wc,rn(zt)),([e,n])=>{if(!e||!n)return;const r=e.anchor.getNode();let i=r.getKey()==="root"?r:lt(r,l=>{const a=l.getParent();return a!==null&>(a)});i??(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null)if($e(i)){const l=CA(r,fs),a=l?l.getListType():i.getListType();t.pub(Iy,a)}else t.pub(Iy,"")})}),tQ=Nn(t=>{t.sub(t.pipe(tQ,rn(zt)),([e,n])=>{n?.dispatchCommand(sq.get(e),void 0)})}),lq=Zr({init(t){var e;(e=t.getValue(cs))==null||e.registerCommand(Hp,()=>!cq(7),co),t.pubIn({[Yc]:"lists",[bg]:nq(),[xg]:JH(),[es]:[qH,YH],[tl]:[us,fs],[nl]:[UH,GH],[kv]:rq(),[Ah]:[H_,Y_,q_],[Tv]:[H_,Y_,q_]})}});function aq(t){const e=t.getNodes();return e.length===0?new Set([t.anchor.getNode().getParentOrThrow(),t.focus.getNode().getParentOrThrow()]):new Set(e.map(n=>N(n)?n:n.getParentOrThrow()))}function cq(t){const e=ne();if(!X(e))return!1;const n=aq(e);let r=0;for(const i of n)if($e(i))r=Math.max(Ff(i)+1,r);else if(De(i)){const o=i.getParent();if(o?.getChildren().length===1){const s=o.getParent();if(De(s)&&s.getChildren().length===1)return!1}if(!$e(o))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(Ff(o)+1,r)}return r<=t}function uq(t){return t.length}function fq(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||uq,o=[],s=[],l=[],a=[];let c=0,u=-1;for(;++u<t.length;){const g=[],m=[];let O=-1;for(t[u].length>c&&(c=t[u].length);++O<t[u].length;){const y=hq(t[u][O]);if(n.alignDelimiters!==!1){const x=i(y);m[O]=x,(a[O]===void 0||x>a[O])&&(a[O]=x)}g.push(y)}s[u]=g,l[u]=m}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)o[f]=G_(r[f]);else{const g=G_(r);for(;++f<c;)o[f]=g}f=-1;const h=[],d=[];for(;++f<c;){const g=o[f];let m="",O="";g===99?(m=":",O=":"):g===108?m=":":g===114&&(O=":");let y=n.alignDelimiters===!1?1:Math.max(1,a[f]-m.length-O.length);const x=m+"-".repeat(y)+O;n.alignDelimiters!==!1&&(y=m.length+y+O.length,y>a[f]&&(a[f]=y),d[f]=y),h[f]=x}s.splice(1,0,h),l.splice(1,0,d),u=-1;const p=[];for(;++u<s.length;){const g=s[u],m=l[u];f=-1;const O=[];for(;++f<c;){const y=g[f]||"";let x="",b="";if(n.alignDelimiters!==!1){const S=a[f]-(m[f]||0),v=o[f];v===114?x=" ".repeat(S):v===99?S%2?(x=" ".repeat(S/2+.5),b=" ".repeat(S/2-.5)):(x=" ".repeat(S/2),b=x):b=" ".repeat(S)}n.delimiterStart!==!1&&!f&&O.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||f)&&O.push(" "),n.alignDelimiters!==!1&&O.push(x),O.push(y),n.alignDelimiters!==!1&&O.push(b),n.padding!==!1&&O.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&O.push("|")}p.push(n.delimiterEnd===!1?O.join("").replace(/ +$/,""):O.join(""))}return p.join(`
|
|
61
|
-
`)}function hq(t){return t==null?"":String(t)}function G_(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function dq(){return{enter:{table:pq,tableData:K_,tableHeader:K_,tableRow:mq},exit:{codeText:Oq,table:gq,tableData:a1,tableHeader:a1,tableRow:a1}}}function pq(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function gq(t){this.exit(t),this.data.inTable=void 0}function mq(t){this.enter({type:"tableRow",children:[]},t)}function a1(t){this.exit(t)}function K_(t){this.enter({type:"tableCell",children:[]},t)}function Oq(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,yq));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function yq(t,e){return e==="|"?e:t}function xq(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
62
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:a,tableRow:l}};function s(d,p,g,m){return c(u(d,g,m),d.align)}function l(d,p,g,m){const O=f(d,g,m),y=c([O]);return y.slice(0,y.indexOf(`
|
|
63
|
-
`))}function a(d,p,g,m){const O=g.enter("tableCell"),y=g.enter("phrasing"),x=g.containerPhrasing(d,{...m,before:o,after:o});return y(),O(),x}function c(d,p){return fq(d,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(d,p,g){const m=d.children;let O=-1;const y=[],x=p.enter("table");for(;++O<m.length;)y[O]=f(m[O],p,g);return x(),y}function f(d,p,g){const m=d.children;let O=-1;const y=[],x=p.enter("tableRow");for(;++O<m.length;)y[O]=a(m[O],d,p,g);return x(),y}function h(d,p,g){let m=pv.inlineCode(d,p,g);return g.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}class bq{constructor(){this.map=[]}add(e,n,r){vq(this,e,n,r)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const o of i)e.push(o);i=r.pop()}this.map.length=0}}function vq(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function Sq(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function wq(){return{flow:{null:{name:"table",tokenize:kq,resolveAll:Cq}}}}function kq(t,e,n){const r=this;let i=0,o=0,s;return l;function l(T){let M=r.events.length-1;for(;M>-1;){const D=r.events[M][1].type;if(D==="lineEnding"||D==="linePrefix")M--;else break}const I=M>-1?r.events[M][1].type:null,$=I==="tableHead"||I==="tableRow"?v:a;return $===v&&r.parser.lazy[r.now().line]?n(T):$(T)}function a(T){return t.enter("tableHead"),t.enter("tableRow"),c(T)}function c(T){return T===124||(s=!0,o+=1),u(T)}function u(T){return T===null?n(T):Ce(T)?o>1?(o=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),d):n(T):je(T)?et(t,u,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),s=!0,u):(t.enter("data"),f(T)))}function f(T){return T===null||T===124||It(T)?(t.exit("data"),u(T)):(t.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(t.consume(T),f):f(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(t.enter("tableDelimiterRow"),s=!1,je(T)?et(t,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):p(T))}function p(T){return T===45||T===58?m(T):T===124?(s=!0,t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),g):S(T)}function g(T){return je(T)?et(t,m,"whitespace")(T):m(T)}function m(T){return T===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),O):T===45?(o+=1,O(T)):T===null||Ce(T)?b(T):S(T)}function O(T){return T===45?(t.enter("tableDelimiterFiller"),y(T)):S(T)}function y(T){return T===45?(t.consume(T),y):T===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(T))}function x(T){return je(T)?et(t,b,"whitespace")(T):b(T)}function b(T){return T===124?p(T):T===null||Ce(T)?!s||i!==o?S(T):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(T)):S(T)}function S(T){return n(T)}function v(T){return t.enter("tableRow"),w(T)}function w(T){return T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),w):T===null||Ce(T)?(t.exit("tableRow"),e(T)):je(T)?et(t,w,"whitespace")(T):(t.enter("data"),k(T))}function k(T){return T===null||T===124||It(T)?(t.exit("data"),w(T)):(t.consume(T),T===92?P:k)}function P(T){return T===92||T===124?(t.consume(T),k):k(T)}}function Cq(t,e){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,a=0,c,u,f;const h=new bq;for(;++n<t.length;){const d=t[n],p=d[1];d[0]==="enter"?p.type==="tableHead"?(l=!1,a!==0&&(J_(h,e,a,c,u),u=void 0,a=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,e]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,e]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=ud(h,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],f=ud(h,e,o,i,void 0,f)),o=s,s=[o[1],n,0,0])):p.type==="tableHead"?(l=!0,a=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(a=n,o[1]!==0?(s[0]=s[1],f=ud(h,e,o,i,n,f)):s[1]!==0&&(f=ud(h,e,s,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(a!==0&&J_(h,e,a,c,u),h.consume(e.events),n=-1;++n<e.events.length;){const d=e.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Sq(e.events,n))}return t}function ud(t,e,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},Qa(e.events,n[0])),t.add(n[0],0,[["exit",o,e]]));const a=Qa(e.events,n[1]);if(o={type:s,start:Object.assign({},a),end:Object.assign({},a)},t.add(n[1],0,[["enter",o,e]]),n[2]!==0){const c=Qa(e.events,n[2]),u=Qa(e.events,n[3]),f={type:l,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const h=e.events[n[2]],d=e.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;t.add(p,g,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},Qa(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function J_(t,e,n,r,i){const o=[],s=Qa(e.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),r.end=Object.assign({},s),o.push(["exit",r,e]),t.add(n+1,0,o)}function Qa(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}var _q=Object.defineProperty,Gc=(t,e)=>_q(t,"name",{value:e,configurable:!0}),nQ=!!(typeof window<"u"&&window.document&&window.document.createElement);function Je(t,e,{checkForDefaultPrevented:n=!0}={}){return Gc(function(i){if(t?.(i),n===!1||!i||!i.defaultPrevented)return e?.(i)},"handleEvent")}Gc(Je,"composeEventHandlers");function Tq(t){if(!nQ)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}Gc(Tq,"getOwnerWindow");function Dy(t){if(!nQ)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}Gc(Dy,"getOwnerDocument");function rQ(t,e=!1){const{activeElement:n}=Dy(t);if(!n?.nodeName)return null;if(iQ(n)&&n.contentDocument)return rQ(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const i=Dy(n).getElementById(r);if(i)return i}}return n}Gc(rQ,"getActiveElement");function iQ(t){return t.tagName==="IFRAME"}Gc(iQ,"isFrame");var Pq=Object.defineProperty,Mv=(t,e)=>Pq(t,"name",{value:e,configurable:!0});function Ny(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Mv(Ny,"setRef");function oQ(...t){return e=>{let n=!1;const r=t.map(i=>{const o=Ny(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Ny(t[i],null)}}}}Mv(oQ,"composeRefs");function Bt(...t){return C.useCallback(oQ(...t),t)}Mv(Bt,"useComposedRefs");var Eq=Object.defineProperty,Ur=(t,e)=>Eq(t,"name",{value:e,configurable:!0});function $q(t,e){const n=C.createContext(e);n.displayName=t+"Context";const r=Ur(o=>{const{children:s,...l}=o,a=C.useMemo(()=>l,Object.values(l));return V.jsx(n.Provider,{value:a,children:s})},"Provider");r.displayName=t+"Provider";function i(o,s={}){const{optional:l=!1}=s,a=C.useContext(n);if(a)return a;if(e!==void 0)return e;if(!l)throw new Error(`\`${o}\` must be used within \`${t}\``)}return Ur(i,"useContext"),[r,i]}Ur($q,"createContext");function mo(t,e=[]){let n=[];function r(o,s){const l=C.createContext(s);l.displayName=o+"Context";const a=n.length;n=[...n,s];const c=Ur(f=>{const{scope:h,children:d,...p}=f,g=h?.[t]?.[a]||l,m=C.useMemo(()=>p,Object.values(p));return V.jsx(g.Provider,{value:m,children:d})},"Provider");c.displayName=o+"Provider";function u(f,h,d={}){const{optional:p=!1}=d,g=h?.[t]?.[a]||l,m=C.useContext(g);if(m)return m;if(s!==void 0)return s;if(!p)throw new Error(`\`${f}\` must be used within \`${o}\``)}return Ur(u,"useContext"),[c,u]}Ur(r,"createContext");const i=Ur(()=>{const o=n.map(s=>C.createContext(s));return Ur(function(l){const a=l?.[t]||o;return C.useMemo(()=>({[`__scope${t}`]:{...l,[t]:a}}),[l,a])},"useScope")},"createScope");return i.scopeName=t,[r,sQ(i,...e)]}Ur(mo,"createContextScope");function sQ(...t){const e=t[0];if(t.length===1)return e;const n=Ur(()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return Ur(function(o){const s=r.reduce((l,{useScope:a,scopeName:c})=>{const f=a(o)[`__scope${c}`];return{...l,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ur(sQ,"composeContextScopes");var Aq=Object.defineProperty,Bi=(t,e)=>Aq(t,"name",{value:e,configurable:!0});function Vs(t){const e=C.forwardRef((n,r)=>{let{children:i,...o}=n,s=null,l=!1;const a=[];Vy(i)&&typeof fd=="function"&&(i=fd(i._payload)),C.Children.forEach(i,h=>{if(fQ(h)){l=!0;const d=h;let p="child"in d.props?d.props.child:d.props.children;Vy(p)&&typeof fd=="function"&&(p=fd(p._payload)),s=Qq(d,p),a.push(s?.props?.children)}else a.push(h)}),s?s=C.cloneElement(s,void 0,a):!l&&C.Children.count(i)===1&&C.isValidElement(i)&&(s=i);const c=s?uQ(s):void 0,u=Bt(r,c);if(!s){if(i||i===0)throw new Error(l?Lq(t):Rq(t));return i}const f=cQ(o,s.props??{});return s.type!==C.Fragment&&(f.ref=r?u:c),C.cloneElement(s,f)});return e.displayName=`${t}.Slot`,e}Bi(Vs,"createSlot");var lQ=Symbol.for("radix.slottable");function aQ(t){const e=Bi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=lQ,e}Bi(aQ,"createSlottable");var Qq=Bi((t,e)=>{if("child"in t.props){const n=t.props.child;return C.isValidElement(n)?C.cloneElement(n,void 0,t.props.children(n.props.children)):null}return C.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function cQ(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const a=o(...l);return i(...l),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}Bi(cQ,"mergeProps");function uQ(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Bi(uQ,"getElementRef");function fQ(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===lQ}Bi(fQ,"isSlottable");var Mq=Symbol.for("react.lazy");function Vy(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Mq&&"_payload"in t&&hQ(t._payload)}Bi(Vy,"isLazyComponent");function hQ(t){return typeof t=="object"&&t!==null&&"then"in t}Bi(hQ,"isPromiseLike");var Rq=Bi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Lq=Bi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),fd=Vc[" use ".trim().toString()],Iq=Object.defineProperty,Dq=(t,e)=>Iq(t,"name",{value:e,configurable:!0}),Nq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],At=Nq.reduce((t,e)=>{const n=Vs(`Primitive.${e}`),r=C.forwardRef((i,o)=>{const{asChild:s,...l}=i,a=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),V.jsx(a,{...l,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function dQ(t,e){t&&Ns.flushSync(()=>t.dispatchEvent(e))}Dq(dQ,"dispatchDiscreteCustomEvent");var Vq=Object.defineProperty,Bq=(t,e)=>Vq(t,"name",{value:e,configurable:!0});function Di(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>((...n)=>e.current?.(...n)),[])}Bq(Di,"useCallbackRef");var Fq=Object.defineProperty,gn=(t,e)=>Fq(t,"name",{value:e,configurable:!0}),By="dismissableLayer.update",Zq="dismissableLayer.pointerDownOutside",zq="dismissableLayer.focusOutside",e2,pQ=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Rv=C.forwardRef(gn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:a,onDismiss:c,...u}=e,f=C.useContext(pQ),[h,d]=C.useState(null),p=h?.ownerDocument??globalThis?.document,[,g]=C.useState({}),m=Bt(n,d),O=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?O.indexOf(y):-1,b=h?O.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,v=b>=x,w=C.useRef(!1),k=gQ(I=>{s?.(I),a?.(I),I.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(I=>{if(!(I instanceof Node))return!1;const $=[...f.branches].some(D=>D.contains(I));return v&&!$},[f.branches,v])}),P=mQ(I=>{if(i&&w.current)return;const $=I.target;[...f.branches].some(Z=>Z.contains($))||(l?.(I),a?.(I),I.defaultPrevented||c?.())},p),T=h?b===O.length-1:!1,M=Di(I=>{I.key==="Escape"&&(o?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))});return C.useEffect(()=>{if(T)return p.addEventListener("keydown",M,{capture:!0}),()=>p.removeEventListener("keydown",M,{capture:!0})},[p,T,M]),C.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(e2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Fy(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=e2))}},[h,p,r,f]),C.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Fy())},[h,f]),C.useEffect(()=>{const I=gn(()=>g({}),"handleUpdate");return document.addEventListener(By,I),()=>document.removeEventListener(By,I)},[]),V.jsx(At.div,{...u,ref:m,style:{pointerEvents:S?v?"auto":"none":void 0,...e.style},onFocusCapture:Je(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Je(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Je(e.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function jq(){const t=C.useContext(pQ),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}gn(jq,"useDismissableLayerSurface");var Xq=gn(()=>!0,"IS_TRUE");function gQ(t,e){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:s=Xq}=e,l=Di(t),a=C.useRef(!1),c=C.useRef(!1),u=C.useRef(new Map),f=C.useRef(()=>{});return C.useEffect(()=>{function h(){c.current=!1,i.current=!1,u.current.clear()}gn(h,"resetOutsideInteraction");function d(){return Array.from(u.current.values()).some(Boolean)}gn(d,"isOutsideInteractionIntercepted");function p(x){if(!c.current)return;const b=x.target;b instanceof Node&&[...o].some(v=>v.contains(b))||u.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{c.current&&f.current()},0)}gn(p,"handleInteractionCapture");function g(x){c.current&&u.current.set(x.type,!1)}gn(g,"handleInteractionBubble");const m=gn(x=>{if(x.target&&!a.current){let b=function(){n.removeEventListener("click",f.current);const v=d();h(),v||Lv(Zq,l,S,{discrete:!0})};if(gn(b,"handleAndDispatchPointerDownOutsideEvent"),!s(x.target)){n.removeEventListener("click",f.current),h(),a.current=!1;return}const S={originalEvent:x};c.current=!0,i.current=r&&x.button===0,u.current.clear(),!r||x.button!==0?b():(n.removeEventListener("click",f.current),f.current=b,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();a.current=!1},"handlePointerDown"),O=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of O)n.addEventListener(x,p,!0),n.addEventListener(x,g);const y=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(y),n.removeEventListener("pointerdown",m),n.removeEventListener("click",f.current);for(const x of O)n.removeEventListener(x,p,!0),n.removeEventListener(x,g)}},[n,l,r,i,o,s]),{onPointerDownCapture:gn(()=>a.current=!0,"onPointerDownCapture")}}gn(gQ,"usePointerDownOutside");function mQ(t,e=globalThis?.document){const n=Di(t),r=C.useRef(!1);return C.useEffect(()=>{const i=gn(o=>{o.target&&!r.current&&Lv(zq,n,{originalEvent:o},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:gn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:gn(()=>r.current=!1,"onBlurCapture")}}gn(mQ,"useFocusOutside");function Fy(){const t=new CustomEvent(By);document.dispatchEvent(t)}gn(Fy,"dispatchUpdate");function Lv(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?dQ(i,o):i.dispatchEvent(o)}gn(Lv,"handleAndDispatchCustomEvent");var Wq=Object.defineProperty,Iv=(t,e)=>Wq(t,"name",{value:e,configurable:!0}),hd=0,Ca=null;function Hq(t){return Ym(),t.children}Iv(Hq,"FocusGuards");function Ym(){C.useEffect(()=>{Ca||(Ca={start:Zy(),end:Zy()});const{start:t,end:e}=Ca;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),hd++,()=>{hd===1&&(Ca?.start.remove(),Ca?.end.remove(),Ca=null),hd=Math.max(0,hd-1)}},[])}Iv(Ym,"useFocusGuards");function Zy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Iv(Zy,"createFocusGuard");var qq=Object.defineProperty,nr=(t,e)=>qq(t,"name",{value:e,configurable:!0}),c1="focusScope.autoFocusOnMount",u1="focusScope.autoFocusOnUnmount",t2={bubbles:!1,cancelable:!0},OQ=C.forwardRef(nr(function(e,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=e,[a,c]=C.useState(null),u=Di(o),f=Di(s),h=C.useRef(null),d=Bt(n,c),p=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(i){let m=function(b){if(p.paused||!a)return;const S=b.target;a.contains(S)?h.current=S:To(h.current,{select:!0})},O=function(b){if(p.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||To(h.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const v of b)v.removedNodes.length>0&&To(a)};nr(m,"handleFocusIn"),nr(O,"handleFocusOut"),nr(y,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",O);const x=new MutationObserver(y);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",O),x.disconnect()}}},[i,a,p.paused]),C.useEffect(()=>{if(a){n2.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(c1,t2);a.addEventListener(c1,u),a.dispatchEvent(y),y.defaultPrevented||(yQ(wQ(Dv(a)),{select:!0}),document.activeElement===m&&To(a))}return()=>{a.removeEventListener(c1,u),setTimeout(()=>{const y=new CustomEvent(u1,t2);a.addEventListener(u1,f),a.dispatchEvent(y),y.defaultPrevented||To(m??document.body,{select:!0}),a.removeEventListener(u1,f),n2.remove(p)},0)}}},[a,u,f,p]);const g=C.useCallback(m=>{if(!r&&!i||p.paused)return;const O=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(O&&y){const x=m.currentTarget,[b,S]=xQ(x);b&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&To(b,{select:!0})):m.shiftKey&&y===b&&(m.preventDefault(),r&&To(S,{select:!0})):y===x&&m.preventDefault()}},[r,i,p.paused]);return V.jsx(At.div,{tabIndex:-1,...l,ref:d,onKeyDown:g})},"FocusScope"));function yQ(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(To(r,{select:e}),document.activeElement!==n)return}nr(yQ,"focusFirst");function xQ(t){const e=Dv(t),n=zy(e,t),r=zy(e.reverse(),t);return[n,r]}nr(xQ,"getTabbableEdges");function Dv(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:nr(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}nr(Dv,"getTabbableCandidates");function zy(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):bQ(r,{upTo:e})))return r}nr(zy,"findVisible");function bQ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}nr(bQ,"isHidden");function vQ(t){return t instanceof HTMLInputElement&&"select"in t}nr(vQ,"isSelectableInput");function To(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&vQ(t)&&e&&t.select()}}nr(To,"focus");var n2=SQ();function SQ(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=jy(t,e),t.unshift(e)},remove(e){t=jy(t,e),t[0]?.resume()}}}nr(SQ,"createFocusScopesStack");function jy(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}nr(jy,"arrayRemove");function wQ(t){return t.filter(e=>e.tagName!=="A")}nr(wQ,"removeLinks");var In=globalThis?.document?C.useLayoutEffect:()=>{},Yq=Object.defineProperty,Uq=(t,e)=>Yq(t,"name",{value:e,configurable:!0}),Gq=Vc[" useId ".trim().toString()]||(()=>{}),Kq=0;function Kc(t){const[e,n]=C.useState(Gq());return In(()=>{t||n(r=>r??String(Kq++))},[t]),t||(e?`radix-${e}`:"")}Uq(Kc,"useId");const Jq=["top","right","bottom","left"],Bs=Math.min,Fo=Math.max,kg=Math.round,dd=Math.floor,Zo=t=>({x:t,y:t}),eY={left:"right",right:"left",bottom:"top",top:"bottom"};function kQ(t,e,n){return Fo(t,Bs(e,n))}function ns(t,e){return typeof t=="function"?t(e):t}function Fs(t){return t.split("-")[0]}function Jc(t){return t.split("-")[1]}function Nv(t){return t==="x"?"y":"x"}function Vv(t){return t==="y"?"height":"width"}function eo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Bv(t){return Nv(eo(t))}function tY(t,e,n){n===void 0&&(n=!1);const r=Jc(t),i=Bv(t),o=Vv(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Cg(s)),[s,Cg(s)]}function nY(t){const e=Cg(t);return[Xy(t),e,Xy(e)]}function Xy(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const r2=["left","right"],i2=["right","left"],rY=["top","bottom"],iY=["bottom","top"];function oY(t,e,n){switch(t){case"top":case"bottom":return n?e?i2:r2:e?r2:i2;case"left":case"right":return e?rY:iY;default:return[]}}function sY(t,e,n,r){const i=Jc(t);let o=oY(Fs(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Xy)))),o}function Cg(t){const e=Fs(t);return eY[e]+t.slice(e.length)}function lY(t){var e,n,r,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(i=t.left)!=null?i:0}}function CQ(t){return typeof t!="number"?lY(t):{top:t,right:t,bottom:t,left:t}}function _g(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function o2(t,e,n){let{reference:r,floating:i}=t;const o=eo(e),s=Bv(e),l=Vv(s),a=Fs(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let d;switch(a){case"top":d={x:u,y:r.y-i.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-i.width,y:f};break;default:d={x:r.x,y:r.y}}const p=Jc(e);return p&&(d[s]+=h*(p==="end"?1:-1)*(n&&c?-1:1)),d}async function aY(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=ns(e,t),p=CQ(d),m=l[h?f==="floating"?"reference":"floating":f],O=_g(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),y=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(x))&&await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1},S=_g(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:a}):y);return{top:(O.top-S.top+p.top)/b.y,bottom:(S.bottom-O.bottom+p.bottom)/b.y,left:(O.left-S.left+p.left)/b.x,right:(S.right-O.right+p.right)/b.x}}const cY=50,uY=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:aY},a=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=o2(c,r,a),h=r,d=0;const p={};for(let g=0;g<o.length;g++){const m=o[g];if(!m)continue;const{name:O,fn:y}=m,{x,y:b,data:S,reset:v}=await y({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});u=x??u,f=b??f,p[O]={...p[O],...S},v&&d<cY&&(d++,typeof v=="object"&&(v.placement&&(h=v.placement),v.rects&&(c=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:u,y:f}=o2(c,h,a)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}},fY=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:u=0}=ns(t,e)||{};if(c==null)return{};const f=CQ(u),h={x:n,y:r},d=Bv(i),p=Vv(d),g=await s.getDimensions(c),m=d==="y",O=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=o.reference[p]+o.reference[d]-h[d]-o.floating[p],S=h[d]-o.reference[d],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let w=v?v[x]:0;(!w||!await(s.isElement==null?void 0:s.isElement(v)))&&(w=l.floating[x]||o.floating[p]);const k=b/2-S/2,P=w/2-g[p]/2-1,T=Bs(f[O],P),M=Bs(f[y],P),I=w-g[p]-M,$=w/2-g[p]/2+k,D=kQ(T,$,I),Z=!a.arrow&&Jc(i)!=null&&$!==D&&o.reference[p]/2-($<T?T:M)-g[p]/2<0,G=Z?$<T?$-T:$-I:0;return{[d]:h[d]+G,data:{[d]:D,centerOffset:$-D-G,...Z&&{alignmentOffset:G}},reset:Z}}}),hY=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=ns(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const O=Fs(i),y=eo(l),x=Fs(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=h||(x||!g?[Cg(l)]:nY(l)),v=p!=="none";!h&&v&&S.push(...sY(l,g,p,b));const w=[l,...S],k=await a.detectOverflow(e,m),P=[];let T=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(k[O]),f){const D=tY(i,s,b);P.push(k[D[0]],k[D[1]])}if(T=[...T,{placement:i,overflows:P}],!P.every(D=>D<=0)){var M,I;const D=(((M=o.flip)==null?void 0:M.index)||0)+1,Z=w[D];if(Z&&(!(f==="alignment"?y!==eo(Z):!1)||T.every(ee=>eo(ee.placement)===y?ee.overflows[0]>0:!0)))return{data:{index:D,overflows:T},reset:{placement:Z}};let G=(I=T.filter(z=>z.overflows[0]<=0).sort((z,ee)=>z.overflows[1]-ee.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(d){case"bestFit":{var $;const z=($=T.filter(ee=>{if(v){const oe=eo(ee.placement);return oe===y||oe==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(oe=>oe>0).reduce((oe,Q)=>oe+Q,0)]).sort((ee,oe)=>ee[1]-oe[1])[0])==null?void 0:$[0];z&&(G=z);break}case"initialPlacement":G=l;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function s2(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function l2(t){return Jq.some(e=>t[e]>=0)}const dY=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...o}=ns(t,e);switch(i){case"referenceHidden":{const s=await r.detectOverflow(e,{...o,elementContext:"reference"}),l=s2(s,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:l2(l)}}}case"escaped":{const s=await r.detectOverflow(e,{...o,altBoundary:!0}),l=s2(s,n.floating);return{data:{escapedOffsets:l,escaped:l2(l)}}}default:return{}}}}},_Q=new Set(["left","top"]);async function pY(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Fs(n),l=Jc(n),a=eo(n)==="y",c=_Q.has(s)?-1:1,u=o&&a?-1:1,f=ns(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(d=l==="end"?p*-1:p),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}const gY=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,a=await pY(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:s}}}}},mY=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:o}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...c}=ns(t,e),u={x:n,y:r},f=await o.detectOverflow(e,c),h=eo(i),d=Nv(h);let p=u[d],g=u[h];const m=(y,x)=>kQ(x+f[y==="y"?"top":"left"],x,x-f[y==="y"?"bottom":"right"]);s&&(p=m(d,p)),l&&(g=m(h,g));const O=a.fn({...e,[d]:p,[h]:g});return{...O,data:{x:O.x-n,y:O.y-r,enabled:{[d]:s,[h]:l}}}}}},OY=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:i,y:o,placement:s,rects:l,middlewareData:a}=e,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=ns(t,e),h={x:i,y:o},d=eo(s),p=Nv(d);let g=h[p],m=h[d];const O=ns(c,e),y=typeof O=="number"?{mainAxis:O,crossAxis:0}:{mainAxis:(n=O.mainAxis)!=null?n:0,crossAxis:(r=O.crossAxis)!=null?r:0};if(u){const S=p==="y"?"height":"width",v=l.reference[p]-l.floating[S]+y.mainAxis,w=l.reference[p]+l.reference[S]-y.mainAxis;g<v?g=v:g>w&&(g=w)}if(f){var x,b;const S=p==="y"?"width":"height",v=_Q.has(Fs(s)),w=l.reference[d]-l.floating[S]+(v&&((x=a.offset)==null?void 0:x[d])||0)+(v?0:y.crossAxis),k=l.reference[d]+l.reference[S]+(v?0:((b=a.offset)==null?void 0:b[d])||0)-(v?y.crossAxis:0);m<w?m=w:m>k&&(m=k)}return{[p]:g,[d]:m}}}},yY=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:o}=e,{apply:s=()=>{},...l}=ns(t,e),a=await i.detectOverflow(e,l),c=Fs(n),u=Jc(n),f=eo(n)==="y",{width:h,height:d}=r.floating;let p,g;c==="top"||c==="bottom"?(p=c,g=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p=u==="end"?"top":"bottom");const m=d-a.top-a.bottom,O=h-a.left-a.right,y=Bs(d-a[p],m),x=Bs(h-a[g],O),b=e.middlewareData.shift,S=!b;let v=y,w=x;b!=null&&b.enabled.x&&(w=O),b!=null&&b.enabled.y&&(v=m),S&&!u&&(f?w=h-2*Fo(a.left,a.right):v=d-2*Fo(a.top,a.bottom)),await s({...e,availableWidth:w,availableHeight:v});const k=await i.getDimensions(o.floating);return h!==k.width||d!==k.height?{reset:{rects:!0}}:{}}}};function Um(){return typeof window<"u"}function eu(t){return TQ(t)?(t.nodeName||"").toLowerCase():"#document"}function vr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hs(t){var e;return(e=(TQ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function TQ(t){return Um()?t instanceof Node||t instanceof vr(t).Node:!1}function fo(t){return Um()?t instanceof Element||t instanceof vr(t).Element:!1}function rl(t){return Um()?t instanceof HTMLElement||t instanceof vr(t).HTMLElement:!1}function a2(t){return!Um()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof vr(t).ShadowRoot}function Gm(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function xY(t){return/^(table|td|th)$/.test(eu(t))}function Km(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const bY=/transform|translate|scale|rotate|perspective|filter/,vY=/paint|layout|strict|content/,fl=t=>!!t&&t!=="none";let f1;function Fv(t){const e=fo(t)?ho(t):t;return fl(e.transform)||fl(e.translate)||fl(e.scale)||fl(e.rotate)||fl(e.perspective)||!Zv()&&(fl(e.backdropFilter)||fl(e.filter))||bY.test(e.willChange||"")||vY.test(e.contain||"")}function SY(t){let e=Hl(t);for(;rl(e)&&!Zf(e);){if(Fv(e))return e;if(Km(e))return null;e=Hl(e)}return null}function Zv(){return f1==null&&(f1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),f1}function Zf(t){return/^(html|body|#document)$/.test(eu(t))}function ho(t){return vr(t).getComputedStyle(t)}function Jm(t){return fo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Hl(t){if(eu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||a2(t)&&t.host||hs(t);return a2(e)?e.host:e}function PQ(t){const e=Hl(t);return Zf(e)?(t.ownerDocument||t).body:rl(e)&&Gm(e)?e:PQ(e)}function zf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=PQ(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=vr(i);if(o){const l=Wy(s);return e.concat(s,s.visualViewport||[],Gm(i)?i:[],l&&n?zf(l):[])}else return e.concat(i,zf(i,[],n))}function Wy(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function EQ(t){const e=ho(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rl(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=kg(n)!==o||kg(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function zv(t){return fo(t)?t:t.contextElement}function rc(t){const e=zv(t);if(!rl(e))return Zo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=EQ(e);let s=(o?kg(n.width):n.width)/r,l=(o?kg(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const wY=Zo(0);function $Q(t){const e=vr(t);return!Zv()||!e.visualViewport?wY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kY(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===vr(t)}function ql(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=zv(t);let s=Zo(1);e&&(r?fo(r)&&(s=rc(r)):s=rc(t));const l=kY(o,n,r)?$Q(o):Zo(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o&&r){const h=vr(o),d=fo(r)?vr(r):r;let p=h,g=Wy(p);for(;g&&d!==p;){const m=rc(g),O=g.getBoundingClientRect(),y=ho(g),x=O.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,b=O.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;a*=m.x,c*=m.y,u*=m.x,f*=m.y,a+=x,c+=b,p=vr(g),g=Wy(p)}}return _g({width:u,height:f,x:a,y:c})}function eO(t,e){const n=Jm(t).scrollLeft;return e?e.left+n:ql(hs(t)).left+n}function AQ(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-eO(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function CY(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=hs(r),l=e?Km(e.floating):!1;if(r===s||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=Zo(1);const u=Zo(0),f=rl(r);if((f||!o)&&((eu(r)!=="body"||Gm(s))&&(a=Jm(r)),f)){const d=ql(r);c=rc(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const h=s&&!f&&!o?AQ(s,a):Zo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}}function _Y(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function TY(t){const e=Jm(t),n=t.ownerDocument.body,r=Fo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Fo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-e.scrollLeft+eO(t);const s=-e.scrollTop;return ho(n).direction==="rtl"&&(o+=Fo(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:s}}const PY=25;function EY(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=vr(t),o=hs(t),s=i.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(s){const h=!Zv()||e==="fixed";r?h||(c=-s.offsetLeft,u=-s.offsetTop):(l=s.width,a=s.height,h&&(c=s.offsetLeft,u=s.offsetTop))}if(eO(o)<=0){const h=o.ownerDocument,d=h.body,p=getComputedStyle(d),g=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-d.clientWidth-g),O=getComputedStyle(o).scrollbarGutter==="stable both-edges"?m/2:m;O<=PY&&(l-=O)}return{width:l,height:a,x:c,y:u}}function $Y(t,e){const n=ql(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=rc(t),s=t.clientWidth*o.x,l=t.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:s,height:l,x:a,y:c}}function c2(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=EY(t,n,e);else if(e==="document")r=TY(hs(t));else if(fo(e))r=$Y(e,n);else{const i=$Q(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _g(r)}function AY(t,e){const n=e.get(t);if(n)return n;let r=zf(t,[],!1).filter(l=>fo(l)&&eu(l)!=="body"),i=null;const o=ho(t).position==="fixed";let s=o?Hl(t):t;for(;fo(s)&&!Zf(s);){const l=ho(s),a=Fv(s),c=i?i.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(f=>f!==s):i=l,s=Hl(s)}return e.set(t,r),r}function QY(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Km(e)?[]:AY(e,this._c):[].concat(n),r],l=c2(e,s[0],i);let a=l.top,c=l.right,u=l.bottom,f=l.left;for(let h=1;h<s.length;h++){const d=c2(e,s[h],i);a=Fo(d.top,a),c=Bs(d.right,c),u=Bs(d.bottom,u),f=Fo(d.left,f)}return{width:c-f,height:u-a,x:f,y:a}}function MY(t){const{width:e,height:n}=EQ(t);return{width:e,height:n}}function RY(t,e,n){const r=rl(e),i=hs(e),o=n==="fixed",s=ql(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=Zo(0);if((r||!o)&&((eu(e)!=="body"||Gm(i))&&(l=Jm(e)),r)){const h=ql(e,!0,o,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}!r&&i&&(a.x=eO(i));const c=i&&!r&&!o?AQ(i,l):Zo(0),u=s.left+l.scrollLeft-a.x-c.x,f=s.top+l.scrollTop-a.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function h1(t){return ho(t).position==="static"}function u2(t,e){if(!rl(t)||ho(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hs(t)===n&&(n=n.ownerDocument.body),n}function QQ(t,e){const n=vr(t);if(Km(t))return n;if(!rl(t)){let i=Hl(t);for(;i&&!Zf(i);){if(fo(i)&&!h1(i))return i;i=Hl(i)}return n}let r=u2(t,e);for(;r&&xY(r)&&h1(r);)r=u2(r,e);return r&&Zf(r)&&h1(r)&&!Fv(r)?n:r||SY(t)||n}const LY=async function(t){const e=this.getOffsetParent||QQ,n=this.getDimensions,r=await n(t.floating);return{reference:RY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function IY(t){return ho(t).direction==="rtl"}const DY={convertOffsetParentRelativeRectToViewportRelativeRect:CY,getDocumentElement:hs,getClippingRect:QY,getOffsetParent:QQ,getElementRects:LY,getClientRects:_Y,getDimensions:MY,getScale:rc,isElement:fo,isRTL:IY};function MQ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function NY(t,e,n){let r=null,i;const o=hs(t);function s(){var u;clearTimeout(i),(u=r)==null||u.disconnect(),r=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=t.getBoundingClientRect(),{left:d,top:p,width:g,height:m}=h;if(u||e(),!g||!m)return;const O=dd(p),y=dd(o.clientWidth-(d+g)),x=dd(o.clientHeight-(p+m)),b=dd(d),v={rootMargin:-O+"px "+-y+"px "+-x+"px "+-b+"px",threshold:Fo(0,Bs(1,f))||1};let w=!0;function k(P){const T=P[0].intersectionRatio;if(!MQ(h,t.getBoundingClientRect()))return l();if(T!==f){if(!w)return l();T?l(!1,T):i=setTimeout(()=>{l(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(k,{...v,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,v)}r.observe(t)}const a=vr(t),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),s()}}function VY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=zv(t),u=i||o?[...c?zf(c):[],...e?zf(e):[]]:[];u.forEach(O=>{i&&O.addEventListener("scroll",n),o&&O.addEventListener("resize",n)});const f=c&&l?NY(c,n,o):null;let h=-1,d=null;s&&(d=new ResizeObserver(O=>{let[y]=O;y&&y.target===c&&d&&e&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),c&&!a&&d.observe(c),e&&d.observe(e));let p,g=a?ql(t):null;a&&m();function m(){const O=ql(t);g&&!MQ(g,O)&&n(),g=O,p=requestAnimationFrame(m)}return n(),()=>{var O;u.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f?.(),(O=d)==null||O.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const BY=gY,FY=mY,ZY=hY,zY=yY,jY=dY,f2=fY,XY=OY,WY=(t,e,n)=>{const r=new Map,i=n??{},o={...DY,...i.platform,_c:r};return uY(t,e,{...i,platform:o})};var HY=typeof document<"u",qY=function(){},wp=HY?C.useLayoutEffect:qY;function Tg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Tg(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Tg(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function RQ(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function h2(t,e){const n=RQ(t);return Math.round(e*n)/n}function d1(t){const e=C.useRef(t);return wp(()=>{e.current=t}),e}function YY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=t,[u,f]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);Tg(h,r)||d(r);const[p,g]=C.useState(null),[m,O]=C.useState(null),y=C.useCallback(ee=>{ee!==v.current&&(v.current=ee,g(ee))},[]),x=C.useCallback(ee=>{ee!==w.current&&(w.current=ee,O(ee))},[]),b=o||p,S=s||m,v=C.useRef(null),w=C.useRef(null),k=C.useRef(u),P=a!=null,T=d1(a),M=d1(i),I=d1(c),$=C.useCallback(()=>{if(!v.current||!w.current)return;const ee={placement:e,strategy:n,middleware:h};M.current&&(ee.platform=M.current),WY(v.current,w.current,ee).then(oe=>{const Q={...oe,isPositioned:I.current!==!1};D.current&&!Tg(k.current,Q)&&(k.current=Q,Ns.flushSync(()=>{f(Q)}))})},[h,e,n,M,I]);wp(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(ee=>({...ee,isPositioned:!1})))},[c]);const D=C.useRef(!1);wp(()=>(D.current=!0,()=>{D.current=!1}),[]),wp(()=>{if(b&&(v.current=b),S&&(w.current=S),b&&S){if(T.current)return T.current(b,S,$);$()}},[b,S,$,T,P]);const Z=C.useMemo(()=>({reference:v,floating:w,setReference:y,setFloating:x}),[y,x]),G=C.useMemo(()=>({reference:b,floating:S}),[b,S]),z=C.useMemo(()=>{const ee={position:n,left:0,top:0};if(!G.floating)return ee;const oe=h2(G.floating,u.x),Q=h2(G.floating,u.y);return l?{...ee,transform:"translate("+oe+"px, "+Q+"px)",...RQ(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:Q}},[n,l,G.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:$,refs:Z,elements:G,floatingStyles:z}),[u,$,Z,G,z])}const UY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?f2({element:r.current,padding:i}).fn(n):{}:r?f2({element:r,padding:i}).fn(n):{}}}},GY=(t,e)=>{const n=BY(t);return{name:n.name,fn:n.fn,options:[t,e]}},KY=(t,e)=>{const n=FY(t);return{name:n.name,fn:n.fn,options:[t,e]}},JY=(t,e)=>({fn:XY(t).fn,options:[t,e]}),eU=(t,e)=>{const n=ZY(t);return{name:n.name,fn:n.fn,options:[t,e]}},tU=(t,e)=>{const n=zY(t);return{name:n.name,fn:n.fn,options:[t,e]}},nU=(t,e)=>{const n=jY(t);return{name:n.name,fn:n.fn,options:[t,e]}},rU=(t,e)=>{const n=UY(t);return{name:n.name,fn:n.fn,options:[t,e]}};var iU=Object.defineProperty,oU=(t,e)=>iU(t,"name",{value:e,configurable:!0}),sU=C.forwardRef(oU(function(e,n){const{children:r,width:i=10,height:o=5,...s}=e;return V.jsx(At.svg,{...s,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:V.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),lU=sU,aU=Object.defineProperty,cU=(t,e)=>aU(t,"name",{value:e,configurable:!0});function LQ(t){const[e,n]=C.useState(void 0);return In(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,l;if("borderBoxSize"in o){const a=o.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,l=c.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}cU(LQ,"useSize");var uU=Object.defineProperty,zo=(t,e)=>uU(t,"name",{value:e,configurable:!0}),IQ="Popper",[DQ,tu]=mo(IQ),[fU,NQ]=DQ(IQ),hU=zo(t=>{const{__scopePopper:e,children:n}=t,[r,i]=C.useState(null),[o,s]=C.useState(void 0);return V.jsx(fU,{scope:e,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:s,children:n})},"Popper"),dU="PopperAnchor",pU=C.forwardRef(zo(function(e,n){const{__scopePopper:r,virtualRef:i,...o}=e,s=NQ(dU,r),l=C.useRef(null),a=s.onAnchorChange,c=C.useCallback(g=>{l.current=g,g&&a(g)},[a]),u=Bt(n,c),f=C.useRef(null);C.useEffect(()=>{if(!i)return;const g=f.current;f.current=i.current,g!==f.current&&a(f.current)});const h=s.placementState&&tO(s.placementState),d=h?.[0],p=h?.[1];return i?null:V.jsx(At.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...o,ref:u})},"PopperAnchor")),VQ="PopperContent",[gU,mU]=DQ(VQ),OU=C.forwardRef(zo(function(e,n){const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:s="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:d=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,O=NQ(VQ,r),[y,x]=C.useState(null),b=Bt(n,x),[S,v]=C.useState(null),w=LQ(S),k=w?.width??0,P=w?.height??0,T=i+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(u)?u:[u],$=I.length>0,D={padding:M,boundary:I.filter(BQ),altBoundary:$},{refs:Z,floatingStyles:G,placement:z,isPositioned:ee,middlewareData:oe}=YY({strategy:"fixed",placement:T,whileElementsMounted:zo((...ue)=>VY(...ue,{animationFrame:p==="always"}),"whileElementsMounted"),elements:{reference:O.anchor},middleware:[GY({mainAxis:o+P,alignmentAxis:l}),c&&KY({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?JY():void 0,...D}),c&&eU({...D}),tU({...D,apply:zo(({elements:ue,rects:Se,availableWidth:Ae,availableHeight:Ze})=>{const{width:Ue,height:Qt}=Se.reference,st=ue.floating.style;st.setProperty("--radix-popper-available-width",`${Ae}px`),st.setProperty("--radix-popper-available-height",`${Ze}px`),st.setProperty("--radix-popper-anchor-width",`${Ue}px`),st.setProperty("--radix-popper-anchor-height",`${Qt}px`)},"apply")}),S&&rU({element:S,padding:a}),vU({arrowWidth:k,arrowHeight:P}),d&&nU({strategy:"referenceHidden",...D,boundary:$?D.boundary:void 0})]}),Q=O.setPlacementState;In(()=>(Q(z),()=>{Q(void 0)}),[z,Q]);const[ve,_e]=tO(z),L=Di(g);In(()=>{ee&&L?.()},[ee,L]);const Ie=oe.arrow?.x,Be=oe.arrow?.y,pe=oe.arrow?.centerOffset!==0,[he,J]=C.useState();return In(()=>{y&&J(window.getComputedStyle(y).zIndex)},[y]),V.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:ee?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(" "),...oe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:V.jsx(gU,{scope:r,placedSide:ve,placedAlign:_e,onArrowChange:v,arrowX:Ie,arrowY:Be,shouldHideArrow:pe,children:V.jsx(At.div,{"data-side":ve,"data-align":_e,...m,ref:b,style:{...m.style,animation:ee?m.style?.animation:"none"}})})})},"PopperContent")),yU="PopperArrow",xU={top:"bottom",right:"left",bottom:"top",left:"right"},bU=C.forwardRef(zo(function(e,n){const{__scopePopper:r,...i}=e,o=mU(yU,r),s=xU[o.placedSide];return V.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:V.jsx(lU,{...i,ref:n,style:{...i.style,display:"block"}})})},"PopperArrow"));function BQ(t){return t!==null}zo(BQ,"isNotNull");var vU=zo(t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,s=i.arrow?.centerOffset!==0,l=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[c,u]=tO(n),f={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+l/2,d=(i.arrow?.y??0)+a/2;let p="",g="";return c==="bottom"?(p=s?f:`${h}px`,g=`${-a}px`):c==="top"?(p=s?f:`${h}px`,g=`${r.floating.height+a}px`):c==="right"?(p=`${-a}px`,g=s?f:`${d}px`):c==="left"&&(p=`${r.floating.width+a}px`,g=s?f:`${d}px`),{data:{x:p,y:g}}}}),"transformOrigin");function tO(t){const[e,n="center"]=t.split("-");return[e,n]}zo(tO,"getSideAndAlignFromPlacement");var jv=hU,nO=pU,Xv=OU,FQ=bU,SU=Object.defineProperty,wU=(t,e)=>SU(t,"name",{value:e,configurable:!0}),Wv=C.forwardRef(wU(function(e,n){const{container:r,...i}=e,[o,s]=C.useState(!1);In(()=>s(!0),[]);const l=r||o&&globalThis?.document?.body;return l?Ns.createPortal(V.jsx(At.div,{...i,ref:n}),l):null},"Portal")),kU=Object.defineProperty,rs=(t,e)=>kU(t,"name",{value:e,configurable:!0});function ZQ(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}rs(ZQ,"useStateMachine");var Mh=rs(t=>{const{present:e,children:n}=t,r=zQ(e),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=jQ(r.ref,XQ(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null},"Presence");function zQ(t){const[e,n]=C.useState(),r=C.useRef(null),i=C.useRef(t),o=C.useRef("none"),s=C.useRef(void 0),l=t?"mounted":"unmounted",[a,c]=ZQ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{a==="mounted"?(o.current=s.current??Ma(r.current),s.current=void 0):o.current="none"},[a]),In(()=>{const u=r.current,f=i.current;if(f!==t){const d=o.current,p=Ma(u);t?(s.current=p,c("MOUNT")):p==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&d!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),In(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,h=rs(p=>{const m=Ma(r.current).includes(CSS.escape(p.animationName));if(p.target===e&&m&&(c("ANIMATION_END"),!i.current)){const O=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=O)})}},"handleAnimationEnd"),d=rs(p=>{p.target===e&&(o.current=Ma(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{if(u){const f=getComputedStyle(u);r.current=f,s.current=Ma(f)}else r.current=null;n(u)},[])}}rs(zQ,"usePresence");function Hy(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}rs(Hy,"setRef");function jQ(...t){const e=C.useRef(t);return e.current=t,C.useCallback(n=>{const r=e.current;let i=!1;const o=r.map(s=>{const l=Hy(s,n);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let s=0;s<o.length;s++){const l=o[s];typeof l=="function"?l():Hy(r[s],null)}}},[])}rs(jQ,"useStableComposedRefs");function Ma(t){return t?.animationName||"none"}rs(Ma,"getAnimationName");function XQ(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}rs(XQ,"getElementRef");var CU=Object.defineProperty,_U=(t,e)=>CU(t,"name",{value:e,configurable:!0}),d2=Vc[" useEffectEvent ".trim().toString()],p2=Vc[" useInsertionEffect ".trim().toString()];function WQ(t){if(typeof d2=="function")return d2(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof p2=="function"?p2(()=>{e.current=t}):In(()=>{e.current=t}),C.useMemo(()=>((...n)=>e.current?.(...n)),[])}_U(WQ,"useEffectEvent");var TU=Object.defineProperty,Rh=(t,e)=>TU(t,"name",{value:e,configurable:!0}),PU=Vc[" useInsertionEffect ".trim().toString()]||In;function is({prop:t,defaultProp:e,onChange:n=Rh(()=>{},"onChange"),caller:r}){const[i,o,s]=HQ({defaultProp:e,onChange:n}),l=t!==void 0,a=l?t:i,c=C.useCallback(u=>{if(l){const f=qQ(u)?u(t):u;f!==t&&s.current?.(f)}else o(u)},[l,t,o,s]);return[a,c]}Rh(is,"useControllableState");function HQ({defaultProp:t,onChange:e}){const[n,r]=C.useState(t),i=C.useRef(n),o=C.useRef(e);return PU(()=>{o.current=e},[e]),C.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Rh(HQ,"useUncontrolledState");function qQ(t){return typeof t=="function"}Rh(qQ,"isFunction");var g2=Symbol("RADIX:SYNC_STATE");function EU(t,e,n,r){const{prop:i,defaultProp:o,onChange:s,caller:l}=e,a=i!==void 0,c=WQ(s),u=[{...n,state:o}];r&&u.push(r);const[f,h]=C.useReducer((m,O)=>{if(O.type===g2)return{...m,state:O.state};const y=t(m,O);return a&&!Object.is(y.state,m.state)&&c(y.state),y},...u),d=f.state,p=C.useRef(d);C.useEffect(()=>{p.current!==d&&(p.current=d,a||c(d))},[d,p,a]);const g=C.useMemo(()=>i!==void 0?{...f,state:i}:f,[f,i]);return C.useEffect(()=>{a&&!Object.is(i,f.state)&&h({type:g2,state:i})},[i,f.state,a]),[g,h]}Rh(EU,"useControllableStateReducer");var $U=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_a=new WeakMap,pd=new WeakMap,gd={},p1=0,YQ=function(t){return t&&(t.host||YQ(t.parentNode))},AU=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=YQ(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},QU=function(t,e,n,r){var i=AU(e,Array.isArray(t)?t:[t]);gd[n]||(gd[n]=new WeakMap);var o=gd[n],s=[],l=new Set,a=new Set(i),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))u(h);else try{var d=h.getAttribute(r),p=d!==null&&d!=="false",g=(_a.get(h)||0)+1,m=(o.get(h)||0)+1;_a.set(h,g),o.set(h,m),s.push(h),g===1&&p&&pd.set(h,!0),m===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(O){console.error("aria-hidden: cannot operate on ",h,O)}})};return u(e),l.clear(),p1++,function(){s.forEach(function(f){var h=_a.get(f)-1,d=o.get(f)-1;_a.set(f,h),o.set(f,d),h||(pd.has(f)||f.removeAttribute(r),pd.delete(f)),d||f.removeAttribute(n)}),p1--,p1||(_a=new WeakMap,_a=new WeakMap,pd=new WeakMap,gd={})}},UQ=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=$U(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),QU(r,i,n,"aria-hidden")):function(){return null}},Gr=function(){return Gr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Gr.apply(this,arguments)};function GQ(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function MU(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var kp="right-scroll-bar-position",Cp="width-before-scroll-bar",RU="with-scroll-bars-hidden",LU="--removed-body-scroll-bar-size";function g1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function IU(t,e){var n=C.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var DU=typeof window<"u"?C.useLayoutEffect:C.useEffect,m2=new WeakMap;function NU(t,e){var n=IU(null,function(r){return t.forEach(function(i){return g1(i,r)})});return DU(function(){var r=m2.get(n);if(r){var i=new Set(r),o=new Set(t),s=n.current;i.forEach(function(l){o.has(l)||g1(l,null)}),o.forEach(function(l){i.has(l)||g1(l,s)})}m2.set(n,t)},[t]),n}function VU(t){return t}function BU(t,e){e===void 0&&(e=VU);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var s=e(o,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(o),s=n}var a=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function FU(t){t===void 0&&(t={});var e=BU(null);return e.options=Gr({async:!0,ssr:!1},t),e}var KQ=function(t){var e=t.sideCar,n=GQ(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,Gr({},n))};KQ.isSideCarExport=!0;function ZU(t,e){return t.useMedium(e),KQ}var JQ=FU(),m1=function(){},rO=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:m1,onWheelCapture:m1,onTouchMoveCapture:m1}),i=r[0],o=r[1],s=t.forwardProps,l=t.children,a=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,d=t.noRelative,p=t.noIsolation,g=t.inert,m=t.allowPinchZoom,O=t.as,y=O===void 0?"div":O,x=t.gapMode,b=GQ(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,v=NU([n,e]),w=Gr(Gr({},b),i);return C.createElement(C.Fragment,null,u&&C.createElement(S,{sideCar:JQ,removeScrollBar:c,shards:f,noRelative:d,noIsolation:p,inert:g,setCallbacks:o,allowPinchZoom:!!m,lockRef:n,gapMode:x}),s?C.cloneElement(C.Children.only(l),Gr(Gr({},w),{ref:v})):C.createElement(y,Gr({},w,{className:a,ref:v}),l))});rO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rO.classNames={fullWidth:Cp,zeroRight:kp};var zU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jU(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=zU();return e&&t.setAttribute("nonce",e),t}function XU(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function WU(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var HU=function(){var t=0,e=null;return{add:function(n){t==0&&(e=jU())&&(XU(e,n),WU(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},qU=function(){var t=HU();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},eM=function(){var t=qU(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},YU={left:0,top:0,right:0,gap:0},O1=function(t){return parseInt(t||"",10)||0},UU=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[O1(n),O1(r),O1(i)]},GU=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return YU;var e=UU(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},KU=eM(),ic="data-scroll-locked",JU=function(t,e,n,r){var i=t.left,o=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
64
|
-
.`.concat(RU,` {
|
|
65
|
-
overflow: hidden `).concat(r,`;
|
|
66
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
67
|
-
}
|
|
68
|
-
body[`).concat(ic,`] {
|
|
69
|
-
overflow: hidden `).concat(r,`;
|
|
70
|
-
overscroll-behavior: contain;
|
|
71
|
-
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
72
|
-
padding-left: `.concat(i,`px;
|
|
73
|
-
padding-top: `).concat(o,`px;
|
|
74
|
-
padding-right: `).concat(s,`px;
|
|
75
|
-
margin-left:0;
|
|
76
|
-
margin-top:0;
|
|
77
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
78
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.`).concat(kp,` {
|
|
82
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.`).concat(Cp,` {
|
|
86
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.`).concat(kp," .").concat(kp,` {
|
|
90
|
-
right: 0 `).concat(r,`;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.`).concat(Cp," .").concat(Cp,` {
|
|
94
|
-
margin-right: 0 `).concat(r,`;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
body[`).concat(ic,`] {
|
|
98
|
-
`).concat(LU,": ").concat(l,`px;
|
|
99
|
-
}
|
|
100
|
-
`)},O2=function(){var t=parseInt(document.body.getAttribute(ic)||"0",10);return isFinite(t)?t:0},eG=function(){C.useEffect(function(){return document.body.setAttribute(ic,(O2()+1).toString()),function(){var t=O2()-1;t<=0?document.body.removeAttribute(ic):document.body.setAttribute(ic,t.toString())}},[])},tG=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;eG();var o=C.useMemo(function(){return GU(i)},[i]);return C.createElement(KU,{styles:JU(o,!e,i,n?"":"!important")})},qy=!1;if(typeof window<"u")try{var md=Object.defineProperty({},"passive",{get:function(){return qy=!0,!0}});window.addEventListener("test",md,md),window.removeEventListener("test",md,md)}catch{qy=!1}var Ta=qy?{passive:!1}:!1,nG=function(t){return t.tagName==="TEXTAREA"},tM=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!nG(t)&&n[e]==="visible")},rG=function(t){return tM(t,"overflowY")},iG=function(t){return tM(t,"overflowX")},y2=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=nM(t,r);if(i){var o=rM(t,r),s=o[1],l=o[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oG=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},sG=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},nM=function(t,e){return t==="v"?rG(e):iG(e)},rM=function(t,e){return t==="v"?oG(e):sG(e)},lG=function(t,e){return t==="h"&&e==="rtl"?-1:1},aG=function(t,e,n,r,i){var o=lG(t,window.getComputedStyle(e).direction),s=o*r,l=n.target,a=e.contains(l),c=!1,u=s>0,f=0,h=0;do{if(!l)break;var d=rM(t,l),p=d[0],g=d[1],m=d[2],O=g-m-o*p;(p||O)&&nM(t,l)&&(f+=O,h+=p);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!a&&l!==document.body||a&&(e.contains(l)||e===l));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Od=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},x2=function(t){return[t.deltaX,t.deltaY]},b2=function(t){return t&&"current"in t?t.current:t},cG=function(t,e){return t[0]===e[0]&&t[1]===e[1]},uG=function(t){return`
|
|
101
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
102
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
103
|
-
`)},fG=0,Pa=[];function hG(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(fG++)[0],o=C.useState(eM)[0],s=C.useRef(t);C.useEffect(function(){s.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var g=MU([t.lockRef.current],(t.shards||[]).map(b2),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=C.useCallback(function(g,m){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var O=Od(g),y=n.current,x="deltaX"in g?g.deltaX:y[0]-O[0],b="deltaY"in g?g.deltaY:y[1]-O[1],S,v=g.target,w=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in g&&w==="h"&&v.type==="range")return!1;var k=window.getSelection(),P=k&&k.anchorNode,T=P?P===v||P.contains(v):!1;if(T)return!1;var M=y2(w,v);if(!M)return!0;if(M?S=w:(S=w==="v"?"h":"v",M=y2(w,v)),!M)return!1;if(!r.current&&"changedTouches"in g&&(x||b)&&(r.current=S),!S)return!0;var I=r.current||S;return aG(I,m,g,I==="h"?x:b)},[]),a=C.useCallback(function(g){var m=g;if(!(!Pa.length||Pa[Pa.length-1]!==o)){var O="deltaY"in m?x2(m):Od(m),y=e.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&cG(S.delta,O)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(b2).filter(Boolean).filter(function(S){return S.contains(m.target)}),b=x.length>0?l(m,x[0]):!s.current.noIsolation;b&&m.cancelable&&m.preventDefault()}}},[]),c=C.useCallback(function(g,m,O,y){var x={name:g,delta:m,target:O,should:y,shadowParent:dG(O)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(b){return b!==x})},1)},[]),u=C.useCallback(function(g){n.current=Od(g),r.current=void 0},[]),f=C.useCallback(function(g){c(g.type,x2(g),g.target,l(g,t.lockRef.current))},[]),h=C.useCallback(function(g){c(g.type,Od(g),g.target,l(g,t.lockRef.current))},[]);C.useEffect(function(){return Pa.push(o),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",a,Ta),document.addEventListener("touchmove",a,Ta),document.addEventListener("touchstart",u,Ta),function(){Pa=Pa.filter(function(g){return g!==o}),document.removeEventListener("wheel",a,Ta),document.removeEventListener("touchmove",a,Ta),document.removeEventListener("touchstart",u,Ta)}},[]);var d=t.removeScrollBar,p=t.inert;return C.createElement(C.Fragment,null,p?C.createElement(o,{styles:uG(i)}):null,d?C.createElement(tG,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function dG(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const pG=ZU(JQ,hG);var Hv=C.forwardRef(function(t,e){return C.createElement(rO,Gr({},t,{ref:e,sideCar:pG}))});Hv.classNames=rO.classNames;var gG=Object.defineProperty,Oo=(t,e)=>gG(t,"name",{value:e,configurable:!0}),qv="Popover",[iM,ope]=mo(qv,[tu]),Lh=tu(),[mG,Oa]=iM(qv),OG=Oo(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=t,l=Lh(e),a=C.useRef(null),[c,u]=C.useState(!1),[f,h]=is({prop:r,defaultProp:i??!1,onChange:o,caller:qv});return V.jsx(jv,{...l,children:V.jsx(mG,{scope:e,contentId:Kc(),triggerRef:a,open:f,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(d=>!d),[h]),hasCustomAnchor:c,onCustomAnchorAdd:C.useCallback(()=>u(!0),[]),onCustomAnchorRemove:C.useCallback(()=>u(!1),[]),modal:s,children:n})})},"Popover"),yG="PopoverAnchor",xG=C.forwardRef(Oo(function(e,n){const{__scopePopover:r,...i}=e,o=Oa(yG,r),s=Lh(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=o;return C.useEffect(()=>(l(),()=>a()),[l,a]),V.jsx(nO,{...s,...i,ref:n})},"PopoverAnchor")),bG="PopoverTrigger",oM=C.forwardRef(Oo(function(e,n){const{__scopePopover:r,...i}=e,o=Oa(bG,r),s=Lh(r),l=Bt(n,o.triggerRef),a=V.jsx(At.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Uv(o.open),...i,ref:l,onClick:Je(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:V.jsx(nO,{asChild:!0,...s,children:a})},"PopoverTrigger")),sM="PopoverPortal",[vG,SG]=iM(sM,{forceMount:void 0}),wG=Oo(t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=Oa(sM,e);return V.jsx(vG,{scope:e,forceMount:n,children:V.jsx(Mh,{present:n||o.open,children:V.jsx(Wv,{asChild:!0,container:i,children:r})})})},"PopoverPortal"),jf="PopoverContent",Yv=C.forwardRef(Oo(function(e,n){const r=SG(jf,e.__scopePopover),{forceMount:i=r.forceMount,...o}=e,s=Oa(jf,e.__scopePopover);return V.jsx(Mh,{present:i||s.open,children:s.modal?V.jsx(CG,{...o,ref:n}):V.jsx(_G,{...o,ref:n})})},"PopoverContent")),kG=Vs("PopoverContent.RemoveScroll"),CG=C.forwardRef(Oo(function(e,n){const r=Oa(jf,e.__scopePopover),i=C.useRef(null),o=Bt(n,i),s=C.useRef(!1);return C.useEffect(()=>{const l=i.current;if(l)return UQ(l)},[]),V.jsx(Hv,{as:kG,allowPinchZoom:!0,children:V.jsx(lM,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Je(e.onCloseAutoFocus,l=>{l.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Je(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),_G=C.forwardRef(Oo(function(e,n){const r=Oa(jf,e.__scopePopover),i=C.useRef(!1),o=C.useRef(!1);return V.jsx(lM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||r.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=s.target;r.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})},"PopoverContentNonModal")),lM=C.forwardRef(Oo(function(e,n){const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...h}=e,d=Oa(jf,r),p=Lh(r);return Ym(),V.jsx(OQ,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:s,children:V.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),deferPointerDownOutside:!0,children:V.jsx(Xv,{"data-state":Uv(d.open),role:"dialog",id:d.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),TG=C.forwardRef(Oo(function(e,n){const{__scopePopover:r,...i}=e,o=Lh(r);return V.jsx(FQ,{...o,...i,ref:n})},"PopoverArrow"));function Uv(t){return t?"open":"closed"}Oo(Uv,"getState");var Gv=OG,PG=xG,Kv=wG,EG=Yv,Jv=TG,$G=Object.defineProperty,xn=(t,e)=>$G(t,"name",{value:e,configurable:!0});function eS(t){const e=t+"CollectionProvider",[n,r]=mo(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=xn(g=>{const{scope:m,children:O}=g,y=C.useRef(null),x=C.useRef(new Map).current;return V.jsx(i,{scope:m,itemMap:x,collectionRef:y,children:O})},"CollectionProvider");s.displayName=e;const l=t+"CollectionSlot",a=Vs(l),c=C.forwardRef((g,m)=>{const{scope:O,children:y}=g,x=o(l,O),b=Bt(m,x.collectionRef);return V.jsx(a,{ref:b,children:y})});c.displayName=l;const u=t+"CollectionItemSlot",f="data-radix-collection-item",h=Vs(u),d=C.forwardRef((g,m)=>{const{scope:O,children:y,...x}=g,b=C.useRef(null),S=Bt(m,b),v=o(u,O);return C.useEffect(()=>(v.itemMap.set(b,{ref:b,...x}),()=>{v.itemMap.delete(b)})),V.jsx(h,{[f]:"",ref:S,children:y})});d.displayName=u;function p(g){const m=o(t+"CollectionConsumer",g);return C.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(m.itemMap.values()).sort((v,w)=>x.indexOf(v.ref.current)-x.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return xn(p,"useCollection"),[{Provider:s,Slot:c,ItemSlot:d},p,r]}xn(eS,"createCollection");var v2=new WeakMap,Jt,Mr,y1=(Mr=class extends Map{constructor(n){super(n);Jw(this,Jt);MO(this,Jt,[...super.keys()]),v2.set(this,!0)}set(n,r){return v2.get(this)&&(this.has(n)?Fn(this,Jt)[Fn(this,Jt).indexOf(n)]=n:Fn(this,Jt).push(n)),super.set(n,r),this}insert(n,r,i){const o=this.has(r),s=Fn(this,Jt).length,l=tS(n);let a=l>=0?l:s+l;const c=a<0||a>=s?-1:a;if(c===this.size||o&&c===this.size-1||c===-1)return this.set(r,i),this;const u=this.size+(o?0:1);l<0&&a++;const f=[...Fn(this,Jt)];let h,d=!1;for(let p=a;p<u;p++)if(a===p){let g=f[p];f[p]===r&&(g=f[p+1]),o&&this.delete(r),h=this.get(g),this.set(r,i)}else{!d&&f[p-1]===r&&(d=!0);const g=f[d?p:p-1],m=h;h=this.get(g),this.delete(g),this.set(g,m)}return this}with(n,r,i){const o=new Mr(this);return o.insert(n,r,i),o}before(n){const r=Fn(this,Jt).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,i){const o=Fn(this,Jt).indexOf(n);return o===-1?this:this.insert(o,r,i)}after(n){let r=Fn(this,Jt).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,i){const o=Fn(this,Jt).indexOf(n);return o===-1?this:this.insert(o+1,r,i)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return MO(this,Jt,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Fn(this,Jt).splice(Fn(this,Jt).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=_p(Fn(this,Jt),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=_p(Fn(this,Jt),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Fn(this,Jt).indexOf(n)}keyAt(n){return _p(Fn(this,Jt),n)}from(n,r){const i=this.indexOf(n);if(i===-1)return;let o=i+r;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(n,r){const i=this.indexOf(n);if(i===-1)return;let o=i+r;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return o;i++}}findIndex(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return i;i++}return-1}filter(n,r){const i=[];let o=0;for(const s of this)Reflect.apply(n,r,[s,o,this])&&i.push(s),o++;return new Mr(i)}map(n,r){const i=[];let o=0;for(const s of this)i.push([s[0],Reflect.apply(n,r,[s,o,this])]),o++;return new Mr(i)}reduce(...n){const[r,i]=n;let o=0,s=i??this.at(0);for(const l of this)o===0&&n.length===1?s=l:s=Reflect.apply(r,this,[s,l,o,this]),o++;return s}reduceRight(...n){const[r,i]=n;let o=i??this.at(-1);for(let s=this.size-1;s>=0;s--){const l=this.at(s);s===this.size-1&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,s,this])}return o}toSorted(n){const r=[...this.entries()].sort(n);return new Mr(r)}toReversed(){const n=new Mr;for(let r=this.size-1;r>=0;r--){const i=this.keyAt(r),o=this.get(i);n.set(i,o)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Mr(r)}slice(n,r){const i=new Mr;let o=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),r!==void 0&&r>0&&(o=r-1);for(let s=n;s<=o;s++){const l=this.keyAt(s),a=this.get(l);i.set(l,a)}return i}every(n,r){let i=0;for(const o of this){if(!Reflect.apply(n,r,[o,i,this]))return!1;i++}return!0}some(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return!0;i++}return!1}},Jt=new WeakMap,xn(Mr,"OrderedDict"),Mr);function _p(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=aM(t,e);return n===-1?void 0:t[n]}xn(_p,"at");function aM(t,e){const n=t.length,r=tS(e),i=r>=0?r:n+r;return i<0||i>=n?-1:i}xn(aM,"toSafeIndex");function tS(t){return t!==t||t===0?0:Math.trunc(t)}xn(tS,"toSafeInteger");function AG(t){const e=t+"CollectionProvider",[n,r]=mo(e),[i,o]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new y1,setItemMap:xn(()=>{},"setItemMap")}),s=xn(({state:x,...b})=>x?V.jsx(a,{...b,state:x}):V.jsx(l,{...b}),"CollectionProvider");s.displayName=e;const l=xn(x=>{const b=m();return V.jsx(a,{...x,state:b})},"CollectionInit");l.displayName=e+"Init";const a=xn(x=>{const{scope:b,children:S,state:v}=x,w=C.useRef(null),[k,P]=C.useState(null),T=Bt(w,P),[M,I]=v;return C.useEffect(()=>{if(!k)return;const $=fM(()=>{});return $.observe(k,{childList:!0,subtree:!0}),()=>{$.disconnect()}},[k]),V.jsx(i,{scope:b,itemMap:M,setItemMap:I,collectionRef:T,collectionRefObject:w,collectionElement:k,children:S})},"CollectionProviderImpl");a.displayName=e+"Impl";const c=t+"CollectionSlot",u=Vs(c),f=C.forwardRef((x,b)=>{const{scope:S,children:v}=x,w=o(c,S),k=Bt(b,w.collectionRef);return V.jsx(u,{ref:k,children:v})});f.displayName=c;const h=t+"CollectionItemSlot",d="data-radix-collection-item",p=Vs(h),g=C.forwardRef((x,b)=>{const{scope:S,children:v,...w}=x,k=C.useRef(null),[P,T]=C.useState(null),M=Bt(b,k,T),I=o(h,S),{setItemMap:$}=I,D=C.useRef(w);cM(D.current,w)||(D.current=w);const Z=D.current;return C.useEffect(()=>{const G=Z;return $(z=>P?z.has(P)?z.set(P,{...G,element:P}).toSorted(Yy):(z.set(P,{...G,element:P}),z.toSorted(Yy)):z),()=>{$(z=>!P||!z.has(P)?z:(z.delete(P),new y1(z)))}},[P,Z,$]),V.jsx(p,{[d]:"",ref:M,children:v})});g.displayName=h;function m(){return C.useState(new y1)}xn(m,"useInitCollection");function O(x){const{itemMap:b}=o(t+"CollectionConsumer",x);return b}return xn(O,"useCollection"),[{Provider:s,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:O,useInitCollection:m}]}xn(AG,"createCollection");function cM(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||t[i]!==e[i])return!1;return!0}xn(cM,"shallowEqual");function uM(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}xn(uM,"isElementPreceding");function Yy(t,e){return!t[1].element||!e[1].element?0:uM(t[1].element,e[1].element)?-1:1}xn(Yy,"sortByDocumentPosition");function fM(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}xn(fM,"getChildListObserver");var QG=Object.defineProperty,MG=(t,e)=>QG(t,"name",{value:e,configurable:!0}),RG=C.createContext(void 0);function Ih(t){const e=C.useContext(RG);return t||e||"ltr"}MG(Ih,"useDirection");var LG=Object.defineProperty,nS=(t,e)=>LG(t,"name",{value:e,configurable:!0}),x1=!1;function hM(){const[t,e]=C.useState(x1);return C.useEffect(()=>{x1||(x1=!0,e(!0))},[]),t}nS(hM,"useIsHydrated");var dM=Vc[" useSyncExternalStore ".trim().toString()];function pM(){return()=>{}}nS(pM,"subscribe");function gM(){return dM(pM,()=>!0,()=>!1)}nS(gM,"useIsHydratedModern");var IG=typeof dM=="function"?gM:hM,DG=Object.defineProperty,ya=(t,e)=>DG(t,"name",{value:e,configurable:!0}),b1="rovingFocusGroup.onEntryFocus",NG={bubbles:!1,cancelable:!0},iO="RovingFocusGroup",[Uy,mM,VG]=eS(iO),[BG,oO]=mo(iO,[VG]),[FG,ZG]=BG(iO),zG=C.forwardRef(ya(function(e,n){return V.jsx(Uy.Provider,{scope:e.__scopeRovingFocusGroup,children:V.jsx(Uy.Slot,{scope:e.__scopeRovingFocusGroup,children:V.jsx(jG,{...e,ref:n})})})},"RovingFocusGroup")),jG=C.forwardRef(ya(function(e,n){const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...h}=e,d=C.useRef(null),p=Bt(n,d),g=Ih(s),[m,O]=is({prop:l,defaultProp:a??null,onChange:c,caller:iO}),[y,x]=C.useState(!1),b=Di(u),S=mM(r),v=C.useRef(!1),[w,k]=C.useState(0);return C.useEffect(()=>{const P=d.current;if(P)return P.addEventListener(b1,b),()=>P.removeEventListener(b1,b)},[b]),V.jsx(FG,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:m,onItemFocus:C.useCallback(P=>O(P),[O]),onItemShiftTab:C.useCallback(()=>x(!0),[]),onFocusableItemAdd:C.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:C.useCallback(()=>k(P=>P-1),[]),children:V.jsx(At.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:Je(e.onMouseDown,()=>{v.current=!0}),onFocus:Je(e.onFocus,P=>{const T=!v.current;if(P.target===P.currentTarget&&T&&!y){const M=new CustomEvent(b1,NG);if(P.currentTarget.dispatchEvent(M),!M.defaultPrevented){const I=S().filter(z=>z.focusable),$=I.find(z=>z.active),D=I.find(z=>z.id===m),G=[$,D,...I].filter(Boolean).map(z=>z.ref.current);rS(G,f)}}v.current=!1}),onBlur:Je(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),XG="RovingFocusGroupItem",WG=C.forwardRef(ya(function(e,n){const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:l,...a}=e,c=Kc(),u=s||c,f=ZG(XG,r),h=f.currentTabStopId===u,d=mM(r),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:m}=f,O=IG();return In(()=>{if(!(!O||!i))return p(),()=>g()},[O,i,p,g]),C.useEffect(()=>{if(!(O||!i))return p(),()=>g()},[O,i,p,g]),V.jsx(Uy.ItemSlot,{scope:r,id:u,focusable:i,active:o,children:V.jsx(At.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...a,ref:n,onMouseDown:Je(e.onMouseDown,y=>{i?f.onItemFocus(u):y.preventDefault()}),onFocus:Je(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Je(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=yM(y,f.orientation,f.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=d().filter(v=>v.focusable).map(v=>v.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const v=S.indexOf(y.currentTarget);S=f.loop?xM(S,v+1):S.slice(v+1)}setTimeout(()=>rS(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:m!=null}):l})})},"RovingFocusGroupItem")),HG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function OM(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}ya(OM,"getDirectionAwareKey");function yM(t,e,n){const r=OM(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HG[r]}ya(yM,"getFocusIntent");function rS(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}ya(rS,"focusFirst");function xM(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ya(xM,"wrapArray");var bM=zG,vM=WG,qG=Object.defineProperty,SM=(t,e)=>qG(t,"name",{value:e,configurable:!0}),S2="horizontal",YG=["horizontal","vertical"],UG=C.forwardRef(SM(function(e,n){const{decorative:r,orientation:i=S2,...o}=e,s=wM(i)?i:S2,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return V.jsx(At.div,{"data-orientation":s,...a,...o,ref:n})},"Separator"));function wM(t){return YG.includes(t)}SM(wM,"isValidOrientation");var GG=UG,KG=Object.defineProperty,JG=(t,e)=>KG(t,"name",{value:e,configurable:!0}),eK="Toggle",tK=C.forwardRef(JG(function(e,n){const{pressed:r,defaultPressed:i,onPressedChange:o,...s}=e,[l,a]=is({prop:r,onChange:o,defaultProp:i??!1,caller:eK});return V.jsx(At.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:n,onClick:Je(e.onClick,()=>{e.disabled||a(!l)})})},"Toggle")),nK=Object.defineProperty,Zs=(t,e)=>nK(t,"name",{value:e,configurable:!0}),nu="ToggleGroup",[kM,CM]=mo(nu,[oO]),_M=oO(),rK=C.forwardRef(Zs(function(e,n){const{type:r,...i}=e;if(r==="single"){const o=i;return V.jsx(iK,{role:"radiogroup",...o,ref:n})}if(r==="multiple"){const o=i;return V.jsx(oK,{role:"toolbar",...o,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${nu}\``)},"ToggleGroup")),[TM,PM]=kM(nu),iK=C.forwardRef(Zs(function(e,n){const{value:r,defaultValue:i,onValueChange:o=Zs(()=>{},"onValueChange"),...s}=e,[l,a]=is({prop:r,defaultProp:i??"",onChange:o,caller:nu});return V.jsx(TM,{scope:e.__scopeToggleGroup,type:"single",value:C.useMemo(()=>l?[l]:[],[l]),onItemActivate:a,onItemDeactivate:C.useCallback(()=>a(""),[a]),children:V.jsx(EM,{...s,ref:n})})},"ToggleGroupImplSingle")),oK=C.forwardRef(Zs(function(e,n){const{value:r,defaultValue:i,onValueChange:o=Zs(()=>{},"onValueChange"),...s}=e,[l,a]=is({prop:r,defaultProp:i??[],onChange:o,caller:nu}),c=C.useCallback(f=>a((h=[])=>[...h,f]),[a]),u=C.useCallback(f=>a((h=[])=>h.filter(d=>d!==f)),[a]);return V.jsx(TM,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:c,onItemDeactivate:u,children:V.jsx(EM,{...s,ref:n})})},"ToggleGroupImplMultiple")),[sK,lK]=kM(nu),EM=C.forwardRef(Zs(function(e,n){const{__scopeToggleGroup:r,disabled:i=!1,rovingFocus:o=!0,orientation:s,dir:l,loop:a=!0,...c}=e,u=_M(r),f=Ih(l),h={dir:f,...c};return V.jsx(sK,{scope:r,rovingFocus:o,disabled:i,children:o?V.jsx(bM,{asChild:!0,...u,orientation:s,dir:f,loop:a,children:V.jsx(At.div,{...h,ref:n})}):V.jsx(At.div,{...h,ref:n})})},"ToggleGroupImpl")),Gy="ToggleGroupItem",aK=C.forwardRef(Zs(function(e,n){const r=PM(Gy,e.__scopeToggleGroup),i=lK(Gy,e.__scopeToggleGroup),o=_M(e.__scopeToggleGroup),s=r.value.includes(e.value),l=i.disabled||e.disabled,a={...e,pressed:s,disabled:l},c=C.useRef(null);return i.rovingFocus?V.jsx(vM,{asChild:!0,...o,focusable:!l,active:s,ref:c,children:V.jsx(w2,{...a,ref:n})}):V.jsx(w2,{...a,ref:n})},"ToggleGroupItem")),w2=C.forwardRef(Zs(function(e,n){const{__scopeToggleGroup:r,value:i,...o}=e,s=PM(Gy,r),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?l:void 0;return V.jsx(tK,{...a,...o,ref:n,onPressedChange:c=>{c?s.onItemActivate(i):s.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),cK=Object.defineProperty,Dh=(t,e)=>cK(t,"name",{value:e,configurable:!0}),$M="Toolbar",[uK,spe]=mo($M,[oO,CM]),AM=oO(),QM=CM(),[fK,MM]=uK($M),hK=C.forwardRef(Dh(function(e,n){const{__scopeToolbar:r,orientation:i="horizontal",dir:o,loop:s=!0,...l}=e,a=AM(r),c=Ih(o);return V.jsx(fK,{scope:r,orientation:i,dir:c,children:V.jsx(bM,{asChild:!0,...a,orientation:i,dir:c,loop:s,children:V.jsx(At.div,{role:"toolbar","aria-orientation":i,dir:c,...l,ref:n})})})},"Toolbar")),dK="ToolbarSeparator",pK=C.forwardRef(Dh(function(e,n){const{__scopeToolbar:r,...i}=e,o=MM(dK,r);return V.jsx(GG,{orientation:o.orientation==="horizontal"?"vertical":"horizontal",...i,ref:n})},"ToolbarSeparator")),RM=C.forwardRef(Dh(function(e,n){const{__scopeToolbar:r,...i}=e,o=AM(r);return V.jsx(vM,{asChild:!0,...o,focusable:!e.disabled,children:V.jsx(At.button,{type:"button",...i,ref:n})})},"ToolbarButton")),gK="ToolbarToggleGroup",mK=C.forwardRef(Dh(function(e,n){const{__scopeToolbar:r,...i}=e,o=MM(gK,r),s=QM(r);return V.jsx(rK,{"data-orientation":o.orientation,dir:o.dir,...s,...i,ref:n,rovingFocus:!1})},"ToolbarToggleGroup")),OK=C.forwardRef(Dh(function(e,n){const{__scopeToolbar:r,...i}=e,o=QM(r),s={__scopeToolbar:e.__scopeToolbar};return V.jsx(RM,{asChild:!0,...s,children:V.jsx(aK,{...o,...i,ref:n})})},"ToolbarToggleItem")),iS=hK,yK=pK,$l=RM,sO=mK,Tp=OK;function LM(t,e){return t===null||t===e?!1:t.dataset.editorDialog!==void 0||t.dataset.toolbarItem!==void 0||t.dataset.editorDropdown?!0:LM(t.parentElement,e)}function xK(){const t=[...Array(256).keys()].map(n=>n.toString(16).padStart(2,"0")),e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,[...e.entries()].map(([n,r])=>[4,6,8,10].includes(n)?`-${t[r]}`:t[r]).join("")}const IM=t=>t===0?"th":"td",DM={center:xe.centeredCell,left:xe.leftAlignedCell,right:xe.rightAlignedCell};function Ci(t){const e=Ge(t);return NM(e)?e:null}const bK=({mdastNode:t,parentEditor:e,lexicalTable:n})=>{const r=n.getKey(),[i,o]=_.useState(null),[s,l]=Vn(Bn,ui),a=_.useMemo(()=>m=>(m.__cacheKey??(m.__cacheKey=xK()),m.__cacheKey),[]),c=_.useCallback(m=>{const O=n.getColCount();if(m===null){o(null);return}let[y,x]=m;if(y>O-1&&(y=0,x++),y<0&&(y=O-1,x-=1),x>n.getRowCount()-1){o(null),e.update(()=>{const b=Ci(r);if(!b)return;if(b.getNextSibling())b.selectNext();else{const v=He();b.insertAfter(v),v.select()}});return}if(x<0){o(null),e.update(()=>{var b;(b=Ci(r))==null||b.selectPrevious()});return}o([y,x])},[n,e,r]);_.useEffect(()=>{n.focusEmitter.subscribe(c)},[n,c]);const u=_.useCallback(m=>{m.preventDefault(),e.update(()=>{const O=Ci(r);O&&(O.addRowToBottom(),o([0,O.getRowCount()]))})},[e,r]),f=_.useCallback(m=>{m.preventDefault(),e.update(()=>{const O=Ci(r);O&&(O.addColumnToRight(),o([O.getColCount(),0]))})},[e,r]),[h,d]=_.useState([-1,-1]),p=_.useCallback(m=>{let O=m.target;for(;O&&!["TH","TD"].includes(O.tagName);){if(O===m.currentTarget)return;O=O.parentElement}if(O===null)return;const y=O.parentElement,b=y.parentElement.tagName==="TFOOT"?-1:Array.from(y.children).indexOf(O),S=O.tagName==="TH"?-1:Array.from(y.parentElement.children).indexOf(y);d([b,S])},[]),g=_n();return _.createElement("table",{className:xe.tableEditor,onMouseOver:p,onMouseLeave:()=>{d([-1,-1])}},_.createElement("colgroup",null,l?null:_.createElement("col",null),Array.from({length:t.children[0].children.length},(m,O)=>{const x=(t.align??[])[O]??"left",b=DM[x];return _.createElement("col",{key:O,className:b})}),l?null:_.createElement("col",null)),l||_.createElement("thead",null,_.createElement("tr",null,_.createElement("th",{className:xe.tableToolsColumn}),Array.from({length:t.children[0].children.length},(m,O)=>_.createElement("th",{key:O,"data-tool-cell":!0},_.createElement(wK,{setActiveCellWithBoundaries:c,parentEditor:e,colIndex:O,highlightedCoordinates:h,lexicalTable:n,align:(t.align??[])[O]}))),_.createElement("th",{className:xe.tableToolsColumn,"data-tool-cell":!0},_.createElement("button",{className:xe.iconButton,type:"button",title:g("table.deleteTable","Delete table"),onClick:m=>{m.preventDefault(),e.update(()=>{const O=Ci(r);O&&(O.selectNext(),O.remove())})}},s("delete_small"))))),_.createElement("tbody",null,t.children.map((m,O)=>{const y=IM(O);return _.createElement("tr",{key:O},l||_.createElement(y,{className:xe.toolCell,"data-tool-cell":!0},_.createElement(kK,{setActiveCellWithBoundaries:c,parentEditor:e,rowIndex:O,highlightedCoordinates:h,lexicalTable:n})),m.children.map((x,b)=>{var S;return _.createElement(vK,{align:(S=t.align)==null?void 0:S[b],key:a(x),contents:x.children,setActiveCell:c,rowIndex:O,colIndex:b,lexicalTable:n,parentEditor:e,activeCell:l?[-1,-1]:i})}),l||O===0&&_.createElement("th",{rowSpan:n.getRowCount(),"data-tool-cell":!0},_.createElement("button",{type:"button",className:xe.addColumnButton,onClick:f},s("add_column"))))})),l||_.createElement("tfoot",null,_.createElement("tr",null,_.createElement("th",null),_.createElement("th",{colSpan:n.getColCount(),"data-tool-cell":!0},_.createElement("button",{type:"button",className:xe.addRowButton,onClick:u},s("add_row"))),_.createElement("th",null))))},vK=({align:t,...e})=>{const{activeCell:n,setActiveCell:r}=e,i=n?.[0]===e.colIndex&&n[1]===e.rowIndex,o=DM[t??"left"],s=IM(e.rowIndex);return _.createElement(s,{className:o,"data-active":i,onClick:()=>{r([e.colIndex,e.rowIndex])}},_.createElement(SK,{...e,focus:i}))},SK=({focus:t,setActiveCell:e,parentEditor:n,lexicalTable:r,contents:i,colIndex:o,rowIndex:s})=>{const l=r.getKey(),[a,c,u,f,h,d,p,g,m,O]=Vn(bv,Hm,vv,qm,x9,$h,kc,wv,cs,M9),[y,x]=_.useState(null);_.useEffect(()=>{const S=g9({name:"@mdxeditor/table-cell",nodes:u,namespace:"TableCellEditor",parentEditor:n,historyMode:"table-local",initialEditorState:()=>{a9({root:ut(),mdastRoot:{type:"root",children:[{type:"paragraph",children:i}]},visitors:a,jsxComponentDescriptors:f,directiveDescriptors:h,codeBlockEditorDescriptors:d,defaultCodeBlockLanguage:p})}});return x(S),()=>{S.dispose()}},[]);const b=_.useCallback(S=>{y&&(y.getEditorState().read(()=>{const v=X3({root:ut(),jsxComponentDescriptors:f,visitors:c,jsxIsAvailable:g});n.update(()=>{const w=Ci(l);w&&w.updateCellContents(o,s,v.children[0].children)},{discrete:!0}),n.dispatchCommand(If,void 0)}),e(S))},[o,y,c,f,g,n,s,e,l]);return _.useEffect(()=>{if(y)return ln(y.registerCommand(vm,S=>{S.preventDefault();const v=S.shiftKey?[o-1,s]:[o+1,s];return b(v),!0},co),y.registerCommand(wm,()=>(e([o,s]),!1),fn),y.registerCommand(gc,S=>{S?.preventDefault();const v=S?.shiftKey?[o,s-1]:[o,s+1];return b(v),!0},co),y.registerCommand(Lb,S=>{const v=S.relatedTarget;return LM(v,m.getRootElement())?!1:(b(null),!0)},Ne),y.registerCommand(If,()=>(b(null),!0),Ne))},[o,y,m,s,b,e]),_.useEffect(()=>{t&&y&&y.focus()},[t,y]),y?_.createElement(D9,{initialEditor:y},_.createElement(N9,{contentEditable:_.createElement(mv,null),placeholder:_.createElement("div",null),ErrorBoundary:Ov}),O.map((S,v)=>_.createElement(S,{key:v}))):null},wK=({parentEditor:t,highlightedCoordinates:e,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:o})=>{const s=r.getKey(),[l,a]=Vn(qc,Bn),c=_.useCallback(d=>{t.update(()=>{const p=Ci(s);p&&(p.insertColumnAt(d),o([d,0]))})},[t,o,s]),u=_.useCallback(d=>{t.update(()=>{var p;(p=Ci(s))==null||p.deleteColumnAt(d)})},[t,s]),f=_.useCallback((d,p)=>{t.update(()=>{var g;(g=Ci(s))==null||g.setColumnAlign(d,p)})},[t,s]),h=_n();return _.createElement(Gv,null,_.createElement(oM,{className:xe.tableColumnEditorTrigger,"data-active":e[0]===i+1,title:h("table.columnMenu","Column menu")},a("more_horiz")),_.createElement(Kv,{container:l?.current},_.createElement(Yv,{className:sn(xe.tableColumnEditorPopoverContent),onOpenAutoFocus:d=>{d.preventDefault()},sideOffset:5,side:"top"},_.createElement(iS,{className:xe.tableColumnEditorToolbar},_.createElement(sO,{className:xe.toggleGroupRoot,onValueChange:d=>{f(i,d)},value:n??"left",type:"single","aria-label":h("table.textAlignment","Text alignment")},_.createElement(Tp,{value:"left",title:h("table.alignLeft","Align left")},a("format_align_left")),_.createElement(Tp,{value:"center",title:h("table.alignCenter","Align center")},a("format_align_center")),_.createElement(Tp,{value:"right",title:h("table.alignRight","Align right")},a("format_align_right"))),_.createElement(yK,null),_.createElement($l,{onClick:c.bind(null,i),title:h("table.insertColumnLeft","Insert a column to the left of this one")},a("insert_col_left")),_.createElement($l,{onClick:c.bind(null,i+1),title:h("table.insertColumnRight","Insert a column to the right of this one")},a("insert_col_right")),_.createElement($l,{onClick:u.bind(null,i),title:h("table.deleteColumn","Delete this column")},a("delete_small"))),_.createElement(Jv,{className:xe.popoverArrow}))))},kK=({parentEditor:t,highlightedCoordinates:e,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{const o=n.getKey(),[s,l]=Vn(qc,Bn),a=_.useCallback(f=>{t.update(()=>{const h=Ci(o);h&&(h.insertRowAt(f),i([0,f]))})},[t,i,o]),c=_.useCallback(f=>{t.update(()=>{var h;(h=Ci(o))==null||h.deleteRowAt(f)})},[t,o]),u=_n();return _.createElement(Gv,null,_.createElement(oM,{className:xe.tableColumnEditorTrigger,"data-active":e[1]===r,title:u("table.rowMenu","Row menu")},l("more_horiz")),_.createElement(Kv,{container:s?.current},_.createElement(Yv,{className:sn(xe.tableColumnEditorPopoverContent),onOpenAutoFocus:f=>{f.preventDefault()},sideOffset:5,side:"bottom"},_.createElement(iS,{className:xe.tableColumnEditorToolbar},_.createElement($l,{onClick:a.bind(null,r),title:u("table.insertRowAbove","Insert a row above this one")},l("insert_row_above")),_.createElement($l,{onClick:a.bind(null,r+1),title:u("table.insertRowBelow","Insert a row below this one")},l("insert_row_below")),_.createElement($l,{onClick:c.bind(null,r),title:u("table.deleteRow","Delete this row")},l("delete_small"))),_.createElement(Jv,{className:xe.popoverArrow}))))};var CK=Object.defineProperty,_K=(t,e,n)=>e in t?CK(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,k2=(t,e,n)=>_K(t,typeof e!="symbol"?e+"":e,n);const C2={type:"tableCell",children:[]};function TK(){let t=El;return{publish:e=>{t(e)},subscribe:e=>{t=e}}}class ru extends Fc{constructor(e,n){super(n),k2(this,"__mdastNode"),k2(this,"focusEmitter",TK()),this.__mdastNode=e??{type:"table",children:[]}}static getType(){return"table"}static clone(e){return new ru(structuredClone(e.__mdastNode),e.__key)}static importJSON(e){return oS(e.mdastNode)}static importDOM(){return{table:()=>({conversion:PK,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:"table",version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){var e;return((e=this.__mdastNode.children[0])==null?void 0:e.children.length)||0}createDOM(){return document.createElement("div")}updateDOM(){return!1}updateCellContents(e,n,r){const o=this.getWritable().__mdastNode,s=o.children[n],l=s.children,a=l[e],c=Array.from(l),u={...a,children:r},f={...s,children:c};c[e]=u,o.children[n]=f}insertColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;i<r.children.length;i++){const o=r.children[i],s=o.children,l=Array.from(s),a={...o,children:l};l.splice(e,0,structuredClone(C2)),r.children[i]=a}r.align&&r.align.length>0&&r.align.splice(e,0,"left")}deleteColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;i<r.children.length;i++){const o=r.children[i],s=o.children,l=Array.from(s),a={...o,children:l};l.splice(e,1),r.children[i]=a}}insertRowAt(e){const r=this.getWritable().__mdastNode,i={type:"tableRow",children:Array.from({length:this.getColCount()},()=>structuredClone(C2))};r.children.splice(e,0,i)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,n){const i=this.getWritable().__mdastNode;i.align??(i.align=[]),i.align[e]=n}decorate(e){return _.createElement(bK,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}}function NM(t){return t instanceof ru}function oS(t){return new ru(t)}function PK(t){const e=t.querySelectorAll("tr"),n=Array.from(e).map(r=>({type:"tableRow",children:Array.from(r.querySelectorAll("td, th")).map(i=>({type:"tableCell",children:[{type:"text",value:i.textContent}]}))}));return{node:new ru({type:"table",children:n})}}const EK={testLexicalNode:NM,visitLexicalNode({actions:t,mdastParent:e,lexicalNode:n}){t.appendToParent(e,n.getMdastNode())}},$K={testNode:"table",visitNode({mdastNode:t,lexicalParent:e}){e.append(oS(t))}};function AK(t=1,e=1){const n={type:"table",children:[]};for(let r=0;r<t;r++){const i={type:"tableRow",children:[]};for(let o=0;o<e;o++){const s={type:"tableCell",children:[]};i.children.push(s)}n.children.push(i)}return n}const VM=Nn(t=>{t.link(t.pipe(VM,Rl(({rows:e,columns:n})=>()=>oS(AK(e,n)))),Ev)}),QK=Zr({init(t,e){t.pubIn({[bg]:dq(),[xg]:wq(),[es]:$K,[tl]:ru,[nl]:EK,[kv]:xq({tableCellPadding:e?.tableCellPadding??!0,tablePipeAlign:e?.tablePipeAlign??!0})})}}),_2=new Set(["http:","https:","mailto:","sms:","tel:"]);class yo extends sr{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new yo(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",n={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=n;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){const n=Tt().createElement("a");return this.updateLinkDOM(null,n,e),Ii(n,e.theme.link),n}updateLinkDOM(e,n,r){if(lA(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const o=`__${i}`,s=this[o];e&&e[o]===s||(s?n[i]=s:n.removeAttribute(i))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!1}static importDOM(){return{a:e=>({conversion:RK,priority:1})}}static importJSON(e){return os().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){const n=e;e=$2(e);try{const r=new URL($2(e));if(!_2.has(r.protocol))return"about:blank"}catch{const i=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(i!=null&&!_2.has(`${i[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){const n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){const n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){const n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){const r=Rn(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!X(n))return!1;const i=n.anchor.getNode(),o=n.focus.getNode();return(this.is(i)||this.isParentOf(i))&&(this.is(o)||this.isParentOf(o))&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function T2(t){const e=Hn(t,"next");return[e,e.getFlipped()]}function P2(t,e){for(const n of e)if(n.origin.isAttached()){const r=Wn(n);return void Ls(t,r)}}function MK(t){const e=ne();let n=null,r=null;function i(){X(e)&&(P2(e.anchor,n),P2(e.focus,r),Ki(e))}X(e)&&(n=T2(e.anchor),r=T2(e.focus));let o=!1;for(const l of lr(t,"next")){const a=l.origin;if(N(a)&&!a.isInline()){const c=a.getChildren();if(c.length>0){const u=Rn(t);u.append(...c),a.append(u),o=!0}Rm(a,Ks(l),{$shouldSplit:()=>!1})}}function s(l,a,c){const[u,f]=l,h=p=>Go(p)&&p.origin.is(a);if(!h(u)&&!h(f))return l;const d=Wn(lr(c,"next"));return[d,d.getFlipped()]}if(t.isAttached()){const l=t.getPreviousSibling();if(en(l)&&l.shouldMergeAdjacentLink(t))return n&&(n=s(n,l,t)),r&&(r=s(r,l,t)),l.append(...t.getChildren()),t.remove(),void i();const a=t.getNextSibling();en(a)&&t.shouldMergeAdjacentLink(a)&&(n&&(n=s(n,t,a)),r&&(r=s(r,t,a)),t.append(...a.getChildren()),a.remove(),o=!0)}if(o){if(!t.canBeEmpty()&&t.isEmpty()){const l=t.getParent();t.remove(),l&&l.isEmpty()&&l.remove()}i()}}function RK(t){let e=null;if(lA(t)){const n=t.textContent;(n!==null&&n!==""||t.children.length>0)&&(e=os(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function os(t="",e){return zr(new yo(t,e))}function en(t){return t instanceof yo}class iu extends yo{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return"autolink"}static clone(e){return new iu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Tt().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Ky().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){const r=Ky(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function Ky(t="",e){return zr(new iu(t,e))}function er(t){return t instanceof iu}const Cs=Pe("TOGGLE_LINK_COMMAND");function E2(t,e){if(t.type==="element"){const n=t.getNode();return N(n)||(function(r,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const l of i)s.append("v",l);throw o.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),n.getChildren()[t.offset+e]||null}return null}function v1(t,e={}){let n;if(t&&typeof t=="object"){const{url:u,...f}=t;n=u,e={...f,...e}}else n=t;const{target:r,title:i}=e,o=e.rel===void 0?"noreferrer":e.rel,s=ne();if(s===null||!X(s)&&!it(s))return;if(it(s)){const u=s.getNodes();return u.length===0?void 0:void u.forEach(f=>{if(n===null){const h=lt(f,d=>!er(d)&&en(d));h&&(h.insertBefore(f),h.getChildren().length===0&&h.remove())}else{const h=lt(f,d=>!er(d)&&en(d));if(h)h.setURL(n),r!==void 0&&h.setTarget(r),o!==void 0&&h.setRel(o);else{const d=os(n,{rel:o,target:r});f.insertBefore(d),d.append(f)}}})}if(s.isCollapsed()&&n===null)for(const u of s.getNodes()){const f=lt(u,h=>!er(h)&&en(h));return void(f!==null&&(f.getParentOrThrow().splice(f.getIndexWithinParent(),0,f.getChildren()),f.remove()))}const l=s.extract();if(n===null){const u=new Set;return void l.forEach(f=>{const h=lt(f,d=>!er(d)&&en(d));if(h!==null){const d=h.getKey();if(u.has(d))return;(function(p,g){const m=new Set(g.filter(k=>p.isParentOf(k)).map(k=>k.getKey())),O=p.getChildren(),y=k=>m.has(k.getKey())||N(k)&&g.some(P=>p.isParentOf(P)&&k.isParentOf(P)),x=O.filter(y);if(x.length===O.length)return O.forEach(k=>p.insertBefore(k)),void p.remove();const b=O.findIndex(y),S=O.findLastIndex(y),v=b===0,w=S===O.length-1;if(v)x.forEach(k=>p.insertBefore(k));else if(w)for(let k=x.length-1;k>=0;k--)p.insertAfter(x[k]);else{for(let P=x.length-1;P>=0;P--)p.insertAfter(x[P]);const k=O.slice(S+1);if(k.length>0){const P=Rn(p);x[x.length-1].insertAfter(P),k.forEach(T=>P.append(T))}}})(h,l),u.add(d)}})}const a=new Set,c=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(n),r!==void 0&&u.setTarget(r),o!==void 0&&u.setRel(o),i!==void 0&&u.setTitle(i))};if(l.length===1){const u=l[0],f=lt(u,en);if(f!==null)return c(f)}(function(u){const f=ne();if(!X(f))return u();const h=Ki(f),d=h.isBackward(),p=E2(h.anchor,d?-1:0),g=E2(h.focus,d?0:-1);if(u(),p||g){const m=ne();if(X(m)){const O=m.clone();if(p){const y=p.getParent();y&&O.anchor.set(y.getKey(),p.getIndexWithinParent()+(d?1:0),"element")}if(g){const y=g.getParent();y&&O.focus.set(y.getKey(),g.getIndexWithinParent()+(d?0:1),"element")}Vt(Ki(O))}}})(()=>{let u=null;for(const f of l){if(!f.isAttached())continue;const h=lt(f,en);if(h){c(h);continue}if(N(f)){if(!f.isInline())continue;if(en(f)){if(!(er(f)||u!==null&&u.getParentOrThrow().isParentOf(f))){c(f),u=f;continue}for(const p of f.getChildren())f.insertBefore(p);f.remove();continue}}const d=f.getPreviousSibling();en(d)&&d.is(u)?d.append(f):(u=os(n,{rel:o,target:r,title:i}),f.insertAfter(u),u.append(f))}})}const LK=/^\+?[0-9\s()-]{5,}$/;function $2(t){return t.match(/^[a-z][a-z0-9+.-]*:/i)||t.match(/^[/#.]/)?t:t.includes("@")?`mailto:${t}`:LK.test(t)?`tel:${t}`:`https://${t}`}Cn.tag("a");function IK(t,e){return ln(t.registerNodeTransform(yo,MK),t.registerCommand(Cs,n=>{const r=e.validateUrl.peek(),i=e.attributes.peek();if(n===null)return v1(null),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(v1(n,i),!0);{const{url:o,target:s,rel:l,title:a}=n;return v1(o,{...i,rel:l,target:s,title:a}),!0}},Ne),Wc(()=>{const n=e.validateUrl.value;if(!n)return;const r=e.attributes.value;return t.registerCommand(mm,i=>{const o=ne();if(!X(o)||o.isCollapsed()||!Lo(i,ClipboardEvent)||i.clipboardData===null)return!1;const s=i.clipboardData.getData("text");return n(s)?!o.getNodes().some(l=>N(l)||Y(l)&&!l.isSimpleText())&&(t.dispatchCommand(Cs,{...r,url:s}),i.preventDefault(),!0):!1},fn)}))}function A2(t,e=n=>n){return n=>{const r=t.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Jy(t,e){for(let n=0;n<e.length;n++){const r=e[n](t);if(r)return r}return null}const BM=/[.,;\s]/;function Pg(t,e){return e.test(t)}function FM(t,e){return Pg(t[t.length-1],e)}function ex(t,e){return Pg(t[0],e)}function ZM(t,e){let n=t.getPreviousSibling();return N(n)&&(n=n.getLastDescendant()),n===null||kn(n)||Y(n)&&FM(n.getTextContent(),e)}function zM(t,e){let n=t.getNextSibling();return N(n)&&(n=n.getFirstDescendant()),n===null||kn(n)||Y(n)&&ex(n.getTextContent(),e)}function DK(t,e,n,r,i){return(t>0?Pg(r[t-1],n):ZM(i[0],n))?e<r.length?Pg(r[e],n):zM(i[i.length-1],n):!1}function NK(t,e,n){const r=[],i=[],o=[];let s=0,l=0;const a=[...t];for(;a.length>0;){const c=a[0],u=c.getTextContent().length,f=l;l+u<=e?(r.push(c),s+=u):f>=n?o.push(c):i.push(c),l+=u,a.shift()}return[s,r,i,o]}function VK(t,e,n,r){const i=Ky(r.url,r.attributes);if(t.length===1){let o,s=t[0];e===0?[o,s]=s.splitText(n):[,o,s]=s.splitText(e,n);const l=bt(r.text);return l.setFormat(o.getFormat()),l.setDetail(o.getDetail()),l.setStyle(o.getStyle()),i.append(l),o.replace(i),s}if(t.length>1){const o=t[0];let s,l=o.getTextContent().length;e===0?s=o:[,s]=o.splitText(e);const a=[];let c;for(let d=1;d<t.length;d++){const p=t[d],g=p.getTextContent().length,m=l;if(m<n)if(l+g<=n)a.push(p);else{const[O,y]=p.splitText(n-m);a.push(O),c=y}l+=g}const u=ne(),f=u?u.getNodes().find(Y):void 0,h=bt(s.getTextContent());return h.setFormat(s.getFormat()),h.setDetail(s.getDetail()),h.setStyle(s.getStyle()),i.append(h,...a),f&&f===s&&(X(u)?h.select(u.anchor.offset,u.focus.offset):it(u)&&h.select(0,h.getTextContent().length)),s.replace(i),c}}function Q2(t,e,n,r){const i=t.getChildren(),o=i.length;for(let c=0;c<o;c++){const u=i[c];if(!Y(u)||!u.isSimpleText())return rf(t),void n(null,t.getURL())}const s=t.getTextContent(),l=Jy(s,e);if(l===null||l.text!==s||!ZM(t,r)||!zM(t,r))return rf(t),void n(null,t.getURL());const a=t.getURL();if(a!==l.url&&(t.setURL(l.url),n(l.url,a)),l.attributes){const c=t.getRel();c!==l.attributes.rel&&(t.setRel(l.attributes.rel||null),n(l.attributes.rel||null,c));const u=t.getTarget();u!==l.attributes.target&&(t.setTarget(l.attributes.target||null),n(l.attributes.target||null,u))}}function rf(t){const e=t.getChildren();for(let n=e.length-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map(n=>n.getLatest())}const BK={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:BM};function FK(t,e=BK){const{matchers:n,changeHandlers:r,excludeParents:i,separatorRegex:o=BM}=e,s=(l,a)=>{for(const c of r)c(l,a)};return ln(t.registerNodeTransform(hi,l=>{const a=l.getParentOrThrow(),c=l.getPreviousSibling();if(er(a))Q2(a,n,s,o);else if(!en(a)&&!i.some(u=>u(a))){if(l.isSimpleText()&&(ex(l.getTextContent(),o)||!er(c))){const u=(function(f){const h=[f];let d=f.getNextSibling();for(;d!==null&&Y(d)&&d.isSimpleText()&&(h.push(d),!/[\s]/.test(d.getTextContent()));)d=d.getNextSibling();return h})(l);(function(f,h,d,p){for(const b of f){const S=b.getParent();if(er(S)&&!S.getIsUnlinked())return}let g=[...f];const m=g.map(b=>b.getTextContent()).join("");let O,y=m,x=0;for(;(O=Jy(y,h))&&O!==null;){const b=O.index,S=b+O.length;if(DK(x+b,x+S,p,m,g)){const[v,,w,k]=NK(g,x+b,x+S);let P=!1;for(const M of w){const I=M.getParent();if(er(I)&&!I.getIsUnlinked()){P=!0;break}}if(P){x+=S,y=y.substring(S);continue}const T=VK(w,x+b-v,x+S-v,O);g=T?[T,...k]:k,d(O.url,null),x=0}else x+=S;y=y.substring(S)}})(u,n,s,o)}(function(u,f,h,d){const p=u.getParent(),g=u.getPreviousSibling(),m=u.getNextSibling(),O=u.getTextContent();if(!er(p)||p.getIsUnlinked()){if(er(g)&&!g.getIsUnlinked()&&g.is(u.getPreviousSibling())&&u.getParent()===g.getParent()){if(!ex(O,d))return rf(g),void h(null,g.getURL());if(y=O,g.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(y):/^\.[a-zA-Z0-9]{1,}/.test(y)){const x=g.getTextContent()+O,b=Jy(x,f);b!==null&&b.text===x&&(g.append(u),Q2(g,f,h,d),h(null,g.getURL()))}}var y;!er(m)||m.getIsUnlinked()||FM(O,d)||m.is(u.getNextSibling())&&u.getParent()===m.getParent()&&(rf(m),h(null,m.getURL()))}})(l,n,s,o)}}),t.registerCommand(Cs,l=>{const a=ne();return l!==null||!X(a)||a.extract().forEach(c=>{const u=c.getParent();er(u)&&(u.setIsUnlinked(!u.getIsUnlinked()),u.markDirty())}),!1},fn))}const ZK={testNode:"link",visitNode({mdastNode:t,actions:e}){e.addAndStepInto(os(t.url,{title:t.title}))}},zK={testLexicalNode:en,visitLexicalNode:({lexicalNode:t,actions:e})=>{e.addAndStepInto("link",{url:t.getURL(),title:t.getTitle()})}};function jK({validateUrl:t,attributes:e}){const[n]=jr();return C.useEffect(()=>{if(!n.hasNodes([yo]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),C.useEffect(()=>IK(n,Nm({attributes:e,validateUrl:t})),[n,t,e]),null}function XK(t,e,n,r){C.useEffect(()=>{t.hasNodes([iu])||(function(i,...o){const s=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",i);for(const a of o)l.append("v",a);throw s.search=l.toString(),Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),C.useEffect(()=>FK(t,{changeHandlers:n?[n]:[],excludeParents:r??[],matchers:e}),[t,e,n,r])}function WK({matchers:t,onChange:e,excludeParents:n}){const[r]=jr();return XK(r,t,e,n),null}const HK=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,qK=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,YK=[A2(HK,t=>t.startsWith("http")?t:`https://${t}`),A2(qK,t=>`mailto:${t}`)],UK=()=>_.createElement(WK,{matchers:YK}),GK=we(!1),KK=Zr({init(t,e){const n=!!e?.disableAutoLink,r=e?.validateUrl?{validateUrl:e.validateUrl}:{},i=()=>_.createElement(_.Fragment,null,_.createElement(jK,{...r}),n?null:_.createElement(UK,null));t.pubIn({[Yc]:"link",[es]:ZK,[tl]:[yo,iu],[nl]:zK,[GK]:n,[Tv]:i,[R9]:i,[Ah]:i})}});var Nh=t=>t.type==="checkbox",lO=t=>t.type==="file",_s=t=>t instanceof Date,pn=t=>t==null;const sS=t=>typeof t=="object";var Xt=t=>!pn(t)&&!Array.isArray(t)&&sS(t)&&!_s(t),tx=t=>Xt(t)&&t.target?Nh(t.target)?t.target.checked:lO(t.target)?t.target.files:t.target.value:t;const JK=/[.[\]'"]/;var Yl=t=>t.split(JK).filter(Boolean);function eJ(t,e){const n=Yl(e);let r=t._formValues,i=t._defaultValues;for(let o=0;o<n.length-1;o++){const s=n[o];if(r=r==null?r:r[s],i=i==null?i:i[s],r===null||i===null)return null}}var jM=(t,e)=>e.split(".").some((n,r,i)=>!isNaN(Number(n))&&t.has(i.slice(0,r).join("."))),aO=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Et(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(aO&&(t instanceof Blob||e))return t;const n=Array.isArray(t);if(!n&&t.constructor!==Object)return t;const r=n?[]:Object.create(Object.getPrototypeOf(t));for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Et(t[i]));return r}const ys={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},_i={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Si={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XM="root",lS=["__proto__","constructor","prototype"],tJ=/^\w*$/;var Ul=t=>tJ.test(t),ct=t=>t===void 0,fe=(t,e,n)=>{if(!e||!Xt(t))return n;const r=Ul(e)?[e]:Yl(e);if(r.some(o=>lS.includes(o)))return n;const i=r.reduce((o,s)=>pn(o)?void 0:o[s],t);return ct(i)||i===t?ct(t[e])?n:t[e]:i},Rr=t=>typeof t=="boolean",Xn=t=>typeof t=="function",Ot=(t,e,n)=>{let r=-1;const i=Ul(e)?[e]:Yl(e),o=i.length,s=o-1;for(;++r<o;){const l=i[r];let a=n;if(r!==s){const c=t[l];a=Xt(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}if(lS.includes(l))return;t[l]=a,t=t[l]}};const WM=_.createContext(null);WM.displayName="HookFormControlContext";const aS=()=>_.useContext(WM);var HM=(t,e,n,r=!0)=>{const i={};for(const o in t)Object.defineProperty(i,o,{get:()=>{const s=o;return e._proxyFormState[s]!==_i.all&&(e._proxyFormState[s]=!r||_i.all),n&&(n[s]=!0),t[s]}});return i};const cS=aO?_.useLayoutEffect:_.useEffect;var nJ=t=>{const e=t.constructor&&t.constructor.prototype;return Xt(e)&&e.hasOwnProperty("isPrototypeOf")},nx=t=>pn(t)||!sS(t);const M2=(t,e)=>e.length===0&&!Array.isArray(t)&&!nJ(t);function pr(t,e,n=new WeakMap){if(t===e)return!0;if(nx(t)||nx(e))return Object.is(t,e);if(_s(t)&&_s(e))return Object.is(t.getTime(),e.getTime());const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;if(M2(t,r)||M2(e,i))return Object.is(t,e);if(!r.length&&Array.isArray(t)!==Array.isArray(e))return!1;const o=n.get(t);if(o&&o.has(e))return!0;if(o)o.add(e);else{const s=new WeakSet;s.add(e),n.set(t,s)}for(const s of r){const l=t[s];if(!(s in e))return!1;if(s!=="ref"){const a=e[s];if(_s(l)&&_s(a)||(Xt(l)||Array.isArray(l))&&(Xt(a)||Array.isArray(a))?!pr(l,a,n):!Object.is(l,a))return!1}}return!0}function uS(t){const e=_.useRef(!1),n=_.useRef(!1),r=_.useRef(void 0),i=_.useRef(0);i.current++,!n.current&&t&&(n.current=!0,r.current=Et(t()));const o=_.useCallback((l,a,c)=>{if(l&&(e.current||n.current&&i.current>1)){const u=a();pr(r.current,u)||c(u)}e.current=!0},[]),s=_.useCallback((l,a)=>{l&&(r.current=Et(a()))},[]);return{resyncIfNeeded:o,snapshot:s}}function rJ(t){const e=aS(),{control:n=e,disabled:r,name:i,exact:o}=t||{},s=()=>({...n._formState,defaultValues:n._defaultValues}),[l,a]=_.useState(s),c=_.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:f}=uS(s);return cS(()=>{u(!r,s,a);const h=n._subscribe({name:i,formState:c.current,exact:o,callback:d=>{!r&&a({...n._formState,...d,defaultValues:n._defaultValues})}});return()=>{h(),f(!r,s)}},[i,r,o,u,f]),_.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),_.useMemo(()=>HM(l,n,c.current,!1),[l,n])}var mn=t=>typeof t=="string",rx=(t,e,n,r,i)=>mn(t)?(r&&e.watch.add(t),fe(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),fe(n,o,fe(i,o)))):(r&&(e.watchAll=!0),n);function iJ(t){const e=aS(),{control:n=e,name:r,defaultValue:i,disabled:o,exact:s,compute:l}=t||{},a=_.useRef(i),c=_.useRef(l),u=_.useRef(void 0),f=_.useRef(n),h=_.useRef(r);c.current=l;const d=()=>{const P=n._getWatch(r,a.current);return c.current?c.current(P):P},[p,g]=_.useState(d),m=_.useCallback(P=>{const T=rx(r,n._names,P||n._formValues,!1,a.current);return c.current?c.current(T):T},[n._formValues,n._names,r]),O=_.useCallback(P=>{if(!o){const T=rx(r,n._names,P||n._formValues,!1,a.current);if(c.current){const M=c.current(T);pr(M,u.current)||(g(M),u.current=M)}else g(T)}},[n._formValues,n._names,o,r]),{resyncIfNeeded:y,snapshot:x}=uS(d),b=_.useRef(O);b.current=O;const S=_.useRef(m);S.current=m,cS(()=>{f.current!==n||!pr(h.current,r)?(f.current=n,h.current=r,b.current()):y(!o,()=>S.current(),T=>{g(T),u.current=T});const P=n._subscribe({name:r,formState:{values:!0},exact:s,callback:T=>{b.current(T.values)}});return()=>{P(),x(!o,()=>S.current())}},[n,s,r,o,y,x]),_.useEffect(()=>n._removeUnmounted());const v=f.current!==n,w=h.current;return _.useMemo(()=>{if(o)return!1;const P=!v&&!pr(w,r);return v||P},[o,v,r,w])?m():p}function oJ(t){const e=aS(),{name:n,disabled:r,control:i=e,shouldUnregister:o,defaultValue:s,exact:l=!0}=t,a=jM(i._names.array,n),c=_.useMemo(()=>{const b=fe(i._formValues,n,fe(i._defaultValues,n,s));return ct(b)?eJ(i,n):b},[i,n,s]),u=iJ({control:i,name:n,defaultValue:c,exact:l}),f=rJ({control:i,name:n,exact:l}),h=_.useRef(t),d=_.useRef(null),p=_.useRef(i.register(n,{...t.rules,value:u,...Rr(t.disabled)?{disabled:t.disabled}:{}}));h.current=t;const g=_.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!fe(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!fe(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!fe(f.validatingFields,n)},error:{enumerable:!0,get:()=>fe(f.errors,n)}}),[f,n]),m=_.useCallback(b=>{const S=tx(b);return fe(i._fields,n)||(p.current=i.register(n,{...h.current.rules,value:S})),p.current.onChange({target:{value:tx(b),name:n},type:ys.CHANGE})},[n,i]),O=_.useCallback(()=>p.current.onBlur({target:{value:fe(i._formValues,n),name:n},type:ys.BLUR}),[n,i._formValues]),y=_.useCallback(b=>{b&&(d.current={focus:()=>Xn(b.focus)&&b.focus(),select:()=>Xn(b.select)&&b.select(),setCustomValidity:v=>Xn(b.setCustomValidity)&&b.setCustomValidity(v),reportValidity:()=>Xn(b.reportValidity)&&b.reportValidity()});const S=fe(i._fields,n);S&&S._f&&b&&(S._f.ref=d.current)},[i._fields,n]),x=_.useMemo(()=>({name:n,value:u,...Rr(r)||f.disabled?{disabled:f.disabled||r}:{},onChange:m,onBlur:O,ref:y}),[n,r,f.disabled,m,O,y,u]);return _.useEffect(()=>{const b=i._options.shouldUnregister||o;p.current=i.register(n,{...h.current.rules,...Rr(h.current.disabled)?{disabled:h.current.disabled}:{}});const S=(v,w)=>{const k=fe(i._fields,v);k&&k._f&&(k._f.mount=w)};if(S(n,!0),b){const v=Et(fe(o?i._defaultValues:i._options.values||i._defaultValues,n,fe(i._options.defaultValues,n,h.current.defaultValue)));Ot(i._defaultValues,n,v),ct(fe(i._formValues,n))&&Ot(i._formValues,n,v)}if(!a&&i.register(n),d.current){const v=fe(i._fields,n);v&&v._f&&(v._f.ref=d.current)}return()=>{(a?b&&!i._state.action:b)?i.unregister(n):S(n,!1)}},[n,i,a,o]),_.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),_.useMemo(()=>({field:x,formState:f,fieldState:g}),[x,f,g])}const sJ=t=>t.render(oJ(t));var yd=t=>({isOnSubmit:!t||t===_i.onSubmit,isOnBlur:t===_i.onBlur,isOnChange:t===_i.onChange,isOnAll:t===_i.all,isOnTouch:t===_i.onTouched}),S1=(t,e,n)=>{if(n)return!1;if(e.watchAll||e.watch.has(t))return!0;for(const r of e.watch)if(t.startsWith(r)&&t.charAt(r.length)===".")return!0;return!1};const of=(t,e,n,r)=>{for(const i of n||Object.keys(t)){if(i==="_f")continue;const o=n?fe(t,i):t[i];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],i)&&!r)return!0;if(s.ref&&e(s.ref,s.name)&&!r)return!0;if(of(o,e))break}else if((Xt(o)||Array.isArray(o))&&of(o,e))break}}};var R2=(t,e,n)=>{const r=fe(t,n),i=Array.isArray(r)?r:[];return Ot(i,XM,e[n]),Ot(t,n,i),t},Pn=t=>Xt(t)&&!Object.keys(t).length,Eg=t=>{if(!aO)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},fS=t=>t.type==="radio",$g=t=>t instanceof RegExp,lJ=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{};const L2={value:!1,isValid:!1},I2={value:!0,isValid:!0};var qM=t=>{if(!Array.isArray(t))return L2;if(t.length>1){const n=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const e=t[0];return!e||!e.checked||e.disabled?L2:!e.attributes||!("value"in e.attributes)||ct(e.value)||e.value===""?I2:{value:e.value,isValid:!0}};const D2={isValid:!1,value:null};var YM=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,D2):D2;function N2(t,e,n="validate"){if(mn(t)||Array.isArray(t)&&t.every(mn)||Rr(t)&&!t)return{type:n,message:mn(t)?t:"",ref:e}}var Ea=t=>Xt(t)&&!$g(t)?t:{value:t,message:""},V2=async(t,e,n,r,i,o)=>{const{ref:s,refs:l,required:a,maxLength:c,minLength:u,min:f,max:h,pattern:d,validate:p,name:g,valueAsNumber:m,mount:O}=t._f,y=fe(n,g);if(!O||e.has(g))return{};const x=l?l[0]:s,b=$=>{if(i&&x.reportValidity){const D=Rr($)?"":$||"";l?l.forEach(Z=>Z.setCustomValidity(D)):x.setCustomValidity(D),x.reportValidity()}},S={},v=fS(s),w=Nh(s),k=v||w,P=(m||lO(s))&&ct(s.value)&&ct(y)||Eg(s)&&s.value===""||y===""||Array.isArray(y)&&!y.length,T=lJ.bind(null,g,r,S),M=($,D,Z,G=Si.maxLength,z=Si.minLength)=>{const ee=$?D:Z;S[g]={type:$?G:z,message:ee,ref:s,...T($?G:z,ee)}};if(o?!Array.isArray(y)||!y.length:a&&(!k&&(P||pn(y))||Rr(y)&&!y||w&&!qM(l).isValid||v&&!YM(l).isValid)){const{value:$,message:D}=mn(a)?{value:!!a,message:a}:Ea(a);if($&&(S[g]={type:Si.required,message:D,ref:x,...T(Si.required,D)},!r))return b(D),S}if(!P&&(!pn(f)||!pn(h))){let $,D;const Z=Ea(h),G=Ea(f);if(!pn(y)&&!_s(y)&&!isNaN(y)){const z=s.valueAsNumber||y&&+y;pn(Z.value)||($=z>Z.value),pn(G.value)||(D=z<G.value)}else{const z=s.valueAsDate||new Date(y),ee=ve=>new Date(new Date().toDateString()+" "+ve),oe=s.type=="time",Q=s.type=="week";mn(Z.value)&&y&&($=oe?ee(y)>ee(Z.value):Q?y>Z.value:z>new Date(Z.value)),mn(G.value)&&y&&(D=oe?ee(y)<ee(G.value):Q?y<G.value:z<new Date(G.value))}if(($||D)&&(M(!!$,Z.message,G.message,Si.max,Si.min),!r))return b(S[g].message),S}if((c||u)&&!P&&(mn(y)||o&&Array.isArray(y))){const $=Ea(c),D=Ea(u),Z=!pn($.value)&&y.length>+$.value,G=!pn(D.value)&&y.length<+D.value;if((Z||G)&&(M(Z,$.message,D.message),!r))return b(S[g].message),S}if(d&&!P&&mn(y)){const{value:$,message:D}=Ea(d);if($g($)&&!y.match($)&&(S[g]={type:Si.pattern,message:D,ref:s,...T(Si.pattern,D)},!r))return b(D),S}if(p){if(Xn(p)){const $=await p(y,n),D=N2($,x);if(D&&(S[g]={...D,...T(Si.validate,D.message)},!r))return b(D.message),S}else if(Xt(p)){let $={};for(const D in p){if(!Pn($)&&!r)break;const Z=N2(await p[D](y,n),x,D);Z&&($={...Z,...T(D,Z.message)},b(Z.message),r&&(S[g]=$))}if(!Pn($)&&(S[g]={ref:x,...$},!r))return S}}const I=S[g];return b(I?I.message:!0),S},Pp=t=>Array.isArray(t)?t:[t],UM=t=>Array.isArray(t)?t.filter(Boolean):[];function aJ(t,e){const n=e.length-1;let r=0;for(;r<n;){if(pn(t)){t=void 0;break}t=t[e[r]],r++}return t}function cJ(t){for(const e in t)if(t.hasOwnProperty(e)&&!ct(t[e]))return!1;return!0}function qt(t,e){if(mn(e)&&Object.prototype.hasOwnProperty.call(t,e))return delete t[e],t;const n=Array.isArray(e)?e:Ul(e)?[e]:Yl(e);if(n.some(s=>lS.includes(String(s))))return t;const r=n.length===1?t:aJ(t,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Xt(r)&&Pn(r)||Array.isArray(r)&&cJ(r))&&qt(t,n.slice(0,-1)),t}const uJ=_.createContext(null);uJ.displayName="HookFormContext";var B2=()=>{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}};function GM(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const i=t[r],o=e[r];if(i&&Xt(i)&&o){const s=GM(i,o);Xt(s)&&(n[r]=s)}else t[r]&&(n[r]=o)}return n}const F2=(t,e)=>t!==null&&sS(t)&&Object.prototype.hasOwnProperty.call(t,e);var fJ=(t,e)=>{if(!e)return!1;let n=t;for(const r of Ul(e)?[e]:Yl(e)){if(!F2(n,r))return F2(t,e);n=n[r]}return!0},KM=t=>t.type==="select-multiple",hJ=t=>fS(t)||Nh(t),w1=t=>Eg(t)&&t.isConnected;function Z2(t){return Array.isArray(t)||Xt(t)}function JM(t,e,n="",r=[]){for(const i in t){const o=n?`${n}.${i}`:i,s=t[i];Z2(s)&&Z2(fe(e,o))?JM(s,e,o,r):r.push(o)}return r}var dJ=t=>{for(const e in t)if(Xn(t[e]))return!0;return!1};function eR(t){return Array.isArray(t)||Xt(t)&&!dJ(t)}function tR(t){return!!(t&&"_f"in t)}function nR(t){return Array.isArray(t)?!t.some(e=>!ct(e)):!Object.keys(t).length}function ix(t,e){Array.isArray(t)?t[e]=void 0:delete t[e]}function ox(t,e={},n){for(const r in t){const i=t[r],o=n&&n[r];eR(i)&&(!Array.isArray(i)||!tR(o))?(e[r]=Array.isArray(i)?[]:{},ox(i,e[r],o),nR(e[r])&&ix(e,r)):ct(i)||(e[r]=!0)}return e}function dl(t,e,n,r){n||(n=ox(e,{},r));for(const i in t){const o=t[i],s=r&&r[i];eR(o)&&(!Array.isArray(o)||!tR(s))?(ct(e)||nx(n[i])?n[i]=ox(o,Array.isArray(o)?[]:{},s):dl(o,pn(e)?{}:e[i],n[i],s),nR(n[i])&&ix(n,i)):pr(o,e[i])?ix(n,i):n[i]=!0}return n}var pJ=(t,e)=>{const n=e.split("."),r=[];let i=n[0];for(let o=1;o<n.length;i+="."+n[o++])!isNaN(+n[o])&&t.has(i)&&r.push(`${i}.${n[o]}`);return r},rR=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>ct(t)?t:e?t===""?NaN:t&&+t:n&&mn(t)?new Date(t):r?r(t):t;function z2(t){const e=t.ref;return lO(e)?e.files:fS(e)?YM(t.refs).value:KM(e)?[...e.selectedOptions].map(({value:n})=>n):Nh(e)?qM(t.refs).value:rR(e.value,t)}var gJ=(t,e,n,r)=>{const i={};for(const o of t){const s=fe(e,o);s&&Ot(i,o,s._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Tu=t=>ct(t)?t:$g(t)?t.source:Xt(t)?$g(t.value)?t.value.source:t.value:t;const j2="AsyncFunction";var mJ=t=>{if(!t||!t.validate)return!1;if(Xn(t.validate))return t.validate.constructor.name===j2;if(Xt(t.validate)){for(const e in t.validate)if(t.validate[e].constructor.name===j2)return!0}return!1},OJ=t=>t.mount&&(t.required||!ct(t.required)&&t.required!==!1||!ct(t.min)||!ct(t.max)||!ct(t.maxLength)||!ct(t.minLength)||t.pattern||t.validate);function X2(t,e,n){const r=fe(t,n);if(r||Ul(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=fe(e,o),l=fe(t,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};i.pop()}return{name:n}}var yJ=(t,e,n,r)=>{n(t);const i=Object.keys(t).filter(o=>o!=="name");return!i.length||r&&i.length>=Object.keys(e).length||i.find(o=>e[o]===(!r||_i.all))},xJ=(t,e,n)=>!t||!e||t===e||Pp(t).some(r=>r&&(n?r===e||r.startsWith(e+"."):r.startsWith(e)||e.startsWith(r))),bJ=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,vJ=(t,e)=>{const n=fe(t,e);!UM(n).length&&!n?.root&&qt(t,e)};const SJ={mode:_i.onSubmit,reValidateMode:_i.onChange,shouldFocusError:!0},k1="form",wJ=(t,e)=>{for(const n in t)n in e||delete t[n];Object.assign(t,e)},iR={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function kJ(t={}){let e={...SJ,...t},n={...Et(iR),isLoading:Xn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},r={},i=Xt(e.defaultValues)||Xt(e.values)?Et(e.defaultValues||e.values)||{}:{},o=e.shouldUnregister?{}:Et(i),s={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const a={},c={};let u=0,f=yd(e.mode),h=yd(e.reValidateMode);const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={...d};let g={...p};const m={array:B2(),state:B2()};let O=0;const y=e.criteriaMode===_i.all,x=(R,F)=>B=>{clearTimeout(c[R]),c[R]=setTimeout(F,B)},b=async R=>{if(!s.keepIsValid&&!e.disabled&&(p.isValid||g.isValid||R)){const F=++O;let B;e.resolver?(B=Pn((await Z()).errors),F===O&&S()):B=await ee({fields:r,onlyCheckValid:!0,eventType:ys.VALID}),F===O&&B!==n.isValid&&m.state.next({isValid:B})}},S=(R,F)=>{!e.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((R||l.mount).forEach(B=>{B&&(F?Ot(n.validatingFields,B,F):qt(n.validatingFields,B))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Pn(n.validatingFields)}))},v=()=>{n.dirtyFields=dl(i,o,void 0,r)},w=(R,F=[],B,K,ie=!0,ae=!0)=>{if(K&&B&&!e.disabled){s.action=!0;const ge=fe(r,R);if(s.actionArrayLengths.has(R)||s.actionArrayLengths.set(R,Array.isArray(ge)?ge.length:0),ae&&Array.isArray(ge)){const Re=B(ge,K.argA,K.argB);ie&&Ot(r,R,Re)}const me=fe(n.errors,R);if(ae&&Array.isArray(me)){const Re=me.root,Ft=B(me,K.argA,K.argB)||me;Re&&(Ft.root=Re),ie&&Ot(n.errors,R,Ft),vJ(n.errors,R)}const Ee=fe(n.touchedFields,R);if((p.touchedFields||g.touchedFields)&&ae&&Array.isArray(Ee)){const Re=B(Ee,K.argA,K.argB);ie&&Ot(n.touchedFields,R,Re)}(p.dirtyFields||g.dirtyFields)&&v(),m.state.next({name:R,isDirty:Q(R,F),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ot(o,R,F)},k=(R,F)=>{Ot(n.errors,R,F),n.errors={...n.errors},m.state.next({errors:n.errors})},P=R=>{n.errors=R,m.state.next({errors:n.errors,isValid:!1})},T=R=>{const F=Ul(R)?[R]:Yl(R);let B=o,K=i;for(let ie=0;ie<F.length-1;ie++){const ae=F[ie];if(B=pn(B)?B:B[ae],K=pn(K)?K:K[ae],B===null&&K!==null)return!0}return!1},M=R=>{if(!s.actionArrayLengths.size)return!1;const F=Ul(R)?[R]:Yl(R);let B=o,K="",ie=-1,ae=0;for(let ge=0;ge<F.length;ge++){if(pn(B))return!1;const me=F[ge];if(K=K?`${K}.${me}`:me,Array.isArray(B)&&+me>=B.length)return ie===-1?!1:ge===ie?+me<ae:!0;s.actionArrayLengths.has(K)&&(ie=ge+1,ae=s.actionArrayLengths.get(K)),B=B[me]}return!1},I=(R,F,B,K)=>{const ie=fe(r,R);if(ie){if(T(R)||M(R))return;const ae=ct(fe(o,R)),ge=fe(o,R,ct(B)?fe(i,R):B);ct(ge)||K&&K.defaultChecked||F?Ot(o,R,F?ge:z2(ie._f)):L(R,ge),s.mount&&!s.action&&(b(),ae&&n.isDirty&&(p.isDirty||g.isDirty)&&(Q()||(n.isDirty=!1,m.state.next({...n}))),t.shouldUnregister&&ae&&!ct(fe(o,R))&&S1(R,l)&&(s.watch=!0))}},$=(R,F,B,K,ie)=>{let ae=!1,ge=!1;const me={name:R};if(!e.disabled||K===!0){if(!B||K){const Ee=pr(fe(i,R),F);(p.isDirty||g.isDirty)&&(ge=n.isDirty,n.isDirty=me.isDirty=!Ee||Q(),ae=ge!==me.isDirty),ge=!!fe(n.dirtyFields,R),Ee!==n.isDirty?wJ(n.dirtyFields,dl(i,o,void 0,r)):Ee?qt(n.dirtyFields,R):Ot(n.dirtyFields,R,!0),me.dirtyFields=n.dirtyFields,ae=ae||(p.dirtyFields||g.dirtyFields)&&ge!==!Ee}if(B){const Ee=fe(n.touchedFields,R);Ee||(Ot(n.touchedFields,R,B),me.touchedFields=n.touchedFields,ae=ae||(p.touchedFields||g.touchedFields)&&Ee!==B)}ae&&ie&&m.state.next(me)}return ae?me:{}},D=(R,F,B,K)=>{const ie=fe(n.errors,R),ae=(p.isValid||g.isValid)&&Rr(F)&&n.isValid!==F;if(e.delayError&&B?(a[R]=x(R,()=>k(R,B)),a[R](e.delayError)):(clearTimeout(c[R]),delete a[R],B?Ot(n.errors,R,B):qt(n.errors,R),n.errors={...n.errors}),(B?!pr(ie,B):ie)||!Pn(K)||ae){const ge={...K,...ae&&Rr(F)?{isValid:F}:{},errors:n.errors,name:R};m.state.next(ge)}},Z=async R=>(S(R,!0),await e.resolver(o,e.context,gJ(R||l.mount,r,e.criteriaMode,e.shouldUseNativeValidation))),G=async R=>{const{errors:F}=await Z(R);if(S(R),R){for(const B of R){const K=fe(F,B);K?l.array.has(B)&&Xt(K)&&!Object.keys(K).some(ie=>!Number.isNaN(Number(ie)))?R2(n.errors,{[B]:K},B):Ot(n.errors,B,K):qt(n.errors,B)}n.errors={...n.errors}}else n.errors=F;return F},z=async({name:R,eventType:F})=>{if(t.validate){const B=await t.validate({formValues:o,formState:n,name:R,eventType:F});if(Xt(B))for(const K in B){const ie=B[K];ie&&st(`${k1}.${K}`,{message:mn(ie.message)?ie.message:"",type:ie.type||Si.validate})}else mn(B)||!B?st(k1,{message:B||"",type:Si.validate}):Qt(k1);return B}return!0},ee=async({fields:R,onlyCheckValid:F,name:B,eventType:K,context:ie={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(ie.runRootValidation=!0,!await z({name:B,eventType:K})&&(ie.valid=!1,F)))return ie.valid;for(const ae in R){const ge=R[ae];if(ge){const{_f:me,...Ee}=ge;if(me){const Re=l.array.has(me.name),Ft=ge._f&&mJ(ge._f),Tr=p.validatingFields||p.isValidating||g.validatingFields||g.isValidating;Ft&&Tr&&S([me.name],!0);const yi=await V2(ge,l.disabled,o,y,e.shouldUseNativeValidation&&!F,Re);if(Ft&&Tr&&S([me.name]),yi[me.name]&&(ie.valid=!1,F)||(!F&&(fe(yi,me.name)?Re?R2(n.errors,yi,me.name):Ot(n.errors,me.name,yi[me.name]):qt(n.errors,me.name)),t.shouldUseNativeValidation&&yi[me.name]))break}!Pn(Ee)&&await ee({context:ie,onlyCheckValid:F,fields:Ee,name:ae,eventType:K})}}return ie.valid},oe=()=>{for(const R of l.unMount){const F=fe(r,R);F&&(F._f.refs?F._f.refs.every(B=>!w1(B)):!w1(F._f.ref))&&Tn(R)}l.unMount=new Set},Q=(R,F)=>(R&&F&&Ot(o,R,F),!pr(s.mount?o:i,i)),ve=(R,F,B)=>rx(R,l,{...s.mount?o:ct(F)||mn(R)?i:F},B,F),_e=R=>UM(fe(s.mount?o:i,R,e.shouldUnregister?fe(i,R,[]):[])),L=(R,F,B={},K=!1,ie=!1,ae=!1)=>{const ge=fe(r,R);let me=F;if(ge){const Ee=ge._f;Ee&&(!Ee.disabled&&Ot(o,R,rR(F,Ee)),me=Eg(Ee.ref)&&pn(F)?"":F,KM(Ee.ref)?[...Ee.ref.options].forEach(Re=>Re.selected=me.includes(Re.value)):Ee.refs?Nh(Ee.ref)?Ee.refs.forEach(Re=>{(!Re.defaultChecked||!Re.disabled)&&(Array.isArray(me)?Re.checked=!!me.find(Ft=>Ft===Re.value):Re.checked=me===Re.value||!!me)}):Ee.refs.forEach(Re=>Re.checked=Re.value===me):lO(Ee.ref)?Ee.ref.value="":(Ee.ref.value=me,!Ee.ref.type&&!ie&&!ae&&m.state.next({name:R,values:K?o:Et(o)})))}(B.shouldDirty||B.shouldTouch)&&$(R,me,B.shouldTouch,B.shouldDirty,!ie),B.shouldValidate&&Se(R,{delayError:B.delayError})},Ie=(R,F,B,K=!1,ie=!1,ae=!1)=>{l.array.has(R)&&m.array.next({name:R,values:K?o:Et(o)});for(const ge in F){if(!F.hasOwnProperty(ge))continue;const me=F[ge],Ee=R+"."+ge,Re=fe(r,Ee);(l.array.has(R)||Xt(me)||Re&&!Re._f)&&!_s(me)?Ie(Ee,me,B,K,ie,ae):L(Ee,me,B,K,ie,ae)}},Be=(R,F,B,K,ie=!1)=>{const ae=fe(r,R),ge=l.array.has(R),me=K?F:Et(F),Ee=fe(o,R),Re=pr(Ee,me);if(Re||Ot(o,R,me),ge)m.array.next({name:R,values:K?o:Et(o)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&B.shouldDirty&&(v(),ie||m.state.next({name:R,dirtyFields:n.dirtyFields,isDirty:Q(R,me)}));else{const Ft=Array.isArray(me)&&!me.length||Pn(me),Tr=!Re&&!ie;!ae||ae._f||pn(me)||Ft?L(R,me,B,K,ie,Tr):Ie(R,me,B,K,ie,Tr)}if(!Re&&!ie){const Ft=S1(R,l),Tr=K?o:Et(o);if(m.state.next({...Ft&&n,name:s.mount||Ft?R:void 0,values:Tr}),!ge)for(const yi of pJ(l.array,R))m.state.next({name:yi,values:Tr})}},pe=(R,F,B={})=>Be(R,F,B,!1),he=(R,F={})=>{const B=Xn(R)?R(o):R;if(!pr(o,B)){o={...o,...B};for(const K of l.mount)fJ(B,K)&&Be(K,fe(B,K),F,!0,!0);m.state.next({...n,name:void 0,type:void 0,...u?{values:o}:{}}),F.shouldValidate&&b()}},J=async R=>{s.mount=!0;const F=R.target;let B=F.name,K=!0;const ie=fe(r,B),ae=ge=>{K=Number.isNaN(ge)||_s(ge)&&isNaN(ge.getTime())||pr(ge,fe(o,B,ge))};if(ie){let ge,me;const Ee=F.type?z2(ie._f):tx(R),Re=R.type===ys.BLUR||R.type===ys.FOCUS_OUT,Ft=!OJ(ie._f)&&!t.validate&&!e.resolver&&!fe(n.errors,B)&&!ie._f.deps,Tr=Ft||bJ(Re,fe(n.touchedFields,B),n.isSubmitted,h,f),yi=S1(B,l,Re);if(Ot(o,B,Et(Ee)),Re){if(!F||!F.readOnly){ie._f.onBlur&&ie._f.onBlur(R);const mu=a[B];mu&&mu(0)}}else ie._f.onChange&&ie._f.onChange(R);const gu=$(B,Ee,Re),y6=!Pn(gu)||yi;if(!Re&&m.state.next({name:B,type:R.type,...u?{values:Et(o)}:{}}),Tr)return(!Ft||!n.isValid)&&(p.isValid||g.isValid)&&(e.mode==="onBlur"?Re&&b():Re||b()),y6&&m.state.next({name:B,...yi?{}:gu});if(!e.resolver&&t.validate&&await z({name:B,eventType:R.type}),!Re&&yi&&m.state.next({...n}),e.resolver){const{errors:mu}=await Z([B]);if(S([B]),ae(Ee),!K){!Pn(gu)&&m.state.next(gu);return}const x6=X2(n.errors,r,B),Uw=X2(mu,r,x6.name||B);ge=Uw.error,B=Uw.name,me=Pn(mu)}else S([B],!0),ge=(await V2(ie,l.disabled,o,y,e.shouldUseNativeValidation))[B],S([B]),ae(Ee),K&&(ge?me=!1:(p.isValid||g.isValid)&&(me=await ee({fields:r,onlyCheckValid:!0,name:B,eventType:R.type})));K&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&Se(ie._f.deps),D(B,me,ge,gu))}},ue=(R,F)=>{if(fe(n.errors,F)&&R.focus)return R.focus(),1},Se=async(R,F={})=>{let B,K;const ie=Pp(R);if(e.resolver){const ae=await G(ct(R)?R:ie);B=Pn(ae),K=R?!ie.some(ge=>fe(ae,ge)):B}else R?(K=(await Promise.all(ie.map(async ae=>{const ge=fe(r,ae);return await ee({fields:ge&&ge._f?{[ae]:ge}:ge,eventType:ys.TRIGGER})}))).every(Boolean),!(!K&&!n.isValid)&&b()):K=B=await ee({fields:r,name:R,eventType:ys.TRIGGER});if(F.delayError&&e.delayError&&mn(R)){const ae=fe(n.errors,R);ae?(qt(n.errors,R),a[R]=x(R,()=>k(R,ae)),a[R](e.delayError)):(clearTimeout(c[R]),delete a[R])}if(F.shouldTouch)for(const ae of R?ie:l.mount)!l.array.has(ae)&&Ot(n.touchedFields,ae,!0);return m.state.next({...!mn(R)||(p.isValid||g.isValid)&&B!==n.isValid?{}:{name:R},...e.resolver||!R?{isValid:B}:{},...F.shouldTouch&&(p.touchedFields||g.touchedFields)?{touchedFields:n.touchedFields}:{},errors:n.errors}),F.shouldFocus&&!K&&of(r,ue,R?ie:l.mount),K},Ae=(R,F)=>{let B={...s.mount?o:i};return F&&(B=GM(F.dirtyFields?n.dirtyFields:n.touchedFields,B)),ct(R)?B:mn(R)?fe(B,R):R.map(K=>fe(B,K))},Ze=R=>ct(R)?{...n.errors}:mn(R)?fe(n.errors,R):R.map(F=>fe(n.errors,F)),Ue=(R,F)=>{const B=F||n,K=fe(B.errors,R);return{invalid:!!K,isDirty:!!fe(B.dirtyFields,R),error:K,isValidating:!!fe(n.validatingFields,R),isTouched:!!fe(B.touchedFields,R)}},Qt=R=>{const F=R?Pp(R):void 0;F?.forEach(B=>qt(n.errors,B)),F?F.forEach(B=>{m.state.next({name:B,errors:n.errors})}):(n.errors={},m.state.next({errors:n.errors}))},st=(R,F,B)=>{const K=(fe(r,R,{_f:{}})._f||{}).ref,ie=fe(n.errors,R)||{},{ref:ae,message:ge,type:me,...Ee}=ie;Ot(n.errors,R,{...Ee,...F,ref:K}),m.state.next({name:R,errors:n.errors,isValid:!1}),B&&B.shouldFocus&&K&&K.focus&&K.focus()},Gt=(R,F)=>{if(Xn(R)){u++;const{unsubscribe:B}=m.state.subscribe({next:ie=>"values"in ie&&R(ie.values||ve(void 0,F),ie)});let K=!1;return{unsubscribe:()=>{K||(K=!0,u--,B())}}}return ve(R,F,!0)},Kt=R=>{var F;const B=!!(!((F=R.formState)===null||F===void 0)&&F.values);B&&u++;const{unsubscribe:K}=m.state.subscribe({next:ae=>{if(xJ(R.name,ae.name,R.exact)&&yJ(ae,R.formState||p,Me,R.reRenderRoot)){const ge={...o};R.callback({values:ge,...n,...ae,defaultValues:i})}}});if(!B)return K;let ie=!1;return()=>{ie||(ie=!0,u--,K())}},fr=R=>(s.mount=!0,g={...g,...R.formState},Kt({...R,formState:{...d,...R.formState}})),Tn=(R,F={})=>{for(const B of R?Pp(R):l.mount)l.mount.delete(B),l.array.delete(B),F.keepValue||(qt(r,B),qt(o,B)),!F.keepError&&qt(n.errors,B),!F.keepDirty&&qt(n.dirtyFields,B),!F.keepTouched&&qt(n.touchedFields,B),!F.keepIsValidating&&qt(n.validatingFields,B),!e.shouldUnregister&&!F.keepDefaultValue&&qt(i,B);u&&m.state.next({values:Et(o)}),m.state.next({...n,...F.keepDirty?{}:{isDirty:Q()}}),!F.keepIsValid&&b()},Cr=({disabled:R,name:F})=>{if(Rr(R)&&s.mount||R||l.disabled.has(F)){const ie=l.disabled.has(F)!==!!R;R?l.disabled.add(F):l.disabled.delete(F),ie&&s.mount&&!s.action&&b()}},un=(R,F={})=>{let B=fe(r,R);const K=Rr(F.disabled)||Rr(e.disabled),ie=!l.registerName.has(R)&&B&&B._f&&!B._f.mount;return Ot(r,R,{...B||{},_f:{...B&&B._f?B._f:{ref:{name:R}},name:R,mount:!0,...F}}),l.mount.add(R),B&&!ie?Cr({disabled:Rr(F.disabled)?F.disabled:e.disabled,name:R}):I(R,!0,F.value),{...K?{disabled:F.disabled||e.disabled}:{},...e.progressive?{required:!!F.required,min:Tu(F.min),max:Tu(F.max),minLength:Tu(F.minLength),maxLength:Tu(F.maxLength),pattern:Tu(F.pattern)}:{},name:R,onChange:J,onBlur:J,ref:ae=>{if(ae){l.registerName.add(R),un(R,F),l.registerName.delete(R),B=fe(r,R);const ge=ct(ae.value)&&ae.querySelectorAll&&ae.querySelectorAll("input,select,textarea")[0]||ae,me=hJ(ge),Ee=B._f.refs||[];if(me?Ee.find(Ft=>Ft===ge):ge===B._f.ref)return;const Re={...B._f};me?(Re.refs=[...Ee.filter(w1),ge,...Array.isArray(fe(i,R))?[{}]:[]],Re.ref={type:ge.type,name:R}):(Re.ref=ge,delete Re.refs),Ot(r,R,{_f:Re}),I(R,!1,void 0,ge)}else B=fe(r,R,{}),B._f&&(B._f.mount=!1),(e.shouldUnregister||F.shouldUnregister)&&!(jM(l.array,R)&&s.action)&&l.unMount.add(R)}}},Oi=()=>e.shouldFocusError&&!e.shouldUseNativeValidation&&of(r,ue,l.mount),_r=R=>{Rr(R)&&(m.state.next({disabled:R}),of(r,(F,B)=>{const K=fe(r,B);K&&(F.disabled=K._f.disabled||R,Array.isArray(K._f.refs)&&K._f.refs.forEach(ie=>{ie.disabled=K._f.disabled||R}))},0,!1))},ft=(R,F)=>async B=>{let K,ie;B&&(B.preventDefault&&B.preventDefault(),B.persist&&B.persist());let ae=Et(o);if(m.state.next({isSubmitting:!0}),e.resolver){const{errors:ge,values:me}=await Z();S(),n.errors=ge,ae=Et(me)}else await ee({fields:r,eventType:ys.SUBMIT});if(l.disabled.size)for(const ge of l.disabled)qt(ae,ge);if(qt(n.errors,XM),Pn(n.errors)){m.state.next({errors:{}});try{K=await R(ae,B)}catch(ge){ie=ge}}else F&&await F({...n.errors},B),Oi(),setTimeout(Oi);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pn(n.errors)&&!ie,submitCount:n.submitCount+1,errors:n.errors}),ie)throw ie;return K},Kn=(R,F={})=>{fe(r,R)&&(ct(F.defaultValue)?pe(R,Et(fe(i,R))):(pe(R,F.defaultValue),Ot(i,R,Et(F.defaultValue))),F.keepTouched||qt(n.touchedFields,R),F.keepDirty||(qt(n.dirtyFields,R),n.isDirty=F.defaultValue?Q(R,Et(fe(i,R))):Q()),F.keepError||(qt(n.errors,R),b()),m.state.next({...n}))},U=(R,F={})=>{const B=R?Et(R):i,K=Et(B),ie=Pn(R),ae=K,ge=r;if(F.keepDefaultValues||(i=B),!F.keepValues){if(F.keepDirtyValues){const me=new Set([...l.mount,...JM(dl(i,o,void 0,ge),n.dirtyFields)]);for(const Ee of me){const Re=fe(n.dirtyFields,Ee),Ft=fe(o,Ee),Tr=fe(ae,Ee);Re&&!ct(Ft)?Ot(ae,Ee,Ft):!Re&&!ct(Tr)&&pe(Ee,Tr)}}else{if(aO&&ct(R))for(const me of l.mount){const Ee=fe(r,me);if(Ee&&Ee._f){const Re=Array.isArray(Ee._f.refs)?Ee._f.refs[0]:Ee._f.ref;if(Eg(Re)){const Ft=Re.closest("form");if(Ft){Ft.reset();break}}}}if(F.keepFieldsRef)for(const me of l.mount)pe(me,fe(ae,me));else r={}}if(e.shouldUnregister){if(o=F.keepDefaultValues?Et(i):{},F.keepFieldsRef)for(const me of l.mount)Ot(o,me,fe(ae,me))}else o=Et(ae);m.array.next({values:{...ae}}),m.state.next({name:void 0,type:void 0,values:{...ae}})}l={mount:F.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!F.keepIsValid||!!F.keepDirtyValues||!e.shouldUnregister&&!Pn(ae),s.watch=!!e.shouldUnregister,s.keepIsValid=!!F.keepIsValid,s.action=!1,s.actionArrayLengths.clear(),F.keepErrors||(n.errors={}),m.state.next({submitCount:F.keepSubmitCount?n.submitCount:0,isDirty:ie?!1:F.keepDirty?n.isDirty:F.keepValues?Q():!!(F.keepDefaultValues&&!pr(R,i)),isSubmitted:F.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ie?{}:F.keepDirtyValues?F.keepDefaultValues&&o?dl(i,o,void 0,ge):n.dirtyFields:F.keepDefaultValues&&R?dl(i,R,void 0,ge):F.keepDirty?n.dirtyFields:{},touchedFields:F.keepTouched?n.touchedFields:{},errors:F.keepErrors?n.errors:{},isSubmitSuccessful:F.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},re=(R,F)=>U(Xn(R)?R(o):R,{...e.resetOptions,...F}),E=(R,F={})=>{const B=fe(r,R),K=B&&B._f;if(K){const ie=K.refs?K.refs[0]:K.ref;ie.focus&&setTimeout(()=>{ie.focus(),F.shouldSelect&&Xn(ie.select)&&ie.select()})}},Me=R=>{const{name:F,type:B,values:K,...ie}=R;n={...n,...ie}};m.state.subscribe({next:Me});const Wr={control:{register:un,unregister:Tn,getFieldState:Ue,handleSubmit:ft,setError:st,_subscribe:Kt,_runSchema:Z,_updateIsValidating:S,_focusError:Oi,_getWatch:ve,_getDirty:Q,_setValid:b,_setFieldArray:w,_setDisabledField:Cr,_setErrors:P,_getFieldArray:_e,_reset:U,_resetDefaultValues:()=>Xn(e.defaultValues)&&e.defaultValues().then(R=>{re(R,e.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:oe,_disableForm:_r,_subjects:m,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(R){s=R},get _defaultValues(){return i},get _names(){return l},set _names(R){l=R},get _formState(){return n},get _options(){return e},set _options(R){e={...e,...R},f=yd(e.mode),h=yd(e.reValidateMode)}},subscribe:fr,trigger:Se,register:un,handleSubmit:ft,watch:Gt,setValue:pe,setValues:he,getValues:Ae,getErrors:Ze,reset:re,resetField:Kn,resetDefaultValues:(R,F={})=>{if(i=Et(R),!F.keepDirty){const B=dl(i,o,void 0,r);n.dirtyFields=B,n.isDirty=!Pn(B)}F.keepIsValid||b(),m.state.next({...n,defaultValues:i})},clearErrors:Qt,unregister:Tn,setError:st,setFocus:E,getFieldState:Ue};return{...Wr,formControl:Wr}}function CJ(t={}){const e=_.useRef(void 0),n=_.useRef(void 0),r=_.useRef(t.formControl),[i,o]=_.useState(()=>({...Et(iR),isLoading:Xn(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Xn(t.defaultValues)?void 0:t.defaultValues}));if(!e.current||t.formControl&&r.current!==t.formControl)if(r.current=t.formControl,t.formControl)e.current={...t.formControl,formState:i},t.defaultValues&&!Xn(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:c,...u}=kJ(t);e.current={...u,formState:i}}const s=e.current.control;s._options=t;const{resyncIfNeeded:l,snapshot:a}=uS();return cS(()=>{const c=()=>({...s._formState,defaultValues:s._defaultValues});l(!0,c,o);const u=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState,defaultValues:s._defaultValues}),reRenderRoot:!0});return o(f=>({...f,isReady:!0})),s._formState.isReady=!0,()=>{u(),a(!0,c)}},[s,l,a]),_.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),_.useEffect(()=>{t.mode&&(s._options.mode=t.mode),t.reValidateMode&&(s._options.reValidateMode=t.reValidateMode)},[s,t.mode,t.reValidateMode]),_.useEffect(()=>{t.errors&&(s._setErrors(t.errors),s._focusError())},[s,t.errors]),_.useEffect(()=>{t.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,t.shouldUnregister]),_.useEffect(()=>{if(s._proxyFormState.isDirty){const c=s._getDirty();c!==i.isDirty&&s._subjects.state.next({isDirty:c})}},[s,i.isDirty]),_.useEffect(()=>{var c;t.values&&!pr(t.values,n.current)?(s._reset(t.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((c=s._options.resetOptions)===null||c===void 0)&&c.keepIsValid||s._setValid(),n.current=t.values,o(u=>({...u}))):s._resetDefaultValues()},[s,t.values]),_.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=_.useMemo(()=>HM(i,s),[s,i]),e.current}function Du(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Lt(){return Lt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lt.apply(null,arguments)}var C1={exports:{}},_1,W2;function _J(){if(W2)return _1;W2=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _1=t,_1}var T1,H2;function TJ(){if(H2)return T1;H2=1;var t=_J();function e(){}function n(){}return n.resetWarningCache=e,T1=function(){function r(s,l,a,c,u,f){if(f!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},T1}var q2;function PJ(){return q2||(q2=1,C1.exports=TJ()()),C1.exports}var EJ=PJ();const ce=wE(EJ);var P1={exports:{}},mt={};var Y2;function $J(){if(Y2)return mt;Y2=1;var t=60103,e=60106,n=60107,r=60108,i=60114,o=60109,s=60110,l=60112,a=60113,c=60120,u=60115,f=60116,h=60121,d=60122,p=60117,g=60129,m=60131;if(typeof Symbol=="function"&&Symbol.for){var O=Symbol.for;t=O("react.element"),e=O("react.portal"),n=O("react.fragment"),r=O("react.strict_mode"),i=O("react.profiler"),o=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),a=O("react.suspense"),c=O("react.suspense_list"),u=O("react.memo"),f=O("react.lazy"),h=O("react.block"),d=O("react.server.block"),p=O("react.fundamental"),g=O("react.debug_trace_mode"),m=O("react.legacy_hidden")}function y($){if(typeof $=="object"&&$!==null){var D=$.$$typeof;switch(D){case t:switch($=$.type,$){case n:case i:case r:case a:case c:return $;default:switch($=$&&$.$$typeof,$){case s:case l:case f:case u:case o:return $;default:return D}}case e:return D}}}var x=o,b=t,S=l,v=n,w=f,k=u,P=e,T=i,M=r,I=a;return mt.ContextConsumer=s,mt.ContextProvider=x,mt.Element=b,mt.ForwardRef=S,mt.Fragment=v,mt.Lazy=w,mt.Memo=k,mt.Portal=P,mt.Profiler=T,mt.StrictMode=M,mt.Suspense=I,mt.isAsyncMode=function(){return!1},mt.isConcurrentMode=function(){return!1},mt.isContextConsumer=function($){return y($)===s},mt.isContextProvider=function($){return y($)===o},mt.isElement=function($){return typeof $=="object"&&$!==null&&$.$$typeof===t},mt.isForwardRef=function($){return y($)===l},mt.isFragment=function($){return y($)===n},mt.isLazy=function($){return y($)===f},mt.isMemo=function($){return y($)===u},mt.isPortal=function($){return y($)===e},mt.isProfiler=function($){return y($)===i},mt.isStrictMode=function($){return y($)===r},mt.isSuspense=function($){return y($)===a},mt.isValidElementType=function($){return typeof $=="string"||typeof $=="function"||$===n||$===i||$===g||$===r||$===a||$===c||$===m||typeof $=="object"&&$!==null&&($.$$typeof===f||$.$$typeof===u||$.$$typeof===o||$.$$typeof===s||$.$$typeof===l||$.$$typeof===p||$.$$typeof===h||$[0]===d)},mt.typeOf=y,mt}var U2;function AJ(){return U2||(U2=1,P1.exports=$J()),P1.exports}AJ();let G2=t=>typeof t=="object"&&t!=null&&t.nodeType===1,K2=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",E1=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){let n=getComputedStyle(t,null);return K2(n.overflowY,e)||K2(n.overflowX,e)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(t)}return!1},xd=(t,e,n,r,i,o,s,l)=>o<t&&s>e||o>t&&s<e?0:o<=t&&l<=n||s>=e&&l>=n?o-t-r:s>e&&l<n||o<t&&l>n?s-e+i:0,QJ=t=>{let e=t.parentElement;return e??(t.getRootNode().host||null)};var MJ=(t,e)=>{var n,r,i,o,s,l;if(typeof document>"u")return[];let{inline:a,boundary:c,skipOverflowHiddenElements:u}=e,f=typeof c=="function"?c:I=>I!==c;if(!G2(t))throw new TypeError("Invalid target");let h=document.scrollingElement||document.documentElement,d=[],p=t;for(;G2(p)&&f(p);){if(p=QJ(p),p===h){d.push(p);break}p!=null&&p===document.body&&E1(p)&&!E1(document.documentElement)||p!=null&&E1(p,u)&&d.push(p)}let g=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,m=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,O=(s=window.scrollX)!=null?s:pageXOffset,y=(l=window.scrollY)!=null?l:pageYOffset,{height:x,width:b,top:S,right:v,bottom:w,left:k}=t.getBoundingClientRect(),P=S,T=a==="center"?k+b/2:a==="end"?v:k,M=[];for(let I=0;I<d.length;I++){let $=d[I],{height:D,width:Z,top:G,right:z,bottom:ee,left:oe}=$.getBoundingClientRect();if(S>=0&&k>=0&&w<=m&&v<=g&&S>=G&&w<=ee&&k>=oe&&v<=z)return M;let Q=getComputedStyle($),ve=parseInt(Q.borderLeftWidth,10),_e=parseInt(Q.borderTopWidth,10),L=parseInt(Q.borderRightWidth,10),Ie=parseInt(Q.borderBottomWidth,10),Be=0,pe=0,he="offsetWidth"in $?$.offsetWidth-$.clientWidth-ve-L:0,J="offsetHeight"in $?$.offsetHeight-$.clientHeight-_e-Ie:0,ue="offsetWidth"in $?$.offsetWidth===0?0:Z/$.offsetWidth:0,Se="offsetHeight"in $?$.offsetHeight===0?0:D/$.offsetHeight:0;if(h===$)Be=xd(y,y+m,m,_e,Ie,y+P,y+P+x,x),pe=a==="start"?T:a==="center"?T-g/2:a==="end"?T-g:xd(O,O+g,g,ve,L,O+T,O+T+b,b),Be=Math.max(0,Be+y),pe=Math.max(0,pe+O);else{Be=xd(G,ee,D,_e,Ie+J,P,P+x,x),pe=a==="start"?T-oe-ve:a==="center"?T-(oe+Z/2)+he/2:a==="end"?T-z+L+he:xd(oe,z,Z,ve,L+he,T,T+b,b);let{scrollLeft:Ae,scrollTop:Ze}=$;Be=Math.max(0,Math.min(Ze+Be/Se,$.scrollHeight-D/Se+J)),pe=Math.max(0,Math.min(Ae+pe/ue,$.scrollWidth-Z/ue+he)),P+=Ze-Be,T+=Ae-pe}M.push({el:$,top:Be,left:pe})}return M},RJ=0;function oR(){}function LJ(t,e){if(t){var n=MJ(t,{boundary:e});n.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scrollTop=o,i.scrollLeft=s})}}function J2(t,e,n){var r=t===e||e instanceof n.Node&&t.contains&&t.contains(e);return r}function sR(t,e){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];r(),n=setTimeout(function(){n=null,t.apply(void 0,s)},e)}return i.cancel=r,i}function wo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return e.some(function(l){return l&&l.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function bd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){e.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function IJ(){return String(RJ++)}function DJ(t){var e=t.isOpen,n=t.resultCount,r=t.previousResultCount;return e?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function sx(t,e){return Object.keys(t).reduce(function(n,r){return n[r]=lR(e,r)?e[r]:t[r],n},{})}function lR(t,e){return t[e]!==void 0}function NJ(t){var e=t.key,n=t.keyCode;return n>=37&&n<=40&&e.indexOf("Arrow")!==0?"Arrow"+e:e}function vd(t,e,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof e!="number"||e<0||e>=n)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var l=Xf(t,s,n,r,i);return l===-1?e>=n?-1:e:l}function Xf(t,e,n,r,i){var o=r(e);if(!o||!o.hasAttribute("disabled"))return e;if(t>0){for(var s=e+1;s<n;s++)if(!r(s).hasAttribute("disabled"))return s}else for(var l=e-1;l>=0;l--)if(!r(l).hasAttribute("disabled"))return l;return i?t>0?Xf(1,0,n,r,!1):Xf(-1,n-1,n,r,!1):-1}function e5(t,e,n,r){return r===void 0&&(r=!0),e.some(function(i){return i&&(J2(i,t,n)||r&&J2(i,n.document.activeElement,n))})}var VJ=sR(function(t){aR(t).textContent=""},500);function BJ(t,e){var n=aR(e);t&&(n.textContent=t,VJ(e))}function aR(t){t===void 0&&(t=document);var e=t.getElementById("a11y-status-message");return e||(e=t.createElement("div"),e.setAttribute("id","a11y-status-message"),e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-relevant","additions text"),Object.assign(e.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),t.body.appendChild(e),e)}var FJ=["isInitialMount","highlightedIndex","items","environment"],cR={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function ZJ(t,e,n){var r=t.props,i=t.type,o={};Object.keys(e).forEach(function(s){zJ(s,t,e,n),n[s]!==e[s]&&(o[s]=n[s])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Lt({type:i},o))}function zJ(t,e,n,r){var i=e.props,o=e.type,s="on"+hS(t)+"Change";i[s]&&r[t]!==void 0&&r[t]!==n[t]&&i[s](Lt({type:o},r))}function jJ(t,e){return e.changes}function XJ(t){var e=t.selectedItem,n=t.itemToString;return e?n(e)+" has been selected.":""}var WJ=sR(function(t,e){BJ(t(),e)},200),HJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect;function qJ(t){var e=t.id,n=e===void 0?"downshift-"+IJ():e,r=t.labelId,i=t.menuId,o=t.getItemId,s=t.toggleButtonId,l=t.inputId,a=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(c){return n+"-item-"+c},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"});return a.current}function YJ(t,e,n,r){var i,o;if(t===void 0){if(e===void 0)throw new Error(r);i=n[e],o=e}else o=e===void 0?n.indexOf(t):e,i=t;return[i,o]}function UJ(t){return t?String(t):""}function hS(t){return""+t.slice(0,1).toUpperCase()+t.slice(1)}function uR(t){var e=C.useRef(t);return e.current=t,e}function GJ(t,e,n){var r=C.useRef(),i=C.useRef(),o=C.useCallback(function(h,d){i.current=d,h=sx(h,d.props);var p=t(h,d),g=d.props.stateReducer(h,Lt({},d,{changes:p}));return g},[t]),s=C.useReducer(o,e),l=s[0],a=s[1],c=uR(n),u=C.useCallback(function(h){return a(Lt({props:c.current},h))},[c]),f=i.current;return C.useEffect(function(){f&&r.current&&r.current!==l&&ZJ(f,sx(r.current,f.props),l),r.current=l},[l,n,f]),[l,u]}var sf={itemToString:UJ,stateReducer:jJ,getA11ySelectionMessage:XJ,scrollIntoView:LJ,environment:typeof window>"u"?{}:window};function to(t,e,n){n===void 0&&(n=cR);var r=t["default"+hS(e)];return r!==void 0?r:n[e]}function Sd(t,e,n){n===void 0&&(n=cR);var r=t[e];if(r!==void 0)return r;var i=t["initial"+hS(e)];return i!==void 0?i:to(t,e,n)}function KJ(t){var e=Sd(t,"selectedItem"),n=Sd(t,"isOpen"),r=Sd(t,"highlightedIndex"),i=Sd(t,"inputValue");return{highlightedIndex:r<0&&e&&n?t.items.indexOf(e):r,isOpen:n,selectedItem:e,inputValue:i}}function lf(t,e,n){var r=t.items,i=t.initialHighlightedIndex,o=t.defaultHighlightedIndex,s=e.selectedItem,l=e.highlightedIndex;return r.length===0?-1:i!==void 0&&l===i?i:o!==void 0?o:s?r.indexOf(s):n===0?-1:n<0?r.length-1:0}function JJ(t,e,n,r){var i=C.useRef({isMouseDown:!1,isTouchMove:!1});return C.useEffect(function(){if(n?.addEventListener!=null){var o=function(){i.current.isMouseDown=!0},s=function(f){i.current.isMouseDown=!1,t&&!e5(f.target,e.map(function(h){return h.current}),n)&&r()},l=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},c=function(f){t&&!i.current.isTouchMove&&!e5(f.target,e.map(function(h){return h.current}),n,!1)&&r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",s),n.addEventListener("touchstart",l),n.addEventListener("touchmove",a),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",s),n.removeEventListener("touchstart",l),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",c)}}},[t,n]),i}var eee=function(){return oR};function t5(t,e,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,s=n.environment,l=Du(n,FJ);C.useEffect(function(){r||WJ(function(){return t(Lt({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},l))},s.document)},e)}function tee(t){var e=t.highlightedIndex,n=t.isOpen,r=t.itemRefs,i=t.getItemNodeFromIndex,o=t.menuElement,s=t.scrollIntoView,l=C.useRef(!0);return HJ(function(){e<0||!n||!Object.keys(r.current).length||(l.current===!1?l.current=!0:s(i(e),o))},[e]),l}var nee=oR;function n5(t,e,n){var r;n===void 0&&(n=!0);var i=((r=t.items)==null?void 0:r.length)&&e>=0;return Lt({isOpen:!1,highlightedIndex:-1},i&&Lt({selectedItem:t.items[e],isOpen:to(t,"isOpen"),highlightedIndex:to(t,"highlightedIndex")},n&&{inputValue:t.itemToString(t.items[e])}))}function ree(t,e,n){var r=e.type,i=e.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:e.disabled?-1:e.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!t.isOpen,highlightedIndex:t.isOpen?-1:lf(i,t,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:lf(i,t,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:e.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:e.inputValue};break;case n.FunctionReset:o={highlightedIndex:to(i,"highlightedIndex"),isOpen:to(i,"isOpen"),selectedItem:to(i,"selectedItem"),inputValue:to(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Lt({},t,o)}ce.array.isRequired,ce.func,ce.func,ce.func,ce.number,ce.number,ce.number,ce.bool,ce.bool,ce.bool,ce.any,ce.any,ce.any,ce.string,ce.string,ce.string,ce.func,ce.string,ce.func,ce.func,ce.func,ce.func,ce.func,ce.shape({addEventListener:ce.func,removeEventListener:ce.func,document:ce.shape({getElementById:ce.func,activeElement:ce.any,body:ce.any})});function iee(t){var e=t.isOpen,n=t.resultCount,r=t.previousResultCount;return e?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}Gr(Gr({},sf),{getA11yStatusMessage:iee});var dS=0,pS=1,gS=2,mS=3,OS=4,yS=5,xS=6,bS=7,vS=8,Ag=9,SS=10,fR=11,hR=12,wS=13,dR=14,pR=15,gR=16,mR=17,OR=18,kS=19,yR=20,xR=21,CS=22,bR=Object.freeze({__proto__:null,InputKeyDownArrowDown:dS,InputKeyDownArrowUp:pS,InputKeyDownEscape:gS,InputKeyDownHome:mS,InputKeyDownEnd:OS,InputKeyDownPageUp:yS,InputKeyDownPageDown:xS,InputKeyDownEnter:bS,InputChange:vS,InputBlur:Ag,InputFocus:SS,MenuMouseLeave:fR,ItemMouseMove:hR,ItemClick:wS,ToggleButtonClick:dR,FunctionToggleMenu:pR,FunctionOpenMenu:gR,FunctionCloseMenu:mR,FunctionSetHighlightedIndex:OR,FunctionSelectItem:kS,FunctionSetInputValue:yR,FunctionReset:xR,ControlledPropUpdatedSelectedItem:CS});function oee(t){var e=KJ(t),n=e.selectedItem,r=e.inputValue;return r===""&&n&&t.defaultInputValue===void 0&&t.initialInputValue===void 0&&t.inputValue===void 0&&(r=t.itemToString(n)),Lt({},e,{inputValue:r})}ce.array.isRequired,ce.func,ce.func,ce.func,ce.func,ce.number,ce.number,ce.number,ce.bool,ce.bool,ce.bool,ce.any,ce.any,ce.any,ce.string,ce.string,ce.string,ce.string,ce.string,ce.string,ce.func,ce.string,ce.string,ce.func,ce.func,ce.func,ce.func,ce.func,ce.func,ce.shape({addEventListener:ce.func,removeEventListener:ce.func,document:ce.shape({getElementById:ce.func,activeElement:ce.any,body:ce.any})});function see(t,e,n){var r=C.useRef(),i=GJ(t,e,n),o=i[0],s=i[1];return C.useEffect(function(){lR(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&s({type:CS,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)},[o.selectedItem,n.selectedItem]),[sx(o,n),s]}var lee=Lt({},sf,{selectedItemChanged:function(e,n){return e!==n},getA11yStatusMessage:DJ});function aee(t,e){var n,r=e.type,i=e.props,o=e.altKey,s;switch(r){case wS:s={isOpen:to(i,"isOpen"),highlightedIndex:to(i,"highlightedIndex"),selectedItem:i.items[e.index],inputValue:i.itemToString(i.items[e.index])};break;case dS:t.isOpen?s={highlightedIndex:vd(1,t.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:s={highlightedIndex:o&&t.selectedItem==null?-1:lf(i,t,1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case pS:t.isOpen?o?s=n5(i,t.highlightedIndex):s={highlightedIndex:vd(-1,t.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:s={highlightedIndex:lf(i,t,-1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case bS:s=n5(i,t.highlightedIndex);break;case gS:s=Lt({isOpen:!1,highlightedIndex:-1},!t.isOpen&&{selectedItem:null,inputValue:""});break;case yS:s={highlightedIndex:vd(-10,t.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case xS:s={highlightedIndex:vd(10,t.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case mS:s={highlightedIndex:Xf(1,0,i.items.length,e.getItemNodeFromIndex,!1)};break;case OS:s={highlightedIndex:Xf(-1,i.items.length-1,i.items.length,e.getItemNodeFromIndex,!1)};break;case Ag:s=Lt({isOpen:!1,highlightedIndex:-1},t.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&e.selectItem&&{selectedItem:i.items[t.highlightedIndex],inputValue:i.itemToString(i.items[t.highlightedIndex])});break;case vS:s={isOpen:!0,highlightedIndex:to(i,"highlightedIndex"),inputValue:e.inputValue};break;case SS:s={isOpen:!0,highlightedIndex:lf(i,t,0)};break;case kS:s={selectedItem:e.selectedItem,inputValue:i.itemToString(e.selectedItem)};break;case CS:s={inputValue:e.inputValue};break;default:return ree(t,e,bR)}return Lt({},t,s)}var cee=["onMouseLeave","refKey","ref"],uee=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],fee=["onClick","onPress","refKey","ref"],hee=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];vR.stateChangeTypes=bR;function vR(t){t===void 0&&(t={});var e=Lt({},lee,t),n=e.initialIsOpen,r=e.defaultIsOpen,i=e.items,o=e.scrollIntoView,s=e.environment,l=e.getA11yStatusMessage,a=e.getA11ySelectionMessage,c=e.itemToString,u=oee(e),f=see(aee,u,e),h=f[0],d=f[1],p=h.isOpen,g=h.highlightedIndex,m=h.selectedItem,O=h.inputValue,y=C.useRef(null),x=C.useRef({}),b=C.useRef(null),S=C.useRef(null),v=C.useRef(!0),w=qJ(e),k=C.useRef(),P=uR({state:h,props:e}),T=C.useCallback(function(he){return x.current[w.getItemId(he)]},[w]);t5(l,[p,g,O,i],Lt({isInitialMount:v.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},h)),t5(a,[m],Lt({isInitialMount:v.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},h));var M=tee({menuElement:y.current,highlightedIndex:g,isOpen:p,itemRefs:x,scrollIntoView:o,getItemNodeFromIndex:T});nee({isInitialMount:v.current}),C.useEffect(function(){var he=n||r||p;he&&b.current&&b.current.focus()},[]),C.useEffect(function(){v.current||(k.current=i.length)});var I=JJ(p,[b,y,S],s,function(){d({type:Ag,selectItem:!1})}),$=eee();C.useEffect(function(){return v.current=!1,function(){v.current=!0}},[]),C.useEffect(function(){var he;if(!p)x.current={};else if(((he=s.document)==null?void 0:he.activeElement)!==b.current){var J;b==null||(J=b.current)==null||J.focus()}},[p,s]);var D=C.useMemo(function(){return{ArrowDown:function(J){J.preventDefault(),d({type:dS,altKey:J.altKey,getItemNodeFromIndex:T})},ArrowUp:function(J){J.preventDefault(),d({type:pS,altKey:J.altKey,getItemNodeFromIndex:T})},Home:function(J){P.current.state.isOpen&&(J.preventDefault(),d({type:mS,getItemNodeFromIndex:T}))},End:function(J){P.current.state.isOpen&&(J.preventDefault(),d({type:OS,getItemNodeFromIndex:T}))},Escape:function(J){var ue=P.current.state;(ue.isOpen||ue.inputValue||ue.selectedItem||ue.highlightedIndex>-1)&&(J.preventDefault(),d({type:gS}))},Enter:function(J){var ue=P.current.state;!ue.isOpen||J.which===229||(J.preventDefault(),d({type:bS,getItemNodeFromIndex:T}))},PageUp:function(J){P.current.state.isOpen&&(J.preventDefault(),d({type:yS,getItemNodeFromIndex:T}))},PageDown:function(J){P.current.state.isOpen&&(J.preventDefault(),d({type:xS,getItemNodeFromIndex:T}))}}},[d,P,T]),Z=C.useCallback(function(he){return Lt({id:w.labelId,htmlFor:w.inputId},he)},[w]),G=C.useCallback(function(he,J){var ue,Se=he===void 0?{}:he,Ae=Se.onMouseLeave,Ze=Se.refKey,Ue=Ze===void 0?"ref":Ze,Qt=Se.ref,st=Du(Se,cee),Gt=J===void 0?{}:J;return Gt.suppressRefError,Lt((ue={},ue[Ue]=bd(Qt,function(Kt){y.current=Kt}),ue.id=w.menuId,ue.role="listbox",ue["aria-labelledby"]=st&&st["aria-label"]?void 0:""+w.labelId,ue.onMouseLeave=wo(Ae,function(){d({type:fR})}),ue),st)},[d,$,w]),z=C.useCallback(function(he){var J,ue,Se=he===void 0?{}:he,Ae=Se.item,Ze=Se.index,Ue=Se.refKey,Qt=Ue===void 0?"ref":Ue,st=Se.ref,Gt=Se.onMouseMove,Kt=Se.onMouseDown,fr=Se.onClick;Se.onPress;var Tn=Se.disabled,Cr=Du(Se,uee),un=P.current,Oi=un.props,_r=un.state,ft=YJ(Ae,Ze,Oi.items,"Pass either item or index to getItemProps!"),Kn=ft[1],U="onClick",re=fr,E=function(){Kn!==_r.highlightedIndex&&(M.current=!1,d({type:hR,index:Kn,disabled:Tn}))},Me=function(){d({type:wS,index:Kn})},We=function(Wr){return Wr.preventDefault()};return Lt((J={},J[Qt]=bd(st,function(kt){kt&&(x.current[w.getItemId(Kn)]=kt)}),J.disabled=Tn,J.role="option",J["aria-selected"]=""+(Kn===_r.highlightedIndex),J.id=w.getItemId(Kn),J),!Tn&&(ue={},ue[U]=wo(re,Me),ue),{onMouseMove:wo(Gt,E),onMouseDown:wo(Kt,We)},Cr)},[d,P,M,w]),ee=C.useCallback(function(he){var J,ue=he===void 0?{}:he,Se=ue.onClick;ue.onPress;var Ae=ue.refKey,Ze=Ae===void 0?"ref":Ae,Ue=ue.ref,Qt=Du(ue,fee),st=P.current.state,Gt=function(){d({type:dR})};return Lt((J={},J[Ze]=bd(Ue,function(Kt){S.current=Kt}),J["aria-controls"]=w.menuId,J["aria-expanded"]=st.isOpen,J.id=w.toggleButtonId,J.tabIndex=-1,J),!Qt.disabled&&Lt({},{onClick:wo(Se,Gt)}),Qt)},[d,P,w]),oe=C.useCallback(function(he,J){var ue,Se=he===void 0?{}:he,Ae=Se.onKeyDown,Ze=Se.onChange,Ue=Se.onInput,Qt=Se.onFocus,st=Se.onBlur;Se.onChangeText;var Gt=Se.refKey,Kt=Gt===void 0?"ref":Gt,fr=Se.ref,Tn=Du(Se,hee),Cr=J===void 0?{}:J;Cr.suppressRefError;var un=P.current.state,Oi=function(We){var kt=NJ(We);kt&&D[kt]&&D[kt](We)},_r=function(We){d({type:vS,inputValue:We.target.value})},ft=function(We){if(un.isOpen&&!I.current.isMouseDown){var kt=We.relatedTarget===null&&s.document.activeElement!==s.document.body;d({type:Ag,selectItem:!kt})}},Kn=function(){un.isOpen||d({type:SS})},U="onChange",re={};if(!Tn.disabled){var E;re=(E={},E[U]=wo(Ze,Ue,_r),E.onKeyDown=wo(Ae,Oi),E.onBlur=wo(st,ft),E.onFocus=wo(Qt,Kn),E)}return Lt((ue={},ue[Kt]=bd(fr,function(Me){b.current=Me}),ue["aria-activedescendant"]=un.isOpen&&un.highlightedIndex>-1?w.getItemId(un.highlightedIndex):"",ue["aria-autocomplete"]="list",ue["aria-controls"]=w.menuId,ue["aria-expanded"]=un.isOpen,ue["aria-labelledby"]=Tn&&Tn["aria-label"]?void 0:""+w.labelId,ue.autoComplete="off",ue.id=w.inputId,ue.role="combobox",ue.value=un.inputValue,ue),re,Tn)},[$,P,w,D,d,I,s]),Q=C.useCallback(function(){d({type:pR})},[d]),ve=C.useCallback(function(){d({type:mR})},[d]),_e=C.useCallback(function(){d({type:gR})},[d]),L=C.useCallback(function(he){d({type:OR,highlightedIndex:he})},[d]),Ie=C.useCallback(function(he){d({type:kS,selectedItem:he})},[d]),Be=C.useCallback(function(he){d({type:yR,inputValue:he})},[d]),pe=C.useCallback(function(){d({type:xR})},[d]);return{getItemProps:z,getLabelProps:Z,getMenuProps:G,getInputProps:oe,getToggleButtonProps:ee,toggleMenu:Q,openMenu:_e,closeMenu:ve,setHighlightedIndex:L,setInputValue:Be,selectItem:Ie,reset:pe,highlightedIndex:g,isOpen:p,selectedItem:m,inputValue:O}}ce.array,ce.array,ce.array,ce.func,ce.func,ce.func,ce.number,ce.number,ce.number,ce.func,ce.func,ce.string,ce.string,ce.shape({addEventListener:ce.func,removeEventListener:ce.func,document:ce.shape({getElementById:ce.func,activeElement:ce.any,body:ce.any})});sf.itemToString,sf.stateReducer,sf.environment;const r5=20,dee=t=>t.suggestions.length>0?_.createElement(pee,{...t}):_.createElement("input",{className:xe.textInput,size:40,autoFocus:!0,...t.register(t.inputName)}),pee=({autofocus:t,suggestions:e,control:n,inputName:r,placeholder:i,initialInputValue:o,setValue:s})=>{const[l,a]=_.useState(e.slice(0,r5)),c=wn(Bn),u=e.length>0,{isOpen:f,getToggleButtonProps:h,getMenuProps:d,getInputProps:p,highlightedIndex:g,getItemProps:m,selectedItem:O}=vR({initialInputValue:o,onInputValueChange({inputValue:x=""}){s(r,x),x=x.toLowerCase()||"";const b=[];for(const S of e)if(S.toLowerCase().includes(x)&&(b.push(S),b.length>=r5))break;a(b)},items:l,itemToString(x){return x??""}}),y=f&&l.length>0;return _.createElement("div",{className:xe.downshiftAutocompleteContainer},_.createElement("div",{"data-visible-dropdown":y,className:xe.downshiftInputWrapper},_.createElement(sJ,{name:r,control:n,render:({field:x})=>{const b=p();return _.createElement("input",{...b,name:x.name,placeholder:i,className:xe.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:t})}}),u&&_.createElement("button",{"aria-label":"toggle menu",type:"button",...h()},c("arrow_drop_down"))),_.createElement("div",{className:xe.downshiftAutocompleteContainer},_.createElement("ul",{...d(),"data-visible":y},l.map((x,b)=>_.createElement("li",{"data-selected":O===x,"data-highlighted":g===b,key:`${x}${b}`,...m({item:x,index:b})},x)))))},gee={testNode:"blockquote",visitNode({actions:t}){t.addAndStepInto(ma())}},mee={testLexicalNode:py,visitLexicalNode:({actions:t})=>{t.addAndStepInto("blockquote")}},Oee=Zr({init(t){t.pubIn({[Yc]:"quote",[es]:gee,[tl]:Fm,[nl]:mee})}});function i5(){let t=El;return{publish:()=>{t()},subscribe:e=>{t=e}}}function SR(t,e,n,r){const i=[...t].sort((s,l)=>l.priority-s.priority),o=n??"";return i.find(s=>s.match(e??"",o))??i.find(s=>s.match(r??"",o))}var yee=Object.defineProperty,xee=(t,e,n)=>e in t?yee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gs=(t,e,n)=>xee(t,typeof e!="symbol"?e+"":e,n);class ou extends Fc{constructor(e,n,r,i){super(i),gs(this,"__code"),gs(this,"__meta"),gs(this,"__language"),gs(this,"__focusEmitter",i5()),gs(this,"setCode",o=>{o!==this.__code&&(this.getWritable().__code=o)}),gs(this,"setMeta",o=>{o!==this.__meta&&(this.getWritable().__meta=o)}),gs(this,"setLanguage",o=>{o!==this.__language&&(this.getWritable().__language=o)}),gs(this,"select",()=>{this.__focusEmitter.publish()}),this.__code=e,this.__meta=r,this.__language=n}static getType(){return"codeblock"}static clone(e){return new ou(e.__code,e.__language,e.__meta,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__code=e.__code,this.__meta=e.__meta,this.__language=e.__language,this.__focusEmitter=i5()}static importJSON(e){const n=typeof e.code=="string"?e.code:"",r=typeof e.language=="string"?e.language:"",i=typeof e.meta=="string"?e.meta:"";return Vh({code:n,language:r,meta:i})}static importDOM(){return{pre:()=>({conversion:wee,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:"codeblock",version:1}}createDOM(e,n){return document.createElement("div")}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(e){return _.createElement(vee,{parentEditor:e,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}}const wR=_.createContext(null),bee=({parentEditor:t,lexicalNode:e,children:n})=>{const r=_.useMemo(()=>({lexicalNode:e,parentEditor:t,setCode:i=>{t.update(()=>{e.setCode(i),setTimeout(()=>{t.dispatchCommand(If,void 0)},0)})},setLanguage:i=>{t.update(()=>{e.setLanguage(i)})},setMeta:i=>{t.update(()=>{e.setMeta(i)})}}),[e,t]);return _.createElement(wR.Provider,{value:r},n)};function lx(){const t=_.useContext(wR);if(!t)throw new Error("useCodeBlockEditor must be used within a CodeBlockEditor");return t}const vee=t=>{const e=wn($h),n=wn(kc),r=SR(e,t.language,t.meta,n);if(!r)throw new Error(`No CodeBlockEditor registered for language=${t.language} meta=${t.meta}`);const i=r.Editor,{codeBlockNode:o,parentEditor:s,...l}=t;return _.createElement(bee,{parentEditor:t.parentEditor,lexicalNode:t.codeBlockNode},_.createElement(i,{...l}))};function Vh(t){const{code:e="",language:n="",meta:r=""}=t;return new ou(e,n,r)}function See(t){return t instanceof ou}function wee(t){const e=t,n=e.textContent,r=t.getAttribute("class")??"",i=t.getAttribute("data-language")??"",o=/language-(\w+)/.exec(r),s=o?o[1]:i,l=e.getAttribute("data-meta")??"";return{node:Vh({code:n,language:s,meta:l})}}const kee={testLexicalNode:See,visitLexicalNode:({lexicalNode:t,actions:e})=>{e.addAndStepInto("code",{value:t.getCode(),lang:t.getLanguage(),meta:t.getMeta()})}},Cee={testNode:(t,{codeBlockEditorDescriptors:e,defaultCodeBlockLanguage:n})=>t.type==="code"?SR(e,t.lang,t.meta,n)!==void 0:!1,visitNode({mdastNode:t,actions:e}){e.addAndStepInto(Vh({code:t.value,language:t.lang??"",meta:t.meta??""}))}},_S=Nn(t=>{t.link(t.pipe(_S,rn(kc),Rl(([e,n])=>()=>Vh({language:n,...e}))),Ev)}),_ee=Un($h),Tee=Zr({update(t,e){t.pub(kc,e?.defaultCodeBlockLanguage??"")},init(t,e){t.pubIn({[Yc]:"codeblock",[kc]:e?.defaultCodeBlockLanguage??"",[$h]:e?.codeBlockEditorDescriptors??[],[es]:Cee,[tl]:ou,[nl]:kee})}}),kR=1024;let Pee=0,Kr=class{constructor(e,n){this.from=e,this.to=n}};class Ve{constructor(e={}){this.id=Pee++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=an.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Ve.closedBy=new Ve({deserialize:t=>t.split(" ")});Ve.openedBy=new Ve({deserialize:t=>t.split(" ")});Ve.group=new Ve({deserialize:t=>t.split(" ")});Ve.isolate=new Ve({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ve.contextHash=new Ve({perNode:!0});Ve.lookAhead=new Ve({perNode:!0});Ve.mounted=new Ve({perNode:!0});class oc{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Ve.mounted.id]}}const Eee=Object.create(null);class an{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):Eee,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new an(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Ve.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Ve.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}an.none=new an("",Object.create(null),0,8);class su{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);if(s){i||(i=Object.assign({},r.props));let l=s[1],a=s[0];a.combine&&a.id in i&&(l=a.combine(i[a.id],l)),i[a.id]=l}}n.push(i?new an(r.name,i,r.id,r.flags):r)}return new su(n)}}const wd=new WeakMap,o5=new WeakMap;var dt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(dt||(dt={}));class Ye{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,l]of o)this.props[typeof s=="number"?s:s.id]=l}}toString(){let e=oc.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Qg(this.topNode,e)}cursorAt(e,n=0,r=0){let i=wd.get(this)||this.topNode,o=new Qg(i);return o.moveTo(e,n),wd.set(this,o._tree),o}get topNode(){return new Yn(this,0,0,null)}resolve(e,n=0){let r=Wf(wd.get(this)||this.topNode,e,n,!1);return wd.set(this,r),r}resolveInner(e,n=0){let r=Wf(o5.get(this)||this.topNode,e,n,!0);return o5.set(this,r),r}resolveStack(e,n=0){return Qee(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,l=(s&dt.IncludeAnonymous)>0;for(let a=this.cursor(s|dt.IncludeAnonymous);;){let c=!1;if(a.from<=o&&a.to>=i&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:ES(an.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Ye(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Ye(an.none,n,r,i)))}static build(e){return Mee(e)}}Ye.empty=new Ye(an.none,[],[],0);class TS{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new TS(this.buffer,this.index)}}class zs{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return an.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,l=-1;for(let a=e;a!=n&&!(CR(o,i,s[a+1],s[a+2])&&(l=a,r>0));a=s[a+3]);return l}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let l=e,a=0;l<n;){o[a++]=i[l++],o[a++]=i[l++]-r;let c=o[a++]=i[l++]-r;o[a++]=i[l++]-e,s=Math.max(s,c)}return new zs(o,s,this.set)}}function CR(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Wf(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Yn&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:dt.IgnoreOverlays;if(r)for(let s=t,l=s.parent;l;s=l,l=s.parent)s instanceof Yn&&s.index<0&&((i=l.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=l);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class _R{cursor(e=0){return new Qg(this,e)}getChild(e,n=null,r=null){let i=s5(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return s5(this,e,n,r)}resolve(e,n=0){return Wf(this,e,n,!1)}resolveInner(e,n=0){return Wf(this,e,n,!0)}matchContext(e){return ax(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Yn extends _R{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let s=this;;){for(let{children:l,positions:a}=s._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+s.from,h;if(!(!(o&dt.EnterBracketed&&u instanceof Ye&&(h=oc.get(u))&&!h.overlay&&h.bracketed&&r>=f&&r<=f+u.length)&&!CR(i,r,f,f+u.length))){if(u instanceof zs){if(o&dt.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new no(new $ee(s,u,e,f),null,d)}else if(o&dt.IncludeAnonymous||!u.type.isAnonymous||PS(u)){let d;if(!(o&dt.IgnoreMounts)&&(d=oc.get(u))&&!d.overlay)return new Yn(d.tree,f,e,s);let p=new Yn(u,f,e,s);return o&dt.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i,o)}}}if(o&dt.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&dt.IgnoreOverlays)&&(i=oc.get(this._tree))&&i.overlay){let o=e-this.from,s=r&dt.EnterBracketed&&i.bracketed;for(let{from:l,to:a}of i.overlay)if((n>0||s?l<=o:l<o)&&(n<0||s?a>=o:a>o))return new Yn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function s5(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function ax(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class $ee{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class no extends _R{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new no(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&dt.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new no(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new no(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new no(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new Ye(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function TR(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>n.from||s.to<n.to)&&(n=s,e=o)}let r=n instanceof Yn&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new Aee(i,n)}class Aee{constructor(e,n){this.heads=e,this.node=n}get next(){return TR(this.heads)}}function Qee(t,e,n){let r=t.resolveInner(e,n),i=null;for(let o=r instanceof Yn?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(e,n)),o=s}else{let s=oc.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let l=new Yn(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(Wf(l,e,n,!1))}}return i?TR(i):r}class Qg{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~dt.EnterBracketed,e instanceof Yn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Yn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&dt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&dt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let l=r._tree.children[o];if(this.mode&dt.IncludeAnonymous||l instanceof zs||!l.type.isAnonymous||PS(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new no(this.buffer,n,this.stack[i]);return this.bufferNode=new no(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return ax(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return ax(this._tree,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function PS(t){return t.children.some(e=>e instanceof zs||!e.type.isAnonymous||PS(e))}function Mee(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=kR,reused:o=[],minRepeatType:s=r.types.length}=t,l=Array.isArray(n)?new TS(n,n.length):n,a=r.types,c=0,u=0;function f(S,v,w,k,P,T){let{id:M,start:I,end:$,size:D}=l,Z=u,G=c;if(D<0)if(l.next(),D==-1){let ve=o[M];w.push(ve),k.push(I-S);return}else if(D==-3){c=M;return}else if(D==-4){u=M;return}else throw new RangeError(`Unrecognized record size: ${D}`);let z=a[M],ee,oe,Q=I-S;if($-I<=i&&(oe=m(l.pos-v,P))){let ve=new Uint16Array(oe.size-oe.skip),_e=l.pos-oe.size,L=ve.length;for(;l.pos>_e;)L=O(oe.start,ve,L);ee=new zs(ve,$-oe.start,r),Q=oe.start-S}else{let ve=l.pos-D;l.next();let _e=[],L=[],Ie=M>=s?M:-1,Be=0,pe=$;for(;l.pos>ve;)Ie>=0&&l.id==Ie&&l.size>=0?(l.end<=pe-i&&(p(_e,L,I,Be,l.end,pe,Ie,Z,G),Be=_e.length,pe=l.end),l.next()):T>2500?h(I,ve,_e,L):f(I,ve,_e,L,Ie,T+1);if(Ie>=0&&Be>0&&Be<_e.length&&p(_e,L,I,Be,I,pe,Ie,Z,G),_e.reverse(),L.reverse(),Ie>-1&&Be>0){let he=d(z,G);ee=ES(z,_e,L,0,_e.length,0,$-I,he,he)}else ee=g(z,_e,L,$-I,Z-$,G)}w.push(ee),k.push(Q)}function h(S,v,w,k){let P=[],T=0,M=-1;for(;l.pos>v;){let{id:I,start:$,end:D,size:Z}=l;if(Z>4)l.next();else{if(M>-1&&$<M)break;M<0&&(M=D-i),P.push(I,$,D),T++,l.next()}}if(T){let I=new Uint16Array(T*4),$=P[P.length-2];for(let D=P.length-3,Z=0;D>=0;D-=3)I[Z++]=P[D],I[Z++]=P[D+1]-$,I[Z++]=P[D+2]-$,I[Z++]=Z;w.push(new zs(I,P[2]-$,r)),k.push($-S)}}function d(S,v){return(w,k,P)=>{let T=0,M=w.length-1,I,$;if(M>=0&&(I=w[M])instanceof Ye){if(!M&&I.type==S&&I.length==P)return I;($=I.prop(Ve.lookAhead))&&(T=k[M]+I.length+$)}return g(S,w,k,P,T,v)}}function p(S,v,w,k,P,T,M,I,$){let D=[],Z=[];for(;S.length>k;)D.push(S.pop()),Z.push(v.pop()+w-P);S.push(g(r.types[M],D,Z,T-P,I-T,$)),v.push(P-w)}function g(S,v,w,k,P,T,M){if(T){let I=[Ve.contextHash,T];M=M?[I].concat(M):[I]}if(P>25){let I=[Ve.lookAhead,P];M=M?[I].concat(M):[I]}return new Ye(S,v,w,k,M)}function m(S,v){let w=l.fork(),k=0,P=0,T=0,M=w.end-i,I={size:0,start:0,skip:0};e:for(let $=w.pos-S;w.pos>$;){let D=w.size;if(w.id==v&&D>=0){I.size=k,I.start=P,I.skip=T,T+=4,k+=4,w.next();continue}let Z=w.pos-D;if(D<0||Z<$||w.start<M)break;let G=w.id>=s?4:0,z=w.start;for(w.next();w.pos>Z;){if(w.size<0)if(w.size==-3||w.size==-4)G+=4;else break e;else w.id>=s&&(G+=4);w.next()}P=z,k+=D,T+=G}return(v<0||k==S)&&(I.size=k,I.start=P,I.skip=T),I.size>4?I:void 0}function O(S,v,w){let{id:k,start:P,end:T,size:M}=l;if(l.next(),M>=0&&k<s){let I=w;if(M>4){let $=l.pos-(M-4);for(;l.pos>$;)w=O(S,v,w)}v[--w]=I,v[--w]=T-S,v[--w]=P-S,v[--w]=k}else M==-3?c=k:M==-4&&(u=k);return w}let y=[],x=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new Ye(a[t.topID],y.reverse(),x.reverse(),b)}const l5=new WeakMap;function Ep(t,e){if(!t.isAnonymous||e instanceof zs||e.type!=t)return 1;let n=l5.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Ye)){n=1;break}n+=Ep(t,r)}l5.set(e,n)}return n}function ES(t,e,n,r,i,o,s,l,a){let c=0;for(let p=r;p<i;p++)c+=Ep(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(p,g,m,O,y){for(let x=m;x<O;){let b=x,S=g[x],v=Ep(t,p[x]);for(x++;x<O;x++){let w=Ep(t,p[x]);if(v+w>=u)break;v+=w}if(x==b+1){if(v>u){let w=p[b];d(w.children,w.positions,0,w.children.length,g[b]+y);continue}f.push(p[b])}else{let w=g[x-1]+p[x-1].length-S;f.push(ES(t,p,g,b,x,S,w,null,a))}h.push(S+y-o)}}return d(e,n,r,i,0),(l||a)(f,h,s)}class PR{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof no?this.setBuffer(e.context.buffer,e.index,n):e instanceof Yn&&this.map.set(e.tree,n)}get(e){return e instanceof no?this.getBuffer(e.context.buffer,e.index):e instanceof Yn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class jo{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new jo(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=r)for(;s&&s.from<f;){let h=s;if(a>=h.from||f<=h.to||c){let d=Math.max(h.from,a)-c,p=Math.min(h.to,f)-c;h=d>=p?null:new jo(d,p,h.tree,h.offset+c,l>0,!!u)}if(h&&i.push(h),s.to>f)break;s=o<e.length?e[o++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return i}}class cO{startParse(e,n,r){return typeof e=="string"&&(e=new Ree(e)),r=r?r.length?r.map(i=>new Kr(i.from,i.to)):[new Kr(0,0)]:[new Kr(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class Ree{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function ER(t){return(e,n,r,i)=>new Iee(e,t,n,r,i)}class a5{constructor(e,n,r,i,o,s){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=o,this.from=s}}function c5(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Lee{constructor(e,n,r,i,o,s,l,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.bracketed=s,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const cx=new Ve({perNode:!0});class Iee{constructor(e,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Ye(r.type,r.children,r.positions,r.length,r.propValues.concat([[cx,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Ve.mounted.id]=new oc(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new Vee(this.fragments),n=null,r=null,i=new Qg(new Yn(this.baseTree,this.ranges[0].from,0,null),dt.IncludeAnonymous|dt.IgnoreMounts);e:for(let o,s;;){let l=!0,a;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)l=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let f=u.from+c.pos,h=u.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(d=>d.from<h&&d.to>f)&&n.ranges.push({from:f,to:h})}}l=!1}else if(r&&(s=Dee(r.ranges,i.from,i.to)))l=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||(Nee(i),n&&n.depth++,r&&r.depth++);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")n=new Lee(o.parser,o.overlay,c,this.inner.length,i.from,!!o.bracketed,i.tree,n);else{let u=h5(this.ranges,o.overlay||(i.from<i.to?[new Kr(i.from,i.to)]:[]));u.length&&c5(u),(u.length||!o.overlay)&&this.inner.push(new a5(o.parser,u.length?o.parser.startParse(this.input,d5(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(f=>new Kr(f.from-i.from,f.to-i.from)):null,!!o.bracketed,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):l=!1}}else if(n&&(a=n.predicate(i))&&(a===!0&&(a=new Kr(i.from,i.to)),a.from<a.to)){let c=n.ranges.length-1;c>=0&&n.ranges[c].to==a.from?n.ranges[c]={from:n.ranges[c].from,to:a.to}:n.ranges.push(a)}if(l&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=h5(this.ranges,n.ranges);c.length&&(c5(c),this.inner.splice(n.index,0,new a5(n.parser,n.parser.startParse(this.input,d5(n.mounts,c),c),n.ranges.map(u=>new Kr(u.from-n.start,u.to-n.start)),n.bracketed,n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function Dee(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function u5(t,e,n,r,i,o){if(e<n){let s=t.buffer[e+1];r.push(t.slice(e,n,s)),i.push(s-o)}}function Nee(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(r),s=i.children[o],l=s.buffer,a=[o];function c(u,f,h,d,p,g){let m=n[g],O=[],y=[];u5(s,u,m,O,y,d);let x=l[m+1],b=l[m+2];a.push(O.length);let S=g?c(m+4,l[m+3],s.set.types[l[m]],x,b-x,g-1):e.toTree();return O.push(S),y.push(x-d),u5(s,l[m+3],f,O,y,d),new Ye(h,O,y,p)}i.children[o]=c(0,l.length,an.none,0,s.length,n.length-1);for(let u of a){let f=t.tree.children[u],h=t.tree.positions[u];t.yield(new Yn(f,h+t.from,u,t._tree))}}class f5{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(dt.IncludeAnonymous|dt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)if(!(n.to>=e&&n.enter(r,1,dt.IgnoreOverlays|dt.ExcludeBuffers)))if(n.to<=e)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Ye)n=n.children[0];else break}return!1}}let Vee=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(cx))!==null&&n!==void 0?n:r.to,this.inner=new f5(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(cx))!==null&&e!==void 0?e:n.to,this.inner=new f5(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(Ve.mounted);if(s&&s.parser==n)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=o.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:o.from-a.offset,mount:s})}}}return i}};function h5(t,e){let n=null,r=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,l=t[i].from;for(;o<r.length;o++){let a=r[o];if(a.from>=l)break;a.to<=s||(n||(r=n=e.slice()),a.from<s?(n[o]=new Kr(a.from,s),a.to>l&&n.splice(o+1,0,new Kr(l,a.to))):a.to>l?n[o--]=new Kr(l,a.to):n.splice(o--,1))}}return r}function Bee(t,e,n,r){let i=0,o=0,s=!1,l=!1,a=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,f=o==e.length?1e9:l?e[o].to:e[o].from;if(s!=l){let h=Math.max(a,n),d=Math.min(u,f,r);h<d&&c.push(new Kr(h,d))}if(a=Math.min(u,f),a==1e9)break;u==a&&(s?(s=!1,i++):s=!0),f==a&&(l?(l=!1,o++):l=!0)}return c}function d5(t,e){let n=[];for(let{pos:r,mount:i,frag:o}of t){let s=r+(i.overlay?i.overlay[0].from:0),l=s+i.tree.length,a=Math.max(o.from,s),c=Math.min(o.to,l);if(i.overlay){let u=i.overlay.map(h=>new Kr(h.from+r,h.to+r)),f=Bee(e,u,a,c);for(let h=0,d=a;;h++){let p=h==f.length,g=p?c:f[h].from;if(g>d&&n.push(new jo(d,g,i.tree,-s,o.from>=d||o.openStart,o.to<=g||o.openEnd)),p)break;d=f[h].to}}else n.push(new jo(a,c,i.tree,-s,o.from>=s||o.openStart,o.to<=l||o.openEnd))}return n}let ux=[],$R=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,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c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?$R:ux).push(n=n+t[e])})();function Fee(t){if(t<768)return!1;for(let e=0,n=ux.length;;){let r=e+n>>1;if(t<ux[r])n=r;else if(t>=$R[r])e=r+1;else return!0;if(e==n)return!1}}function p5(t){return t>=127462&&t<=127487}const g5=8205;function Zee(t,e,n=!0,r=!0){return(n?AR:zee)(t,e,r)}function AR(t,e,n){if(e==t.length)return e;e&&QR(t.charCodeAt(e))&&MR(t.charCodeAt(e-1))&&e--;let r=$1(t,e);for(e+=m5(r);e<t.length;){let i=$1(t,e);if(r==g5||i==g5||n&&Fee(i))e+=m5(i),r=i;else if(p5(i)){let o=0,s=e-2;for(;s>=0&&p5($1(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function zee(t,e,n){for(;e>1;){let r=AR(t,e-2,n);if(r<e)return r;e--}return 0}function $1(t,e){let n=t.charCodeAt(e);if(!MR(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return QR(r)?(n-55296<<10)+(r-56320)+65536:n}function QR(t){return t>=56320&&t<57344}function MR(t){return t>=55296&&t<56320}function m5(t){return t<65536?1:2}class rt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Cc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Yi.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Cc(this,e,n);let r=[];return this.decompose(e,n,r,0),Yi.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new af(this),o=new af(e);for(let s=n,l=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new af(this,e)}iterRange(e,n=this.length){return new RR(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new LR(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?rt.empty:e.length<=32?new Yt(e):Yi.from(Yt.split(e,[]))}}class Yt extends rt{constructor(e,n=jee(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],l=i+s.length;if((n?r:l)>=e)return new Xee(i,l,r,s);i=l+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Yt(O5(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),l=$p(o.text,s.text.slice(),0,o.length);if(l.length<=32)r.push(new Yt(l,s.length+o.length));else{let a=l.length>>1;r.push(new Yt(l.slice(0,a)),new Yt(l.slice(a)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Yt))return super.replace(e,n,r);[e,n]=Cc(this,e,n);let i=$p(this.text,$p(r.text,O5(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Yt(i,o):Yi.from(Yt.split(i,[]),o)}sliceString(e,n=this.length,r=`
|
|
104
|
-
`){[e,n]=Cc(this,e,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let l=this.text[s],a=o+l.length;o>e&&s&&(i+=r),e<a&&n>o&&(i+=l.slice(Math.max(0,e-o),n-o)),o=a+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Yt(r,i)),r=[],i=-1);return i>-1&&n.push(new Yt(r,i)),n}}class Yi extends rt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],l=i+s.length,a=r+s.lines-1;if((n?a:l)>=e)return s.lineInner(e,n,r,i);i=l+1,r=a+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let l=this.children[o],a=s+l.length;if(e<=a&&n>=s){let c=i&((s<=e?1:0)|(a>=n?2:0));s>=e&&a<=n&&!c?r.push(l):l.decompose(e-s,n-s,r,c)}s=a+1}}replace(e,n,r){if([e,n]=Cc(this,e,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],l=o+s.length;if(e>=o&&n<=l){let a=s.replace(e-o,n-o,r),c=this.lines-s.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[i]=a,new Yi(u,this.length-(n-e)+r.length)}return super.replace(o,l,a)}o=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
105
|
-
`){[e,n]=Cc(this,e,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let l=this.children[o],a=s+l.length;s>e&&o&&(i+=r),e<a&&n>s&&(i+=l.sliceString(e-s,n-s,r)),s=a+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Yi))return 0;let r=0,[i,o,s,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==l)return r;let a=this.children[i],c=e.children[o];if(a!=c)return r+a.scanIdentical(c,n);r+=a.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let p of e)p.flatten(d);return new Yt(d,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,l=[],a=0,c=-1,u=[];function f(d){let p;if(d.lines>o&&d instanceof Yi)for(let g of d.children)f(g);else d.lines>s&&(a>s||!a)?(h(),l.push(d)):d instanceof Yt&&a&&(p=u[u.length-1])instanceof Yt&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new Yt(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&h(),a+=d.lines,c+=d.length+1,u.push(d))}function h(){a!=0&&(l.push(u.length==1?u[0]:Yi.from(u,c)),c=-1,a=u.length=0)}for(let d of e)f(d);return h(),l.length==1?l[0]:new Yi(l,n)}}rt.empty=new Yt([""],0);function jee(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $p(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=r;o++){let l=t[o],a=i+l.length;a>=n&&(a>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),s?(e[e.length-1]+=l,s=!1):e.push(l)),i=a+1}return e}function O5(t,e,n){return $p(t,[""],e,n)}class af{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Yt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,l=i instanceof Yt?i.text.length:i.children.length;if(s==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
106
|
-
`,this;e--}else if(i instanceof Yt){let a=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[s+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof Yt?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class RR{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new af(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LR{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(rt.prototype[Symbol.iterator]=function(){return this.iter()},af.prototype[Symbol.iterator]=RR.prototype[Symbol.iterator]=LR.prototype[Symbol.iterator]=function(){return this});let Xee=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function Cc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Sn(t,e,n=!0,r=!0){return Zee(t,e,n,r)}function Wee(t){return t>=56320&&t<57344}function Hee(t){return t>=55296&&t<56320}function gr(t,e){let n=t.charCodeAt(e);if(!Hee(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Wee(r)?(n-55296<<10)+(r-56320)+65536:n}function $S(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ui(t){return t<65536?1:2}const fx=/\r\n?|\n/;var Mn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Mn||(Mn={}));class lo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(e(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(e,n=!1){hx(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new lo(e)}composeDesc(e){return this.empty?e:e.empty?this:IR(this,e)}mapDesc(e,n=!1){return e.empty?this:dx(this,e,n)}mapPos(e,n=-1,r=Mn.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let l=this.sections[s++],a=this.sections[s++],c=i+l;if(a<0){if(c>e)return o+(e-i);o+=l}else{if(r!=Mn.Simple&&c>=e&&(r==Mn.TrackDel&&i<e&&c>e||r==Mn.TrackBefore&&i<e||r==Mn.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==i||n<0?o:o+a;o+=a}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],l=i+o;if(s>=0&&i<=n&&l>=e)return i<e&&l>n?"cover":!0;i=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new lo(e)}static create(e){return new lo(e)}}class tn extends lo{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return hx(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return dx(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],l=n[i+1];if(l>=0){n[i]=l,n[i+1]=s;let a=i>>1;for(;r.length<a;)r.push(rt.empty);r.push(s?e.slice(o,o+s):rt.empty)}o+=s}return new tn(n,r)}compose(e){return this.empty?e:e.empty?this:IR(this,e,!0)}map(e,n=!1){return e.empty?this:dx(this,e,n,!0)}iterChanges(e,n=!1){hx(this,e,n)}get desc(){return lo.create(this.sections)}filter(e){let n=[],r=[],i=[],o=new Hf(this);e:for(let s=0,l=0;;){let a=s==e.length?1e9:e[s++];for(;l<a||l==a&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,a-l);jn(i,u,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;jn(n,u,f),f>0&&Ts(r,n,o.text),o.forward(u),l+=u}let c=e[s++];for(;l<c;){if(o.done)break e;let u=Math.min(o.len,c-l);jn(n,u,-1),jn(i,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),l+=u}}return{changes:new tn(n,r),filtered:lo.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,l=null;function a(u=!1){if(!u&&!i.length)return;s<n&&jn(i,n-s,-1);let f=new tn(i,o);l=l?l.compose(f.map(l)):f,i=[],o=[],s=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof tn){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:h=f,insert:d}=u;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let p=d?typeof d=="string"?rt.of(d.split(r||fx)):d:rt.empty,g=p.length;if(f==h&&g==0)return;f<s&&a(),f>s&&jn(i,f-s,-1),jn(i,h-f,g),Ts(o,i,p),s=h}}return c(e),a(!l),l}static empty(e){return new tn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,l)=>l&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(rt.empty);r[i]=rt.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new tn(n,r)}static createSet(e,n){return new tn(e,n)}}function jn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ts(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(rt.empty);t.push(n)}}function hx(t,e,n){let r=t.inserted;for(let i=0,o=0,s=0;s<t.sections.length;){let l=t.sections[s++],a=t.sections[s++];if(a<0)i+=l,o+=l;else{let c=i,u=o,f=rt.empty;for(;c+=l,u+=a,a&&r&&(f=f.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)l=t.sections[s++],a=t.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function dx(t,e,n,r=!1){let i=[],o=r?[]:null,s=new Hf(t),l=new Hf(e);for(let a=-1;;){if(s.done&&l.len||l.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&l.ins==-1){let c=Math.min(s.len,l.len);jn(i,c,-1),s.forward(c),l.forward(c)}else if(l.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(l.len<s.len||l.len==s.len&&!n))){let c=l.len;for(jn(i,l.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&a<s.i&&s.len<=u&&(jn(i,0,s.ins),o&&Ts(o,i,s.text),a=s.i),s.forward(u),c-=u}l.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;jn(i,c,a<s.i?s.ins:0),o&&a<s.i&&Ts(o,i,s.text),a=s.i,s.forward(s.len-u)}else{if(s.done&&l.done)return o?tn.createSet(i,o):lo.create(i);throw new Error("Mismatched change set lengths")}}}function IR(t,e,n=!1){let r=[],i=n?[]:null,o=new Hf(t),s=new Hf(e);for(let l=!1;;){if(o.done&&s.done)return i?tn.createSet(r,i):lo.create(r);if(o.ins==0)jn(r,o.len,0,l),o.next();else if(s.len==0&&!s.done)jn(r,0,s.ins,l),i&&Ts(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let a=Math.min(o.len2,s.len),c=r.length;if(o.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;jn(r,a,u,l),i&&u&&Ts(i,r,s.text)}else s.ins==-1?(jn(r,o.off?0:o.len,a,l),i&&Ts(i,r,o.textBit(a))):(jn(r,o.off?0:o.len,s.off?0:s.ins,l),i&&!s.off&&Ts(i,r,s.text));l=(o.ins>a||s.ins>=0&&s.len>a)&&(l||r.length>c),o.forward2(a),s.forward(a)}}}}class Hf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?rt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?rt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ss{constructor(e,n,r,i){this.from=e,this.to=n,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Ss(r,i,this.flags,this.goalColumn)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return H.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return H.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return H.range(e.anchor,e.head)}static create(e,n,r,i){return new Ss(e,n,r,i)}}class H{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:H.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new H([this.main],0)}addRange(e,n=!0){return H.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,H.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new H(e.ranges.map(n=>Ss.fromJSON(n)),e.main)}static single(e,n=e){return new H([H.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=r:o.from<r)return H.normalized(e.slice(),n);r=o.to}return new H(e,n)}static cursor(e,n=0,r,i){return Ss.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(e,n,r,i,o){let s=i==null?7:Math.min(6,i);return!o&&e!=n&&(o=n<e?1:-1),o&&(s|=o<0?8:16),n<e?Ss.create(n,e,s|32,r):Ss.create(e,n,s,r)}static undirectionalRange(e,n){return Ss.create(e,n,64,void 0)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let o=e[i],s=e[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let l=s.from,a=Math.max(o.to,s.to);i<=n&&n--,e.splice(--i,2,o.anchor>o.head?H.range(a,l):H.range(l,a))}}return new H(e,n)}}function DR(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let AS=0;class ye{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=AS++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ye(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:QS),!!e.static,e.enables)}of(e){return new Ap([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ap(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ap(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function QS(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ap{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=AS++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,h){if(a&&h.docChanged||c&&(h.docChanged||h.selection)||px(f,u)){let d=r(f);if(l?!y5(d,f.values[s],i):!i(d,f.values[s]))return f.values[s]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[o];if(p!=null){let g=Rg(h,p);if(this.dependencies.every(m=>m instanceof ye?h.facet(m)===f.facet(m):m instanceof cn?h.field(m,!1)==f.field(m,!1):!0)||(l?y5(d=r(f),g,i):i(d=r(f),g)))return f.values[s]=g,0}else d=r(f);return f.values[s]=d,1}}}get extension(){return this}}function y5(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function px(t,e){let n=!1;for(let r of e)cf(t,r)&1&&(n=!0);return n}function qee(t,e,n){let r=n.map(a=>t[a.id]),i=n.map(a=>a.type),o=r.filter(a=>!(a&1)),s=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<r.length;u++){let f=Rg(a,r[u]);if(i[u]==2)for(let h of f)c.push(h);else c.push(f)}return e.combine(c)}return{create(a){for(let c of r)cf(a,c);return a.values[s]=l(a),1},update(a,c){if(!px(a,o))return 0;let u=l(a);return e.compare(u,a.values[s])?0:(a.values[s]=u,1)},reconfigure(a,c){let u=px(a,r),f=c.config.facets[e.id],h=c.facet(e);if(f&&!u&&QS(n,f))return a.values[s]=h,0;let d=l(a);return e.compare(d,h)?(a.values[s]=h,0):(a.values[s]=d,1)}}}const kd=ye.define({static:!0});class cn{constructor(e,n,r,i,o){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let n=new cn(AS++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(kd).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(kd),s=i.facet(kd),l;return(l=o.find(a=>a.field==this))&&l!=s.find(a=>a.field==this)?(r.values[n]=l.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,kd.of({field:this,create:e})]}get extension(){return this}}const Ol={lowest:4,low:3,default:2,high:1,highest:0};function Pu(t){return e=>new NR(e,t)}const Fi={highest:Pu(Ol.highest),high:Pu(Ol.high),default:Pu(Ol.default),low:Pu(Ol.low),lowest:Pu(Ol.lowest)};class NR{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class lu{of(e){return new gx(this,e)}reconfigure(e){return lu.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class gx{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}}class Mg{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let h of Yee(e,n,s))h instanceof cn?i.push(h):(o[h.facet.id]||(o[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],c=[];for(let h of i)l[h.id]=c.length<<1,c.push(d=>h.slot(d));let u=r?.config.facets;for(let h in o){let d=o[h],p=d[0].facet,g=u&&u[h]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,QS(g,d))a.push(r.facet(p));else{let m=p.combine(d.map(O=>O.value));a.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(O=>m.dynamicSlot(O)));l[p.id]=c.length<<1,c.push(m=>qee(m,p,d))}}let f=c.map(h=>h(l));return new Mg(e,s,f,l,a,o)}}function Yee(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,l){let a=i.get(s);if(a!=null){if(a<=l)return;let c=r[a].indexOf(s);c>-1&&r[a].splice(c,1),s instanceof gx&&n.delete(s.compartment)}if(i.set(s,l),Array.isArray(s))for(let c of s)o(c,l);else if(s instanceof gx){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,l)}else if(s instanceof NR)o(s.inner,s.prec);else if(s instanceof cn)r[l].push(s),s.provides&&o(s.provides,l);else if(s instanceof Ap)r[l].push(s),s.facet.extensions&&o(s.facet.extensions,Ol.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}).`);if(c==s)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,l)}}return o(t,Ol.default),r.reduce((s,l)=>s.concat(l))}function cf(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Rg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const VR=ye.define(),mx=ye.define({combine:t=>t.some(e=>e),static:!0}),BR=ye.define({combine:t=>t.length?t[0]:void 0,static:!0}),FR=ye.define(),ZR=ye.define(),zR=ye.define(),jR=ye.define({combine:t=>t.length?t[0]:!1});class ds{constructor(e,n){this.type=e,this.value=n}static define(){return new Uee}}class Uee{of(e){return new ds(this,e)}}class Gee{constructor(e){this.map=e}of(e){return new Le(this,e)}}class Le{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Le(this.type,n)}is(e){return this.type==e}static define(e={}){return new Gee(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}Le.reconfigure=Le.define();Le.appendConfig=Le.define();class on{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&DR(r,n.newLength),o.some(l=>l.type==on.time)||(this.annotations=o.concat(on.time.of(Date.now())))}static create(e,n,r,i,o,s){return new on(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(on.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}on.time=ds.define();on.userEvent=ds.define();on.addToHistory=ds.define();on.remote=ds.define();function Kee(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],s=t[r++];else if(i<e.length)o=e[i++],s=e[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function XR(t,e,n){var r;let i,o,s;return n?(i=e.changes,o=tn.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(o):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Le.mapEffects(t.effects,i).concat(Le.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Ox(t,e,n){let r=e.selection,i=sc(e.annotations);return e.userEvent&&(i=i.concat(on.userEvent.of(e.userEvent))),{changes:e.changes instanceof tn?e.changes:tn.of(e.changes||[],n,t.facet(BR)),selection:r&&(r instanceof H?r:H.single(r.anchor,r.head)),effects:sc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function WR(t,e,n){let r=Ox(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let s=!!e[o].sequential;r=XR(r,Ox(t,e[o],s?r.changes.newLength:t.doc.length),s)}let i=on.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return ete(n?Jee(i):i)}function Jee(t){let e=t.startState,n=!0;for(let i of e.facet(FR)){let o=i(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:Kee(n,o))}if(n!==!0){let i,o;if(n===!1)o=t.changes.invertedDesc,i=tn.empty(e.doc.length);else{let s=t.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}t=on.create(e,i,t.selection&&t.selection.map(o),Le.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let r=e.facet(ZR);for(let i=r.length-1;i>=0;i--){let o=r[i](t);o instanceof on?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof on?t=o[0]:t=WR(e,sc(o),!1)}return t}function ete(t){let e=t.startState,n=e.facet(zR),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=XR(r,Ox(e,o,t.changes.newLength),!0))}return r==t?t:on.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const tte=[];function sc(t){return t==null?tte:Array.isArray(t)?t:[t]}var Dt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Dt||(Dt={}));const nte=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let yx;try{yx=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function rte(t){if(yx)return yx.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||nte.test(n)))return!0}return!1}function ite(t){return e=>{if(!/\S/.test(e))return Dt.Space;if(rte(e))return Dt.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Dt.Word;return Dt.Other}}class ze{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)cf(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return cf(this,r),Rg(this,r)}update(...e){return WR(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(lu.reconfigure)?(n&&(i=new Map,n.compartments.forEach((a,c)=>i.set(c,a)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(Le.reconfigure)?(n=null,r=l.value):l.is(Le.appendConfig)&&(n=null,r=sc(r).concat(l.value));let o;n?o=e.startState.values.slice():(n=Mg.resolve(r,i,this),o=new ze(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let s=e.startState.facet(mx)?e.newSelection:e.newSelection.asSingle();new ze(n,e.newDoc,s,o,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:H.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=sc(r.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(i);for(let h=0;h<l;h++)o[h]=o[h].map(u);let f=i.mapDesc(c,!0);o.push(a.range.map(f)),i=i.compose(u),s=Le.mapEffects(s,u).concat(Le.mapEffects(sc(a.effects),f))}return{changes:i,selection:H.create(o,n.mainIndex),effects:s}}changes(e=[]){return e instanceof tn?e:tn.of(e,this.doc.length,this.facet(ze.lineSeparator))}toText(e){return rt.of(e.split(this.facet(ze.lineSeparator)||fx))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(cf(this,n),Rg(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof cn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(e,o)){let s=r[o],l=e[o];i.push(s.init(a=>s.spec.fromJSON(l,a)))}}return ze.create({doc:e.doc,selection:H.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Mg.resolve(e.extensions||[],new Map),r=e.doc instanceof rt?e.doc:rt.of((e.doc||"").split(n.staticFacet(ze.lineSeparator)||fx)),i=e.selection?e.selection instanceof H?e.selection:H.single(e.selection.anchor,e.selection.head):H.single(0);return DR(i,r.length),n.staticFacet(mx)||(i=i.asSingle()),new ze(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(ze.tabSize)}get lineBreak(){return this.facet(ze.lineSeparator)||`
|
|
107
|
-
`}get readOnly(){return this.facet(jR)}phrase(e,...n){for(let r of this.facet(ze.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(VR))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return ite(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,l=e-r;for(;s>0;){let a=Sn(n,s,!1);if(o(n.slice(a,s))!=Dt.Word)break;s=a}for(;l<i;){let a=Sn(n,l);if(o(n.slice(l,a))!=Dt.Word)break;l=a}return s==l?null:H.range(s+r,l+r)}}ze.allowMultipleSelections=mx;ze.tabSize=ye.define({combine:t=>t.length?t[0]:4});ze.lineSeparator=BR;ze.readOnly=jR;ze.phrases=ye.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});ze.languageData=VR;ze.changeFilter=FR;ze.transactionFilter=ZR;ze.transactionExtender=zR;lu.reconfigure=Le.define();function xo(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],l=r[o];if(l===void 0)r[o]=s;else if(!(l===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](l,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class js{eq(e){return this==e}range(e,n=e){return qf.create(e,n,this)}}js.prototype.startSide=js.prototype.endSide=0;js.prototype.point=!1;js.prototype.mapMode=Mn.TrackDel;function MS(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}class qf{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new qf(e,n,r)}}function xx(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let ote=class HR{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return Ra(this.to)}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,l=o.length;;){if(s==l)return s;let a=s+l>>1,c=o[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-n;if(a==s)return c>=0?s:l;c>=0?l=a:s=a+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n,r,i,o){let s=[],l=[],a=[],c=-1,u=-1;e:for(let f=0;f<this.value.length;f++){let h=this.value[f],d=this.from[f]+e,p=this.to[f]+e,g,m;if(d==p){let O=n.mapPos(d,h.startSide,h.mapMode);if(O==null||(g=m=O,h.startSide!=h.endSide&&(m=n.mapPos(d,h.endSide),m<g)))continue}else if(g=n.mapPos(d,h.startSide),m=n.mapPos(p,h.endSide),g>m||g==m&&h.startSide>0&&h.endSide<=0)continue;if(!((m-g||h.endSide-h.startSide)<0))if(c<0&&(c=g),h.point&&(u=Math.max(u,m-g)),(g-r||h.startSide-i)>=0)s.push(h),l.push(g-c),a.push(m-c),r=m,i=h.endSide;else{if(g==m){for(let O=s.length-1;O>0;O--)if((g-a[O-1]||h.startSide-s[O-1].endSide)<=0){s.splice(O,0,h),l.splice(O,0,g),a.splice(O,0,m);continue e}}o(g,m,h)}}return{mapped:s.length?new HR(l,a,s,u):null,pos:c}}};class qe{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new qe(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(xx)),this.isEmpty)return n.length?qe.of(n):this;let l=new qR(this,null,-1).goto(0),a=0,c=[],u=new ir;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!s||i>this.chunkEnd(l.chunkIndex)||o<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!s||i>l.to||o<l.from||s(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(qf.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?qe.empty:this.nextLayer.update({add:c,filter:s,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1,o,s=(a,c,u)=>{o||(o=new ir),o.add(a,c,u)};for(let a=0;a<this.chunk.length;a++){let c=this.chunkPos[a],u=this.chunk[a],f=e.touchesRange(c,c+u.length);if(f===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(c));else if(f===!0){let[h,d]=n.length?[Ra(r)+Ra(n).length,Ra(Ra(n).value).endSide]:[-1,-1],{mapped:p,pos:g}=u.map(c,e,h,d,s);p&&(i=Math.max(i,p.maxPoint),n.push(p),r.push(g))}}let l=this.nextLayer.map(e);return o&&(l=o.finishInner(l)),n.length==0?l:new qe(r,n,l||qe.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Yf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Yf.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=x5(s,l,r),c=new Eu(s,a,o),u=new Eu(l,a,o);r.iterGaps((f,h,d)=>b5(c,f,u,h,d,i)),r.empty&&r.length==0&&b5(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let l=x5(o,s),a=new Eu(o,l,0).goto(r),c=new Eu(s,l,0).goto(r);for(;;){if(a.to!=c.to||!bx(a.active,c.active)||a.point&&(!c.point||!MS(a.point,c.point)))return!1;if(a.to>i)return!0;a.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new Eu(e,null,o).goto(n),l=n,a=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFrom<n?u.length+1:s.point.startSide<0?u.length:Math.min(u.length,a);i.point(l,c,s.point,u,f,s.pointRank),a=Math.min(s.openEnd(c),u.length)}else c>l&&(i.span(l,c,s.active,a),a=s.openEnd(c));if(s.to>r)return a+(s.point&&s.to>r?1:0);l=s.to,s.next()}}static of(e,n=!1){let r=new ir;for(let i of e instanceof qf?[e]:n?ste(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return qe.empty;let n=Ra(e);for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=qe.empty;i=i.nextLayer)n=new qe(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}qe.empty=new qe([],[],null,-1);function Ra(t){return t[t.length-1]}function ste(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(xx(e,r)>0)return t.slice().sort(xx);e=r}return t}qe.empty.nextLayer=qe.empty;class ir{finishChunk(e){this.chunks.push(new ote(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new ir)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(qe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=qe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function x5(t,e,n){let r=new Map;for(let o of t)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of e)for(let s=0;s<o.chunk.length;s++){let l=r.get(o.chunk[s]);l!=null&&(n?n.mapPos(l):l)==o.chunkPos[s]&&!n?.touchesRange(l,l+o.chunk[s].length)&&i.add(o.chunk[s])}return i}class qR{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Yf{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let o=0;o<e.length;o++)for(let s=e[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new qR(s,n,r,o));return i.length==1?i[0]:new Yf(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)A1(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)A1(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),A1(this.heap,0)}}}function A1(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Eu{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Yf.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Cd(this.active,e),Cd(this.activeTo,e),Cd(this.activeRank,e),this.minActive=v5(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;_d(this.active,n,r),_d(this.activeTo,n,i),_d(this.activeRank,n,o),e&&_d(e,n,this.cursor.from),this.minActive=v5(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Cd(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function b5(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,l=r,a=r-e,c=!!o.boundChange;for(let u=!1;;){let f=t.to+a-n.to,h=f||t.endSide-n.endSide,d=h<0?t.to+a:n.to,p=Math.min(d,s);if(t.point||n.point?(t.point&&n.point&&MS(t.point,n.point)&&bx(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(l,p,t.point,n.point),u=!1):(u&&o.boundChange(l),p>l&&!bx(t.active,n.active)&&o.compareRange(l,p,t.active,n.active),c&&p<s&&(f||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>s)break;l=d,h<=0&&t.next(),h>=0&&n.next()}}function bx(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!MS(t[n],e[n]))return!1;return!0}function Cd(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function _d(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function v5(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Ni(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Sn(t,i));return r}function vx(t,e,n,r){for(let i=0,o=0;;){if(o>=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=Sn(t,i)}return r===!0?-1:t.length}const Sx="ͼ",S5=typeof Symbol>"u"?"__"+Sx:Symbol.for(Sx),wx=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),w5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ss{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,l,a,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(s[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))o(d.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,u,h)}else p!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||h)&&a.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
108
|
-
`)}static newName(){let e=w5[S5]||1;return w5[S5]=e+1,Sx+e.toString(36)}static mount(e,n,r){let i=e[wx],o=r&&r.nonce;i?o&&i.setNonce(o):i=new lte(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let k5=new Map;class lte{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=k5.get(r);if(o)return e[wx]=o;this.sheet=new i.CSSStyleSheet,k5.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[wx]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s<e.length;s++){let l=e[s],a=this.modules.indexOf(l);if(a<o&&a>-1&&(this.modules.splice(a,1),o--,a=-1),a==-1){if(this.modules.splice(o++,0,l),r)for(let c=0;c<l.rules.length;c++)r.insertRule(l.rules[c],i++)}else{for(;o<a;)i+=this.modules[o++].rules.length;i+=l.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let a=0;a<this.modules.length;a++)s+=this.modules[a].getRules()+`
|
|
109
|
-
`;this.styleTag.textContent=s;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Xs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Uf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ate=typeof navigator<"u"&&/Mac/.test(navigator.platform),cte=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Qn=0;Qn<10;Qn++)Xs[48+Qn]=Xs[96+Qn]=String(Qn);for(var Qn=1;Qn<=24;Qn++)Xs[Qn+111]="F"+Qn;for(var Qn=65;Qn<=90;Qn++)Xs[Qn]=String.fromCharCode(Qn+32),Uf[Qn]=String.fromCharCode(Qn);for(var Q1 in Xs)Uf.hasOwnProperty(Q1)||(Uf[Q1]=Xs[Q1]);function ute(t){var e=ate&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||cte&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Uf:Xs)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function xt(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)YR(t,arguments[e]);return t}function YR(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)YR(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let tr=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},kx=typeof document<"u"?document:{documentElement:{style:{}}};const Cx=/Edge\/(\d+)/.exec(tr.userAgent),UR=/MSIE \d/.test(tr.userAgent),_x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tr.userAgent),uO=!!(UR||_x||Cx),C5=!uO&&/gecko\/(\d+)/i.test(tr.userAgent),M1=!uO&&/Chrome\/(\d+)/.exec(tr.userAgent),_5="webkitFontSmoothing"in kx.documentElement.style,Tx=!uO&&/Apple Computer/.test(tr.vendor),T5=Tx&&(/Mobile\/\w+/.test(tr.userAgent)||tr.maxTouchPoints>2);var Oe={mac:T5||/Mac/.test(tr.platform),windows:/Win/.test(tr.platform),linux:/Linux|X11/.test(tr.platform),ie:uO,ie_version:UR?kx.documentMode||6:_x?+_x[1]:Cx?+Cx[1]:0,gecko:C5,gecko_version:C5?+(/Firefox\/(\d+)/.exec(tr.userAgent)||[0,0])[1]:0,chrome:!!M1,chrome_version:M1?+M1[1]:0,ios:T5,android:/Android\b/.test(tr.userAgent),webkit:_5,webkit_version:_5?+(/\bAppleWebKit\/(\d+)/.exec(tr.userAgent)||[0,0])[1]:0,safari:Tx,safari_version:Tx?+(/\bVersion\/(\d+(\.\d+)?)/.exec(tr.userAgent)||[0,0])[1]:0,tabSize:kx.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function RS(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Lg=Object.create(null);function LS(t,e,n){if(t==e)return!0;t||(t=Lg),e||(e=Lg);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function fte(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function P5(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function hte(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class pi{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Dn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Dn||(Dn={}));class ke extends js{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Bh(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Gl(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=GR(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Gl(e,r,i,n,e.widget||null,!0)}static line(e){return new Fh(e)}static set(e,n=!1){return qe.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ke.none=qe.empty;class Bh extends ke{constructor(e){let{start:n,end:r}=GR(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?RS(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Lg}eq(e){return this==e||e instanceof Bh&&this.tagName==e.tagName&&LS(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Bh.prototype.point=!1;class Fh extends ke{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Fh&&this.spec.class==e.spec.class&&LS(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Fh.prototype.mapMode=Mn.TrackBefore;Fh.prototype.point=!0;class Gl extends ke{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?Mn.TrackBefore:Mn.TrackAfter:Mn.TrackDel}get type(){return this.startSide!=this.endSide?Dn.WidgetRange:this.startSide<=0?Dn.WidgetBefore:Dn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Gl&&dte(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Gl.prototype.point=!0;function GR(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function dte(t,e){return t==e||!!(t&&e&&t.compare(e))}function lc(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Gf extends js{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof Gf&&this.tagName==e.tagName&&LS(this.attributes,e.attributes)}static create(e){return new Gf(e.tagName,e.attributes||Lg,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return qe.of(e,n)}}Gf.prototype.startSide=Gf.prototype.endSide=-1;function Kf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Px(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function uf(t,e){if(!e.anchorNode)return!1;try{return Px(t,e.anchorNode)}catch{return!1}}function Qp(t){return t.nodeType==3?Jf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ff(t,e,n,r){return n?E5(t,e,n,r,-1)||E5(t,e,n,r,1):!1}function Ws(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Ig(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function E5(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ls(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=Ws(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?ls(t):0}else return!1}}function ls(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Dg(t,e){let{left:n,right:r}=t;if(n==r)return t;let i=e?n:r;return{left:i,right:i,top:t.top,bottom:t.bottom}}function pte(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function KR(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function gte(t,e,n,r,i,o,s,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let h,d=u==a.body,p=1,g=1;if(d)h=pte(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=KR(u,y)),h={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,O=0;if(i=="nearest")e.top<h.top+s?(O=e.top-(h.top+s),n>0&&e.bottom>h.bottom+O&&(O=e.bottom-h.bottom+s)):e.bottom>h.bottom-s&&(O=e.bottom-h.bottom+s,n<0&&e.top-O<h.top&&(O=e.top-(h.top+s)));else{let y=e.bottom-e.top,x=h.bottom-h.top;O=(i=="center"&&y<=x?e.top+y/2-x/2:i=="start"||i=="center"&&n<0?e.top-s:e.bottom-x+s)-h.top}if(r=="nearest"?e.left<h.left+o?(m=e.left-(h.left+o),n>0&&e.right>h.right+m&&(m=e.right-h.right+o)):e.right>h.right-o&&(m=e.right-h.right+o,n<0&&e.left<h.left+m&&(m=e.left-(h.left+o))):m=(r=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:r=="start"==l?e.left-o:e.right-(h.right-h.left)+o)-h.left,m||O)if(d)c.scrollBy(m,O);else{let y=0,x=0;if(O){let b=u.scrollTop;u.scrollTop+=O/g,x=(u.scrollTop-b)*g}if(m){let b=u.scrollLeft;u.scrollLeft+=m/p,y=(u.scrollLeft-b)*p}e={left:e.left-y,top:e.top-x,right:e.right-y,bottom:e.bottom-x},y&&Math.abs(y-m)<1&&(r="nearest"),x&&Math.abs(x-O)<1&&(i="nearest")}if(d)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function JR(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let o=t.parentNode;o&&!(o==n.body||(!e||r)&&i);)if(o.nodeType==1)!i&&o.scrollHeight>o.clientHeight&&(i=o),e&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:r,y:i}}class mte{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ls(n):0),r,Math.min(e.focusOffset,r?ls(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}function e4(t){let e=[];for(let n=t;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&e.push({node:n,left:n.scrollLeft,top:n.scrollTop});return e}function t4(t,e=!0){for(let{node:n,left:r,top:i}of t)e&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}let pl=null;Oe.safari&&Oe.safari_version>=26&&(pl=!1);function n4(t){if(t.setActive)return t.setActive();if(pl)return t.focus(pl);let e=e4(t);t.focus(pl==null?{get preventScroll(){return pl={preventScroll:!0},!0}}:void 0),pl||(pl=!1,t4(e))}let $5;function Jf(t,e,n=e){let r=$5||($5=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function ac(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,t.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,t.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function Ote(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function yte(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ls(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=ls(n))}else{if(n==t)return!0;r=Ws(n),n=n.parentNode}}function r4(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function i4(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ls(n)}else if(n.parentNode&&!Ig(n))r=Ws(n),n=n.parentNode;else return null}}function o4(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Ig(n))r=Ws(n)+1,n=n.parentNode;else return null}}class Qi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Qi(e.parentNode,Ws(e),n)}static after(e,n){return new Qi(e.parentNode,Ws(e)+1,n)}}var _t=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(_t||(_t={}));const Kl=_t.LTR,IS=_t.RTL;function s4(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const xte=s4("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),bte=s4("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ex=Object.create(null),ji=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ex[e]=n,Ex[n]=-e}function l4(t){return t<=247?xte[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?bte[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const vte=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ro{get dir(){return this.level%2?IS:Kl}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let o=-1;for(let s=0;s<e.length;s++){let l=e[s];if(l.from<=n&&l.to>=n){if(l.level==r)return s;(o<0||(i!=0?i<0?l.from<n:l.to>n:e[o].level>l.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function a4(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!a4(r.inner,i.inner))return!1}return!0}const Ct=[];function Ste(t,e,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:e,l=o<r.length?r[o].from:n,a=o?256:i;for(let c=s,u=a,f=a;c<l;c++){let h=l4(t.charCodeAt(c));h==512?h=u:h==8&&f==4&&(h=16),Ct[c]=h==4?2:h,h&7&&(f=h),u=h}for(let c=s,u=a,f=a;c<l;c++){let h=Ct[c];if(h==128)c<l-1&&u==Ct[c+1]&&u&24?h=Ct[c]=u:Ct[c]=256;else if(h==64){let d=c+1;for(;d<l&&Ct[d]==64;)d++;let p=c&&u==8||d<n&&Ct[d]==8?f==1?1:8:256;for(let g=c;g<d;g++)Ct[g]=p;c=d-1}else h==8&&f==1&&(Ct[c]=1);u=h,h&7&&(f=h)}}}function wte(t,e,n,r,i){let o=i==1?2:1;for(let s=0,l=0,a=0;s<=r.length;s++){let c=s?r[s-1].to:e,u=s<r.length?r[s].from:n;for(let f=c,h,d,p;f<u;f++)if(d=Ex[h=t.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(ji[g+1]==-d){let m=ji[g+2],O=m&2?i:m&4?m&1?o:i:0;O&&(Ct[f]=Ct[ji[g]]=O),l=g;break}}else{if(ji.length==189)break;ji[l++]=f,ji[l++]=h,ji[l++]=a}else if((p=Ct[f])==2||p==1){let g=p==i;a=g?0:1;for(let m=l-3;m>=0;m-=3){let O=ji[m+2];if(O&2)break;if(g)ji[m+2]|=2;else{if(O&4)break;ji[m+2]|=4}}}}}function kte(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,l=i<n.length?n[i].from:e;for(let a=s;a<l;){let c=Ct[a];if(c==256){let u=a+1;for(;;)if(u==l){if(i==n.length)break;u=n[i++].to,l=i<n.length?n[i].from:e}else if(Ct[u]==256)u++;else break;let f=o==1,h=(u<e?Ct[u]:r)==1,d=f==h?f?1:2:r;for(let p=u,g=i,m=g?n[g-1].to:t;p>a;)p==m&&(p=n[--g].from,m=g?n[g-1].to:t),Ct[--p]=d;a=u}else o=c,a++}}}function $x(t,e,n,r,i,o,s){let l=r%2?2:1;if(r%2==i%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==o.length||a<o[c].from){let g=Ct[a];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?r:r+1,p=a;e:for(;;)if(c<o.length&&p==o[c].from){if(f)break e;let g=o[c];if(!u)for(let m=g.to,O=c+1;;){if(m==n)break e;if(O<o.length&&o[O].from==m)m=o[O++].to;else{if(Ct[m]==l)break e;break}}if(c++,h)h.push(g);else{g.from>a&&s.push(new ro(a,g.from,d));let m=g.direction==Kl!=!(d%2);Ax(t,m?r+1:r,i,g.inner,g.from,g.to,s),a=g.to}p=g.to}else{if(p==n||(u?Ct[p]!=l:Ct[p]==l))break;p++}h?$x(t,a,p,r+1,i,h,s):a<p&&s.push(new ro(a,p,d)),a=p}else for(let a=n,c=o.length;a>e;){let u=!0,f=!1;if(!c||a>o[c-1].to){let g=Ct[a-1];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?r:r+1,p=a;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,O=c;;){if(m==e)break e;if(O&&o[O-1].to==m)m=o[--O].from;else{if(Ct[m-1]==l)break e;break}}if(h)h.push(g);else{g.to<a&&s.push(new ro(g.to,a,d));let m=g.direction==Kl!=!(d%2);Ax(t,m?r+1:r,i,g.inner,g.from,g.to,s),a=g.from}p=g.from}else{if(p==e||(u?Ct[p-1]!=l:Ct[p-1]==l))break;p--}h?$x(t,p,a,r+1,i,h,s):p<a&&s.push(new ro(p,a,d)),a=p}}function Ax(t,e,n,r,i,o,s){let l=e%2?2:1;Ste(t,i,o,r,l),wte(t,i,o,r,l),kte(i,o,r,l),$x(t,i,o,e,n,r,s)}function Cte(t,e,n){if(!t)return[new ro(0,0,e==IS?1:0)];if(e==Kl&&!n.length&&!vte.test(t))return c4(t.length);if(n.length)for(;t.length>Ct.length;)Ct[Ct.length]=256;let r=[],i=e==Kl?0:1;return Ax(t,i,i,n,0,t.length,r),r}function c4(t){return[new ro(0,t,0)]}let u4="";function _te(t,e,n,r,i){var o;let s=r.head-t.from,l=ro.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),a=e[l],c=a.side(i,n);if(s==c){let h=l+=i?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],s=a.side(!i,n),c=a.side(i,n)}let u=Sn(t.text,s,a.forward(i,n));(u<a.from||u>a.to)&&(u=c),u4=t.text.slice(Math.min(s,u),Math.max(s,u));let f=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)<a.level?H.cursor(f.side(!i,n)+t.from,f.forward(i,n)?1:-1,f.level):H.cursor(u+t.from,a.forward(i,n)?-1:1,a.level)}function Tte(t,e,n){for(let r=e;r<n;r++){let i=l4(t.charCodeAt(r));if(i==1)return Kl;if(i==2||i==4)return IS}return Kl}const f4=ye.define(),h4=ye.define(),d4=ye.define(),p4=ye.define(),Qx=ye.define(),g4=ye.define(),m4=ye.define(),DS=ye.define(),NS=ye.define(),O4=ye.define({combine:t=>t.some(e=>e)}),y4=ye.define({combine:t=>t.some(e=>e)}),x4=ye.define();class cc{constructor(e,n,r,i,o,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new cc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new cc(H.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Td=Le.define({map:(t,e)=>t.map(e)}),b4=Le.define();function yr(t,e,n){let r=t.facet(p4);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ao=ye.define({combine:t=>t.length?t[0]:!0});let Pte=0;const za=ye.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ht{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(za.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(za.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Ht(Pte++,e,r,i,l=>{let a=[];return s&&a.push(fO.of(c=>{let u=c.plugin(l);return u?s(u):ke.none})),o&&a.push(o(l)),a})}static fromClass(e,n){return Ht.define((r,i)=>new e(r,i),n)}}class R1{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(yr(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){yr(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){yr(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const v4=ye.define(),VS=ye.define(),fO=ye.define(),S4=ye.define(),BS=ye.define(),Zh=ye.define(),w4=ye.define();function A5(t,e){let n=t.state.facet(w4);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return qe.spans(r,e.from,e.to,{point(){},span(o,s,l,a){let c=o-e.from,u=s-e.from,f=i;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,p;if(d==null&&(d=Tte(e.text,c,u)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:d,inner:[]};f.push(g),f=g.inner}}}}),i}const k4=ye.define();function FS(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(k4)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Nu=ye.define();class Jr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Jr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,o=0,s=0;;){let l=i<e.length?e[i].fromB:1e9,a=o<n.length?n[o]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+s,f=c,h=u;for(;;)if(o<n.length&&n[o]<=f){let d=n[o+1];o+=2,f=Math.max(f,d);for(let p=i;p<e.length&&e[p].fromB<=f;p++)s=e[p].toA-e[p].toB;h=Math.max(h,d+s)}else if(i<e.length&&e[i].fromB<=f){let d=e[i++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),s=d.toA-d.toB}else break;r.push(new Jr(u,h,c,f))}return r}}class Ng{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=tn.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,l,a)=>i.push(new Jr(o,s,l,a))),this.changedRanges=i}static create(e,n,r){return new Ng(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Ete=[];class Wt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Ete}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&fte(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,r){return null}domPosFor(e,n){let r=Ws(this.dom),i=this.length?e>0:n>0;return new Qi(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof dO)return e;return null}static get(e){return e.cmTile}}class hO extends Wt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,o=e?.node==n?e:null,s=0;for(let l of this.children){if(l.sync(e),s+=l.length+l.breakAfter,i=r?r.nextSibling:n.firstChild,o&&i!=l.dom&&(o.written=!0),l.dom.parentNode==n)for(;i&&i!=l.dom;)i=Q5(i);else n.insertBefore(l.dom,i);r=l.dom}for(i=r?r.nextSibling:n.firstChild,o&&i&&(o.written=!0);i;)i=Q5(i);this.length=s}}function Q5(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class dO extends hO{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Wt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,o=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&o++,i=n.pop()}else{let s=r.children[i++];if(s instanceof Xo)n.push(i),r=s,i=0;else{let l=o+s.length,a=e(s,o);if(a!==void 0)return a;o=l+s.breakAfter}}}resolveBlock(e,n){let r,i=-1,o,s=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(r=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,i=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!o||!l.isWidget()&&o.isWidget())&&(o=l,s=e-a)}}),!r&&!o)throw new Error("No tile at position "+e);return r&&n<0||!o?{tile:r,offset:i}:{tile:o,offset:s}}}class Xo extends hO{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new Xo(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class _c extends hO{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new _c(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,o=-1,s=null,l=-1;function a(u,f){for(let h=0,d=0;h<u.children.length&&d<=f;h++){let p=u.children[h],g=d+p.length;g>=f&&(p.isComposite()?a(p,f-d):(!s||s.isHidden&&(n>0&&!(s.flags&32)||r&&Ate(s,p)))&&(g>f||p.flags&32&&n<=1)?(s=p,l=f-d):(d<f||p.flags&16&&!p.isHidden&&n>=-1)&&(i=p,o=f-d)),d=g}}a(this,e);let c=(n<0?i:s)||i||s;return c?{tile:c,offset:c==i?o:l}:null}coordsIn(e,n,r){let i=this.resolveInline(e,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n,r):$te(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:o}=r;if(this.dom.contains(i.dom))return i.isText()?new Qi(i.dom,Math.min(i.dom.nodeValue.length,o)):i.domPosFor(o,i.flags&16?1:i.flags&32?-1:n);let s=r.tile.parent,l=!1;for(let a of s.children){if(l)return new Qi(a.dom,0);a==r.tile&&(l=!0)}}return new Qi(this.dom,0)}}function $te(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Qp(e);return n[n.length-1]||null}function Ate(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Or extends hO{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Or(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class wl extends Wt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,r){let i=this.dom.nodeValue.length;e>i&&(e=i);let o=e,s=e,l=0;e==0&&n<0||e==i&&n>=0?Oe.chrome||Oe.gecko||(e?(o--,l=1):s<i&&(s++,l=-1)):n<0?o--:s<i&&s++;let a=Jf(this.dom,o,s).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return Oe.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),r==null?c:Dg(c,(l?l>0:n<0)==r)}static of(e,n){let r=new wl(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Jl extends Wt{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Dg(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let o=this.dom.getClientRects(),s=null;if(!o.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?o.length-1:0;s=o[a],!(e>0?a==0:a==o.length-1||s.top<s.bottom);a+=l?-1:1);return Dg(s,!l)}}get overrideDOMText(){if(!this.length)return rt.empty;let{root:e}=this;if(!e)return rt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,o){return o||(o=e.toDOM(n),e.editable||(o.contentEditable="false")),new Jl(o,r,e,i)}}class Vg extends Wt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return rt.empty}coordsIn(e,n,r){let i=this.dom.getBoundingClientRect();return r==null?i:Dg(i,n>0==r)}}class Qte{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:o,beforeBreak:s,parents:l}=this;for(;e||n>0;)if(i.isComposite())if(s){if(!e)break;r&&r.break(),e--,s=!1}else if(o==i.children.length){if(!e&&!l.length)break;r&&r.leave(i),s=!!i.breakAfter,{tile:i,index:o}=l.pop(),o++}else{let a=i.children[o],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!r||r.skip(a,0,a.length)!==!1||!a.isComposite)?(s=!!c,o++,e-=a.length):(l.push({tile:i,index:o}),i=a,o=0,r&&a.isComposite()&&r.enter(a))}else{let a=i.length;if(o<a&&e){let c=Math.min(e,a-o);r&&r.skip(i,o,o+c),e-=c,o+=c}if(o==a)s=!!i.breakAfter,{tile:i,index:o}=l.pop(),o++;else if(!e)break}return this.tile=i,this.index=o,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Mte{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class Rte{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var o;this.flushBuffer();let s=this.ensureMarks(n,r),l=s.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=s.children[s.children.length-1]=new wl(l.dom,l.text+e);a.parent=s}else s.append(i||wl.of(e,(o=this.cache.find(wl))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?L1(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=i.lastChild;if(c instanceof Or&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(L1(a.dom)),i=c;else{if(this.cache.reused.get(a)){let f=Wt.get(a.dom);f&&f.setDOM(L1(a.dom))}let u=Or.of(a.mark,a.dom);i.append(u),i=u}this.cache.reused.set(a,2)}let o=Wt.get(e.text);o&&this.cache.reused.set(o,2);let s=new wl(e.text,e.text.nodeValue);s.flags|=8,this.pos=e.range.toB,i.append(s)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let o=this.ensureMarks(n,r);!i&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=C4);let i=_c.start(e,n||((r=this.cache.find(_c))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let o=e.length-1;o>=0;o--){let s=e[o],l;if(n>0&&(l=i.lastChild)&&l instanceof Or&&l.mark.eq(s))i=l,n--;else{let a=Or.of(s,(r=this.cache.find(Or,c=>c.mark.eq(s)))===null||r===void 0?void 0:r.dom);i.append(a),i=a,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!M5(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&M5(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(I1,0,32)||new Jl(I1.toDOM(),0,I1,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,r=new Mte(e.from,e.to,e.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Xo&&i.wrapper.eq(r.wrapper))n=i;else{let o=Xo.of(r.wrapper,(e=this.cache.find(Xo,s=>s.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(o),n=o}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(Vg,void 0,1);return r&&(r.flags=n),r||new Vg(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Lte{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:o,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let l=this.textOff=Math.min(e,i.length);return o?null:i.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Bg=[Jl,_c,wl,Or,Vg,Xo,dO];for(let t=0;t<Bg.length;t++)Bg[t].bucket=t;class Ite{constructor(e){this.view=e,this.buckets=Bg.map(()=>[]),this.index=Bg.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,o=this.buckets[i],s=this.index[i];for(let l=0;l<o.length;l++){let a=(l+s)%o.length,c=o[a];if((!n||n(c))&&!this.reused.has(c))return o.splice(a,1),a<s&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let o=0,s=0;;o++){if(o==i.length){if(s)return null;s=1,o=0}let l=i[o];if(!this.reused.has(l)&&(s==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return i.splice(o,1),o<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==r?(this.reused.set(l,1),l):(this.reused.set(l,2),new Jl(l.dom,n,e,l.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Dte{constructor(e,n,r,i,o){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new Ite(e),this.text=new Lte(e.state.doc),this.builder=new Rte(this.cache,new dO(e,e.contentDOM),qe.iter(r)),this.cache.reused.set(n,2),this.old=new Qte(n),this.reuseWalker={skip:(s,l,a)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,o=0,s=0;;){let l=s<e.length?e[s++]:null,a=l?l.fromA:this.old.root.length;if(a>i){let c=a-i;this.preserve(c,!s,!l),i=a,o+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(o,l.toB)),o=l.toB,i=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=Bte(this.old),o=this.openMarks;this.old.advance(e,r?1:-1,{skip:(s,l,a)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<s.length?Jl.of(s.widget,this.view,a-l,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,o),o=i.length)}else if(s.isText())this.builder.ensureLine(null),!l&&a==s.length&&!this.cache.reused.has(s)?this.builder.addText(s.text,i,o,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(l,a),i,o)),o=i.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof Vg)this.cache.add(s);else if(s instanceof Or)this.builder.ensureLine(null),this.builder.addMark(s,i,o),this.cache.reused.set(s,1),o=i.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Or&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=o=0):s instanceof Or&&(i.shift(),o=Math.min(o,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,o=-1,s=qe.spans(this.decorations,e,n,{point:(l,a,c,u,f,h)=>{if(c instanceof Gl){if(this.disallowBlockEffectsFor[h]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=u.length,f>u.length)i.continueWidget(a-l);else{let d=c.widget||(c.block?Tc.block:Tc.inline),p=Nte(c),g=this.cache.findWidget(d,a-l,p)||Jl.of(d,this.view,a-l,p);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(g)):(i.ensureLine(r),i.addInlineWidget(g,u,f))}r=null}else r=Vte(r,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let h=this.text.next(Math.min(512,a-f));h==null?(i.addLineStartIfNotCovered(r),i.addBreak(),f++):(i.ensureLine(r),i.addText(h,c,f==l?u:c.length),f+=h.length),r=null}o=c.length}});o>-1&&(this.openWidget=s>o),this.openWidget||i.addLineStartIfNotCovered(r),this.openMarks=s}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let o=Wt.get(i);if(i==this.view.contentDOM)break;o instanceof Or?n.push(o):o?.isLine()?r=o:o instanceof Xo||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new _c(i,C4):r||n.push(Or.of(new Bh({tagName:i.nodeName.toLowerCase(),attributes:hte(i)}),i)))}return{line:r,marks:n}}}function M5(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function Nte(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const C4={class:"cm-line"};function Vte(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&RS(n,t),r&&(t.class+=" "+r)),t}function Bte(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Or&&e.push(r.mark)}return e}function L1(t){let e=Wt.get(t);return e&&e.setDOM(t.cloneNode()),t}class Tc extends pi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tc.inline=new Tc("span");Tc.block=new Tc("div");const I1=new class extends pi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class R5{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ke.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new dO(e,e.contentDOM),this.updateInner([new Jr(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Yte(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?Zte(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;r=new Jr(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Oe.ie||Oe.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,l=this.blockWrappers;this.updateDeco();let a=Xte(s,this.decorations,e.changes);a.length&&(r=Jr.extendWithRanges(r,a));let c=Hte(l,this.blockWrappers,e.changes);return c.length&&(r=Jr.extendWithRanges(r,c)),o&&!r.some(u=>u.fromA<=o.range.fromA&&u.toA>=o.range.toA)&&(r=o.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let s=this.tile,l=new Dte(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Wt.get(n.text)&&l.cache.reused.set(Wt.get(n.text),2),this.tile=l.run(e,n),Mx(s,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Oe.chrome||Oe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||r.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof D1&&i.push(o.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(b4)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(Ao)||r.tabIndex>-1)&&uf(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||n||s))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),Oe.gecko&&a.empty&&!this.hasComposition&&Fte(c)){let h=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(h,c.node.childNodes[c.offset]||null)),c=u=new Qi(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!ff(c.node,c.offset,f.anchorNode,f.anchorOffset)||!ff(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&r.contains(f.focusNode)&&qte(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let h=Kf(this.view.root);if(h)if(a.empty){if(Oe.gecko){let d=zte(c.node,c.offset);if(d&&d!=3){let p=(d==1?i4:o4)(c.node,c.offset);p&&(c=new Qi(p.node,p.offset))}}h.collapse(c.node,c.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(c.node,c.offset);try{h.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(d)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Qi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new Qi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ff(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Kf(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let l=s.posAtStart;if(n.head==l||n.head==l+s.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let o;if(e==r.dom)o=r.dom.childNodes[n];else{let s=ls(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==r.dom)break;s==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?s=-1:s=1),e=l}s<0?o=e:o=e.nextSibling}if(o==r.dom.firstChild)return i;for(;o&&!Wt.get(o);)o=o.nextSibling;if(!o)return i+r.length;for(let s=0,l=i;;s++){let a=r.children[s];if(a.dom==o)return l;l+=a.length+a.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(i,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,o=!1,s,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(o=!0)}else{let f=u+c.length;if(u<=e&&(r=c,i=e-u,o=f<e),f>=e&&!s&&(s=c,l=e-u,a=u>e),u>e&&s)return!0}}),!r&&!s?this.domAtPos(e,n):(o&&s?r=null:a&&r&&(s=null),r&&n<0||!s?r.domIn(i,n):s.domIn(l,n))}coordsAt(e,n,r){let{tile:i,offset:o}=this.tile.resolveBlock(e,n);return i.isWidget()?i.widget instanceof D1?null:i.coordsInWidget(o,n,!0):i.coordsIn(o,n,r)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(o,s){if(o.isComposite())for(let l of o.children){if(l.length>=s){let a=i(l,s);if(a)return a}if(s-=l.length,s<0)break}else if(o.isText()&&s<o.length){let l=Sn(o.text,s);if(l==s)return null;let a=Jf(o.dom,s,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_t.LTR,c=0,u=(f,h,d)=>{for(let p=0;p<f.children.length&&!(h>i);p++){let g=f.children[p],m=h+g.length,O=g.dom.getBoundingClientRect(),{height:y}=O;if(d&&!p&&(c+=O.top-d.top),g instanceof Xo)m>r&&u(g,h,O);else if(h>=r&&(c>0&&n.push(-c),n.push(y+c),c=0,s)){let x=g.dom.lastChild,b=x?Qp(x):[];if(b.length){let S=b[b.length-1],v=a?S.right-O.left:O.right-S.left;v>l&&(l=v,this.minWidth=o,this.minWidthFrom=h,this.minWidthTo=m)}}d&&p==f.children.length-1&&(c+=d.bottom-O.bottom),h=m+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?_t.RTL:_t.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let l=0,a;for(let c of s.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Qp(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:l/s.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),r,i,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=Qp(n.firstChild)[0];r=n.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,o=s&&s.height?s.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:o}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.view.state.doc.length;if(s>r){let l=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ke.replace({widget:new D1(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return ke.set(e)}updateDeco(){let e=1,n=this.view.state.facet(fO).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(BS).map((o,s)=>{let l=typeof o=="function";return l&&(r=!0),l?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(qe.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(S4).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(x4))try{if(c(this.view,e.range,e))return!0}catch(u){yr(this.view.state,u,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=FS(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(gte(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==_t.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);if(c){let u=e4(c.dom);c.dom.scrollIntoView({block:"nearest"}),t4(u,!1)}}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Mx(this.tile)}}function Mx(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Mx(r,e)}}function Fte(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function _4(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=i4(n.focusNode,n.focusOffset),i=o4(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let l=Wt.get(i.node);if(!l||l.isText()&&l.text!=i.node.nodeValue)o=i;else if(t.docView.lastCompositionAfterCursor){let a=Wt.get(r.node);!a||a.isText()&&a.text!=r.node.nodeValue||(o=i)}}if(t.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=e-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function Zte(t,e,n){let r=_4(t,n);if(!r)return null;let{node:i,from:o,to:s}=r,l=i.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let a=e.invertedDesc;return{range:new Jr(a.mapPos(o),a.mapPos(s),o,s),text:i}}function zte(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let jte=class{constructor(){this.changes=[]}compareRange(e,n){lc(e,n,this.changes)}comparePoint(e,n){lc(e,n,this.changes)}boundChange(e){lc(e,e,this.changes)}};function Xte(t,e,n){let r=new jte;return qe.compare(t,e,n,r),r.changes}class Wte{constructor(){this.changes=[]}compareRange(e,n){lc(e,n,this.changes)}comparePoint(){}boundChange(e){lc(e,e,this.changes)}}function Hte(t,e,n){let r=new Wte;return qe.compare(t,e,n,r),r.changes}function qte(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function Yte(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class D1 extends pi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Ute(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return H.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,l=o;n<0?s=Sn(i.text,o,!1):l=Sn(i.text,o);let a=r(i.text.slice(s,l));for(;s>0;){let c=Sn(i.text,s,!1);if(r(i.text.slice(c,s))!=a)break;s=c}for(;l<i.length;){let c=Sn(i.text,l);if(r(i.text.slice(l,c))!=a)break;l=c}return H.undirectionalRange(s+i.from,l+i.from)}function Gte(t,e,n,r,i){let o=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);o+=a*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+vx(s,o,t.state.tabSize)}function Rx(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!i||o.type==Dn.Text&&(i.type!=o.type||(n<0?o.from<e:o.to>e)))&&(i=o)}}return i||r}return r}function Kte(t,e,n,r){let i=Rx(t,e.head,e.assoc||-1),o=!r||i.type!=Dn.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),l=t.textDirectionAt(i.from),a=t.posAtCoords({x:n==(l==_t.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(a!=null)return H.cursor(a,n?-1:1)}return H.cursor(n?i.to:i.from,n?-1:1)}function L5(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let l=e,a=null;;){let c=_te(i,o,s,l,n),u=u4;if(!c){if(i.number==(n?t.state.doc.lines:1))return l;u=`
|
|
110
|
-
`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(a){if(!a(u))return l}else{if(!r)return c;a=r(u)}l=c}}function Jte(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==Dt.Space&&(i=s),i==s}}function ene(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return H.cursor(i,e.assoc);let s=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)s==null&&(s=c.left-a.left),l=o<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(a.right-a.left,t.defaultCharacterWidth*(i-p.from))),l=(o<0?p.top:p.bottom)+u}let f=a.left+s,h=t.viewState.heightOracle.textHeight>>1,d=r??h;for(let p=0;;p+=h){let g=l+(d+p)*o,m=Lx(t,{x:f,y:g},!1,o);if(n?g>a.bottom:g<a.top)return H.cursor(m.pos,m.assoc);let O=t.coordsAtPos(m.pos,m.assoc),y=O?(O.top+O.bottom)/2:0;if(!O||(n?y>l:y<l))return H.cursor(m.pos,m.assoc,void 0,s)}}function hf(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(o,s,l)=>{if(e>o&&e<s){let a=r||n||(e-o<s-e?-1:1);e=a<0?o:s,r=a}});if(!r)return e}}function T4(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],o=null;if(i.empty){let s=hf(t,i.from,0);s!=i.from&&(o=H.cursor(s,-1))}else{let s=hf(t,i.from,-1),l=hf(t,i.to,1);(s!=i.from||l!=i.to)&&(i.undirectional?o=H.undirectionalRange(i.from,i.to):o=H.range(i.from==i.anchor?s:l,i.from==i.head?s:l))}o&&(n||(n=e.ranges.slice()),n[r]=o)}return n?H.create(n,e.mainIndex):e}function N1(t,e,n){let r=hf(t.state.facet(Zh).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:H.cursor(r,r<n.from?1:-1)}class Gi{constructor(e,n){this.pos=e,this.assoc=n}}function Lx(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),o=i.top+t.viewState.paddingTop,{x:s,y:l}=e,a=l-o,c;for(;;){if(a<0)return new Gi(0,1);if(a>t.viewState.docHeight)return new Gi(t.state.doc.length,-1);if(c=t.elementAtHeight(a),r==null)break;if(c.type==Dn.Text){if(r<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let h=t.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(h&&(r<0?h.top<=a+o:h.bottom>=a+o))break}let f=t.viewState.heightOracle.textHeight/2;a=r>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==Dn.Text){let f=Gte(t,i,c,s,l);return new Gi(f,f==c.from?1:-1)}}if(c.type!=Dn.Text)return a<(c.top+c.bottom)/2?new Gi(c.from,1):new Gi(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new tne(t,s,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}class tne{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ro.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ro.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n,r=!1){let i=0,o=e.length-1,s=new Set,l=this.bidiIn(e[0],e[o]),a,c,u=-1,f=1e9,h;e:for(;i<o;){let p=o-i,g=i+o>>1;t:if(s.has(g)){for(let y=1;y<p;y++){let x=g+y;if(x>=o&&(x-=p),!s.has(x)){g=x;break t}}break e}s.add(g);let m=n(g),O=0;if(m)for(let y=0;y<m.length;y++){let x=m[y];if(!(x.width==0&&m.length>1))if(x.bottom<this.y)(!a||a.bottom<x.bottom)&&(a=x),O=1;else if(x.top>this.y)(!c||c.top>x.top)&&(c=x),O=-1;else{let b=x.left>this.x?this.x-x.left:x.right<this.x?this.x-x.right:0,S=Math.abs(b);S<f&&(u=g,f=S,h=x),b&&(O=b<0==(this.baseDir==_t.LTR)?-1:1)}}O==-1&&(!l||this.baseDirAt(e[g],1))?o=g:O==1&&(!l||this.baseDirAt(e[g+1],-1))&&(i=g+1)}if(!h){if(!c&&!a)return{i:e[0],after:!1};let p=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(p.top+p.bottom)/2,this.scan(e,n,!0)}if(f&&!r){let{top:p,bottom:g}=h;if(a&&a.bottom>(p+p+g)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(p+g+g)/3)return this.y=c.top+1,this.scan(e,n,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==_t.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let r=[];for(let o=0;o<e.length;o=Sn(e.text,o))r.push(n+o);r.push(n+e.length);let i=this.scan(r,o=>{let s=r[o]-n,l=r[o+1]-n;return Jf(e.dom,s,l).getClientRects()});return i.after?new Gi(r[i.i+1],-1):new Gi(r[i.i],1)}scanTile(e,n){if(!e.length)return new Gi(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let r=[n];for(let l=0,a=n;l<e.children.length;l++)r.push(a+=e.children[l].length);let i=this.scan(r,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Jf(a.dom,0,a.length)).getClientRects()}),o=e.children[i.i],s=r[i.i];return o.isText()?this.scanText(o,s):o.isComposite()?this.scanTile(o,s):i.after?new Gi(r[i.i+1],-1):new Gi(s,1)}}const La="";class nne{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(ze.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=La}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=Wt.get(i),l=i.nextSibling;if(l==n){s?.breakAfter&&!l&&r!=this.view.contentDOM&&this.lineBreak();break}let a=Wt.get(l);(s&&a?s.breakAfter:(s?s.breakAfter:Ig(i))||Ig(l)&&(i.nodeName!="BR"||s?.isWidget())&&this.text.length>o)&&!ine(l,n)&&this.lineBreak(),i=l}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,l;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(l=i.exec(n))&&(o=l.index,s=l[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=s-1);r=o+s}}readNode(e){let n=Wt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(rne(e,r.node,r.offset)?n:0))}}function rne(t,e,n){for(;;){if(!e||n<ls(e))return!1;if(e==t)return!0;n=Ws(e)+1,e=e.parentNode}}function ine(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Wt.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class I5{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class one{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=P4(e.docView.tile,n,r,0))){let a=o||s?[]:lne(e),c=new nne(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=ane(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!Px(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!Px(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((Oe.ios||Oe.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let h=Math.min(c,u),d=Math.max(c,u),p=f.from-h,g=f.to-d;(p==0||p==1||h==0)&&(g==0||g==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(H.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let h=e.coordsAtPos(c,-1),d=0;h&&(d=e.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=H.create([H.cursor(c,d)])}else this.newSel=H.single(u,c)}}}function P4(t,e,n,r){if(t.isComposite()){let i=-1,o=-1,s=-1,l=-1;for(let a=0,c=r,u=r;a<t.children.length;a++){let f=t.children[a],h=c+f.length;if(c<e&&h>n)return P4(f,e,n,c);if(h>=e&&i==-1&&(i=a,o=c),c>n&&f.dom.parentNode==t.dom){s=a,l=u;break}u=h,c=h+f.breakAfter}return{from:o,to:l<0?r+t.length:l,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function E4(t,e){let n,{newSel:r}=e,{state:i}=t,o=i.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=o.from,u=null;(s===8||Oe.android&&e.text.length<a-l)&&(c=o.to,u="end");let f=i.doc.sliceString(l,a,La),h,d;!o.empty&&o.from>=l&&o.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,o.from-l)==e.text.slice(0,o.from-l)&&f.slice(o.to-l)==e.text.slice(h=e.text.length-(f.length-(o.to-l)))?n={from:o.from,to:o.to,insert:rt.of(e.text.slice(o.from-l,h).split(La))}:(d=$4(f,e.text,c-l,u))&&(Oe.chrome&&s==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==La+La&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:rt.of(e.text.slice(d.from,d.toB).split(La))})}else r&&(!t.hasFocus&&i.facet(Ao)||Fg(r,o))&&(r=null);if(!n&&!r)return!1;if((Oe.mac||Oe.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:rt.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(o.from).to<o.to&&t.docView.lineHasWidget(o.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:i.toText(t.inputState.insertingText)}:Oe.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
|
|
111
|
-
`&&t.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:rt.of([" "])}),n)return ZS(t,n,r,s);if(r&&!Fg(r,o)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=T4(i.facet(Zh).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:l,userEvent:a}),!0}else return!1}function ZS(t,e,n,r=-1){if(Oe.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Oe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ac(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&ac(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&ac(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,l=()=>s||(s=sne(t,e,n));return t.state.facet(g4).some(a=>a(t,e.from,e.to,o,l))||t.dispatch(l()),!0}function sne(t,e,n){let r,i=t.state,o=i.selection.main,s=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let a=e.from<o.from?-1:1,c=a<0?o.from:o.to,u=hf(i.facet(Zh).map(f=>f(t)),c,a);e.from==u&&(s=u)}if(s>-1)r={changes:e,selection:H.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.from<e.from?i.sliceDoc(o.from,e.from):"",c=o.to>e.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=i.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let u=t.state.sliceDoc(e.from,e.to),f,h=n&&_4(t,n.main.head);if(h){let p=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-p}}else f=t.state.doc.lineAt(o.head);let d=o.to-e.to;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:c||p.map(a)};let g=p.to-d,m=g-u.length;if(t.state.sliceDoc(m,g)!=u||g>=f.from&&m<=f.to)return{range:p};let O=i.changes({from:m,to:g,insert:e.insert}),y=p.to-o.to;return{changes:O,range:c?H.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(O)}})}else r={changes:a,selection:c&&i.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:l,scrollIntoView:!0})}function $4(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;let s=t.length,l=e.length;for(;s>0&&l>0&&t.charCodeAt(s-1)==e.charCodeAt(l-1);)s--,l--;if(r=="end"){let a=Math.max(0,o-Math.min(s,l));n-=s+a-o}if(s<o&&t.length<e.length){let a=n<=o&&n>=s?o-n:0;o-=a,l=o+(l-s),s=o}else if(l<o){let a=n<=o&&n>=l?o-n:0;o-=a,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}function lne(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new I5(n,r)),(i!=n||o!=r)&&e.push(new I5(i,o))),e}function ane(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?H.single(n+e,r+e):null}function Fg(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class cne{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&Cne(e.contentDOM.ownerDocument)}handleEvent(e){!yne(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=fne(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,l=r[o];l&&s!=!l.handlers.length&&(i.removeEventListener(o,this.handleEvent),l=null),l||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Q4.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(A4.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||hne.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&Oe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&une(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ac(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function une(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function D5(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){yr(n.state,i)}}}function fne(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,o=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(o)for(let l in o){let a=o[l];a&&n(l).handlers.push(D5(r.value,a))}if(s)for(let l in s){let a=s[l];a&&n(l).observers.push(D5(r.value,a))}}for(let r in Vi)n(r).handlers.push(Vi[r]);for(let r in ar)n(r).observers.push(ar[r]);return e}const A4=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],hne="dthko",Q4=[16,17,18,20,91,92,224,225],Pd=6;function Ed(t){return Math.max(0,t)*.7+8}function dne(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class pne{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=JR(e.contentDOM),this.atoms=e.state.facet(Zh).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(ze.allowMultipleSelections)&&gne(e,n),this.dragging=One(e,n)&&L4(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dne(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=FS(this.view);e.clientX-a.left<=i+Pd?n=-Ed(i-e.clientX):e.clientX+a.right>=s-Pd&&(n=Ed(e.clientX-s)),e.clientY-a.top<=o+Pd?r=-Ed(o-e.clientY):e.clientY+a.bottom>=l-Pd&&(r=Ed(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=T4(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function gne(t,e){let n=t.state.facet(f4);return n.length?n[0](e):Oe.mac?e.metaKey:e.ctrlKey}function mne(t,e){let n=t.state.facet(h4);return n.length?n[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function One(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Kf(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function yne(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Wt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Vi=Object.create(null),ar=Object.create(null),M4=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function xne(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),R4(t,n.value)},50)}function pO(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function R4(t,e){e=pO(t.state,DS,e);let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(Ix!=null&&n.selection.ranges.every(a=>a.empty)&&Ix==o.toString()){let a=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:H.cursor(c.from+f.length)}})}else s?r=n.changeByRange(a=>{let c=o.line(i++);return{changes:{from:a.from,to:a.to,insert:c.text},range:H.cursor(a.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ar.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,Oe.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};ar.wheel=ar.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Vi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ar.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};ar.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ar.touchend=(t,e)=>{t.inputState.touchActive=!1};Vi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(d4))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=vne(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new pne(t,e,n,r)),r&&t.observer.ignore(()=>{n4(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function N5(t,e,n,r){if(r==1)return H.cursor(e,n);if(r==2)return Ute(t.state,e,n);{let i=t.docView.lineAt(e,n),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,l=i?i.posAtEnd:o.to;return l<t.state.doc.length&&l==o.to&&l++,H.undirectionalRange(s,l)}}const bne=Oe.ie&&Oe.ie_version<=11;let V5=null,B5=0,F5=0;function L4(t){if(!bne)return t.detail;let e=V5,n=F5;return V5=t,F5=Date.now(),B5=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(B5+1)%3:1}function vne(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=L4(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,l){let a=t.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),c,u=N5(t,a.pos,a.assoc,r);if(n.pos!=a.pos&&!s){let f=N5(t,n.pos,n.assoc,r),h=Math.min(f.from,u.from),d=Math.max(f.to,u.to);u=h<u.from?H.range(h,d,u.assoc):H.range(d,h,u.assoc)}return s?i.replaceRange(i.main.extend(u.from,u.to,u.assoc)):l&&r==1&&i.ranges.length>1&&(c=Sne(i,a.pos))?c:l?i.addRange(u):H.create([u])}}}function Sne(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return H.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Vi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=H.undirectionalRange(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",pO(t.state,NS,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Vi.dragend=t=>(t.inputState.draggedContent=null,!1);function Z5(t,e,n,r){if(n=pO(t.state,DS,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&mne(t,e)?{from:o.from,to:o.to}:null,l={from:i,insert:n},a=t.state.changes(s?[s,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Vi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&Z5(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let l=new FileReader;l.onerror=o,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[s]=l.result),o()},l.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Z5(t,e,r,!0),!0}return!1};Vi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=M4?null:e.clipboardData;return n?(R4(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(xne(t),!1)};function wne(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function kne(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:pO(t,NS,e.join(t.lineBreak)),ranges:n,linewise:r}}let Ix=null;Vi.copy=Vi.cut=(t,e)=>{if(!uf(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=kne(t.state);if(!n&&!i)return!1;Ix=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=M4?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(wne(t,n),!1)};const I4=ds.define();function D4(t,e){let n=[];for(let r of t.facet(m4)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:I4.of(!0)}):null}function N4(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=D4(t.state,e);n?t.dispatch(n):t.update([])}},10)}ar.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),N4(t)};ar.blur=t=>{t.observer.clearSelectionRange(),N4(t)};ar.compositionstart=ar.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ar.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Oe.chrome&&Oe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ar.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Vi.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let l=s[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return ZS(t,{from:a,to:c,insert:t.state.toText(o)},null),!0}}let i;if(Oe.chrome&&Oe.android&&(i=A4.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ar.compositionend(t,e),20),!1};const z5=new Set;function Cne(t){z5.has(t)||(z5.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const j5=["pre-wrap","normal","pre-line","break-spaces"];let Pc=!1;function X5(){Pc=!1}class _ne{constructor(e){this.lineWrapping=e,this.doc=rt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return j5.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,o,s){let l=j5.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,a){this.heightSamples={};for(let c=0;c<s.length;c++){let u=s[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}}class Tne{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Ti{constructor(e,n,r,i,o){this.from=e,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?Dn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Gl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ti(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var $t=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})($t||($t={}));const Mp=.001;class or{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Mp&&(Pc=!0),this.height=e)}replace(e,n,r){return or.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=i[l],h=o.lineAt(a,$t.ByPosNoHeight,r.setDoc(n),0,0),d=h.to>=c?h:o.lineAt(c,$t.ByPosNoHeight,r,0,0);for(f+=d.to-c,c=d.to;l>0&&h.from<=i[l-1].toA;)a=i[l-1].fromA,u=i[l-1].fromB,l--,a<h.from&&(h=o.lineAt(a,$t.ByPosNoHeight,r,0,0));u+=h.from-a,a=h.from;let p=zS.build(r.setDoc(s),e,u,f);o=Zg(o,o.replace(a,c,p))}return o.updateHeight(r,0)}static empty(){return new Ar(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(o>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,o-=l.size}else break;else if(i<o){let l=e[n++];l&&(i+=l.size)}else{let l=e[--r];l&&(o+=l.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new Ene(or.of(e.slice(0,n)),s,or.of(e.slice(r)))}}function Zg(t,e){return t==e?t:(t.constructor!=e.constructor&&(Pc=!0),e)}or.prototype.size=1;const Pne=ke.replace({});class V4 extends or{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Ti(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Ti(i,0,r,this.spaceAbove,Pne):this.mainBlock(r,i)}lineAt(e,n,r,i,o){let s=this.mainBlock(i,o);return this.spaceAbove?this.blockAt(0,r,i,o).join(s):s}forEachLine(e,n,r,i,o,s){e<=o+this.length&&n>=o&&s(this.lineAt(0,$t.ByPos,r,i,o))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ar extends V4{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Ti(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Ar||i instanceof En&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof En?i=new Ar(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):or.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class En extends or{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*o);s=a/o,this.length>o+1&&(l=(this.height-a)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:l}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:l,perChar:a}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,h=Math.max(r,e-f/2);return new Ti(u.from,u.length,h,f,0)}else{let c=Math.max(0,Math.min(s-o,Math.floor((e-r)/l))),{from:u,length:f}=n.doc.line(o+c);return new Ti(u,f,r+l*c,l,0)}}lineAt(e,n,r,i,o){if(n==$t.ByHeight)return this.blockAt(e,r,i,o);if(n==$t.ByPosNoHeight){let{from:d,to:p}=r.doc.lineAt(e);return new Ti(d,p-d,0,0,0)}let{firstLine:s,perLine:l,perChar:a}=this.heightMetrics(r,o),c=r.doc.lineAt(e),u=l+c.length*a,f=c.number-s,h=i+l*f+a*(c.from-o-f);return new Ti(c.from,c.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,n,r,i,o,s){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(r,o);for(let u=e,f=i;u<=n;){let h=r.doc.lineAt(u);if(u==e){let p=h.number-l;f+=a*p+c*(e-o-p)}let d=a+c*h.length;s(new Ti(h.from,h.length,f,d,0)),f+=d,u=h.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof En?r[r.length-1]=new En(o.length+i):r.push(null,new En(i-1))}if(e>0){let o=r[0];o instanceof En?r[0]=new En(e+o.length):r.unshift(new En(e-1),null)}return or.of(r)}decomposeLeft(e,n){n.push(new En(e-1),null)}decomposeRight(e,n){n.push(null,new En(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],l=Math.max(n,i.from),a=-1;for(i.from>n&&s.push(new En(i.from-n-1).updateHeight(e,n));l<=o&&i.more;){let u=e.doc.lineAt(l).length;s.length&&s.push(null);let f=i.heights[i.index++],h=0;f<0&&(h=-f,f=i.heights[i.index++]),a==-1?a=f:Math.abs(f-a)>=Mp&&(a=-2);let d=new Ar(u,f,h);d.outdated=!1,s.push(d),l+=u+1}l<=o&&s.push(null,new En(o-l).updateHeight(e,l));let c=or.of(s);return(a<0||Math.abs(c.height-this.height)>=Mp||Math.abs(a-this.heightMetrics(e,n).perLine)>=Mp)&&(Pc=!0),Zg(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Ene extends or{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return e<o?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,o,i+this.left.length+this.break)}lineAt(e,n,r,i,o){let s=i+this.left.height,l=o+this.left.length+this.break,a=n==$t.ByHeight?e<s:e<l,c=a?this.left.lineAt(e,n,r,i,o):this.right.lineAt(e,n,r,s,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==$t.ByPosNoHeight?$t.ByPosNoHeight:$t.ByPos;return a?c.join(this.right.lineAt(l,u,r,s,l)):this.left.lineAt(l,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let l=i+this.left.height,a=o+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,r,i,o,s),n>=a&&this.right.forEachLine(e,n,r,l,a,s);else{let c=this.lineAt(a,$t.ByPos,r,i,o);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,o,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,l,a,s)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let l of r)o.push(l);if(e>0&&W5(o,s-1),n<this.length){let l=o.length;this.decomposeRight(n,o),W5(o,l)}return or.of(o)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?or.of(this.break?[e,null,n]:[e,n]):(this.left=Zg(this.left,e),this.right=Zg(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,l=n+o.length+this.break,a=null;return i&&i.from<=n+o.length&&i.more?a=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=l+s.length&&i.more?a=s=s.updateHeight(e,l,r,i):s.updateHeight(e,l,r),a?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function W5(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof En&&(r=t[e+1])instanceof En&&t.splice(e-1,3,new En(n.length+1+r.length))}const $ne=5;class zS{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ar?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ar(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new V4(s,i,r)):(s||o||i>=$ne)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ar(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new En(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ar)return e;let n=new Ar(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ar)&&!this.isCovered?this.nodes.push(new Ar(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Ar&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let o=new zS(r,e);return qe.spans(n,r,i,o,0),o.finish(r)}}function Ane(t,e,n){let r=new Qne;return qe.compare(t,e,n,r,0),r.changes}class Qne{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&lc(e,n,this.changes,5)}}function Mne(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let h=u.getBoundingClientRect();o=Math.max(o,h.left),s=Math.min(s,h.right),l=Math.max(l,h.top),a=Math.min(c==t.parentNode?i.innerHeight:a,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function Rne(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function Lne(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class V1{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,n){return ke.replace({widget:new Ine(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class Ine extends pi{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class H5{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=q5,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=_t.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(VS).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new _ne(r),this.stateDeco=Y5(n),this.heightMap=or.empty().applyChanges(this.stateDeco,rt.empty,this.heightOracle.setDoc(n.doc),[new Jr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ke.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new $d(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?q5:new jS(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Vu(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Y5(this.state);let i=e.changedRanges,o=Jr.extendWithRanges(i,Ane(r,this.stateDeco,e?e.changes:tn.empty(this.state.doc.length))),s=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);X5(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||Pc)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(y4)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?_t.RTL:_t.LTR;let s=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:S,scaleY:v}=KR(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||v>.005&&Math.abs(this.scaleY-v)>.005)&&(this.scaleX=S,this.scaleY=v,c|=16,s=a=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=JR(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=r4(this.scrollParent||e.win);let g=(this.printing?Lne:Mne)(n,this.paddingTop),m=g.top-this.pixelViewport.top,O=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!Rne(e.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(s=!0),s||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:v,charWidth:w,textHeight:k}=e.docView.measureTextSize();s=v>0&&i.refresh(o,v,w,k,Math.max(5,x/w),S),s&&(e.docView.minWidth=0,c|=16)}m>0&&O>0?u=Math.max(m,O):m<0&&O<0&&(u=Math.min(m,O)),X5();for(let v of this.viewports){let w=v.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(v);this.heightMap=(s?or.empty().applyChanges(this.stateDeco,rt.empty,this.heightOracle,[new Jr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new Tne(v.from,w))}Pc&&(c|=2)}let b=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return b&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:l}=this,a=new $d(i.lineAt(s-r*1e3,$t.ByHeight,o,0,0).from,i.lineAt(l+(1-r)*1e3,$t.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,$t.ByPos,o,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?h=f.top:h=f.bottom-u,a=new $d(i.lineAt(h-1e3/2,$t.ByHeight,o,0,0).from,i.lineAt(h+u+1e3/2,$t.ByHeight,o,0,0).to)}}return a}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new $d(this.heightMap.lineAt(r,$t.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,$t.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,$t.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,$t.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:l}=this;return(e==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=l+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new V1(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=_t.LTR&&!r)return[];let l=[],a=(u,f,h,d)=>{if(f-u<o)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let O of g)if(O>u&&O<f){a(u,O-10,h,d),a(O+10,f,h,d);return}let m=Nne(e,O=>O.from>=h.from&&O.to<=h.to&&Math.abs(O.from-u)<o&&Math.abs(O.to-f)<o&&!g.some(y=>O.from<y&&O.to>y));if(!m){if(f<h.to&&n&&r&&n.visibleRanges.some(x=>x.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(H.cursor(f),!1,!0).head;x>u&&(f=x)}let O=this.gapSize(h,u,f,d),y=r||O<2e6?O:2e6;m=new V1(u,f,O,y)}l.push(m)},c=u=>{if(u.length<s||u.type!=Dn.Text)return;let f=Dne(u.from,u.to,this.stateDeco);if(f.total<s)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(r){let g=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,O;if(h!=null){let y=Qd(f,h),x=((this.visibleBottom-this.visibleTop)/2+g)/u.height;m=y-x,O=y+x}else m=(this.visibleTop-u.top-g)/u.height,O=(this.visibleBottom-u.top+g)/u.height;d=Ad(f,m),p=Ad(f,O)}else{let g=f.total*this.heightOracle.charWidth,m=i*this.heightOracle.charWidth,O=0;if(g>2e6)for(let v of e)v.from>=u.from&&v.from<u.to&&v.size!=v.displaySize&&v.from*this.heightOracle.charWidth+O<this.pixelViewport.left&&(O=v.size-v.displaySize);let y=this.pixelViewport.left+O,x=this.pixelViewport.right+O,b,S;if(h!=null){let v=Qd(f,h),w=((x-y)/2+m)/g;b=v-w,S=v+w}else b=(y-m)/g,S=(x+m)/g;d=Ad(f,b),p=Ad(f,S)}d>u.from&&a(u.from,d,u,f),p<u.to&&a(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,r,i){let o=Qd(i,r)-Qd(i,n);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){V1.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ke.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];qe.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o<r.length&&!(i&8);o++){let s=this.visibleRanges[o],l=r[o];(s.from!=l.from||s.to!=l.to)&&(i|=4,e&&e.mapPos(s.from,-1)==l.from&&e.mapPos(s.to,1)==l.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Vu(this.heightMap.lineAt(e,$t.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Vu(this.heightMap.lineAt(this.scaler.fromDOM(e),$t.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Vu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class $d{constructor(e,n){this.from=e,this.to=n}}function Dne(t,e,n){let r=[],i=t,o=0;return qe.spans(n,t,e,{span(){},point(s,l){s>i&&(r.push({from:i,to:s}),o+=s-i),i=l}},20),i<e&&(r.push({from:i,to:e}),o+=e-i),{total:o,ranges:r}}function Ad({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],l=s-o;if(r<=l)return o+r;r-=l}}function Qd(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Nne(t,e){for(let n of t)if(e(n))return n}const q5={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Y5(t){let e=t.facet(fO).filter(r=>typeof r!="function"),n=t.facet(BS).filter(r=>typeof r!="function");return n.length&&e.push(qe.join(n)),e}class jS{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:l,to:a})=>{let c=n.lineAt(l,$t.ByPos,e,0,0).top,u=n.lineAt(a,$t.ByPos,e,0,0).bottom;return i+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let l of this.viewports)l.domTop=s+(l.top-o)*this.scale,s=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);r=o.bottom,i=o.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);r=o.bottom,i=o.domBottom}}eq(e){return e instanceof jS?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Vu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Ti(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Vu(i,e)):t._content)}const Md=ye.define({combine:t=>t.join(" ")}),Dx=ye.define({combine:t=>t.indexOf(!0)>-1}),Nx=ss.newName(),B4=ss.newName(),F4=ss.newName(),Z4={"&light":"."+B4,"&dark":"."+F4};function Vx(t,e,n){return new ss(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Vne=Vx("."+Nx,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Z4),Bne={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},B1=Oe.ie&&Oe.ie_version<=11;class Fne{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new mte,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Oe.ie&&Oe.ie_version<=11||Oe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new zne(e),e.state.facet(Ao)&&(e.contentDOM.editContext=this.editContext.editContext)),B1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ao)?r.root.activeElement!=this.dom:!uf(this.dom,i))return;let o=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ff(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Kf(e.root);if(!n)return!1;let r=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Zne(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=uf(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&yte(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Bne),B1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),B1&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&ac(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&uf(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new one(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=E4(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Fg(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=U5(n,e.previousSibling||e.target.previousSibling,-1),i=U5(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ao)!=e.state.facet(Ao)&&(e.view.contentDOM.editContext=e.state.facet(Ao)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function U5(t,e,n){for(;e;){let r=Wt.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function G5(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return ff(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Zne(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return G5(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?G5(t,n):null}class zne{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:o,head:s}=i,l=this.toEditorPos(r.updateRangeStart),a=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>r.text.length;l==this.from&&o<this.from?l=o:a==this.to&&o>this.to&&(a=o);let u=$4(e.state.sliceDoc(l,a),r.text,(c?i.from:i.to)-l,c?"end":null);if(!u){let h=H.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Fg(h,i)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:rt.of(r.text.slice(u.from,u.toB).split(`
|
|
112
|
-
`))};if((Oe.mac||Oe.android)&&f.from==s-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:rt.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);ZS(e,f,H.single(this.toEditorPos(r.selectionStart,h),this.toEditorPos(r.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);s<l;s++){let a=e.coordsForChar(s);o=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||o||new DOMRect,i.push(o)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,l=o.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(l)){let a=this.toEditorPos(o.rangeStart),c=this.toEditorPos(o.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;i.push(ke.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:b4.of(ke.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=Kf(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,l,a,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(o<this.to){if(o<this.from||s>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class se{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Ote(e.parent)||document,this.viewState=new H5(this,e.state||ze.create(e)),e.scrollTo&&e.scrollTo.is(Td)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(za).map(i=>new R1(i));for(let i of this.plugins)i.update(this);this.observer=new Fne(this),this.inputState=new cne(this),this.inputState.ensureHandlers(this.plugins),this.docView=new R5(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof on?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let h of e){if(h.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=h.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(I4))?(this.inputState.notifiedFocused=s,l=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=D4(o,s),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(ze.phrases)!=this.state.facet(ze.phrases))return this.setState(o);i=Ng.create(this,o,e),i.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection,{x:p,y:g}=this.state.facet(se.cursorScrollMargin);f=new cc(d.empty?d:H.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of h.effects)d.is(Td)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=zg.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Nu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Md)!=i.state.facet(Md)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(Qx))try{h(i)}catch(d){yr(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!E4(this,u)&&c.force&&ac(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new H5(this,e),this.plugins=e.facet(za).map(r=>new R1(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new R5(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(za),r=e.state.facet(za);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new R1(o));else{let l=this.plugins[s];l.mustUpdate=e,i.push(l)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){yr(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:s,scaleY:l}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0){if(r4(r||this.win))o=-1,s=this.viewState.heightMap.height/this.viewState.scaleY;else{let p=this.viewState.scrollAnchorAt(i);o=p.from,s=p.top}l=this.viewState.scaleY}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let f=u.map(p=>{try{return p.read(this)}catch(g){return yr(this.state,g),K5}}),h=Ng.create(this,this.state,[]),d=!1;h.flags|=c,n?n.flags|=c:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),d=this.docView.update(h),d&&this.docViewUpdate());for(let p=0;p<u.length;p++)if(f[p]!=K5)try{let g=u[p];g.write&&g.write(f[p],this)}catch(g){yr(this.state,g)}if(d&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let g=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)/this.viewState.scaleY-s/l;if((g>1||g<-1)&&!(Oe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+g,r?o<0?r.scrollTop=r.scrollHeight:r.scrollTop+=g:this.win.scrollBy(0,g),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Qx))a(n)}get themeClasses(){return Nx+" "+(this.state.facet(Dx)?F4:B4)+" "+this.state.facet(Md)}updateAttrs(){let e=J5(this,v4,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ao)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),J5(this,VS,n);let r=this.observer.ignore(()=>{let i=P5(this.contentDOM,this.contentAttrs,n),o=P5(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(se.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Nu);let e=this.state.facet(se.cspNonce);ss.mount(this.root,this.styleModules.concat(Vne).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return N1(this,e,L5(this,e,n,r))}moveByGroup(e,n){return N1(this,e,L5(this,e,n,r=>Jte(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return H.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Kte(this,e,n,r)}moveVertically(e,n,r){return N1(this,e,ene(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Lx(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Lx(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[ro.find(i,e-r.from,-1,n)];return this.docView.coordsAt(e,n,o.dir==_t.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(O4)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>jne)return c4(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||a4(o.isolates,r=A5(this,e))))return o.order;r||(r=A5(this,e));let i=Cte(e.text,n,r);return this.bidiCache.push(new zg(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{n4(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var r,i,o,s;return Td.of(new cc(typeof e=="number"?H.cursor(e):e,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(o=n.yMargin)!==null&&o!==void 0?o:5,(s=n.xMargin)!==null&&s!==void 0?s:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Td.of(new cc(H.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ht.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ht.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ss.newName(),i=[Md.of(r),Nu.of(Vx(`.${r}`,e))];return n&&n.dark&&i.push(Dx.of(!0)),i}static baseTheme(e){return Fi.lowest(Nu.of(Vx("."+Nx,e,Z4)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Wt.get(r)||Wt.get(e);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}se.styleModule=Nu;se.inputHandler=g4;se.clipboardInputFilter=DS;se.clipboardOutputFilter=NS;se.scrollHandler=x4;se.focusChangeEffect=m4;se.perLineTextDirection=O4;se.exceptionSink=p4;se.updateListener=Qx;se.editable=Ao;se.mouseSelectionStyle=d4;se.dragMovesSelection=h4;se.clickAddsSelectionRange=f4;se.decorations=fO;se.blockWrappers=S4;se.outerDecorations=BS;se.atomicRanges=Zh;se.bidiIsolatedRanges=w4;se.cursorScrollMargin=ye.define({combine:t=>{let e=5,n=5;for(let r of t)typeof r=="number"?e=n=r:{x:e,y:n}=r;return{x:e,y:n}}});se.scrollMargins=k4;se.darkTheme=Dx;se.cspNonce=ye.define({combine:t=>t.length?t[0]:""});se.contentAttributes=VS;se.editorAttributes=v4;se.lineWrapping=se.contentAttributes.of({class:"cm-lineWrapping"});se.announce=Le.define();const jne=4096,K5={};class zg{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:_t.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let s=e[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new zg(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function J5(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&RS(s,n)}return n}const Xne=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function Wne(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,l;for(let a=0;a<n.length-1;++a){const c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),l&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function Rd(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const Hne=Fi.default(se.domEventHandlers({keydown(t,e){return j4(z4(e.state),t,e,"editor")}})),au=ye.define({enables:Hne}),eT=new WeakMap;function z4(t){let e=t.facet(au),n=eT.get(e);return n||eT.set(e,n=Une(e.reduce((r,i)=>r.concat(i),[]))),n}function qne(t,e,n){return j4(z4(t.state),e,t,n)}let ws=null;const Yne=4e3;function Une(t,e=Xne){let n=Object.create(null),r=Object.create(null),i=(s,l)=>{let a=r[s];if(a==null)r[s]=l;else if(a!=l)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,l,a,c,u)=>{var f,h;let d=n[s]||(n[s]=Object.create(null)),p=l.split(/ (?!$)/).map(O=>Wne(O,e));for(let O=1;O<p.length;O++){let y=p.slice(0,O).join(" ");i(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let b=ws={view:x,prefix:y,scope:s};return setTimeout(()=>{ws==b&&(ws=null)},Yne),!0}]})}let g=p.join(" ");i(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let l=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let h in u)u[h].run.push(d=>f(d,Bx))}let a=s[e]||s.key;if(a)for(let c of l)o(c,a,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+a,s.shift,s.preventDefault,s.stopPropagation)}return n}let Bx=null;function j4(t,e,n,r){Bx=e;let i=ute(e),o=gr(i,0),s=Ui(o)==i.length&&i!=" ",l="",a=!1,c=!1,u=!1;ws&&ws.view==n&&ws.scope==r&&(l=ws.prefix+" ",Q4.indexOf(e.keyCode)<0&&(c=!0,ws=null));let f=new Set,h=m=>{if(m){for(let O of m.run)if(!f.has(O)&&(f.add(O),O(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},d=t[r],p,g;return d&&(h(d[l+Rd(i,e,!s)])?a=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Xs[e.keyCode])&&p!=i?(h(d[l+Rd(p,e,!0)])||e.shiftKey&&(g=Uf[e.keyCode])!=i&&g!=p&&h(d[l+Rd(g,e,!1)]))&&(a=!0):s&&e.shiftKey&&h(d[l+Rd(i,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),Bx=null,a}class Al{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=X4(e);return[new Al(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Gne(e,n,r)}}function X4(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==_t.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function tT(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,l=t.posAtCoords({x:o.left+1,y:s}),a=t.posAtCoords({x:o.right-1,y:s});return l==null||a==null?r:{from:Math.max(r.from,Math.min(l,a)),to:Math.min(r.to,Math.max(l,a))}}function Gne(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==_t.LTR,s=t.contentDOM,l=s.getBoundingClientRect(),a=X4(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),h=l.right-(u?parseInt(u.paddingRight):0),d=Rx(t,r,1),p=Rx(t,i,-1),g=d.type==Dn.Text?d:null,m=p.type==Dn.Text?p:null;if(g&&(t.lineWrapping||d.widgetLineBreaks)&&(g=tT(t,r,1,g)),m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=tT(t,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let S=g?x(n.from,null,g):b(d,!1),v=m?x(null,n.to,m):b(p,!0),w=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&S.bottom+t.defaultLineHeight/2<v.top?w.push(O(f,S.bottom,h,v.top)):S.bottom<v.top&&t.elementAtHeight((S.bottom+v.top)/2).type==Dn.Text&&(S.bottom=v.top=(S.bottom+v.top)/2),y(S).concat(w).concat(y(v))}function O(S,v,w,k){return new Al(e,S-a.left,v-a.top,Math.max(0,w-S),k-v)}function y({top:S,bottom:v,horizontal:w}){let k=[];for(let P=0;P<w.length;P+=2)k.push(O(w[P],S,w[P+1],v));return k}function x(S,v,w){let k=1e9,P=-1e9,T=[];function M(D,Z,G,z,ee){let oe=t.coordsAtPos(D,D==w.to?-2:2),Q=t.coordsAtPos(G,G==w.from?2:-2);!oe||!Q||(k=Math.min(oe.top,Q.top,k),P=Math.max(oe.bottom,Q.bottom,P),ee==_t.LTR?T.push(o&&Z?f:oe.left,o&&z?h:Q.right):T.push(!o&&z?f:Q.left,!o&&Z?h:oe.right))}let I=S??w.from,$=v??w.to;for(let D of t.visibleRanges)if(D.to>I&&D.from<$)for(let Z=Math.max(D.from,I),G=Math.min(D.to,$);;){let z=t.state.doc.lineAt(Z);for(let ee of t.bidiSpans(z)){let oe=ee.from+z.from,Q=ee.to+z.from;if(oe>=G)break;Q>Z&&M(Math.max(oe,Z),S==null&&oe<=I,Math.min(Q,G),v==null&&Q>=$,ee.dir)}if(Z=z.to+1,Z>=G)break}return T.length==0&&M(I,S==null,$,v==null,t.textDirection),{top:k,bottom:P,horizontal:T}}function b(S,v){let w=l.top+(v?S.top:S.bottom);return{top:w,bottom:w,horizontal:[]}}}function Kne(t,e){return t.constructor==e.constructor&&t.eq(e)}class Jne{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Rp)!=e.state.facet(Rp)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Rp);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!Kne(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,Oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Rp=ye.define();function W4(t){return[Ht.define(e=>new Jne(e,t)),Rp.of(t)]}const Ec=ye.define({combine(t){return xo(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function ere(t={}){return[Ec.of(t),tre,nre,ire,y4.of(!0)]}function H4(t){return t.startState.facet(Ec)!=t.state.facet(Ec)}const tre=W4({above:!0,markers(t){let{state:e}=t,n=e.facet(Ec),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&Oe.ios&&n.iosSelectionHandles)){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:H.cursor(i.head,i.assoc);for(let a of Al.forRange(t,s,l))r.push(a)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=H4(t);return n&&nT(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){nT(e.state,t)},class:"cm-cursorLayer"});function nT(t,e){e.style.animationDuration=t.facet(Ec).cursorBlinkRate+"ms"}const nre=W4({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let i of r)if(!i.empty)for(let o of Al.forRange(t,"cm-selectionBackground",i))e.push(o);if(Oe.ios&&!n.empty&&t.state.facet(Ec).iosSelectionHandles){for(let i of Al.forRange(t,"cm-selectionHandle cm-selectionHandle-start",H.cursor(n.from,1)))e.push(i);for(let i of Al.forRange(t,"cm-selectionHandle cm-selectionHandle-end",H.cursor(n.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||H4(t)},class:"cm-selectionLayer"}),rre=Oe.gecko&&Oe.gecko_version==153?"#ffffff01":"transparent",ire=Fi.highest(se.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${rre} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),q4=Le.define({map(t,e){return t==null?null:e.mapPos(t)}}),Bu=cn.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(q4)?r.value:n,t)}}),ore=Ht.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Bu);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Bu)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Bu),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Bu)!=t&&this.view.dispatch({effects:q4.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function sre(){return[Bu,ore]}function rT(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=e.exec(o.value);)i(s+l.index,l)}function lre(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class are{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(l,a,c,u)=>i(u,c,c+l[0].length,l,a);else if(typeof r=="function")this.addMatch=(l,a,c,u)=>{let f=r(l,a,c);f&&u(c,c+l[0].length,f)};else if(r)this.addMatch=(l,a,c,u)=>u(c,c+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new ir,r=n.add.bind(n);for(let{from:i,to:o}of lre(e,this.maxLength))rT(e.state.doc,this.regexp,i,o,(s,l)=>this.addMatch(l,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),i=Math.max(a,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),l=Math.min(o.to,i);if(l>=s){let a=e.state.doc.lineAt(s),c=a.to<l?e.state.doc.lineAt(l):a,u=Math.max(o.from,a.from),f=Math.min(o.to,c.to);if(this.boundary){for(;s>a.from;s--)if(this.boundary.test(a.text[s-1-a.from])){u=s;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){f=l;break}}let h=[],d,p=(g,m,O)=>h.push(O.range(g,m));if(a==c)for(this.regexp.lastIndex=u-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,e,d.index+a.from,p);else rT(e.state.doc,this.regexp,u,f,(g,m)=>this.addMatch(m,e,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>g<u||m>f,add:h})}}return n}}const Fx=/x/.unicode!=null?"gu":"g",cre=new RegExp(`[\0-\b
|
|
113
|
-
--\u2028\u2029\uFEFF-]`,Fx),ure={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let F1=null;function fre(){var t;if(F1==null&&typeof document<"u"&&document.body){let e=document.body.style;F1=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return F1||!1}const Lp=ye.define({combine(t){let e=xo(t,{render:null,specialChars:cre,addSpecialChars:null});return(e.replaceTabs=!fre())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Fx)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Fx)),e}});function hre(t={}){return[Lp.of(t),dre()]}let iT=null;function dre(){return iT||(iT=Ht.fromClass(class{constructor(t){this.view=t,this.decorations=ke.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Lp)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new are({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=gr(e[0],0);if(o==9){let s=i.lineAt(r),l=n.state.tabSize,a=Ni(s.text,l,r-s.from);return ke.replace({widget:new Ore((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=ke.replace({widget:new mre(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Lp);t.startState.facet(Lp)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const pre="•";function gre(t){return t>=32?pre:t==10?"":String.fromCharCode(9216+t)}class mre extends pi{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=gre(this.code),r=e.state.phrase("Control character")+" "+(ure[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Ore extends pi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function yre(){return bre}const xre=ke.line({class:"cm-activeLine"}),bre=Ht.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(xre.range(i.from)),e=i.from)}return ke.set(n)}},{decorations:t=>t.decorations}),Zx=2e3;function vre(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>Zx||n.off>Zx||e.col<0||n.col<0){let s=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let a=r;a<=i;a++){let c=t.doc.line(a);c.length<=l&&o.push(H.range(c.from+s,c.to+l))}}else{let s=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let a=r;a<=i;a++){let c=t.doc.line(a),u=vx(c.text,s,t.tabSize,!0);if(u<0)o.push(H.cursor(c.to));else{let f=vx(c.text,l,t.tabSize);o.push(H.range(c.from+u,c.from+f))}}}return o}function Sre(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function oT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>Zx?-1:i==r.length?Sre(t,e.clientX):Ni(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function wre(t,e){let n=oT(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let l=oT(t,i);if(!l)return r;let a=vre(t.state,n,l);return a.length?s?H.create(a.concat(r.ranges)):H.create(a):r}}:null}function kre(t){let e=(n=>n.altKey&&n.button==0);return se.mouseSelectionStyle.of((n,r)=>e(r)?wre(n,r):null)}const Cre={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},_re={style:"cursor: crosshair"};function Tre(t={}){let[e,n]=Cre[t.key||"Alt"],r=Ht.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,se.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?_re:null})]}const Ld="-10000px";class Y4{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let s=[],l=n?[]:null;for(let a=0;a<o.length;a++){let c=o[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==c.create&&(u=f)}if(u<0)s[a]=this.createTooltipView(c,a?s[a-1]:null),l&&(l[a]=!!c.above);else{let f=s[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)s.indexOf(a)<0&&(this.removeTooltipView(a),(r=a.destroy)===null||r===void 0||r.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function Pre(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Z1=ye.define({combine:t=>{var e,n,r;return{position:Oe.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Pre}}}),sT=new WeakMap,XS=Ht.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Z1);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Y4(t,WS,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Z1);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Ld,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(Oe.safari){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(t=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=FS(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let l=this.manager.tooltipViews[s];return l.getCoords?l.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(Z1).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],h=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1)){u.style.top=Ld;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=h.right-h.left,m=(e=sT.get(c))!==null&&e!==void 0?e:h.bottom-h.top,O=c.offset||$re,y=this.view.textDirection==_t.LTR,x=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(d?14:0)+O.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(d?14:0)-O.x),r.right-g),b=this.above[l];!a.strictSide&&(b?f.top-m-p-O.y<r.top:f.bottom+m+p+O.y>r.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[l]=!b);let S=(b?f.top-r.top:r.bottom-f.bottom)-p;if(S<m&&c.resize!==!1){if(S<this.view.defaultLineHeight){u.style.top=Ld;continue}sT.set(c,m),u.style.height=(m=S)/o+"px"}else u.style.height&&(u.style.height="");let v=b?f.top-m-p-O.y:f.bottom+p+O.y,w=x+g;if(c.overlap!==!0)for(let k of s)k.left<w&&k.right>x&&k.top<v+m&&k.bottom>v&&(v=b?k.top-m-2-p:k.bottom+p+2);if(this.position=="absolute"?(u.style.top=(v-t.parent.top)/o+"px",lT(u,(x-t.parent.left)/i)):(u.style.top=v/o+"px",lT(u,x/i)),d){let k=f.left+(y?O.x:-O.x)-(x+14-7);d.style.left=k/i+"px"}c.overlap!==!0&&s.push({left:x,top:v,right:w,bottom:v+m}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Ld}},{eventObservers:{scroll(){this.maybeMeasure()}}});function lT(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const Ere=se.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$re={x:0,y:0},WS=ye.define({enables:[XS,Ere]}),jg=ye.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class gO{static create(e){return new gO(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Y4(e,jg,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Are=WS.compute([jg],t=>{let e=t.facet(jg);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:gO.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),U4=ye.define();class Qre{constructor(e,n,r,i,o,s){this.view=e,this.source=n,this.field=r,this.locked=i,this.setHover=o,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.tile.nearest(n.target);if(!r)return;let i,o=1;if(r.isWidget())i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let s=e.coordsAtPos(i);if(!s||n.y<s.top||n.y>s.bottom||n.x<s.left-e.defaultCharacterWidth||n.x>s.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),a=l&&l.dir==_t.RTL?-1:1;o=n.x<s.left?-a:a}this.activateHover(e,i,o)}activateHover(e,n,r,i){let o=this.source(e,n,r),s=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];i&&this.locked.set(a,i),e.dispatch({effects:this.setHover.of(a)})}};if(o&&"then"in o){let l=this.pending={pos:n};o.then(a=>{this.pending==l&&(this.pending=null,s(a))},a=>yr(e.state,a,"hover tooltip"))}else s(o)}get tooltip(){let e=this.view.plugin(XS),n=e?e.manager.tooltips.findIndex(r=>r.create==gO.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&!this.locked.has(i)&&o&&!Mre(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,l=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==l?this.view.posAtCoords(this.lastMove)!=s:!Rre(this.view,s,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Id=4;function Mre(t,e){let{left:n,right:r,top:i,bottom:o}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let l=s.getBoundingClientRect();i=Math.min(l.top,i),o=Math.max(l.bottom,o)}return e.clientX>=n-Id&&e.clientX<=r+Id&&e.clientY>=i-Id&&e.clientY<=o+Id}function Rre(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,l)<i)return!1;let a=t.posAtCoords({x:r,y:i},!1);return a>=e&&a<=n}function Lre(t,e={}){let n=Le.define(),r=new WeakMap,i=cn.define({create(){return[]},update(s,l){let a=r.get(s);if(s.length&&(e.hideOnChange&&(l.docChanged||l.selection)?s=[]:a&&a(l)?s=[]:e.hideOn&&(s=s.filter(c=>!e.hideOn(l,c)))),l.docChanged&&s.length){let c=[];for(let u of s){let f=l.changes.mapPos(u.pos,-1,Mn.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),u);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),c.push(h)}}s=c}for(let c of l.effects)c.is(n)&&(s=c.value,a=void 0),(c.is(Dre)&&!c.value||c.value==i)&&(s=[]);return s.length&&a&&r.set(s,a),s},provide:s=>jg.from(s)});const o=Ht.define(s=>new Qre(s,t,i,r,n,e.hoverTime||300));return{active:i,extension:[i,o,U4.of(o),Are]}}function Ire(t,e,n,r={}){var i;let o=t.state.facet(U4).map(s=>t.plugin(s)).filter(s=>!!s);if(r.tooltip&&r.tooltip.active){let s=o.find(l=>l.field==r.tooltip.active);s&&(o=[s])}for(let s of o)s.activateHover(t,e,n,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function G4(t,e){let n=t.plugin(XS);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const Dre=Le.define(),aT=ye.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function mO(t,e){let n=t.plugin(K4),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const K4=Ht.fromClass(class{constructor(t){this.input=t.state.facet(eh),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(aT);this.top=new Dd(t,!0,e.topContainer),this.bottom=new Dd(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(aT);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Dd(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Dd(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(eh);if(n!=this.input){let r=n.filter(a=>a),i=[],o=[],s=[],l=[];for(let a of r){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>se.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Dd{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=cT(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=cT(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function cT(t){let e=t.nextSibling;return t.remove(),e}const eh=ye.define({enables:K4});function Nre(t,e){let n,r=new Promise(s=>n=s),i=s=>Bre(s,e,n);t.state.field(Ip,!1)?t.dispatch({effects:J4.of(i)}):t.dispatch({effects:Le.appendConfig.of(Ip.init(()=>[i]))});let o=e7.of(i);return{close:o,result:r.then(s=>((t.win.queueMicrotask||(a=>t.win.setTimeout(a,10)))(()=>{t.state.field(Ip).indexOf(i)>-1&&t.dispatch({effects:o})}),s))}}function Vre(t,e){let n=t.state.field(Ip,!1)||[];for(let r of n){let i=mO(t,r);if(i&&i.dom.classList.contains(e))return i}return null}const Ip=cn.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(J4)?t=[n.value].concat(t):n.is(e7)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>eh.computeN([t],e=>e.field(t))}),J4=Le.define(),e7=Le.define();function Bre(t,e,n){let r=e.content?e.content(t,()=>s(null)):null;if(!r){if(r=xt("form"),e.input){let l=xt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),r.appendChild(xt("label",(e.label||"")+": ",l))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(xt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let l=0;l<i.length;l++){let a=i[l];a.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),s(null)):c.keyCode==13&&(c.preventDefault(),s(a))}),a.addEventListener("submit",c=>{c.preventDefault(),s(a)})}let o=xt("div",r,xt("button",{onclick:()=>s(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(o.className=e.class),o.classList.add("cm-dialog");function s(l){o.contains(o.ownerDocument.activeElement)&&t.focus(),n(l)}return{dom:o,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=r.querySelector(e.focus):l=r.querySelector("input")||r.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class po extends js{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}po.prototype.elementClass="";po.prototype.toDOM=void 0;po.prototype.mapMode=Mn.TrackBefore;po.prototype.startSide=po.prototype.endSide=-1;po.prototype.point=!0;const Dp=ye.define(),Fre=ye.define(),Zre={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>qe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},df=ye.define();function t7(t){return[n7(),df.of({...Zre,...t})]}const uT=ye.define({combine:t=>t.some(e=>e)});function n7(t){return[zre]}const zre=Ht.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(df).map(e=>new hT(t,e)),this.fixed=!t.state.facet(uT);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(uT)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=qe.iter(this.view.state.facet(Dp),this.view.viewport.from),r=[],i=this.gutters.map(o=>new jre(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let l of o.type)if(l.type==Dn.Text&&s){zx(n,r,l.from);for(let a of i)a.line(this.view,l,r);s=!1}else if(l.widget)for(let a of i)a.widget(this.view,l)}else if(o.type==Dn.Text){zx(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(df),n=t.state.facet(df),r=t.docChanged||t.heightChanged||t.viewportChanged||!qe.eq(t.startState.facet(Dp),t.state.facet(Dp),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new hT(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>se.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==_t.LTR?{left:r,right:i}:{right:r,left:i}})});function fT(t){return Array.isArray(t)?t:[t]}function zx(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class jre{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=qe.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let l=new r7(e,s,o,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];zx(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(Fre)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class hT{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let a=o.getBoundingClientRect();s=(a.top+a.bottom)/2}else s=i.clientY;let l=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=fT(n.markers(e)),n.initialSpacer&&(this.spacer=new r7(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=fT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!qe.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class r7{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),Xre(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let l=s,a=o<n.length?n[o++]:null,c=!1;if(a){let u=a.elementClass;u&&(r+=" "+u);for(let f=s;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;s<l;){let u=this.markers[s++];if(u.toDOM){u.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!a)break;a.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function Xre(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const Wre=ye.define(),Hre=ye.define(),ja=ye.define({combine(t){return xo(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let o=r[i],s=n[i];r[i]=o?(l,a,c)=>o(l,a,c)||s(l,a,c):s}return r}})}});class z1 extends po{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function j1(t,e){return t.state.facet(ja).formatNumber(e,t.state)}const qre=df.compute([ja],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Wre)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new z1(j1(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Hre)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(ja)!=e.state.facet(ja),initialSpacer(e){return new z1(j1(e,dT(e.state.doc.lines)))},updateSpacer(e,n){let r=j1(n.view,dT(n.view.state.doc.lines));return r==e.number?e:new z1(r)},domEventHandlers:t.facet(ja).domEventHandlers,side:"before"}));function HS(t={}){return[ja.of(t),n7(),qre]}function dT(t){let e=9;for(;e<t;)e=e*10+9;return e}const Yre=new class extends po{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ure=Dp.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(Yre.range(i)))}return qe.of(e)});function Gre(){return Ure}let Kre=0;class Ir{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Kre++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Ir&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Ir(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new Xg(e);return r=>r.modified.indexOf(n)>-1?r:Xg.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Jre=0;class Xg{constructor(e){this.name=e,this.instances=[],this.id=Jre++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&eie(n,l.modified));if(r)return r;let i=[],o=new Ir(e.name,i,e,n);for(let l of n)l.instances.push(o);let s=tie(n);for(let l of e.set)if(!l.modified.length)for(let a of s)i.push(Xg.get(l,a));return o}}function eie(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function tie(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function cu(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,l=i;for(let f=0;;){if(l=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);l=i.slice(f)}let a=o.length-1,c=o[a];if(!c)throw new RangeError("Invalid path: "+i);let u=new th(r,s,a>0?o.slice(0,a):null);e[c]=u.sort(e[c])}}return i7.add(e)}const i7=new Ve({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new th(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class th{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}th.empty=new th([],2,null);function o7(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let l of o)for(let a of l.set){let c=n[a.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function nie(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function rie(t,e,n,r=0,i=t.length){let o=new iie(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class iie{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:l,to:a}=e;if(l>=r||a<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let c=i,u=oie(e)||th.empty,f=nie(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let h=e.tree&&e.tree.prop(Ve.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(h.tree.type)),g=e.firstChild();for(let m=0,O=l;;m++){let y=m<h.overlay.length?h.overlay[m]:null,x=y?y.from+l:a,b=Math.max(n,O),S=Math.min(r,x);if(b<S&&g)for(;e.from<S&&(this.highlightRange(e,b,S,i,o),this.startSpan(Math.min(S,e.to),c),!(e.to>=x||!e.nextSibling())););if(!y||x>r)break;O=y.to+l,O>n&&(this.highlightRange(d.cursor(),Math.max(n,y.from+l),Math.min(r,O),"",p),this.startSpan(Math.min(r,O),c))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function oie(t){let e=t.type.prop(i7);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const de=Ir.define,Nd=de(),xs=de(),pT=de(xs),gT=de(xs),bs=de(),Vd=de(bs),X1=de(bs),Hi=de(),hl=de(Hi),Xi=de(),Wi=de(),jx=de(),$u=de(jx),Bd=de(),A={comment:Nd,lineComment:de(Nd),blockComment:de(Nd),docComment:de(Nd),name:xs,variableName:de(xs),typeName:pT,tagName:de(pT),propertyName:gT,attributeName:de(gT),className:de(xs),labelName:de(xs),namespace:de(xs),macroName:de(xs),literal:bs,string:Vd,docString:de(Vd),character:de(Vd),attributeValue:de(Vd),number:X1,integer:de(X1),float:de(X1),bool:de(bs),regexp:de(bs),escape:de(bs),color:de(bs),url:de(bs),keyword:Xi,self:de(Xi),null:de(Xi),atom:de(Xi),unit:de(Xi),modifier:de(Xi),operatorKeyword:de(Xi),controlKeyword:de(Xi),definitionKeyword:de(Xi),moduleKeyword:de(Xi),operator:Wi,derefOperator:de(Wi),arithmeticOperator:de(Wi),logicOperator:de(Wi),bitwiseOperator:de(Wi),compareOperator:de(Wi),updateOperator:de(Wi),definitionOperator:de(Wi),typeOperator:de(Wi),controlOperator:de(Wi),punctuation:jx,separator:de(jx),bracket:$u,angleBracket:de($u),squareBracket:de($u),paren:de($u),brace:de($u),content:Hi,heading:hl,heading1:de(hl),heading2:de(hl),heading3:de(hl),heading4:de(hl),heading5:de(hl),heading6:de(hl),contentSeparator:de(Hi),list:de(Hi),quote:de(Hi),emphasis:de(Hi),strong:de(Hi),link:de(Hi),monospace:de(Hi),strikethrough:de(Hi),inserted:de(),deleted:de(),changed:de(),invalid:de(),meta:Bd,documentMeta:de(Bd),annotation:de(Bd),processingInstruction:de(Bd),definition:Ir.defineModifier("definition"),constant:Ir.defineModifier("constant"),function:Ir.defineModifier("function"),standard:Ir.defineModifier("standard"),local:Ir.defineModifier("local"),special:Ir.defineModifier("special")};for(let t in A){let e=A[t];e instanceof Ir&&(e.name=t)}o7([{tag:A.link,class:"tok-link"},{tag:A.heading,class:"tok-heading"},{tag:A.emphasis,class:"tok-emphasis"},{tag:A.strong,class:"tok-strong"},{tag:A.keyword,class:"tok-keyword"},{tag:A.atom,class:"tok-atom"},{tag:A.bool,class:"tok-bool"},{tag:A.url,class:"tok-url"},{tag:A.labelName,class:"tok-labelName"},{tag:A.inserted,class:"tok-inserted"},{tag:A.deleted,class:"tok-deleted"},{tag:A.literal,class:"tok-literal"},{tag:A.string,class:"tok-string"},{tag:A.number,class:"tok-number"},{tag:[A.regexp,A.escape,A.special(A.string)],class:"tok-string2"},{tag:A.variableName,class:"tok-variableName"},{tag:A.local(A.variableName),class:"tok-variableName tok-local"},{tag:A.definition(A.variableName),class:"tok-variableName tok-definition"},{tag:A.special(A.variableName),class:"tok-variableName2"},{tag:A.definition(A.propertyName),class:"tok-propertyName tok-definition"},{tag:A.typeName,class:"tok-typeName"},{tag:A.namespace,class:"tok-namespace"},{tag:A.className,class:"tok-className"},{tag:A.macroName,class:"tok-macroName"},{tag:A.propertyName,class:"tok-propertyName"},{tag:A.operator,class:"tok-operator"},{tag:A.comment,class:"tok-comment"},{tag:A.meta,class:"tok-meta"},{tag:A.invalid,class:"tok-invalid"},{tag:A.punctuation,class:"tok-punctuation"}]);var W1;const Ps=new Ve;function OO(t){return ye.define({combine:t?e=>e.concat(t):void 0})}const qS=new Ve;class Nr{constructor(e,n,r=[],i=""){this.data=e,this.name=i,ze.prototype.hasOwnProperty("tree")||Object.defineProperty(ze.prototype,"tree",{get(){return wt(this)}}),this.parser=n,this.extension=[Hs.of(this),ze.languageData.of((o,s,l)=>{let a=mT(o,s,l),c=a.type.prop(Ps);if(!c)return[];let u=o.facet(c),f=a.type.prop(qS);if(f){let h=a.resolve(s-a.from,l);for(let d of f)if(d.test(h,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return mT(e,n,r).type.prop(Ps)==this.data}findRegions(e){let n=e.facet(Hs);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(Ps)==this.data){r.push({from:s,to:s+o.length});return}let l=o.prop(Ve.mounted);if(l){if(l.tree.prop(Ps)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+s,to:a.to+s});else r.push({from:s,to:s+o.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+s),r.length>a)return}}for(let a=0;a<o.children.length;a++){let c=o.children[a];c instanceof Ye&&i(c,o.positions[a]+s)}};return i(wt(e),0),r}get allowsNesting(){return!0}}Nr.setState=Le.define();function mT(t,e,n){let r=t.facet(Hs),i=wt(t).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(e,n,dt.ExcludeBuffers|dt.EnterBracketed))o.type.isTop&&(i=o);return i}class $c extends Nr{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=OO(e.languageData);return new $c(n,e.parser.configure({props:[Ps.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new $c(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function wt(t){let e=t.field(Nr.state,!1);return e?e.tree:Ye.empty}class sie{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Au=null;class ea{constructor(e,n,r=[],i,o,s,l,a){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new ea(e,n,[],Ye.empty,0,r,[],null)}startParse(){return this.parser.startParse(new sie(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ye.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(jo.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(jo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Au;Au=this;try{return e()}finally{Au=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=OT(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,h)=>a.push({fromA:c,toA:u,fromB:f,toB:h})),r=jo.applyChanges(r,a),i=Ye.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new ea(this.parser,n,r,i,o,s,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=OT(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends cO{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let a=Au;if(a){for(let c of i)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=s,new Ye(an.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Au}}function OT(t,e,n){return jo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Ac{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Ac(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=ea.create(e.facet(Hs).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Ac(r)}}Nr.state=cn.define({create:Ac.init,update(t,e){for(let n of e.effects)if(n.is(Nr.setState))return n.value;return e.startState.facet(Hs)!=e.state.facet(Hs)?Ac.init(e.state):t.apply(e)}});let s7=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(s7=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const H1=typeof navigator<"u"&&(!((W1=navigator.scheduling)===null||W1===void 0)&&W1.isInputPending)?()=>navigator.scheduling.isInputPending():null,lie=Ht.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Nr.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Nr.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=s7(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(Nr.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!H1?Math.max(25,e.timeRemaining()-5):1e9),l=o.context.treeLen<i&&r.doc.length>i+1e3,a=o.context.work(()=>H1&&H1()||Date.now()>s,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Nr.setState.of(new Ac(o.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>yr(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Hs=ye.define({combine(t){return t.length?t[0]:null},enables:t=>[Nr.state,lie,se.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Qc{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class j{constructor(e,n,r,i,o,s=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new j(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(o=>o==n))return i;if(r)for(let i of e)for(let o of i.alias){let s=n.indexOf(o);if(s>-1&&(o.length>2||!/\w/.test(n[s-1])&&!/\w/.test(n[s+o.length])))return i}return null}}const aie=ye.define(),zh=ye.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ta(t){let e=t.facet(zh);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function nh(t,e){let n="",r=t.tabSize,i=t.facet(zh)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function YS(t,e){t instanceof ze&&(t=new yO(t));for(let r of t.state.facet(aie)){let i=r(t,e);if(i!==void 0)return i}let n=wt(t.state);return n.length>=e?cie(t,n,e):null}class yO{constructor(e,n={}){this.state=e,this.options=n,this.unit=ta(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return Ni(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uu=new Ve;function cie(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return l7(r,t,n)}function l7(t,e,n){for(let r=t;r;r=r.next){let i=fie(r.node);if(i)return i(US.create(e,n,r))}return 0}function uie(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function fie(t){let e=t.type.prop(uu);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Ve.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>a7(s,!0,1,void 0,o&&!uie(s)?i.from:void 0)}return t.parent==null?hie:null}function hie(){return 0}class US extends yO{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new US(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(die(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return l7(this.context.next,this.base,this.pos)}}function die(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function pie(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=s)return null;let c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function gie({closing:t,align:e=!0,units:n=1}){return r=>a7(r,e,n,t)}function a7(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,l=r&&o.slice(s,s+r.length)==r||i==t.pos+s,a=e?pie(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}const mie=t=>t.baseIndent;function Np({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Oie=200;function yie(){return ze.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Oie)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,l=-1,a=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==l)continue;l=u.from;let f=YS(s,u.from);if(f==null)continue;let h=/^\s*/.exec(u.text)[0],d=nh(s,f);h!=d&&a.push({from:u.from,to:u.from+h.length,insert:d})}return a.length?[t,{changes:a,sequential:!0}]:t})}const c7=ye.define(),fu=new Ve;function u7(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function xie(t,e,n){let r=wt(t);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let l=s.node;if(l.to<=n||l.from>n)continue;if(o&&l.from<e)break;let a=l.type.prop(fu);if(a&&(l.to<r.length-50||r.length==t.doc.length||!bie(l))){let c=a(l,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(o=c)}}return o}function bie(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Wg(t,e,n){for(let r of t.facet(c7)){let i=r(t,e,n);if(i)return i}return xie(t,e,n)}function f7(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const xO=Le.define({map:f7}),jh=Le.define({map:f7});function h7(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const na=cn.define({create(){return ke.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>t=yT(t,r,i)),t=t.map(e.changes);let n=[];for(let r of e.effects)r.is(xO)&&!vie(t,r.value.from,r.value.to)?n.push(r.value):r.is(jh)&&(t=t.update({filter:(i,o)=>r.value.from!=i||r.value.to!=o,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=e.state.facet(g7),i=n.map(o=>(r?ke.replace({widget:new Pie(r(e.state,o))}):xT).range(o.from,o.to));t=t.update({add:i})}return e.selection&&(t=yT(t,e.selection.main.head)),t},provide:t=>se.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(xT.range(r,i))}return ke.set(e,!0)}});function yT(t,e,n=e){let r=!1;return t.between(e,n,(i,o)=>{i<n&&o>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,o)=>i>=n||o<=e}):t}function Hg(t,e,n){var r;let i=null;return(r=t.field(na,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function vie(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function d7(t,e){return t.field(na,!1)?e:e.concat(Le.appendConfig.of(m7()))}const Sie=t=>{for(let e of h7(t)){let n=Wg(t.state,e.from,e.to);if(n)return t.dispatch({effects:d7(t.state,[xO.of(n),p7(t,n)])}),!0}return!1},wie=t=>{if(!t.state.field(na,!1))return!1;let e=[];for(let n of h7(t)){let r=Hg(t.state,n.from,n.to);r&&e.push(jh.of(r),p7(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function p7(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return se.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const kie=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=Wg(e,i.from,i.to);o&&n.push(xO.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:d7(t.state,n)}),!!n.length},Cie=t=>{let e=t.state.field(na,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(jh.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},_ie=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Sie},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:wie},{key:"Ctrl-Alt-[",run:kie},{key:"Ctrl-Alt-]",run:Cie}],Tie={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},g7=ye.define({combine(t){return xo(t,Tie)}});function m7(t){return[na,Aie]}function O7(t,e){let{state:n}=t,r=n.facet(g7),i=s=>{let l=t.lineBlockAt(t.posAtDOM(s.target)),a=Hg(t.state,l.from,l.to);a&&t.dispatch({effects:jh.of(a)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const xT=ke.replace({widget:new class extends pi{toDOM(t){return O7(t,null)}}});class Pie extends pi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return O7(e,this.value)}}const Eie={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class q1 extends po{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function $ie(t={}){let e={...Eie,...t},n=new q1(e,!0),r=new q1(e,!1),i=Ht.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Hs)!=s.state.facet(Hs)||s.startState.field(na,!1)!=s.state.field(na,!1)||wt(s.startState)!=wt(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let l=new ir;for(let a of s.viewportLineBlocks){let c=Hg(s.state,a.from,a.to)?r:Wg(s.state,a.from,a.to)?n:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:o}=e;return[i,t7({class:"cm-foldGutter",markers(s){var l;return((l=s.plugin(i))===null||l===void 0?void 0:l.markers)||qe.empty},initialSpacer(){return new q1(e,!1)},domEventHandlers:{...o,click:(s,l,a)=>{if(o.click&&o.click(s,l,a))return!0;let c=Hg(s.state,l.from,l.to);if(c)return s.dispatch({effects:jh.of(c)}),!0;let u=Wg(s.state,l.from,l.to);return u?(s.dispatch({effects:xO.of(u)}),!0):!1}}}),m7()]}const Aie=se.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Xh{constructor(e,n){this.specs=e;let r;function i(l){let a=ss.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof Nr?l=>l.prop(Ps)==s.data:s?l=>l==s:void 0,this.style=o7(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:o}).style,this.module=r?new ss(r):null,this.themeType=n.themeType}static define(e,n){return new Xh(e,n||{})}}const Xx=ye.define(),y7=ye.define({combine(t){return t.length?[t[0]]:null}});function Y1(t){let e=t.facet(Xx);return e.length?e:t.facet(y7)}function x7(t,e){let n=[Mie],r;return t instanceof Xh&&(t.module&&n.push(se.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(y7.of(t)):r?n.push(Xx.computeN([se.darkTheme],i=>i.facet(se.darkTheme)==(r=="dark")?[t]:[])):n.push(Xx.of(t)),n}class Qie{constructor(e){this.markCache=Object.create(null),this.tree=wt(e.state),this.decorations=this.buildDeco(e,Y1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=wt(e.state),r=Y1(e.state),i=r!=Y1(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return ke.none;let r=new ir;for(let{from:i,to:o}of e.visibleRanges)rie(this.tree,n,(s,l,a)=>{r.add(s,l,this.markCache[a]||(this.markCache[a]=ke.mark({class:a})))},i,o);return r.finish()}}const Mie=Fi.high(Ht.fromClass(Qie,{decorations:t=>t.decorations})),Rie=Xh.define([{tag:A.meta,color:"#404740"},{tag:A.link,textDecoration:"underline"},{tag:A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.keyword,color:"#708"},{tag:[A.atom,A.bool,A.url,A.contentSeparator,A.labelName],color:"#219"},{tag:[A.literal,A.inserted],color:"#164"},{tag:[A.string,A.deleted],color:"#a11"},{tag:[A.regexp,A.escape,A.special(A.string)],color:"#e40"},{tag:A.definition(A.variableName),color:"#00f"},{tag:A.local(A.variableName),color:"#30a"},{tag:[A.typeName,A.namespace],color:"#085"},{tag:A.className,color:"#167"},{tag:[A.special(A.variableName),A.macroName],color:"#256"},{tag:A.definition(A.propertyName),color:"#00c"},{tag:A.comment,color:"#940"},{tag:A.invalid,color:"#f00"}]),Lie=se.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),b7=1e4,v7="()[]{}",S7=ye.define({combine(t){return xo(t,{afterCursor:!0,brackets:v7,maxScanDistance:b7,renderMatch:Nie})}}),Iie=ke.mark({class:"cm-matchingBracket"}),Die=ke.mark({class:"cm-nonmatchingBracket"});function Nie(t){let e=[],n=t.matched?Iie:Die;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function bT(t){let e=[],n=t.facet(S7);for(let r of t.selection.ranges){if(!r.empty)continue;let i=io(t,r.head,-1,n)||r.head>0&&io(t,r.head-1,1,n)||n.afterCursor&&(io(t,r.head,1,n)||r.head<t.doc.length&&io(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return ke.set(e,!0)}const Vie=Ht.fromClass(class{constructor(t){this.paused=!1,this.decorations=bT(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=bT(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),Bie=[Vie,Lie];function Fie(t={}){return[S7.of(t),Bie]}const w7=new Ve;function Wx(t,e,n){let r=t.prop(e<0?Ve.openedBy:Ve.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Hx(t){let e=t.type.prop(w7);return e?e(t.node):t}function io(t,e,n,r={}){let i=r.maxScanDistance||b7,o=r.brackets||v7,s=wt(t),l=s.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=Wx(a.type,n,o);if(c&&a.from<a.to){let u=Hx(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Zie(t,e,n,a,u,c,o)}}return zie(t,e,n,s,l.type,i,o)}function Zie(t,e,n,r,i,o,s){let l=r.parent,a={from:i.from,to:i.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from<u.to){let f=Hx(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Wx(u.type,n,s))c++;else if(Wx(u.type,-n,s)){if(c==0){let f=Hx(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function zie(t,e,n,r,i,o,s){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=s.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!u.next().done&&h<=o;){let d=u.value;n<0&&(h+=d.length);let p=e+h*n;for(let g=n>0?0:d.length-1,m=n>0?d.length:-1;g!=m;g+=n){let O=s.indexOf(d[g]);if(!(O<0||r.resolveInner(p+g,1).type!=i))if(O%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:O>>1==a>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}function vT(t,e,n,r=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=i;for(let s=r;s<e;s++)t.charCodeAt(s)==9?o+=n-o%n:o++;return o}class k7{constructor(e,n,r,i){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=vT(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:vT(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let i=s=>r?s.toLowerCase():s,o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&n!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function jie(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Xie,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||JS,mergeTokens:t.mergeTokens!==!1}}function Xie(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const ST=new WeakMap;class GS extends Nr{constructor(e){let n=OO(e.languageData),r=jie(e),i,o=new class extends cO{createParse(s,l,a){return new Hie(i,s,l,a)}};super(n,o,[],e.name),this.topNode=Uie(n,this),i=this,this.streamParser=r,this.stateAfter=new Ve({perNode:!0}),this.tokenTable=e.tokenTable?new P7(r.tokenTable):Yie}static define(e){return new GS(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=ST.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let i=KS(this,e.node.tree,e.node.from,e.node.from,n??e.pos),o,s;if(i?(s=i.state,o=i.pos+1):(s=this.streamParser.startState(e.unit),o=e.node.from),e.pos-o>1e4)return null;for(;o<e.pos;){let a=e.state.doc.lineAt(o),c=Math.min(e.pos,a.to);if(a.length){let u=r?r(a.from):-1,f=new k7(a.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;f.pos<c-a.from;)_7(this.streamParser.token,f,s)}else this.streamParser.blankLine(s,e.unit);if(c==e.pos)break;o=a.to+1}let l=e.lineAt(e.pos);return r&&n==null&&ST.set(e.state,l.from),this.streamParser.indent(s,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function KS(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let s=e.children.length-1;s>=0;s--){let l=e.children[s],a=n+e.positions[s],c=l instanceof Ye&&a<i&&KS(t,l,a,r,i);if(c)return c}return null}function C7(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;!i&&n==0&&e.type==t.topNode&&(i=!0);for(let o=e.children.length-1;o>=0;o--){let s=e.positions[o],l=e.children[o],a;if(s<r&&l instanceof Ye){if(!(a=C7(t,l,n-s,r-s,i)))break;return i?new Ye(e.type,e.children.slice(0,o).concat(a),e.positions.slice(0,o+1),s+a.length):a}}return null}function Wie(t,e,n,r,i){for(let o of e){let s=o.from+(o.openStart?25:0),l=o.to-(o.openEnd?25:0),a=s<=n&&l>n&&KS(t,o.tree,0-o.offset,n,l),c;if(a&&a.pos<=r&&(c=C7(t,o.tree,n+o.offset,a.pos+o.offset,!1)))return{state:a.state,tree:c}}return{state:t.streamParser.startState(i?ta(i):4),tree:Ye.empty}}let Hie=class{constructor(e,n,r,i){this.lang=e,this.input=n,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let o=ea.get(),s=i[0].from,{state:l,tree:a}=Wie(e,r,s,this.to,o?.state);this.state=l,this.parsedPos=this.chunkStart=s+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);o&&this.parsedPos<o.viewport.from-1e5&&i.some(c=>c.from<=o.viewport.from&&c.to>=o.viewport.from)&&(this.state=this.lang.streamParser.startState(ta(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=ea.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
|
114
|
-
`&&(n="");else{let r=n.indexOf(`
|
|
115
|
-
`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let i=this.rangeIndex;;){let o=this.ranges[i].to;if(o>=r||(n=n.slice(0,o-(r-n.length)),i++,i==this.ranges.length))break;let s=this.ranges[i].from,l=this.lineAfter(s);n+=l,r=s+l.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let i=this.ranges[this.rangeIndex].to,o=e+n;if(r>0?i>o:i>=o)break;let s=this.ranges[++this.rangeIndex].from;n+=s-i}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,r,i){let o=4;if(this.ranges.length>1){i=this.skipGapsTo(n,i,1),n+=i;let l=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,o+=this.chunk.length-l}let s=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&s>=0&&this.chunk[s]==e&&this.chunk[s+2]==n?this.chunk[s+2]=r:this.chunk.push(e,n,r,o),i}parseLine(e){let{line:n,end:r}=this.nextLine(),i=0,{streamParser:o}=this.lang,s=new k7(n,e?e.state.tabSize:4,e?ta(e.state):2);if(s.eol())o.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let l=_7(o.token,s,this.state);if(l&&(i=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+s.start,this.parsedPos+s.pos,i)),s.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Ye.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:qie,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Ye(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Ye(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function _7(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let i=t(e,n);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const JS=Object.create(null),rh=[an.none],qie=new su(rh),wT=[],kT=Object.create(null),T7=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])T7[t]=E7(JS,e);class P7{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),T7)}resolve(e){return e?this.table[e]||(this.table[e]=E7(this.extra,e)):0}}const Yie=new P7(JS);function U1(t,e){wT.indexOf(t)>-1||(wT.push(t),console.warn(e))}function E7(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||A[c];u?typeof u=="function"?a.length?a=a.map(u):U1(c,`Modifier ${c} used at start of tag`):a.length?U1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:U1(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(l=>l.id),o=kT[i];if(o)return o.id;let s=kT[i]=an.define({id:rh.length,name:r,props:[cu({[r]:n})]});return rh.push(s),s.id}function Uie(t,e){let n=an.define({id:rh.length,name:"Document",props:[Ps.add(()=>t),uu.add(()=>r=>e.getIndent(r))],top:!0});return rh.push(n),n}_t.RTL,_t.LTR;function te(t){return new Qc(GS.define(t))}function ms(t){return W(()=>import("./index-rAZqRLhj.js"),__vite__mapDeps([0,1,2])).then(e=>e.sql({dialect:e[t]}))}const Gie=[j.of({name:"C",extensions:["c","h","ino"],load(){return W(()=>import("./index-p5w5E19N.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),j.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return W(()=>import("./index-p5w5E19N.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),j.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ms("Cassandra")}}),j.of({name:"CSS",extensions:["css"],load(){return W(()=>Promise.resolve().then(()=>Bfe),void 0).then(t=>t.css())}}),j.of({name:"Go",extensions:["go"],load(){return W(()=>import("./index-CDY-uFno.js"),__vite__mapDeps([4,1,2])).then(t=>t.go())}}),j.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return W(()=>Promise.resolve().then(()=>Mhe),void 0).then(t=>t.html())}}),j.of({name:"Java",extensions:["java"],load(){return W(()=>import("./index-BrGHSw5I.js"),__vite__mapDeps([5,1,2])).then(t=>t.java())}}),j.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return W(()=>Promise.resolve().then(()=>tp),void 0).then(t=>t.javascript())}}),j.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return W(()=>import("./index-CcGsEtey.js"),__vite__mapDeps([6,1,2])).then(t=>t.jinja())}}),j.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return W(()=>import("./index-CntcQxRr.js"),__vite__mapDeps([7,1,2])).then(t=>t.json())}}),j.of({name:"JSX",extensions:["jsx"],load(){return W(()=>Promise.resolve().then(()=>tp),void 0).then(t=>t.javascript({jsx:!0}))}}),j.of({name:"LESS",extensions:["less"],load(){return W(()=>import("./index-C1tY1uK0.js"),__vite__mapDeps([8,1,2])).then(t=>t.less())}}),j.of({name:"Liquid",extensions:["liquid"],load(){return W(()=>import("./index-IosqBxL0.js"),__vite__mapDeps([9,1,2])).then(t=>t.liquid())}}),j.of({name:"MariaDB SQL",load(){return ms("MariaSQL")}}),j.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return W(()=>Promise.resolve().then(()=>jhe),void 0).then(t=>t.markdown())}}),j.of({name:"MS SQL",load(){return ms("MSSQL")}}),j.of({name:"MySQL",load(){return ms("MySQL")}}),j.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return W(()=>import("./index-Cw6eNCH7.js"),__vite__mapDeps([10,1,2])).then(t=>t.php())}}),j.of({name:"PLSQL",extensions:["pls"],load(){return ms("PLSQL")}}),j.of({name:"PostgreSQL",load(){return ms("PostgreSQL")}}),j.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return W(()=>import("./index-CpDzWqX0.js"),__vite__mapDeps([11,1,2])).then(t=>t.python())}}),j.of({name:"Rust",extensions:["rs"],load(){return W(()=>import("./index-yGDq5Egm.js"),__vite__mapDeps([12,1,2])).then(t=>t.rust())}}),j.of({name:"Sass",extensions:["sass"],load(){return W(()=>import("./index-iRFYcgNN.js"),__vite__mapDeps([13,1,2])).then(t=>t.sass({indented:!0}))}}),j.of({name:"SCSS",extensions:["scss"],load(){return W(()=>import("./index-iRFYcgNN.js"),__vite__mapDeps([13,1,2])).then(t=>t.sass())}}),j.of({name:"SQL",extensions:["sql"],load(){return ms("StandardSQL")}}),j.of({name:"SQLite",load(){return ms("SQLite")}}),j.of({name:"TSX",extensions:["tsx"],load(){return W(()=>Promise.resolve().then(()=>tp),void 0).then(t=>t.javascript({jsx:!0,typescript:!0}))}}),j.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return W(()=>Promise.resolve().then(()=>tp),void 0).then(t=>t.javascript({typescript:!0}))}}),j.of({name:"WebAssembly",extensions:["wat","wast"],load(){return W(()=>import("./index-BuiRW-03.js"),__vite__mapDeps([14,1,2])).then(t=>t.wast())}}),j.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return W(()=>import("./index-BkznuDSS.js"),__vite__mapDeps([15,1,2])).then(t=>t.xml())}}),j.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return W(()=>import("./index-B_BJEGG5.js"),__vite__mapDeps([16,1,2])).then(t=>t.yaml())}}),j.of({name:"APL",extensions:["dyalog","apl"],load(){return W(()=>import("./apl-B4CMkyY2.js"),[]).then(t=>te(t.apl))}}),j.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return W(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(t=>te(t.asciiArmor))}}),j.of({name:"ASN.1",extensions:["asn","asn1"],load(){return W(()=>import("./asn1-EdZsLKOL.js"),[]).then(t=>te(t.asn1({})))}}),j.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return W(()=>import("./asterisk-B-8jnY81.js"),[]).then(t=>te(t.asterisk))}}),j.of({name:"Brainfuck",extensions:["b","bf"],load(){return W(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(t=>te(t.brainfuck))}}),j.of({name:"Cobol",extensions:["cob","cpy"],load(){return W(()=>import("./cobol-CWcv1MsR.js"),[]).then(t=>te(t.cobol))}}),j.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.csharp))}}),j.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return W(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>te(t.clojure))}}),j.of({name:"ClojureScript",extensions:["cljs"],load(){return W(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>te(t.clojure))}}),j.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return W(()=>import("./css-BnMrqG3P.js"),[]).then(t=>te(t.gss))}}),j.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return W(()=>import("./cmake-BQqOBYOt.js"),[]).then(t=>te(t.cmake))}}),j.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return W(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(t=>te(t.coffeeScript))}}),j.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return W(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(t=>te(t.commonLisp))}}),j.of({name:"Cypher",extensions:["cyp","cypher"],load(){return W(()=>import("./cypher-C_CwsFkJ.js"),[]).then(t=>te(t.cypher))}}),j.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return W(()=>import("./python-BuPzkPfP.js"),[]).then(t=>te(t.cython))}}),j.of({name:"Crystal",extensions:["cr"],load(){return W(()=>import("./crystal-SjHAIU92.js"),[]).then(t=>te(t.crystal))}}),j.of({name:"D",extensions:["d"],load(){return W(()=>import("./d-pRatUO7H.js"),[]).then(t=>te(t.d))}}),j.of({name:"Dart",extensions:["dart"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.dart))}}),j.of({name:"diff",extensions:["diff","patch"],load(){return W(()=>import("./diff-DbItnlRl.js"),[]).then(t=>te(t.diff))}}),j.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return W(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([17,18])).then(t=>te(t.dockerFile))}}),j.of({name:"DTD",extensions:["dtd"],load(){return W(()=>import("./dtd-DF_7sFjM.js"),[]).then(t=>te(t.dtd))}}),j.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return W(()=>import("./dylan-DwRh75JA.js"),[]).then(t=>te(t.dylan))}}),j.of({name:"EBNF",load(){return W(()=>import("./ebnf-CDyGwa7X.js"),[]).then(t=>te(t.ebnf))}}),j.of({name:"ECL",extensions:["ecl"],load(){return W(()=>import("./ecl-Cabwm37j.js"),[]).then(t=>te(t.ecl))}}),j.of({name:"edn",extensions:["edn"],load(){return W(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>te(t.clojure))}}),j.of({name:"Eiffel",extensions:["e"],load(){return W(()=>import("./eiffel-CnydiIhH.js"),[]).then(t=>te(t.eiffel))}}),j.of({name:"Elm",extensions:["elm"],load(){return W(()=>import("./elm-vLlmbW-K.js"),[]).then(t=>te(t.elm))}}),j.of({name:"Erlang",extensions:["erl"],load(){return W(()=>import("./erlang-BNw1qcRV.js"),[]).then(t=>te(t.erlang))}}),j.of({name:"Esper",load(){return W(()=>import("./sql-D0XecflT.js"),[]).then(t=>te(t.esper))}}),j.of({name:"Factor",extensions:["factor"],load(){return W(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([19,18])).then(t=>te(t.factor))}}),j.of({name:"FCL",load(){return W(()=>import("./fcl-Kvtd6kyn.js"),[]).then(t=>te(t.fcl))}}),j.of({name:"Forth",extensions:["forth","fth","4th"],load(){return W(()=>import("./forth-Ffai-XNe.js"),[]).then(t=>te(t.forth))}}),j.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return W(()=>import("./fortran-DYz_wnZ1.js"),[]).then(t=>te(t.fortran))}}),j.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return W(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>te(t.fSharp))}}),j.of({name:"Gas",extensions:["s"],load(){return W(()=>import("./gas-Bneqetm1.js"),[]).then(t=>te(t.gas))}}),j.of({name:"Gherkin",extensions:["feature"],load(){return W(()=>import("./gherkin-heZmZLOM.js"),[]).then(t=>te(t.gherkin))}}),j.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return W(()=>import("./groovy-D9Dt4D0W.js"),[]).then(t=>te(t.groovy))}}),j.of({name:"Haskell",extensions:["hs"],load(){return W(()=>import("./haskell-Cw1EW3IL.js"),[]).then(t=>te(t.haskell))}}),j.of({name:"Haxe",extensions:["hx"],load(){return W(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>te(t.haxe))}}),j.of({name:"HXML",extensions:["hxml"],load(){return W(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>te(t.hxml))}}),j.of({name:"HTTP",load(){return W(()=>import("./http-DBlCnlav.js"),[]).then(t=>te(t.http))}}),j.of({name:"IDL",extensions:["pro"],load(){return W(()=>import("./idl-BEugSyMb.js"),[]).then(t=>te(t.idl))}}),j.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return W(()=>import("./javascript-iXu5QeM3.js"),[]).then(t=>te(t.jsonld))}}),j.of({name:"Julia",extensions:["jl"],load(){return W(()=>import("./julia-DuME0IfC.js"),[]).then(t=>te(t.julia))}}),j.of({name:"Kotlin",extensions:["kt","kts"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.kotlin))}}),j.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return W(()=>import("./livescript-BwQOo05w.js"),[]).then(t=>te(t.liveScript))}}),j.of({name:"Lua",extensions:["lua"],load(){return W(()=>import("./lua-VAEuO923.js"),[]).then(t=>te(t.lua))}}),j.of({name:"mIRC",extensions:["mrc"],load(){return W(()=>import("./mirc-CjQqDB4T.js"),[]).then(t=>te(t.mirc))}}),j.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return W(()=>import("./mathematica-DTrFuWx2.js"),[]).then(t=>te(t.mathematica))}}),j.of({name:"Modelica",extensions:["mo"],load(){return W(()=>import("./modelica-Dc1JOy9r.js"),[]).then(t=>te(t.modelica))}}),j.of({name:"MUMPS",extensions:["mps"],load(){return W(()=>import("./mumps-BT43cFF4.js"),[]).then(t=>te(t.mumps))}}),j.of({name:"Mbox",extensions:["mbox"],load(){return W(()=>import("./mbox-CNhZ1qSd.js"),[]).then(t=>te(t.mbox))}}),j.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return W(()=>import("./nginx-DdIZxoE0.js"),[]).then(t=>te(t.nginx))}}),j.of({name:"NSIS",extensions:["nsh","nsi"],load(){return W(()=>import("./nsis-LY0VT_u5.js"),__vite__mapDeps([20,18])).then(t=>te(t.nsis))}}),j.of({name:"NTriples",extensions:["nt","nq"],load(){return W(()=>import("./ntriples-BfvgReVJ.js"),[]).then(t=>te(t.ntriples))}}),j.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.objectiveC))}}),j.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.objectiveCpp))}}),j.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return W(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>te(t.oCaml))}}),j.of({name:"Octave",extensions:["m"],load(){return W(()=>import("./octave-Ck1zUtKM.js"),[]).then(t=>te(t.octave))}}),j.of({name:"Oz",extensions:["oz"],load(){return W(()=>import("./oz-BzwKVEFT.js"),[]).then(t=>te(t.oz))}}),j.of({name:"Pascal",extensions:["p","pas"],load(){return W(()=>import("./pascal--L3eBynH.js"),[]).then(t=>te(t.pascal))}}),j.of({name:"Perl",extensions:["pl","pm"],load(){return W(()=>import("./perl-CdXCOZ3F.js"),[]).then(t=>te(t.perl))}}),j.of({name:"Pig",extensions:["pig"],load(){return W(()=>import("./pig-CevX1Tat.js"),[]).then(t=>te(t.pig))}}),j.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return W(()=>import("./powershell-CFHJl5sT.js"),[]).then(t=>te(t.powerShell))}}),j.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return W(()=>import("./properties-C78fOPTZ.js"),[]).then(t=>te(t.properties))}}),j.of({name:"ProtoBuf",extensions:["proto"],load(){return W(()=>import("./protobuf-ChK-085T.js"),[]).then(t=>te(t.protobuf))}}),j.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return W(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([21,22])).then(t=>te(t.pug))}}),j.of({name:"Puppet",extensions:["pp"],load(){return W(()=>import("./puppet-DMA9R1ak.js"),[]).then(t=>te(t.puppet))}}),j.of({name:"Q",extensions:["q"],load(){return W(()=>import("./q-pXgVlZs6.js"),[]).then(t=>te(t.q))}}),j.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return W(()=>import("./r-B6wPVr8A.js"),[]).then(t=>te(t.r))}}),j.of({name:"RPM Changes",load(){return W(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>te(t.rpmChanges))}}),j.of({name:"RPM Spec",extensions:["spec"],load(){return W(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>te(t.rpmSpec))}}),j.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return W(()=>import("./ruby-BK5aLJev.js"),[]).then(t=>te(t.ruby))}}),j.of({name:"SAS",extensions:["sas"],load(){return W(()=>import("./sas-B4kiWyti.js"),[]).then(t=>te(t.sas))}}),j.of({name:"Scala",extensions:["scala"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.scala))}}),j.of({name:"Scheme",extensions:["scm","ss"],load(){return W(()=>import("./scheme-C41bIUwD.js"),[]).then(t=>te(t.scheme))}}),j.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return W(()=>import("./shell-CjFT_Tl9.js"),[]).then(t=>te(t.shell))}}),j.of({name:"Sieve",extensions:["siv","sieve"],load(){return W(()=>import("./sieve-C3Gn_uJK.js"),[]).then(t=>te(t.sieve))}}),j.of({name:"Smalltalk",extensions:["st"],load(){return W(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(t=>te(t.smalltalk))}}),j.of({name:"Solr",load(){return W(()=>import("./solr-DehyRSwq.js"),[]).then(t=>te(t.solr))}}),j.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return W(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>te(t.sml))}}),j.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return W(()=>import("./sparql-DkYu6x3z.js"),[]).then(t=>te(t.sparql))}}),j.of({name:"Spreadsheet",alias:["excel","formula"],load(){return W(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(t=>te(t.spreadsheet))}}),j.of({name:"Squirrel",extensions:["nut"],load(){return W(()=>import("./clike-B9uivgTg.js"),[]).then(t=>te(t.squirrel))}}),j.of({name:"Stylus",extensions:["styl"],load(){return W(()=>import("./stylus-B533Al4x.js"),[]).then(t=>te(t.stylus))}}),j.of({name:"Swift",extensions:["swift"],load(){return W(()=>import("./swift-BzpIVaGY.js"),[]).then(t=>te(t.swift))}}),j.of({name:"sTeX",load(){return W(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>te(t.stex))}}),j.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return W(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>te(t.stex))}}),j.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return W(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>te(t.verilog))}}),j.of({name:"Tcl",extensions:["tcl"],load(){return W(()=>import("./tcl-DVfN8rqt.js"),[]).then(t=>te(t.tcl))}}),j.of({name:"Textile",extensions:["textile"],load(){return W(()=>import("./textile-CnDTJFAw.js"),[]).then(t=>te(t.textile))}}),j.of({name:"TiddlyWiki",load(){return W(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(t=>te(t.tiddlyWiki))}}),j.of({name:"Tiki wiki",load(){return W(()=>import("./tiki-DGYXhP31.js"),[]).then(t=>te(t.tiki))}}),j.of({name:"TOML",extensions:["toml"],load(){return W(()=>import("./toml-Bm5Em-hy.js"),[]).then(t=>te(t.toml))}}),j.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return W(()=>import("./troff-wAsdV37c.js"),[]).then(t=>te(t.troff))}}),j.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return W(()=>import("./ttcn-CfJYG6tj.js"),[]).then(t=>te(t.ttcn))}}),j.of({name:"TTCN_CFG",extensions:["cfg"],load(){return W(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(t=>te(t.ttcnCfg))}}),j.of({name:"Turtle",extensions:["ttl"],load(){return W(()=>import("./turtle-B1tBg_DP.js"),[]).then(t=>te(t.turtle))}}),j.of({name:"Web IDL",extensions:["webidl"],load(){return W(()=>import("./webidl-ZXfAyPTL.js"),[]).then(t=>te(t.webIDL))}}),j.of({name:"VB.NET",extensions:["vb"],load(){return W(()=>import("./vb-CmGdzxic.js"),[]).then(t=>te(t.vb))}}),j.of({name:"VBScript",extensions:["vbs"],load(){return W(()=>import("./vbscript-BuJXcnF6.js"),[]).then(t=>te(t.vbScript))}}),j.of({name:"Velocity",extensions:["vtl"],load(){return W(()=>import("./velocity-D8B20fx6.js"),[]).then(t=>te(t.velocity))}}),j.of({name:"Verilog",extensions:["v"],load(){return W(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>te(t.verilog))}}),j.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return W(()=>import("./vhdl-lSbBsy5d.js"),[]).then(t=>te(t.vhdl))}}),j.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return W(()=>import("./xquery-DzFWVndE.js"),[]).then(t=>te(t.xQuery))}}),j.of({name:"Yacas",extensions:["ys"],load(){return W(()=>import("./yacas-BJ4BC0dw.js"),[]).then(t=>te(t.yacas))}}),j.of({name:"Z80",extensions:["z80"],load(){return W(()=>import("./z80-Hz9HOZM7.js"),[]).then(t=>te(t.z80))}}),j.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return W(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>te(t.mscgen))}}),j.of({name:"Xù",extensions:["xu"],load(){return W(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>te(t.xu))}}),j.of({name:"MsGenny",extensions:["msgenny"],load(){return W(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>te(t.msgenny))}}),j.of({name:"Vue",extensions:["vue"],load(){return W(()=>import("./index-6VtYKf_K.js"),__vite__mapDeps([23,1,2])).then(t=>t.vue())}}),j.of({name:"Angular Template",load(){return W(()=>import("./index-DfK1f9gz.js"),__vite__mapDeps([24,1,2])).then(t=>t.angular())}})],Kie=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=tw(t.state,n.from);return r.line?Jie(t):r.block?toe(t):!1};function ew(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Jie=ew(ioe,0),eoe=ew($7,0),toe=ew((t,e)=>$7(t,e,roe(e)),0);function tw(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Qu=50;function noe(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-Qu,r),s=t.sliceDoc(i,i+Qu),l=/\s*$/.exec(o)[0].length,a=/^\s*/.exec(s)[0].length,c=o.length-l;if(o.slice(c-e.length,c)==e&&s.slice(a,a+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+a,margin:a&&1}};let u,f;i-r<=2*Qu?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+Qu),f=t.sliceDoc(i-Qu,i));let h=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return u.slice(h,h+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function roe(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function $7(t,e,n=e.selection.ranges){let r=n.map(o=>tw(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>noe(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,l;s<i.length;s++)if(l=i[s]){let a=r[s],{open:c,close:u}=l;o.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:o}}return null}function ioe(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:o,to:s}of n){let l=r.length,a=1e9,c;for(let u=o;u<=s;){let f=e.doc.lineAt(u);if(c==null&&(c=tw(e,f.from).line,!c))continue e;if(f.from>i&&(o==s||s>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+c.length)==c?h:-1;h<f.text.length&&h<a&&(a=h),r.push({line:f,comment:p,token:c,indent:h,empty:d,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=a);r.length==l+1&&(r[l].single=!0)}if(t!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:l.from+c,insert:a+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:l,token:a}of r)if(l>=0){let c=s.from+l,u=c+a.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const qx=ds.define(),ooe=ds.define(),soe=ye.define(),A7=ye.define({combine(t){return xo(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),Q7=cn.define({create(){return oo.empty},update(t,e){let n=e.state.facet(A7),r=e.annotation(qx);if(r){let a=xr.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return a?u=qg(u,u.length,n.minDepth,a):u=L7(u,e.startState.selection),new oo(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(ooe);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(on.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=xr.fromTransaction(e),s=e.annotation(on.time),l=e.annotation(on.userEvent);return o?t=t.addChanges(o,s,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,l,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new oo(t.done.map(xr.fromJSON),t.undone.map(xr.fromJSON))}});function loe(t={}){return[Q7,A7.of(t),se.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?M7:e.inputType=="historyRedo"?Yx:null;return r?(e.preventDefault(),r(n)):!1}})]}function bO(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(Q7,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const M7=bO(0,!1),Yx=bO(1,!1),aoe=bO(0,!0),coe=bO(1,!0);class xr{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new xr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new xr(e.changes&&tn.fromJSON(e.changes),[],e.mapped&&lo.fromJSON(e.mapped),e.startSelection&&H.fromJSON(e.startSelection),e.selectionsAfter.map(H.fromJSON))}static fromTransaction(e,n){let r=ei;for(let i of e.startState.facet(soe)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new xr(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ei)}static selection(e){return new xr(void 0,ei,void 0,void 0,e)}}function qg(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function uoe(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&s<=u&&(r=!0)}}),r}function foe(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function R7(t,e){return t.length?e.length?t.concat(e):t:e}const ei=[],hoe=200;function L7(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-hoe));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),qg(t,t.length-1,1e9,n.setSelAfter(r)))}else return[xr.selection([e])]}function doe(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function G1(t,e){if(!t.length)return t;let n=t.length,r=ei;for(;n;){let i=poe(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[xr.selection(r)]:ei}function poe(t,e,n){let r=R7(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ei,n);if(!t.changes)return xr.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new xr(i,Le.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const goe=/^(input\.type|delete)($|\.)/;class oo{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new oo(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,l=s[s.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||goe.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,uoe(l.changes,e.changes))||r=="input.type.compose")?s=qg(s,s.length-1,i.minDepth,new xr(e.changes.compose(l.changes),R7(Le.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,ei)):s=qg(s,s.length,i.minDepth,e),new oo(s,ei,n,r)}addSelection(e,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:ei;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&foe(o[o.length-1],e)?this:new oo(L7(this.done,e),this.undone,n,r)}addMapping(e){return new oo(G1(this.done,e),G1(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:qx.of({side:e,rest:doe(i),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let l=i.length==1?ei:i.slice(0,i.length-1);return o.mapped&&(l=G1(l,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:qx.of({side:e,rest:l,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}oo.empty=new oo(ei,ei);const moe=[{key:"Mod-z",run:M7,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Yx,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Yx,preventDefault:!0},{key:"Mod-u",run:aoe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:coe,preventDefault:!0}];function hu(t,e){return H.create(t.ranges.map(e),t.mainIndex)}function Zi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function zi({state:t,dispatch:e},n){let r=hu(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Zi(t,r)),!0)}function vO(t,e){return H.cursor(e?t.to:t.from)}function I7(t,e){return zi(t,n=>n.empty?t.moveByChar(n,e):vO(n,e))}function Gn(t){return t.textDirectionAt(t.state.selection.main.head)==_t.LTR}const D7=t=>I7(t,!Gn(t)),N7=t=>I7(t,Gn(t));function V7(t,e){return zi(t,n=>n.empty?t.moveByGroup(n,e):vO(n,e))}const Ooe=t=>V7(t,!Gn(t)),yoe=t=>V7(t,Gn(t));function xoe(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function SO(t,e,n){let r=wt(t).resolveInner(e.head),i=n?Ve.closedBy:Ve.openedBy;for(let a=e.head;;){let c=n?r.childAfter(a):r.childBefore(a);if(!c)break;xoe(t,c,i)?r=c:a=n?c.to:c.from}let o=r.type.prop(i),s,l;return o&&(s=n?io(t,r.from,1):io(t,r.to,-1))&&s.matched?l=n?s.end.to:s.end.from:l=n?r.to:r.from,H.cursor(l,n?-1:1)}const boe=t=>zi(t,e=>SO(t.state,e,!Gn(t))),voe=t=>zi(t,e=>SO(t.state,e,Gn(t)));function B7(t,e){return zi(t,n=>{if(!n.empty)return vO(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const F7=t=>B7(t,!1),Z7=t=>B7(t,!0);function z7(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let o of t.state.facet(se.scrollMargins)){let s=o(t);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function j7(t,e){let n=z7(t),{state:r}=t,i=hu(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):vO(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;s&&s.top>a&&s.bottom<c&&(o=se.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-a}))}return t.dispatch(Zi(r,i),{effects:o}),!0}const CT=t=>j7(t,!1),Ux=t=>j7(t,!0);function il(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=H.cursor(r.from+o))}return i}const Soe=t=>zi(t,e=>il(t,e,!0)),woe=t=>zi(t,e=>il(t,e,!1)),koe=t=>zi(t,e=>il(t,e,!Gn(t))),Coe=t=>zi(t,e=>il(t,e,Gn(t))),_oe=t=>zi(t,e=>H.cursor(t.lineBlockAt(e.head).from,1)),Toe=t=>zi(t,e=>H.cursor(t.lineBlockAt(e.head).to,-1));function Poe(t,e,n){let r=!1,i=hu(t.selection,o=>{let s=io(t,o.head,-1)||io(t,o.head,1)||o.head>0&&io(t,o.head-1,1)||o.head<t.doc.length&&io(t,o.head+1,-1);if(!s||!s.end)return o;r=!0;let l=s.start.from==o.head?s.end.to:s.end.from;return H.cursor(l)});return r?(e(Zi(t,i)),!0):!1}const Eoe=({state:t,dispatch:e})=>Poe(t,e);function gi(t,e,n){let r=hu(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=H.range(i.head,i.anchor));let o=n(i);return H.range(i.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return r.eq(t.state.selection)?!1:(t.dispatch(Zi(t.state,r)),!0)}function X7(t,e){return gi(t,e,n=>t.moveByChar(n,e))}const W7=t=>X7(t,!Gn(t)),H7=t=>X7(t,Gn(t));function q7(t,e){return gi(t,e,n=>t.moveByGroup(n,e))}const $oe=t=>q7(t,!Gn(t)),Aoe=t=>q7(t,Gn(t)),Qoe=t=>{let e=!Gn(t);return gi(t,e,n=>SO(t.state,n,e))},Moe=t=>{let e=Gn(t);return gi(t,e,n=>SO(t.state,n,e))};function Y7(t,e){return gi(t,e,n=>t.moveVertically(n,e))}const U7=t=>Y7(t,!1),G7=t=>Y7(t,!0);function K7(t,e){return gi(t,e,n=>t.moveVertically(n,e,z7(t).height))}const _T=t=>K7(t,!1),TT=t=>K7(t,!0),Roe=t=>gi(t,!0,e=>il(t,e,!0)),Loe=t=>gi(t,!1,e=>il(t,e,!1)),Ioe=t=>{let e=!Gn(t);return gi(t,e,n=>il(t,n,e))},Doe=t=>{let e=Gn(t);return gi(t,e,n=>il(t,n,e))},Noe=t=>gi(t,!1,e=>H.cursor(t.lineBlockAt(e.head).from)),Voe=t=>gi(t,!0,e=>H.cursor(t.lineBlockAt(e.head).to)),PT=({state:t,dispatch:e})=>(e(Zi(t,{anchor:0})),!0),ET=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.doc.length})),!0),$T=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.selection.main.anchor,head:0})),!0),AT=({state:t,dispatch:e})=>(e(Zi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Boe=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Foe=({state:t,dispatch:e})=>{let n=wO(t).map(({from:r,to:i})=>H.undirectionalRange(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:H.create(n),userEvent:"select"})),!0},Zoe=({state:t,dispatch:e})=>{let n=hu(t.selection,r=>{let i=wt(t),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:l}=s;if((l.from<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&s.next)return H.undirectionalRange(l.from,l.to)}return r});return n.eq(t.selection)?!1:(e(Zi(t,n)),!0)};function J7(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(e?s.to<t.state.doc.length:s.from>0)for(let l=o;;){let a=t.moveVertically(l,e);if(a.head<s.from||a.head>s.to){i.some(c=>c.head==a.head)||i.push(a);break}else{if(a.head==l.head)break;l=a}}}return i.length==r.ranges.length?!1:(t.dispatch(Zi(n,H.create(i,i.length-1))),!0)}const zoe=t=>J7(t,!1),joe=t=>J7(t,!0),Xoe=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=H.create([n.main]):n.main.empty||(r=H.create([H.cursor(n.main.head)])),r?(e(Zi(t,r)),!0):!1};function Wh(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:l}=o;if(s==l){let a=e(o);a<s?(n="delete.backward",a=Fd(t,a,!1)):a>s&&(n="delete.forward",a=Fd(t,a,!0)),s=Math.min(s,a),l=Math.max(l,a)}else s=Fd(t,s,!1),l=Fd(t,l,!0);return s==l?{range:o}:{changes:{from:s,to:l},range:H.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?se.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Fd(t,e,n){if(t instanceof se)for(let r of t.state.facet(se.atomicRanges).map(i=>i(t)))r.between(e,e,(i,o)=>{i<e&&o>e&&(e=n?o:i)});return e}const e8=(t,e,n)=>Wh(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),l,a;if(n&&!e&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(l=s.text.slice(0,i-s.from))){if(l[l.length-1]==" ")return i-1;let c=Ni(l,o.tabSize),u=c%ta(o)||ta(o);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)i--;a=i}else a=Sn(s.text,i-s.from,e,e)+s.from,a==i&&s.number!=(e?o.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(a-s.from,i-s.from))&&(a=Sn(s.text,a-s.from,!1,!1)+s.from);return a}),Gx=t=>e8(t,!1,!0),t8=t=>e8(t,!0,!1),n8=(t,e)=>Wh(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let l=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let a=Sn(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),u=s(c);if(l!=null&&u!=l)break;(c!=" "||r!=n.head)&&(l=u),r=a}return r}),r8=t=>n8(t,!1),Woe=t=>n8(t,!0),Hoe=t=>Wh(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),qoe=t=>Wh(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Yoe=t=>Wh(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Uoe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:rt.of(["",""])},range:H.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Goe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:Sn(o.text,i-o.from,!1)+o.from,l=i==o.to?i+1:Sn(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:l,insert:t.doc.slice(i,l).append(t.doc.slice(s,i))},range:H.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function wO(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function i8(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of wO(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),l=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let a of o.ranges)i.push(H.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let a of o.ranges)i.push(H.range(a.anchor-l,a.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:H.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Koe=({state:t,dispatch:e})=>i8(t,e,!1),Joe=({state:t,dispatch:e})=>i8(t,e,!0);function o8(t,e,n){if(t.readOnly)return!1;let r=[];for(let o of wO(t))n?r.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):r.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ese=({state:t,dispatch:e})=>o8(t,e,!1),tse=({state:t,dispatch:e})=>o8(t,e,!0),nse=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(wO(e).map(({from:i,to:o})=>(i>0?i--:o<e.doc.length&&o++,{from:i,to:o}))),r=hu(e.selection,i=>{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),l=t.coordsAtPos(i.head,i.assoc||1);l&&(o=s.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function rse(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=wt(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Ve.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const QT=s8(!1),ise=s8(!0);function s8(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,l=e.doc.lineAt(o),a=!t&&o==s&&rse(e,o);t&&(o=s=(s<=l.to?l:e.doc.lineAt(s)).to);let c=new yO(e,{simulateBreak:o,simulateDoubleBreak:!!a}),u=YS(c,o);for(u==null&&(u=Ni(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));s<l.to&&/\s/.test(l.text[s-l.from]);)s++;a?{from:o,to:s}=a:o>l.from&&o<l.from+100&&!/\S/.test(l.text.slice(0,o))&&(o=l.from);let f=["",nh(e,u)];return a&&f.push(nh(e,c.lineIndent(l.from,-1))),{changes:{from:o,to:s,insert:rt.of(f)},range:H.cursor(o+1+f[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function nw(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let l=t.doc.lineAt(s);l.number>n&&(r.empty||r.to>l.from)&&(e(l,i,r),n=l.number),s=l.to+1}let o=t.changes(i);return{changes:i,range:H.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const ose=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new yO(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=nw(t,(o,s,l)=>{let a=YS(r,o.from);if(a==null)return;/\S/.test(o.text)||(a=0);let c=/^\s*/.exec(o.text)[0],u=nh(t,a);(c!=u||l.from<o.from+c.length)&&(n[o.from]=a,s.push({from:o.from,to:o.from+c.length,insert:u}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},l8=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(n,r)=>{r.push({from:n.from,insert:t.facet(zh)})}),{userEvent:"input.indent"})),!0),a8=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Ni(i,t.tabSize),s=0,l=nh(t,Math.max(0,o-ta(t)));for(;s<i.length&&s<l.length&&i.charCodeAt(s)==l.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:l.slice(s)})}),{userEvent:"delete.dedent"})),!0),sse=t=>(t.setTabFocusMode(),!0),lse=[{key:"Ctrl-b",run:D7,shift:W7,preventDefault:!0},{key:"Ctrl-f",run:N7,shift:H7},{key:"Ctrl-p",run:F7,shift:U7},{key:"Ctrl-n",run:Z7,shift:G7},{key:"Ctrl-a",run:_oe,shift:Noe},{key:"Ctrl-e",run:Toe,shift:Voe},{key:"Ctrl-d",run:t8},{key:"Ctrl-h",run:Gx},{key:"Ctrl-k",run:Hoe},{key:"Ctrl-Alt-h",run:r8},{key:"Ctrl-o",run:Uoe},{key:"Ctrl-t",run:Goe},{key:"Ctrl-v",run:Ux}],ase=[{key:"ArrowLeft",run:D7,shift:W7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Ooe,shift:$oe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:koe,shift:Ioe,preventDefault:!0},{key:"ArrowRight",run:N7,shift:H7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:yoe,shift:Aoe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Coe,shift:Doe,preventDefault:!0},{key:"ArrowUp",run:F7,shift:U7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:PT,shift:$T},{mac:"Ctrl-ArrowUp",run:CT,shift:_T},{key:"ArrowDown",run:Z7,shift:G7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ET,shift:AT},{mac:"Ctrl-ArrowDown",run:Ux,shift:TT},{key:"PageUp",run:CT,shift:_T},{key:"PageDown",run:Ux,shift:TT},{key:"Home",run:woe,shift:Loe,preventDefault:!0},{key:"Mod-Home",run:PT,shift:$T},{key:"End",run:Soe,shift:Roe,preventDefault:!0},{key:"Mod-End",run:ET,shift:AT},{key:"Enter",run:QT,shift:QT},{key:"Mod-a",run:Boe},{key:"Backspace",run:Gx,shift:Gx,preventDefault:!0},{key:"Delete",run:t8,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:r8,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Woe,preventDefault:!0},{mac:"Mod-Backspace",run:qoe,preventDefault:!0},{mac:"Mod-Delete",run:Yoe,preventDefault:!0}].concat(lse.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),cse=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:boe,shift:Qoe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:voe,shift:Moe},{key:"Alt-ArrowUp",run:Koe},{key:"Shift-Alt-ArrowUp",run:ese},{key:"Alt-ArrowDown",run:Joe},{key:"Shift-Alt-ArrowDown",run:tse},{key:"Mod-Alt-ArrowUp",run:zoe},{key:"Mod-Alt-ArrowDown",run:joe},{key:"Escape",run:Xoe},{key:"Mod-Enter",run:ise},{key:"Alt-l",mac:"Ctrl-l",run:Foe},{key:"Mod-i",run:Zoe,preventDefault:!0},{key:"Mod-[",run:a8},{key:"Mod-]",run:l8},{key:"Mod-Alt-\\",run:ose},{key:"Shift-Mod-k",run:nse},{key:"Shift-Mod-\\",run:Eoe},{key:"Mod-/",run:Kie},{key:"Alt-A",mac:"Ctrl-A",run:eoe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:sse}].concat(ase),use={key:"Tab",run:l8,shift:a8},MT="#2e3440",rw="#3b4252",RT="#434c5e",Zd="#4c566a",LT="#e5e9f0",Kx="#eceff4",K1="#8fbcbb",IT="#88c0d0",fse="#81a1c1",vi="#5e81ac",hse="#bf616a",$a="#d08770",J1="#ebcb8b",DT="#a3be8c",dse="#b48ead",NT="#d30102",iw=Kx,e0=iw,pse="#ffffff",t0=rw,gse=iw,VT=rw,mse=se.theme({"&":{color:MT,backgroundColor:pse},".cm-content":{caretColor:VT},".cm-cursor, .cm-dropCursor":{borderLeftColor:VT},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:gse},".cm-panels":{backgroundColor:iw,color:Zd},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Zd}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:LT},".cm-activeLine":{backgroundColor:e0},".cm-selectionMatch":{backgroundColor:LT},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Zd}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Kx},".cm-gutters":{backgroundColor:Kx,color:MT,border:"none"},".cm-activeLineGutter":{backgroundColor:e0},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:t0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:t0,borderBottomColor:t0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:e0,color:Zd}}},{dark:!1}),Ose=Xh.define([{tag:A.keyword,color:vi},{tag:[A.name,A.deleted,A.character,A.propertyName,A.macroName],color:$a},{tag:[A.variableName],color:$a},{tag:[A.function(A.variableName)],color:vi},{tag:[A.labelName],color:fse},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:vi},{tag:[A.definition(A.name),A.separator],color:DT},{tag:[A.brace],color:K1},{tag:[A.annotation],color:NT},{tag:[A.number,A.changed,A.annotation,A.modifier,A.self,A.namespace],color:IT},{tag:[A.typeName,A.className],color:J1},{tag:[A.operator,A.operatorKeyword],color:DT},{tag:[A.tagName],color:dse},{tag:[A.squareBracket],color:hse},{tag:[A.angleBracket],color:$a},{tag:[A.attributeName],color:J1},{tag:[A.regexp],color:vi},{tag:[A.quote],color:rw},{tag:[A.string],color:$a},{tag:A.link,color:K1,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[A.url,A.escape,A.special(A.string)],color:$a},{tag:[A.meta],color:IT},{tag:[A.comment],color:RT,fontStyle:"italic"},{tag:A.strong,fontWeight:"bold",color:vi},{tag:A.emphasis,fontStyle:"italic",color:vi},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.heading,fontWeight:"bold",color:vi},{tag:A.special(A.heading1),fontWeight:"bold",color:vi},{tag:A.heading1,fontWeight:"bold",color:vi},{tag:[A.heading2,A.heading3,A.heading4],fontWeight:"bold",color:vi},{tag:[A.heading5,A.heading6],color:vi},{tag:[A.atom,A.bool,A.special(A.variableName)],color:$a},{tag:[A.processingInstruction,A.inserted],color:K1},{tag:[A.contentSeparator],color:J1},{tag:A.invalid,color:RT,borderBottom:`1px dotted ${NT}`}]),c8=[mse,x7(Ose)],BT=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Mc{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?l=>o(BT(l)):BT,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return gr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=$S(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ui(e);let i=this.normalize(n);if(i.length)for(let o=0,s=r,l=!0;;o++){let a=i.charCodeAt(o),c=this.match(a,s,l,this.bufferPos+this.bufferStart,o==i.length-1);if(c)return this.value=c,this;if(o==i.length-1)break;l&&o<n.length&&n.charCodeAt(o)==a?s++:l=!1}}}match(e,n,r,i,o){let s=null;for(let l=0;l<this.matches.length;){let a=this.matches[l],c=!1;this.query.charCodeAt(a.index)==e&&(a.index==this.query.length-1?s={from:a.from,to:i,precise:o&&a.precise}:(a.index++,c=!0)),c?l++:this.matches.splice(l,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:n,to:i,precise:r&&o}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Mc.prototype[Symbol.iterator]=function(){return this});const u8={from:-1,to:-1,match:/.*/.exec(""),precise:!0},ow="gm"+(/x/.unicode==null?"":"u");class f8{constructor(e,n,r,i=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=u8,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new h8(e,n,r,i,o);this.re=new RegExp(n,ow+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=Yg(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=Yg(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const n0=new WeakMap;class uc{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=n0.get(e);if(!i||i.from>=r||i.to<=n){let l=new uc(n,e.sliceString(n,r));return n0.set(e,l),l}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to<r&&(o+=e.sliceString(i.to,r)),n0.set(e,new uc(s,o)),new uc(n,o.slice(n-s,r-s))}}class h8{constructor(e,n,r,i,o){this.text=e,this.to=o,this.done=!1,this.value=u8,this.matchPos=Yg(e,i),this.re=new RegExp(n,ow+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=uc.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=Yg(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=uc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(f8.prototype[Symbol.iterator]=h8.prototype[Symbol.iterator]=function(){return this});function yse(t){try{return new RegExp(t,ow),!0}catch{return!1}}function Yg(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}const xse=t=>{let e=Vre(t,"cm-goto-line");if(e){let s=e.dom.querySelector("input[type=text]");return s&&s.select(),!0}let{state:n}=t,r=String(n.doc.lineAt(t.state.selection.main.head).number),{close:i,result:o}=Nre(t,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return o.then(s=>{let l=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!l){t.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,c,u,f,h]=l,d=f?+f.slice(1):0,p=u?+u:a.number;if(u&&h){let O=p/100;c&&(O=O*(c=="-"?-1:1)+a.number/n.doc.lines),p=Math.round(n.doc.lines*O)}else u&&c&&(p=p*(c=="-"?-1:1)+a.number);let g=n.doc.line(Math.max(1,Math.min(n.doc.lines,p))),m=H.cursor(g.from+Math.max(0,Math.min(d,g.length)));t.dispatch({effects:[i,se.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},bse={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},vse=ye.define({combine(t){return xo(t,bse,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Sse(t){return[Tse,_se]}const wse=ke.mark({class:"cm-selectionMatch"}),kse=ke.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function FT(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Dt.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Dt.Word)}function Cse(t,e,n,r){return t(e.sliceDoc(n,n+1))==Dt.Word&&t(e.sliceDoc(r-1,r))==Dt.Word}const _se=Ht.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(vse),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ke.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return ke.none;let a=n.wordAt(i.head);if(!a)return ke.none;s=n.charCategorizer(i.head),o=n.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a<e.minSelectionLength||a>200)return ke.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(FT(s,n,i.from,i.to)&&Cse(s,n,i.from,i.to)))return ke.none}else if(o=n.sliceDoc(i.from,i.to),!o)return ke.none}let l=[];for(let a of t.visibleRanges){let c=new Mc(n.doc,o,a.from,a.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||FT(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?l.push(kse.range(u,f)):(u>=i.to||f<=i.from)&&l.push(wse.range(u,f)),l.length>e.maxMatches))return ke.none}}return ke.set(l)}},{decorations:t=>t.decorations}),Tse=se.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Pse=({state:t,dispatch:e})=>{let{selection:n}=t,r=H.create(n.ranges.map(i=>t.wordAt(i.head)||H.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Ese(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,l=new Mc(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(s)return null;l=new Mc(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(a=>a.from==l.value.from))continue;if(o){let a=t.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const $se=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return Pse({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=Ese(t,r);return i?(e(t.update({selection:t.selection.addRange(H.range(i.from,i.to),!1),effects:se.scrollIntoView(i.to)})),!0):!1},du=ye.define({combine(t){return xo(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new jse(e),scrollToMatch:e=>se.scrollIntoView(e)})}});class d8{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||yse(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
116
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ise(this):new Mse(this)}getCursor(e,n=0,r){let i=e.doc?e:ze.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Da(this,i,n,r):Ia(this,i,n,r)}}class p8{constructor(e){this.spec=e}}function Ase(t,e,n){return(r,i,o,s)=>{if(n&&!n(r,i,o,s))return!1;let l=r>=s&&i<=s+o.length?o.slice(r-s,i-s):e.doc.sliceString(r,i);return t(l,e,r,i)}}function Ia(t,e,n,r){let i;return t.wholeWord&&(i=Qse(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=Ase(t.test,e,i)),new Mc(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:o=>o.toLowerCase(),i)}function Qse(t,e){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=t.sliceString(o,Math.min(t.length,r+2))),(e(Ug(i,n-o))!=Dt.Word||e(Gg(i,n-o))!=Dt.Word)&&(e(Gg(i,r-o))!=Dt.Word||e(Ug(i,r-o))!=Dt.Word))}class Mse extends p8{constructor(e){super(e)}nextMatch(e,n,r){let i=Ia(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let o=Math.min(e.doc.length,n+this.spec.unquoted.length);i=Ia(this.spec,e,0,o).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=Ia(this.spec,e,o,i),l=null;for(;!s.nextOverlapping().done;)l=s.value;if(l)return l;if(o==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Ia(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Ia(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Rse(t,e,n){return(r,i,o)=>(!n||n(r,i,o))&&t(o[0],e,r,i)}function Da(t,e,n,r){let i;return t.wholeWord&&(i=Lse(e.charCategorizer(e.selection.main.head))),t.test&&(i=Rse(t.test,e,i)),new f8(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function Ug(t,e){return t.slice(Sn(t,e,!1),e)}function Gg(t,e){return t.slice(e,Sn(t,e))}function Lse(t){return(e,n,r)=>!r[0].length||(t(Ug(r.input,r.index))!=Dt.Word||t(Gg(r.input,r.index))!=Dt.Word)&&(t(Gg(r.input,r.index+r[0].length))!=Dt.Word||t(Ug(r.input,r.index+r[0].length))!=Dt.Word)}class Ise extends p8{nextMatch(e,n,r){let i=Da(this.spec,e,r,e.doc.length).next();return i.done&&(i=Da(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=Da(this.spec,e,o,r),l=null;for(;!s.next().done;)l=s.value;if(l&&(o==n||l.from>o+10))return l;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o<e.match.length)return e.match[o]+r.slice(i)}return n})}matchAll(e,n){let r=Da(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Da(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const ih=Le.define(),sw=Le.define(),Qs=cn.define({create(t){return new r0(Jx(t).create(),null)},update(t,e){for(let n of e.effects)n.is(ih)?t=new r0(n.value.create(),t.panel):n.is(sw)&&(t=new r0(t.query,n.value?lw:null));return t},provide:t=>eh.from(t,e=>e.panel)});class r0{constructor(e,n){this.query=e,this.panel=n}}const Dse=ke.mark({class:"cm-searchMatch"}),Nse=ke.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Vse=Ht.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Qs))}update(t){let e=t.state.field(Qs);(e!=t.startState.field(Qs)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ke.none;let{view:n}=this,r=new ir;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:l,to:a}=o[i];for(;i<s-1&&a>o[i+1].from-500;)a=o[++i].to;t.highlight(n.state,l,a,(c,u)=>{let f=n.state.selection.ranges.some(h=>h.from==c&&h.to==u);r.add(c,u,f?Nse:Dse)})}return r.finish()}},{decorations:t=>t.decorations});function Hh(t){return e=>{let n=e.state.field(Qs,!1);return n&&n.query.spec.valid?t(e,n):O8(e)}}const Kg=Hh((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=H.single(r.from,r.to),o=t.state.facet(du);return t.dispatch({selection:i,effects:[aw(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),m8(t),!0}),Jg=Hh((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=H.single(i.from,i.to),s=t.state.facet(du);return t.dispatch({selection:o,effects:[aw(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),m8(t),!0}),Bse=Hh((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:H.create(n.map(r=>H.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Fse=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let l=new Mc(t.doc,t.sliceDoc(r,i));!l.next().done;){if(o.length>1e3)return!1;l.value.from==r&&(s=o.length),o.push(H.range(l.value.from,l.value.to))}return e(t.update({selection:H.create(o,s),userEvent:"select.search.matches"})),!0},ZT=Hh((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=o,l=[],a,c,u=[];s.precise?s.from==r&&s.to==i&&(c=n.toText(e.getReplacement(s)),l.push({from:s.from,to:s.to,insert:c}),s=e.nextMatch(n,s.from,s.to),u.push(se.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=e.nextMatch(n,s.from,s.to);let f=t.state.changes(l);return s&&(a=H.single(s.from,s.to).map(f),u.push(aw(t,s)),u.push(n.facet(du).scrollToMatch(a.main,t))),t.dispatch({changes:f,selection:a,effects:u,userEvent:"input.replace"}),!0}),Zse=Hh((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let i of e.matchAll(t.state,1e9)){let{from:o,to:s,precise:l}=i;l&&n.push({from:o,to:s,insert:e.getReplacement(i)})}if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:se.announce.of(r),userEvent:"input.replace.all"}),!0});function lw(t){return t.state.facet(du).createPanel(t)}function Jx(t,e){var n,r,i,o,s;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=t.facet(du);return new d8({search:((n=e?.literal)!==null&&n!==void 0?n:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e?.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function g8(t){let e=mO(t,lw);return e&&e.dom.querySelector("[main-field]")}function m8(t){let e=g8(t);e&&e==t.root.activeElement&&e.select()}const O8=t=>{let e=t.state.field(Qs,!1);if(e&&e.panel){let n=g8(t);if(n&&n!=t.root.activeElement){let r=Jx(t.state,e.query.spec);r.valid&&t.dispatch({effects:ih.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[sw.of(!0),e?ih.of(Jx(t.state,e.query.spec)):Le.appendConfig.of(Wse)]});return!0},y8=t=>{let e=t.state.field(Qs,!1);if(!e||!e.panel)return!1;let n=mO(t,lw);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:sw.of(!1)}),!0},zse=[{key:"Mod-f",run:O8,scope:"editor search-panel"},{key:"F3",run:Kg,shift:Jg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Kg,shift:Jg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:y8,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Fse},{key:"Mod-Alt-g",run:xse},{key:"Mod-d",run:$se,preventDefault:!0}];class jse{constructor(e){this.view=e;let n=this.query=e.state.field(Qs).query.spec;this.commit=this.commit.bind(this),this.searchField=xt("input",{value:n.search,placeholder:Pr(e,"Find"),"aria-label":Pr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=xt("input",{value:n.replace,placeholder:Pr(e,"Replace"),"aria-label":Pr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=xt("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=xt("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=xt("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return xt("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=xt("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Kg(e),[Pr(e,"next")]),r("prev",()=>Jg(e),[Pr(e,"previous")]),r("select",()=>Bse(e),[Pr(e,"all")]),xt("label",null,[this.caseField,Pr(e,"match case")]),xt("label",null,[this.reField,Pr(e,"regexp")]),xt("label",null,[this.wordField,Pr(e,"by word")]),...e.state.readOnly?[]:[xt("br"),this.replaceField,r("replace",()=>ZT(e),[Pr(e,"replace")]),r("replaceAll",()=>Zse(e),[Pr(e,"replace all")])],xt("button",{name:"close",onclick:()=>y8(e),"aria-label":Pr(e,"close"),type:"button"},["×"])])}commit(){let e=new d8({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ih.of(e)}))}keydown(e){qne(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Jg:Kg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ZT(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(ih)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(du).top}}function Pr(t,e){return t.state.phrase(e)}const zd=30,jd=/[\s\.,:;?!]/;function aw(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-zd),s=Math.min(i,n+zd),l=t.state.sliceDoc(o,s);if(o!=r.from){for(let a=0;a<zd;a++)if(!jd.test(l[a+1])&&jd.test(l[a])){l=l.slice(a);break}}if(s!=i){for(let a=l.length-1;a>l.length-zd;a--)if(!jd.test(l[a-1])&&jd.test(l[a])){l=l.slice(0,a);break}}return se.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const Xse=se.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Wse=[Qs,Fi.low(Vse),Xse];class cw{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=wt(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(b8(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function zT(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Hse(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=zT(e)+zT(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function x8(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Hse(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function qse(t,e){return n=>{for(let r=wt(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class jT{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Ql(t){return t.selection.main.from}function b8(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const uw=ds.define();function Yse(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return{...t.changeByRange(l=>{if(l!=i&&n!=r&&t.sliceDoc(l.from+o,l.from+s)!=t.sliceDoc(n,r))return{range:l};let a=t.toText(e);return{changes:{from:l.from+o,to:r==i.from?l.to:l.from+s,insert:a},range:H.cursor(l.from+o+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const XT=new WeakMap;function Use(t){if(!Array.isArray(t))return t;let e=XT.get(t);return e||XT.set(t,e=x8(t)),e}const em=Le.define(),oh=Le.define();class Gse{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=gr(e,n),i=Ui(r);this.chars.push(r);let o=e.slice(n,n+i),s=o.toUpperCase();this.folded.push(gr(s==o?o.toLowerCase():s,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let y=gr(e,0),x=Ui(y),b=x==e.length?0:-100;if(y!=n[0])if(y==r[0])b+=-200;else return null;return this.ret(b,[0,x])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=n.length,c=0;if(l<0){for(let y=0,x=Math.min(e.length,200);y<x&&c<a;){let b=gr(e,y);(b==n[c]||b==r[c])&&(i[c++]=y),y+=Ui(b)}if(c<a)return null}let u=0,f=0,h=!1,d=0,p=-1,g=-1,m=/[a-z]/.test(e),O=!0;for(let y=0,x=Math.min(e.length,200),b=0;y<x&&f<a;){let S=gr(e,y);l<0&&(u<a&&S==n[u]&&(o[u++]=y),d<a&&(S==n[d]||S==r[d]?(d==0&&(p=y),g=y+1,d++):d=0));let v,w=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(v=$S(S))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!y||w==1&&m||b==0&&w!=0)&&(n[f]==S||r[f]==S&&(h=!0)?s[f++]=y:s.length&&(O=!1)),b=w,y+=Ui(S)}return f==a&&s[0]==0&&O?this.result(-100+(h?-200:0),s,e):d==a&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,g]):f==a?this.result(-100+(h?-200:0)+-700+(O?0:-1100),s,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let l=s+(this.astral?Ui(gr(r,s)):1);o&&i[o-1]==s?i[o-1]=l:(i[o++]=s,i[o++]=l)}return this.ret(e-r.length,i)}}class Kse{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const vn=ye.define({combine(t){return xo(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Jse,filterStrict:!1,compareCompletions:(e,n)=>(e.sortText||e.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>WT(e(r),n(r)),optionClass:(e,n)=>r=>WT(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function WT(t,e){return t?e?t+" "+e:t:e}function Jse(t,e,n,r,i,o){let s=t.textDirection==_t.RTL,l=s,a=!1,c="top",u,f,h=e.left-i.left,d=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(l&&h<Math.min(p,d)?l=!1:!l&&d<Math.min(p,h)&&(l=!0),p<=(l?h:d))u=Math.max(i.top,Math.min(n.top,i.bottom-g))-e.top,f=Math.min(400,l?h:d);else{a=!0,f=Math.min(400,(s?e.right:i.right-e.left)-30);let y=i.bottom-e.bottom;y>=g||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let m=(e.bottom-e.top)/o.offsetHeight,O=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(a?s?"left-narrow":"right-narrow":l?"left":"right")}}const fw=Le.define();function ele(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let l=n.displayLabel||n.label,a=0;for(let c=0;c<o.length;){let u=o[c++],f=o[c++];u>a&&s.appendChild(document.createTextNode(l.slice(a,u)));let h=s.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(u,f))),h.className="cm-completionMatchedText",a=f}return a<l.length&&s.appendChild(document.createTextNode(l.slice(a))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function i0(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.ceil((t-e)/n);return{from:t-r*n,to:t-(r-1)*n}}class tle{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,l=e.state.facet(vn);this.optionContent=ele(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=i0(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(n).open;for(let u=a.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]<c.length){this.applyCompletion(e,c[+f[1]]),a.preventDefault();return}if(a.target==this.list){let u=this.list.classList.contains("cm-completionListIncompleteTop")&&a.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&a.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;u!=null&&(e.dispatch({effects:fw.of(u)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(vn).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:oh.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:l}=r.open;(!i.open||i.open.options!=o)&&(this.range=i0(o.length,s,e.state.facet(vn).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),l!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=i0(n.options.length,n.selected,this.view.state.facet(vn).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>yr(this.view.state,l,"completion info")):(this.addInfoPane(s,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&rle(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(vn).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",s=>{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;s<r.to;s++){let{completion:l,match:a}=e[s],{section:c}=l;if(c){let h=typeof c=="string"?c:c.name;if(h!=o&&(s>r.from||r.from==0))if(o=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=h}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(l);f&&(u.className=f);for(let h of this.optionContent){let d=h(l,this.view.state,this.view,a);d&&u.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function nle(t,e){return n=>new tle(n,t,e)}function rle(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function HT(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function ile(t,e){let n=[],r=null,i=null,o=u=>{n.push(u);let{section:f}=u.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(d=>d.name==h)||r.push(typeof f=="string"?{name:h}:f)}},s=e.facet(vn);for(let u of t)if(u.hasResult()){let f=u.result.getMatch;if(u.result.filter===!1)for(let h of u.result.options)o(new jT(h,u.source,f?f(h):[],1e9-n.length));else{let h=e.sliceDoc(u.from,u.to),d,p=s.filterStrict?new Kse(h):new Gse(h);for(let g of u.result.options)if(d=p.match(g.label)){let m=g.displayLabel?f?f(g,d.matched):[]:d.matched,O=d.score+(g.boost||0);if(o(new jT(g,u.source,m,O)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(O,i[y]||-1e9)}}}}if(r){let u=Object.create(null),f=0,h=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of r.sort(h))f-=1e5,u[d.name]=f;for(let d of n){let{section:p}=d.completion;p&&(d.score+=u[typeof p=="string"?p:p.name])}}let l=[],a=null,c=s.compareCompletions;for(let u of n.sort((f,h)=>h.score-f.score||c(f.completion,h.completion))){let f=u.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(u):HT(u.completion)>HT(a)&&(l[l.length-1]=u),a=u.completion}return l}class Xa{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Xa(this.options,qT(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o,s){if(i&&!s&&e.some(c=>c.isPending))return i.setDisabled();let l=ile(e,n);if(!l.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let a=n.facet(vn).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;u<l.length;u++)if(l[u].completion==c){a=u;break}}return new Xa(l,qT(r,a),{pos:e.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:ule,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new Xa(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Xa(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class tm{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new tm(ale,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(vn),o=(r.override||n.languageDataAt("autocomplete",Ql(n)).map(Use)).map(a=>(this.active.find(u=>u.source==a)||new ti(a,this.active.some(u=>u.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,c)=>a==this.active[c])&&(o=this.active);let s=this.open,l=e.effects.some(a=>a.is(hw));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!ole(o,this.active)||l?s=Xa.build(o,n,this.id,s,r,l):s&&s.disabled&&!o.some(a=>a.isPending)&&(s=null),!s&&o.every(a=>!a.isPending)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new ti(a.source,0):a));for(let a of e.effects)a.is(fw)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new tm(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?sle:lle}}function ole(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const sle={"aria-autocomplete":"list"},lle={};function qT(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const ale=[];function v8(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(uw);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class ti{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=v8(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new ti(i.source,0)),r&4&&i.state==0&&(i=new ti(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(em))i=new ti(i.source,1,o.value);else if(o.is(oh))i=new ti(i.source,0);else if(o.is(hw))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Ql(e.state))}}class fc extends ti{constructor(e,n,r,i,o,s){super(e,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=Ql(e.state);if(l>s||!i||n&2&&(Ql(e.startState)==this.from||l<this.limit))return new ti(this.source,n&4?1:0);let a=e.changes.mapPos(this.limit);return cle(i.validFor,e.state,o,s)?new fc(this.source,this.explicit,a,i,o,s):i.update&&(i=i.update(i,o,s,new cw(e.state,l,!1)))?new fc(this.source,this.explicit,a,i,i.from,(r=i.to)!==null&&r!==void 0?r:Ql(e.state)):new ti(this.source,1,this.explicit)}map(e){if(e.empty)return this;let n=this.result.map?this.result.map(this.result,e):this.result;return n?new fc(this.source,this.explicit,e.mapPos(this.limit),n,e.mapPos(this.from),e.mapPos(this.to,1)):new ti(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function cle(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):b8(t,!0).test(i)}const hw=Le.define({map(t,e){return t.map(n=>n.map(e))}}),mr=cn.define({create(){return tm.start()},update(t,e){return t.update(e)},provide:t=>[WS.from(t,e=>e.tooltip),se.contentAttributes.from(t,e=>e.attrs)]});function dw(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(mr).active.find(i=>i.source==e.source);return r instanceof fc?(typeof n=="string"?t.dispatch({...Yse(t.state,n,r.from,r.to),annotations:uw.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const ule=nle(mr,dw);function Xd(t,e="option"){return n=>{let r=n.state.field(mr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(vn).interactionDelay)return!1;let i=1,o;e=="page"&&(o=G4(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,l=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:s-1;return l<0?l=e=="page"?0:s-1:l>=s&&(l=e=="page"?s-1:0),n.dispatch({effects:fw.of(l)}),!0}}const fle=t=>{let e=t.state.field(mr,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(vn).interactionDelay?!1:dw(t,e.open.options[e.open.selected])},o0=t=>t.state.field(mr,!1)?(t.dispatch({effects:em.of(!0)}),!0):!1,hle=t=>{let e=t.state.field(mr,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:oh.of(null)}),!0)};class dle{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const ple=50,gle=1e3,mle=Ht.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(mr).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(mr),n=t.state.facet(vn);if(!t.selectionSet&&!t.docChanged&&t.startState.field(mr)==e)return;let r=t.transactions.some(o=>{let s=v8(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;o<this.running.length;o++){let s=this.running[o];if(r||s.context.abortOnDocChange&&t.docChanged||s.updates.length+t.transactions.length>ple&&Date.now()-s.time>gle){for(let l of s.context.abortListeners)try{l()}catch(a){yr(this.view.state,a)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(em)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(mr);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vn).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Ql(e),r=new cw(e,n,t.explicit,this.view),i=new dle(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:oh.of(null)}),yr(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vn).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(vn),r=this.view.state.field(mr);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let l=Ql(o.updates.length?o.updates[0].startState:this.view.state),a=Math.min(l,o.done.from+(o.active.explicit?0:1)),c=new fc(o.active.source,o.active.explicit,a,o.done,o.done.from,(t=o.done.to)!==null&&t!==void 0?t:l);for(let u of o.updates)c=c.update(u,n);if(c.hasResult()){e.push(c);continue}}let s=r.active.find(l=>l.source==o.active.source);if(s&&s.isPending)if(o.done==null){let l=new ti(o.active.source,0);for(let a of o.updates)l=l.update(a,n);l.isPending||e.push(l)}else this.startQuery(s)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:hw.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(mr,!1);if(e&&e.tooltip&&this.view.state.facet(vn).closeOnBlur){let n=e.open&&G4(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:oh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:em.of(!1)}),20),this.composing=0}}}),Ole=typeof navigator=="object"&&/Win/.test(navigator.platform),yle=Fi.highest(se.domEventHandlers({keydown(t,e){let n=e.state.field(mr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Ole&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&dw(e,r),!1}})),S8=se.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class xle{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class pw{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Mn.TrackDel),r=e.mapPos(this.to,1,Mn.TrackDel);return n==null||r==null?null:new pw(this.field,n,r)}}class gw{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let a of this.lines){if(r.length){let c=s,u=/^\t*/.exec(a)[0].length;for(let f=0;f<u;f++)c+=e.facet(zh);i.push(n+c.length-u),a=c+a.slice(u)}r.push(a),n+=a.length+1}let l=this.fieldPositions.map(a=>new pw(a.field,i[a.line]+a.from,i[a.line]+a.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let l=o[1]?+o[1]:null,a=o[2]||o[3]||"",c=-1;l===0&&(l=1e9);let u=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<n.length;f++)(l!=null?n[f].seq==l:u&&n[f].name==u)&&(c=f);if(c<0){let f=0;for(;f<n.length&&(l==null||n[f].seq!=null&&n[f].seq<l);)f++;n.splice(f,0,{seq:l,name:u}),c=f;for(let h of i)h.field>=c&&h.field++}for(let f of i)if(f.line==r.length&&f.from>o.index){let h=o[2]?3+(o[1]||"").length:2;f.from-=h,f.to-=h}i.push(new xle(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+a+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(l,a,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return a}),r.push(s)}return new gw(r,i)}}let ble=ke.widget({widget:new class extends pi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),vle=ke.mark({class:"cm-snippetField"});class pu{constructor(e,n){this.ranges=e,this.active=n,this.deco=ke.set(e.map(r=>(r.from==r.to?ble:vle).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new pu(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const qh=Le.define({map(t,e){return t&&t.map(e)}}),Sle=Le.define(),sh=cn.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(qh))return n.value;if(n.is(Sle)&&t)return new pu(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>se.decorations.from(t,e=>e?e.deco:ke.none)});function mw(t,e){return H.create(t.filter(n=>n.field==e).map(n=>H.range(n.from,n.to)))}function wle(t){let e=gw.parse(t);return(n,r,i,o)=>{let{text:s,ranges:l}=e.instantiate(n.state,i),{main:a}=n.state.selection,c={changes:{from:i,to:o==a.from?a.to:o,insert:rt.of(s)},scrollIntoView:!0,annotations:r?[uw.of(r),on.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=mw(l,0)),l.some(u=>u.field>0)){let u=new pu(l,0),f=c.effects=[qh.of(u)];n.state.field(sh,!1)===void 0&&f.push(Le.appendConfig.of([sh,Ple,Ele,S8]))}n.dispatch(n.state.update(c))}}function w8(t){return({state:e,dispatch:n})=>{let r=e.field(sh,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:mw(r.ranges,i),effects:qh.of(o?null:new pu(r.ranges,i)),scrollIntoView:!0})),!0}}const kle=({state:t,dispatch:e})=>t.field(sh,!1)?(e(t.update({effects:qh.of(null)})),!0):!1,Cle=w8(1),_le=w8(-1),Tle=[{key:"Tab",run:Cle,shift:_le},{key:"Escape",run:kle}],YT=ye.define({combine(t){return t.length?t[0]:Tle}}),Ple=Fi.highest(au.compute([YT],t=>t.facet(YT)));function dr(t,e){return{...e,apply:wle(t)}}const Ele=se.domEventHandlers({mousedown(t,e){let n=e.state.field(sh,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:mw(n.ranges,i.field),effects:qh.of(n.ranges.some(o=>o.field>i.field)?new pu(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),lh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},kl=Le.define({map(t,e){let n=e.mapPos(t,-1,Mn.TrackAfter);return n??void 0}}),Ow=new class extends js{};Ow.startSide=1;Ow.endSide=-1;const k8=cn.define({create(){return qe.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(kl)&&(t=t.update({add:[Ow.range(n.value,n.value+1)]}));return t}});function $le(){return[Qle,k8]}const s0="()[]{}<>«»»«[]{}";function C8(t){for(let e=0;e<s0.length;e+=2)if(s0.charCodeAt(e)==t)return s0.charAt(e+1);return $S(t<128?t:t+1)}function _8(t,e){return t.languageDataAt("closeBrackets",e)[0]||lh}const Ale=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Qle=se.inputHandler.of((t,e,n,r)=>{if((Ale?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ui(gr(r,0))==1||e!=i.from||n!=i.to)return!1;let o=Lle(t.state,r);return o?(t.dispatch(o),!0):!1}),Mle=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=_8(t,t.selection.main.head).brackets||lh.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let l=Ile(t.doc,s.head);for(let a of r)if(a==l&&kO(t.doc,s.head)==C8(gr(a,0)))return{changes:{from:s.head-a.length,to:s.head+a.length},range:H.cursor(s.head-a.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Rle=[{key:"Backspace",run:Mle}];function Lle(t,e){let n=_8(t,t.selection.main.head),r=n.brackets||lh.brackets;for(let i of r){let o=C8(gr(i,0));if(e==i)return o==i?Vle(t,i,r.indexOf(i+i+i)>-1,n):Dle(t,i,o,n.before||lh.before);if(e==o&&T8(t,t.selection.main.from))return Nle(t,i,o)}return null}function T8(t,e){let n=!1;return t.field(k8).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function kO(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ui(gr(n,0)))}function Ile(t,e){let n=t.sliceString(e-2,e);return Ui(gr(n,0))==n.length?n:n.slice(1)}function Dle(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:kl.of(s.to+e.length),range:H.range(s.anchor+e.length,s.head+e.length)};let l=kO(t.doc,s.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:s.head},effects:kl.of(s.head+e.length),range:H.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Nle(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&kO(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:H.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Vle(t,e,n,r){let i=r.stringPrefixes||lh.stringPrefixes,o=null,s=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:kl.of(l.to+e.length),range:H.range(l.anchor+e.length,l.head+e.length)};let a=l.head,c=kO(t.doc,a),u;if(c==e){if(UT(t,a))return{changes:{insert:e+e,from:a},effects:kl.of(a+e.length),range:H.cursor(a+e.length)};if(T8(t,a)){let h=n&&t.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+h.length,insert:h},range:H.cursor(a+h.length)}}}else{if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(u=GT(t,a-2*e.length,i))>-1&&UT(t,u))return{changes:{insert:e+e+e+e,from:a},effects:kl.of(a+e.length),range:H.cursor(a+e.length)};if(t.charCategorizer(a)(c)!=Dt.Word&>(t,a,i)>-1&&!Ble(t,a,e,i))return{changes:{insert:e+e,from:a},effects:kl.of(a+e.length),range:H.cursor(a+e.length)}}return{range:o=l}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function UT(t,e){let n=wt(t).resolveInner(e+1);return n.parent&&n.from==e}function Ble(t,e,n,r){let i=wt(t).resolveInner(e,-1),o=r.reduce((s,l)=>Math.max(s,l.length),0);for(let s=0;s<5;s++){let l=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),a=l.indexOf(n);if(!a||a>-1&&r.indexOf(l.slice(0,a))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+a;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function GT(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Dt.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=Dt.Word)return o}return-1}function Fle(t={}){return[yle,mr,vn.of(t),mle,Zle,S8]}const P8=[{key:"Ctrl-Space",run:o0},{mac:"Alt-`",run:o0},{mac:"Alt-i",run:o0},{key:"Escape",run:hle},{key:"ArrowDown",run:Xd(!0)},{key:"ArrowUp",run:Xd(!1)},{key:"PageDown",run:Xd(!0,"page")},{key:"PageUp",run:Xd(!1,"page")},{key:"Enter",run:fle}],Zle=Fi.highest(au.computeN([vn],t=>t.facet(vn).defaultKeymap?[P8]:[]));class KT{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class yl{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(ah).markerFilter;i&&(e=i(e,r));let o=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),s=new ir,l=[],a=0,c=r.doc.iter(),u=0,f=r.doc.length;for(let d=0;;){let p=d==o.length?null:o[d];if(!p&&!l.length)break;let g,m;if(l.length)g=a,m=l.reduce((x,b)=>Math.min(x,b.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>f)break;m=p.to,l.push(p),d++}for(;d<o.length;){let x=o[d];if(x.from==g&&(x.to>x.from||x.to==g))l.push(x),d++,m=Math.min(x.to,m);else{m=Math.min(x.from,m);break}}m=Math.min(m,f);let O=!1;if(l.some(x=>x.from==g&&(x.to==m||m==f))&&(O=g==m,!O&&m-g<10)){let x=g-(u+c.value.length);x>0&&(c.next(x),u=g);for(let b=g;;){if(b>=m){O=!0;break}if(!c.lineBreak&&u+c.value.length>b)break;b=u+c.value.length,u+=c.value.length,c.next()}}let y=tae(l);if(O)s.add(g,g,ke.widget({widget:new Gle(y),diagnostics:l.slice()}));else{let x=l.reduce((b,S)=>S.markClass?b+" "+S.markClass:b,"");s.add(g,m,ke.mark({class:"cm-lintRange cm-lintRange-"+y+x,diagnostics:l.slice(),inclusiveEnd:l.some(b=>b.to>m)}))}if(a=m,a==f)break;for(let x=0;x<l.length;x++)l[x].to<=a&&l.splice(x--,1)}let h=s.finish();return new yl(h,n,qs(h))}}function qs(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostics.indexOf(e)<0))if(!r)r=new KT(i,o,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new KT(r.from,o,r.diagnostic)}}),r}function zle(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(ah).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(E8))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function jle(t,e){return t.field(Vr,!1)?e:e.concat(Le.appendConfig.of(nae))}const E8=Le.define(),yw=Le.define(),$8=Le.define(),Vr=cn.define({create(){return new yl(ke.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=qs(n,t.selected.diagnostic,o)||qs(n,null,o)}!n.size&&i&&e.state.facet(ah).autoPanel&&(i=null),t=new yl(n,i,r)}for(let n of e.effects)if(n.is(E8)){let r=e.state.facet(ah).autoPanel?n.value.length?ch.open:null:t.panel;t=yl.init(n.value,r,e.state)}else n.is(yw)?t=new yl(t.diagnostics,n.value?ch.open:null,t.selected):n.is($8)&&(t=new yl(t.diagnostics,t.panel,n.value));return t},provide:t=>[eh.from(t,e=>e.panel),se.decorations.from(t,e=>e.diagnostics)]}),Xle=ke.mark({class:"cm-lintRange cm-lintRange-active"});function Wle(t,e,n){let{diagnostics:r}=t.state.field(Vr),i,o=-1,s=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return i=u.diagnostics,o=a,s=c,!1});let l=t.state.facet(ah).tooltipFilter;return i&&l&&(i=l(i,t.state)),i?{pos:o,end:s,above:!0,create(){return{dom:Hle(t,i)}}}:null}function Hle(t,e){return xt("ul",{class:"cm-tooltip-lint"},e.map(n=>Q8(t,n,!1)))}const qle=t=>{let e=t.state.field(Vr,!1);(!e||!e.panel)&&t.dispatch({effects:jle(t.state,[yw.of(!0)])});let n=mO(t,ch.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},JT=t=>{let e=t.state.field(Vr,!1);return!e||!e.panel?!1:(t.dispatch({effects:yw.of(!1)}),!0)},Yle=t=>{let e=t.state.field(Vr,!1);if(!e)return!1;let n=t.state.selection.main,r=qs(e.diagnostics,null,n.to+1);return!r&&(r=qs(e.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),Ire(t,r.from,1,{tooltip:M8,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},Ule=[{key:"Mod-Shift-m",run:qle,preventDefault:!0},{key:"F8",run:Yle}],ah=ye.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...xo(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:eP,tooltipFilter:eP,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,i,o)=>e(r,i,o)||n(r,i,o):e:n,autoPanel:(e,n)=>e||n})}}});function eP(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function A8(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(o=>o.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function Q8(t,e,n){var r;let i=n?A8(e.actions):[];return xt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},xt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=qs(t.state.field(Vr).diagnostics,e);p&&o.apply(t,p.from,p.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),xt("u",c.slice(u,u+1)),c.slice(u+1)],h=o.markClass?" "+o.markClass:"";return xt("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&xt("div",{class:"cm-diagnosticSource"},e.source))}class Gle extends pi{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return xt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class tP{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Q8(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ch{constructor(e){this.view=e,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)JT(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=A8(o.actions);for(let l=0;l<s.length;l++)if(s[l].toUpperCase().charCodeAt(0)==i.keyCode){let a=qs(this.view.state.field(Vr).diagnostics,o);a&&o.actions[l].apply(e,a.from,a.to)}}else return;i.preventDefault()}},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=xt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=xt("div",{class:"cm-panel-lint"},this.list,xt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>JT(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Vr).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Vr),r=0,i=!1,o=null,s=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(s.has(u))continue;s.add(u);let f=-1,h;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==u){f=d;break}f<0?(h=new tP(this.view,u),this.items.splice(r,0,h),i=!0):(h=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),o=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new tP(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Vr),r=qs(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:$8.of(r)})}static open(e){return new ch(e)}}function Kle(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Wd(t){return Kle(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Jle=se.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Wd("#f11")},".cm-lintRange-warning":{backgroundImage:Wd("orange")},".cm-lintRange-info":{backgroundImage:Wd("#999")},".cm-lintRange-hint":{backgroundImage:Wd("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function eae(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function tae(t){let e="hint",n=1;for(let r of t){let i=eae(r.severity);i>n&&(n=i,e=r.severity)}return e}const M8=Lre(Wle,{hideOn:zle}),nae=[Vr,se.decorations.compute([Vr],t=>{let{selected:e,panel:n}=t.field(Vr);return!e||!n||e.from==e.to?ke.none:ke.set([Xle.range(e.from,e.to)])}),M8,Jle],R8=[HS(),Gre(),hre(),loe(),$ie(),ere(),sre(),ze.allowMultipleSelections.of(!0),yie(),x7(Rie,{fallback:!0}),Fie(),$le(),Fle(),kre(),Tre(),yre(),Sse(),au.of([...Rle,...cse,...zse,...moe,..._ie,...P8,...Ule])];function rae(t,e,n){const r=wn(zt),i=Zt(_9),o=_.useRef(null),{lexicalNode:s}=lx(),l=_.useRef(!1),a=_.useRef(!1),c=_.useCallback(()=>{i({editorType:"codeblock",rootNode:s,editorRef:o.current})},[s,i]),u=_.useCallback(f=>{var h,d,p,g,m,O;if(f.key==="ArrowDown"){const y=(d=(h=o.current)==null?void 0:h.getCodemirror())==null?void 0:d.state;if(y){const x=y.doc.length,b=y.selection.ranges[0].to;x===b&&(l.current?(r?.update(()=>{var S,v;const w=Ge(t);w.getNextSibling()?((v=(S=o.current)==null?void 0:S.getCodemirror())==null||v.contentDOM.blur(),w.selectNext()):w.insertAfter(He())}),l.current=!1):l.current=!0)}}else if(f.key==="ArrowUp"){const y=(g=(p=o.current)==null?void 0:p.getCodemirror())==null?void 0:g.state;y&&y.selection.ranges[0].from===0&&(a.current?(r?.update(()=>{var b,S;const v=Ge(t);v.getPreviousSibling()&&((S=(b=o.current)==null?void 0:b.getCodemirror())==null||S.contentDOM.blur(),v.selectPrevious())}),a.current=!1):a.current=!0)}else if(f.key==="Enter")f.stopPropagation();else if(f.key==="Backspace"||f.key==="Delete"){const y=(O=(m=o.current)==null?void 0:m.getCodemirror())==null?void 0:O.state;y?.doc.length===0&&r?.update(()=>{Ge(t).remove()})}},[r,t]);return _.useEffect(()=>{const f=o.current;return setTimeout(()=>{var h,d;(h=f?.getCodemirror())==null||h.contentDOM.addEventListener("focus",c),(d=f?.getCodemirror())==null||d.contentDOM.addEventListener("keydown",u)},300),()=>{var h,d;(h=f?.getCodemirror())==null||h.contentDOM.removeEventListener("focus",c),(d=f?.getCodemirror())==null||d.contentDOM.removeEventListener("keydown",u)}},[o,c,u,e]),_.useEffect(()=>{n.subscribe(()=>{var f,h;(h=(f=o.current)==null?void 0:f.getCodemirror())==null||h.focus(),c()})},[n,o,t,c]),o}var iae=Object.defineProperty,oae=(t,e)=>iae(t,"name",{value:e,configurable:!0});function eb(t,[e,n]){return Math.min(n,Math.max(e,t))}oae(eb,"clamp");var sae=Object.defineProperty,lae=(t,e)=>sae(t,"name",{value:e,configurable:!0});function L8(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}lae(L8,"usePrevious");var aae=Object.defineProperty,cae=(t,e)=>aae(t,"name",{value:e,configurable:!0}),I8=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uae=C.forwardRef(cae(function(e,n){return V.jsx(At.span,{...e,ref:n,style:{...I8,...e.style}})},"VisuallyHidden")),fae=uae,hae=Object.defineProperty,St=(t,e)=>hae(t,"name",{value:e,configurable:!0}),dae=[" ","Enter","ArrowUp","ArrowDown"],pae=[" ","Enter"],Rc="Select",[CO,xw,gae]=eS(Rc),[xa,dpe]=mo(Rc,[gae,tu]),bw=tu(),[mae,ol]=xa(Rc),[Oae,yae]=xa(Rc);function D8(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:f,disabled:h,required:d,form:p,internal_do_not_use_render:g}=t,m=bw(e),[O,y]=C.useState(null),[x,b]=C.useState(null),[S,v]=C.useState(!1),w=Ih(c),[k,P]=is({prop:r,defaultProp:i??!1,onChange:o,caller:Rc}),[T,M]=is({prop:s,defaultProp:l,onChange:a,caller:Rc}),I=C.useRef(null),$=C.useRef(T);C.useEffect(()=>{const _e=p?O?.ownerDocument.getElementById(p):O?.form;if(_e instanceof HTMLFormElement){const L=St(()=>M($.current),"reset");return _e.addEventListener("reset",L),()=>_e.removeEventListener("reset",L)}},[p,O,M]);const D=O?!!p||!!O.closest("form"):!0,[Z,G]=C.useState(new Set),z=Kc(),ee=Array.from(Z).map(_e=>_e.props.value).join(";"),oe=C.useCallback(_e=>{G(L=>new Set(L).add(_e))},[]),Q=C.useCallback(_e=>{G(L=>{const Ie=new Set(L);return Ie.delete(_e),Ie})},[]),ve={required:d,trigger:O,onTriggerChange:y,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:z,value:T,onValueChange:M,open:k,onOpenChange:P,dir:w,triggerPointerDownPosRef:I,disabled:h,name:u,autoComplete:f,form:p,nativeOptions:Z,nativeSelectKey:ee,isFormControl:D};return V.jsx(jv,{...m,children:V.jsx(mae,{scope:e,...ve,children:V.jsx(CO.Provider,{scope:e,children:V.jsx(Oae,{scope:e,onNativeOptionAdd:oe,onNativeOptionRemove:Q,children:V8(g)?g(ve):n})})})})}St(D8,"SelectProvider");var xae=St(t=>{const{__scopeSelect:e,children:n,...r}=t;return V.jsx(D8,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:i})=>V.jsxs(V.Fragment,{children:[n,i?V.jsx(jae,{__scopeSelect:e}):null]})})},"Select"),bae="SelectTrigger",vae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,disabled:i=!1,...o}=e,s=bw(r),l=ol(bae,r),a=l.disabled||i,c=Bt(n,l.onTriggerChange),u=xw(r),f=C.useRef("touch"),[h,d,p]=vw(m=>{const O=u().filter(b=>!b.disabled),y=O.find(b=>b.value===l.value),x=Sw(O,m,y);x!==void 0&&l.onValueChange(x.value)}),g=St(m=>{a||(l.onOpenChange(!0),p()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return V.jsx(nO,{asChild:!0,...s,children:V.jsx(At.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Yh(l.value)?"":void 0,...o,ref:c,onClick:Je(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&g(m)}),onPointerDown:Je(o.onPointerDown,m=>{f.current=m.pointerType;const O=m.target;O.hasPointerCapture(m.pointerId)&&O.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Je(o.onKeyDown,m=>{const O=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&d(m.key),!(O&&m.key===" ")&&dae.includes(m.key)&&(g(),m.preventDefault())})})})},"SelectTrigger")),Sae="SelectValue",wae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,className:i,style:o,children:s,placeholder:l="",...a}=e,c=ol(Sae,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,h=Bt(n,c.onValueNodeChange);In(()=>{u(f)},[u,f]);const d=Yh(c.value);return V.jsx(At.span,{...a,asChild:d?!1:a.asChild,ref:h,style:{pointerEvents:"none"},children:V.jsx(C.Fragment,{children:d?l:s},d?"placeholder":"value")})},"SelectValue")),kae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,children:i,...o}=e;return V.jsx(At.span,{"aria-hidden":!0,...o,ref:n,children:i||"▼"})},"SelectIcon")),Cae="SelectPortal",[_ae,Tae]=xa(Cae,{forceMount:void 0}),Pae=St(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return V.jsx(_ae,{scope:t.__scopeSelect,forceMount:n,children:V.jsx(Wv,{asChild:!0,...r})})},"SelectPortal"),ra="SelectContent",Eae=C.forwardRef(St(function(e,n){const r=Tae(ra,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,s=ol(ra,e.__scopeSelect),[l,a]=C.useState();return In(()=>{a(new DocumentFragment)},[]),V.jsx(Mh,{present:i||s.open,children:({present:c})=>c?V.jsx(Qae,{...o,ref:n}):V.jsx($ae,{...o,fragment:l})})},"SelectContent")),$ae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,children:i,fragment:o}=e;return o?Ns.createPortal(V.jsx(N8,{scope:r,children:V.jsx(CO.Slot,{scope:r,children:V.jsx("div",{ref:n,children:i})})}),o):null},"SelectContentFragment")),wi=10,[N8,_O]=xa(ra),Aae=Vs("SelectContent.RemoveScroll"),Qae=C.forwardRef(St(function(e,n){const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:O,...y}=e,x=ol(ra,r),[b,S]=C.useState(null),[v,w]=C.useState(null),k=Bt(n,S),[P,T]=C.useState(null),[M,I]=C.useState(null),$=xw(r),[D,Z]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(b)return UQ(b)},[b]),Ym();const z=C.useCallback(J=>{const[ue,...Se]=$().map(Ue=>Ue.ref.current),[Ae]=Se.slice(-1),Ze=document.activeElement;for(const Ue of J)if(Ue===Ze||(Ue?.scrollIntoView({block:"nearest"}),Ue===ue&&v&&(v.scrollTop=0),Ue===Ae&&v&&(v.scrollTop=v.scrollHeight),Ue?.focus(),document.activeElement!==Ze))return},[$,v]),ee=C.useCallback(()=>z([P,b]),[z,P,b]);C.useEffect(()=>{D&&ee()},[D,ee]);const{onOpenChange:oe,triggerPointerDownPosRef:Q}=x;C.useEffect(()=>{if(b){let J={x:0,y:0};const ue=St(Ae=>{J={x:Math.abs(Math.round(Ae.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(Ae.pageY)-(Q.current?.y??0))}},"handlePointerMove"),Se=St(Ae=>{J.x<=10&&J.y<=10?Ae.preventDefault():Ae.composedPath().includes(b)||oe(!1),document.removeEventListener("pointermove",ue),Q.current=null},"handlePointerUp");return Q.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",Se,{capture:!0})}}},[b,oe,Q]),C.useEffect(()=>{const J=St(()=>oe(!1),"close");return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[oe]);const[ve,_e]=vw(J=>{const ue=$().filter(Ze=>!Ze.disabled),Se=ue.find(Ze=>Ze.ref.current===document.activeElement),Ae=Sw(ue,J,Se);Ae&&setTimeout(()=>Ae.ref.current?.focus())}),L=C.useCallback((J,ue,Se)=>{const Ae=!G.current&&!Se;(x.value!==void 0&&x.value===ue||Ae)&&(T(J),Ae&&(G.current=!0))},[x.value]),Ie=C.useCallback(()=>b?.focus(),[b]),Be=C.useCallback((J,ue,Se)=>{const Ae=!G.current&&!Se;(x.value!==void 0&&x.value===ue||Ae)&&I(J)},[x.value]),pe=i==="popper"?nP:Mae,he=pe===nP?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:O}:{};return V.jsx(N8,{scope:r,content:b,viewport:v,onViewportChange:w,itemRefCallback:L,selectedItem:P,onItemLeave:Ie,itemTextRefCallback:Be,focusSelectedItem:ee,selectedItemText:M,position:i,isPositioned:D,searchRef:ve,children:V.jsx(Hv,{as:Aae,allowPinchZoom:!0,children:V.jsx(OQ,{asChild:!0,trapped:x.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Je(o,J=>{x.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:V.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:V.jsx(pe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:J=>J.preventDefault(),...y,...he,onPlaced:()=>Z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Je(y.onKeyDown,J=>{const ue=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ue&&J.key.length===1&&_e(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ae=$().filter(Ze=>!Ze.disabled).map(Ze=>Ze.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Ze=J.target,Ue=Ae.indexOf(Ze);Ae=Ae.slice(Ue+1)}setTimeout(()=>z(Ae)),J.preventDefault()}})})})})})})},"SelectContentImpl")),Mae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,onPlaced:i,...o}=e,s=ol(ra,r),l=_O(ra,r),[a,c]=C.useState(null),[u,f]=C.useState(null),h=Bt(n,f),d=xw(r),p=C.useRef(!1),g=C.useRef(!0),{viewport:m,selectedItem:O,selectedItemText:y,focusSelectedItem:x}=l,b=C.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&O&&y){const k=s.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(s.dir!=="rtl"){const Ze=M.left-P.left,Ue=T.left-Ze,Qt=k.left-Ue,st=k.width+Qt,Gt=Math.max(st,P.width),Kt=window.innerWidth-wi,fr=eb(Ue,[wi,Math.max(wi,Kt-Gt)]);a.style.minWidth=st+"px",a.style.left=fr+"px"}else{const Ze=P.right-M.right,Ue=window.innerWidth-T.right-Ze,Qt=window.innerWidth-k.right-Ue,st=k.width+Qt,Gt=Math.max(st,P.width),Kt=window.innerWidth-wi,fr=eb(Ue,[wi,Math.max(wi,Kt-Gt)]);a.style.minWidth=st+"px",a.style.right=fr+"px"}const I=d(),$=window.innerHeight-wi*2,D=m.scrollHeight,Z=window.getComputedStyle(u),G=parseInt(Z.borderTopWidth,10),z=parseInt(Z.paddingTop,10),ee=parseInt(Z.borderBottomWidth,10),oe=parseInt(Z.paddingBottom,10),Q=G+z+D+oe+ee,ve=Math.min(O.offsetHeight*5,Q),_e=window.getComputedStyle(m),L=parseInt(_e.paddingTop,10),Ie=parseInt(_e.paddingBottom,10),Be=k.top+k.height/2-wi,pe=$-Be,he=O.offsetHeight/2,J=O.offsetTop+he,ue=G+z+J,Se=Q-ue;if(ue<=Be){const Ze=I.length>0&&O===I[I.length-1].ref.current;a.style.bottom="0px";const Ue=u.clientHeight-m.offsetTop-m.offsetHeight,Qt=Math.max(pe,he+(Ze?Ie:0)+Ue+ee),st=ue+Qt;a.style.height=st+"px"}else{const Ze=I.length>0&&O===I[0].ref.current;a.style.top="0px";const Qt=Math.max(Be,G+m.offsetTop+(Ze?L:0)+he)+Se;a.style.height=Qt+"px",m.scrollTop=ue-Be+m.offsetTop}a.style.margin=`${wi}px 0`,a.style.minHeight=ve+"px",a.style.maxHeight=$+"px",i?.(),requestAnimationFrame(()=>p.current=!0)}},[d,s.trigger,s.valueNode,a,u,m,O,y,s.dir,i]);In(()=>b(),[b]);const[S,v]=C.useState();In(()=>{u&&v(window.getComputedStyle(u).zIndex)},[u]);const w=C.useCallback(k=>{k&&g.current===!0&&(b(),x?.(),g.current=!1)},[b,x]);return V.jsx(Rae,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:w,children:V.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:V.jsx(At.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})},"SelectItemAlignedPosition")),nP=C.forwardRef(St(function(e,n){const{__scopeSelect:r,align:i="start",collisionPadding:o=wi,...s}=e,l=bw(r);return V.jsx(Xv,{...l,...s,ref:n,align:i,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[Rae,Lae]=xa(ra,{}),rP="SelectViewport",Iae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,nonce:i,...o}=e,s=_O(rP,r),l=Lae(rP,r),a=Bt(n,s.onViewportChange),c=C.useRef(0);return V.jsxs(V.Fragment,{children:[V.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),V.jsx(CO.Slot,{scope:r,children:V.jsx(At.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Je(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:d}=l;if(d?.current&&h){const p=Math.abs(c.current-f.scrollTop);if(p>0){const g=window.innerHeight-wi*2,m=parseFloat(h.style.minHeight),O=parseFloat(h.style.height),y=Math.max(m,O);if(y<g){const x=y+p,b=Math.min(g,x),S=x-b;h.style.height=b+"px",h.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})},"SelectViewport")),Dae="SelectGroup",[ppe,gpe]=xa(Dae),tb="SelectItem",[Nae,Vae]=xa(tb),Bae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,value:i,disabled:o=!1,textValue:s,...l}=e,a=ol(tb,r),c=_O(tb,r),u=a.value===i,[f,h]=C.useState(s??""),[d,p]=C.useState(!1),g=Di(b=>c.itemRefCallback?.(b,i,o)),m=Bt(n,g),O=Kc(),y=C.useRef("touch"),x=St(()=>{o||(a.onValueChange(i),a.onOpenChange(!1))},"handleSelect");return V.jsx(Nae,{scope:r,value:i,disabled:o,textId:O,isSelected:u,onItemTextChange:C.useCallback(b=>{h(S=>S||(b?.textContent??"").trim())},[]),children:V.jsx(CO.ItemSlot,{scope:r,value:i,disabled:o,textValue:f,children:V.jsx(At.div,{role:"option","aria-labelledby":O,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:m,onFocus:Je(l.onFocus,()=>p(!0)),onBlur:Je(l.onBlur,()=>p(!1)),onClick:Je(l.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:Je(l.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:Je(l.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:Je(l.onPointerMove,b=>{y.current=b.pointerType,o?c.onItemLeave?.():y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Je(l.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Je(l.onKeyDown,b=>{o||b.target!==b.currentTarget||c.searchRef?.current!==""&&b.key===" "||(pae.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})},"SelectItem")),Hd="SelectItemText",Fae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,className:i,style:o,...s}=e,l=ol(Hd,r),a=_O(Hd,r),c=Vae(Hd,r),u=yae(Hd,r),[f,h]=C.useState(null),d=Di(x=>a.itemTextRefCallback?.(x,c.value,c.disabled)),p=Bt(n,h,c.onItemTextChange,d),g=f?.textContent,m=C.useMemo(()=>V.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:O,onNativeOptionRemove:y}=u;return In(()=>(O(m),()=>y(m)),[O,y,m]),V.jsxs(V.Fragment,{children:[V.jsx(At.span,{id:c.textId,...s,ref:p}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!Yh(l.value)?Ns.createPortal(s.children,l.valueNode):null]})},"SelectItemText")),Zae=C.forwardRef(St(function(e,n){const{__scopeSelect:r,...i}=e;return V.jsx(At.div,{"aria-hidden":!0,...i,ref:n})},"SelectSeparator")),zae="SelectBubbleInput",jae=C.forwardRef(St(function({__scopeSelect:e,...n},r){const i=ol(zae,e),{value:o,onValueChange:s,required:l,disabled:a,name:c,autoComplete:u,form:f}=i,{nativeOptions:h,nativeSelectKey:d}=i,p=C.useRef(null),g=Bt(r,p),m=o??"",O=L8(m),y=Array.from(h).some(x=>(x.props.value??"")==="");return C.useEffect(()=>{const x=p.current;if(!x)return;const b=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(b,"value").set;if(O!==m&&v){const w=new Event("change",{bubbles:!0});v.call(x,m),x.dispatchEvent(w)}},[O,m]),V.jsxs(At.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:c,autoComplete:u,disabled:a,form:f,onChange:x=>s(x.target.value),...n,style:{...I8,...n.style},ref:g,defaultValue:m,children:[Yh(o)&&!y?V.jsx("option",{value:""}):null,Array.from(h)]},d)},"SelectBubbleInput"));function V8(t){return typeof t=="function"}St(V8,"isFunction");function Yh(t){return t===""||t===void 0}St(Yh,"shouldShowPlaceholder");function vw(t){const e=Di(t),n=C.useRef(""),r=C.useRef(0),i=C.useCallback(s=>{const l=n.current+s;e(l),St((function a(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}),"updateSearch")(l)},[e]),o=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}St(vw,"useTypeaheadSearch");function Sw(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let s=B8(t,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const a=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}St(Sw,"findNextItem");function B8(t,e){return t.map((n,r)=>t[(e+r)%t.length])}St(B8,"wrapArray");var Xae=Object.defineProperty,hn=(t,e)=>Xae(t,"name",{value:e,configurable:!0}),[ww,mpe]=mo("Tooltip",[tu]),TO=tu(),Wae="TooltipProvider",Hae=700,nb="tooltip.open",[qae,kw]=ww(Wae),Yae=hn(t=>{const{__scopeTooltip:e,delayDuration:n=Hae,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,s=C.useRef(!0),l=C.useRef(!1),a=C.useRef(0);return C.useEffect(()=>{const c=a.current;return()=>window.clearTimeout(c)},[]),V.jsx(qae,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:C.useCallback(()=>{r<=0||(window.clearTimeout(a.current),s.current=!1)},[r]),onClose:C.useCallback(()=>{r<=0||(window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(c=>{l.current=c},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),rb="Tooltip",[Uae,Uh]=ww(rb),Gae=hn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=t,a=kw(rb,t.__scopeTooltip),c=TO(e),[u,f]=C.useState(null),[h,d]=C.useState(void 0),p=Kc(),g=C.useRef(0),m=s??a.disableHoverableContent,O=l??a.delayDuration,y=C.useRef(!1),[x,b]=is({prop:r,defaultProp:i??!1,onChange:hn(T=>{T?(a.onOpen(),document.dispatchEvent(new CustomEvent(nb))):a.onClose(),o?.(T)},"onChange"),caller:rb}),S=C.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),v=C.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,b(!0)},[b]),w=C.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),k=C.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,b(!0),g.current=0},O)},[O,b]);C.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const P=h??p;return V.jsx(jv,{...c,children:V.jsx(Uae,{scope:e,contentId:P,setContentId:d,open:x,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:C.useCallback(()=>{a.isOpenDelayedRef.current?k():v()},[a.isOpenDelayedRef,k,v]),onTriggerLeave:C.useCallback(()=>{m?w():(window.clearTimeout(g.current),g.current=0)},[w,m]),onOpen:v,onClose:w,disableHoverableContent:m,children:n})})},"Tooltip"),iP="TooltipTrigger",Kae=C.forwardRef(hn(function(e,n){const{__scopeTooltip:r,...i}=e,o=Uh(iP,r),s=kw(iP,r),l=TO(r),a=C.useRef(null),c=Bt(n,a,o.onTriggerChange),u=C.useRef(!1),f=C.useRef(!1),h=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),V.jsx(nO,{asChild:!0,...l,children:V.jsx(At.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:c,onPointerMove:Je(e.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Je(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Je(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Je(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Je(e.onBlur,o.onClose),onClick:Je(e.onClick,o.onClose)})})},"TooltipTrigger")),F8="TooltipPortal",[Jae,ece]=ww(F8,{forceMount:void 0}),tce=hn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,o=Uh(F8,e);return V.jsx(Jae,{scope:e,forceMount:n,children:V.jsx(Mh,{present:n||o.open,children:V.jsx(Wv,{asChild:!0,container:i,children:r})})})},"TooltipPortal"),uh="TooltipContent",nce=C.forwardRef(hn(function(e,n){const r=ece(uh,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...s}=e,l=Uh(uh,e.__scopeTooltip);return V.jsx(Mh,{present:i||l.open,children:l.disableHoverableContent?V.jsx(Z8,{side:o,...s,ref:n}):V.jsx(rce,{side:o,...s,ref:n})})},"TooltipContent")),rce=C.forwardRef(hn(function(e,n){const r=Uh(uh,e.__scopeTooltip),i=kw(uh,e.__scopeTooltip),o=C.useRef(null),s=Bt(n,o),[l,a]=C.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:h}=i,d=C.useCallback(()=>{a(null),h(!1)},[h]),p=C.useCallback((g,m)=>{const O=g.currentTarget,y={x:g.clientX,y:g.clientY},x=z8(y,O.getBoundingClientRect()),b=j8(y,x),S=X8(m.getBoundingClientRect()),v=H8([...b,...S]);a(v),h(!0)},[h]);return C.useEffect(()=>()=>d(),[d]),C.useEffect(()=>{if(c&&f){const g=hn(O=>p(O,f),"handleTriggerLeave"),m=hn(O=>p(O,c),"handleContentLeave");return c.addEventListener("pointerleave",g),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",m)}}},[c,f,p,d]),C.useEffect(()=>{if(l){const g=hn(m=>{const O=m.target,y={x:m.clientX,y:m.clientY},x=c?.contains(O)||f?.contains(O),b=!W8(y,l);x?d():b&&(d(),u())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,f,l,u,d]),V.jsx(Z8,{...e,ref:s})},"TooltipContentHoverable")),ice=aQ("TooltipContent"),Z8=C.forwardRef(hn(function(e,n){const{__scopeTooltip:r,children:i,"aria-label":o,id:s,onEscapeKeyDown:l,onPointerDownOutside:a,...c}=e,u=Uh(uh,r),f=TO(r),{onClose:h}=u;C.useEffect(()=>(document.addEventListener(nb,h),()=>document.removeEventListener(nb,h)),[h]),C.useEffect(()=>{if(u.trigger){const p=hn(g=>{g.target instanceof Node&&g.target.contains(u.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,h]);const{setContentId:d}=u;return In(()=>(d(s),()=>{d(void 0)}),[s,d]),V.jsx(Rv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:V.jsxs(Xv,{"data-state":u.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:u.contentId,...f,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[V.jsx(ice,{children:i}),o?V.jsx(fae,{id:u.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl")),oce=C.forwardRef(hn(function(e,n){const{__scopeTooltip:r,...i}=e,o=TO(r);return V.jsx(FQ,{...o,...i,ref:n})},"TooltipArrow"));function z8(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}hn(z8,"getExitSideFromRect");function j8(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}hn(j8,"getPaddedExitPoints");function X8(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}hn(X8,"getPointsFromRect");function W8(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const l=e[o],a=e[s],c=l.x,u=l.y,f=a.x,h=a.y;u>r!=h>r&&n<(f-c)*(r-u)/(h-u)+c&&(i=!i)}return i}hn(W8,"isPointInPolygon");function H8(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),q8(e)}hn(H8,"getHull");function q8(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const o=e[e.length-1],s=e[e.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}hn(q8,"getHullPresorted");var Y8=Yae,U8=Gae,G8=Kae,K8=tce,J8=nce,sce=oce;const PO=_.forwardRef(({title:t,children:e},n)=>{const r=wn(qc);return _.createElement(Y8,{delayDuration:100},_.createElement(U8,null,_.createElement(G8,{ref:n,asChild:!0},_.createElement("span",{className:xe.tooltipTrigger},e)),_.createElement(K8,{container:r?.current},_.createElement(J8,{className:sn(xe.tooltipContent),sideOffset:10},t))))}),lce=_.forwardRef(({children:t,className:e,...n},r)=>_.createElement(Bae,{...n,ref:r,className:sn(e,xe.selectItem)},_.createElement(Fae,null,t))),ace=({title:t,placeholder:e,className:n})=>{const[r,i]=Vn(ui,Bn);return _.createElement(PO,{title:t},_.createElement(vae,{"aria-label":e,className:sn(xe.selectTrigger,n),"data-toolbar-item":!0,disabled:r},_.createElement(wae,{placeholder:e}),_.createElement(kae,{className:xe.selectDropdownArrow},i("arrow_drop_down"))))},cce=({children:t,className:e=xe.selectContainer})=>{const n=wn(qc);return _.createElement(Pae,{container:n?.current},_.createElement(Eae,{className:sn(e,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},_.createElement(Iae,{"data-editor-dropdown":!0,style:{maxHeight:"var(--radix-select-content-available-height)"}},t)))},eL=t=>_.createElement(xae,{value:t.value||"",onValueChange:t.onChange,disabled:t.disabled},_.createElement(ace,{title:t.triggerTitle,placeholder:t.placeholder}),_.createElement(cce,null,t.items.map((e,n)=>e==="separator"?_.createElement(Zae,{key:n}):_.createElement(lce,{key:n,value:e.value},e.label)))),uce=({language:t,nodeKey:e,code:n,focusEmitter:r})=>{const i=_n(),{parentEditor:o,lexicalNode:s}=lx(),[l,a,c,u,f]=Vn(ui,sb,lb,Bn,ob),h=rae(e,t,r),{setCode:d}=lx(),p=_.useRef(null),g=_.useRef(null),{value:m,items:O}=_.useMemo(()=>fce(f,t),[f,t]),y=_.useRef(d);return y.current=d,h.current={getCodemirror:()=>p.current},_.useEffect(()=>{const x=g.current;return(async()=>{const b=[...a,R8,c8,HS(),au.of([use]),se.lineWrapping,se.updateListener.of(({state:S})=>{y.current(S.doc.toString())}),se.domEventHandlers({focus:()=>{o.update(()=>{Vt(null)})}})];if(l&&b.push(ze.readOnly.of(!0)),t!==""){const S=f.keyMap[t]??t,v=f.supportMap[S];if(v)b.push(v.extension);else if(c){const w=Gie.find(k=>k.name===t||k.alias.includes(t)||k.extensions.includes(t));if(w)try{const k=await w.load();b.push(k.extension)}catch{console.warn("failed to load language support for",t)}}}x.innerHTML="",p.current=new se({parent:x,state:ze.create({doc:n,extensions:b})}),x.addEventListener("keydown",oP)})(),()=>{var b;(b=p.current)==null||b.destroy(),p.current=null,x.removeEventListener("keydown",oP)}},[l,t,...a]),_.createElement("div",{className:xe.codeMirrorWrapper},_.createElement("div",{className:xe.codeMirrorToolbar},_.createElement(eL,{disabled:l,value:m,onChange:x=>{o.update(()=>{s.setLanguage(x===Vp?"":x),setTimeout(()=>{o.update(()=>{s.getLatest().select()})})})},triggerTitle:i("codeBlock.selectLanguage","Select code block language"),placeholder:i("codeBlock.inlineLanguage","Language"),items:O}),_.createElement("button",{className:xe.iconButton,type:"button",disabled:l,title:i("codeblock.delete","Delete code block"),onClick:x=>{x.preventDefault(),o.update(()=>{s.remove()})}},u("delete_small"))),_.createElement("div",{ref:g}))};function oP(t){t.stopPropagation()}const Vp="__EMPTY_VALUE__";function ib(t){var e;const n=[],r={},i={};if(Array.isArray(t))for(const o of t){const s=((e=o.alias)==null?void 0:e[0])??o.name.toLowerCase(),l=s||Vp;if(n.push({value:l,label:o.name}),r[s]=l,o.alias)for(const a of o.alias)r[a]=l;if(o.extensions)for(const a of o.extensions)r[a]=l;r[o.name.toLowerCase()]=l,o.support&&(i[l]=o.support)}else{const o={};for(const[s,l]of Object.entries(t))l in o||(o[l]=s,n.push({value:s||Vp,label:l})),r[s]=o[l]||Vp}return{items:n,keyMap:r,supportMap:i}}function fce(t,e){const n=t.keyMap[e]??e;return!n||t.items.some(r=>r.value===n)?{value:n,items:t.items}:{value:n,items:[...t.items,{value:n,label:e}]}}const ob=we(ib({js:"JavaScript",ts:"TypeScript",tsx:"TypeScript (React)",jsx:"JavaScript (React)",css:"CSS"})),hce=Nn(t=>{t.link(t.pipe(hce,Rl(({language:e,code:n})=>({code:n,language:e,meta:""}))),_S)}),sb=we([]),lb=we(!0),dce=Zr({update(t,e){t.pubIn({[ob]:ib(e?.codeBlockLanguages??{}),[sb]:e?.codeMirrorExtensions??[],[lb]:e?.autoLoadLanguageSupport??!0})},init(t,e){const n=ib(e?.codeBlockLanguages??{});t.pubIn({[ob]:n,[sb]:e?.codeMirrorExtensions??[],[_ee]:pce(n),[lb]:e?.autoLoadLanguageSupport??!0})}});function pce(t){return{match(e,n){return!n||Object.hasOwn(t.keyMap,e??"")},priority:1,Editor:uce}}function gce({url:t,title:e,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:o,showLinkTitleField:s,showAnchorTextField:l}){const{register:a,handleSubmit:c,control:u,setValue:f,reset:h}=CJ({values:{url:t,title:e,text:n}}),d=_n();return _.createElement("form",{onSubmit:p=>{c(r)(p),p.stopPropagation(),p.preventDefault()},onReset:p=>{p.stopPropagation(),i()},onKeyDown:p=>{p.key==="Escape"&&(p.stopPropagation(),i())},className:sn(xe.multiFieldForm,xe.linkDialogEditForm)},_.createElement("div",{className:xe.formField},_.createElement("label",{htmlFor:"link-url"},d("createLink.url","URL")),_.createElement(dee,{register:a,initialInputValue:t,inputName:"url",suggestions:o,setValue:f,control:u,placeholder:d("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),l?_.createElement("div",{className:xe.formField},_.createElement("label",{htmlFor:"link-text",title:d("createLink.textTooltip","The text to be displayed for the link")},d("createLink.text","Anchor text")),_.createElement("input",{id:"link-text",className:xe.textInput,size:40,...a("text")})):null,s?_.createElement("div",{className:xe.formField},_.createElement("label",{htmlFor:"link-title",title:d("createLink.titleTooltip","The link's title attribute, shown on hover")},d("createLink.title","Link title")),_.createElement("input",{id:"link-title",className:xe.textInput,size:40,...a("title")})):null,_.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},_.createElement("button",{type:"submit",title:d("createLink.saveTooltip","Set URL"),"aria-label":d("createLink.saveTooltip","Set URL"),className:sn(xe.primaryButton)},d("dialogControls.save","Save")),_.createElement("button",{type:"reset",title:d("createLink.cancelTooltip","Cancel change"),"aria-label":d("createLink.cancelTooltip","Cancel change"),className:sn(xe.secondaryButton)},d("dialogControls.cancel","Cancel"))))}const mce=()=>{const[t,e,n,r,i,o,s,l]=Vn(qc,w9,zt,Bn,Zn,lL,aL,uL),a=Zt(nL),c=Zt(rL),u=Zt(iL),f=Zt(oL),h=Zt(sL);_.useEffect(()=>{const y=e?.closest(".mdxeditor-root-contenteditable"),x=()=>{n?.getEditorState().read(()=>{a(!0)})};return window.addEventListener("resize",x),window.addEventListener("scroll",x),y?.addEventListener("scroll",x),()=>{window.removeEventListener("resize",x),window.removeEventListener("scroll",x),y?.removeEventListener("scroll",x)}},[n,e,a]);const[d,p]=_.useState(!1),g=_n();if(i.type==="inactive")return null;const m=i.rectangle,O=i.type==="preview"&&i.url.startsWith("http");return _.createElement(Gv,{open:!0},_.createElement(PG,{"data-visible":i.type==="edit",className:xe.linkDialogAnchor,style:{top:`${m.top}px`,left:`${m.left}px`,width:`${m.width}px`,height:`${m.height}px`}}),_.createElement(Kv,{container:t?.current},_.createElement(EG,{className:sn(xe.linkDialogPopoverContent),sideOffset:5,updatePositionStrategy:"always",onOpenAutoFocus:y=>{y.preventDefault()},key:i.linkNodeKey},i.type==="edit"&&_.createElement(gce,{url:i.url,title:i.title,text:i.text,onSubmit:c,onCancel:u.bind(null),linkAutocompleteSuggestions:o,showLinkTitleField:l,showAnchorTextField:i.withAnchorText}),i.type==="preview"&&_.createElement(_.Fragment,null,_.createElement("a",{className:xe.linkDialogPreviewAnchor,"data-testid":"link-dialog-preview",href:i.href??"about:blank",...O?{target:"_blank",rel:"noreferrer"}:{},onClick:y=>{s!==null&&(y.preventDefault(),s(i.url))},title:O?g("linkPreview.open","Open {{url}} in new window",{url:i.url}):i.url},_.createElement("span",null,i.url),O&&r("open_in_new")),_.createElement(l0,{onClick:()=>{f()},title:g("linkPreview.edit","Edit link URL"),"aria-label":g("linkPreview.edit","Edit link URL")},r("edit")),_.createElement(Y8,null,_.createElement(U8,{open:d},_.createElement(G8,{asChild:!0},_.createElement(l0,{title:g("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":g("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(i.url).then(()=>{p(!0),setTimeout(()=>{p(!1)},1e3)})}},r(d?"check":"content_copy"))),_.createElement(K8,{container:t?.current},_.createElement(J8,{className:sn(xe.tooltipContent),sideOffset:5},g("linkPreview.copied","Copied!"),_.createElement(sce,null))))),_.createElement(l0,{title:g("linkPreview.remove","Remove link"),"aria-label":g("linkPreview.remove","Remove link"),onClick:()=>{h()}},r("link_off"))),_.createElement(Jv,{className:xe.popoverArrow}))))},l0=_.forwardRef(({className:t,...e},n)=>_.createElement("button",{className:sn(xe.actionButton,t),ref:n,...e}));function nm(t){if(!t)return null;const e=cH(t);if(e===null)return null;const n=e.getParent();return en(n)?n:en(e)?e:null}function tL(t=ne()){if(!it(t))return null;const e=t.getNodes(),n=e.length===1?e[0]:null;return Fe(n)&&n.isInline()?n:null}function a0(t,e,n){return t?t.getEditorState().read(()=>{const r=e===""?null:Ge(e),i=ne(),o=X(i)?nm(i):null,s=en(r)?r:o;return s?.sanitizeUrl(n)??"about:blank"}):"about:blank"}const nL=Nn(),Zn=we({type:"inactive"},t=>{t.pub(vg,e=>e.registerCommand(bm,()=>t.getValue(Zn).type==="preview"?(t.pub(Zn,{type:"inactive"}),!0):!1,fn)),t.sub(t.pipe(ts),e=>{e!=="rich-text"&&t.pub(Zn,{type:"inactive"})}),t.pub(vg,e=>e.registerCommand(xm,n=>{if(n.key==="k"&&(wg?n.metaKey:n.ctrlKey)&&!t.getValue(ui)){const r=ne();return X(r)||tL(r)!==null?(t.pub(Cw),n.stopPropagation(),n.preventDefault(),!0):!1}return!1},DD)),t.sub(t.pipe(oL,rn(Zn,zt)),([,e,n])=>{if(e.type==="preview")setTimeout(()=>{n?.getEditorState().read(()=>{const r=Ge(e.linkNodeKey),i=en(r)?r.getTextContent().length>0&&r.getChildrenSize()<=1:!1,o=i&&r?r.getTextContent():"";t.pub(Zn,{type:"edit",initialUrl:e.url,url:e.url,title:e.title,text:o,withAnchorText:i,linkNodeKey:e.linkNodeKey,decoratorNodeKey:e.decoratorNodeKey,rectangle:e.rectangle})})});else throw new Error("Cannot switch to edit mode when not in preview mode")}),t.sub(t.pipe(rL,rn(zt,Zn,wc)),([e,n,r,i])=>{var o,s,l;const a=((o=e.text)==null?void 0:o.trim())??"",c=((s=e.url)==null?void 0:s.trim())??"",u=((l=e.title)==null?void 0:l.trim())??"";if(c!==""){if(r.decoratorNodeKey!==void 0){let f="",h=!1;if(n?.update(()=>{const d=Ge(r.decoratorNodeKey);if(d===null)return;const p=Vl();if(p.add(d.getKey()),Vt(p),h=n.dispatchCommand(Cs,c),!h)return;const g=d.getParent();en(g)&&(g.setTitle(u),f=g.getKey())},{discrete:!0}),f==="")return;t.pub(Zn,{type:"preview",linkNodeKey:f,decoratorNodeKey:r.decoratorNodeKey,rectangle:r.rectangle,title:u,url:c,href:a0(n,f,c)});return}if(i?.isCollapsed()){const f=a||u||c;n?.update(()=>{const h=nm(i);if(h)if(er(h)){const d=os(c,{title:u});d.append(bt(a)),h.replace(d),d.select()}else h.setURL(c),h.setTitle(u),sP(h.getFirstChild(),a);else{const d=os(c,{title:u});d.append(bt(f)),_m([d]),d.select()}},{discrete:!0})}else n?.update(()=>{sP(i?.anchor.getNode(),a)}),n?.dispatchCommand(Cs,{url:c,title:u});t.pub(Zn,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:u,url:c,href:a0(n,r.linkNodeKey??"",c)})}else r.type==="edit"&&r.initialUrl!==""&&(r.decoratorNodeKey!==void 0?n?.update(()=>{const f=Ge(r.decoratorNodeKey);if(f===null)return;const h=Vl();h.add(f.getKey()),Vt(h),n.dispatchCommand(Cs,null)}):n?.dispatchCommand(Cs,null)),t.pub(Zn,{type:"inactive"})}),t.link(t.pipe(iL,rn(Zn,zt),Rl(([,e,n])=>{if(e.type==="edit")return n?.focus(),e.initialUrl===""?{type:"inactive"}:{type:"preview",url:e.initialUrl,href:a0(n,e.linkNodeKey,e.initialUrl),linkNodeKey:e.linkNodeKey,decoratorNodeKey:e.decoratorNodeKey,rectangle:e.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),Zn),t.link(t.pipe(t.combine(wc,nL),rn(zt,Zn,ui),Rl(([[e],n,r,i])=>{if(r.decoratorNodeKey!==void 0&&n&&!i){if(n.getEditorState().read(()=>{const l=ne();if(!it(l))return null;const a=l.getNodes();return a.length===1?a[0].getKey():null})!==r.decoratorNodeKey)return{type:"inactive"};const s=B9(n,r.decoratorNodeKey);return s===null?{type:"inactive"}:{...r,rectangle:s}}if(X(e)&&n&&!i){const o=nm(e);if(!e.isCollapsed())return{type:"inactive"};if(o){const s=F9(n);return s?{type:"preview",url:o.getURL(),href:o.sanitizeUrl(o.getURL()),linkNodeKey:o.getKey(),title:o.getTitle(),rectangle:s}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),Zn)}),rL=Nn(),iL=Bc();Bc();const oL=Bc(),sL=Bc(t=>{t.sub(t.pipe(sL,rn(zt)),([,e])=>{e?.dispatchCommand(Cs,null)})}),Cw=Bc(t=>{t.sub(t.pipe(Cw,rn(wc,zt)),([,e,n])=>{if(!n)return;const r=n.getEditorState().read(()=>{const i=tL();if(i===null)return null;const o=i.getParent(),s=en(o)?o:null;return{nodeKey:i.getKey(),url:s?.getURL()??"",title:s?.getTitle()??"",linkNodeKey:s?.getKey()??""}});if(r!==null){const i=B9(n,r.nodeKey);if(i===null)return;t.pub(Zn,{type:"edit",initialUrl:r.url,url:r.url,title:r.title,text:"",withAnchorText:!1,linkNodeKey:r.linkNodeKey,decoratorNodeKey:r.nodeKey,rectangle:i});return}X(e)&&n.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{const i=nm(e),o=F9(n);if(o===null)return;const s=i?.getURL()??"",l=i?.getURL()??"",a=i?.getTitle()??"",c=i?.getKey()??"",u=i?i.getTextContent().length>0&&i.getChildrenSize()<=1:e.isCollapsed(),f=u&&i?i.getTextContent():"";t.pub(Zn,{type:"edit",initialUrl:s,url:l,title:a,text:f,withAnchorText:u,linkNodeKey:c,rectangle:o})})})})})}),lL=we([]),aL=we(null),cL=we(null,t=>{t.pub(vg,e=>{function n(r){const[i,o]=t.getValues([ui,cL]);!i||o===null||e.update(()=>{const s=Li(r.target);if(s!==null){const l=lt(s,a=>a instanceof yo);l!==null&&o(r,l,l.getURL())}})}return e.registerRootListener((r,i)=>{r&&r.addEventListener("click",n),i&&i.removeEventListener("click",n)})})});function sP(t,e){Y(t)&&e&&(t.setTextContent(e),t.selectStart())}const uL=we(!0),Oce=Zr({init(t,e){t.pub(Ah,e?.LinkDialog??mce),t.pub(aL,e?.onClickLinkCallback??null),t.pub(cL,e?.onReadOnlyClickLinkCallback??null),t.pub(uL,e?.showLinkTitleField??!0)},update(t,e={}){t.pub(lL,e.linkAutocompleteSuggestions??[])}});function _w(t,e){return _.forwardRef((n,r)=>{const i=sn(e.className,n.className);return _.createElement(t,{...e,...n,className:i,ref:r})})}function yce(t){return({title:e,children:n,...r})=>_.createElement(t,{"aria-label":e,...r},_.createElement(PO,{title:e},n))}const xce=({readOnly:t,children:e,className:n})=>_.createElement(iS,{className:sn("mdxeditor-toolbar",xe.toolbarRoot,{[xe.readOnlyToolbarRoot]:t},n),...t?{tabIndex:-1}:{}},e),bce=_w($l,{className:xe.toolbarButton,"data-toolbar-item":!0}),EO=yce(bce),fL=_w(Tp,{className:xe.toolbarToggleItem,"data-toolbar-item":!0});_w(sO,{type:"single",className:xe.toolbarToggleSingleGroup});const hL=_.forwardRef(({on:t,title:e,children:n,disabled:r,...i},o)=>_.createElement(sO,{type:"single",className:xe.toolbarToggleSingleGroup,...i,value:t?"on":"off",ref:o},_.createElement(fL,{"aria-label":e,value:"on",disabled:r},_.createElement(PO,{title:e},n)))),dL=({items:t})=>_.createElement("div",{className:xe.toolbarGroupOfGroups},t.map((e,n)=>_.createElement(hL,{key:n,title:e.title,on:e.active,onValueChange:r=>{e.onChange(r==="on")},disabled:e.disabled},e.contents))),pL=({value:t,onChange:e,className:n,ggClassName:r,items:i,disabled:o})=>{const s=_n();return _.createElement("div",{className:sn(xe.toolbarGroupOfGroups,r)},_.createElement(sO,{"aria-label":s("toolbar.toggleGroup","toggle group"),type:"single",className:sn(xe.toolbarToggleSingleGroup,n),onValueChange:e,value:t||"",disabled:o,onFocus:l=>{l.preventDefault()}},i.map((l,a)=>_.createElement(fL,{key:a,"aria-label":l.title,value:l.value},_.createElement(PO,{title:l.title},l.contents)))))},c0=we(()=>null),u0=we(""),lP=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",vce=Zr({init(t,e){const n=e?.toolbarPosition==="bottom"?GX:UX;t.pubIn({[c0]:e?.toolbarContents??lP,[u0]:e?.toolbarClassName??"",[n]:()=>{const[r,i,o]=Vn(c0,ui,u0);return _.createElement(xce,{className:o,readOnly:i},r())}})},update(t,e){t.pub(c0,e?.toolbarContents??lP),t.pub(u0,e?.toolbarClassName??"")}});class nn{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}offset(e,n=e){return new nn(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function ia(t,e,n,r,i,o){if(t==r)return[];let s=Pw(t,e,n,r,i,o),l=Ew(t,e+s,n,r,i+s,o);e+=s,n-=l,i+=s,o-=l;let a=n-e,c=o-i;if(!a||!c)return[new nn(e,n,i,o)];if(a>c){let f=t.slice(e,n).indexOf(r.slice(i,o));if(f>-1)return[new nn(e,e+f,i,i),new nn(e+f+c,n,o,o)]}else if(c>a){let f=r.slice(i,o).indexOf(t.slice(e,n));if(f>-1)return[new nn(e,e,i,i+f),new nn(n,n,i+f+a,o)]}if(a==1||c==1)return[new nn(e,n,i,o)];let u=OL(t,e,n,r,i,o);if(u){let[f,h,d]=u;return ia(t,e,f,r,i,h).concat(ia(t,f+d,n,r,h+d,o))}return Sce(t,e,n,r,i,o)}let Fu=1e9,Zu=0,Tw=!1;function Sce(t,e,n,r,i,o){let s=n-e,l=o-i;if(Fu<1e9&&Math.min(s,l)>Fu*16||Zu>0&&Date.now()>Zu)return Math.min(s,l)>Fu*64?[new nn(e,n,i,o)]:aP(t,e,n,r,i,o);let a=Math.ceil((s+l)/2);f0.reset(a),h0.reset(a);let c=(d,p)=>t.charCodeAt(e+d)==r.charCodeAt(i+p),u=(d,p)=>t.charCodeAt(n-d-1)==r.charCodeAt(o-p-1),f=(s-l)%2!=0?h0:null,h=f?null:f0;for(let d=0;d<a;d++){if(d>Fu||Zu>0&&!(d&63)&&Date.now()>Zu)return aP(t,e,n,r,i,o);let p=f0.advance(d,s,l,a,f,!1,c)||h0.advance(d,s,l,a,h,!0,u);if(p)return wce(t,e,n,e+p[0],r,i,o,i+p[1])}return[new nn(e,n,i,o)]}class gL{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,r,i,o,s,l){for(let a=-e+this.start;a<=e-this.end;a+=2){let c=i+a,u=a==-e||a!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,f=u-a;for(;u<n&&f<r&&l(u,f);)u++,f++;if(this.vec[c]=u,u>n)this.end+=2;else if(f>r)this.start+=2;else if(o){let h=i+(n-r)-a;if(h>=0&&h<this.len&&o.vec[h]!=-1)if(s){let d=o.vec[h];if(d>=n-u)return[d,i+d-h]}else{let d=n-o.vec[h];if(u>=d)return[u,f]}}}return null}}const f0=new gL,h0=new gL;function wce(t,e,n,r,i,o,s,l){let a=!1;return!Lc(t,r)&&++r==n&&(a=!0),!Lc(i,l)&&++l==s&&(a=!0),a?[new nn(e,n,o,s)]:ia(t,e,r,i,o,l).concat(ia(t,r,n,i,l,s))}function mL(t,e){let n=1,r=Math.min(t,e);for(;n<r;)n=n<<1;return n}function Pw(t,e,n,r,i,o){if(e==n||e==o||t.charCodeAt(e)!=r.charCodeAt(i))return 0;let s=mL(n-e,o-i);for(let l=e,a=i;;){let c=l+s,u=a+s;if(c>n||u>o||t.slice(l,c)!=r.slice(a,u)){if(s==1)return l-e-(Lc(t,l)?0:1);s=s>>1}else{if(c==n||u==o)return c-e;l=c,a=u}}}function Ew(t,e,n,r,i,o){if(e==n||i==o||t.charCodeAt(n-1)!=r.charCodeAt(o-1))return 0;let s=mL(n-e,o-i);for(let l=n,a=o;;){let c=l-s,u=a-s;if(c<e||u<i||t.slice(c,l)!=r.slice(u,a)){if(s==1)return n-l-(Lc(t,l)?0:1);s=s>>1}else{if(c==e||u==i)return n-c;l=c,a=u}}}function ab(t,e,n,r,i,o,s,l){let a=r.slice(i,o),c=null;for(;;){if(c||s<l)return c;for(let u=e+s;;){Lc(t,u)||u++;let f=u+s;if(Lc(t,f)||(f+=f==u+1?1:-1),f>=n)break;let h=t.slice(u,f),d=-1;for(;(d=a.indexOf(h,d+1))!=-1;){let p=Pw(t,f,n,r,i+d+h.length,o),g=Ew(t,e,u,r,i,i+d),m=h.length+p+g;(!c||c[2]<m)&&(c=[u-g,i+d-g,m])}u=f}if(l<0)return c;s=s>>1}}function OL(t,e,n,r,i,o){let s=n-e,l=o-i;if(s<l){let a=OL(r,i,o,t,e,n);return a&&[a[1],a[0],a[2]]}return s<4||l*2<s?null:ab(t,e,n,r,i,o,Math.floor(s/4),-1)}function aP(t,e,n,r,i,o){Tw=!0;let s=n-e,l=o-i,a;if(s<l){let h=ab(r,i,o,t,e,n,Math.floor(s/6),50);a=h&&[h[1],h[0],h[2]]}else a=ab(t,e,n,r,i,o,Math.floor(l/6),50);if(!a)return[new nn(e,n,i,o)];let[c,u,f]=a;return ia(t,e,c,r,i,u).concat(ia(t,c+f,n,r,u+f,o))}function yL(t,e){for(let n=1;n<t.length;n++){let r=t[n-1],i=t[n];r.toA>i.fromA-e&&r.toB>i.fromB-e&&(t[n-1]=new nn(r.fromA,i.toA,r.fromB,i.toB),t.splice(n--,1))}}function kce(t,e,n){for(;;){yL(n,1);let r=!1;for(let i=0;i<n.length;i++){let o=n[i],s,l;(s=Pw(t,o.fromA,o.toA,e,o.fromB,o.toB))&&(o=n[i]=new nn(o.fromA+s,o.toA,o.fromB+s,o.toB)),(l=Ew(t,o.fromA,o.toA,e,o.fromB,o.toB))&&(o=n[i]=new nn(o.fromA,o.toA-l,o.fromB,o.toB-l));let a=o.toA-o.fromA,c=o.toB-o.fromB;if(a&&c)continue;let u=o.fromA-(i?n[i-1].toA:0),f=(i<n.length-1?n[i+1].fromA:t.length)-o.toA;if(!u||!f)continue;let h=a?t.slice(o.fromA,o.toA):e.slice(o.fromB,o.toB);u<=h.length&&t.slice(o.fromA-u,o.fromA)==h.slice(h.length-u)?(n[i]=new nn(o.fromA-u,o.toA-u,o.fromB-u,o.toB-u),r=!0):f<=h.length&&t.slice(o.toA,o.toA+f)==h.slice(0,f)&&(n[i]=new nn(o.fromA+f,o.toA+f,o.fromB+f,o.toB+f),r=!0)}if(!r)break}return n}function Cce(t,e,n){for(let r=0,i=0;i<t.length;i++){let o=t[i],s=o.toA-o.fromA,l=o.toB-o.fromB;if(s&&l||s>3||l>3){let a=i==t.length-1?e.length:t[i+1].fromA,c=o.fromA-r,u=a-o.toA,f=uP(e,o.fromA,c),h=cP(e,o.toA,u),d=o.fromA-f,p=h-o.toA;if((!s||!l)&&d&&p){let g=Math.max(s,l),[m,O,y]=s?[e,o.fromA,o.toA]:[n,o.fromB,o.toB];g>d&&e.slice(f,o.fromA)==m.slice(y-d,y)?(o=t[i]=new nn(f,f+s,o.fromB-d,o.toB-d),f=o.fromA,h=cP(e,o.toA,a-o.toA)):g>p&&e.slice(o.toA,h)==m.slice(O,O+p)&&(o=t[i]=new nn(h-s,h,o.fromB+p,o.toB+p),h=o.toA,f=uP(e,o.fromA,o.fromA-r)),d=o.fromA-f,p=h-o.toA}if(d||p)o=t[i]=new nn(o.fromA-d,o.toA+p,o.fromB-d,o.toB+p);else if(s){if(!l){let g=hP(e,o.fromA,o.toA),m,O=g<0?-1:fP(e,o.toA,o.fromA);g>-1&&(m=g-o.fromA)<=u&&e.slice(o.fromA,g)==e.slice(o.toA,o.toA+m)?o=t[i]=o.offset(m):O>-1&&(m=o.toA-O)<=c&&e.slice(o.fromA-m,o.fromA)==e.slice(O,o.toA)&&(o=t[i]=o.offset(-m))}}else{let g=hP(n,o.fromB,o.toB),m,O=g<0?-1:fP(n,o.toB,o.fromB);g>-1&&(m=g-o.fromB)<=u&&n.slice(o.fromB,g)==n.slice(o.toB,o.toB+m)?o=t[i]=o.offset(m):O>-1&&(m=o.toB-O)<=c&&n.slice(o.fromB-m,o.fromB)==n.slice(O,o.toB)&&(o=t[i]=o.offset(-m))}}r=o.toA}return yL(t,3),t}let Ml;try{Ml=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function xL(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function bL(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?xL(n)?1:0:Ml?!wL(n)||e==t.length-1?Ml.test(String.fromCharCode(n))?1:0:Ml.test(t.slice(e,e+2))?2:0:0}function vL(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?xL(n)?1:0:Ml?!kL(n)||e==1?Ml.test(String.fromCharCode(n))?1:0:Ml.test(t.slice(e-2,e))?2:0:0}const SL=8;function cP(t,e,n){if(e==t.length||!vL(t,e))return e;for(let r=e,i=e+n,o=0;o<SL;o++){let s=bL(t,r);if(!s||r+s>i)return r;r+=s}return e}function uP(t,e,n){if(!e||!bL(t,e))return e;for(let r=e,i=e-n,o=0;o<SL;o++){let s=vL(t,r);if(!s||r-s<i)return r;r-=s}return e}function fP(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function hP(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const wL=t=>t>=55296&&t<=56319,kL=t=>t>=56320&&t<=57343;function Lc(t,e){return!e||e==t.length||!wL(t.charCodeAt(e-1))||!kL(t.charCodeAt(e))}function _ce(t,e,n){var r;let i=n?.override;return i?i(t,e):(Fu=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,Zu=n?.timeout?Date.now()+n.timeout:0,Tw=!1,kce(t,e,ia(t,0,t.length,e,0,e.length)))}function CL(){return!Tw}function _L(t,e,n){return Cce(_ce(t,e,n),t,e)}const Pi=ye.define({combine:t=>t[0]}),cb=Le.define(),Tce=ye.define(),Wo=cn.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(cb)&&(t=n.value);for(let n of e.state.facet(Tce))t=n(t,e);return t}});class hc{constructor(e,n,r,i,o,s=!0){this.changes=e,this.fromA=n,this.toA=r,this.fromB=i,this.toB=o,this.precise=s}offset(e,n){return e||n?new hc(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,r){let i=_L(e.toString(),n.toString(),r);return TL(i,e,n,0,0,CL())}static updateA(e,n,r,i,o){return OP(mP(e,i,!0,r.length),e,n,r,o)}static updateB(e,n,r,i,o){return OP(mP(e,i,!1,n.length),e,n,r,o)}}function dP(t,e,n,r){let i=n.lineAt(t),o=r.lineAt(e);return i.to==t&&o.to==e&&t<n.length&&e<r.length?[t+1,e+1]:[i.from,o.from]}function pP(t,e,n,r){let i=n.lineAt(t),o=r.lineAt(e);return i.from==t&&o.from==e?[t,e]:[i.to+1,o.to+1]}function TL(t,e,n,r,i,o){let s=[];for(let l=0;l<t.length;l++){let a=t[l],[c,u]=dP(a.fromA+r,a.fromB+i,e,n),[f,h]=pP(a.toA+r,a.toB+i,e,n),d=[a.offset(-c+r,-u+i)];for(;l<t.length-1;){let p=t[l+1],[g,m]=dP(p.fromA+r,p.fromB+i,e,n);if(g>f+1&&m>h+1)break;d.push(p.offset(-c+r,-u+i)),[f,h]=pP(p.toA+r,p.toB+i,e,n),l++}s.push(new hc(d,c,Math.max(c,f),u,Math.max(u,h),o))}return s}const qd=1e3;function gP(t,e,n,r){let i=0,o=t.length;for(;;){if(i==o){let u=0,f=0;i&&({toA:u,toB:f}=t[i-1]);let h=e-(n?u:f);return[u+h,f+h]}let s=i+o>>1,l=t[s],[a,c]=n?[l.fromA,l.toA]:[l.fromB,l.toB];if(a>e)o=s;else if(c<=e)i=s+1;else return r?[l.fromA,l.fromB]:[l.toA,l.toB]}}function mP(t,e,n,r){let i=[];return e.iterChangedRanges((o,s,l,a)=>{let c=0,u=n?e.length:r,f=0,h=n?r:e.length;o>qd&&([c,f]=gP(t,o-qd,n,!0)),s<e.length-qd&&([u,h]=gP(t,s+qd,n,!1));let d=a-l-(s-o),p,[g,m]=n?[d,0]:[0,d];i.length&&(p=i[i.length-1]).toA>=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:h,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:c,toA:u,fromB:f,toB:h,diffA:g,diffB:m})}),i}function OP(t,e,n,r,i){if(!t.length)return e;let o=[];for(let s=0,l=0,a=0,c=0;;s++){let u=s==t.length?null:t[s],f=u?u.fromA+l:n.length,h=u?u.fromB+a:r.length;for(;c<e.length;){let m=e[c];if(u&&(m.toA+l>f||m.toB+a>h))break;o.push(m.offset(l,a)),c++}if(!u)break;let d=u.toA+l+u.diffA,p=u.toB+a+u.diffB,g=_L(n.sliceString(f,d),r.sliceString(h,p),i);for(let m of TL(g,n,r,f,h,CL()))o.push(m);for(l+=u.diffA,a+=u.diffB;c<e.length;){let m=e[c];if(m.fromA+l>d&&m.fromB+a>p)break;c++}}return o}const Pce={scanLimit:500},PL=Ht.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=bP(t))}update(t){(t.docChanged||t.viewportChanged||Ece(t.startState,t.state)||$ce(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=bP(t.view))}},{decorations:t=>t.deco}),Yd=Fi.low(t7({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(PL))===null||e===void 0?void 0:e.gutter)||qe.empty}}));function Ece(t,e){return t.field(Wo,!1)!=e.field(Wo,!1)}function $ce(t,e){return t.facet(Pi)!=e.facet(Pi)}const yP=ke.line({class:"cm-changedLine"}),Ace=ke.mark({class:"cm-changedText"}),Qce=ke.mark({tagName:"ins",class:"cm-insertedLine"}),Mce=ke.mark({tagName:"del",class:"cm-deletedLine"}),xP=new class extends po{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Rce(t,e,n,r,i,o){let s=n?t.fromA:t.fromB,l=n?t.toA:t.toB,a=0;if(s!=l){i.add(s,s,yP),i.add(s,l,n?Mce:Qce),o&&o.add(s,s,xP);for(let c=e.iterRange(s,l-1),u=s;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,yP),o&&o.add(u,u,xP);continue}let f=u+c.value.length;if(r)for(;a<t.changes.length;){let h=t.changes[a],d=s+(n?h.fromA:h.fromB),p=s+(n?h.toA:h.toB),g=Math.max(u,d),m=Math.min(f,p);if(g<m&&i.add(g,m,Ace),p<f)a++;else break}u=f}}}function bP(t){let e=t.state.field(Wo),{side:n,highlightChanges:r,markGutter:i,overrideChunk:o}=t.state.facet(Pi),s=n=="a",l=new ir,a=i?new ir:null,{from:c,to:u}=t.viewport;for(let f of e){if((s?f.fromA:f.fromB)>=u)break;(s?f.toA:f.toB)>c&&(!o||!o(t.state,f,l,a))&&Rce(f,t.state.doc,s,r,l,a)}return{deco:l.finish(),gutter:a&&a.finish()}}class Ud extends pi{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const rm=Le.define({map:(t,e)=>t.map(e)}),zu=cn.define({create:()=>ke.none,update:(t,e)=>{for(let n of e.effects)if(n.is(rm))return n.value;return t.map(e.changes)},provide:t=>se.decorations.from(t)}),Gd=.01;function vP(t,e){if(t.size!=e.size)return!1;let n=t.iter(),r=e.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Lce(t,e,n){let r=new ir,i=new ir,o=t.state.field(zu).iter(),s=e.state.field(zu).iter(),l=0,a=0,c=0,u=0,f=t.viewport,h=e.viewport;for(let m=0;;m++){let O=m<n.length?n[m]:null,y=O?O.fromA:t.state.doc.length,x=O?O.fromB:e.state.doc.length;if(l<y){let b=t.lineBlockAt(l).top+c,S=e.lineBlockAt(a).top+u,v=b-S;v<-Gd?(c-=v,r.add(l,l,ke.widget({widget:new Ud(-v),block:!0,side:-1}))):v>Gd&&(u+=v,i.add(a,a,ke.widget({widget:new Ud(v),block:!0,side:-1})))}if(y>l+1e3&&l<f.from&&y>f.from&&a<h.from&&x>h.from){let b=Math.min(f.from-l,h.from-a);l+=b,a+=b,m--}else if(O)l=O.toA,a=O.toB;else break;for(;o.value&&o.from<l;)c-=o.value.spec.widget.height,o.next();for(;s.value&&s.from<a;)u-=s.value.spec.widget.height,s.next()}for(;o.value;)c-=o.value.spec.widget.height,o.next();for(;s.value;)u-=s.value.spec.widget.height,s.next();let d=t.contentHeight+c-(e.contentHeight+u);d<Gd?r.add(t.state.doc.length,t.state.doc.length,ke.widget({widget:new Ud(-d),block:!0,side:1})):d>Gd&&i.add(e.state.doc.length,e.state.doc.length,ke.widget({widget:new Ud(d),block:!0,side:1}));let p=r.finish(),g=i.finish();vP(p,t.state.field(zu))||t.dispatch({effects:rm.of(p)}),vP(g,e.state.field(zu))||e.dispatch({effects:rm.of(g)})}const ub=Le.define({map:(t,e)=>e.mapPos(t)});class Ice extends pi{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",r=>{let i=e.posAtDOM(r.target);e.dispatch({effects:ub.of(i)});let{side:o,sibling:s}=e.state.facet(Pi);s&&s().dispatch({effects:ub.of(Dce(i,e.state.field(Wo),o=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dce(t,e,n){let r=0,i=0;for(let o=0;;o++){let s=o<e.length?e[o]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-r);[r,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Nce=cn.define({create(t){return ke.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(ub)&&(t=t.update({filter:r=>r!=n.value}));if(t.size&&e.state.field(Wo)!=e.startState.field(Wo,!1)){let n=e.state.facet(Pi).side=="a",r=[];for(let i of e.state.field(Wo))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,o=>{r.push(o)});r.length&&(t=t.update({filter:i=>r.indexOf(i)<0}))}return t},provide:t=>se.decorations.from(t)});function SP({margin:t=3,minSize:e=4}){return Nce.init(n=>Vce(n,t,e))}function Vce(t,e,n){let r=new ir,i=t.facet(Pi).side=="a",o=t.field(Wo),s=1;for(let l=0;;l++){let a=l<o.length?o[l]:null,c=l?s+e:1,u=a?t.doc.lineAt(i?a.fromA:a.fromB).number-1-e:t.doc.lines,f=u-c+1;if(f>=n&&r.add(t.doc.line(c).from,t.doc.line(u).to,ke.replace({widget:new Ice(f),block:!0})),!a)break;s=t.doc.lineAt(Math.min(t.doc.length,i?a.toA:a.toB)).number}return r.finish()}const Bce=se.styleModule.of(new ss({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),Fce=se.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wP=new lu,Kd=new lu;class Zce{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||Pce;let n=[Fi.low(PL),Fce,Bce,zu,se.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(h=>h.effects.some(d=>d.is(rm)))&&this.measure()})],r=[Pi.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(Yd);let i=ze.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],se.editorAttributes.of({class:"cm-merge-a"}),Kd.of(r),n]}),o=[Pi.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&o.push(Yd);let s=ze.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],se.editorAttributes.of({class:"cm-merge-b"}),Kd.of(o),n]});this.chunks=hc.build(i.doc,s.doc,this.diffConf);let l=[Wo.init(()=>this.chunks),wP.of(e.collapseUnchanged?SP(e.collapseUnchanged):[])];i=i.update({effects:Le.appendConfig.of(l)}).state,s=s.update({effects:Le.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(a=="a-b"?c:u),this.editorDOM.appendChild(a=="a-b"?u:c),this.a=new se({state:i,parent:c,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new se({state:s,parent:u,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(r=>r.docChanged)){let r=e[e.length-1],i=e.reduce((s,l)=>s.compose(l.changes),tn.empty(e[0].startState.doc.length));this.chunks=n==this.a?hc.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):hc.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),n.update([...e,r.state.update({effects:cb.of(this.chunks)})]);let o=n==this.a?this.b:this.a;o.update([o.state.update({effects:cb.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let o=e.orientation!="b-a";if(o!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,l=this.b.dom.parentNode;s.remove(),l.remove(),this.editorDOM.insertBefore(o?s:l,this.editorDOM.firstChild),this.editorDOM.appendChild(o?l:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let o=!!this.revertDOM,s=this.revertToA,l=this.renderRevert;"revertControls"in e&&(o=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(l=e.renderRevertControl),this.setupRevertControls(o,s,l)}let n="highlightChanges"in e,r="gutter"in e,i="collapseUnchanged"in e;if(n||r||i){let o=[],s=[];if(n||r){let l=this.a.state.facet(Pi),a=r?e.gutter!==!1:l.markGutter,c=n?e.highlightChanges!==!1:l.highlightChanges;o.push(Kd.reconfigure([Pi.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:a}),a?Yd:[]])),s.push(Kd.reconfigure([Pi.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:a}),a?Yd:[]]))}if(i){let l=wP.reconfigure(e.collapseUnchanged?SP(e.collapseUnchanged):[]);o.push(l),s.push(l)}this.a.dispatch({effects:o}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){Lce(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,r=this.a.viewport,i=this.b.viewport;for(let o=0;o<this.chunks.length;o++){let s=this.chunks[o];if(s.fromA>r.to||s.fromB>i.to)break;if(s.fromA<r.from||s.fromB<i.from)continue;let l=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<o;)n=kP(n);n&&n.dataset.chunk==String(o)?(n.style.top!=l&&(n.style.top=l),n=n.nextSibling):e.insertBefore(this.renderRevertButton(l,o),n)}for(;n;)n=kP(n)}renderRevertButton(e,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",i),r.setAttribute("title",i),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=e,r.setAttribute("data-chunk",String(n)),r}revertClicked(e){let n=e.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[i,o,s,l,a,c]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],u=i.state.sliceDoc(s,Math.max(s,l-1));s!=l&&c<=o.state.doc.length&&(u+=i.state.lineBreak),o.dispatch({changes:{from:a,to:Math.min(o.state.doc.length,c),insert:u},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function kP(t){let e=t.nextSibling;return t.remove(),e}class im{static create(e,n,r,i,o){let s=i+(i<<8)+e+(n<<4)|0;return new im(e,n,r,s,o,[],[])}constructor(e,n,r,i,o,s,l){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=o,this.children=s,this.positions=l,this.hashProp=[[Ve.contextHash,i]]}addChild(e,n){e.prop(Ve.contextHash)!=this.hash&&(e=new Ye(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new Ye(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,o,s)=>new Ye(an.none,i,o,s,this.hashProp)})}}var le;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(le||(le={}));class zce{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class jce{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return pf(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function CP(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==le.OrderedList?Qw:Aw)(n,e,!1);return r>0&&(t.type!=le.BulletList||$w(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const EL={[le.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(tt(le.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(mi(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[le.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[le.OrderedList]:CP,[le.BulletList]:CP,[le.Document](){return!0}};function mi(t){return t==32||t==9||t==10||t==13}function pf(t,e=0){for(;e<t.length&&mi(t.charCodeAt(e));)e++;return e}function _P(t,e,n){for(;e>n&&mi(t.charCodeAt(e-1));)e--;return e}function $L(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function AL(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function $w(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let o=t.text.charCodeAt(i);if(o==t.next)r++;else if(!mi(o))return-1}return n&&t.next==45&&RL(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(NL.SetextHeading)>-1||r<3?-1:1}function QL(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function Aw(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||mi(t.text.charCodeAt(t.pos+1)))&&(!n||QL(e,le.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function Qw(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!mi(t.text.charCodeAt(r+1))||n&&!QL(e,le.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function ML(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function RL(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&mi(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const fb=/^[ \t]*$/,LL=/-->/,IL=/\?>/,hb=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,LL],[/^\s*<\?/,IL],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,fb],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,fb]];function DL(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,o=hb.length-(n?1:0);i<o;i++)if(hb[i][0].test(r))return i;return-1}function TP(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.skipSpace(e),i=t.countIndent(r,e,n);return i>=n+5||r==t.text.length?n+1:i}function Os(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==le.CodeText?t[r].to=n:t.push(tt(le.CodeText,e,n))}const Jd={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,o=t.lineStart+e.text.length,s=[],l=[];for(Os(s,i,o);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){Os(l,t.lineStart-1,t.lineStart);for(let a of e.markers)l.push(a)}else{if(e.indent<n)break;{if(l.length){for(let c of l)c.type==le.CodeText?Os(s,c.from,c.to):s.push(c);l=[]}Os(s,t.lineStart-1,t.lineStart);for(let c of e.markers)s.push(c);o=t.lineStart+e.text.length;let a=t.lineStart+e.findColumn(e.baseIndent+4);a<o&&Os(s,a,o)}}return l.length&&(l=l.filter(a=>a.type!=le.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(s,-i).finish(le.CodeBlock,o-i),i),!0},FencedCode(t,e){let n=$L(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,o=n-e.pos,s=e.skipSpace(n),l=_P(e.text,e.text.length,s),a=[tt(le.CodeMark,r,r+o)];s<l&&a.push(tt(le.CodeInfo,t.lineStart+s,t.lineStart+l));for(let c=!0,u=!0,f=!1;t.nextLine()&&e.depth>=t.stack.length;c=!1){let h=e.pos;if(e.indent-e.baseIndent<4)for(;h<e.text.length&&e.text.charCodeAt(h)==i;)h++;if(h-e.pos>=o&&e.skipSpace(h)==e.text.length){for(let d of e.markers)a.push(d);u&&f&&Os(a,t.lineStart-1,t.lineStart),a.push(tt(le.CodeMark,t.lineStart+e.pos,t.lineStart+h)),t.nextLine();break}else{f=!0,c||(Os(a,t.lineStart-1,t.lineStart),u=!1);for(let g of e.markers)a.push(g);let d=t.lineStart+e.basePos,p=t.lineStart+e.text.length;d<p&&(Os(a,d,p),u=!1)}}return t.addNode(t.buffer.writeElements(a,-r).finish(le.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=AL(e);return n<0?!1:(t.startContext(le.Blockquote,e.pos),t.addNode(le.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if($w(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(le.HorizontalRule,n),!0},BulletList(t,e){let n=Aw(e,t,!1);if(n<0)return!1;t.block.type!=le.BulletList&&t.startContext(le.BulletList,e.basePos,e.next);let r=TP(e,e.pos+1);return t.startContext(le.ListItem,e.basePos,r-e.baseIndent),t.addNode(le.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=Qw(e,t,!1);if(n<0)return!1;t.block.type!=le.OrderedList&&t.startContext(le.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=TP(e,e.pos+n);return t.startContext(le.ListItem,e.basePos,r-e.baseIndent),t.addNode(le.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=ML(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,o=_P(e.text,e.text.length,r),s=o;for(;s>r&&e.text.charCodeAt(s-1)==e.next;)s--;(s==o||s==r||!mi(e.text.charCodeAt(s-1)))&&(s=e.text.length);let l=t.buffer.write(le.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,s),i+n+1),-i);s<e.text.length&&l.write(le.HeaderMark,s-r,o-r);let a=l.finish(le.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(a,i),!0},HTMLBlock(t,e){let n=DL(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=hb[n][1],o=[],s=i!=fb;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){s=!1;break}for(let c of e.markers)o.push(c)}s&&t.nextLine();let l=i==LL?le.CommentBlock:i==IL?le.ProcessingInstructionBlock:le.HTMLBlock,a=t.prevLineEnd();return t.addNode(t.buffer.writeElements(o,-r).finish(l,a-r),r),!0},SetextHeading:void 0};class Xce{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
117
|
-
`+n.scrub(),o=this.advance(i);return o>-1&&o<i.length?this.complete(e,r,o):!1}finish(e,n){return(this.stage==2||this.stage==3)&&pf(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,tt(le.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(HL(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(tt(le.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(XL(e,pf(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=pf(e,this.pos),r=0;if(n>this.pos){let i=WL(e,n,this.start);if(i){let o=d0(e,i.to-this.start);o>0&&(this.nextStage(i),r=o)}}return r||(r=d0(e,this.pos)),r>0&&r<e.length?r:-1}else return d0(e,this.pos)}}}function d0(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!mi(n))return-1}return e}class Wce{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:RL(n),o=n.next;if(i<0)return!1;let s=tt(le.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,tt(o==61?le.SetextHeading1:le.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),s])),!0}finish(){return!1}}const NL={LinkReference(t,e){return e.content.charCodeAt(0)==91?new Xce(e):null},SetextHeading(){return new Wce}},Hce=[(t,e)=>ML(e)>=0,(t,e)=>$L(e)>=0,(t,e)=>AL(e)>=0,(t,e)=>Aw(e,t,!0)>=0,(t,e)=>Qw(e,t,!0)>=0,(t,e)=>$w(e,t,!0)>=0,(t,e)=>DL(e,t,!0)>=0],qce={text:"",end:0};class Yce{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new jce,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=im.create(le.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new Kce(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let o=e.markers[r++];this.addNode(o.type,o.from,o.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let n=new zce(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
|
|
118
|
-
`+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=qL(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=qce;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let o=this.ranges[i].from,s=this.lineChunkAt(o);n.end=o+s.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+s,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],o=this.parser.skipContextMarkup[i.type];if(!o)throw new Error("Unhandled block context "+le[i.type]);let s=this.line.markers.length;if(!o(i,this,e)){this.line.markers.length>s&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
|
|
119
|
-
`?"":n;else{let i=n.indexOf(`
|
|
120
|
-
`);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=im.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new Ye(this.parser.nodeSet.types[e],Ic,Ic,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(pb(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?VL(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=pb(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(le.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?tt(this.parser.getNodeType(e),n,r,i):new ZL(e,n)}get buffer(){return new FL(this.parser.nodeSet)}}function VL(t,e,n,r,i){let o=t[e].to,s=[],l=[],a=n.from+r;function c(u,f){for(;f?u>=o:u>o;){let h=t[e+1].from-o;r+=h,u+=h,e++,o=t[e].to}}for(let u=n.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let f=u.from+r,h,d=i.get(u.tree);d?h=d:u.to+r>o?(h=VL(t,e,u,r,i),c(u.to+r,!1)):h=u.toTree(),s.push(h),l.push(f-a)}return c(n.to+r,!1),new Ye(n.type,s,l,n.to+r-a,n.tree?n.tree.propValues:void 0)}class $O extends cO{constructor(e,n,r,i,o,s,l,a,c){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=o,this.skipContextMarkup=s,this.inlineParsers=l,this.inlineNames=a,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,n,r){let i=new Yce(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}configure(e){let n=db(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,o=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),f=this.wrappers;if(Mu(n.defineNodes)){i=Object.assign({},i);let h=r.types.slice(),d;for(let p of n.defineNodes){let{name:g,block:m,composite:O,style:y}=typeof p=="string"?{name:p}:p;if(h.some(S=>S.name==g))continue;O&&(i[h.length]=(S,v,w)=>O(v,w,S.value));let x=h.length,b=O?["Block","BlockContext"]:m?x>=le.ATXHeading1&&x<=le.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(an.define({id:x,name:g,props:b&&[[Ve.group,b]]})),y&&(d||(d={}),Array.isArray(y)||y instanceof Ir?d[g]=y:Object.assign(d,y))}r=new su(h),d&&(r=r.extend(cu(d)))}if(Mu(n.props)&&(r=r.extend(...n.props)),Mu(n.remove))for(let h of n.remove){let d=this.blockNames.indexOf(h),p=this.inlineNames.indexOf(h);d>-1&&(o[d]=s[d]=void 0),p>-1&&(a[p]=void 0)}if(Mu(n.parseBlock))for(let h of n.parseBlock){let d=l.indexOf(h.name);if(d>-1)o[d]=h.parse,s[d]=h.leaf;else{let p=h.before?ep(l,h.before):h.after?ep(l,h.after)+1:l.length-1;o.splice(p,0,h.parse),s.splice(p,0,h.leaf),l.splice(p,0,h.name)}h.endLeaf&&u.push(h.endLeaf)}if(Mu(n.parseInline))for(let h of n.parseInline){let d=c.indexOf(h.name);if(d>-1)a[d]=h.parse;else{let p=h.before?ep(c,h.before):h.after?ep(c,h.after)+1:c.length-1;a.splice(p,0,h.parse),c.splice(p,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new $O(r,o,s,l,u,i,a,c,f)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new Mw(this,e,n);e:for(let i=n;i<r.end;){let o=r.char(i);for(let s of this.inlineParsers)if(s){let l=s(r,o,i);if(l>=0){i=l;continue e}}i++}return r.resolveMarkers(0)}}function Mu(t){return t!=null&&t.length>0}function db(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=db(t[0]);if(t.length==1)return e;let n=db(t.slice(1));if(!n||!e)return e||n;let r=(s,l)=>(s||Ic).concat(l||Ic),i=e.wrap,o=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?o?(s,l,a,c)=>i(o(s,l,a,c),l,a,c):i:o}}function ep(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let BL=[an.none];for(let t=1,e;e=le[t];t++)BL[t]=an.define({id:t,name:e,props:t>=le.Escape?[]:[[Ve.group,t in EL?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Ic=[];class FL{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return Ye.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let fh=class{constructor(e,n,r,i=Ic){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new FL(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class ZL{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Ic}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function tt(t,e,n,r){return new fh(t,e,n,r)}const zL={resolve:"Emphasis",mark:"EmphasisMark"},jL={resolve:"Emphasis",mark:"EmphasisMark"},xl={},om={};class Qr{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const PP="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let hh=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{hh=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const p0={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<PP.length;i++)if(PP.charCodeAt(i)==r)return t.append(tt(le.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(tt(le.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,o=0;for(;r<t.end;r++)if(t.char(r)==96){if(o++,o==i&&t.char(r+1)!=96)return t.append(tt(le.InlineCode,n,r+1,[tt(le.CodeMark,n,n+i),tt(le.CodeMark,r+1-i,r+1)]))}else o=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(tt(le.Autolink,n,n+1+i[0].length,[tt(le.LinkMark,n,n+1),tt(le.URL,n+1,n+i[0].length),tt(le.LinkMark,n+i[0].length,n+1+i[0].length)]));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(o)return t.append(tt(le.Comment,n,n+1+o[0].length));let s=/^\?[^]*?\?>/.exec(r);if(s)return t.append(tt(le.ProcessingInstruction,n,n+1+s[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return l?t.append(tt(le.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),o=t.slice(r,r+1),s=hh.test(i),l=hh.test(o),a=/\s|^$/.test(i),c=/\s|^$/.test(o),u=!c&&(!l||a||s),f=!a&&(!s||c||l),h=u&&(e==42||!f||s),d=f&&(e==42||!u||l);return t.append(new Qr(e==95?zL:jL,n,r,(h?1:0)|(d?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(tt(le.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(tt(le.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new Qr(xl,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new Qr(om,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof Qr&&(i.type==xl||i.type==om)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let o=t.takeContent(r),s=t.parts[r]=Uce(t,o,i.type==xl?le.Link:le.Image,i.from,n+1);if(i.type==xl)for(let l=0;l<r;l++){let a=t.parts[l];a instanceof Qr&&a.type==xl&&(a.side=0)}return s.to}}return-1}};function Uce(t,e,n,r,i){let{text:o}=t,s=t.char(i),l=i;if(e.unshift(tt(le.LinkMark,r,r+(n==le.Image?2:1))),e.push(tt(le.LinkMark,i-1,i)),s==40){let a=t.skipSpace(i+1),c=XL(o,a-t.offset,t.offset),u;c&&(a=t.skipSpace(c.to),a!=c.to&&(u=WL(o,a-t.offset,t.offset),u&&(a=t.skipSpace(u.to)))),t.char(a)==41&&(e.push(tt(le.LinkMark,i,i+1)),l=a+1,c&&e.push(c),u&&e.push(u),e.push(tt(le.LinkMark,a,l)))}else if(s==91){let a=HL(o,i-t.offset,t.offset,!1);a&&(e.push(a),l=a.to)}return tt(n,r,l,e)}function XL(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let o=t.charCodeAt(i);if(o==62)return tt(le.URL,e+n,i+1+n);if(o==60||o==10)return!1}return null}else{let i=0,o=e;for(let s=!1;o<t.length;o++){let l=t.charCodeAt(o);if(mi(l))break;if(s)s=!1;else if(l==40)i++;else if(l==41){if(!i)break;i--}else l==92&&(s=!0)}return o>e?tt(le.URL,e+n,o+n):o==t.length?null:!1}}function WL(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let o=e+1,s=!1;o<t.length;o++){let l=t.charCodeAt(o);if(s)s=!1;else{if(l==i)return tt(le.LinkTitle,e+n,o+1+n);l==92&&(s=!0)}}return null}function HL(t,e,n,r){for(let i=!1,o=e+1,s=Math.min(t.length,o+999);o<s;o++){let l=t.charCodeAt(o);if(i)i=!1;else{if(l==93)return r?!1:tt(le.LinkLabel,e+n,o+1+n);if(r&&!mi(l)&&(r=!1),l==91)return!1;l==92&&(i=!0)}}return null}class Mw{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,o){return this.append(new Qr(e,n,r,(i?1:0)|(o?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof Qr&&(n.type==xl||n.type==om))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Qr&&i.type.resolve&&i.side&2))continue;let o=i.type==zL||i.type==jL,s=i.to-i.from,l,a=r-1;for(;a>=e;a--){let g=this.parts[a];if(g instanceof Qr&&g.side&1&&g.type==i.type&&!(o&&(i.side&1||g.side&2)&&(g.to-g.from+s)%3==0&&((g.to-g.from)%3||s%3))){l=g;break}}if(!l)continue;let c=i.type.resolve,u=[],f=l.from,h=i.to;if(o){let g=Math.min(2,l.to-l.from,s);f=l.to-g,h=i.from+g,c=g==1?"Emphasis":"StrongEmphasis"}l.type.mark&&u.push(this.elt(l.type.mark,f,l.to));for(let g=a+1;g<r;g++)this.parts[g]instanceof fh&&u.push(this.parts[g]),this.parts[g]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,h));let d=this.elt(c,f,h,u);this.parts[a]=o&&l.from!=f?new Qr(l.type,l.from,f,l.side):null,(this.parts[r]=o&&i.to!=h?new Qr(i.type,h,i.to,i.side):null)?this.parts.splice(r,0,d):this.parts[r]=d}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof fh&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Qr&&r.type==e&&r.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof Qr?n:null}skipSpace(e){return pf(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?tt(this.parser.getNodeType(e),n,r,i):new ZL(e,n)}}Mw.linkStart=xl;Mw.imageStart=om;function pb(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let o=n[r];o instanceof fh&&(n[r]=new fh(o.type,o.from,o.to,pb(o.children,[i])))}else n.splice(r++,0,i)}return n}const Gce=[le.CodeBlock,le.ListItem,le.OrderedList,le.BulletList];let Kce=class{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let o=this.fragment.to;for(;o>0&&this.input.read(o-1,o)!=`
|
|
121
|
-
`;)o--;this.fragmentEnd=o?o-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Ve.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),o=e.absoluteLineStart,s=o,l=e.block.children.length,a=s,c=l;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let u=qL(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,u);else{let f=new Ye(e.parser.nodeSet.types[le.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,n.tree),e.addNode(f,u)}if(n.type.is("Block")&&(Gce.indexOf(n.type.id)<0?(s=n.to-r,l=e.block.children.length):(s=a,l=c),a=n.to-r,c=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return s-o}};function qL(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,o=e[r].from;i<t&&(n-=o-i)}return n}const Jce=cu({"Blockquote/...":A.quote,HorizontalRule:A.contentSeparator,"ATXHeading1/... SetextHeading1/...":A.heading1,"ATXHeading2/... SetextHeading2/...":A.heading2,"ATXHeading3/...":A.heading3,"ATXHeading4/...":A.heading4,"ATXHeading5/...":A.heading5,"ATXHeading6/...":A.heading6,"Comment CommentBlock":A.comment,Escape:A.escape,Entity:A.character,"Emphasis/...":A.emphasis,"StrongEmphasis/...":A.strong,"Link/... Image/...":A.link,"OrderedList/... BulletList/...":A.list,"BlockQuote/...":A.quote,"InlineCode CodeText":A.monospace,"URL Autolink":A.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":A.processingInstruction,"CodeInfo LinkLabel":A.labelName,LinkTitle:A.string,Paragraph:A.content}),eue=new $O(new su(BL).extend(Jce),Object.keys(Jd).map(t=>Jd[t]),Object.keys(Jd).map(t=>NL[t]),Object.keys(Jd),Hce,EL,Object.keys(p0).map(t=>p0[t]),Object.keys(p0),[]);function tue(t,e,n){let r=[];for(let i=t.firstChild,o=e;;i=i.nextSibling){let s=i?i.from:n;if(s>o&&r.push({from:o,to:s}),!i)break;o=i.to}return r}function nue(t){let{codeParser:e,htmlParser:n}=t;return{wrap:ER((i,o)=>{let s=i.type.id;if(e&&(s==le.CodeBlock||s==le.FencedCode)){let l="";if(s==le.FencedCode){let c=i.node.getChild(le.CodeInfo);c&&(l=o.read(c.from,c.to))}let a=e(l);if(a)return{parser:a,overlay:c=>c.type.id==le.CodeText,bracketed:s==le.FencedCode}}else if(n&&(s==le.HTMLBlock||s==le.HTMLTag||s==le.CommentBlock))return{parser:n,overlay:tue(i.node,i.from,i.to)};return null})}}const rue={resolve:"Strikethrough",mark:"StrikethroughMark"},iue={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":A.strikethrough}},{name:"StrikethroughMark",style:A.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),o=/\s|^$/.test(r),s=/\s|^$/.test(i),l=hh.test(r),a=hh.test(i);return t.addDelimiter(rue,n,n+2,!s&&(!a||o||l),!o&&(!l||s||a))},after:"Emphasis"}]};function gf(t,e,n=0,r,i=0){let o=0,s=!0,l=-1,a=-1,c=!1,u=()=>{r.push(t.elt("TableCell",i+l,i+a,t.parser.parseInline(e.slice(l,a),i+l)))};for(let f=n;f<e.length;f++){let h=e.charCodeAt(f);h==124&&!c?((!s||l>-1)&&o++,s=!1,r&&(l>-1&&u(),r.push(t.elt("TableDelimiter",f+i,f+i+1))),l=a=-1):(c||h!=32&&h!=9)&&(l<0&&(l=f),a=f+1),c=!c&&h==92}return l>-1&&(o++,r&&u()),o}function EP(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const YL=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class $P{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&YL.test(i=n.text.slice(n.pos))){let o=[];gf(e,r.content,0,o,r.start)==gf(e,i,0)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,o),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];gf(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const oue={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":A.heading}},"TableRow",{name:"TableCell",style:A.content},{name:"TableDelimiter",style:A.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return EP(e.content,0)?new $P:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof $P)||!EP(e.text,e.basePos))return!1;let r=t.peekLine();return YL.test(r)&&gf(t,e.text,e.basePos)==gf(t,r,e.basePos)},before:"SetextHeading"}]};class sue{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const lue={defineNodes:[{name:"Task",block:!0,style:A.list},{name:"TaskMarker",style:A.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new sue:null},after:"SetextHeading"}]},AP=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,QP=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,aue=/[\w-]+\.[\w-]+($|[/:])/,MP=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,RP=/\/[a-zA-Z\d@.]+/gy;function LP(t,e,n,r){let i=0;for(let o=e;o<n;o++)t[o]==r&&i++;return i}function cue(t,e){QP.lastIndex=e;let n=QP.exec(t);if(!n||aue.exec(n[0])[0].indexOf("_")>-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],o;if(/[?!.,:*_~]/.test(i)||i==")"&&LP(t,e,r,")")>LP(t,e,r,"("))r--;else if(i==";"&&(o=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+o.index;else break}return r}function IP(t,e){MP.lastIndex=e;let n=MP.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const uue={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;AP.lastIndex=r;let i=AP.exec(t.text),o=-1;if(!i)return-1;if(i[1]||i[2]){if(o=cue(t.text,r+i[0].length),o>-1&&t.hasOpenLink){let s=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,o));o=r+s[0].length}}else i[3]?o=IP(t.text,r):(o=IP(t.text,r+i[0].length),o>-1&&i[0]=="xmpp:"&&(RP.lastIndex=o,i=RP.exec(t.text),i&&(o=i.index+i[0].length)));return o<0?-1:(t.addElement(t.elt("URL",n,o+t.offset)),o+t.offset)}}]},fue=[oue,lue,iue,uue];function UL(t,e,n){return(r,i,o)=>{if(i!=t||r.char(o+1)==t)return-1;let s=[r.elt(n,o,o+1)];for(let l=o+1;l<r.end;l++){let a=r.char(l);if(a==t)return r.addElement(r.elt(e,o,l+1,s.concat(r.elt(n,l,l+1))));if(a==92&&s.push(r.elt("Escape",l,l+++2)),mi(a))break}return-1}}const hue={defineNodes:[{name:"Superscript",style:A.special(A.content)},{name:"SuperscriptMark",style:A.processingInstruction}],parseInline:[{name:"Superscript",parse:UL(94,"Superscript","SuperscriptMark")}]},due={defineNodes:[{name:"Subscript",style:A.special(A.content)},{name:"SubscriptMark",style:A.processingInstruction}],parseInline:[{name:"Subscript",parse:UL(126,"Subscript","SubscriptMark")}]},pue={defineNodes:[{name:"Emoji",style:A.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]};var DP={};class sm{constructor(e,n,r,i,o,s,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new sm(e,[],n,r,r,0,[],0,i?new NP(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=o.dynamicPrecedence(i);if(l&&(this.score+=l),r==0){i<o.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let a=this.stack.length-(r-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;i<o.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||e&131072){let d=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=o.getGoto(d,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this.buffer.length;if(s>0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(n==r)return;if(this.buffer[s-2]>=n){this.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let l=!1;for(let a=s;a>0&&this.buffer[a-2]>r;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;this.pos=i;let l=s.stateFlag(o,1);!l&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,l?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new sm(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new gue(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((l,a)=>a&1&&l==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let l=(s>>19)-o;if(l>1){let a=s&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=r(s,o+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new NP(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class NP{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class gue{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class lm{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new lm(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lm(this.stack,this.pos,this.index)}}function ju(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let o=0;for(;;){let s=t.charCodeAt(r++),l=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let a=s-32;if(a>=46&&(a-=46,l=!0),o+=a,l)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class Bp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const VP=new Bp;class mue{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=VP,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=VP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class dc{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;GL(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}dc.prototype.contextual=dc.prototype.fallback=dc.prototype.extend=!1;class am{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?ju(e):e}token(e,n){let r=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(GL(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(o||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}am.prototype.contextual=dc.prototype.fallback=dc.prototype.extend=!1;class Xr{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function GL(t,e,n,r,i,o){let s=0,l=1<<r,{dialect:a}=n.p.parser;e:for(;(l&t[s])!=0;){let c=t[s+1];for(let d=s+3;d<c;d+=2)if((t[d+1]&l)>0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||Oue(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,h=t[s+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){s=t[c+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=c+d+(d<<1),g=t[p],m=t[p+1]||65536;if(u<g)h=d;else if(u>=m)f=d+1;else{s=t[p+2],e.advance();continue e}}break}}function BP(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Oue(t,e,n,r){let i=BP(n,r,e);return i<0||BP(n,r,t)<i}const Er=typeof process<"u"&&DP&&/\bparse\b/.test(DP.LOG);let g0=null;function FP(t,e,n){let r=t.cursor(dt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class yue{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?FP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?FP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>e)return this.nextStart=s,null;if(o instanceof Ye){if(s==e){if(s<this.safeFrom)return null;let l=s+o.length;if(l<=this.safeTo){let a=o.prop(Ve.lookAhead);if(!a||l+a<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class xue{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Bp)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let u=o[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=s||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=s,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!r&&e.pos==this.stream.end&&(r=new Bp,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Bp,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let l=o.specializers[s](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:o}=e,{parser:s}=e.p,{data:l}=s;for(let a=0;a<2;a++)for(let c=s.stateSlot(o,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=Eo(l,c+2);else{i==0&&l[c+1]==2&&(i=this.putAction(Eo(l,c+2),n,r,i));break}l[c]==n&&(i=this.putAction(Eo(l,c+1),n,r,i))}return i}}class bue{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new mue(n,i),this.tokens=new xue(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[sm.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new yue(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let l=e[s];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{i||(i=[],o=[]),i.push(l);let a=this.tokens.getMainToken(l);o.push(a.value,a.end)}}break}}if(!r.length){let s=i&&Sue(i);if(s)return Er&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Er&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Er&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((l,a)=>a.score-l.score);r.length>s;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let l=r[s];for(let a=s+1;a<r.length;a++){let c=r[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)r.splice(a--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,l)=>l.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:o}=this,s=Er?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(Ve.contextHash)||0)==u))return e.useNode(f,h),Er&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Ye)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof Ye&&f.positions[0]==0)f=d;else break}}let l=o.stateSlot(e.state,4);if(l>0)return e.reduce(l),Er&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],h=a[c++],d=c==a.length||!r,p=d?e:e.split(),g=this.tokens.mainToken;if(p.apply(u,f,g?g.start:p.pos,h),Er&&console.log(s+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(f)} @ ${i}${p==e?"":", split"})`),d)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return ZP(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s<e.length;s++){let l=e[s],a=n[s<<1],c=n[(s<<1)+1],u=Er?this.stackID(l)+" -> ":"";if(l.deadEnd&&(o||(o=!0,l.restart(),Er&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let f=l.split(),h=u;for(let d=0;d<10&&f.forceReduce()&&(Er&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));d++)Er&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Er&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),Er&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),ZP(l,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(e){return e.close(),Ye.build({buffer:lm.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(g0||(g0=new WeakMap)).get(e);return n||g0.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function ZP(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class vue{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const m0=t=>t;class KL{constructor(e){this.start=e.start,this.shift=e.shift||m0,this.reduce=e.reduce||m0,this.reuse=e.reuse||m0,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Dc extends cO{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<n.length;l++)i.push([]);function o(l,a,c){i[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=Ve[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)o(u,a,l[c++]);else{let f=l[c+-u];for(let h=-u;h>0;h--)o(l[c++],a,f);c++}}}this.nodeSet=new su(n.map((l,a)=>an.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:i[a],top:r.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=kR;let s=ju(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(zP),this.states=ju(e.states,Uint32Array),this.data=ju(e.stateData),this.goto=ju(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new dc(s,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new bue(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],l=s&1,a=i[o++];if(l&&r)return a;for(let c=o+(s>>1);o<c;o++)if(i[o]==e)return a;if(l)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=Eo(r,o+2)];else{if(r[o+1]==2)return Eo(r,o+2);break}if(s==n||s==0)return Eo(r,o+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Eo(this.data,o+2);else break;i=n(Eo(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Eo(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Dc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(l=>l.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=zP(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],l;(l=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new vue(e,r,i)}static deserialize(e){return new Dc(e)}}function Eo(t,e){return t[e]|t[e+1]<<16}function Sue(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function zP(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const wue=55,kue=1,Cue=56,_ue=2,Tue=57,Pue=3,jP=4,Eue=5,Rw=6,JL=7,eI=8,tI=9,nI=10,$ue=11,Aue=12,Que=13,O0=58,Mue=14,Rue=15,XP=59,rI=21,Lue=23,iI=24,Iue=25,gb=27,oI=28,Due=29,Nue=32,Vue=35,Bue=37,Fue=38,Zue=0,zue=1,jue={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Xue={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},WP={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Wue(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let HP=null,qP=null,YP=0;function mb(t,e){let n=t.pos+e;if(YP==n&&qP==t)return HP;let r=t.peek(e),i="";for(;Wue(r);)i+=String.fromCharCode(r),r=t.peek(++e);return qP=t,YP=n,HP=i?i.toLowerCase():r==Hue||r==que?void 0:null}const sI=60,cm=62,Lw=47,Hue=63,que=33,Yue=45;function UP(t,e){this.name=t,this.parent=e}const Uue=[Rw,nI,JL,eI,tI],Gue=new KL({start:null,shift(t,e,n,r){return Uue.indexOf(e)>-1?new UP(mb(r,1)||"",t):t},reduce(t,e){return e==rI&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==Rw||i==Bue?new UP(mb(r,1)||"",t):t},strict:!1}),Kue=new Xr((t,e)=>{if(t.next!=sI){t.next<0&&e.context&&t.acceptToken(O0);return}t.advance();let n=t.next==Lw;n&&t.advance();let r=mb(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?Rue:Mue);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken($ue);if(i&&Xue[i])return t.acceptToken(O0,-2);if(e.dialectEnabled(Zue))return t.acceptToken(Aue);for(let o=e.context;o;o=o.parent)if(o.name==r)return;t.acceptToken(Que)}else{if(r=="script")return t.acceptToken(JL);if(r=="style")return t.acceptToken(eI);if(r=="textarea")return t.acceptToken(tI);if(jue.hasOwnProperty(r))return t.acceptToken(nI);i&&WP[i]&&WP[i][r]?t.acceptToken(O0,-1):t.acceptToken(Rw)}},{contextual:!0}),Jue=new Xr(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(XP);break}if(t.next==Yue)e++;else if(t.next==cm&&e>=2){n>=3&&t.acceptToken(XP,-2);break}else e=0;t.advance()}});function efe(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const tfe=new Xr((t,e)=>{if(t.next==Lw&&t.peek(1)==cm){let n=e.dialectEnabled(zue)||efe(e.context);t.acceptToken(n?Eue:jP,2)}else t.next==cm&&t.acceptToken(jP,1)});function Iw(t,e,n){let r=2+t.length;return new Xr(i=>{for(let o=0,s=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(o==0&&i.next==sI||o==1&&i.next==Lw||o>=2&&o<r&&i.next==t.charCodeAt(o-2))o++,s++;else if(o==r&&i.next==cm){l>s?i.acceptToken(e,-s):i.acceptToken(n,-(s-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else o=s=0;i.advance()}})}const nfe=Iw("script",wue,kue),rfe=Iw("style",Cue,_ue),ife=Iw("textarea",Tue,Pue),ofe=cu({"Text RawText IncompleteTag IncompleteCloseTag":A.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":A.angleBracket,TagName:A.tagName,"MismatchedCloseTag/TagName":[A.tagName,A.invalid],AttributeName:A.attributeName,"AttributeValue UnquotedAttributeValue":A.attributeValue,Is:A.definitionOperator,"EntityReference CharacterReference":A.character,Comment:A.blockComment,ProcessingInst:A.processingInstruction,DoctypeDecl:A.documentMeta}),sfe=Dc.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wO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d!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:Gue,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[ofe],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W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!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[nfe,rfe,ife,tfe,Kue,Jue,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function lI(t,e){let n=Object.create(null);for(let r of t.getChildren(iI)){let i=r.getChild(Iue),o=r.getChild(gb)||r.getChild(oI);i&&(n[e.read(i.from,i.to)]=o?o.type.id==gb?e.read(o.from+1,o.to-1):e.read(o.from,o.to):"")}return n}function GP(t,e){let n=t.getChild(Lue);return n?e.read(n.from,n.to):" "}function y0(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=lI(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function aI(t=[],e=[]){let n=[],r=[],i=[],o=[];for(let l of t)(l.tag=="script"?n:l.tag=="style"?r:l.tag=="textarea"?i:o).push(l);let s=e.length?Object.create(null):null;for(let l of e)(s[l.name]||(s[l.name]=[])).push(l);return ER((l,a)=>{let c=l.type.id;if(c==Due)return y0(l,a,n);if(c==Nue)return y0(l,a,r);if(c==Vue)return y0(l,a,i);if(c==rI&&o.length){let u=l.node,f=u.firstChild,h=f&&GP(f,a),d;if(h){for(let p of o)if(p.tag==h&&(!p.attrs||p.attrs(d||(d=lI(f,a))))){let g=u.lastChild,m=g.type.id==Fue?g.from:u.to;if(m>f.to)return{parser:p.parser,overlay:[{from:f.to,to:m}]}}}}if(s&&c==iI){let u=l.node,f;if(f=u.firstChild){let h=s[a.read(f.from,f.to)];if(h)for(let d of h){if(d.tagName&&d.tagName!=GP(u.parent,a))continue;let p=u.lastChild;if(p.type.id==gb){let g=p.from+1,m=p.lastChild,O=p.to-(m&&m.isError?0:1);if(O>g)return{parser:d.parser,overlay:[{from:g,to:O}],bracketed:!0}}else if(p.type.id==oI)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const lfe=148,KP=1,afe=149,cfe=150,cI=2,ufe=151,ffe=3,hfe=4,uI=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],dfe=58,pfe=40,fI=95,gfe=91,Fp=45,mfe=46,Ofe=35,yfe=37,xfe=38,bfe=92,vfe=10,Sfe=42;function dh(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Dw(t){return t>=48&&t<=57}function JP(t){return Dw(t)||t>=97&&t<=102||t>=65&&t<=70}const hI=(t,e,n)=>(r,i)=>{for(let o=!1,s=0,l=0;;l++){let{next:a}=r;if(dh(a)||a==Fp||a==fI||o&&Dw(a))!o&&(a!=Fp||l>0)&&(o=!0),s===l&&a==Fp&&s++,r.advance();else if(a==bfe&&r.peek(1)!=vfe){if(r.advance(),JP(r.next)){do r.advance();while(JP(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();o=!0}else{o&&r.acceptToken(s==2&&i.canShift(cI)?e:a==pfe?n:t);break}}},wfe=new Xr(hI(afe,cI,cfe),{contextual:!0}),kfe=new Xr(hI(ufe,ffe,hfe),{contextual:!0}),Cfe=new Xr(t=>{if(uI.includes(t.peek(-1))){let{next:e}=t;(dh(e)||e==fI||e==Ofe||e==mfe||e==Sfe||e==gfe||e==dfe&&dh(t.peek(1))||e==Fp||e==xfe)&&t.acceptToken(lfe)}}),_fe=new Xr(t=>{if(!uI.includes(t.peek(-1))){let{next:e}=t;if(e==yfe&&(t.advance(),t.acceptToken(KP)),dh(e)){do t.advance();while(dh(t.next)||Dw(t.next));t.acceptToken(KP)}}}),Tfe=cu({"AtKeyword import charset namespace keyframes media supports font-feature-values":A.definitionKeyword,"from to selector scope MatchFlag":A.keyword,NamespaceName:A.namespace,KeyframeName:A.labelName,KeyframeRangeName:A.operatorKeyword,TagName:A.tagName,ClassName:A.className,PseudoClassName:A.constant(A.className),IdName:A.labelName,"FeatureName PropertyName":A.propertyName,AttributeName:A.attributeName,NumberLiteral:A.number,KeywordQuery:A.keyword,UnaryQueryOp:A.operatorKeyword,"CallTag ValueName FontName":A.atom,VariableName:A.variableName,Callee:A.operatorKeyword,Unit:A.unit,"UniversalSelector NestingSelector":A.definitionOperator,"MatchOp CompareOp":A.compareOperator,"ChildOp SiblingOp, LogicOp":A.logicOperator,BinOp:A.arithmeticOperator,Important:A.modifier,Comment:A.blockComment,ColorLiteral:A.color,"ParenthesizedContent StringLiteral":A.string,":":A.punctuation,"PseudoOp #":A.derefOperator,"; , |":A.separator,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace}),Pfe={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:158,"url-prefix":158,domain:158,regexp:158},Efe={__proto__:null,or:104,and:104,not:112,only:112,layer:212},$fe={__proto__:null,selector:118,style:124,layer:208},Afe={__proto__:null,"@import":204,"@media":216,"@charset":220,"@namespace":224,"@keyframes":230,"@supports":242,"@scope":246,"@font-feature-values":252},Qfe={__proto__:null,to:249},Mfe=Dc.deserialize({version:14,states:"MrQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FqO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#ERO'dQdO'#ETO'oQdO'#E[O'oQdO'#E_OOQP'#Fq'#FqO)RQhO'#FQOOQS'#Fp'#FpOOQS'#FT'#FTQYQdOOO)YQdO'#EeO*iQhO'#EkO)YQdO'#EmO*pQdO'#EoO*{QdO'#ErO)}QhO'#ExO+TQdO'#EzO+`QdO'#E}O+eQaO'#CfO+lQ`O'#EbO+qQ`O'#F}O+|QdO'#F}QOQ`OOP,WO&jO'#CaPOOO)CA`)CA`OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP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QQ&v%iS'q&v(WR(W'rQ&n%]R'j&nQ&j%YR'h&jQ!QXR#m!QQ&d${R'c&dQ#]nS%Q#]%RR%R#^Q'z'RR(]'zQ$m!yR&U$mQ&]$rR'_&]Q']&[R(R']Q#XkR$y#XQ$P!dR%f$P_bOPco!R#[%P^XOPco!R#[%PQ!`]Q!a^Q#i|Q#j}Q#k!OQ#l!PQ$u#SQ%Y#pR'g&iR%^#qQ!rdQ!{f[$X!n!o!p$[$^$`Q${#Zh%[#q%]%a&m&r&w'O'i'r'x(V(bQ%`#vQ%z$cS&b${&dQ&h%WQ'b&cR'|'T]$Z!n!o!p$[$^$`Q!d`U!ye!r$gQ#RiQ#y!cS#|!d$PQ$R!eQ%d#}Q%e$OQ%i$SS&O$i&QQ&T$lR'o&uQ#{!cW%s$W%m&z'uQ&t%bQ'w&}Q(U'mR(d(ZQ%u$WQ&y%mQ't&zR(Y'uR%k$SR%Z#pQpPR#o!RQ!zeQ$f!rR%}$g",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector StyleQuery style ParenthesedQuery CallQuery ArgList PropertyName , PropertyName UnaryQuery ParenthesedQuery BinaryQuery ParenthesedQuery ParenthesedQuery StyleFeature PropertyName StyleRange PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:174,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[Tfe],skippedNodes:[0,5,130],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!r`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$_~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$_~!r`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$J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ules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:150,get:t=>Pfe[t]||-1},{term:151,get:t=>Efe[t]||-1},{term:4,get:t=>$fe[t]||-1},{term:28,get:t=>Afe[t]||-1},{term:149,get:t=>Qfe[t]||-1}],tokenPrec:2444});let x0=null;function b0(){if(!x0&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));x0=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return x0||[]}const eE=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),tE=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),Rfe=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Lfe=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),ko=/^(\w[\w-]*|-\w[\w-]*|)$/,Ife=/^-(-[\w-]*)?$/;function Dfe(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const nE=new PR,Nfe=["Declaration"];function Vfe(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function dI(t,e,n){if(e.to-e.from>4096){let r=nE.get(e);if(r)return r;let i=[],o=new Set,s=e.cursor(dt.IncludeAnonymous);if(s.firstChild())do for(let l of dI(t,s.node,n))o.has(l.label)||(o.add(l.label),i.push(l));while(s.nextSibling());return nE.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(o=>{var s;if(n(o)&&o.matchContext(Nfe)&&((s=o.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let l=t.sliceString(o.from,o.to);i.has(l)||(i.add(l),r.push({label:l,type:"variable"}))}}),r}}const pI=t=>e=>{let{state:n,pos:r}=e,i=wt(n).resolveInner(r,-1),o=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(o||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:b0(),validFor:ko};if(i.name=="ValueName")return{from:i.from,options:tE,validFor:ko};if(i.name=="PseudoClassName")return{from:i.from,options:eE,validFor:ko};if(t(i)||(e.explicit||o)&&Dfe(i,n.doc))return{from:t(i)||o?i.from:r,options:dI(n.doc,Vfe(i),t),validFor:Ife};if(i.name=="TagName"){for(let{parent:a}=i;a;a=a.parent)if(a.name=="Block")return{from:i.from,options:b0(),validFor:ko};return{from:i.from,options:Rfe,validFor:ko}}if(i.name=="AtKeyword")return{from:i.from,options:Lfe,validFor:ko};if(!e.explicit)return null;let s=i.resolve(r),l=s.childBefore(r);return l&&l.name==":"&&s.name=="PseudoClassSelector"?{from:r,options:eE,validFor:ko}:l&&l.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:r,options:tE,validFor:ko}:s.name=="Block"||s.name=="Styles"?{from:r,options:b0(),validFor:ko}:null},gI=pI(t=>t.name=="VariableName"),ph=$c.define({name:"css",parser:Mfe.configure({props:[uu.add({Declaration:Np()}),fu.add({"Block KeyframeList":u7})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mI(){return new Qc(ph,ph.data.of({autocomplete:gI}))}const Bfe=Object.freeze(Object.defineProperty({__proto__:null,css:mI,cssCompletionSource:gI,cssLanguage:ph,defineCSSCompletionSource:pI},Symbol.toStringTag,{value:"Module"})),Ffe=316,Zfe=317,rE=1,zfe=2,jfe=3,Xfe=4,Wfe=318,Hfe=320,qfe=321,Yfe=5,Ufe=6,Gfe=0,Ob=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],OI=125,Kfe=59,yb=47,Jfe=42,ehe=43,the=45,nhe=60,rhe=44,ihe=63,ohe=46,she=91,lhe=new KL({start:!1,shift(t,e){return e==Yfe||e==Ufe||e==Hfe?t:e==qfe},strict:!1}),ahe=new Xr((t,e)=>{let{next:n}=t;(n==OI||n==-1||e.context)&&t.acceptToken(Wfe)},{contextual:!0,fallback:!0}),che=new Xr((t,e)=>{let{next:n}=t,r;Ob.indexOf(n)>-1||n==yb&&((r=t.peek(1))==yb||r==Jfe)||n!=OI&&n!=Kfe&&n!=-1&&!e.context&&t.acceptToken(Ffe)},{contextual:!0}),uhe=new Xr((t,e)=>{t.next==she&&!e.context&&t.acceptToken(Zfe)},{contextual:!0}),fhe=new Xr((t,e)=>{let{next:n}=t;if(n==ehe||n==the){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(rE);t.acceptToken(r?rE:zfe)}}else n==ihe&&t.peek(1)==ohe&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(jfe))},{contextual:!0});function v0(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const hhe=new Xr((t,e)=>{if(t.next!=nhe||!e.dialectEnabled(Gfe)||(t.advance(),t.next==yb))return;let n=0;for(;Ob.indexOf(t.next)>-1;)t.advance(),n++;if(v0(t.next,!0)){for(t.advance(),n++;v0(t.next,!1);)t.advance(),n++;for(;Ob.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==rhe)return;for(let r=0;;r++){if(r==7){if(!v0(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(Xfe,-n)}),dhe=cu({"get set async static":A.modifier,"for while do if else switch try catch finally return throw break continue default case defer":A.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":A.operatorKeyword,"let var const using function class extends":A.definitionKeyword,"import export from":A.moduleKeyword,"with debugger new":A.keyword,TemplateString:A.special(A.string),super:A.atom,BooleanLiteral:A.bool,this:A.self,null:A.null,Star:A.modifier,VariableName:A.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":A.function(A.variableName),VariableDefinition:A.definition(A.variableName),Label:A.labelName,PropertyName:A.propertyName,PrivatePropertyName:A.special(A.propertyName),"CallExpression/MemberExpression/PropertyName":A.function(A.propertyName),"FunctionDeclaration/VariableDefinition":A.function(A.definition(A.variableName)),"ClassDeclaration/VariableDefinition":A.definition(A.className),"NewExpression/VariableName":A.className,PropertyDefinition:A.definition(A.propertyName),PrivatePropertyDefinition:A.definition(A.special(A.propertyName)),UpdateOp:A.updateOperator,"LineComment Hashbang":A.lineComment,BlockComment:A.blockComment,Number:A.number,String:A.string,Escape:A.escape,ArithOp:A.arithmeticOperator,LogicOp:A.logicOperator,BitOp:A.bitwiseOperator,CompareOp:A.compareOperator,RegExp:A.regexp,Equals:A.definitionOperator,Arrow:A.function(A.punctuation),": Spread":A.punctuation,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace,"InterpolationStart InterpolationEnd":A.special(A.brace),".":A.derefOperator,", ;":A.separator,"@":A.meta,TypeName:A.typeName,TypeDefinition:A.definition(A.typeName),"type enum interface implements namespace module declare":A.definitionKeyword,"abstract global Privacy readonly override":A.modifier,"is keyof unique infer asserts":A.operatorKeyword,JSXAttributeValue:A.attributeValue,JSXText:A.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":A.angleBracket,"JSXIdentifier JSXNameSpacedName":A.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":A.attributeName,"JSXBuiltin/JSXIdentifier":A.standard(A.tagName)}),phe={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},ghe={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},mhe={__proto__:null,"<":193},Ohe=Dc.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#I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4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:lhe,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[dhe],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O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phe[t]||-1},{term:343,get:t=>ghe[t]||-1},{term:95,get:t=>mhe[t]||-1}],tokenPrec:15201}),Nw=[dr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),dr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),dr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),dr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),dr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),dr(`try {
|
|
122
|
-
\${}
|
|
123
|
-
} catch (\${error}) {
|
|
124
|
-
\${}
|
|
125
|
-
}`,{label:"try",detail:"/ catch block",type:"keyword"}),dr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),dr(`if (\${}) {
|
|
126
|
-
\${}
|
|
127
|
-
} else {
|
|
128
|
-
\${}
|
|
129
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),dr(`class \${name} {
|
|
130
|
-
constructor(\${params}) {
|
|
131
|
-
\${}
|
|
132
|
-
}
|
|
133
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),dr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),dr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],yI=Nw.concat([dr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),dr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),dr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),iE=new PR,xI=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ru(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const yhe=["FunctionDeclaration"],xhe={FunctionDeclaration:Ru("function"),ClassDeclaration:Ru("class"),ClassExpression:()=>!0,EnumDeclaration:Ru("constant"),TypeAliasDeclaration:Ru("type"),NamespaceDeclaration:Ru("namespace"),VariableDefinition(t,e){t.matchContext(yhe)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function bI(t,e){let n=iE.get(e);if(n)return n;let r=[],i=!0;function o(s,l){let a=t.sliceString(s.from,s.to);r.push({label:a,type:l})}return e.cursor(dt.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let l=xhe[s.name];if(l&&l(s,o)||xI.has(s.name))return!1}else if(s.to-s.from>8192){for(let l of bI(t,s.node))r.push(l);return!1}}),iE.set(e,r),r}const um=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Vw=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function vI(t){let e=wt(t.state).resolveInner(t.pos,-1);if(Vw.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&um.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)xI.has(i.name)&&(r=r.concat(bI(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:um}}function S0(t,e,n){var r;let i=[];for(;;){let o=e.firstChild,s;if(o?.name=="VariableName")return i.push(t(o)),{path:i.reverse(),name:n};if(o?.name=="MemberExpression"&&((r=s=o.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")i.push(t(s)),e=o;else return null}}function SI(t){let e=r=>t.state.doc.sliceString(r.from,r.to),n=wt(t.state).resolveInner(t.pos,-1);return n.name=="PropertyName"?S0(e,n.parent,e(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?S0(e,n.parent,""):Vw.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&um.test(e(n))?{path:[],name:e(n)}:n.name=="MemberExpression"?S0(e,n,""):t.explicit?{path:[],name:""}:null}function bhe(t,e){let n=t,r=[],i=new Set;for(let o=0;;o++){for(let l of(Object.getOwnPropertyNames||Object.keys)(t)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||i.has(l))continue;i.add(l);let a;try{a=n[l]}catch{continue}r.push({label:l,type:typeof a=="function"?/^[A-Z]/.test(l)?"class":e?"function":"method":e?"variable":"property",boost:-o})}let s=Object.getPrototypeOf(t);if(!s)return r;t=s}}function vhe(t){let e=new Map;return n=>{let r=SI(n);if(!r)return null;let i=t;for(let s of r.path)if(i=i[s],!i)return null;let o=e.get(i);return o||e.set(i,o=bhe(i,!r.path.length)),{from:n.pos-r.name.length,options:o,validFor:um}}}const li=$c.define({name:"javascript",parser:Ohe.configure({props:[uu.add({IfStatement:Np({except:/^\s*({|else\b)/}),TryStatement:Np({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:mie,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:gie({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Np({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),fu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":u7,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),wI={test:t=>/^JSX/.test(t.name),facet:OO({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Bw=li.configure({dialect:"ts"},"typescript"),Fw=li.configure({dialect:"jsx",props:[qS.add(t=>t.isTop?[wI]:void 0)]}),Zw=li.configure({dialect:"jsx ts",props:[qS.add(t=>t.isTop?[wI]:void 0)]},"typescript");let kI=t=>({label:t,type:"keyword"});const CI="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kI),She=CI.concat(["declare","implements","private","protected","public"].map(kI));function _I(t={}){let e=t.jsx?t.typescript?Zw:Fw:t.typescript?Bw:li,n=t.typescript?yI.concat(She):Nw.concat(CI);return new Qc(e,[li.data.of({autocomplete:qse(Vw,x8(n))}),li.data.of({autocomplete:vI}),t.jsx?TI:[]])}function whe(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function oE(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const khe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),TI=se.inputHandler.of((t,e,n,r,i)=>{if((khe?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!li.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,l=s.changeByRange(a=>{var c;let{head:u}=a,f=wt(s).resolveInner(u-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(s.doc.sliceString(u-1,u)!=r||f.name=="JSXAttributeValue"&&f.to>u)){if(r==">"&&f.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let d=f.parent,p=d.parent;if(p&&d.from==u-2&&((h=oE(s.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:H.cursor(u+g.length,-1),changes:{from:u,insert:g}}}}else if(r==">"){let d=whe(f);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(s.doc.sliceString(u,u+2))&&(h=oE(s.doc,d,u)))return{range:a,changes:{from:u,insert:`</${h}>`}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([o,s.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Che(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach((n,r)=>{var i;!((i=n.meta.docs)===null||i===void 0)&&i.recommended&&(e.rules[r]=2)})),n=>{let{state:r}=n,i=[];for(let{from:o,to:s}of li.findRegions(r)){let l=r.doc.lineAt(o),a={line:l.number-1,col:o-l.from,pos:o};for(let c of t.verify(r.sliceDoc(o,s),e))i.push(_he(c,r.doc,a))}return i}}function sE(t,e,n,r){return n.line(t+r.line).from+e+(t==1?r.col-1:-1)}function _he(t,e,n){let r=sE(t.line,t.column,e,n),i={from:r,to:t.endLine!=null&&t.endColumn!=1?sE(t.endLine,t.endColumn,e,n):r,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:t.severity==1?"warning":"error"};if(t.fix){let{range:o,text:s}=t.fix,l=o[0]+n.pos-r,a=o[1]+n.pos-r;i.actions=[{name:"fix",apply(c,u){c.dispatch({changes:{from:u+l,to:u+a,insert:s},scrollIntoView:!0})}}]}return i}const tp=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:TI,completionPath:SI,esLint:Che,javascript:_I,javascriptLanguage:li,jsxLanguage:Fw,localCompletionSource:vI,scopeCompletionSource:vhe,snippets:Nw,tsxLanguage:Zw,typescriptLanguage:Bw,typescriptSnippets:yI},Symbol.toStringTag,{value:"Module"})),Lu=["_blank","_self","_top","_parent"],w0=["ascii","utf-8","utf-16","latin1","latin1"],k0=["get","post","put","delete"],C0=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],$r=["true","false"],Te={},The={a:{attrs:{href:null,ping:null,type:null,media:null,target:Lu,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:Lu}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:C0,formmethod:k0,formnovalidate:["novalidate"],formtarget:Lu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":w0,autocomplete:["on","off"],enctype:C0,method:k0,novalidate:["novalidate"],target:Lu}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:C0,formmethod:k0,formnovalidate:["novalidate"],formtarget:Lu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:w0,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Te,noscript:Te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:w0}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Te},PI={accesskey:null,class:null,contenteditable:$r,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:$r,autocorrect:$r,autocapitalize:$r,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":$r,"aria-autocomplete":["inline","list","both","none"],"aria-busy":$r,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":$r,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":$r,"aria-hidden":$r,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":$r,"aria-multiselectable":$r,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":$r,"aria-relevant":null,"aria-required":$r,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},EI="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of EI)PI[t]=null;class gh{constructor(e,n){this.tags={...The,...e},this.globalAttrs={...PI,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}gh.default=new gh;function oa(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Nc(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function $I(t,e,n){let r=n.tags[oa(t,Nc(e))];return r?.children||n.allTags}function zw(t,e){let n=[];for(let r=Nc(e);r&&!r.type.isTop;r=Nc(r.parent)){let i=oa(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const AI=/^[:\-\.\w\u00b7-\uffff]*$/;function lE(t,e,n,r,i){let o=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=Nc(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:$I(t.doc,s,e).map(l=>({label:l,type:"type"})).concat(zw(t.doc,n).map((l,a)=>({label:"/"+l,apply:"/"+l+o,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function aE(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:zw(t.doc,e).map((o,s)=>({label:o,apply:o+i,type:"type",boost:99-s})),validFor:AI}}function Phe(t,e,n,r){let i=[],o=0;for(let s of $I(t.doc,n,e))i.push({label:"<"+s,type:"type"});for(let s of zw(t.doc,n))i.push({label:"</"+s+">",type:"type",boost:99-o++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ehe(t,e,n,r,i){let o=Nc(n),s=o?e.tags[oa(t.doc,o)]:null,l=s&&s.attrs?Object.keys(s.attrs):[],a=s&&s.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:a.map(c=>({label:c,type:"property"})),validFor:AI}}function $he(t,e,n,r,i){var o;let s=(o=n.parent)===null||o===void 0?void 0:o.getChild("AttributeName"),l=[],a;if(s){let c=t.sliceDoc(s.from,s.to),u=e.globalAttrs[c];if(!u){let f=Nc(n),h=f?e.tags[oa(t.doc,f)]:null;u=h?.attrs&&h.attrs[c]}if(u){let f=t.sliceDoc(r,i).toLowerCase(),h='"',d='"';/^['"]/.test(f)?(a=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",d=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):a=/^[^\s<>='"]*$/;for(let p of u)l.push({label:p,apply:h+p+d,type:"constant"})}}return{from:r,to:i,options:l,validFor:a}}function QI(t,e){let{state:n,pos:r}=e,i=wt(n).resolveInner(r,-1),o=i.resolve(r);for(let s=r,l;o==i&&(l=i.childBefore(s));){let a=l.lastChild;if(!a||!a.type.isError||a.from<a.to)break;o=i=l,s=a.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?aE(n,i,i.from,r):lE(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?lE(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?aE(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?Ehe(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?$he(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(o.name=="Element"||o.name=="Text"||o.name=="Document")?Phe(n,t,i,r):null}function MI(t){return QI(gh.default,t)}function RI(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new gh(e,n):gh.default;return i=>QI(r,i)}const Ahe=li.parser.configure({top:"SingleExpression"}),LI=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:Bw.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:Fw.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:Zw.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:Ahe},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:li.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:ph.parser}],II=[{name:"style",parser:ph.parser.configure({top:"Styles"})}].concat(EI.map(t=>({name:t,parser:li.parser}))),DI=$c.define({name:"html",parser:sfe.configure({props:[uu.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),fu.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),w7.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),mf=DI.configure({wrap:aI(LI,II)});function NI(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=aI((t.nestedLanguages||[]).concat(LI),(t.nestedAttributes||[]).concat(II)));let r=n?DI.configure({wrap:n,dialect:e}):e?mf.configure({dialect:e}):mf;return new Qc(r,[mf.data.of({autocomplete:RI(t)}),t.autoCloseTags!==!1?VI:[],_I().support,mI().support])}const cE=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));function Qhe(t,e,n){for(var r;;){if(((r=e.lastChild)===null||r===void 0?void 0:r.name)!="CloseTag")return!1;let i=e.parent;if(!i||oa(t,i)!=n)return!0;e=i}}const VI=se.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!mf.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,l=s.changeByRange(a=>{var c;let u=s.doc.sliceString(a.from-1,a.to)==r,{head:f}=a,h=wt(s).resolveInner(f,-1),d;if(u&&r==">"&&h.name=="EndTag"){let p=h.parent;if((d=oa(s.doc,p.parent,f))&&!cE.has(d)&&!Qhe(s.doc,p.parent,d)){let g=f+(s.doc.sliceString(f,f+1)===">"?1:0),m=`</${d}>`;return{range:a,changes:{from:f,to:g,insert:m}}}}else if(u&&r=="/"&&h.name=="IncompleteCloseTag"){let p=h.parent;if(h.from==f-2&&((c=p.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(d=oa(s.doc,p,f))&&!cE.has(d)){let g=f+(s.doc.sliceString(f,f+1)===">"?1:0),m=`${d}>`;return{range:H.cursor(f+m.length,-1),changes:{from:f,to:g,insert:m}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([o,s.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Mhe=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:VI,html:NI,htmlCompletionSource:MI,htmlCompletionSourceWith:RI,htmlLanguage:mf},Symbol.toStringTag,{value:"Module"})),BI=OO({commentTokens:{block:{open:"<!--",close:"-->"}}}),FI=new Ve,ZI=eue.configure({props:[fu.add(t=>!t.is("Block")||t.is("Document")||xb(t)!=null||Rhe(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),FI.add(xb),uu.add({Document:()=>null}),Ps.add({Document:BI})]});function xb(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Rhe(t){return t.name=="OrderedList"||t.name=="BulletList"}function Lhe(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=xb(r.type))!=null&&i<=e)break;n=r}return n.to}const Ihe=c7.of((t,e,n)=>{for(let r=wt(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(FI);if(i==null)continue;let o=Lhe(r,i);if(o>n)return{from:n,to:o}}return null});function jw(t){return new Nr(BI,t,[],"markdown")}const zI=jw(ZI),Dhe=ZI.configure([fue,due,hue,pue,{props:[fu.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),mh=jw(Dhe);function Nhe(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=j.matchLanguageName(t,n,!0),r instanceof j)return r.support?r.support.language.parser:ea.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class _0{constructor(e,n,r,i,o,s,l){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=o,this.type=s,this.item=l}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+XI(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function jI(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let o=n[i],s,l=e.lineAt(o.from),a=o.from-l.from;if(o.name=="Blockquote"&&(s=/^ *>( ?)/.exec(l.text.slice(a))))r.push(new _0(o,a,a+s[0].length,"",s[1],">",null));else if(o.name=="ListItem"&&o.parent.name=="OrderedList"&&(s=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let c=s[3],u=s[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new _0(o.parent,a,a+u,s[1],c,s[2],o))}else if(o.name=="ListItem"&&o.parent.name=="BulletList"&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let c=s[4],u=s[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let f=s[2];s[3]&&(f+=s[3].replace(/[xX]/," ")),r.push(new _0(o.parent,a,a+u,s[1],c,f,o))}}return r}function XI(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function T0(t,e,n,r=0){for(let i=-1,o=t;;){if(o.name=="ListItem"){let l=XI(o,e),a=+l[2];if(i>=0){if(a!=i+1)return;n.push({from:o.from+l[1].length,to:o.from+l[0].length,insert:String(i+2+r)})}i=a}let s=o.nextSibling;if(!s)break;o=s}}function Xw(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(zh)!=" ")return t;let r=Ni(t,4,n),i="";for(let o=r;o>0;)o>=4?(i+=" ",o-=4):(i+=" ",o--);return i+t.slice(n)}const WI=(t={})=>({state:e,dispatch:n})=>{let r=wt(e),{doc:i}=e,o=null,s=e.changeByRange(l=>{if(!l.empty||!mh.isActiveAt(e,l.from,-1)&&!mh.isActiveAt(e,l.from,1))return o={range:l};let a=l.from,c=i.lineAt(a),u=jI(r.resolveInner(a,-1),i);for(;u.length&&u[u.length-1].from>a-c.from;)u.pop();if(!u.length)return o={range:l};let f=u[u.length-1];if(f.to-f.spaceAfter.length>a-c.from)return o={range:l};let h=a>=f.to-f.spaceAfter.length&&!/\S/.test(c.text.slice(f.to));if(f.item&&h){if(f.item.from<c.from&&!/^[\s>]*$/.test(c.text.slice(0,f.to)))return o={range:l};let O=f.node.firstChild,y=f.node.getChild("ListItem","ListItem");if(O.to>=a||y&&y.to<a||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let x=u.length>1?u[u.length-2]:null,b,S="";x&&x.item?(b=c.from+x.from,S=x.marker(i,1)):b=c.from+(x?x.to:0);let v=[{from:b,to:a,insert:S}];return f.node.name=="OrderedList"&&T0(f.item,i,v,-2),x&&x.node.name=="OrderedList"&&T0(x.item,i,v),{range:H.cursor(b+S.length),changes:v}}else{let x=fE(u,e,c);return{range:H.cursor(a+x.length+1),changes:{from:c.from,insert:x+e.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&c.from){let O=i.lineAt(c.from-1),y=/>\s*$/.exec(O.text);if(y&&y.index==f.from){let x=e.changes([{from:O.from+y.index,to:O.to},{from:c.from+f.from,to:c.to}]);return{range:l.map(x),changes:x}}}let d=[];f.node.name=="OrderedList"&&T0(f.item,i,d);let p=f.item&&f.item.from<c.from,g="";if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=f.to)for(let O=0,y=u.length-1;O<=y;O++)g+=O==y&&!p?u[O].marker(i,1):u[O].blank(O<y?Ni(c.text,4,u[O+1].from)-g.length:null);let m=a;for(;m>c.from&&/\s/.test(c.text.charAt(m-c.from-1));)m--;return g=Xw(g,e),Vhe(f.node,e.doc)&&(g=fE(u,e,c)+e.lineBreak+g),d.push({from:m,to:a,insert:e.lineBreak+g}),{range:H.cursor(m+g.length+1),changes:d}});return o?!1:(n(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)},HI=WI();function uE(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Vhe(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),o=e.lineAt(r.from),s=/^[\s>]*$/.test(i.text);return i.number+(s?0:1)<o.number}function fE(t,e,n){let r="";for(let i=0,o=t.length-2;i<=o;i++)r+=t[i].blank(i<o?Ni(n.text,4,t[i+1].from)-r.length:null,i<o);return Xw(r,e)}function Bhe(t,e){let n=t.resolveInner(e,-1),r=e;uE(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(uE(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const qI=({state:t,dispatch:e})=>{let n=wt(t),r=null,i=t.changeByRange(o=>{let s=o.from,{doc:l}=t;if(o.empty&&mh.isActiveAt(t,o.from)){let a=l.lineAt(s),c=jI(Bhe(n,s),l);if(c.length){let u=c[c.length-1],f=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(s-a.from>f&&!/\S/.test(a.text.slice(f,s-a.from)))return{range:H.cursor(a.from+f),changes:{from:a.from+f,to:s}};if(s-a.from==f&&(u.item&&a.from<=u.item.from||/^[\s>]*$/.test(a.text.slice(0,u.to)))){let h=a.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(a.text.slice(u.from,u.to))){let d=u.blank(Ni(a.text,4,u.to)-Ni(a.text,4,u.from));return h==a.from&&(d=Xw(d,t)),{range:H.cursor(h+d.length),changes:{from:h,to:a.from+u.to,insert:d}}}if(h<s)return{range:H.cursor(h),changes:{from:h,to:s}}}}}return r={range:o}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},YI=[{key:"Enter",run:HI},{key:"Backspace",run:qI}],UI=NI({matchClosingTags:!1});function GI(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=zI,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:l=UI}=t;if(!(i instanceof $O))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let a=t.extensions?[t.extensions]:[],c=[l.support,Ihe],u;s&&c.push(KI),n instanceof Qc?(c.push(n.support),u=n.language):n&&(u=n);let f=e||u?Nhe(e,u):void 0;a.push(nue({codeParser:f,htmlParser:l.language.parser})),r&&c.push(Fi.high(au.of(YI)));let h=jw(i.configure(a));return o&&c.push(h.data.of({autocomplete:Fhe})),new Qc(h,c)}function Fhe(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=wt(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:Zhe(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let P0=null;function Zhe(){if(P0)return P0;let t=MI(new cw(ze.create({extensions:UI}),0,!0));return P0=t?t.options:[]}const zhe=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,KI=se.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!mh.isActiveAt(e.state,r.from,1)))return!1;let o=wt(e.state),s=!1;return o.iterate({from:r.from,to:r.to,enter:l=>{(l.from>r.from||zhe.test(l.name))&&(s=!0)},leave:l=>{l.to<r.to&&(s=!0)}}),s?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),jhe=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:zI,deleteMarkupBackward:qI,insertNewlineContinueMarkup:HI,insertNewlineContinueMarkupCommand:WI,markdown:GI,markdownKeymap:YI,markdownLanguage:mh,pasteURLAsLink:KI},Symbol.toStringTag,{value:"Module"})),bb=[R8,c8,GI(),HS(),se.lineWrapping],Xhe=()=>{const[t,e,n]=Vn(uo,ui,Ww),r=Zt(Xl),i=Zt(Vf),o=_.useRef(null),s=_.useCallback(l=>{var a;if(l!==null){const c=[...n,...bb,se.updateListener.of(({state:u})=>{r(u.doc.toString())}),se.focusChangeEffect.of((u,f)=>(f||i(new FocusEvent("blur")),null))];e&&c.push(ze.readOnly.of(!0)),l.innerHTML="",o.current=new se({parent:l,state:ze.create({doc:t,extensions:c})})}else(a=o.current)==null||a.destroy(),o.current=null},[t,e,r,n,i]);return _.createElement("div",{ref:s,className:"cm-sourceView mdxeditor-source-editor"})};function hE(t,e){t!==void 0&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})}const Whe=()=>{const t=yh(),[e,n,r,i]=Vn(uo,fm,ui,JI),o=Zt(Xl),s=_.useRef(null),l=_.useRef(null),a=wn(Ww),c=Zt(Vf);return _.useEffect(()=>t.sub(fm,u=>{var f;hE((f=l.current)==null?void 0:f.a,u)}),[t]),_.useEffect(()=>t.sub(uo,u=>{var f;hE((f=l.current)==null?void 0:f.b,u)}),[t]),_.useEffect(()=>{const u=r||i,f=u?{renderRevertControl:void 0,revertControls:void 0}:{renderRevertControl:()=>{const h=document.createElement("button");return h.classList.add("cm-merge-revert"),h.appendChild(document.createTextNode("⮕")),h},revertControls:"a-to-b"};return l.current=new Zce({...f,parent:s.current,orientation:"a-b",gutter:!0,a:{doc:n,extensions:[...a,...bb,ze.readOnly.of(!0)]},b:{doc:e,extensions:[...a,...bb,ze.readOnly.of(u),se.updateListener.of(({state:h})=>{const d=h.doc.toString();o(d)}),se.focusChangeEffect.of((h,d)=>(d||c(new FocusEvent("blur")),null))]}}),()=>{var h;(h=l.current)==null||h.destroy(),l.current=null}},[o,a]),_.createElement("div",{ref:s,className:"mdxeditor-diff-editor"})},Hhe=({children:t})=>{const[e,n]=Vn(Nf,ts);return _.createElement("div",{className:"mdxeditor-diff-source-wrapper"},e?_.createElement("div",{className:xe.markdownParseError},_.createElement("p",null,e.error,"."),_.createElement("p",null,"You can fix the errors in source mode and switch to rich text mode when you are ready.")):null,_.createElement("div",{className:"mdxeditor-rich-text-editor",style:{display:n==="rich-text"&&e==null?"block":"none"}},t),n==="diff"?_.createElement(Whe,null):null,n==="source"?_.createElement(Xhe,null):null)},fm=we(""),Ww=we([]),JI=we(!1),qhe=Zr({update:(t,e)=>{t.pub(fm,e?.diffMarkdown??"")},init(t,e){t.pubIn({[fm]:e?.diffMarkdown??"",[Ww]:e?.codeMirrorExtensions??[],[KX]:Hhe,[JI]:e?.readOnlyDiff??!1,[ts]:e?.viewMode??"rich-text"})}});function Yhe(t,e){let n=t;for(let r=ot(t,e);r&&(n6(r.origin)||Dl(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function Uhe(t){return Yhe(t,"previous")}function e6(t,e){for(const n of t.childNodes)if(Qe(n)&&n.tagName===e||e6(n,e))return!0;return!1}const Xu="data-language",Iu="data-highlight-language",np="data-theme";class Gh extends sr{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Gh(e.__language,e.__key)}constructor(e,n){super(n),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const n=Tt().createElement("code");Ii(n,e.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Xu,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Iu,r));const i=this.getTheme();i&&n.setAttribute(np,i);const o=this.getStyle();return o&&Ga(n.style,o),n}updateDOM(e,n,r){const i=this.__language,o=e.__language;i?i!==o&&n.setAttribute(Xu,i):o&&n.removeAttribute(Xu);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&o?s&&i?i!==o&&n.setAttribute(Iu,i):n.removeAttribute(Iu):s&&i&&n.setAttribute(Iu,i);const l=this.__theme,a=e.__theme;l?l!==a&&n.setAttribute(np,l):a&&n.removeAttribute(np);const c=this.__style,u=e.__style;return c!==u&&Ga(n.style,c,u),!1}exportDOM(e){const n=Tt().createElement("pre");Ii(n,e._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Xu,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Iu,r));const i=this.getTheme();i&&n.setAttribute(np,i);const o=this.getStyle();return o&&Ga(n.style,o),{element:n}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||e6(e,"BR"))?{conversion:dE,priority:1}:null,div:()=>({conversion:Ghe,priority:1}),pre:()=>({conversion:dE,priority:0}),table:e=>E0(e)?{conversion:Khe,priority:3}:null,td:e=>{const n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&E0(r)?{conversion:pE,priority:3}:null},tr:e=>{const n=e.closest("table");return n&&E0(n)?{conversion:pE,priority:3}:null}}}static importJSON(e){return rr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!da(Mt(),"@lexical/code")){const s=Jhe(e);if(s)return s}const{anchor:r,focus:i}=e,o=(r.isBefore(i)?r:i).getNode();if(Y(o)){let s=Uhe(o);const l=[];for(;;)if(Dl(s))l.push(Sh()),s=s.getNextSibling();else{if(!n6(s))break;{let p=0;const g=s.getTextContent(),m=s.getTextContentSize();for(;p<m&&g[p]===" ";)p++;if(p!==0&&l.push(t6(" ".repeat(p))),p!==m)break;s=s.getNextSibling()}}const a=o.splitText(r.offset)[0],c=r.offset===0?0:1,u=a.getIndexWithinParent()+c,f=o.getParentOrThrow(),h=[Sr(),...l];f.splice(u,0,h);const d=l[l.length-1];d?d.select():r.offset===0?a.selectPrevious():a.getNextSibling().selectNext(0,0)}if(Oh(o)){const{offset:s}=e.anchor;o.splice(s,0,[Sr()]),o.select(s+1,s+1)}return null}canIndent(){return!1}collapseAtStart(){const e=He();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}setLanguage(e){const n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}}function rr(t,e){return uA(Gh).setLanguage(t).setTheme(e)}function Oh(t){return t instanceof Gh}function dE(t){return{node:rr(t.getAttribute(Xu))}}function Ghe(t){const e=t,n=gE(e);return n||(function(r){let i=r.parentElement;for(;i!==null;){if(gE(i))return!0;i=i.parentElement}return!1})(e)?{node:n?rr():null}:{node:null}}function Khe(){return{node:rr()}}function pE(){return{node:null}}function gE(t){return t.style.fontFamily.match("monospace")!==null}function E0(t){return t.classList.contains("js-file-line-container")}function Jhe(t){const{anchor:e}=t;if(t.isCollapsed()&&e.type==="element"){const n=e.getNode();if(Oh(n)){const r=n.getChildrenSize();if(r>=2&&e.offset===r){const i=n.getLastChild();if(kn(i)&&kn(i.getPreviousSibling())){const o=He();return n.splice(r-2,2,[]).insertAfter(o,!1),o.select(),o}}}}return null}class AO extends hi{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(e){return new AO(e.__text,e.__highlightType||void 0,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){const n=super.createDOM(e),r=$0(e.theme,this.__highlightType);return Ii(n,r),n}updateDOM(e,n,r){const i=super.updateDOM(e,n,r),o=$0(r.theme,e.__highlightType),s=$0(r.theme,this.__highlightType);return o!==s&&(o&&Im(n,o),s&&Ii(n,s)),i}static importJSON(e){return t6().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return rr()}}function $0(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function t6(t="",e){return zr(new AO(t,e))}function n6(t){return t instanceof AO}const r6="data-language";function i6(t){return t.style.fontFamily.match("monospace")!==null}function vb(t){let e=t.parentElement;for(;e!==null;){if(i6(e))return!0;e=e.parentElement}return!1}const ede=KA([{$import:(t,e)=>t.$importChildren(e),match:Cn.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"}]),tde={$import:(t,e)=>[rr(e.getAttribute(r6)).splice(0,0,t.$importChildren(e))],match:Cn.tag("pre"),name:"@lexical/code/pre"},nde={$import:(t,e,n)=>{const r=e.textContent||"";return/\r?\n/.test(r)||e.querySelector("br")!==null?[rr(e.getAttribute(r6)).splice(0,0,t.$importChildren(e))]:n()},match:Cn.tag("code"),name:"@lexical/code/code-multiline"};function rp(t){if(!Qe(t))return!1;const e=t.style.fontFamily,n=t.style.whiteSpace;return typeof e=="string"&&/monospace/i.test(e)&&typeof n=="string"&&n.startsWith("pre")}function rde(t){let e=!1;const n=[];let r="",i=!1;const o=()=>{i&&(n.push(r),r="",i=!1)};for(const s of Array.from(t.childNodes))if(Qe(s))s.tagName==="DIV"?(o(),n.push(s.textContent||""),e=!0):s.tagName==="BR"?(o(),n.push(""),e=!0):(r+=s.textContent||"",i=!0);else if(wr(s)){const l=s.textContent||"";l.length>0&&(r+=l,i=!0)}return o(),e?n:null}Cn.tag("div"),Cn.tag("div","br");const ide={$import:(t,e,n)=>i6(e)?[rr().splice(0,0,t.$importChildren(e))]:vb(e)?t.$importChildren(e):n(),match:Cn.tag("div"),name:"@lexical/code/div"};Cn.tag("table").classAll("js-file-line-container"),Cn.tag("td").classAll("js-file-line");function Sb(t,e){const n={};for(const r of t){const i=e(r);i&&(n[i]?n[i].push(r):n[i]=[r])}return n}function ode(t){const e=Sb(t,n=>n.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const mE=/[!-/:-@[-`{-~\s]/;function OE(t){return t.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n)))}const sde=/^(\s*)(\d{1,})\.\s/,lde=/^(\s*)[-*+]\s/,ade=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,cde=/^(#{1,6})\s/,ude=/^>\s/,fde=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,hde=/^[ \t]*`{3,}$/,Wu=vh("mdListMarker",{parse:t=>typeof t=="string"&&/^[-*+]$/.test(t)?t:"-",resetOnCopyNode:!0}),yE=vh("mdCodeFence",{parse:t=>typeof t=="string"&&/^`{3,}$/.test(t)?t:"```",resetOnCopyNode:!0}),dde=vh("mdHardLineBreak",{parse:t=>typeof t=="string"&&/^(\\| {2,})$/.test(t)?t:"",resetOnCopyNode:!0});function pde(t){if(t.endsWith("\\"))return[t.slice(0,-1),"\\"];const e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function gde(t){const e=t.getChildren(),n=e.length-1,r=e[n];if(!Y(r))return null;const i=r.getTextContent(),o=pde(i);if(o!==null){const[s,l]=o;return r.setTextContent(s),l}return/^ {2,}$/.test(i)&&(function(s,l){for(let a=l-1;a>=0;a--){if(kn(s[a]))return!1;if(/\S/.test(s[a].getTextContent()))return!0}return!1})(e,n)?(r.setTextContent(""),i):null}function mde(t){const e=Sr(),n=gde(t);return n!==null&&Ha(e,dde,n),e}const o6=t=>(e,n,r,i)=>{const o=t(r);o.append(...n),e.replace(o),i||o.select(0,0)},Hw=t=>(e,n,r,i)=>{const o=e.getPreviousSibling(),s=e.getNextSibling(),l=fi(t==="check"?r[3]==="x":void 0),a=r[0].trim()[0],c=t!=="bullet"&&t!=="check"||a!==Wu.parse(a)?void 0:a;if($e(s)&&s.getListType()===t){c&&Ha(s,Wu,c);const f=s.getFirstChild();f!==null?f.insertBefore(l):s.append(l),t==="number"&&s.setStart(Number(r[2])),e.remove()}else if($e(o)&&o.getListType()===t)c&&Ha(o,Wu,c),o.append(l),e.remove();else{const f=si(t,t==="number"?Number(r[2]):void 0);c&&Ha(f,Wu,c),f.append(l),e.replace(f)}l.append(...n),i||l.select(0,0);const u=(function(f){const h=f.match(/\t/g),d=f.match(/ /g);let p=0;return h&&(p+=h.length),d&&(p+=Math.floor(d.length/4)),p})(r[1]);u&&l.setIndent(u)},QO=(t,e,n,r)=>{const i=[],o=t.getChildren();let s=0;for(const l of o)if(De(l)){if(l.getChildrenSize()===1){const d=l.getFirstChild();if($e(d)){const p=QO(d,e,n+1,r);p&&i.push(p);continue}}if(r&&!l.getChildren().some(d=>d.isSelected(r)))continue;const a=" ".repeat(4*n),c=t.getListType(),u=pm(t,Wu),f=c==="number"?`${t.getStart()+s}. `:c==="check"?`${u} [${l.getChecked()?"x":" "}] `:u+" ";let h=e(l);c!=="number"&&(h=h.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(a+f+h),s++}return i.join(`
|
|
134
|
-
`)},Ode={dependencies:[Th],export:(t,e)=>{if(!Zm(t))return null;const n=Number(t.getTag().slice(1));return"#".repeat(n)+" "+e(t)},regExp:cde,replace:o6(t=>{const e="h"+t[1].length;return Ri(e)}),triggerOnEnter:!0,type:"element"},s6={dependencies:[Fm],export:(t,e)=>{if(!py(t))return null;const n=e(t).split(`
|
|
135
|
-
`),r=[];for(const i of n)r.push("> "+i);return r.join(`
|
|
136
|
-
`)},regExp:ude,replace:(t,e,n,r)=>{if(r){const o=t.getPreviousSibling();if(py(o))return o.splice(o.getChildrenSize(),0,[mde(o),...e]),void t.remove()}const i=ma();i.append(...e),t.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:"element"},Of={dependencies:[Gh],export:t=>{if(!Oh(t))return null;const e=t.getTextContent();let n=pm(t,yE);if(e.indexOf(n)>-1){const r=e.match(/`{3,}/g);if(r){const i=Math.max(...r.map(o=>o.length));n="`".repeat(i+1)}}return n+(t.getLanguage()||"")+(e?`
|
|
137
|
-
`+e:"")+`
|
|
138
|
-
`+n},handleImportAfterStartMatch:({lines:t,rootNode:e,startLineIndex:n,startMatch:r})=>{const i=r[1],o=i.trim().length,s=t[n],l=r.index+i.length,a=s.slice(l),c=new RegExp(`\`{${o},}$`);if(c.test(a)){const d=a.match(c),p=a.slice(0,a.lastIndexOf(d[0])),g=[...r];return g[2]="",Of.replace(e,null,g,d,[p],!0),[!0,n]}const u=new RegExp(`^[ \\t]*\`{${o},}$`);for(let d=n+1;d<t.length;d++){const p=t[d];if(u.test(p)){const g=p.match(u),m=t.slice(n+1,d),O=s.slice(r[0].length);return O.length>0&&m.unshift(O),Of.replace(e,null,r,g,m,!0),[!0,d]}}const f=t.slice(n+1),h=s.slice(r[0].length);return h.length>0&&f.unshift(h),Of.replace(e,null,r,null,f,!0),[!0,t.length-1]},regExpEnd:{optional:!0,regExp:hde},regExpStart:fde,replace:(t,e,n,r,i,o)=>{let s,l;const a=n[1]?n[1].trim():"```",c=n[2]||void 0;if(!e&&i){if(i.length===1)r?(s=rr(c),l=i[0]):(s=rr(c),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=rr(c),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
|
|
139
|
-
`)}Ha(s,yE,a);const u=bt(l);s.append(u),t.append(s)}else e&&o6(u=>rr(u?u[2]:void 0))(t,e,n,o)},type:"multiline-element"},qw={dependencies:[fs,us],export:(t,e,n)=>$e(t)?QO(t,e,0,n):null,regExp:lde,replace:Hw("bullet"),triggerOnEnter:!0,type:"element"},l6={dependencies:[fs,us],export:(t,e,n)=>$e(t)?QO(t,e,0,n):null,regExp:ade,replace:Hw("check"),triggerOnEnter:!0,type:"element"},Yw={dependencies:[fs,us],export:(t,e,n)=>$e(t)?QO(t,e,0,n):null,regExp:sde,replace:Hw("number"),triggerOnEnter:!0,type:"element"},a6={format:["code"],tag:"`",type:"text-format"},yde={format:["highlight"],tag:"==",type:"text-format"},c6={format:["bold","italic"],tag:"***",type:"text-format"},u6={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},f6={format:["bold"],tag:"**",type:"text-format"},h6={format:["bold"],intraword:!1,tag:"__",type:"text-format"},xde={format:["strikethrough"],tag:"~~",type:"text-format"},d6={format:["italic"],tag:"*",type:"text-format"},p6={format:["italic"],intraword:!1,tag:"_",type:"text-format"},g6={dependencies:[yo],export:(t,e,n)=>{if(!en(t)||er(t))return null;const r=e(t);let i=t.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${r}](${t.getURL()} "${i}")`:`[${r}](${t.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(t,e)=>{if(lt(t,en))return;const[,n,r,i]=e,o=r!=null?OE(r):void 0,s=i!=null?OE(i):void 0,l=os(o,{title:s}),a=n.split("[").length-1,c=n.split("]").length-1;let u=n,f="";if(a<c)return;if(a>c){const d=n.split("[");f="["+d[0],u=d.slice(1).join("[")}const h=bt(u);return h.setFormat(t.getFormat()),l.append(h),t.replace(l),f&&l.insertBefore(bt(f)),h},trigger:")",type:"text-match"},bde=[Ode,s6,qw,Yw],vde=[Of],Sde=[a6,c6,u6,f6,h6,yde,d6,p6,xde],wde=[g6],m6=[...bde,...vde,...Sde,...wde];function xE(t){return Y(t)&&!t.hasFormat("code")}function kde(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function bE(t,e,n,r,i){const o=t.getParent();if(!gt(o)||t.getFirstChild()!==e)return!1;const s=e.getTextContent();if(!i&&s[n-1]!==" ")return!1;for(const{regExp:l,replace:a}of r){const c=s.match(l),u=i||c&&c[0].endsWith(" ")?n:n-1;if(c&&c[0].length===u){const f=e.getNextSiblings(),[h,d]=e.splitText(n);if(a(t,d?[d,...f]:f,c,!1)!==!1)return h.remove(),!0}}return!1}function vE(t,e,n,r,i){const o=t.getParent();if(!gt(o)||t.getFirstChild()!==e)return!1;const s=e.getTextContent();if(!i&&s[n-1]!==" ")return!1;for(const{regExpStart:l,replace:a,regExpEnd:c}of r){if(c&&!("optional"in c)||c&&"optional"in c&&!c.optional)continue;const u=s.match(l);if(u){const f=i||u[0].endsWith(" ")?n:n-1;if(u[0].length!==f)continue;const h=e.getNextSiblings(),[d,p]=e.splitText(n);if(a(t,p?[p,...h]:h,u,null,null,!1)!==!1)return d.remove(),!0}}return!1}function Cde(t,e){let n=0;const r=t.getTextContent();for(let i=0;i<e;i++)r[i]==="`"&&n++;return n%2!=0}function SE(t,e,n){const r=n.length;for(let i=e;i>=r;i--){const o=i-r;if(O6(t,o,n,0,r)&&t[o+r]!==" ")return o}return-1}function O6(t,e,n,r,i){for(let o=0;o<i;o++)if(t[e+o]!==n[r+o])return!1;return!0}function _de(t,e=m6){const n=ode(e),r=n.element.filter(a=>a.triggerOnEnter),i=Sb(n.textFormat,({tag:a})=>a[a.length-1]),o=Sb(n.textMatch,({trigger:a})=>a),s=new Set([" "]);for(const a of n.textFormat)s.add(a.tag.slice(-1));for(const a of n.textMatch)a.trigger!==void 0&&s.add(a.trigger);for(const a of e){const c=a.type;if(c==="element"||c==="text-match"||c==="multiline-element"){const u=a.dependencies;for(const f of u)t.hasNode(f)||kde(173,f.getType())}}const l=(a,c,u)=>!!bE(a,c,u,n.element)||!!vE(a,c,u,n.multilineElement)||!!(function(f,h,d){let p=f.getTextContent();const g=d[p[h-1]];if(g==null)return!1;h<p.length&&(p=p.slice(0,h));for(const m of g){if(!m.replace||!m.regExp)continue;const O=p.match(m.regExp);if(O===null)continue;const y=O.index||0,x=y+O[0].length;let b;return y===0?[b]=f.splitText(x):[,b]=f.splitText(y,x),b.selectNext(0,0),m.replace(b,O),!0}return!1})(c,u,o)||!!(function(f,h,d){const p=f.getTextContent(),g=h-1,m=p[g],O=d[m];if(!O)return!1;for(const y of O){const{tag:x}=y,b=x.length,S=g-b+1;if(b>1&&!O6(p,S,x,0,b)||p[S-1]===" ")continue;const v=p[g+1];if(y.intraword===!1&&v&&!mE.test(v))continue;const w=f;let k=w,P=SE(p,S,x),T=k;for(;P<0&&(T=T.getPreviousSibling())&&!kn(T);)if(Y(T)){if(T.hasFormat("code"))continue;const oe=T.getTextContent();k=T,P=SE(oe,oe.length,x)}if(P<0||k===w&&P+b===S)continue;const M=k.getTextContent();if(P>0&&M[P-1]===m)continue;const I=M[P-1];if(y.intraword===!1&&I&&!mE.test(I)||!y.format.includes("code")&&Cde(k,P))continue;const $=w.getTextContent(),D=$.slice(0,S)+$.slice(g+1);w.setTextContent(D);const Z=k===w?D:M;k.setTextContent(Z.slice(0,P)+Z.slice(P+b));const G=ne(),z=Cm();Vt(z);const ee=g-b*(k===w?2:1)+1;z.anchor.set(k.__key,P,"text"),z.focus.set(w.__key,ee,"text");for(const oe of y.format)z.formatText(oe,qo[oe]);z.anchor.set(z.focus.key,z.focus.offset,z.focus.type);for(const oe of y.format)z.hasFormat(oe)&&z.toggleFormat(oe);return X(G)&&(z.format=G.format),!0}return!1})(c,u,i);return ln(t.registerUpdateListener(({tags:a,dirtyLeaves:c,editorState:u,prevEditorState:f})=>{if(a.has(b$)||a.has(_l)||t.isComposing())return;const h=a.has(Tf),d=u.read(ne),p=f.read(ne);if(!X(p)||!X(d)||!d.isCollapsed()||d.is(p)&&!h)return;const g=d.anchor.key,m=d.anchor.offset,O=u._nodeMap.get(g);if(Y(O)&&c.has(g)&&(h||m===1||!(m>p.anchor.offset+1))){if(h){const y=u.read(()=>O.getTextContent())[m-1];if(!s.has(y))return}t.update(()=>{if(!xE(O))return;const y=O.getParent();y===null||Oh(y)||l(y,O,d.anchor.offset)&&Yo(O$)})}}),t.registerCommand(gc,a=>{if(a!==null&&a.shiftKey)return!1;const c=ne();if(!X(c)||!c.isCollapsed())return!1;const u=c.anchor.offset,f=c.anchor.getNode();if(!Y(f)||!xE(f))return!1;const h=f.getParent();return h===null||Oh(h)?!1:u===f.getTextContent().length&&!(!vE(h,f,u,n.multilineElement,!0)&&!bE(h,f,u,r,!0))&&(a!==null&&a.preventDefault(),!0)},fn))}const Tde=[{dependencies:[pa],export:t=>NA(t)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(t,e,n,r)=>{const i=Vm();r||t.getNextSibling()!=null?t.replace(i):t.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...m6];function A0({transformers:t=Tde}){const[e]=jr();return C.useEffect(()=>_de(e,t),[e,t]),null}const Pde=Zr({init(t){const e=t.getValue($v),n=e.includes("headings")?t.getValue(Bf):[],r=Qde(e,n),i=r.filter(o=>!Ade.has(o));t.pubIn({[Ah]:()=>_.createElement(A0,{transformers:r}),[Tv]:()=>_.createElement(A0,{transformers:r}),[R9]:()=>_.createElement(A0,{transformers:i})})}}),Ede=t=>(e,n,r)=>{const i=t(r);i.append(...n),e.replace(i),i.select(0,0)},$de={dependencies:[Uc],export:t=>NA(t)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(t,e,n,r)=>{const i=Qh();r||t.getNextSibling()!=null?t.replace(i):t.insertBefore(i),i.selectNext()},type:"element"},Ade=new Set([Yw,qw,l6]);function Qde(t,e){const n=[c6,u6,f6,h6,a6,d6,p6];if(t.includes("headings")){const r=Math.min(...e),i=Math.max(...e),o=new RegExp(`^(#{${r},${i}})\\s`),s={dependencies:[Th],export:(l,a)=>{if(!Zm(l))return null;const c=Number(l.getTag().slice(1));return"#".repeat(c)+" "+a(l)},regExp:o,replace:Ede(l=>{const a=`h${l[1].length}`;return Ri(a)}),type:"element"};n.push(s)}if(t.includes("thematicBreak")&&n.push($de),t.includes("quote")&&n.push(s6),t.includes("link")&&n.push(g6),t.includes("lists")&&n.push(Yw,qw,l6),t.includes("codeblock")){const r={...Of,dependencies:[ou],replace:(i,o,s)=>{const l=Vh({code:"",language:s[1]??"",meta:""});i.selectPrevious(),i.replace(l),setTimeout(()=>{l.select()},80)}};n.push(r)}return n}const Mde=()=>{const t=Zt(Sg),e=wn(L9),n=wn($v),r=n.includes("quote"),i=n.includes("headings"),o=_n();if(!r&&!i)return null;const s=[{label:o("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&s.push({label:o("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const l=wn(Bf);s.push(...l.map(a=>({label:o("toolbar.blockTypes.heading","Heading {{level}}",{level:a}),value:`h${a}`})))}return _.createElement(eL,{value:e,onChange:l=>{switch(l){case"quote":t(()=>ma());break;case"paragraph":t(()=>He());break;case"":break;default:if(l.startsWith("h"))t(()=>Ri(l));else throw new Error(`Unknown block type: ${l}`)}},triggerTitle:o("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:o("toolbar.blockTypeSelect.placeholder","Block type"),items:s})},Q0=({format:t,addTitle:e,removeTitle:n,icon:r,formatName:i})=>{const[o,s]=Vn(yv,Bn),l=Zt(xv),a=(o&t)!==0;return _.createElement(hL,{title:a?n:e,on:a,onValueChange:()=>{l(i)}},s(r))},Rde=({options:t})=>{const e=_n(),n=typeof t>"u";return _.createElement("div",{className:xe.toolbarGroupOfGroups},n||t.includes("Bold")?_.createElement(Q0,{format:ef,addTitle:e("toolbar.bold","Bold"),removeTitle:e("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,n||t.includes("Italic")?_.createElement(Q0,{format:tf,addTitle:e("toolbar.italic","Italic"),removeTitle:e("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,n||t.includes("Underline")?_.createElement(Q0,{format:nf,addTitle:e("toolbar.underline","Underline"),removeTitle:e("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},Lde=()=>{const[t,e]=Vn(yv,Bn),n=Zt(xv),r=_n(),i=(t&Xm)!==0,o=i?r("toolbar.removeInlineCode","Remove code format"):r("toolbar.inlineCode","Inline code format");return _.createElement(dL,{items:[{title:o,contents:e("code"),active:i,onChange:n.bind(null,"code")}]})},Ide=()=>{const t=Zt(Cw),e=wn(Bn),n=_n();return _.createElement(EO,{"aria-label":n("toolbar.link","Create link"),title:n("toolbar.link","Create link"),onPointerDown:r=>{r.preventDefault()},onClick:r=>{t()}},e("link"))},Dde=({children:t,SourceToolbar:e,options:n=["rich-text","diff","source"]})=>{const[r,i]=Vn(ts,Bn),o=Zt(ts),s=_n(),l=[];return n.includes("rich-text")&&l.push({title:s("toolbar.richText","Rich text"),contents:i("rich_text"),value:"rich-text"}),n.includes("diff")&&l.push({title:s("toolbar.diffMode","Diff mode"),contents:i("difference"),value:"diff"}),n.includes("source")&&l.push({title:s("toolbar.source","Source mode"),contents:i("markdown"),value:"source"}),_.createElement(_.Fragment,null,r==="rich-text"?t:r==="diff"?_.createElement("span",{className:xe.toolbarTitleMode},s("toolbar.diffMode","Diff mode")):e??_.createElement("span",{className:xe.toolbarTitleMode},s("toolbar.source","Source mode")),_.createElement("div",{className:xe.diffSourceToggleWrapper},_.createElement(pL,{className:xe.diffSourceToggle,ggClassName:xe.ggDiffSourceToggle,value:r,items:l,onChange:a=>{o(a===""?"rich-text":a)}})))},Nde=()=>{const t=Zt(_S),e=wn(Bn),n=_n();return _.createElement(EO,{title:n("toolbar.codeBlock","Insert Code Block"),onClick:()=>{t({})}},e("frame_source"))},Vde=()=>{const t=wn(Bn),e=Zt(VM),n=_n(),r=wn(Pv);return _.createElement(EO,{title:n("toolbar.table","Insert Table"),onClick:()=>{e({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},t("table"))},Bde=()=>{const t=Zt(z9),e=wn(Bn),n=_n();return _.createElement(EO,{title:n("toolbar.thematicBreak","Insert thematic break"),onClick:()=>{t()}},e("horizontal_rule"))},Fde={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},Zde=({options:t=["bullet","number","check"]})=>{const[e,n,r]=Vn(Iy,Bn,Pv),i=Zt(tQ),o=_n(),s={bullet:o("toolbar.bulletedList","Bulleted list"),number:o("toolbar.numberedList","Numbered list"),check:o("toolbar.checkList","Check list")},l=t.map(a=>({value:a,title:s[a],contents:n(Fde[a])}));return _.createElement(pL,{value:e||"",items:l,onChange:i,disabled:r})},zde=()=>{const[t,e]=Vn(Bn,zt),[n,r]=_.useState(!1),[i,o]=_.useState(!1),s=_n();return _.useEffect(()=>{if(e)return ln(e.registerCommand(Sl,l=>(r(l),!1),co),e.registerCommand(vl,l=>(o(l),!1),co))},[e]),_.createElement(dL,{items:[{title:s("toolbar.undo","Undo {{shortcut}}",{shortcut:wg?"⌘Z":"Ctrl+Z"}),disabled:!n,contents:t("undo"),active:!1,onChange:()=>e?.dispatchCommand(Om,void 0)},{title:s("toolbar.redo","Redo {{shortcut}}",{shortcut:wg?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:t("redo"),active:!1,onChange:()=>e?.dispatchCommand(ym,void 0)}]})},jde=1e3;function Xde(){const t=()=>document.documentElement.dataset.theme!=="light",[e,n]=C.useState(t);return C.useEffect(()=>{const r=new MutationObserver(()=>n(t()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>r.disconnect()},[]),e}function Wde(t){const e=[];let n=!1;const r=/^(\s*([-*+]|\d+[.)])\s|#{1,6}\s|\||>|\s*```|---\s*$|\s*[-*_]{3,}\s*$|\s*\\?\[\^[^\]]+\]:)/;for(const i of t.split(`
|
|
140
|
-
`)){if(/^\s*```/.test(i)){n=!n,e.push(i);continue}const o=e[e.length-1];!n&&o!==void 0&&o.trim()!==""&&i.trim()!==""&&!/^(#{1,6}\s|\||>|\s*```)/.test(o)&&!/ {2}$|\\$/.test(o)&&!r.test(i)&&!/^\s*<|^\s*!\[/.test(i)?e[e.length-1]=`${o.replace(/\s+$/,"")} ${i.trim()}`:e.push(i)}return e.join(`
|
|
141
|
-
`)}function Hde(t){return t.replace(/\\\[\\\[([^\]]*?)\\\]\\\]/g,"[[$1]]").replace(/\\\[\\\[([^\]]*?)\]\]/g,"[[$1]]").replace(/\\\[\^/g,"[^")}function M0(t){const e=t.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return e?{head:e[0],body:t.slice(e[0].length)}:{head:"",body:t}}function qde({bundle:t,conceptId:e}){const[n,r]=C.useState(void 0),[i,o]=C.useState("saved"),[s,l]=C.useState(""),[a,c]=C.useState(!1),u=C.useRef(null),f=C.useRef(""),h=C.useRef(null),d=C.useRef(null),p=C.useRef(null),g=`/api/knowledge/${encodeURIComponent(t)}/concept?id=${encodeURIComponent(e)}`;C.useEffect(()=>{let k=!0;return fetch(g).then(P=>P.ok?P.json():null).then(P=>{k&&(P&&(f.current=M0(P.raw).head),r(P))}).catch(()=>k&&r(null)),()=>{k=!1}},[g]);const m=n?.title||e;C.useEffect(()=>(ek(`${m} · editor`),()=>ek("")),[m]);const O=C.useMemo(()=>n?Wde(M0(n.raw).body):"",[n]),y=Xde();async function x(){p.current&&await p.current;const k=h.current;if(k===null)return;h.current=null,o("saving");const P=(async()=>{try{const T=f.current,M=T?`${T}${T.endsWith(`
|
|
142
|
-
`)?"":`
|
|
143
|
-
`}${k.replace(/^\n+/,`
|
|
144
|
-
`)}`:k,$=await(await fetch(`/api/knowledge/${encodeURIComponent(t)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,content:M}),keepalive:!0})).json();if($.error)throw new Error($.error);f.current=M0($.raw).head,l(""),o(h.current===null?"saved":"unsaved")}catch(T){l(T.message),o("error"),h.current===null&&(h.current=k)}})();p.current=P,await P,p.current=null}function b(k){h.current=Hde(k),o("unsaved"),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{x()},jde)}C.useEffect(()=>{const k=()=>{h.current!==null&&x()};return window.addEventListener("beforeunload",k),window.addEventListener("pagehide",k),()=>{window.removeEventListener("beforeunload",k),window.removeEventListener("pagehide",k),d.current&&clearTimeout(d.current)}},[]);async function S(){d.current&&clearTimeout(d.current),await x(),window.history.length>1?window.history.back():v6(`/knowledge/${encodeURIComponent(t)}/${e}`)}const v=C.useMemo(()=>[EH(),lq(),Oee(),IH(),KK(),Oce(),QK(),Tee({defaultCodeBlockLanguage:""}),dce({codeBlockLanguages:{"":"text",txt:"text",js:"JavaScript",ts:"TypeScript",json:"JSON",yaml:"YAML",bash:"Shell",md:"Markdown"}}),Pde(),qhe({viewMode:"rich-text"}),vce({toolbarContents:()=>V.jsxs(Dde,{children:[V.jsx(zde,{}),V.jsx(Mde,{}),V.jsx(Rde,{}),V.jsx(Lde,{}),V.jsx(Zde,{}),V.jsx(Ide,{}),V.jsx(Vde,{}),V.jsx(Bde,{}),V.jsx(Nde,{})]})})],[]),w=i==="saving"?"saving…":i==="unsaved"?"unsaved changes":i==="error"?`not saved — ${s}`:"all changes saved";return V.jsxs("div",{className:"editor-screen",children:[V.jsxs("div",{className:"editor-bar",children:[V.jsxs("span",{className:"editor-crumb",children:[V.jsx(tk,{name:"menu_book",className:"ms-sm"})," ",t]}),V.jsx("span",{className:"editor-title",children:m}),V.jsx("span",{className:`editor-status ${i}`,children:w}),V.jsx("span",{className:"spacer"}),V.jsxs("button",{className:"editor-close",onClick:()=>{S()},title:"Save and close",children:[V.jsx(tk,{name:"close"})," close"]})]}),n===void 0?V.jsx("div",{className:"empty",children:"loading…"}):n===null?V.jsx("div",{className:"empty",children:"concept not found"}):a?V.jsxs("div",{className:"editor-doc",children:[V.jsx("div",{className:"viewer-note",children:"This document could not be opened in rich-text mode — editing the markdown source instead."}),V.jsx("textarea",{className:"editor-plain",defaultValue:O,spellCheck:!1,onChange:k=>b(k.target.value)})]}):V.jsx("div",{className:"editor-doc",children:V.jsx(SH,{ref:u,className:`editor-mdx ${y?"dark-theme":""}`,contentEditableClassName:"editor-content md-body",markdown:O,plugins:v,autoFocus:{defaultSelection:"rootStart",preventScroll:!0},onChange:(k,P)=>{P||b(k)},onError:()=>c(!0)})})]})}const xpe=Object.freeze(Object.defineProperty({__proto__:null,EditorScreen:qde},Symbol.toStringTag,{value:"Module"}));export{KL as C,Xr as E,dt as I,$c as L,PR as N,Qc as a,qse as b,Np as c,x8 as d,Dc as e,fu as f,wt as g,am as h,uu as i,mie as j,gie as k,u7 as l,dr as m,se as n,H as o,NI as p,ER as q,pI as r,cu as s,A as t,w7 as u,li as v,xpe as w};
|