aitu-app 0.6.63 → 0.6.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +3 -3
  2. package/assets/{CanvasAudioPlayer-Du5kXrAd.js → CanvasAudioPlayer-B2W5__ni.js} +1 -1
  3. package/assets/{ChatDrawer-CqZHx7x_.js → ChatDrawer-M1q92KNU.js} +2 -2
  4. package/assets/{ChatMessagesArea-AG3RXe34.js → ChatMessagesArea-D9LNDmbK.js} +2 -2
  5. package/assets/{DeferredAIInputBar-CNAPl6C2.js → DeferredAIInputBar-CKhI8Jhd.js} +2 -2
  6. package/assets/{DrawnixDeferredFeatures-BrhbEEBa.js → DrawnixDeferredFeatures-DxyxvT2y.js} +1 -1
  7. package/assets/{KnowledgeBaseContent-3hE8vBra.js → KnowledgeBaseContent-C_JxGQXg.js} +3 -3
  8. package/assets/{MVCreator-2NIxaaSL.js → MVCreator-DOt6pxq2.js} +1 -1
  9. package/assets/{ModelBenchmarkWorkbench-CacNyFbi.js → ModelBenchmarkWorkbench-3j77ocpe.js} +1 -1
  10. package/assets/{ModelDropdown-3MjTl1AO.js → ModelDropdown-CHYgRb1r.js} +1 -1
  11. package/assets/{MusicAnalyzer-Mmu92A4Y.js → MusicAnalyzer-BTXks5oV.js} +1 -1
  12. package/assets/{MusicAnalyzer-Drf2j8jn.js → MusicAnalyzer-Dr-DPePj.js} +1 -1
  13. package/assets/{ResizableDivider-B_67th7H.js → ResizableDivider-P1jpoJ3i.js} +1 -1
  14. package/assets/{TaskQueuePanel-VfjKIooN.js → TaskQueuePanel-D6NtMAbm.js} +1 -1
  15. package/assets/{VideoAnalyzer-DNWjNcIx.js → VideoAnalyzer-BHZMqLIa.js} +1 -1
  16. package/assets/{ai-generation-preferences-service-Ch1XhjkZ.js → ai-generation-preferences-service-CabuQA69.js} +1 -1
  17. package/assets/{arc-DE4qRd9D.js → arc-BajUk0_Z.js} +1 -1
  18. package/assets/{arc-DJ5Mb9x1.js → arc-Z9PGo_2L.js} +1 -1
  19. package/assets/{batch-image-generation-Bk8HSFol.js → batch-image-generation-RKz5tz-Y.js} +1 -1
  20. package/assets/{blockDiagram-38ab4fdb-B62iB8ti.js → blockDiagram-38ab4fdb-BsEJDcLK.js} +1 -1
  21. package/assets/{blockDiagram-38ab4fdb-D2MnfN1Q.js → blockDiagram-38ab4fdb-Cfmk3_6A.js} +1 -1
  22. package/assets/{c4Diagram-3d4e48cf-CgUaipiZ.js → c4Diagram-3d4e48cf-D2OyfHpd.js} +1 -1
  23. package/assets/{c4Diagram-3d4e48cf-DHV35ltP.js → c4Diagram-3d4e48cf-K-ewbsK1.js} +1 -1
  24. package/assets/{canvas-insertion-ZEZkcXvB.js → canvas-insertion-CYbFgP4L.js} +1 -1
  25. package/assets/channel-6DAc0JPc.js +1 -0
  26. package/assets/channel-WrMsNCbC.js +1 -0
  27. package/assets/{classDiagram-70f12bd4-C6X-VZXt.js → classDiagram-70f12bd4-BGEF352u.js} +1 -1
  28. package/assets/{classDiagram-70f12bd4-OH5sF1K-.js → classDiagram-70f12bd4-Gn3MZjEL.js} +1 -1
  29. package/assets/{classDiagram-v2-f2320105-otk4V9KH.js → classDiagram-v2-f2320105-C_aAfIgL.js} +1 -1
  30. package/assets/{classDiagram-v2-f2320105-D1I5s2af.js → classDiagram-v2-f2320105-DYPMFlcT.js} +1 -1
  31. package/assets/{clipper-BWlMmsTH.js → clipper-ByL4oIbZ.js} +1 -1
  32. package/assets/clone-keJVIubx.js +1 -0
  33. package/assets/{createText-2e5e7dd3-DuiUpOXV.js → createText-2e5e7dd3-C0UgSBh5.js} +1 -1
  34. package/assets/{createText-2e5e7dd3-D78Dn_q8.js → createText-2e5e7dd3-CoA6JNKB.js} +1 -1
  35. package/assets/{edges-e0da2a9e-Br3GgeJK.js → edges-e0da2a9e-DmyL0L_b.js} +1 -1
  36. package/assets/{edges-e0da2a9e-Dio4S9-4.js → edges-e0da2a9e-qdTreft0.js} +1 -1
  37. package/assets/{erDiagram-9861fffd-BYkBBs0M.js → erDiagram-9861fffd-Bjyf78Da.js} +1 -1
  38. package/assets/{erDiagram-9861fffd-DuZccGHy.js → erDiagram-9861fffd-DYWtVkXG.js} +1 -1
  39. package/assets/{flowDb-956e92f1-BvHxN76x.js → flowDb-956e92f1-Clfuqh48.js} +1 -1
  40. package/assets/{flowDb-956e92f1-D6cTY_st.js → flowDb-956e92f1-vnfymslR.js} +1 -1
  41. package/assets/{flowDiagram-66a62f08-Bh5LanWu.js → flowDiagram-66a62f08-54OX2XOH.js} +1 -1
  42. package/assets/{flowDiagram-66a62f08-rCNbZEwY.js → flowDiagram-66a62f08-lS8fOa4T.js} +1 -1
  43. package/assets/flowDiagram-v2-96b9c2cf-Bw7qAcFu.js +1 -0
  44. package/assets/flowDiagram-v2-96b9c2cf-DGyrUMgR.js +1 -0
  45. package/assets/{flowchart-elk-definition-4a651766-llVLlxyE.js → flowchart-elk-definition-4a651766-CXdElD40.js} +1 -1
  46. package/assets/{flowchart-elk-definition-4a651766-CIShIr5E.js → flowchart-elk-definition-4a651766-D4UghemK.js} +1 -1
  47. package/assets/{ganttDiagram-c361ad54-j2pPvoOi.js → ganttDiagram-c361ad54-Bl7rQCLW.js} +1 -1
  48. package/assets/{ganttDiagram-c361ad54-CUtUP4cJ.js → ganttDiagram-c361ad54-CwAjbWcn.js} +1 -1
  49. package/assets/{gitGraphDiagram-72cf32ee-hQmVrZTT.js → gitGraphDiagram-72cf32ee-B-ykaDuR.js} +1 -1
  50. package/assets/{gitGraphDiagram-72cf32ee-BijhDF7a.js → gitGraphDiagram-72cf32ee-ChvlaDvG.js} +1 -1
  51. package/assets/{graph-CVdXivUk.js → graph-Bq1HvHkL.js} +1 -1
  52. package/assets/{graph-iERr38Mn.js → graph-DM094zt_.js} +1 -1
  53. package/assets/{index-3862675e-BCU8UapW.js → index-3862675e-CA0xjB9W.js} +1 -1
  54. package/assets/{index-3862675e-BdD6mhWW.js → index-3862675e-DGrSmeWu.js} +1 -1
  55. package/assets/{index-CxqCKbLy.js → index-AFp_qpAI.js} +1 -1
  56. package/assets/{index-q02ppfIX.js → index-B4dceFKj.js} +1 -1
  57. package/assets/{index-BmNN2uGW.js → index-B67KSDhv.js} +1 -1
  58. package/assets/{index-ByxyNkwM.js → index-BC221_MJ.js} +1 -1
  59. package/assets/{index-nPSeKWRU.js → index-BGFWA6Zt.js} +1 -1
  60. package/assets/{index-DCjrDHEd.js → index-BH3jS3gm.js} +1 -1
  61. package/assets/{index-B-bas2QJ.js → index-BKTLxghO.js} +1 -1
  62. package/assets/{index-CW9BeyEu.js → index-Bks4xBST.js} +1 -1
  63. package/assets/{index-CvlBHvN3.js → index-BmEFRKV7.js} +1 -1
  64. package/assets/{index-DuFyvKRm.js → index-C3h-b0UN.js} +1 -1
  65. package/assets/{index-CmOEsqBQ.js → index-C5Onm0uO.js} +1 -1
  66. package/assets/{index-DYtXgeSz.js → index-CGelrSXy.js} +1 -1
  67. package/assets/{index-vw8fjMik.js → index-CKBsqCzR.js} +1 -1
  68. package/assets/{index-DjGrNkrV.js → index-CKjzms_e.js} +1 -1
  69. package/assets/{index-CxUWaNUo.js → index-CMLI8gQy.js} +1 -1
  70. package/assets/{index-CkjuY786.js → index-CVEllvWf.js} +1 -1
  71. package/assets/{index-BUZUbTWS.js → index-CW_ala_3.js} +1 -1
  72. package/assets/{index-BxdH1-er.js → index-Ci5Z3DWY.js} +1 -1
  73. package/assets/{index-BeRhCeQu.js → index-CtNjfEqK.js} +1 -1
  74. package/assets/{index-BakDREx4.js → index-CvbEsbIE.js} +1 -1
  75. package/assets/{index-BnaNWg7x.js → index-DM-iV9Y8.js} +2 -2
  76. package/assets/{index-DMfHKITi.js → index-DTqVJVfv.js} +1 -1
  77. package/assets/{index-BdSFouqR.js → index-DZtf3zC8.js} +1 -1
  78. package/assets/{index-ByECpktB.js → index-D_LadtY8.js} +1 -1
  79. package/assets/{index-UeGDfQIX.js → index-DiSWR48t.js} +1 -1
  80. package/assets/{index-D0O0qYML.js → index-DsFroXrj.js} +1 -1
  81. package/assets/{index-BN7eABQE.js → index-DxqCsnoj.js} +1 -1
  82. package/assets/{index-B_eFETCZ.js → index-Jvh12pKI.js} +1 -1
  83. package/assets/{index-CMQMxwMb.js → index-gHdnUGOu.js} +3 -3
  84. package/assets/{index-CE0NChcB.js → index-kKjFXTNL.js} +1 -1
  85. package/assets/{index-D4R9cQ86.js → index-v1v0x1ci.js} +3 -3
  86. package/assets/{infoDiagram-f8f76790-Cmv7jbWa.js → infoDiagram-f8f76790-C-wYgjah.js} +1 -1
  87. package/assets/{infoDiagram-f8f76790-D0DSz5Ue.js → infoDiagram-f8f76790-Cu-3eq4R.js} +1 -1
  88. package/assets/{journeyDiagram-49397b02-D6HU8bXU.js → journeyDiagram-49397b02-BG8aYQK6.js} +1 -1
  89. package/assets/{journeyDiagram-49397b02-Db00D03K.js → journeyDiagram-49397b02-DXPaY9vn.js} +1 -1
  90. package/assets/{layout-CPj4wl_r.js → layout-DvIBYRXu.js} +1 -1
  91. package/assets/{layout-DGJFFi9s.js → layout-SoDWNnQD.js} +1 -1
  92. package/assets/{line-D_WC7vRh.js → line-Bxc-zIvZ.js} +1 -1
  93. package/assets/{line-CpXi5g86.js → line-CFFXuH78.js} +1 -1
  94. package/assets/{linear-n85WiAhX.js → linear-BF0xIQKP.js} +1 -1
  95. package/assets/{linear-UpmxQM2f.js → linear-DQ3XkjOP.js} +1 -1
  96. package/assets/{main-DX4kRYQX.js → main-8GBlYJSO.js} +8 -8
  97. package/assets/{mermaid.core-N7WwfYcf.js → mermaid.core-BGyfnsLl.js} +3 -3
  98. package/assets/{mindmap-definition-fc14e90a-C8U6pdZ2.js → mindmap-definition-fc14e90a-CrYWIUXi.js} +1 -1
  99. package/assets/{mindmap-definition-fc14e90a-D2hbUBx2.js → mindmap-definition-fc14e90a-DOkI3ebm.js} +1 -1
  100. package/assets/{model-benchmark-launcher-BrOG9Vlm.js → model-benchmark-launcher-DtJmU6Wc.js} +1 -1
  101. package/assets/{model-benchmark-service-DDklUBjC.js → model-benchmark-service-B0QCqInK.js} +1 -1
  102. package/assets/{model-selection-BaH65gMK.js → model-selection-CbzU26xQ.js} +1 -1
  103. package/assets/{photo-wall-splitter-QuaIbsZ1.js → photo-wall-splitter-BPzdMtA1.js} +1 -1
  104. package/assets/{pieDiagram-8a3498a8-BPHw5PxR.js → pieDiagram-8a3498a8-ChLZxjKv.js} +1 -1
  105. package/assets/{pieDiagram-8a3498a8-DKV5uwrs.js → pieDiagram-8a3498a8-DAWd9-jL.js} +1 -1
  106. package/assets/{quadrantDiagram-120e2f19-pe-wI-U4.js → quadrantDiagram-120e2f19-CBBovNE2.js} +1 -1
  107. package/assets/{quadrantDiagram-120e2f19-DQdaeBYM.js → quadrantDiagram-120e2f19-DSvfgE7I.js} +1 -1
  108. package/assets/{requirementDiagram-deff3bca-DYepoptc.js → requirementDiagram-deff3bca-De51fyhT.js} +1 -1
  109. package/assets/{requirementDiagram-deff3bca-QX4OaNTO.js → requirementDiagram-deff3bca-ke6SiEw1.js} +1 -1
  110. package/assets/{sankeyDiagram-04a897e0-DJkKTFXr.js → sankeyDiagram-04a897e0-BxiqkhtK.js} +1 -1
  111. package/assets/{sankeyDiagram-04a897e0-1bYf2R8i.js → sankeyDiagram-04a897e0-Clr8_HiZ.js} +1 -1
  112. package/assets/{sequenceDiagram-704730f1-B52OA1Y3.js → sequenceDiagram-704730f1-Bc8zPHLG.js} +1 -1
  113. package/assets/{sequenceDiagram-704730f1-B4QsYTCd.js → sequenceDiagram-704730f1-BfBUJmAu.js} +1 -1
  114. package/assets/{settings-dialog-Bueh6yYA.js → settings-dialog-C9BMj8Zj.js} +1 -1
  115. package/assets/{skill-dsl-parser-CPpdtdC1.js → skill-dsl-parser-BxkJ9Ixc.js} +1 -1
  116. package/assets/{stateDiagram-587899a1-D221rMST.js → stateDiagram-587899a1-DAil8S_m.js} +1 -1
  117. package/assets/{stateDiagram-587899a1-X7bhoHKe.js → stateDiagram-587899a1-Vop8VRn5.js} +1 -1
  118. package/assets/{stateDiagram-v2-d93cdb3a-D9VdRPIN.js → stateDiagram-v2-d93cdb3a-8b1lkei5.js} +1 -1
  119. package/assets/{stateDiagram-v2-d93cdb3a-CGMASaM9.js → stateDiagram-v2-d93cdb3a-BHm8pPuv.js} +1 -1
  120. package/assets/{styles-6aaf32cf-D_xcN1dm.js → styles-6aaf32cf-BlD8JxQr.js} +1 -1
  121. package/assets/{styles-6aaf32cf-DHTzglnJ.js → styles-6aaf32cf-C4CEUYqK.js} +1 -1
  122. package/assets/{styles-9a916d00-w5Yn3LRO.js → styles-9a916d00-C6tkW5rH.js} +1 -1
  123. package/assets/{styles-9a916d00-BVoYXPeR.js → styles-9a916d00-Oss0YMv5.js} +1 -1
  124. package/assets/{styles-c10674c1-xX_gtHzZ.js → styles-c10674c1-D4YQTLGD.js} +1 -1
  125. package/assets/{styles-c10674c1-C3cgfc7I.js → styles-c10674c1-D6N_fge5.js} +1 -1
  126. package/assets/{svgDrawCommon-08f97a94-DFof-iml.js → svgDrawCommon-08f97a94-BOSx1sQS.js} +1 -1
  127. package/assets/{svgDrawCommon-08f97a94-DxU2UGYh.js → svgDrawCommon-08f97a94-RZvmFGZL.js} +1 -1
  128. package/assets/{timeline-definition-85554ec2-CzV_JohE.js → timeline-definition-85554ec2-BL5y0l6c.js} +1 -1
  129. package/assets/{timeline-definition-85554ec2-FPml3o0r.js → timeline-definition-85554ec2-BY6Jx-ZP.js} +1 -1
  130. package/assets/{tool-windows-hjm6YiPY.js → tool-windows-C4D0lII2.js} +137 -137
  131. package/assets/{ttd-dialog-CqISZ7cy.js → ttd-dialog-qD0QkDID.js} +4 -4
  132. package/assets/{use-runtime-models-C0uyCfar.js → use-runtime-models-BLwgp0M1.js} +1 -1
  133. package/assets/{useCharacters-BGdX9007.js → useCharacters-945b6dqW.js} +1 -1
  134. package/assets/{useWorkflowSubmission-BmFQdWt3.js → useWorkflowSubmission-Z0u0KCNN.js} +2 -2
  135. package/assets/{video-analyze-DszumYAr.js → video-analyze-Co9na7Gr.js} +1 -1
  136. package/assets/{video-generation-DEL-kJgF.js → video-generation-x2UMMPYg.js} +1 -1
  137. package/assets/{video-recovery-service-C9y_bfU1.js → video-recovery-service-BsV5nlEP.js} +1 -1
  138. package/assets/{workflow-generation-utils-Da12qXTb.js → workflow-generation-utils-CZULSJWQ.js} +2 -2
  139. package/assets/{workflow-submission-service-BuFuRV_m.js → workflow-submission-service-C-eCWm_8.js} +1 -1
  140. package/assets/{xychartDiagram-e933f94c-C41tCiSk.js → xychartDiagram-e933f94c-CNjZprqQ.js} +1 -1
  141. package/assets/{xychartDiagram-e933f94c-HanO46iU.js → xychartDiagram-e933f94c-DjIBec-i.js} +1 -1
  142. package/changelog.json +16 -0
  143. package/idle-prefetch-manifest.json +6 -6
  144. package/manifest.json +3 -3
  145. package/package.json +1 -1
  146. package/precache-manifest.json +304 -304
  147. package/sw.js +5 -5
  148. package/version.json +7 -3
  149. package/assets/channel-B5QZCgOy.js +0 -1
  150. package/assets/channel-CU3dhzIS.js +0 -1
  151. package/assets/clone-BAOxFbud.js +0 -1
  152. package/assets/flowDiagram-v2-96b9c2cf-BEdEe3Ip.js +0 -1
  153. package/assets/flowDiagram-v2-96b9c2cf-CVItVSoD.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tool-windows-Cos6lOhr.css","./MediaLibrarySidebar-CNCXXhfY.css"])))=>i.map(i=>d[i]);
2
- var Rx=n=>{throw TypeError(n)};var k0=(n,e,t)=>e.has(n)||Rx("Cannot "+t);var C=(n,e,t)=>(k0(n,e,"read from private field"),t?t.call(n):e.get(n)),U=(n,e,t)=>e.has(n)?Rx("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(k0(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Td=(n,e,t)=>(k0(n,e,"access private method"),t);import{_ as I,lW as hg,lX as ow,lY as El,lZ as Or,l_ as lw,l$ as vN,m0 as Nx,m1 as xN,r as se,aI as IT,as as It,y as ke,m2 as CN,E as DT,m3 as RT,m4 as NT,h8 as X1,ka as SN,m5 as Q1,m6 as aw,m7 as MN,m8 as TN,m9 as AN,ma as _N,hM as EN,bx as ON}from"./tool-windows-hjm6YiPY.js";import LT from"./katex-Cu_Erd72.js";import{c as gm,t as PT,d as IN,u as ey,r as ty,a as oc,b as cw,n as Kf,e as uw,f as Eh,m as ai,g as DN,h as RN,i as yi,s as v0,j as NN,k as bi,l as ta,o as LN}from"./index-q02ppfIX.js";/* empty css */var jn=(n=>(n.docTypeError="docTypeError",n.contextNotFound="contextNotFound",n.timerNotFound="timerNotFound",n.ctxCallOutOfScope="ctxCallOutOfScope",n.createNodeInParserFail="createNodeInParserFail",n.stackOverFlow="stackOverFlow",n.parserMatchError="parserMatchError",n.serializerMatchError="serializerMatchError",n.getAtomFromSchemaFail="getAtomFromSchemaFail",n.expectDomTypeError="expectDomTypeError",n.callCommandBeforeEditorView="callCommandBeforeEditorView",n.missingRootElement="missingRootElement",n.missingNodeInSchema="missingNodeInSchema",n.missingMarkInSchema="missingMarkInSchema",n.ctxNotBind="ctxNotBind",n.missingYjsDoc="missingYjsDoc",n))(jn||{});class ci extends Error{constructor(e,t){super(t),this.name="MilkdownError",this.code=e}}const PN=(n,e)=>typeof e=="function"?"[Function]":e,fg=n=>JSON.stringify(n,PN);function BN(n){return new ci(jn.docTypeError,`Doc type error, unsupported type: ${fg(n)}`)}function FN(n){return new ci(jn.contextNotFound,`Context "${n}" not found, do you forget to inject it?`)}function HN(n){return new ci(jn.timerNotFound,`Timer "${n}" not found, do you forget to record it?`)}function dg(){return new ci(jn.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function $N(n,e,t){const r=`Cannot create node for ${"name"in n?n.name:n}`,s=u=>{if(u==null)return"null";if(Array.isArray(u))return`[${u.map(s).join(", ")}]`;if(typeof u=="object")return"toJSON"in u&&typeof u.toJSON=="function"?JSON.stringify(u.toJSON()):"spec"in u?JSON.stringify(u.spec):JSON.stringify(u);if(typeof u=="string"||typeof u=="number"||typeof u=="boolean")return JSON.stringify(u);if(typeof u=="function")return`[Function: ${u.name||"anonymous"}]`;try{return String(u)}catch{return"[Unserializable]"}},o=["[Description]",r],l=["[Attributes]",e],a=["[Content]",(t??[]).map(u=>u?typeof u=="object"&&"type"in u?`${u}`:s(u):"null")],c=[o,l,a].reduce((u,[h,f])=>{const d=`${h}: ${s(f)}.`;return u.concat(d)},[]);return new ci(jn.createNodeInParserFail,c.join(`
2
+ var Rx=n=>{throw TypeError(n)};var k0=(n,e,t)=>e.has(n)||Rx("Cannot "+t);var C=(n,e,t)=>(k0(n,e,"read from private field"),t?t.call(n):e.get(n)),U=(n,e,t)=>e.has(n)?Rx("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(k0(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Td=(n,e,t)=>(k0(n,e,"access private method"),t);import{_ as I,lW as hg,lX as ow,lY as El,lZ as Or,l_ as lw,l$ as vN,m0 as Nx,m1 as xN,r as se,aI as IT,as as It,y as ke,m2 as CN,E as DT,m3 as RT,m4 as NT,h8 as X1,ka as SN,m5 as Q1,m6 as aw,m7 as MN,m8 as TN,m9 as AN,ma as _N,hM as EN,bx as ON}from"./tool-windows-C4D0lII2.js";import LT from"./katex-Cu_Erd72.js";import{c as gm,t as PT,d as IN,u as ey,r as ty,a as oc,b as cw,n as Kf,e as uw,f as Eh,m as ai,g as DN,h as RN,i as yi,s as v0,j as NN,k as bi,l as ta,o as LN}from"./index-B4dceFKj.js";/* empty css */var jn=(n=>(n.docTypeError="docTypeError",n.contextNotFound="contextNotFound",n.timerNotFound="timerNotFound",n.ctxCallOutOfScope="ctxCallOutOfScope",n.createNodeInParserFail="createNodeInParserFail",n.stackOverFlow="stackOverFlow",n.parserMatchError="parserMatchError",n.serializerMatchError="serializerMatchError",n.getAtomFromSchemaFail="getAtomFromSchemaFail",n.expectDomTypeError="expectDomTypeError",n.callCommandBeforeEditorView="callCommandBeforeEditorView",n.missingRootElement="missingRootElement",n.missingNodeInSchema="missingNodeInSchema",n.missingMarkInSchema="missingMarkInSchema",n.ctxNotBind="ctxNotBind",n.missingYjsDoc="missingYjsDoc",n))(jn||{});class ci extends Error{constructor(e,t){super(t),this.name="MilkdownError",this.code=e}}const PN=(n,e)=>typeof e=="function"?"[Function]":e,fg=n=>JSON.stringify(n,PN);function BN(n){return new ci(jn.docTypeError,`Doc type error, unsupported type: ${fg(n)}`)}function FN(n){return new ci(jn.contextNotFound,`Context "${n}" not found, do you forget to inject it?`)}function HN(n){return new ci(jn.timerNotFound,`Timer "${n}" not found, do you forget to record it?`)}function dg(){return new ci(jn.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function $N(n,e,t){const r=`Cannot create node for ${"name"in n?n.name:n}`,s=u=>{if(u==null)return"null";if(Array.isArray(u))return`[${u.map(s).join(", ")}]`;if(typeof u=="object")return"toJSON"in u&&typeof u.toJSON=="function"?JSON.stringify(u.toJSON()):"spec"in u?JSON.stringify(u.spec):JSON.stringify(u);if(typeof u=="string"||typeof u=="number"||typeof u=="boolean")return JSON.stringify(u);if(typeof u=="function")return`[Function: ${u.name||"anonymous"}]`;try{return String(u)}catch{return"[Unserializable]"}},o=["[Description]",r],l=["[Attributes]",e],a=["[Content]",(t??[]).map(u=>u?typeof u=="object"&&"type"in u?`${u}`:s(u):"null")],c=[o,l,a].reduce((u,[h,f])=>{const d=`${h}: ${s(f)}.`;return u.concat(d)},[]);return new ci(jn.createNodeInParserFail,c.join(`
3
3
  `))}function BT(){return new ci(jn.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function VN(n){return new ci(jn.parserMatchError,`Cannot match target parser for node: ${fg(n)}.`)}function zN(n){return new ci(jn.serializerMatchError,`Cannot match target serializer for node: ${fg(n)}.`)}function WN(n,e){return new ci(jn.getAtomFromSchemaFail,`Cannot get ${n}: ${e} from schema.`)}function Yi(n){return new ci(jn.expectDomTypeError,`Expect to be a dom, but get: ${fg(n)}.`)}function x0(){return new ci(jn.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function qN(n){return new ci(jn.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${n}" in schema.`)}function jN(n){return new ci(jn.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${n}" in schema.`)}class FT{constructor(){this.sliceMap=new Map,this.get=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(i=>i.type.name===e):this.sliceMap.get(e.id);if(!t){const i=typeof e=="string"?e:e.name;throw FN(i)}return t},this.remove=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(i=>i.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}}var Fi,Xr,Da,OT;let UN=(OT=class{constructor(e,t,i){U(this,Fi);U(this,Xr);U(this,Da);R(this,Fi,[]),R(this,Da,()=>{C(this,Fi).forEach(r=>r(C(this,Xr)))}),this.set=r=>{R(this,Xr,r),C(this,Da).call(this)},this.get=()=>C(this,Xr),this.update=r=>{R(this,Xr,r(C(this,Xr))),C(this,Da).call(this)},this.type=i,R(this,Xr,t),e.set(i.id,this)}on(e){return C(this,Fi).push(e),()=>{R(this,Fi,C(this,Fi).filter(t=>t!==e))}}once(e){const t=this.on(i=>{e(i),t()});return t}off(e){R(this,Fi,C(this,Fi).filter(t=>t!==e))}offAll(){R(this,Fi,[])}},Fi=new WeakMap,Xr=new WeakMap,Da=new WeakMap,OT);class KN{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw dg()}}create(e,t=this._defaultValue){return new UN(e,t,this)}}const $e=(n,e)=>new KN(n,e);var wf,kf,vf,sl,Ra,Gs,Na,La,Pa;class GN{constructor(e,t,i){U(this,wf);U(this,kf);U(this,vf);U(this,sl);U(this,Ra);U(this,Gs);U(this,Na);U(this,La);U(this,Pa);R(this,sl,new Set),R(this,Ra,new Set),R(this,Gs,new Map),R(this,Na,new Map),this.read=()=>({metadata:C(this,wf),injectedSlices:[...C(this,sl)].map(r=>({name:typeof r=="string"?r:r.name,value:C(this,La).call(this,r)})),consumedSlices:[...C(this,Ra)].map(r=>({name:typeof r=="string"?r:r.name,value:C(this,La).call(this,r)})),recordedTimers:[...C(this,Gs)].map(([r,{duration:s}])=>({name:r.name,duration:s,status:C(this,Pa).call(this,r)})),waitTimers:[...C(this,Na)].map(([r,{duration:s}])=>({name:r.name,duration:s,status:C(this,Pa).call(this,r)}))}),this.onRecord=r=>{C(this,Gs).set(r,{start:Date.now(),duration:0})},this.onClear=r=>{C(this,Gs).delete(r)},this.onDone=r=>{const s=C(this,Gs).get(r);s&&(s.duration=Date.now()-s.start)},this.onWait=(r,s)=>{const o=Date.now();s.finally(()=>{C(this,Na).set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{C(this,sl).add(r)},this.onRemove=r=>{C(this,sl).delete(r)},this.onUse=r=>{C(this,Ra).add(r)},R(this,La,r=>C(this,kf).get(r).get()),R(this,Pa,r=>C(this,vf).get(r).status),R(this,kf,e),R(this,vf,t),R(this,wf,i)}}wf=new WeakMap,kf=new WeakMap,vf=new WeakMap,sl=new WeakMap,Ra=new WeakMap,Gs=new WeakMap,Na=new WeakMap,La=new WeakMap,Pa=new WeakMap;var Qr,es,xf,di;const Sx=class Sx{constructor(e,t,i){U(this,Qr);U(this,es);U(this,xf);U(this,di);this.produce=r=>r&&Object.keys(r).length?new Sx(C(this,Qr),C(this,es),{...r}):this,this.inject=(r,s)=>{var l;const o=r.create(C(this,Qr).sliceMap);return s!=null&&o.set(s),(l=C(this,di))==null||l.onInject(r),this},this.remove=r=>{var s;return C(this,Qr).remove(r),(s=C(this,di))==null||s.onRemove(r),this},this.record=r=>{var s;return r.create(C(this,es).store),(s=C(this,di))==null||s.onRecord(r),this},this.clearTimer=r=>{var s;return C(this,es).remove(r),(s=C(this,di))==null||s.onClear(r),this},this.isInjected=r=>C(this,Qr).has(r),this.isRecorded=r=>C(this,es).has(r),this.use=r=>{var s;return(s=C(this,di))==null||s.onUse(r),C(this,Qr).get(r)},this.get=r=>this.use(r).get(),this.set=(r,s)=>this.use(r).set(s),this.update=(r,s)=>this.use(r).update(s),this.timer=r=>C(this,es).get(r),this.done=r=>{var s;this.timer(r).done(),(s=C(this,di))==null||s.onDone(r)},this.wait=r=>{var o;const s=this.timer(r).start();return(o=C(this,di))==null||o.onWait(r,s),s},this.waitTimers=async r=>{await Promise.all(this.get(r).map(s=>this.wait(s)))},R(this,Qr,e),R(this,es,t),R(this,xf,i),i&&R(this,di,new GN(e,t,i))}get meta(){return C(this,xf)}get inspector(){return C(this,di)}};Qr=new WeakMap,es=new WeakMap,xf=new WeakMap,di=new WeakMap;let ny=Sx;class JN{constructor(){this.store=new Map,this.get=e=>{const t=this.store.get(e.id);if(!t)throw HN(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}}var Ba,Js,Fa,ts,Ha,Cf;class YN{constructor(e,t){U(this,Ba);U(this,Js);U(this,Fa);U(this,ts);U(this,Ha);U(this,Cf);R(this,Ba,null),R(this,Js,null),R(this,ts,"pending"),this.start=()=>(C(this,Ba)??R(this,Ba,new Promise((i,r)=>{R(this,Js,s=>{s instanceof CustomEvent&&s.detail.id===C(this,Fa)&&(R(this,ts,"resolved"),C(this,Ha).call(this),s.stopImmediatePropagation(),i())}),C(this,Cf).call(this,()=>{C(this,ts)==="pending"&&R(this,ts,"rejected"),C(this,Ha).call(this),r(new Error(`Timing ${this.type.name} timeout.`))}),R(this,ts,"pending"),addEventListener(this.type.name,C(this,Js))})),C(this,Ba)),this.done=()=>{const i=new CustomEvent(this.type.name,{detail:{id:C(this,Fa)}});dispatchEvent(i)},R(this,Ha,()=>{C(this,Js)&&removeEventListener(this.type.name,C(this,Js))}),R(this,Cf,i=>{setTimeout(()=>{i()},this.type.timeout)}),R(this,Fa,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return C(this,ts)}}Ba=new WeakMap,Js=new WeakMap,Fa=new WeakMap,ts=new WeakMap,Ha=new WeakMap,Cf=new WeakMap;class ZN{constructor(e,t=3e3){this.create=i=>new YN(i,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}}const Nr=(n,e=3e3)=>new ZN(n,e);function Jt(n){this.content=n}Jt.prototype={constructor:Jt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,r=i.find(n),s=i.content.slice();return r==-1?s.push(t||n,e):(s[r+1]=e,t&&(s[r]=t)),new Jt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Jt(t)},addToStart:function(n,e){return new Jt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Jt(t)},addBefore:function(n,e,t){var i=this.remove(e),r=i.content.slice(),s=i.find(n);return r.splice(s==-1?r.length:s,0,e,t),new Jt(r)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Jt.from(n),n.size?new Jt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Jt.from(n),n.size?new Jt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Jt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Jt.from=function(n){if(n instanceof Jt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Jt(e)};function HT(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let r=n.child(i),s=e.child(i);if(r==s){t+=r.nodeSize;continue}if(!r.sameMarkup(s))return t;if(r.isText&&r.text!=s.text){for(let o=0;r.text[o]==s.text[o];o++)t++;return t}if(r.content.size||s.content.size){let o=HT(r.content,s.content,t+1);if(o!=null)return o}t+=r.nodeSize}}function $T(n,e,t,i){for(let r=n.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:t,b:i};let o=n.child(--r),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,i-=a;continue}if(!o.sameMarkup(l))return{a:t,b:i};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,i--;return{a:t,b:i}}if(o.content.size||l.content.size){let c=$T(o.content,l.content,t-1,i-1);if(c)return c}t-=a,i-=a}}let G=class vn{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,r=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&i(a,r+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),i,r+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,r){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?r?typeof r=="function"?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&i&&(o?o=!1:s+=i),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(i)&&(r[r.length-1]=t.withText(t.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new vn(r,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],r=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),i.push(l),r+=l.nodeSize),o=a}return new vn(i,r)}cutByIndex(e,t){return e==t?vn.empty:e==0&&t==this.content.length?this:new vn(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let r=this.content.slice(),s=this.size+t.nodeSize-i.nodeSize;return r[e]=t,new vn(r,s)}addToStart(e){return new vn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new vn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let r=this.content[t];e(r,i,t),i+=r.nodeSize}}findDiffStart(e,t=0){return HT(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return $T(this,e,t,i)}findIndex(e){if(e==0)return Ad(0,e);if(e==this.size)return Ad(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let r=this.child(t),s=i+r.nodeSize;if(s>=e)return s==e?Ad(t+1,s):Ad(t,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return vn.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new vn(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return vn.empty;let t,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(t||(t=e.slice(0,r)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new vn(t||e,i)}static from(e){if(!e)return vn.empty;if(e instanceof vn)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new vn([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};G.empty=new G([],0);const C0={index:0,offset:0};function Ad(n,e){return C0.index=n,C0.offset=e,C0}function ym(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!ym(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!ym(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}class Pe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),i=!0),t&&t.push(s)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ym(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=i.create(t.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Pe.none;if(e instanceof Pe)return[e];let t=e.slice();return t.sort((i,r)=>i.type.rank-r.type.rank),t}}Pe.none=[];class bm extends Error{}class X{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=zT(this.content,e+this.openStart,t);return i&&new X(i,this.openStart,this.openEnd)}removeBetween(e,t){return new X(VT(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return X.empty;let i=t.openStart||0,r=t.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(G.fromJSON(e,t.content),i,r)}static maxOpen(e,t=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)r++;return new X(e,i,r)}}X.empty=new X(G.empty,0,0);function VT(n,e,t){let{index:i,offset:r}=n.findIndex(e),s=n.maybeChild(i),{index:o,offset:l}=n.findIndex(t);if(r==e||s.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(i,s.copy(VT(s.content,e-r-1,t-r-1)))}function zT(n,e,t,i){let{index:r,offset:s}=n.findIndex(e),o=n.maybeChild(r);if(s==e||o.isText)return i&&!i.canReplace(r,r,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=zT(o.content,e-s-1,t,o);return l&&n.replaceChild(r,o.copy(l))}function XN(n,e,t){if(t.openStart>n.depth)throw new bm("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new bm("Inconsistent open depths");return WT(n,e,t,0)}function WT(n,e,t,i){let r=n.index(i),s=n.node(i);if(r==e.index(i)&&i<n.depth-t.openStart){let o=WT(n,e,t,i+1);return s.copy(s.content.replaceChild(r,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let o=n.parent,l=o.content;return bl(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=QN(t,n);return bl(s,jT(n,o,l,e,i))}else return bl(s,wm(n,e,i))}function qT(n,e){if(!e.type.compatibleContent(n.type))throw new bm("Cannot join "+e.type.name+" onto "+n.type.name)}function iy(n,e,t){let i=n.node(t);return qT(i,e.node(t)),i}function yl(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function eh(n,e,t,i){let r=(e||n).node(t),s=0,o=e?e.index(t):r.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(yl(n.nodeAfter,i),s++));for(let l=s;l<o;l++)yl(r.child(l),i);e&&e.depth==t&&e.textOffset&&yl(e.nodeBefore,i)}function bl(n,e){return n.type.checkContent(e),n.copy(e)}function jT(n,e,t,i,r){let s=n.depth>r&&iy(n,e,r+1),o=i.depth>r&&iy(t,i,r+1),l=[];return eh(null,n,r,l),s&&o&&e.index(r)==t.index(r)?(qT(s,o),yl(bl(s,jT(n,e,t,i,r+1)),l)):(s&&yl(bl(s,wm(n,e,r+1)),l),eh(e,t,r,l),o&&yl(bl(o,wm(t,i,r+1)),l)),eh(i,null,r,l),new G(l)}function wm(n,e,t){let i=[];if(eh(null,n,t,i),n.depth>t){let r=iy(n,e,t+1);yl(bl(r,wm(n,e,t+1)),i)}return eh(e,null,t,i),new G(i)}function QN(n,e){let t=e.depth-n.openStart,r=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)r=e.node(s).copy(G.from(r));return{start:r.resolveNoCache(n.openStart+t),end:r.resolveNoCache(r.content.size-n.openEnd-t)}}class Oh{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=e.child(t);return i?e.child(t).cut(i):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pe.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),r=e.maybeChild(t);if(!i){let l=i;i=r,r=l}let s=i.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!r||!s[o].isInSet(r.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new UT(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],r=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(i.push(o,l,r+a),!c||(o=o.child(l),o.isText))break;s=c-1,r+=a+1}return new Oh(t,i,s)}static resolveCached(e,t){let i=Lx.get(e);if(i)for(let s=0;s<i.elts.length;s++){let o=i.elts[s];if(o.pos==t)return o}else Lx.set(e,i=new e3);let r=i.elts[i.i]=Oh.resolve(e,t);return i.i=(i.i+1)%t3,r}}class e3{constructor(){this.elts=[],this.i=0}}const t3=12,Lx=new WeakMap;class UT{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const n3=Object.create(null);class Mi{constructor(e,t,i,r=Pe.none){this.type=e,this.attrs=t,this.marks=r,this.content=i||G.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,r=0){this.content.nodesBetween(e,t,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,r){return this.content.textBetween(e,t,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&ym(this.attrs,t||e.defaultAttrs||n3)&&Pe.sameSet(this.marks,i||Pe.none)}copy(e=null){return e==this.content?this:new Mi(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mi(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return X.empty;let r=this.resolve(e),s=this.resolve(t),o=i?0:r.sharedDepth(t),l=r.start(o),c=r.node(o).content.cut(r.pos-l,s.pos-l);return new X(c,r.depth-o,s.depth-o)}replace(e,t,i){return XN(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let r=this.content.child(t-1);return{node:r,index:t-1,offset:i-r.nodeSize}}resolve(e){return Oh.resolveCached(this,e)}resolveNoCache(e){return Oh.resolve(this,e)}rangeHasMark(e,t,i){let r=!1;return t>e&&this.nodesBetween(e,t,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),KT(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=G.empty,r=0,s=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,r,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=r;a<s;a++)if(!this.type.allowsMarks(i.child(a).marks))return!1;return!0}canReplaceWith(e,t,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pe.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!Pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let r=G.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,r,i);return s.type.checkAttrs(s.attrs),s}}Mi.prototype.text=void 0;let i3=class ry extends Mi{constructor(e,t,i,r){if(super(e,t,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):KT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ry(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ry(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function KT(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ol{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new r3(e,t);if(i.next==null)return Ol.empty;let r=GT(i);i.next&&i.err("Unexpected trailing text");let s=h3(u3(r));return f3(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let r=this;for(let s=t;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let r=[this];function s(o,l){let a=o.matchFragment(e,i);if(a&&(!t||a.validEnd))return G.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&r.indexOf(h)==-1){r.push(h);let f=s(h,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let o=[];for(let l=r;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!r.type||a.validEnd)&&(i.push({match:l.contentMatch,type:l,via:r}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&t(i.next[r].next)}return t(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)s+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return s}).join(`
4
4
  `)}}Ol.empty=new Ol(!0);class r3{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function GT(n){let e=[];do e.push(s3(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function s3(n){let e=[];do e.push(o3(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function o3(n){let e=c3(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=l3(n,e);else break;return e}function Px(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function l3(n,e){let t=Px(n),i=t;return n.eat(",")&&(n.next!="}"?i=Px(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function a3(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let r=[];for(let s in t){let o=t[s];o.isInGroup(e)&&r.push(o)}return r.length==0&&n.err("No node type or group '"+e+"' found"),r}function c3(n){if(n.eat("(")){let e=GT(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=a3(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function u3(n){let e=[[]];return r(s(n,0),t()),e;function t(){return e.push([])-1}function i(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function r(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;r(c,l=t())}else if(o.type=="star"){let a=t();return i(l,a),r(s(o.expr,a),a),[i(a)]}else if(o.type=="plus"){let a=t();return r(s(o.expr,l),a),r(s(o.expr,a),a),[i(a)]}else{if(o.type=="opt")return[i(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();r(s(o.expr,a),u),a=u}if(o.max==-1)r(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();i(a,u),r(s(o.expr,a),u),a=u}return[i(a)]}else{if(o.type=="name")return[i(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function JT(n,e){return e-n}function Bx(n,e){let t=[];return i(e),t.sort(JT);function i(r){let s=n[r];if(s.length==1&&!s[0].term)return i(s[0].to);t.push(r);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&t.indexOf(a)==-1&&i(a)}}}function h3(n){let e=Object.create(null);return t(Bx(n,0));function t(i){let r=[];i.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<r.length;u++)r[u][0]==l&&(c=r[u][1]);Bx(n,a).forEach(u=>{c||r.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[i.join(",")]=new Ol(i.indexOf(n.length-1)>-1);for(let o=0;o<r.length;o++){let l=r[o][1].sort(JT);s.next.push({type:r[o][0],next:e[l.join(",")]||t(l)})}return s}}function f3(n,e){for(let t=0,i=[n];t<i.length;t++){let r=i[t],s=!r.validEnd,o=[];for(let l=0;l<r.next.length;l++){let{type:a,next:c}=r.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),i.indexOf(c)==-1&&i.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function YT(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function ZT(n,e){let t=Object.create(null);for(let i in n){let r=e&&e[i];if(r===void 0){let s=n[i];if(s.hasDefault)r=s.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=r}return t}function XT(n,e,t,i){for(let r in e)if(!(r in n))throw new RangeError(`Unsupported attribute ${r} for ${t} of type ${r}`);for(let r in n){let s=n[r];s.validate&&s.validate(e[r])}}function QT(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new p3(n,i,e[i]);return t}let km=class eA{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=QT(e,i.attrs),this.defaultAttrs=YT(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ol.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ZT(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mi(this,this.computeAttrs(e),G.from(t),Pe.setFrom(i))}createChecked(e=null,t,i){return t=G.from(t),this.checkContent(t),new Mi(this,this.computeAttrs(e),t,Pe.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=G.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let r=this.contentMatch.matchFragment(t),s=r&&r.fillBefore(G.empty,!0);return s?new Mi(this,e,t.append(s),Pe.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){XT(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:Pe.none:e}static compile(e,t){let i=Object.create(null);e.forEach((s,o)=>i[s]=new eA(s,t,o));let r=t.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function d3(n,e,t){let i=t.split("|");return r=>{let s=r===null?"null":typeof r;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${s}`)}}class p3{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?d3(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class pg{constructor(e,t,i,r){this.name=e,this.rank=t,this.schema=i,this.spec=r,this.attrs=QT(e,r.attrs),this.excluded=null;let s=YT(this.attrs);this.instance=s?new Pe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Pe(this,ZT(this.attrs,e))}static compile(e,t){let i=Object.create(null),r=0;return e.forEach((s,o)=>i[s]=new pg(s,r++,t,o)),i}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){XT(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class tA{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=Jt.from(e.nodes),t.marks=Jt.from(e.marks||{}),this.nodes=km.compile(this.spec.nodes,this),this.marks=pg.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let s=this.nodes[r],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[o]||(i[o]=Ol.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Fx(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let r in this.marks){let s=this.marks[r],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Fx(this,o.split(" "))}this.nodeFromJSON=r=>Mi.fromJSON(this,r),this.markFromJSON=r=>Pe.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof km){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,i,r)}text(e,t){let i=this.nodes.text;return new i3(i,i.defaultAttrs,e,Pe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Fx(n,e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],s=n.marks[r],o=s;if(s)t.push(s);else for(let l in n.marks){let a=n.marks[l];(r=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(r)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function m3(n){return n.tag!=null}function g3(n){return n.style!=null}class ao{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(r=>{if(m3(r))this.tags.push(r);else if(g3(r)){let s=/[^=]*/.exec(r.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let s=e.nodes[r.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let i=new $x(this,t,!1);return i.addAll(e,Pe.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new $x(this,t,!0);return i.addAll(e,Pe.none,t.from,t.to),X.maxOpen(i.finish())}matchTag(e,t,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let s=this.tags[r];if(w3(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,i,r){for(let s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!i.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function i(r){let s=r.priority==null?50:r.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,r)}for(let r in e.marks){let s=e.marks[r].spec.parseDOM;s&&s.forEach(o=>{i(o=Vx(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in e.nodes){let s=e.nodes[r].spec.parseDOM;s&&s.forEach(o=>{i(o=Vx(o)),o.node||o.ignore||o.mark||(o.node=r)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ao(e,ao.schemaRules(e)))}}const nA={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},y3={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},iA={ol:!0,ul:!0},Ih=1,sy=2,th=4;function Hx(n,e,t){return e!=null?(e?Ih:0)|(e==="full"?sy:0):n&&n.whitespace=="pre"?Ih|sy:t&~th}class _d{constructor(e,t,i,r,s,o){this.type=e,this.attrs=t,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=Pe.none,this.match=s||(o&th?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(G.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ih)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-r[0].length))}}let t=G.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!nA.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}let $x=class{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=t.topNode,s,o=Hx(null,t.preserveWhitespace,0)|(i?th:0);r?s=new _d(r.type,r.attrs,Pe.none,!0,t.topMatch||r.type.contentMatch,o):i?s=new _d(null,null,Pe.none,!0,null,o):s=new _d(e.schema.topNodeType,null,Pe.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let i=e.nodeValue,r=this.top,s=r.options&sy?"full":this.localPreserveWS||(r.options&Ih)>0,{schema:o}=this.parser;if(s==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,`
5
5
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=r.content[r.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let r=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;iA.hasOwnProperty(o)&&this.parser.normalizeLists&&b3(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,i));e:if(a?a.ignore:y3.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(nA.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=a&&a.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
@@ -52,7 +52,7 @@ var Rx=n=>{throw TypeError(n)};var k0=(n,e,t)=>e.has(n)||Rx("Cannot "+t);var C=(
52
52
  `))};if((ie.mac||ie.android)&&h.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:l,to:a,insert:Ue.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);nk(e,h,P.single(this.toEditorPos(i.selectionStart,f),this.toEditorPos(i.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(pe.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:WE.of(pe.set(r))})},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:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Jh(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.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||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+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 t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class te{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 t;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:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||P7(e.parent)||document,this.viewState=new NS(e.state||qe.create(e)),e.scrollTo&&e.scrollTo.is(Ld)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ma).map(r=>new X0(r));for(let r of this.plugins)r.update(this);this.observer=new rB(this),this.inputState=new A8(this),this.inputState.ensureHandlers(this.plugins),this.docView=new kS(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Nt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(o5))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=l5(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(qe.phrases)!=this.state.facet(qe.phrases))return this.setState(s);r=Rm.create(this,s,e),r.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new Ma(d.empty?d:P.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Ld)&&(h=d.value.clip(this.state))}this.viewState.update(r,h),this.bidiCache=Bm.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Iu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Vd)!=r.state.facet(Vd)&&(this.viewState.mustMeasureContent=!0),(t||i||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(nb))try{f(r)}catch(d){Vn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!QE(this,u)&&c.force&&Sa(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 t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new NS(e),this.plugins=e.facet(ma).map(i=>new X0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new kS(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ma),i=e.state.facet(ma);if(t!=i){let r=[];for(let s of i){let o=t.indexOf(s);if(o<0)r.push(new X0(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){Vn(this.state,i,"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 t=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(TE(i))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(p){return Vn(this.state,p),HS}}),h=Rm.create(this,this.state,[]),f=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=HS)try{let p=c[d];p.write&&p.write(u[d],this)}catch(p){Vn(this.state,p)}if(f&&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,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){r=r+p,i.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(nb))l(t)}get themeClasses(){return ab+" "+(this.state.facet(lb)?h5:u5)+" "+this.state.facet(Vd)}updateAttrs(){let e=$S(this,qE,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ss)?"true":"false",class:"cm-content",style:`${ie.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),$S(this,Qw,t);let i=this.observer.ignore(()=>{let r=pS(this.contentDOM,this.contentAttrs,t),s=pS(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(te.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Iu);let e=this.state.facet(te.cspNonce);po.mount(this.root,this.styleModules.concat(nB).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 t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.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,t,i){return n1(this,e,vS(this,e,t,i))}moveByGroup(e,t){return n1(this,e,vS(this,e,t,i=>b8(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return P.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return y8(this,e,t,i)}moveVertically(e,t,i){return n1(this,e,w8(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=sb(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),sb(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[us.find(s,e-r.from,-1,t)];return Yh(i,o.dir==ct.LTR==t>0)}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($E)||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>lB)return DE(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||IE(s.isolates,i=yS(this,e))))return s.order;i||(i=yS(this,e));let r=q7(e.text,t,i);return this.bidiCache.push(new Bm(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ie.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ME(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,t={}){return Ld.of(new Ma(typeof e=="number"?P.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Ld.of(new Ma(P.cursor(i.from),"start","start",i.top-e,t,!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 Tt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Tt.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=po.newName(),r=[Vd.of(i),Iu.of(cb(`.${i}`,e))];return t&&t.dark&&r.push(lb.of(!0)),r}static baseTheme(e){return To.lowest(Iu.of(cb("."+ab,e,f5)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Lt.get(i)||Lt.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}te.styleModule=Iu;te.inputHandler=FE;te.clipboardInputFilter=Zw;te.clipboardOutputFilter=Xw;te.scrollHandler=zE;te.focusChangeEffect=HE;te.perLineTextDirection=$E;te.exceptionSink=BE;te.updateListener=nb;te.editable=ss;te.mouseSelectionStyle=PE;te.dragMovesSelection=LE;te.clickAddsSelectionRange=NE;te.decorations=_g;te.blockWrappers=jE;te.outerDecorations=ek;te.atomicRanges=td;te.bidiIsolatedRanges=UE;te.scrollMargins=KE;te.darkTheme=lb;te.cspNonce=ne.define({combine:n=>n.length?n[0]:""});te.contentAttributes=Qw;te.editorAttributes=qE;te.lineWrapping=te.contentAttributes.of({class:"cm-lineWrapping"});te.announce=De.define();const lB=4096,HS={};class Bm{constructor(e,t,i,r,s,o){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:ct.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&i.push(new Bm(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function $S(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(n):s;o&&Gw(o,t)}return t}const aB=ie.mac?"mac":ie.windows?"win":ie.linux?"linux":"key";function cB(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function zd(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const uB=To.default(te.domEventHandlers({keydown(n,e){return p5(d5(e.state),n,e,"editor")}})),Oc=ne.define({enables:uB}),VS=new WeakMap;function d5(n){let e=n.facet(Oc),t=VS.get(e);return t||VS.set(e,t=dB(e.reduce((i,r)=>i.concat(r),[]))),t}function hB(n,e,t){return p5(d5(n.state),e,n,t)}let js=null;const fB=4e3;function dB(n,e=aB){let t=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var h,f;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>cB(y,e));for(let y=1;y<p.length;y++){let b=p.slice(0,y).join(" ");r(b,!0),d[b]||(d[b]={preventDefault:!0,stopPropagation:!1,run:[w=>{let k=js={view:w,prefix:b,scope:o};return setTimeout(()=>{js==k&&(js=null)},fB),!0}]})}let m=p.join(" ");r(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(d=>h(d,ub))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let ub=null;function p5(n,e,t,i){ub=e;let r=t_(e),s=Fn(r,0),o=vr(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;js&&js.view==t&&js.scope==i&&(l=js.prefix+" ",n5.indexOf(e.keyCode)<0&&(c=!0,js=null));let h=new Set,f=g=>{if(g){for(let y of g.run)if(!h.has(y)&&(h.add(y),y(t)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},d=n[i],p,m;return d&&(f(d[l+zd(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ie.windows&&e.ctrlKey&&e.altKey)&&!(ie.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ms[e.keyCode])&&p!=r?(f(d[l+zd(p,e,!0)])||e.shiftKey&&(m=Lh[e.keyCode])!=r&&m!=p&&f(d[l+zd(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(d[l+zd(r,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),ub=null,a}class nd{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.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,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=m5(e);return[new nd(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return pB(e,t,i)}}function m5(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==ct.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function zS(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=n.posAtCoords({x:s.left+1,y:o}),a=n.posAtCoords({x:s.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function pB(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==ct.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=m5(n),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=l.right-(u?parseInt(u.paddingRight):0),d=rb(n,i,1),p=rb(n,r,-1),m=d.type==nn.Text?d:null,g=p.type==nn.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=zS(n,i,1,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=zS(n,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return b(w(t.from,t.to,m));{let v=m?w(t.from,null,m):k(d,!1),T=g?w(null,t.to,g):k(p,!0),A=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&v.bottom+n.defaultLineHeight/2<T.top?A.push(y(h,v.bottom,f,T.top)):v.bottom<T.top&&n.elementAtHeight((v.bottom+T.top)/2).type==nn.Text&&(v.bottom=T.top=(v.bottom+T.top)/2),b(v).concat(A).concat(b(T))}function y(v,T,A,F){return new nd(e,v-a.left,T-a.top,A-v,F-T)}function b({top:v,bottom:T,horizontal:A}){let F=[];for(let j=0;j<A.length;j+=2)F.push(y(A[j],v,A[j+1],T));return F}function w(v,T,A){let F=1e9,j=-1e9,_=[];function q(ge,xe,Oe,Ze,re){let ae=n.coordsAtPos(ge,ge==A.to?-2:2),Se=n.coordsAtPos(Oe,Oe==A.from?2:-2);!ae||!Se||(F=Math.min(ae.top,Se.top,F),j=Math.max(ae.bottom,Se.bottom,j),re==ct.LTR?_.push(s&&xe?h:ae.left,s&&Ze?f:Se.right):_.push(!s&&Ze?h:Se.left,!s&&xe?f:ae.right))}let B=v??A.from,me=T??A.to;for(let ge of n.visibleRanges)if(ge.to>B&&ge.from<me)for(let xe=Math.max(ge.from,B),Oe=Math.min(ge.to,me);;){let Ze=n.state.doc.lineAt(xe);for(let re of n.bidiSpans(Ze)){let ae=re.from+Ze.from,Se=re.to+Ze.from;if(ae>=Oe)break;Se>xe&&q(Math.max(ae,xe),v==null&&ae<=B,Math.min(Se,Oe),T==null&&Se>=me,re.dir)}if(xe=Ze.to+1,xe>=Oe)break}return _.length==0&&q(B,v==null,me,T==null,n.textDirection),{top:F,bottom:j,horizontal:_}}function k(v,T){let A=l.top+(T?v.top:v.bottom);return{top:A,bottom:A,horizontal:[]}}}function mB(n,e){return n.constructor==e.constructor&&n.eq(e)}class gB{constructor(e,t){this.view=e,this.layer=t,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"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet($p)!=e.state.facet($p)&&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 t=0,i=e.facet($p);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!mB(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,ie.safari&&ie.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const $p=ne.define();function g5(n){return[Tt.define(e=>new gB(e,n)),$p.of(n)]}const Xh=ne.define({combine(n){return Lr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function y5(n={}){return[Xh.of(n),yB,bB,wB,VE.of(!0)]}function b5(n){return n.startState.facet(Xh)!=n.state.facet(Xh)}const yB=g5({above:!0,markers(n){let{state:e}=n,t=e.facet(Xh),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:P.cursor(r.head,r.head>r.anchor?-1:1);for(let a of nd.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=b5(n);return t&&WS(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){WS(e.state,n)},class:"cm-cursorLayer"});function WS(n,e){e.style.animationDuration=n.facet(Xh).cursorBlinkRate+"ms"}const bB=g5({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:nd.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||b5(n)},class:"cm-selectionLayer"}),wB=To.highest(te.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),w5=De.define({map(n,e){return n==null?null:e.mapPos(n)}}),Nu=jt.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(w5)?i.value:t,n)}}),kB=Tt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Nu);t==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"),(n.startState.field(Nu)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Nu),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Nu)!=n&&this.view.dispatch({effects:w5.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function vB(){return[Nu,kB]}function qS(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),o=t,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function xB(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class CB{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(l,a,c,u)=>r(u,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,u)=>{let h=i(l,a,c);h&&u(c,c+l[0].length,h)};else if(i)this.addMatch=(l,a,c,u)=>u(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new ys,i=t.add.bind(t);for(let{from:r,to:s}of xB(e,this.maxLength))qS(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),r=Math.max(a,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let a=e.state.doc.lineAt(o),c=a.to<l?e.state.doc.lineAt(l):a,u=Math.max(s.from,a.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){u=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){h=l;break}}let f=[],d,p=(m,g,y)=>f.push(y.range(m,g));if(a==c)for(this.regexp.lastIndex=u-a.from;(d=this.regexp.exec(a.text))&&d.index<h-a.from;)this.addMatch(d,e,d.index+a.from,p);else qS(e.state.doc,this.regexp,u,h,(m,g)=>this.addMatch(g,e,m,p));t=t.update({filterFrom:u,filterTo:h,filter:(m,g)=>m<u||g>h,add:f})}}return t}}const hb=/x/.unicode!=null?"gu":"g",SB=new RegExp(`[\0-\b
53
53
  --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,hb),MB={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 s1=null;function TB(){var n;if(s1==null&&typeof document<"u"&&document.body){let e=document.body.style;s1=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return s1||!1}const Vp=ne.define({combine(n){let e=Lr(n,{render:null,specialChars:SB,addSpecialChars:null});return(e.replaceTabs=!TB())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,hb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,hb)),e}});function AB(n={}){return[Vp.of(n),_B()]}let jS=null;function _B(){return jS||(jS=Tt.fromClass(class{constructor(n){this.view=n,this.decorations=pe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Vp)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new CB({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Fn(e[0],0);if(s==9){let o=r.lineAt(i),l=t.state.tabSize,a=Ec(o.text,l,i-o.from);return pe.replace({widget:new DB((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=pe.replace({widget:new IB(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Vp);n.startState.facet(Vp)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const EB="•";function OB(n){return n>=32?EB:n==10?"␤":String.fromCharCode(9216+n)}class IB extends Qi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=OB(this.code),i=e.state.phrase("Control character")+" "+(MB[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class DB extends Qi{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 RB(){return LB}const NB=pe.line({class:"cm-activeLine"}),LB=Tt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(NB.range(r.from)),e=r.from)}return pe.set(t)}},{decorations:n=>n.decorations});class PB extends Qi{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?ph(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=Yh(t[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function RX(n){let e=Tt.fromClass(class{constructor(t){this.view=t,this.placeholder=n?pe.set([pe.widget({widget:new PB(n),side:1}).range(0)]):pe.none}get decorations(){return this.view.state.doc.length?pe.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,te.contentAttributes.of({"aria-placeholder":n})]:e}const fb=2e3;function BB(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>fb||t.off>fb||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=l&&s.push(P.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),u=jy(c.text,o,n.tabSize,!0);if(u<0)s.push(P.cursor(c.to));else{let h=jy(c.text,l,n.tabSize);s.push(P.range(c.from+u,c.from+h))}}}return s}function FB(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function US(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>fb?-1:r==i.length?FB(n,e.clientX):Ec(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function HB(n,e){let t=US(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=US(n,r);if(!l)return i;let a=BB(n.state,t,l);return a.length?o?P.create(a.concat(i.ranges)):P.create(a):i}}:null}function $B(n){let e=(t=>t.altKey&&t.button==0);return te.mouseSelectionStyle.of((t,i)=>e(i)?HB(t,i):null)}const VB={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},zB={style:"cursor: crosshair"};function WB(n={}){let[e,t]=VB[n.key||"Alt"],i=Tt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,te.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?zB:null})]}const Wd="-10000px";class k5{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(u=h)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let h=o[a]=this.tooltipViews[u];l&&(l[a]=t[u]),h.update&&h.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,c)=>t[c]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function qB(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const o1=ne.define({combine:n=>{var e,t,i;return{position:ie.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||qB}}}),KS=new WeakMap,sk=Tt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(o1);this.position=e.position,this.parent=e.parent,this.classes=n.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 k5(n,ok,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.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 n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(o1);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Wd,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(ie.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=tk(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(o1).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,h=n.pos[l],f=n.size[l];if(!h||a.clip!==!1&&(h.bottom<=Math.max(t.top,i.top)||h.top>=Math.min(t.bottom,i.bottom)||h.right<Math.max(t.left,i.left)-.1||h.left>Math.min(t.right,i.right)+.1)){u.style.top=Wd;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=f.right-f.left,g=(e=KS.get(c))!==null&&e!==void 0?e:f.bottom-f.top,y=c.offset||UB,b=this.view.textDirection==ct.LTR,w=f.width>i.right-i.left?b?i.left:i.right-f.width:b?Math.max(i.left,Math.min(h.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,h.left-m+(d?14:0)-y.x),i.right-m),k=this.above[l];!a.strictSide&&(k?h.top-g-p-y.y<i.top:h.bottom+g+p+y.y>i.bottom)&&k==i.bottom-h.bottom>h.top-i.top&&(k=this.above[l]=!k);let v=(k?h.top-i.top:i.bottom-h.bottom)-p;if(v<g&&c.resize!==!1){if(v<this.view.defaultLineHeight){u.style.top=Wd;continue}KS.set(c,g),u.style.height=(g=v)/s+"px"}else u.style.height&&(u.style.height="");let T=k?h.top-g-p-y.y:h.bottom+p+y.y,A=w+m;if(c.overlap!==!0)for(let F of o)F.left<A&&F.right>w&&F.top<T+g&&F.bottom>T&&(T=k?F.top-g-2-p:F.bottom+p+2);if(this.position=="absolute"?(u.style.top=(T-n.parent.top)/s+"px",GS(u,(w-n.parent.left)/r)):(u.style.top=T/s+"px",GS(u,w/r)),d){let F=h.left+(b?y.x:-y.x)-(w+14-7);d.style.left=F/r+"px"}c.overlap!==!0&&o.push({left:w,top:T,right:A,bottom:T+g}),u.classList.toggle("cm-tooltip-above",k),u.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(n.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 n of this.manager.tooltipViews)n.dom.style.top=Wd}},{eventObservers:{scroll(){this.maybeMeasure()}}});function GS(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const jB=te.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"}}}),UB={x:0,y:0},ok=ne.define({enables:[sk,jB]}),Fm=ne.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Dg{static create(e){return new Dg(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new k5(e,Fm,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}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 KB=ok.compute([Fm],n=>{let e=n.facet(Fm);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:Dg.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class GB{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,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(){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:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let l=e.coordsAtPos(r);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=a&&a.dir==ct.RTL?-1:1;s=t.x<l.left?-c:c}let o=this.source(e,r,s);if(o!=null&&o.then){let l=this.pending={pos:r};o.then(a=>{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Vn(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(sk),t=e?e.manager.tooltips.findIndex(i=>i.create==Dg.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;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:r,tooltip:s}=this;if(r.length&&s&&!JB(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!YB(this.view,o,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:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const qd=4;function JB(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=t-qd&&e.clientX<=i+qd&&e.clientY>=r-qd&&e.clientY<=s+qd}function YB(n,e,t,i,r,s){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=n.posAtCoords({x:i,y:r},!1);return a>=e&&a<=t}function ZB(n,e={}){let t=De.define(),i=jt.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let l of r){let a=s.changes.mapPos(l.pos,-1,en.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),l);c.pos=a,c.end!=null&&(c.end=s.changes.mapPos(c.end)),o.push(c)}}r=o}for(let o of s.effects)o.is(t)&&(r=o.value),o.is(XB)&&(r=[]);return r},provide:r=>Fm.from(r)});return{active:i,extension:[i,Tt.define(r=>new GB(r,n,i,t,e.hoverTime||300)),KB]}}function v5(n,e){let t=n.plugin(sk);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const XB=De.define(),JS=ne.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function lk(n,e){let t=n.plugin(x5),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const x5=Tt.fromClass(class{constructor(n){this.input=n.state.facet(Qh),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(JS);this.top=new jd(n,!0,e.topContainer),this.bottom=new jd(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(JS);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new jd(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new jd(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Qh);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(n.view),l.push(u)):(u=this.panels[c],u.update&&u.update(n)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>te.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class jd{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.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",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=YS(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=YS(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 YS(n){let e=n.nextSibling;return n.remove(),e}const Qh=ne.define({enables:x5});function QB(n,e){let t,i=new Promise(o=>t=o),r=o=>e6(o,e,t);n.state.field(l1,!1)?n.dispatch({effects:C5.of(r)}):n.dispatch({effects:De.appendConfig.of(l1.init(()=>[r]))});let s=S5.of(r);return{close:s,result:i.then(o=>((n.win.queueMicrotask||(a=>n.win.setTimeout(a,10)))(()=>{n.state.field(l1).indexOf(r)>-1&&n.dispatch({effects:s})}),o))}}const l1=jt.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(C5)?n=[t.value].concat(n):t.is(S5)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Qh.computeN([n],e=>e.field(n))}),C5=De.define(),S5=De.define();function e6(n,e,t){let i=e.content?e.content(n,()=>o(null)):null;if(!i){if(i=nt("form"),e.input){let l=nt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(nt("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(nt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l<r.length;l++){let a=r[l];a.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(a))}),a.addEventListener("submit",c=>{c.preventDefault(),o(a)})}let s=nt("div",i,nt("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class ws extends fo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ws.prototype.elementClass="";ws.prototype.toDOM=void 0;ws.prototype.mapMode=en.TrackBefore;ws.prototype.startSide=ws.prototype.endSide=-1;ws.prototype.point=!0;const zp=ne.define(),t6=ne.define(),n6={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},yh=ne.define();function i6(n){return[M5(),yh.of({...n6,...n})]}const ZS=ne.define({combine:n=>n.some(e=>e)});function M5(n){return[r6]}const r6=Tt.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.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=n.state.facet(yh).map(e=>new QS(n,e)),this.fixed=!n.state.facet(ZS);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),n.scrollDOM.insertBefore(this.dom,n.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(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.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(ZS)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Ve.iter(this.view.state.facet(zp),this.view.viewport.from),i=[],r=this.gutters.map(s=>new s6(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==nn.Text&&o){db(t,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==nn.Text){db(t,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(yh),t=n.state.facet(yh),i=n.docChanged||n.heightChanged||n.viewportChanged||!Ve.eq(n.startState.facet(zp),n.state.facet(zp),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new QS(this.view,s)):(this.gutters[o].update(n),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>te.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ct.LTR?{left:i,right:r}:{right:i,left:r}})});function XS(n){return Array.isArray(n)?n:[n]}function db(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class s6{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Ve.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let l=new T5(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];db(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(t6)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class QS{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=XS(t.markers(e)),t.initialSpacer&&(this.spacer=new T5(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=XS(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!Ve.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class T5{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),o6(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<t.length?t[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(a)){l=h,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let h=r.nextSibling;r.remove(),r=h}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function o6(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const l6=ne.define(),a6=ne.define(),ga=ne.define({combine(n){return Lr(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let s=i[r],o=t[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}});class a1 extends ws{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function c1(n,e){return n.state.facet(ga).formatNumber(e,n.state)}const c6=yh.compute([ga],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(l6)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new a1(c1(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(a6)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ga)!=e.state.facet(ga),initialSpacer(e){return new a1(c1(e,e2(e.state.doc.lines)))},updateSpacer(e,t){let i=c1(t.view,e2(t.view.state.doc.lines));return i==e.number?e:new a1(i)},domEventHandlers:n.facet(ga).domEventHandlers,side:"before"}));function u6(n={}){return[ga.of(n),M5(),c6]}function e2(n){let e=9;for(;e<n;)e=e*10+9;return e}const h6=new class extends ws{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},f6=zp.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(h6.range(r)))}return Ve.of(e)});function d6(){return f6}let p6=0;class gi{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=p6++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof gi&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new gi(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Hm(e);return i=>i.modified.indexOf(t)>-1?i:Hm.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let m6=0;class Hm{constructor(e){this.name=e,this.instances=[],this.id=m6++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&g6(t,l.modified));if(i)return i;let r=[],s=new gi(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=y6(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Hm.get(l,a));return s}}function g6(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function y6(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function b6(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let h=0;;){if(l=="..."&&h>0&&h+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==r.length)break;let d=r[h++];if(h==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(h)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new ef(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return A5.add(e)}const A5=new He({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new ef(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}});class ef{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}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}}ef.empty=new ef([],2,null);function _5(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function w6(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function k6(n,e,t,i=0,r=n.length){let s=new v6(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class v6{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=x6(e)||ef.empty,h=w6(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(r+=(r?" ":"")+h)),this.startSpan(Math.max(t,l),c),u.opaque)return;let f=e.tree&&e.tree.prop(He.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let b=g<f.overlay.length?f.overlay[g]:null,w=b?b.from+l:a,k=Math.max(t,y),v=Math.min(i,w);if(k<v&&m)for(;e.from<v&&(this.highlightRange(e,k,v,r,s),this.startSpan(Math.min(v,e.to),c),!(e.to>=w||!e.nextSibling())););if(!b||w>i)break;y=b.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,b.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function x6(n){let e=n.type.prop(A5);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Q=gi.define,Ud=Q(),Bs=Q(),t2=Q(Bs),n2=Q(Bs),Fs=Q(),Kd=Q(Fs),u1=Q(Fs),dr=Q(),Ro=Q(dr),cr=Q(),ur=Q(),pb=Q(),su=Q(pb),Gd=Q(),N={comment:Ud,lineComment:Q(Ud),blockComment:Q(Ud),docComment:Q(Ud),name:Bs,variableName:Q(Bs),typeName:t2,tagName:Q(t2),propertyName:n2,attributeName:Q(n2),className:Q(Bs),labelName:Q(Bs),namespace:Q(Bs),macroName:Q(Bs),literal:Fs,string:Kd,docString:Q(Kd),character:Q(Kd),attributeValue:Q(Kd),number:u1,integer:Q(u1),float:Q(u1),bool:Q(Fs),regexp:Q(Fs),escape:Q(Fs),color:Q(Fs),url:Q(Fs),keyword:cr,self:Q(cr),null:Q(cr),atom:Q(cr),unit:Q(cr),modifier:Q(cr),operatorKeyword:Q(cr),controlKeyword:Q(cr),definitionKeyword:Q(cr),moduleKeyword:Q(cr),operator:ur,derefOperator:Q(ur),arithmeticOperator:Q(ur),logicOperator:Q(ur),bitwiseOperator:Q(ur),compareOperator:Q(ur),updateOperator:Q(ur),definitionOperator:Q(ur),typeOperator:Q(ur),controlOperator:Q(ur),punctuation:pb,separator:Q(pb),bracket:su,angleBracket:Q(su),squareBracket:Q(su),paren:Q(su),brace:Q(su),content:dr,heading:Ro,heading1:Q(Ro),heading2:Q(Ro),heading3:Q(Ro),heading4:Q(Ro),heading5:Q(Ro),heading6:Q(Ro),contentSeparator:Q(dr),list:Q(dr),quote:Q(dr),emphasis:Q(dr),strong:Q(dr),link:Q(dr),monospace:Q(dr),strikethrough:Q(dr),inserted:Q(),deleted:Q(),changed:Q(),invalid:Q(),meta:Gd,documentMeta:Q(Gd),annotation:Q(Gd),processingInstruction:Q(Gd),definition:gi.defineModifier("definition"),constant:gi.defineModifier("constant"),function:gi.defineModifier("function"),standard:gi.defineModifier("standard"),local:gi.defineModifier("local"),special:gi.defineModifier("special")};for(let n in N){let e=N[n];e instanceof gi&&(e.name=n)}_5([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);var h1;const tl=new He;function E5(n){return ne.define({combine:n?e=>e.concat(n):void 0})}const C6=new He;class xi{constructor(e,t,i=[],r=""){this.data=e,this.name=r,qe.prototype.hasOwnProperty("tree")||Object.defineProperty(qe.prototype,"tree",{get(){return rn(this)}}),this.parser=t,this.extension=[go.of(this),qe.languageData.of((s,o,l)=>{let a=i2(s,o,l),c=a.type.prop(tl);if(!c)return[];let u=s.facet(c),h=a.type.prop(C6);if(h){let f=a.resolve(o-a.from,l);for(let d of h)if(d.test(f,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(i)}isActiveAt(e,t,i=-1){return i2(e,t,i).type.prop(tl)==this.data}findRegions(e){let t=e.facet(go);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(tl)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(He.mounted);if(l){if(l.tree.prop(tl)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof at&&r(c,s.positions[a]+o)}};return r(rn(e),0),i}get allowsNesting(){return!0}}xi.setState=De.define();function i2(n,e,t){let i=n.facet(go),r=rn(n).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,t,ot.ExcludeBuffers|ot.EnterBracketed))s.type.isTop&&(r=s);return r}class mb extends xi{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=E5(e.languageData);return new mb(t,e.parser.configure({props:[tl.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new mb(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function rn(n){let e=n.field(xi.state,!1);return e?e.tree:at.empty}class S6{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,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ou=null;class gc{constructor(e,t,i=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new gc(e,t,[],at.empty,0,i,[],null)}startParse(){return this.parser.startParse(new S6(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=at.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(ds.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ds.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ou;ou=this;try{return e()}finally{ou=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=r2(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,h,f)=>a.push({fromA:c,toA:u,fromB:h,toB:f})),i=ds.applyChanges(i,a),r=at.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&l.push({from:u,to:h})}}}return new gc(this.parser,t,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=r2(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends tE{createParse(t,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=ou;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new at(On.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ou}}function r2(n,e,t){return ds.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class yc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new yc(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=gc.create(e.facet(go).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new yc(i)}}xi.state=jt.define({create:yc.init,update(n,e){for(let t of e.effects)if(t.is(xi.setState))return t.value;return e.startState.facet(go)!=e.state.facet(go)?yc.init(e.state):n.apply(e)}});let O5=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(O5=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const f1=typeof navigator<"u"&&(!((h1=navigator.scheduling)===null||h1===void 0)&&h1.isInputPending)?()=>navigator.scheduling.isInputPending():null,M6=Tt.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 t=this.view.state.field(xi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(xi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=O5(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(xi.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!f1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>f1&&f1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:xi.setState.of(new yc(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Vn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),go=ne.define({combine(n){return n.length?n[0]:null},enables:n=>[xi.state,M6,te.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class T6{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class E{constructor(e,t,i,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,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:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new E(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}const A6=ne.define(),Rg=ne.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Bl(n){let e=n.facet(Rg);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function tf(n,e){let t="",i=n.tabSize,r=n.facet(Rg)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s<e;s++)t+=r;return t}function ak(n,e){n instanceof qe&&(n=new Ng(n));for(let i of n.state.facet(A6)){let r=i(n,e);if(r!==void 0)return r}let t=rn(n.state);return t.length>=e?_6(n,t,e):null}class Ng{constructor(e,t={}){this.state=e,this.options=t,this.unit=Bl(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Ec(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const I5=new He;function _6(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return D5(i,n,t)}function D5(n,e,t){for(let i=n;i;i=i.next){let r=O6(i.node);if(r)return r(ck.create(e,t,i))}return 0}function E6(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function O6(n){let e=n.type.prop(I5);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(He.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>R5(o,!0,1,void 0,s&&!E6(o)?r.from:void 0)}return n.parent==null?I6:null}function I6(){return 0}class ck extends Ng{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new ck(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(D6(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return D5(this.context.next,this.base,this.pos)}}function D6(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function R6(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}l=a.to}}function LX({closing:n,align:e=!0,units:t=1}){return i=>R5(i,e,t,n)}function R5(n,e,t,i,r){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==n.pos+o,a=e?R6(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const PX=n=>n.baseIndent;function BX({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const N6=200;function L6(){return qe.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+N6)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==l)continue;l=u.from;let h=ak(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],d=tf(o,h);f!=d&&a.push({from:u.from,to:u.from+f.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const P6=ne.define(),B6=new He;function FX(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function F6(n,e,t){let i=rn(n);if(i.length<t)return null;let r=i.resolveStack(t,1),s=null;for(let o=r;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(B6);if(a&&(l.to<i.length-50||i.length==n.doc.length||!H6(l))){let c=a(l,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function H6(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function $m(n,e,t){for(let i of n.facet(P6)){let r=i(n,e,t);if(r)return r}return F6(n,e,t)}function N5(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Lg=De.define({map:N5}),id=De.define({map:N5});function L5(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Fl=jt.define({create(){return pe.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=s2(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Lg)&&!$6(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(F5),r=i?pe.replace({widget:new K6(i(e.state,t.value))}):o2;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(id)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=s2(n,e.selection.main.head)),n},provide:n=>te.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],r=n[t++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(o2.range(i,r))}return pe.set(e,!0)}});function s2(n,e,t=e){let i=!1;return n.between(e,t,(r,s)=>{r<t&&s>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):n}function Vm(n,e,t){var i;let r=null;return(i=n.field(Fl,!1))===null||i===void 0||i.between(e,t,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function $6(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function P5(n,e){return n.field(Fl,!1)?e:e.concat(De.appendConfig.of(H5()))}const V6=n=>{for(let e of L5(n)){let t=$m(n.state,e.from,e.to);if(t)return n.dispatch({effects:P5(n.state,[Lg.of(t),B5(n,t)])}),!0}return!1},z6=n=>{if(!n.state.field(Fl,!1))return!1;let e=[];for(let t of L5(n)){let i=Vm(n.state,t.from,t.to);i&&e.push(id.of(i),B5(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function B5(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return te.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const W6=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let r=n.lineBlockAt(i),s=$m(e,r.from,r.to);s&&t.push(Lg.of(s)),i=(s?n.lineBlockAt(s.to):r).to+1}return t.length&&n.dispatch({effects:P5(n.state,t)}),!!t.length},q6=n=>{let e=n.state.field(Fl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(id.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},j6=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:V6},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:z6},{key:"Ctrl-Alt-[",run:W6},{key:"Ctrl-Alt-]",run:q6}],U6={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},F5=ne.define({combine(n){return Lr(n,U6)}});function H5(n){return[Fl,Y6]}function $5(n,e){let{state:t}=n,i=t.facet(F5),r=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=Vm(n.state,l.from,l.to);a&&n.dispatch({effects:id.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const o2=pe.replace({widget:new class extends Qi{toDOM(n){return $5(n,null)}}});class K6 extends Qi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return $5(e,this.value)}}const G6={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class d1 extends ws{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function J6(n={}){let e={...G6,...n},t=new d1(e,!0),i=new d1(e,!1),r=Tt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(go)!=o.state.facet(go)||o.startState.field(Fl,!1)!=o.state.field(Fl,!1)||rn(o.startState)!=rn(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ys;for(let a of o.viewportLineBlocks){let c=Vm(o.state,a.from,a.to)?i:$m(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:s}=e;return[r,i6({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ve.empty},initialSpacer(){return new d1(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let c=Vm(o.state,l.from,l.to);if(c)return o.dispatch({effects:id.of(c)}),!0;let u=$m(o.state,l.from,l.to);return u?(o.dispatch({effects:Lg.of(u)}),!0):!1}}}),H5()]}const Y6=te.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 rd{constructor(e,t){this.specs=e;let i;function r(l){let a=po.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof xi?l=>l.prop(tl)==o.data:o?l=>l==o:void 0,this.style=_5(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new po(i):null,this.themeType=t.themeType}static define(e,t){return new rd(e,t||{})}}const gb=ne.define(),V5=ne.define({combine(n){return n.length?[n[0]]:null}});function p1(n){let e=n.facet(gb);return e.length?e:n.facet(V5)}function z5(n,e){let t=[X6],i;return n instanceof rd&&(n.module&&t.push(te.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(V5.of(n)):i?t.push(gb.computeN([te.darkTheme],r=>r.facet(te.darkTheme)==(i=="dark")?[n]:[])):t.push(gb.of(n)),t}class Z6{constructor(e){this.markCache=Object.create(null),this.tree=rn(e.state),this.decorations=this.buildDeco(e,p1(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=rn(e.state),i=p1(e.state),r=i!=p1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return pe.none;let i=new ys;for(let{from:r,to:s}of e.visibleRanges)k6(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=pe.mark({class:a})))},r,s);return i.finish()}}const X6=To.high(Tt.fromClass(Z6,{decorations:n=>n.decorations})),Q6=rd.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),eF=te.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),W5=1e4,q5="()[]{}",j5=ne.define({combine(n){return Lr(n,{afterCursor:!0,brackets:q5,maxScanDistance:W5,renderMatch:iF})}}),tF=pe.mark({class:"cm-matchingBracket"}),nF=pe.mark({class:"cm-nonmatchingBracket"});function iF(n){let e=[],t=n.matched?tF:nF;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const rF=jt.define({create(){return pe.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(j5);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=Mr(e.state,r.head,-1,i)||r.head>0&&Mr(e.state,r.head-1,1,i)||i.afterCursor&&(Mr(e.state,r.head,1,i)||r.head<e.state.doc.length&&Mr(e.state,r.head+1,-1,i));s&&(t=t.concat(i.renderMatch(s,e.state)))}return pe.set(t,!0)},provide:n=>te.decorations.from(n)}),sF=[rF,eF];function oF(n={}){return[j5.of(n),sF]}const lF=new He;function yb(n,e,t){let i=n.prop(e<0?He.openedBy:He.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function bb(n){let e=n.type.prop(lF);return e?e(n.node):n}function Mr(n,e,t,i={}){let r=i.maxScanDistance||W5,s=i.brackets||q5,o=rn(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=yb(a.type,t,s);if(c&&a.from<a.to){let u=bb(a);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return aF(n,e,t,a,u,c,s)}}return cF(n,e,t,o,l.type,r,s)}function aF(n,e,t,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l==null?void 0:l.cursor();if(u&&(t<0?u.childBefore(i.from):u.childAfter(i.to)))do if(t<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let h=bb(u);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(yb(u.type,t,o))c++;else if(yb(u.type,-t,o)){if(c==0){let h=bb(u);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function cF(n,e,t,i,r,s,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=s;){let d=u.value;t<0&&(f+=d.length);let p=e+f*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=r))if(y%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};h--}}t>0&&(f+=d.length)}return u.done?{start:c,matched:!1}:null}function l2(n,e,t,i=0,r=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=r;for(let o=i;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class U5{constructor(e,t,i,r){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=r,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 t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}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 t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=l2(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:l2(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let r=o=>i?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function uF(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||hF,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||fk,mergeTokens:n.mergeTokens!==!1}}function hF(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const a2=new WeakMap;class uk extends xi{constructor(e){let t=E5(e.languageData),i=uF(e),r,s=new class extends tE{createParse(o,l,a){return new dF(r,o,l,a)}};super(t,s,[],e.name),this.topNode=gF(t,this),r=this,this.streamParser=i,this.stateAfter=new He({perNode:!0}),this.tokenTable=e.tokenTable?new Y5(i.tokenTable):mF}static define(e){return new uk(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=a2.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=hk(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let a=e.state.doc.lineAt(s),c=Math.min(e.pos,a.to);if(a.length){let u=i?i(a.from):-1,h=new U5(a.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;h.pos<c-a.from;)G5(this.streamParser.token,h,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=a.to+1}let l=e.lineAt(e.pos);return i&&t==null&&a2.set(e.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function hk(n,e,t,i,r){let s=t>=i&&t+e.length<=r&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],c=l instanceof at&&a<r&&hk(n,l,a,i,r);if(c)return c}return null}function K5(n,e,t,i,r){if(r&&t<=0&&i>=e.length)return e;!r&&t==0&&e.type==n.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(o<i&&l instanceof at){if(!(a=K5(n,l,t-o,i-o,r)))break;return r?new at(e.type,e.children.slice(0,s).concat(a),e.positions.slice(0,s+1),o+a.length):a}}return null}function fF(n,e,t,i,r){for(let s of e){let o=s.from+(s.openStart?25:0),l=s.to-(s.openEnd?25:0),a=o<=t&&l>t&&hk(n,s.tree,0-s.offset,t,l),c;if(a&&a.pos<=i&&(c=K5(n,s.tree,t+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:c}}return{state:n.streamParser.startState(r?Bl(r):4),tree:at.empty}}class dF{constructor(e,t,i,r){this.lang=e,this.input=t,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=gc.get(),o=r[0].from,{state:l,tree:a}=fF(e,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&r.some(c=>c.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Bl(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=gc.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
54
54
  `&&(t="");else{let i=t.indexOf(`
55
- `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new U5(t,e?e.state.tabSize:4,e?Bl(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=G5(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=at.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:pF,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new at(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 at(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function G5(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let r=n(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const fk=Object.create(null),nf=[On.none],pF=new Hw(nf),c2=[],u2=Object.create(null),J5=Object.create(null);for(let[n,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"]])J5[n]=Z5(fk,e);class Y5{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),J5)}resolve(e){return e?this.table[e]||(this.table[e]=Z5(this.extra,e)):0}}const mF=new Y5(fk);function m1(n,e){c2.indexOf(n)>-1||(c2.push(n),console.warn(e))}function Z5(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=n[c]||N[c];u?typeof u=="function"?a.length?a=a.map(u):m1(c,`Modifier ${c} used at start of tag`):a.length?m1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:m1(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(l=>l.id),s=u2[r];if(s)return s.id;let o=u2[r]=On.define({id:nf.length,name:i,props:[b6({[i]:t})]});return nf.push(o),o.id}function gF(n,e){let t=On.define({id:nf.length,name:"Document",props:[tl.add(()=>n),I5.add(()=>i=>e.getIndent(i))],top:!0});return nf.push(t),t}ct.RTL,ct.LTR;function H(n){return new T6(uk.define(n))}function _s(n){return I(()=>import("./index-nPSeKWRU.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const yF=[E.of({name:"C",extensions:["c","h","ino"],load(){return I(()=>import("./index-CvlBHvN3.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),E.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return I(()=>import("./index-CvlBHvN3.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),E.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return _s("Cassandra")}}),E.of({name:"CSS",extensions:["css"],load(){return I(()=>import("./index-CmOEsqBQ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.css())}}),E.of({name:"Go",extensions:["go"],load(){return I(()=>import("./index-DuFyvKRm.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.go())}}),E.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return I(()=>import("./index-CxqCKbLy.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.html())}}),E.of({name:"Java",extensions:["java"],load(){return I(()=>import("./index-BeRhCeQu.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.java())}}),E.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return I(()=>import("./index-B_eFETCZ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript())}}),E.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return I(()=>import("./index-D0O0qYML.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.jinja())}}),E.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return I(()=>import("./index-BUZUbTWS.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.json())}}),E.of({name:"JSX",extensions:["jsx"],load(){return I(()=>import("./index-B_eFETCZ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),E.of({name:"LESS",extensions:["less"],load(){return I(()=>import("./index-UeGDfQIX.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.less())}}),E.of({name:"Liquid",extensions:["liquid"],load(){return I(()=>import("./index-DjGrNkrV.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.liquid())}}),E.of({name:"MariaDB SQL",load(){return _s("MariaSQL")}}),E.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return I(()=>import("./index-DCjrDHEd.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.markdown())}}),E.of({name:"MS SQL",load(){return _s("MSSQL")}}),E.of({name:"MySQL",load(){return _s("MySQL")}}),E.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return I(()=>import("./index-ByECpktB.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.php())}}),E.of({name:"PLSQL",extensions:["pls"],load(){return _s("PLSQL")}}),E.of({name:"PostgreSQL",load(){return _s("PostgreSQL")}}),E.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return I(()=>import("./index-CkjuY786.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.python())}}),E.of({name:"Rust",extensions:["rs"],load(){return I(()=>import("./index-CE0NChcB.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.rust())}}),E.of({name:"Sass",extensions:["sass"],load(){return I(()=>import("./index-BdSFouqR.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass({indented:!0}))}}),E.of({name:"SCSS",extensions:["scss"],load(){return I(()=>import("./index-BdSFouqR.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass())}}),E.of({name:"SQL",extensions:["sql"],load(){return _s("StandardSQL")}}),E.of({name:"SQLite",load(){return _s("SQLite")}}),E.of({name:"TSX",extensions:["tsx"],load(){return I(()=>import("./index-B_eFETCZ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),E.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return I(()=>import("./index-B_eFETCZ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),E.of({name:"WebAssembly",extensions:["wat","wast"],load(){return I(()=>import("./index-BN7eABQE.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.wast())}}),E.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return I(()=>import("./index-CxUWaNUo.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.xml())}}),E.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return I(()=>import("./index-DYtXgeSz.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.yaml())}}),E.of({name:"APL",extensions:["dyalog","apl"],load(){return I(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(n=>H(n.apl))}}),E.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return I(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>H(n.asciiArmor))}}),E.of({name:"ASN.1",extensions:["asn","asn1"],load(){return I(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>H(n.asn1({})))}}),E.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return I(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>H(n.asterisk))}}),E.of({name:"Brainfuck",extensions:["b","bf"],load(){return I(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>H(n.brainfuck))}}),E.of({name:"Cobol",extensions:["cob","cpy"],load(){return I(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>H(n.cobol))}}),E.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.csharp))}}),E.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"ClojureScript",extensions:["cljs"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return I(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(n=>H(n.gss))}}),E.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return I(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>H(n.cmake))}}),E.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return I(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>H(n.coffeeScript))}}),E.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return I(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>H(n.commonLisp))}}),E.of({name:"Cypher",extensions:["cyp","cypher"],load(){return I(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>H(n.cypher))}}),E.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return I(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(n=>H(n.cython))}}),E.of({name:"Crystal",extensions:["cr"],load(){return I(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(n=>H(n.crystal))}}),E.of({name:"D",extensions:["d"],load(){return I(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(n=>H(n.d))}}),E.of({name:"Dart",extensions:["dart"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.dart))}}),E.of({name:"diff",extensions:["diff","patch"],load(){return I(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(n=>H(n.diff))}}),E.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return I(()=>import("./dockerfile-BKs6k2Af.js"),[],import.meta.url).then(n=>H(n.dockerFile))}}),E.of({name:"DTD",extensions:["dtd"],load(){return I(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>H(n.dtd))}}),E.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return I(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(n=>H(n.dylan))}}),E.of({name:"EBNF",load(){return I(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>H(n.ebnf))}}),E.of({name:"ECL",extensions:["ecl"],load(){return I(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(n=>H(n.ecl))}}),E.of({name:"edn",extensions:["edn"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"Eiffel",extensions:["e"],load(){return I(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>H(n.eiffel))}}),E.of({name:"Elm",extensions:["elm"],load(){return I(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(n=>H(n.elm))}}),E.of({name:"Erlang",extensions:["erl"],load(){return I(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>H(n.erlang))}}),E.of({name:"Esper",load(){return I(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>H(n.esper))}}),E.of({name:"Factor",extensions:["factor"],load(){return I(()=>import("./factor-kuTfRLto.js"),[],import.meta.url).then(n=>H(n.factor))}}),E.of({name:"FCL",load(){return I(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>H(n.fcl))}}),E.of({name:"Forth",extensions:["forth","fth","4th"],load(){return I(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(n=>H(n.forth))}}),E.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return I(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>H(n.fortran))}}),E.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.fSharp))}}),E.of({name:"Gas",extensions:["s"],load(){return I(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(n=>H(n.gas))}}),E.of({name:"Gherkin",extensions:["feature"],load(){return I(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>H(n.gherkin))}}),E.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return I(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>H(n.groovy))}}),E.of({name:"Haskell",extensions:["hs"],load(){return I(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>H(n.haskell))}}),E.of({name:"Haxe",extensions:["hx"],load(){return I(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>H(n.haxe))}}),E.of({name:"HXML",extensions:["hxml"],load(){return I(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>H(n.hxml))}}),E.of({name:"HTTP",load(){return I(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(n=>H(n.http))}}),E.of({name:"IDL",extensions:["pro"],load(){return I(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(n=>H(n.idl))}}),E.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return I(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>H(n.jsonld))}}),E.of({name:"Julia",extensions:["jl"],load(){return I(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(n=>H(n.julia))}}),E.of({name:"Kotlin",extensions:["kt","kts"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.kotlin))}}),E.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return I(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(n=>H(n.liveScript))}}),E.of({name:"Lua",extensions:["lua"],load(){return I(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(n=>H(n.lua))}}),E.of({name:"mIRC",extensions:["mrc"],load(){return I(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>H(n.mirc))}}),E.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return I(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>H(n.mathematica))}}),E.of({name:"Modelica",extensions:["mo"],load(){return I(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>H(n.modelica))}}),E.of({name:"MUMPS",extensions:["mps"],load(){return I(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(n=>H(n.mumps))}}),E.of({name:"Mbox",extensions:["mbox"],load(){return I(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>H(n.mbox))}}),E.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return I(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>H(n.nginx))}}),E.of({name:"NSIS",extensions:["nsh","nsi"],load(){return I(()=>import("./nsis-LdVXkNf5.js"),[],import.meta.url).then(n=>H(n.nsis))}}),E.of({name:"NTriples",extensions:["nt","nq"],load(){return I(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>H(n.ntriples))}}),E.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.objectiveC))}}),E.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.objectiveCpp))}}),E.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.oCaml))}}),E.of({name:"Octave",extensions:["m"],load(){return I(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>H(n.octave))}}),E.of({name:"Oz",extensions:["oz"],load(){return I(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(n=>H(n.oz))}}),E.of({name:"Pascal",extensions:["p","pas"],load(){return I(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(n=>H(n.pascal))}}),E.of({name:"Perl",extensions:["pl","pm"],load(){return I(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>H(n.perl))}}),E.of({name:"Pig",extensions:["pig"],load(){return I(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(n=>H(n.pig))}}),E.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return I(()=>import("./powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>H(n.powerShell))}}),E.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return I(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(n=>H(n.properties))}}),E.of({name:"ProtoBuf",extensions:["proto"],load(){return I(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(n=>H(n.protobuf))}}),E.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return I(()=>import("./pug-DeIclll2.js"),[],import.meta.url).then(n=>H(n.pug))}}),E.of({name:"Puppet",extensions:["pp"],load(){return I(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>H(n.puppet))}}),E.of({name:"Q",extensions:["q"],load(){return I(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(n=>H(n.q))}}),E.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return I(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>H(n.r))}}),E.of({name:"RPM Changes",load(){return I(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>H(n.rpmChanges))}}),E.of({name:"RPM Spec",extensions:["spec"],load(){return I(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>H(n.rpmSpec))}}),E.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return I(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(n=>H(n.ruby))}}),E.of({name:"SAS",extensions:["sas"],load(){return I(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(n=>H(n.sas))}}),E.of({name:"Scala",extensions:["scala"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.scala))}}),E.of({name:"Scheme",extensions:["scm","ss"],load(){return I(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(n=>H(n.scheme))}}),E.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return I(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>H(n.shell))}}),E.of({name:"Sieve",extensions:["siv","sieve"],load(){return I(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>H(n.sieve))}}),E.of({name:"Smalltalk",extensions:["st"],load(){return I(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>H(n.smalltalk))}}),E.of({name:"Solr",load(){return I(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(n=>H(n.solr))}}),E.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.sml))}}),E.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return I(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>H(n.sparql))}}),E.of({name:"Spreadsheet",alias:["excel","formula"],load(){return I(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>H(n.spreadsheet))}}),E.of({name:"Squirrel",extensions:["nut"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.squirrel))}}),E.of({name:"Stylus",extensions:["styl"],load(){return I(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(n=>H(n.stylus))}}),E.of({name:"Swift",extensions:["swift"],load(){return I(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(n=>H(n.swift))}}),E.of({name:"sTeX",load(){return I(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>H(n.stex))}}),E.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return I(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>H(n.stex))}}),E.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return I(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>H(n.verilog))}}),E.of({name:"Tcl",extensions:["tcl"],load(){return I(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>H(n.tcl))}}),E.of({name:"Textile",extensions:["textile"],load(){return I(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(n=>H(n.textile))}}),E.of({name:"TiddlyWiki",load(){return I(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>H(n.tiddlyWiki))}}),E.of({name:"Tiki wiki",load(){return I(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(n=>H(n.tiki))}}),E.of({name:"TOML",extensions:["toml"],load(){return I(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>H(n.toml))}}),E.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return I(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(n=>H(n.troff))}}),E.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return I(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>H(n.ttcn))}}),E.of({name:"TTCN_CFG",extensions:["cfg"],load(){return I(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>H(n.ttcnCfg))}}),E.of({name:"Turtle",extensions:["ttl"],load(){return I(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>H(n.turtle))}}),E.of({name:"Web IDL",extensions:["webidl"],load(){return I(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>H(n.webIDL))}}),E.of({name:"VB.NET",extensions:["vb"],load(){return I(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(n=>H(n.vb))}}),E.of({name:"VBScript",extensions:["vbs"],load(){return I(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>H(n.vbScript))}}),E.of({name:"Velocity",extensions:["vtl"],load(){return I(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(n=>H(n.velocity))}}),E.of({name:"Verilog",extensions:["v"],load(){return I(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>H(n.verilog))}}),E.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return I(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>H(n.vhdl))}}),E.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return I(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(n=>H(n.xQuery))}}),E.of({name:"Yacas",extensions:["ys"],load(){return I(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>H(n.yacas))}}),E.of({name:"Z80",extensions:["z80"],load(){return I(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>H(n.z80))}}),E.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.mscgen))}}),E.of({name:"Xù",extensions:["xu"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.xu))}}),E.of({name:"MsGenny",extensions:["msgenny"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.msgenny))}}),E.of({name:"Vue",extensions:["vue"],load(){return I(()=>import("./index-BxdH1-er.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.vue())}}),E.of({name:"Angular Template",load(){return I(()=>import("./index-ByxyNkwM.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.angular())}})],bF="#e5c07b",h2="#e06c75",wF="#56b6c2",kF="#ffffff",Wp="#abb2bf",wb="#7d8799",vF="#61afef",xF="#98c379",f2="#d19a66",CF="#c678dd",SF="#21252b",d2="#2c313a",p2="#282c34",g1="#353a42",MF="#3E4451",m2="#528bff",TF=te.theme({"&":{color:Wp,backgroundColor:p2},".cm-content":{caretColor:m2},".cm-cursor, .cm-dropCursor":{borderLeftColor:m2},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MF},".cm-panels":{backgroundColor:SF,color:Wp},".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 #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:p2,color:wb,border:"none"},".cm-activeLineGutter":{backgroundColor:d2},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:g1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:g1,borderBottomColor:g1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:d2,color:Wp}}},{dark:!0}),AF=rd.define([{tag:N.keyword,color:CF},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:h2},{tag:[N.function(N.variableName),N.labelName],color:vF},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:f2},{tag:[N.definition(N.name),N.separator],color:Wp},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:bF},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:wF},{tag:[N.meta,N.comment],color:wb},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:wb,textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:h2},{tag:[N.atom,N.bool,N.special(N.variableName)],color:f2},{tag:[N.processingInstruction,N.string,N.inserted],color:xF},{tag:N.invalid,color:kF}]),_F=[TF,z5(AF)];function sd(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-block",...e}}),n}const EF=n=>!_r(t=>t.type.name==="table")(n),Pg=et({filterNodes:EF},"blockConfig");sd(Pg,{displayName:"Ctx<blockConfig>"});function OF(n,e,t){var r;if(!n.dom.parentElement)return null;try{const s=(r=n.posAtCoords({left:e.x,top:e.y}))==null?void 0:r.inside;if(s==null||s<0)return null;let o=n.state.doc.resolve(s),l=n.state.doc.nodeAt(s),a=n.nodeDOM(s);const c=h=>{const f=o.depth>=1&&o.index(o.depth)===0;if(!(h||f))return;const p=o.before(o.depth);l=n.state.doc.nodeAt(p),a=n.nodeDOM(p),o=n.state.doc.resolve(p),t(o,l)||c(!0)},u=t(o,l);return c(!u),!a||!l?null:{node:l,$pos:o,el:a}}catch{return null}}const g2=Od.ie&&Od.ie_version<15||Od.ios&&Od.webkit_version<604,y2=20;var Wa,_f,hl,Hi,qa,$i,Vi,X5,zo,fl,dl,Ef,ja,Ua,Ka,Ga,Of,Zs;class IF{constructor(){U(this,Vi);U(this,Wa);U(this,_f);U(this,hl);U(this,Hi);U(this,qa);U(this,$i);U(this,fl);U(this,dl);U(this,Ef);U(this,ja);U(this,Ua);U(this,Ka);U(this,Ga);U(this,Of);U(this,Zs);R(this,_f,()=>{if(!C(this,Hi))return null;const e=C(this,Hi),t=C(this,Vi,zo);if(t&&be.isSelectable(e.node)){const i=be.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(i)),t.focus(),R(this,hl,i),i}return null}),R(this,hl,null),R(this,Hi,null),R(this,qa,void 0),R(this,$i,!1),R(this,dl,()=>{var e;(e=C(this,fl))==null||e.call(this,{type:"hide"}),R(this,Hi,null)}),R(this,Ef,e=>{var t;R(this,Hi,e),(t=C(this,fl))==null||t.call(this,{type:"show",active:e})}),this.bind=(e,t)=>{R(this,Wa,e),R(this,fl,t)},this.addEvent=e=>{e.addEventListener("mousedown",C(this,ja)),e.addEventListener("mouseup",C(this,Ua)),e.addEventListener("dragstart",C(this,Ka)),e.addEventListener("dragend",C(this,Ga))},this.removeEvent=e=>{e.removeEventListener("mousedown",C(this,ja)),e.removeEventListener("mouseup",C(this,Ua)),e.removeEventListener("dragstart",C(this,Ka)),e.removeEventListener("dragend",C(this,Ga))},this.unBind=()=>{R(this,fl,void 0)},R(this,ja,()=>{var e;R(this,qa,(e=C(this,Hi))==null?void 0:e.el.getBoundingClientRect()),C(this,_f).call(this)}),R(this,Ua,()=>{if(!C(this,$i)){requestAnimationFrame(()=>{var e;C(this,qa)&&((e=C(this,Vi,zo))==null||e.focus())});return}R(this,$i,!1),R(this,hl,null)}),R(this,Ka,e=>{var r;R(this,$i,!0);const t=C(this,Vi,zo);if(!t)return;t.dom.dataset.dragging="true";const i=C(this,hl);if(e.dataTransfer&&i){const s=i.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:l}=t.serializeForClipboard(s);e.dataTransfer.clearData(),e.dataTransfer.setData(g2?"Text":"text/html",o.innerHTML),g2||e.dataTransfer.setData("text/plain",l);const a=(r=C(this,Hi))==null?void 0:r.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:s,move:!0}}}),R(this,Ga,()=>{C(this,Vi,zo)&&C(this,Zs).call(this,C(this,Vi,zo))}),this.keydownCallback=e=>(C(this,dl).call(this),R(this,$i,!1),e.dom.dataset.dragging="false",!1),R(this,Of,hg((e,t)=>{if(!e.editable)return;const i=e.dom.getBoundingClientRect(),r=i.left+i.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){C(this,dl).call(this);return}const o=C(this,Vi,X5);if(!o)return;const l=OF(e,{x:r,y:t.clientY},o);if(!l){C(this,dl).call(this);return}C(this,Ef).call(this,l)},200)),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||C(this,Of).call(this,e,t),!1),this.dragoverCallback=(e,t)=>{var i;if(C(this,$i)){const r=(i=C(this,Vi,zo))==null?void 0:i.dom.parentElement;if(!r)return!1;const s=r.scrollHeight>r.clientHeight,o=r.getBoundingClientRect();if(s){if(r.scrollTop>0&&Math.abs(t.y-o.y)<y2){const c=r.scrollTop>10?r.scrollTop-10:0;return r.scrollTop=c,!1}const l=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(r.scrollTop+o.height)<l&&Math.abs(t.y-(o.height+o.y))<y2){const c=r.scrollTop+10;return r.scrollTop=c,!1}}}return!1},this.dragenterCallback=e=>{e.dragging&&(R(this,$i,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const i=t.clientX,r=t.clientY;(i<0||r<0||i>window.innerWidth||r>window.innerHeight)&&(R(this,Hi,null),C(this,Zs).call(this,e))},this.dropCallback=e=>(C(this,Zs).call(this,e),!1),this.dragendCallback=e=>{C(this,Zs).call(this,e)},R(this,Zs,e=>{R(this,$i,!1),e.dom.dataset.dragging="false"})}}Wa=new WeakMap,_f=new WeakMap,hl=new WeakMap,Hi=new WeakMap,qa=new WeakMap,$i=new WeakMap,Vi=new WeakSet,X5=function(){var e;try{return(e=C(this,Wa))==null?void 0:e.get(Pg.key).filterNodes}catch{return}},zo=function(){var e;return(e=C(this,Wa))==null?void 0:e.get(Qe)},fl=new WeakMap,dl=new WeakMap,Ef=new WeakMap,ja=new WeakMap,Ua=new WeakMap,Ka=new WeakMap,Ga=new WeakMap,Of=new WeakMap,Zs=new WeakMap;const dk=et(()=>new IF,"blockService"),Bg=et({},"blockServiceInstance");sd(dk,{displayName:"Ctx<blockService>"});sd(Bg,{displayName:"Ctx<blockServiceInstance>"});const Fg=et({},"blockSpec");sd(Fg,{displayName:"Ctx<blockSpec>"});const pk=Pt(n=>{const e=new yt("MILKDOWN_BLOCK"),i=n.get(dk.key)();n.set(Bg.key,i);const r=n.get(Fg.key);return new gt({key:e,...r,props:{...r.props,handleDOMEvents:{drop:s=>i.dropCallback(s),pointermove:(s,o)=>i.mousemoveCallback(s,o),keydown:s=>i.keydownCallback(s),dragover:(s,o)=>i.dragoverCallback(s,o),dragleave:(s,o)=>i.dragleaveCallback(s,o),dragenter:s=>i.dragenterCallback(s),dragend:s=>i.dragendCallback(s)}}})});sd(pk,{displayName:"Prose<block>"});var Pn,rs,pl,ml,If,Ja,Df,Rf,Ya,Za,Xa,ag,Q5;class DF{constructor(e){U(this,ag);U(this,Pn);U(this,rs);U(this,pl);U(this,ml);U(this,If);U(this,Ja);U(this,Df);U(this,Rf);U(this,Ya);U(this,Za);U(this,Xa);R(this,ml,null),R(this,Ja,!1),this.update=()=>{requestAnimationFrame(()=>{if(!C(this,Ja))try{Td(this,ag,Q5).call(this),R(this,Ja,!0)}catch{}})},this.destroy=()=>{var t,i;(t=C(this,pl))==null||t.unBind(),(i=C(this,pl))==null||i.removeEvent(C(this,Pn)),C(this,Pn).remove()},this.show=t=>{const i=t.el,r=C(this,rs).get(Qe).dom,s={ctx:C(this,rs),active:t,editorDom:r,blockDom:C(this,Pn)},o={contextElement:i,getBoundingClientRect:()=>C(this,Za)?C(this,Za).call(this,s):i.getBoundingClientRect()},l=[ow()];if(C(this,Ya)){const a=C(this,Ya).call(this,s),c=El(a);l.push(c)}Or(o,C(this,Pn),{placement:C(this,Xa)?C(this,Xa).call(this,s):"left",middleware:[...l,...C(this,Df)],...C(this,Rf)}).then(({x:a,y:c})=>{Object.assign(C(this,Pn).style,{left:`${a}px`,top:`${c}px`}),C(this,Pn).dataset.show="true"}).catch(console.error)},this.hide=()=>{C(this,Pn).dataset.show="false"},R(this,rs,e.ctx),R(this,Pn,e.content),R(this,Ya,e.getOffset),R(this,Za,e.getPosition),R(this,Xa,e.getPlacement),R(this,Df,e.middleware??[]),R(this,Rf,e.floatingUIOptions??{}),R(this,If,e.root),this.hide()}get active(){return C(this,ml)}}Pn=new WeakMap,rs=new WeakMap,pl=new WeakMap,ml=new WeakMap,If=new WeakMap,Ja=new WeakMap,Df=new WeakMap,Rf=new WeakMap,Ya=new WeakMap,Za=new WeakMap,Xa=new WeakMap,ag=new WeakSet,Q5=function(){const e=C(this,rs).get(Qe);(C(this,If)??e.dom.parentElement??document.body).appendChild(C(this,Pn));const i=C(this,rs).get(Bg.key);i.bind(C(this,rs),r=>{r.type==="hide"?(this.hide(),R(this,ml,null)):r.type==="show"&&(this.show(r.active),R(this,ml,r.active))}),R(this,pl,i),C(this,pl).addEvent(C(this,Pn)),C(this,Pn).draggable=!0};const Hg=[Fg,Pg,dk,Bg,pk];Hg.key=Fg.key;Hg.pluginKey=pk.key;function RF(n,e){return function(t,i){let{$from:r,$to:s,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(s))return!1;let l=r.node(-1);if(l.type!=n)return!1;if(r.parent.content.size==0&&r.node(-1).childCount==r.indexAfter(-1)){if(r.depth==3||r.node(-3).type!=n||r.index(-2)!=r.node(-2).childCount-1)return!1;if(i){let h=G.empty,f=r.index(-1)?1:r.index(-2)?2:3;for(let y=r.depth-f;y>=r.depth-3;y--)h=G.from(r.node(y).copy(h));let d=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;h=h.append(G.from(n.createAndFill()));let p=r.before(r.depth-(f-1)),m=t.tr.replace(p,r.after(-d),new X(h,4-f,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(y,b)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=b+1)}),g>-1&&m.setSelection(Ee.near(m.doc.resolve(g))),i(m.scrollIntoView())}return!0}let a=s.pos==r.end()?l.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,s.pos),u=a?[null,{type:a}]:void 0;return nh(c.doc,r.pos,2,u)?(i&&i(c.split(r.pos,2,u).scrollIntoView()),!0):!1}}function NF(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?LF(e,t,n,s):PF(e,t,s):!0:!1}}function LF(n,e,t,i){let r=n.tr,s=i.end,o=i.$to.end(i.depth);s<o&&(r.step(new hn(s-1,o,s,o,new X(G.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new UT(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=yg(i);if(l==null)return!1;r.lift(i,l);let a=r.doc.resolve(r.mapping.map(s,-1)-1);return bg(r.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&r.join(a.pos),e(r.scrollIntoView()),!0}function PF(n,e,t){let i=n.tr,r=t.parent;for(let d=t.end,p=t.endIndex-1,m=t.startIndex;p>m;p--)d-=r.child(p).nodeSize,i.delete(d-1,d+1);let s=i.doc.resolve(t.start),o=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==r.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?G.empty:G.from(r))))return!1;let h=s.pos,f=h+o.nodeSize;return i.step(new hn(h-(l?1:0),f+(a?1:0),h+1,f-1,new X((l?G.empty:G.from(r.copy(G.empty))).append(a?G.empty:G.from(r.copy(G.empty))),l?0:1,a?0:1),l?0:1)),e(i.scrollIntoView()),!0}function BF(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=G.from(c?n.create():null),h=new X(G.from(n.create(null,G.from(l.type.create(null,u)))),c?3:1,0),f=s.start,d=s.end;t(e.tr.step(new hn(f-(c?3:1),d,f,d,h,1,!0)).scrollIntoView())}return!0}}function FF(n){const e=new Map;if(!n||!n.type)throw new Error("mdast-util-definitions expected node");return Co(n,"definition",function(i){const r=b2(i.identifier);r&&!e.get(r)&&e.set(r,i)}),t;function t(i){const r=b2(i);return e.get(r)}}function b2(n){return String(n||"").toUpperCase()}function HF(){return function(n){const e=FF(n);Co(n,function(t,i,r){if(t.type==="definition"&&r!==void 0&&typeof i=="number")return r.children.splice(i,1),[ay,i];if(t.type==="imageReference"||t.type==="linkReference"){const s=e(t.identifier);if(s&&r&&typeof i=="number")return r.children[i]=t.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:t.alt}:{type:"link",url:s.url,title:s.title,children:t.children},[ay,i]}})}}function eO(n,e){var r;if(!(e.childCount>=1&&((r=e.lastChild)==null?void 0:r.type.name)==="hardbreak")){n.next(e.content);return}const i=[];e.content.forEach((s,o,l)=>{l!==e.childCount-1&&i.push(s)}),n.next(G.fromArray(i))}function L(n,e){return Object.assign(n,{meta:{package:"@milkdown/preset-commonmark",...e}}),n}const mk=Xf("emphasis");L(mk,{displayName:"Attr<emphasis>",group:"Emphasis"});const Vl=_c("emphasis",n=>({attrs:{marker:{default:n.get(sh).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",n.get(mk.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));L(Vl.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});L(Vl.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const $g=_e("ToggleEmphasis",n=>()=>vg(Vl.type(n)));L($g,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const tO=yn(n=>Gf(/(?:^|[^*])\*([^*]+)\*$/,Vl.type(n),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));L(tO,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const nO=yn(n=>Gf(/\b_(?![_\s])(.*?[^_\s])_\b/,Vl.type(n),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));L(nO,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const gk=Kn("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:n=>{const e=n.get(oe);return()=>e.call($g.key)}}});L(gk.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});L(gk.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const yk=Xf("strong");L(yk,{displayName:"Attr<strong>",group:"Strong"});const Ic=_c("strong",n=>({attrs:{marker:{default:n.get(sh).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",n.get(yk.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));L(Ic.mark,{displayName:"MarkSchema<strong>",group:"Strong"});L(Ic.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const Vg=_e("ToggleStrong",n=>()=>vg(Ic.type(n)));L(Vg,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const iO=yn(n=>Gf(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Ic.type(n),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));L(iO,{displayName:"InputRule<strong>",group:"Strong"});const bk=Kn("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:n=>{const e=n.get(oe);return()=>e.call(Vg.key)}}});L(bk.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});L(bk.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const wk=Xf("inlineCode");L(wk,{displayName:"Attr<inlineCode>",group:"InlineCode"});const hs=_c("inlineCode",n=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:e=>["code",n.get(wk.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,t,i)=>{e.openMark(i),e.addText(t.value),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,t,i)=>{e.withMark(t,"inlineCode",i.text||"")}}}));L(hs.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});L(hs.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const zg=_e("ToggleInlineCode",n=>()=>(e,t)=>{const{selection:i,tr:r}=e;if(i.empty)return!1;const{from:s,to:o}=i;return e.doc.rangeHasMark(s,o,hs.type(n))?(t==null||t(r.removeMark(s,o,hs.type(n))),!0):(Object.keys(e.schema.marks).filter(c=>c!==hs.type.name).map(c=>e.schema.marks[c]).forEach(c=>{r.removeMark(s,o,c)}),t==null||t(r.addMark(s,o,hs.type(n).create())),!0)});L(zg,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const rO=yn(n=>Gf(/(?:`)([^`]+)(?:`)$/,hs.type(n)));L(rO,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const kk=Kn("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:n=>{const e=n.get(oe);return()=>e.call(zg.key)}}});L(kk.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});L(kk.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const vk=Xf("link");L(vk,{displayName:"Attr<link>",group:"Link"});const Ui=_c("link",n=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...n.get(vk.key)(e),...e.attrs}],parseMarkdown:{match:e=>e.type==="link",runner:(e,t,i)=>{const r=t.url,s=t.title;e.openMark(i,{href:r,title:s}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));L(Ui.mark,{displayName:"MarkSchema<link>",group:"Link"});const sO=_e("ToggleLink",n=>(e={})=>vg(Ui.type(n),e));L(sO,{displayName:"Command<toggleLinkCommand>",group:"Link"});const oO=_e("UpdateLink",n=>(e={})=>(t,i)=>{if(!i)return!1;let r,s=-1;const{selection:o}=t,{from:l,to:a}=o;if(t.doc.nodesBetween(l,l===a?a+1:a,(p,m)=>{if(Ui.type(n).isInSet(p.marks))return r=p,s=m,!1}),!r)return!1;const c=r.marks.find(({type:p})=>p===Ui.type(n));if(!c)return!1;const u=s,h=s+r.nodeSize,{tr:f}=t,d=Ui.type(n).create({...c.attrs,...e});return d?(i(f.removeMark(u,h,c).addMark(u,h,d).setSelection(new ue(f.selection.$anchor)).scrollIntoView()),!0):!1});L(oO,{displayName:"Command<updateLinkCommand>",group:"Link"});const lO=Fw("doc",()=>({content:"block+",parseMarkdown:{match:({type:n})=>n==="root",runner:(n,e,t)=>{n.injectRoot(e,t)}},toMarkdown:{match:n=>n.type.name==="doc",runner:(n,e)=>{n.openNode("root"),n.next(e.content)}}}));L(lO,{displayName:"NodeSchema<doc>",group:"Doc"});function $F(n){return fw(n,e=>{var t;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((t=e.value)==null?void 0:t.trim())},(e,t)=>{if(!t.length)return;const i=t[t.length-1];if(!i)return;const r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)},!0)}const Wg=Xi("remark-preserve-empty-line",()=>()=>$F);L(Wg.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});L(Wg.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const xk=Zi("paragraph");L(xk,{displayName:"Attr<paragraph>",group:"Paragraph"});const er=xt("paragraph",n=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",n.get(xk.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,t,i)=>{e.openNode(i),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,t)=>{var s;const r=(s=n.get(Qe).state)==null?void 0:s.doc.lastChild;e.openNode("paragraph"),(!t.content||t.content.size===0)&&t!==r&&VF(n)?e.addNode("html",void 0,"<br />"):eO(e,t),e.closeNode()}}}));function VF(n){let e=!1;try{n.get(Wg.id),e=!0}catch{e=!1}return e}L(er.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});L(er.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const Ck=_e("TurnIntoText",n=>()=>Nh(er.type(n)));L(Ck,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const Sk=Kn("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:n=>{const e=n.get(oe);return()=>e.call(Ck.key)}}});L(Sk.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});L(Sk.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const zF=Array(6).fill(0).map((n,e)=>e+1);function WF(n){return n.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const qg=et(WF,"headingIdGenerator");L(qg,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const Mk=Zi("heading");L(Mk,{displayName:"Attr<heading>",group:"Heading"});const ii=xt("heading",n=>{const e=n.get(qg.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:zF.map(t=>({tag:`h${t}`,getAttrs:i=>{if(!(i instanceof HTMLElement))throw Yi(i);return{level:t,id:i.id}}})),toDOM:t=>[`h${t.attrs.level}`,{...n.get(Mk.key)(t),id:t.attrs.id||e(t)},0],parseMarkdown:{match:({type:t})=>t==="heading",runner:(t,i,r)=>{const s=i.depth;t.openNode(r,{level:s}),t.next(i.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="heading",runner:(t,i)=>{t.openNode("heading",void 0,{depth:i.attrs.level}),eO(t,i),t.closeNode()}}}});L(ii.node,{displayName:"NodeSchema<heading>",group:"Heading"});L(ii.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const aO=yn(n=>Tw(/^(?<hashes>#+)\s$/,ii.type(n),e=>{var o,l;const t=((l=(o=e.groups)==null?void 0:o.hashes)==null?void 0:l.length)||0,i=n.get(Qe),{$from:r}=i.state.selection,s=r.node();if(s.type.name==="heading"){let a=Number(s.attrs.level)+Number(t);return a>6&&(a=6),{level:a}}return{level:t}}));L(aO,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Hs=_e("WrapInHeading",n=>e=>(e??(e=1),e<1?Nh(er.type(n)):Nh(ii.type(n),{level:e})));L(Hs,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const Tk=_e("DowngradeHeading",n=>()=>(e,t,i)=>{const{$from:r}=e.selection,s=r.node();if(s.type!==ii.type(n)||!e.selection.empty||r.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(t==null||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):Nh(er.type(n))(e,t,i)});L(Tk,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const Ak=Kn("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:n=>{const e=n.get(oe);return()=>e.call(Tk.key)}}});L(Ak.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});L(Ak.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const _k=Zi("blockquote");L(_k,{displayName:"Attr<blockquote>",group:"Blockquote"});const Dc=xt("blockquote",n=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",n.get(_k.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,t,i)=>{e.openNode(i).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));L(Dc.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});L(Dc.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const cO=yn(n=>Mw(/^\s*>\s$/,Dc.type(n)));L(cO,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const Ek=_e("WrapInBlockquote",n=>()=>Sw(Dc.type(n)));L(Ek,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const Ok=Kn("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:n=>{const e=n.get(oe);return()=>e.call(Ek.key)}}});L(Ok.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});L(Ok.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const Ik=Zi("codeBlock",()=>({pre:{},code:{}}));L(Ik,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const Rr=xt("code_block",n=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{language:e.dataset.language}}}],toDOM:e=>{const t=n.get(Ik.key)(e),i=e.attrs.language,r=i&&i.length>0?{"data-language":i}:void 0;return["pre",{...t.pre,...r},["code",t.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,t,i)=>{const r=t.lang??"",s=t.value;e.openNode(i,{language:r}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,t)=>{var i;e.addNode("code",void 0,((i=t.content.firstChild)==null?void 0:i.text)||"",{lang:t.attrs.language})}}}));L(Rr.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});L(Rr.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const uO=yn(n=>Tw(/^```(?<language>[a-z]*)?[\s\n]$/,Rr.type(n),e=>{var t;return{language:((t=e.groups)==null?void 0:t.language)??""}}));L(uO,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const Dk=_e("CreateCodeBlock",n=>(e="")=>Nh(Rr.type(n),{language:e}));L(Dk,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});const qF=_e("UpdateCodeBlockLanguage",()=>({pos:n,language:e}={pos:-1,language:""})=>(t,i)=>n>=0?(i==null||i(t.tr.setNodeAttribute(n,"language",e)),!0):!1);L(qF,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const Rk=Kn("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:n=>{const e=n.get(oe);return()=>e.call(Dk.key)}}});L(Rk.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});L(Rk.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const Nk=Zi("image");L(Nk,{displayName:"Attr<image>",group:"Image"});const zl=xt("image",n=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...n.get(Nk.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,t,i)=>{const r=t.url,s=t.alt,o=t.title;e.addNode(i,{src:r,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));L(zl.node,{displayName:"NodeSchema<image>",group:"Image"});L(zl.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const hO=_e("InsertImage",n=>(e={})=>(t,i)=>{if(!i)return!0;const{src:r="",alt:s="",title:o=""}=e,l=zl.type(n).create({src:r,alt:s,title:o});return l&&i(t.tr.replaceSelectionWith(l).scrollIntoView()),!0});L(hO,{displayName:"Command<insertImageCommand>",group:"Image"});const fO=_e("UpdateImage",n=>(e={})=>(t,i)=>{const r=zP(t.selection,zl.type(n));if(!r)return!1;const{node:s,pos:o}=r,l={...s.attrs},{src:a,alt:c,title:u}=e;return a!==void 0&&(l.src=a),c!==void 0&&(l.alt=c),u!==void 0&&(l.title=u),i==null||i(t.tr.setNodeMarkup(o,void 0,l).scrollIntoView()),!0});L(fO,{displayName:"Command<updateImageCommand>",group:"Image"});const jF=yn(n=>new Un(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,t,i,r)=>{const[s,o,l="",a]=t;return s?e.tr.replaceWith(i,r,zl.type(n).create({src:l,alt:o,title:a})):null}));L(jF,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const zm=Zi("hardbreak",n=>({"data-type":"hardbreak","data-is-inline":n.attrs.isInline}));L(zm,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const Sl=xt("hardbreak",n=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",n.get(zm.key)(e)," "]:["br",n.get(zm.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,t,i)=>{var r;e.addNode(i,{isInline:!!((r=t.data)!=null&&r.isInline)})}},leafText:()=>`
55
+ `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new U5(t,e?e.state.tabSize:4,e?Bl(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=G5(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=at.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:pF,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new at(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 at(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function G5(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let r=n(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const fk=Object.create(null),nf=[On.none],pF=new Hw(nf),c2=[],u2=Object.create(null),J5=Object.create(null);for(let[n,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"]])J5[n]=Z5(fk,e);class Y5{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),J5)}resolve(e){return e?this.table[e]||(this.table[e]=Z5(this.extra,e)):0}}const mF=new Y5(fk);function m1(n,e){c2.indexOf(n)>-1||(c2.push(n),console.warn(e))}function Z5(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=n[c]||N[c];u?typeof u=="function"?a.length?a=a.map(u):m1(c,`Modifier ${c} used at start of tag`):a.length?m1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:m1(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(l=>l.id),s=u2[r];if(s)return s.id;let o=u2[r]=On.define({id:nf.length,name:i,props:[b6({[i]:t})]});return nf.push(o),o.id}function gF(n,e){let t=On.define({id:nf.length,name:"Document",props:[tl.add(()=>n),I5.add(()=>i=>e.getIndent(i))],top:!0});return nf.push(t),t}ct.RTL,ct.LTR;function H(n){return new T6(uk.define(n))}function _s(n){return I(()=>import("./index-BGFWA6Zt.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const yF=[E.of({name:"C",extensions:["c","h","ino"],load(){return I(()=>import("./index-BmEFRKV7.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),E.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return I(()=>import("./index-BmEFRKV7.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),E.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return _s("Cassandra")}}),E.of({name:"CSS",extensions:["css"],load(){return I(()=>import("./index-C5Onm0uO.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.css())}}),E.of({name:"Go",extensions:["go"],load(){return I(()=>import("./index-C3h-b0UN.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.go())}}),E.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return I(()=>import("./index-AFp_qpAI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.html())}}),E.of({name:"Java",extensions:["java"],load(){return I(()=>import("./index-CtNjfEqK.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.java())}}),E.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return I(()=>import("./index-Jvh12pKI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript())}}),E.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return I(()=>import("./index-DsFroXrj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.jinja())}}),E.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return I(()=>import("./index-CW_ala_3.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.json())}}),E.of({name:"JSX",extensions:["jsx"],load(){return I(()=>import("./index-Jvh12pKI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),E.of({name:"LESS",extensions:["less"],load(){return I(()=>import("./index-DiSWR48t.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.less())}}),E.of({name:"Liquid",extensions:["liquid"],load(){return I(()=>import("./index-CKjzms_e.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.liquid())}}),E.of({name:"MariaDB SQL",load(){return _s("MariaSQL")}}),E.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return I(()=>import("./index-BH3jS3gm.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.markdown())}}),E.of({name:"MS SQL",load(){return _s("MSSQL")}}),E.of({name:"MySQL",load(){return _s("MySQL")}}),E.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return I(()=>import("./index-D_LadtY8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.php())}}),E.of({name:"PLSQL",extensions:["pls"],load(){return _s("PLSQL")}}),E.of({name:"PostgreSQL",load(){return _s("PostgreSQL")}}),E.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return I(()=>import("./index-CVEllvWf.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.python())}}),E.of({name:"Rust",extensions:["rs"],load(){return I(()=>import("./index-kKjFXTNL.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.rust())}}),E.of({name:"Sass",extensions:["sass"],load(){return I(()=>import("./index-DZtf3zC8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass({indented:!0}))}}),E.of({name:"SCSS",extensions:["scss"],load(){return I(()=>import("./index-DZtf3zC8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass())}}),E.of({name:"SQL",extensions:["sql"],load(){return _s("StandardSQL")}}),E.of({name:"SQLite",load(){return _s("SQLite")}}),E.of({name:"TSX",extensions:["tsx"],load(){return I(()=>import("./index-Jvh12pKI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),E.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return I(()=>import("./index-Jvh12pKI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),E.of({name:"WebAssembly",extensions:["wat","wast"],load(){return I(()=>import("./index-DxqCsnoj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.wast())}}),E.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return I(()=>import("./index-CMLI8gQy.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.xml())}}),E.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return I(()=>import("./index-CGelrSXy.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.yaml())}}),E.of({name:"APL",extensions:["dyalog","apl"],load(){return I(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(n=>H(n.apl))}}),E.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return I(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>H(n.asciiArmor))}}),E.of({name:"ASN.1",extensions:["asn","asn1"],load(){return I(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>H(n.asn1({})))}}),E.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return I(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>H(n.asterisk))}}),E.of({name:"Brainfuck",extensions:["b","bf"],load(){return I(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>H(n.brainfuck))}}),E.of({name:"Cobol",extensions:["cob","cpy"],load(){return I(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>H(n.cobol))}}),E.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.csharp))}}),E.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"ClojureScript",extensions:["cljs"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return I(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(n=>H(n.gss))}}),E.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return I(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>H(n.cmake))}}),E.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return I(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>H(n.coffeeScript))}}),E.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return I(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>H(n.commonLisp))}}),E.of({name:"Cypher",extensions:["cyp","cypher"],load(){return I(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>H(n.cypher))}}),E.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return I(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(n=>H(n.cython))}}),E.of({name:"Crystal",extensions:["cr"],load(){return I(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(n=>H(n.crystal))}}),E.of({name:"D",extensions:["d"],load(){return I(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(n=>H(n.d))}}),E.of({name:"Dart",extensions:["dart"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.dart))}}),E.of({name:"diff",extensions:["diff","patch"],load(){return I(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(n=>H(n.diff))}}),E.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return I(()=>import("./dockerfile-BKs6k2Af.js"),[],import.meta.url).then(n=>H(n.dockerFile))}}),E.of({name:"DTD",extensions:["dtd"],load(){return I(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>H(n.dtd))}}),E.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return I(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(n=>H(n.dylan))}}),E.of({name:"EBNF",load(){return I(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>H(n.ebnf))}}),E.of({name:"ECL",extensions:["ecl"],load(){return I(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(n=>H(n.ecl))}}),E.of({name:"edn",extensions:["edn"],load(){return I(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>H(n.clojure))}}),E.of({name:"Eiffel",extensions:["e"],load(){return I(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>H(n.eiffel))}}),E.of({name:"Elm",extensions:["elm"],load(){return I(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(n=>H(n.elm))}}),E.of({name:"Erlang",extensions:["erl"],load(){return I(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>H(n.erlang))}}),E.of({name:"Esper",load(){return I(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>H(n.esper))}}),E.of({name:"Factor",extensions:["factor"],load(){return I(()=>import("./factor-kuTfRLto.js"),[],import.meta.url).then(n=>H(n.factor))}}),E.of({name:"FCL",load(){return I(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>H(n.fcl))}}),E.of({name:"Forth",extensions:["forth","fth","4th"],load(){return I(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(n=>H(n.forth))}}),E.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return I(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>H(n.fortran))}}),E.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.fSharp))}}),E.of({name:"Gas",extensions:["s"],load(){return I(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(n=>H(n.gas))}}),E.of({name:"Gherkin",extensions:["feature"],load(){return I(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>H(n.gherkin))}}),E.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return I(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>H(n.groovy))}}),E.of({name:"Haskell",extensions:["hs"],load(){return I(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>H(n.haskell))}}),E.of({name:"Haxe",extensions:["hx"],load(){return I(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>H(n.haxe))}}),E.of({name:"HXML",extensions:["hxml"],load(){return I(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>H(n.hxml))}}),E.of({name:"HTTP",load(){return I(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(n=>H(n.http))}}),E.of({name:"IDL",extensions:["pro"],load(){return I(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(n=>H(n.idl))}}),E.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return I(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>H(n.jsonld))}}),E.of({name:"Julia",extensions:["jl"],load(){return I(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(n=>H(n.julia))}}),E.of({name:"Kotlin",extensions:["kt","kts"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.kotlin))}}),E.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return I(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(n=>H(n.liveScript))}}),E.of({name:"Lua",extensions:["lua"],load(){return I(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(n=>H(n.lua))}}),E.of({name:"mIRC",extensions:["mrc"],load(){return I(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>H(n.mirc))}}),E.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return I(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>H(n.mathematica))}}),E.of({name:"Modelica",extensions:["mo"],load(){return I(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>H(n.modelica))}}),E.of({name:"MUMPS",extensions:["mps"],load(){return I(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(n=>H(n.mumps))}}),E.of({name:"Mbox",extensions:["mbox"],load(){return I(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>H(n.mbox))}}),E.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return I(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>H(n.nginx))}}),E.of({name:"NSIS",extensions:["nsh","nsi"],load(){return I(()=>import("./nsis-LdVXkNf5.js"),[],import.meta.url).then(n=>H(n.nsis))}}),E.of({name:"NTriples",extensions:["nt","nq"],load(){return I(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>H(n.ntriples))}}),E.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.objectiveC))}}),E.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.objectiveCpp))}}),E.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.oCaml))}}),E.of({name:"Octave",extensions:["m"],load(){return I(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>H(n.octave))}}),E.of({name:"Oz",extensions:["oz"],load(){return I(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(n=>H(n.oz))}}),E.of({name:"Pascal",extensions:["p","pas"],load(){return I(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(n=>H(n.pascal))}}),E.of({name:"Perl",extensions:["pl","pm"],load(){return I(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>H(n.perl))}}),E.of({name:"Pig",extensions:["pig"],load(){return I(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(n=>H(n.pig))}}),E.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return I(()=>import("./powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>H(n.powerShell))}}),E.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return I(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(n=>H(n.properties))}}),E.of({name:"ProtoBuf",extensions:["proto"],load(){return I(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(n=>H(n.protobuf))}}),E.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return I(()=>import("./pug-DeIclll2.js"),[],import.meta.url).then(n=>H(n.pug))}}),E.of({name:"Puppet",extensions:["pp"],load(){return I(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>H(n.puppet))}}),E.of({name:"Q",extensions:["q"],load(){return I(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(n=>H(n.q))}}),E.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return I(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>H(n.r))}}),E.of({name:"RPM Changes",load(){return I(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>H(n.rpmChanges))}}),E.of({name:"RPM Spec",extensions:["spec"],load(){return I(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>H(n.rpmSpec))}}),E.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return I(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(n=>H(n.ruby))}}),E.of({name:"SAS",extensions:["sas"],load(){return I(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(n=>H(n.sas))}}),E.of({name:"Scala",extensions:["scala"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.scala))}}),E.of({name:"Scheme",extensions:["scm","ss"],load(){return I(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(n=>H(n.scheme))}}),E.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return I(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>H(n.shell))}}),E.of({name:"Sieve",extensions:["siv","sieve"],load(){return I(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>H(n.sieve))}}),E.of({name:"Smalltalk",extensions:["st"],load(){return I(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>H(n.smalltalk))}}),E.of({name:"Solr",load(){return I(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(n=>H(n.solr))}}),E.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return I(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>H(n.sml))}}),E.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return I(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>H(n.sparql))}}),E.of({name:"Spreadsheet",alias:["excel","formula"],load(){return I(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>H(n.spreadsheet))}}),E.of({name:"Squirrel",extensions:["nut"],load(){return I(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>H(n.squirrel))}}),E.of({name:"Stylus",extensions:["styl"],load(){return I(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(n=>H(n.stylus))}}),E.of({name:"Swift",extensions:["swift"],load(){return I(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(n=>H(n.swift))}}),E.of({name:"sTeX",load(){return I(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>H(n.stex))}}),E.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return I(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>H(n.stex))}}),E.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return I(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>H(n.verilog))}}),E.of({name:"Tcl",extensions:["tcl"],load(){return I(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>H(n.tcl))}}),E.of({name:"Textile",extensions:["textile"],load(){return I(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(n=>H(n.textile))}}),E.of({name:"TiddlyWiki",load(){return I(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>H(n.tiddlyWiki))}}),E.of({name:"Tiki wiki",load(){return I(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(n=>H(n.tiki))}}),E.of({name:"TOML",extensions:["toml"],load(){return I(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>H(n.toml))}}),E.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return I(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(n=>H(n.troff))}}),E.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return I(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>H(n.ttcn))}}),E.of({name:"TTCN_CFG",extensions:["cfg"],load(){return I(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>H(n.ttcnCfg))}}),E.of({name:"Turtle",extensions:["ttl"],load(){return I(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>H(n.turtle))}}),E.of({name:"Web IDL",extensions:["webidl"],load(){return I(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>H(n.webIDL))}}),E.of({name:"VB.NET",extensions:["vb"],load(){return I(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(n=>H(n.vb))}}),E.of({name:"VBScript",extensions:["vbs"],load(){return I(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>H(n.vbScript))}}),E.of({name:"Velocity",extensions:["vtl"],load(){return I(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(n=>H(n.velocity))}}),E.of({name:"Verilog",extensions:["v"],load(){return I(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>H(n.verilog))}}),E.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return I(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>H(n.vhdl))}}),E.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return I(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(n=>H(n.xQuery))}}),E.of({name:"Yacas",extensions:["ys"],load(){return I(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>H(n.yacas))}}),E.of({name:"Z80",extensions:["z80"],load(){return I(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>H(n.z80))}}),E.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.mscgen))}}),E.of({name:"Xù",extensions:["xu"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.xu))}}),E.of({name:"MsGenny",extensions:["msgenny"],load(){return I(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>H(n.msgenny))}}),E.of({name:"Vue",extensions:["vue"],load(){return I(()=>import("./index-Ci5Z3DWY.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.vue())}}),E.of({name:"Angular Template",load(){return I(()=>import("./index-BC221_MJ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.angular())}})],bF="#e5c07b",h2="#e06c75",wF="#56b6c2",kF="#ffffff",Wp="#abb2bf",wb="#7d8799",vF="#61afef",xF="#98c379",f2="#d19a66",CF="#c678dd",SF="#21252b",d2="#2c313a",p2="#282c34",g1="#353a42",MF="#3E4451",m2="#528bff",TF=te.theme({"&":{color:Wp,backgroundColor:p2},".cm-content":{caretColor:m2},".cm-cursor, .cm-dropCursor":{borderLeftColor:m2},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MF},".cm-panels":{backgroundColor:SF,color:Wp},".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 #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:p2,color:wb,border:"none"},".cm-activeLineGutter":{backgroundColor:d2},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:g1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:g1,borderBottomColor:g1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:d2,color:Wp}}},{dark:!0}),AF=rd.define([{tag:N.keyword,color:CF},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:h2},{tag:[N.function(N.variableName),N.labelName],color:vF},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:f2},{tag:[N.definition(N.name),N.separator],color:Wp},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:bF},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:wF},{tag:[N.meta,N.comment],color:wb},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:wb,textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:h2},{tag:[N.atom,N.bool,N.special(N.variableName)],color:f2},{tag:[N.processingInstruction,N.string,N.inserted],color:xF},{tag:N.invalid,color:kF}]),_F=[TF,z5(AF)];function sd(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-block",...e}}),n}const EF=n=>!_r(t=>t.type.name==="table")(n),Pg=et({filterNodes:EF},"blockConfig");sd(Pg,{displayName:"Ctx<blockConfig>"});function OF(n,e,t){var r;if(!n.dom.parentElement)return null;try{const s=(r=n.posAtCoords({left:e.x,top:e.y}))==null?void 0:r.inside;if(s==null||s<0)return null;let o=n.state.doc.resolve(s),l=n.state.doc.nodeAt(s),a=n.nodeDOM(s);const c=h=>{const f=o.depth>=1&&o.index(o.depth)===0;if(!(h||f))return;const p=o.before(o.depth);l=n.state.doc.nodeAt(p),a=n.nodeDOM(p),o=n.state.doc.resolve(p),t(o,l)||c(!0)},u=t(o,l);return c(!u),!a||!l?null:{node:l,$pos:o,el:a}}catch{return null}}const g2=Od.ie&&Od.ie_version<15||Od.ios&&Od.webkit_version<604,y2=20;var Wa,_f,hl,Hi,qa,$i,Vi,X5,zo,fl,dl,Ef,ja,Ua,Ka,Ga,Of,Zs;class IF{constructor(){U(this,Vi);U(this,Wa);U(this,_f);U(this,hl);U(this,Hi);U(this,qa);U(this,$i);U(this,fl);U(this,dl);U(this,Ef);U(this,ja);U(this,Ua);U(this,Ka);U(this,Ga);U(this,Of);U(this,Zs);R(this,_f,()=>{if(!C(this,Hi))return null;const e=C(this,Hi),t=C(this,Vi,zo);if(t&&be.isSelectable(e.node)){const i=be.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(i)),t.focus(),R(this,hl,i),i}return null}),R(this,hl,null),R(this,Hi,null),R(this,qa,void 0),R(this,$i,!1),R(this,dl,()=>{var e;(e=C(this,fl))==null||e.call(this,{type:"hide"}),R(this,Hi,null)}),R(this,Ef,e=>{var t;R(this,Hi,e),(t=C(this,fl))==null||t.call(this,{type:"show",active:e})}),this.bind=(e,t)=>{R(this,Wa,e),R(this,fl,t)},this.addEvent=e=>{e.addEventListener("mousedown",C(this,ja)),e.addEventListener("mouseup",C(this,Ua)),e.addEventListener("dragstart",C(this,Ka)),e.addEventListener("dragend",C(this,Ga))},this.removeEvent=e=>{e.removeEventListener("mousedown",C(this,ja)),e.removeEventListener("mouseup",C(this,Ua)),e.removeEventListener("dragstart",C(this,Ka)),e.removeEventListener("dragend",C(this,Ga))},this.unBind=()=>{R(this,fl,void 0)},R(this,ja,()=>{var e;R(this,qa,(e=C(this,Hi))==null?void 0:e.el.getBoundingClientRect()),C(this,_f).call(this)}),R(this,Ua,()=>{if(!C(this,$i)){requestAnimationFrame(()=>{var e;C(this,qa)&&((e=C(this,Vi,zo))==null||e.focus())});return}R(this,$i,!1),R(this,hl,null)}),R(this,Ka,e=>{var r;R(this,$i,!0);const t=C(this,Vi,zo);if(!t)return;t.dom.dataset.dragging="true";const i=C(this,hl);if(e.dataTransfer&&i){const s=i.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:l}=t.serializeForClipboard(s);e.dataTransfer.clearData(),e.dataTransfer.setData(g2?"Text":"text/html",o.innerHTML),g2||e.dataTransfer.setData("text/plain",l);const a=(r=C(this,Hi))==null?void 0:r.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:s,move:!0}}}),R(this,Ga,()=>{C(this,Vi,zo)&&C(this,Zs).call(this,C(this,Vi,zo))}),this.keydownCallback=e=>(C(this,dl).call(this),R(this,$i,!1),e.dom.dataset.dragging="false",!1),R(this,Of,hg((e,t)=>{if(!e.editable)return;const i=e.dom.getBoundingClientRect(),r=i.left+i.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){C(this,dl).call(this);return}const o=C(this,Vi,X5);if(!o)return;const l=OF(e,{x:r,y:t.clientY},o);if(!l){C(this,dl).call(this);return}C(this,Ef).call(this,l)},200)),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||C(this,Of).call(this,e,t),!1),this.dragoverCallback=(e,t)=>{var i;if(C(this,$i)){const r=(i=C(this,Vi,zo))==null?void 0:i.dom.parentElement;if(!r)return!1;const s=r.scrollHeight>r.clientHeight,o=r.getBoundingClientRect();if(s){if(r.scrollTop>0&&Math.abs(t.y-o.y)<y2){const c=r.scrollTop>10?r.scrollTop-10:0;return r.scrollTop=c,!1}const l=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(r.scrollTop+o.height)<l&&Math.abs(t.y-(o.height+o.y))<y2){const c=r.scrollTop+10;return r.scrollTop=c,!1}}}return!1},this.dragenterCallback=e=>{e.dragging&&(R(this,$i,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const i=t.clientX,r=t.clientY;(i<0||r<0||i>window.innerWidth||r>window.innerHeight)&&(R(this,Hi,null),C(this,Zs).call(this,e))},this.dropCallback=e=>(C(this,Zs).call(this,e),!1),this.dragendCallback=e=>{C(this,Zs).call(this,e)},R(this,Zs,e=>{R(this,$i,!1),e.dom.dataset.dragging="false"})}}Wa=new WeakMap,_f=new WeakMap,hl=new WeakMap,Hi=new WeakMap,qa=new WeakMap,$i=new WeakMap,Vi=new WeakSet,X5=function(){var e;try{return(e=C(this,Wa))==null?void 0:e.get(Pg.key).filterNodes}catch{return}},zo=function(){var e;return(e=C(this,Wa))==null?void 0:e.get(Qe)},fl=new WeakMap,dl=new WeakMap,Ef=new WeakMap,ja=new WeakMap,Ua=new WeakMap,Ka=new WeakMap,Ga=new WeakMap,Of=new WeakMap,Zs=new WeakMap;const dk=et(()=>new IF,"blockService"),Bg=et({},"blockServiceInstance");sd(dk,{displayName:"Ctx<blockService>"});sd(Bg,{displayName:"Ctx<blockServiceInstance>"});const Fg=et({},"blockSpec");sd(Fg,{displayName:"Ctx<blockSpec>"});const pk=Pt(n=>{const e=new yt("MILKDOWN_BLOCK"),i=n.get(dk.key)();n.set(Bg.key,i);const r=n.get(Fg.key);return new gt({key:e,...r,props:{...r.props,handleDOMEvents:{drop:s=>i.dropCallback(s),pointermove:(s,o)=>i.mousemoveCallback(s,o),keydown:s=>i.keydownCallback(s),dragover:(s,o)=>i.dragoverCallback(s,o),dragleave:(s,o)=>i.dragleaveCallback(s,o),dragenter:s=>i.dragenterCallback(s),dragend:s=>i.dragendCallback(s)}}})});sd(pk,{displayName:"Prose<block>"});var Pn,rs,pl,ml,If,Ja,Df,Rf,Ya,Za,Xa,ag,Q5;class DF{constructor(e){U(this,ag);U(this,Pn);U(this,rs);U(this,pl);U(this,ml);U(this,If);U(this,Ja);U(this,Df);U(this,Rf);U(this,Ya);U(this,Za);U(this,Xa);R(this,ml,null),R(this,Ja,!1),this.update=()=>{requestAnimationFrame(()=>{if(!C(this,Ja))try{Td(this,ag,Q5).call(this),R(this,Ja,!0)}catch{}})},this.destroy=()=>{var t,i;(t=C(this,pl))==null||t.unBind(),(i=C(this,pl))==null||i.removeEvent(C(this,Pn)),C(this,Pn).remove()},this.show=t=>{const i=t.el,r=C(this,rs).get(Qe).dom,s={ctx:C(this,rs),active:t,editorDom:r,blockDom:C(this,Pn)},o={contextElement:i,getBoundingClientRect:()=>C(this,Za)?C(this,Za).call(this,s):i.getBoundingClientRect()},l=[ow()];if(C(this,Ya)){const a=C(this,Ya).call(this,s),c=El(a);l.push(c)}Or(o,C(this,Pn),{placement:C(this,Xa)?C(this,Xa).call(this,s):"left",middleware:[...l,...C(this,Df)],...C(this,Rf)}).then(({x:a,y:c})=>{Object.assign(C(this,Pn).style,{left:`${a}px`,top:`${c}px`}),C(this,Pn).dataset.show="true"}).catch(console.error)},this.hide=()=>{C(this,Pn).dataset.show="false"},R(this,rs,e.ctx),R(this,Pn,e.content),R(this,Ya,e.getOffset),R(this,Za,e.getPosition),R(this,Xa,e.getPlacement),R(this,Df,e.middleware??[]),R(this,Rf,e.floatingUIOptions??{}),R(this,If,e.root),this.hide()}get active(){return C(this,ml)}}Pn=new WeakMap,rs=new WeakMap,pl=new WeakMap,ml=new WeakMap,If=new WeakMap,Ja=new WeakMap,Df=new WeakMap,Rf=new WeakMap,Ya=new WeakMap,Za=new WeakMap,Xa=new WeakMap,ag=new WeakSet,Q5=function(){const e=C(this,rs).get(Qe);(C(this,If)??e.dom.parentElement??document.body).appendChild(C(this,Pn));const i=C(this,rs).get(Bg.key);i.bind(C(this,rs),r=>{r.type==="hide"?(this.hide(),R(this,ml,null)):r.type==="show"&&(this.show(r.active),R(this,ml,r.active))}),R(this,pl,i),C(this,pl).addEvent(C(this,Pn)),C(this,Pn).draggable=!0};const Hg=[Fg,Pg,dk,Bg,pk];Hg.key=Fg.key;Hg.pluginKey=pk.key;function RF(n,e){return function(t,i){let{$from:r,$to:s,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(s))return!1;let l=r.node(-1);if(l.type!=n)return!1;if(r.parent.content.size==0&&r.node(-1).childCount==r.indexAfter(-1)){if(r.depth==3||r.node(-3).type!=n||r.index(-2)!=r.node(-2).childCount-1)return!1;if(i){let h=G.empty,f=r.index(-1)?1:r.index(-2)?2:3;for(let y=r.depth-f;y>=r.depth-3;y--)h=G.from(r.node(y).copy(h));let d=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;h=h.append(G.from(n.createAndFill()));let p=r.before(r.depth-(f-1)),m=t.tr.replace(p,r.after(-d),new X(h,4-f,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(y,b)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=b+1)}),g>-1&&m.setSelection(Ee.near(m.doc.resolve(g))),i(m.scrollIntoView())}return!0}let a=s.pos==r.end()?l.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,s.pos),u=a?[null,{type:a}]:void 0;return nh(c.doc,r.pos,2,u)?(i&&i(c.split(r.pos,2,u).scrollIntoView()),!0):!1}}function NF(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?LF(e,t,n,s):PF(e,t,s):!0:!1}}function LF(n,e,t,i){let r=n.tr,s=i.end,o=i.$to.end(i.depth);s<o&&(r.step(new hn(s-1,o,s,o,new X(G.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new UT(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=yg(i);if(l==null)return!1;r.lift(i,l);let a=r.doc.resolve(r.mapping.map(s,-1)-1);return bg(r.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&r.join(a.pos),e(r.scrollIntoView()),!0}function PF(n,e,t){let i=n.tr,r=t.parent;for(let d=t.end,p=t.endIndex-1,m=t.startIndex;p>m;p--)d-=r.child(p).nodeSize,i.delete(d-1,d+1);let s=i.doc.resolve(t.start),o=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==r.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?G.empty:G.from(r))))return!1;let h=s.pos,f=h+o.nodeSize;return i.step(new hn(h-(l?1:0),f+(a?1:0),h+1,f-1,new X((l?G.empty:G.from(r.copy(G.empty))).append(a?G.empty:G.from(r.copy(G.empty))),l?0:1,a?0:1),l?0:1)),e(i.scrollIntoView()),!0}function BF(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=G.from(c?n.create():null),h=new X(G.from(n.create(null,G.from(l.type.create(null,u)))),c?3:1,0),f=s.start,d=s.end;t(e.tr.step(new hn(f-(c?3:1),d,f,d,h,1,!0)).scrollIntoView())}return!0}}function FF(n){const e=new Map;if(!n||!n.type)throw new Error("mdast-util-definitions expected node");return Co(n,"definition",function(i){const r=b2(i.identifier);r&&!e.get(r)&&e.set(r,i)}),t;function t(i){const r=b2(i);return e.get(r)}}function b2(n){return String(n||"").toUpperCase()}function HF(){return function(n){const e=FF(n);Co(n,function(t,i,r){if(t.type==="definition"&&r!==void 0&&typeof i=="number")return r.children.splice(i,1),[ay,i];if(t.type==="imageReference"||t.type==="linkReference"){const s=e(t.identifier);if(s&&r&&typeof i=="number")return r.children[i]=t.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:t.alt}:{type:"link",url:s.url,title:s.title,children:t.children},[ay,i]}})}}function eO(n,e){var r;if(!(e.childCount>=1&&((r=e.lastChild)==null?void 0:r.type.name)==="hardbreak")){n.next(e.content);return}const i=[];e.content.forEach((s,o,l)=>{l!==e.childCount-1&&i.push(s)}),n.next(G.fromArray(i))}function L(n,e){return Object.assign(n,{meta:{package:"@milkdown/preset-commonmark",...e}}),n}const mk=Xf("emphasis");L(mk,{displayName:"Attr<emphasis>",group:"Emphasis"});const Vl=_c("emphasis",n=>({attrs:{marker:{default:n.get(sh).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",n.get(mk.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));L(Vl.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});L(Vl.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const $g=_e("ToggleEmphasis",n=>()=>vg(Vl.type(n)));L($g,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const tO=yn(n=>Gf(/(?:^|[^*])\*([^*]+)\*$/,Vl.type(n),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));L(tO,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const nO=yn(n=>Gf(/\b_(?![_\s])(.*?[^_\s])_\b/,Vl.type(n),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));L(nO,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const gk=Kn("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:n=>{const e=n.get(oe);return()=>e.call($g.key)}}});L(gk.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});L(gk.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const yk=Xf("strong");L(yk,{displayName:"Attr<strong>",group:"Strong"});const Ic=_c("strong",n=>({attrs:{marker:{default:n.get(sh).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",n.get(yk.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));L(Ic.mark,{displayName:"MarkSchema<strong>",group:"Strong"});L(Ic.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const Vg=_e("ToggleStrong",n=>()=>vg(Ic.type(n)));L(Vg,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const iO=yn(n=>Gf(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Ic.type(n),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));L(iO,{displayName:"InputRule<strong>",group:"Strong"});const bk=Kn("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:n=>{const e=n.get(oe);return()=>e.call(Vg.key)}}});L(bk.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});L(bk.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const wk=Xf("inlineCode");L(wk,{displayName:"Attr<inlineCode>",group:"InlineCode"});const hs=_c("inlineCode",n=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:e=>["code",n.get(wk.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,t,i)=>{e.openMark(i),e.addText(t.value),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,t,i)=>{e.withMark(t,"inlineCode",i.text||"")}}}));L(hs.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});L(hs.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const zg=_e("ToggleInlineCode",n=>()=>(e,t)=>{const{selection:i,tr:r}=e;if(i.empty)return!1;const{from:s,to:o}=i;return e.doc.rangeHasMark(s,o,hs.type(n))?(t==null||t(r.removeMark(s,o,hs.type(n))),!0):(Object.keys(e.schema.marks).filter(c=>c!==hs.type.name).map(c=>e.schema.marks[c]).forEach(c=>{r.removeMark(s,o,c)}),t==null||t(r.addMark(s,o,hs.type(n).create())),!0)});L(zg,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const rO=yn(n=>Gf(/(?:`)([^`]+)(?:`)$/,hs.type(n)));L(rO,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const kk=Kn("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:n=>{const e=n.get(oe);return()=>e.call(zg.key)}}});L(kk.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});L(kk.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const vk=Xf("link");L(vk,{displayName:"Attr<link>",group:"Link"});const Ui=_c("link",n=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...n.get(vk.key)(e),...e.attrs}],parseMarkdown:{match:e=>e.type==="link",runner:(e,t,i)=>{const r=t.url,s=t.title;e.openMark(i,{href:r,title:s}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));L(Ui.mark,{displayName:"MarkSchema<link>",group:"Link"});const sO=_e("ToggleLink",n=>(e={})=>vg(Ui.type(n),e));L(sO,{displayName:"Command<toggleLinkCommand>",group:"Link"});const oO=_e("UpdateLink",n=>(e={})=>(t,i)=>{if(!i)return!1;let r,s=-1;const{selection:o}=t,{from:l,to:a}=o;if(t.doc.nodesBetween(l,l===a?a+1:a,(p,m)=>{if(Ui.type(n).isInSet(p.marks))return r=p,s=m,!1}),!r)return!1;const c=r.marks.find(({type:p})=>p===Ui.type(n));if(!c)return!1;const u=s,h=s+r.nodeSize,{tr:f}=t,d=Ui.type(n).create({...c.attrs,...e});return d?(i(f.removeMark(u,h,c).addMark(u,h,d).setSelection(new ue(f.selection.$anchor)).scrollIntoView()),!0):!1});L(oO,{displayName:"Command<updateLinkCommand>",group:"Link"});const lO=Fw("doc",()=>({content:"block+",parseMarkdown:{match:({type:n})=>n==="root",runner:(n,e,t)=>{n.injectRoot(e,t)}},toMarkdown:{match:n=>n.type.name==="doc",runner:(n,e)=>{n.openNode("root"),n.next(e.content)}}}));L(lO,{displayName:"NodeSchema<doc>",group:"Doc"});function $F(n){return fw(n,e=>{var t;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((t=e.value)==null?void 0:t.trim())},(e,t)=>{if(!t.length)return;const i=t[t.length-1];if(!i)return;const r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)},!0)}const Wg=Xi("remark-preserve-empty-line",()=>()=>$F);L(Wg.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});L(Wg.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const xk=Zi("paragraph");L(xk,{displayName:"Attr<paragraph>",group:"Paragraph"});const er=xt("paragraph",n=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",n.get(xk.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,t,i)=>{e.openNode(i),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,t)=>{var s;const r=(s=n.get(Qe).state)==null?void 0:s.doc.lastChild;e.openNode("paragraph"),(!t.content||t.content.size===0)&&t!==r&&VF(n)?e.addNode("html",void 0,"<br />"):eO(e,t),e.closeNode()}}}));function VF(n){let e=!1;try{n.get(Wg.id),e=!0}catch{e=!1}return e}L(er.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});L(er.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const Ck=_e("TurnIntoText",n=>()=>Nh(er.type(n)));L(Ck,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const Sk=Kn("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:n=>{const e=n.get(oe);return()=>e.call(Ck.key)}}});L(Sk.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});L(Sk.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const zF=Array(6).fill(0).map((n,e)=>e+1);function WF(n){return n.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const qg=et(WF,"headingIdGenerator");L(qg,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const Mk=Zi("heading");L(Mk,{displayName:"Attr<heading>",group:"Heading"});const ii=xt("heading",n=>{const e=n.get(qg.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:zF.map(t=>({tag:`h${t}`,getAttrs:i=>{if(!(i instanceof HTMLElement))throw Yi(i);return{level:t,id:i.id}}})),toDOM:t=>[`h${t.attrs.level}`,{...n.get(Mk.key)(t),id:t.attrs.id||e(t)},0],parseMarkdown:{match:({type:t})=>t==="heading",runner:(t,i,r)=>{const s=i.depth;t.openNode(r,{level:s}),t.next(i.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="heading",runner:(t,i)=>{t.openNode("heading",void 0,{depth:i.attrs.level}),eO(t,i),t.closeNode()}}}});L(ii.node,{displayName:"NodeSchema<heading>",group:"Heading"});L(ii.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const aO=yn(n=>Tw(/^(?<hashes>#+)\s$/,ii.type(n),e=>{var o,l;const t=((l=(o=e.groups)==null?void 0:o.hashes)==null?void 0:l.length)||0,i=n.get(Qe),{$from:r}=i.state.selection,s=r.node();if(s.type.name==="heading"){let a=Number(s.attrs.level)+Number(t);return a>6&&(a=6),{level:a}}return{level:t}}));L(aO,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Hs=_e("WrapInHeading",n=>e=>(e??(e=1),e<1?Nh(er.type(n)):Nh(ii.type(n),{level:e})));L(Hs,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const Tk=_e("DowngradeHeading",n=>()=>(e,t,i)=>{const{$from:r}=e.selection,s=r.node();if(s.type!==ii.type(n)||!e.selection.empty||r.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(t==null||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):Nh(er.type(n))(e,t,i)});L(Tk,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const Ak=Kn("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:n=>{const e=n.get(oe);return()=>e.call(Hs.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:n=>{const e=n.get(oe);return()=>e.call(Tk.key)}}});L(Ak.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});L(Ak.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const _k=Zi("blockquote");L(_k,{displayName:"Attr<blockquote>",group:"Blockquote"});const Dc=xt("blockquote",n=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",n.get(_k.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,t,i)=>{e.openNode(i).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));L(Dc.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});L(Dc.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const cO=yn(n=>Mw(/^\s*>\s$/,Dc.type(n)));L(cO,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const Ek=_e("WrapInBlockquote",n=>()=>Sw(Dc.type(n)));L(Ek,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const Ok=Kn("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:n=>{const e=n.get(oe);return()=>e.call(Ek.key)}}});L(Ok.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});L(Ok.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const Ik=Zi("codeBlock",()=>({pre:{},code:{}}));L(Ik,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const Rr=xt("code_block",n=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{language:e.dataset.language}}}],toDOM:e=>{const t=n.get(Ik.key)(e),i=e.attrs.language,r=i&&i.length>0?{"data-language":i}:void 0;return["pre",{...t.pre,...r},["code",t.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,t,i)=>{const r=t.lang??"",s=t.value;e.openNode(i,{language:r}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,t)=>{var i;e.addNode("code",void 0,((i=t.content.firstChild)==null?void 0:i.text)||"",{lang:t.attrs.language})}}}));L(Rr.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});L(Rr.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const uO=yn(n=>Tw(/^```(?<language>[a-z]*)?[\s\n]$/,Rr.type(n),e=>{var t;return{language:((t=e.groups)==null?void 0:t.language)??""}}));L(uO,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const Dk=_e("CreateCodeBlock",n=>(e="")=>Nh(Rr.type(n),{language:e}));L(Dk,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});const qF=_e("UpdateCodeBlockLanguage",()=>({pos:n,language:e}={pos:-1,language:""})=>(t,i)=>n>=0?(i==null||i(t.tr.setNodeAttribute(n,"language",e)),!0):!1);L(qF,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const Rk=Kn("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:n=>{const e=n.get(oe);return()=>e.call(Dk.key)}}});L(Rk.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});L(Rk.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const Nk=Zi("image");L(Nk,{displayName:"Attr<image>",group:"Image"});const zl=xt("image",n=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...n.get(Nk.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,t,i)=>{const r=t.url,s=t.alt,o=t.title;e.addNode(i,{src:r,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));L(zl.node,{displayName:"NodeSchema<image>",group:"Image"});L(zl.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const hO=_e("InsertImage",n=>(e={})=>(t,i)=>{if(!i)return!0;const{src:r="",alt:s="",title:o=""}=e,l=zl.type(n).create({src:r,alt:s,title:o});return l&&i(t.tr.replaceSelectionWith(l).scrollIntoView()),!0});L(hO,{displayName:"Command<insertImageCommand>",group:"Image"});const fO=_e("UpdateImage",n=>(e={})=>(t,i)=>{const r=zP(t.selection,zl.type(n));if(!r)return!1;const{node:s,pos:o}=r,l={...s.attrs},{src:a,alt:c,title:u}=e;return a!==void 0&&(l.src=a),c!==void 0&&(l.alt=c),u!==void 0&&(l.title=u),i==null||i(t.tr.setNodeMarkup(o,void 0,l).scrollIntoView()),!0});L(fO,{displayName:"Command<updateImageCommand>",group:"Image"});const jF=yn(n=>new Un(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,t,i,r)=>{const[s,o,l="",a]=t;return s?e.tr.replaceWith(i,r,zl.type(n).create({src:l,alt:o,title:a})):null}));L(jF,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const zm=Zi("hardbreak",n=>({"data-type":"hardbreak","data-is-inline":n.attrs.isInline}));L(zm,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const Sl=xt("hardbreak",n=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",n.get(zm.key)(e)," "]:["br",n.get(zm.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,t,i)=>{var r;e.addNode(i,{isInline:!!((r=t.data)!=null&&r.isInline)})}},leafText:()=>`
56
56
  `,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,`
57
57
  `):e.addNode("break")}}}));L(Sl.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});L(Sl.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const Lk=_e("InsertHardbreak",n=>()=>(e,t)=>{var s;const{selection:i,tr:r}=e;if(!(i instanceof ue))return!1;if(i.empty){const o=i.$from.node();if(o.childCount>0&&((s=o.lastChild)==null?void 0:s.type.name)==="hardbreak")return t==null||t(r.replaceRangeWith(i.to-1,i.to,e.schema.node("paragraph")).setSelection(Ee.near(r.doc.resolve(i.to))).scrollIntoView()),!0}return t==null||t(r.setMeta("hardbreak",!0).replaceSelectionWith(Sl.type(n).create()).scrollIntoView()),!0});L(Lk,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const Pk=Kn("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:n=>{const e=n.get(oe);return()=>e.call(Lk.key)}}});L(Pk.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});L(Pk.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const Bk=Zi("hr");L(Bk,{displayName:"Attr<hr>",group:"Hr"});const Rc=xt("hr",n=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",n.get(Bk.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,t,i)=>{e.addNode(i)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));L(Rc.node,{displayName:"NodeSchema<hr>",group:"Hr"});L(Rc.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const dO=yn(n=>new Un(/^(?:---|___\s|\*\*\*\s)$/,(e,t,i,r)=>{const{tr:s}=e;return t[0]&&s.replaceWith(i-1,r,Rc.type(n).create()),s}));L(dO,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const pO=_e("InsertHr",n=>()=>(e,t)=>{if(!t)return!0;const i=er.node.type(n).create(),{tr:r,selection:s}=e,{from:o}=s,l=Rc.type(n).create();if(!l)return!0;const a=r.replaceSelectionWith(l).insert(o,i),c=Ee.findFrom(a.doc.resolve(o),1,!0);return c&&t(a.setSelection(c).scrollIntoView()),!0});L(pO,{displayName:"Command<insertHrCommand>",group:"Hr"});const Fk=Zi("bulletList");L(Fk,{displayName:"Attr<bulletList>",group:"BulletList"});const Wl=xt("bullet_list",n=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...n.get(Fk.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!t,runner:(e,t,i)=>{const r=t.spread!=null?`${t.spread}`:"false";e.openNode(i,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));L(Wl.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});L(Wl.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const mO=yn(n=>Mw(/^\s*([-+*])\s$/,Wl.type(n)));L(mO,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const Hk=_e("WrapInBulletList",n=>()=>Sw(Wl.type(n)));L(Hk,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const $k=Kn("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:n=>{const e=n.get(oe);return()=>e.call(Hk.key)}}});L($k.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});L($k.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Vk=Zi("orderedList");L(Vk,{displayName:"Attr<orderedList>",group:"OrderedList"});const ql=xt("ordered_list",n=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...n.get(Vk.key)(e),...e.attrs.order===1?{}:e.attrs.order,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!!t,runner:(e,t,i)=>{const r=t.spread!=null?`${t.spread}`:"true";e.openNode(i,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:t.attrs.spread==="true"}),e.next(t.content),e.closeNode()}}}));L(ql.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});L(ql.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const gO=yn(n=>Mw(/^\s*(\d+)\.\s$/,ql.type(n),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));L(gO,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const zk=_e("WrapInOrderedList",n=>()=>Sw(ql.type(n)));L(zk,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Wk=Kn("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:n=>{const e=n.get(oe);return()=>e.call(zk.key)}}});L(Wk.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});L(Wk.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const qk=Zi("listItem");L(qk,{displayName:"Attr<listItem>",group:"ListItem"});const tr=xt("list_item",n=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw Yi(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...n.get(qk.key)(e),"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e})=>e==="listItem",runner:(e,t,i)=>{const r=t.label!=null?`${t.label}.`:"•",s=t.label!=null?"ordered":"bullet",o=t.spread!=null?`${t.spread}`:"true";e.openNode(i,{label:r,listType:s,spread:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="list_item",runner:(e,t)=>{e.openNode("listItem",void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));L(tr.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});L(tr.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const jk=_e("SinkListItem",n=>()=>BF(tr.type(n)));L(jk,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const Uk=_e("LiftListItem",n=>()=>NF(tr.type(n)));L(Uk,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const Kk=_e("SplitListItem",n=>()=>RF(tr.type(n)));L(Kk,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function UF(n){return(e,t,i)=>{const{selection:r}=e;if(!(r instanceof ue))return!1;const{empty:s,$from:o}=r;return!s||o.parentOffset!==0||o.node(-1).type!==tr.type(n)?!1:HA(e,t,i)}}const Gk=_e("LiftFirstListItem",n=>()=>UF(n));L(Gk,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});const Jk=Kn("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:n=>{const e=n.get(oe);return()=>e.call(Kk.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:n=>{const e=n.get(oe);return()=>e.call(jk.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:n=>{const e=n.get(oe);return()=>e.call(Uk.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:n=>{const e=n.get(oe);return()=>e.call(Gk.key)}}});L(Jk.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});L(Jk.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const yO=Fw("text",()=>({group:"inline",parseMarkdown:{match:({type:n})=>n==="text",runner:(n,e)=>{n.addText(e.value)}},toMarkdown:{match:n=>n.type.name==="text",runner:(n,e)=>{n.addNode("text",void 0,e.text)}}}));L(yO,{displayName:"NodeSchema<text>",group:"Text"});const Yk=Zi("html");L(Yk,{displayName:"Attr<html>",group:"Html"});const Zk=xt("html",n=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{const t=document.createElement("span"),i={...n.get(Yk.key)(e),"data-value":e.attrs.value,"data-type":"html"};return t.textContent=e.attrs.value,["span",i,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,t,i)=>{e.addNode(i,{value:t.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}}));L(Zk.node,{displayName:"NodeSchema<html>",group:"Html"});L(Zk.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const KF=[lO,xk,er,qg,Mk,ii,zm,Sl,_k,Dc,Ik,Rr,Bk,Rc,Nk,zl,Fk,Wl,Vk,ql,qk,tr,mk,Vl,yk,Ic,wk,hs,vk,Ui,Yk,Zk,yO].flat(),GF=[cO,mO,gO,uO,dO,aO].flat(),JF=[tO,nO,rO,iO],sa=_e("IsMarkSelected",()=>n=>e=>{if(!n)return!1;const{doc:t,selection:i}=e;return t.rangeHasMark(i.from,i.to,n)}),bO=_e("IsNoteSelected",()=>n=>e=>n?e_(e,n).hasNode:!1),Gt=_e("ClearTextInCurrentBlock",()=>()=>(n,e)=>{let t=n.tr;const{$from:i,$to:r}=t.selection,{pos:s}=i,{pos:o}=r,l=s-i.node().content.size;return l<0?!1:(t=t.deleteRange(l,o),e==null||e(t),!0)}),Ur=_e("SetBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;const s=e.tr,{from:o,to:l}=s.selection;try{s.setBlockType(o,l,i,r)}catch{return!1}return t==null||t(s),!0}),Lu=_e("WrapInBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;let s=e.tr;try{const{$from:o,$to:l}=s.selection,a=o.blockRange(l),c=a&&bw(a,i,r);if(!c)return!1;s=s.wrap(a,c)}catch{return!1}return t==null||t(s),!0}),Pu=_e("AddBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;const s=e.tr;try{const o=i instanceof Mi?i:i.createAndFill(r);if(!o)return!1;s.replaceSelectionWith(o)}catch{return!1}return t==null||t(s),!0}),wO=_e("SelectTextNearPos",()=>n=>(e,t)=>{const{pos:i}=n??{};if(i==null)return!1;const r=(o,l,a)=>Math.min(Math.max(o,l),a),s=e.tr;try{const o=e.doc.resolve(r(i,0,e.doc.content.size));s.setSelection(ue.near(o))}catch{return!1}return t==null||t(s.scrollIntoView()),!0}),YF=[Ck,Ek,Hs,Tk,Dk,Lk,pO,hO,fO,zk,Hk,jk,Kk,Uk,Gk,$g,zg,Vg,sO,oO,sa,bO,Gt,Ur,Lu,Pu,wO],ZF=[Ok,Rk,Pk,Ak,Jk,Wk,$k,Sk,gk,kk,bk].flat(),Xk=Xi("remarkAddOrderInList",()=>()=>n=>{Co(n,"list",e=>{if(e.ordered){const t=e.start??1;e.children.forEach((i,r)=>{i.label=r+t})}})});L(Xk.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});L(Xk.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});const Qk=Xi("remarkLineBreak",()=>()=>n=>{const e=/[\t ]*(?:\r?\n|\r)/g;Co(n,"text",(t,i,r)=>{if(!t.value||typeof t.value!="string")return;const s=[];let o=0;e.lastIndex=0;let l=e.exec(t.value);for(;l;){const c=l.index;o!==c&&s.push({type:"text",value:t.value.slice(o,c)}),s.push({type:"break",data:{isInline:!0}}),o=c+l[0].length,l=e.exec(t.value)}if(s.length>0&&r&&typeof i=="number")return o<t.value.length&&s.push({type:"text",value:t.value.slice(o)}),r.children.splice(i,1,...s),i+s.length})});L(Qk.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});L(Qk.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});const ev=Xi("remarkInlineLink",()=>HF);L(ev.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});L(ev.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});const XF=n=>!!n.children,QF=n=>n.type==="html";function eH(n,e){return t(n,0,null)[0];function t(i,r,s){if(XF(i)){const o=[];for(let l=0,a=i.children.length;l<a;l++){const c=i.children[l];if(c){const u=t(c,l,i);if(u)for(let h=0,f=u.length;h<f;h++){const d=u[h];d&&o.push(d)}}}i.children=o}return e(i,r,s)}}const tH=["root","blockquote","listItem"],tv=Xi("remarkHTMLTransformer",()=>()=>n=>{eH(n,(e,t,i)=>QF(e)?(i&&tH.includes(i.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])});L(tv.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});L(tv.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});const nv=Xi("remarkMarker",()=>()=>(n,e)=>{const t=i=>e.value.charAt(i.position.start.offset);Co(n,i=>["strong","emphasis"].includes(i.type),i=>{i.marker=t(i)})});L(nv.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});L(nv.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});const kO=Pt(()=>{let n=!1;const e=new yt("MILKDOWN_INLINE_NODES_CURSOR"),t=new gt({key:e,state:{init(){return!1},apply(i){if(!i.selection.empty)return!1;const r=i.selection.$from,s=r.nodeBefore,o=r.nodeAfter;return!!(s&&o&&s.isInline&&!s.isText&&o.isInline&&!o.isText)}},props:{handleDOMEvents:{compositionend:(i,r)=>n?(n=!1,requestAnimationFrame(()=>{if(t.getState(i.state)){const o=i.state.selection.from;r.preventDefault(),i.dispatch(i.state.tr.insertText(r.data||"",o))}}),!0):!1,compositionstart:i=>(t.getState(i.state)&&(n=!0),!1),beforeinput:(i,r)=>{if(t.getState(i.state)&&r instanceof InputEvent&&r.data&&!n){const o=i.state.selection.from;return r.preventDefault(),i.dispatch(i.state.tr.insertText(r.data||"",o)),!0}return!1}},decorations(i){if(t.getState(i)){const o=i.selection.$from.pos,l=document.createElement("span"),a=En.widget(o,l,{side:-1}),c=document.createElement("span"),u=En.widget(o,c);return setTimeout(()=>{l.contentEditable="true",c.contentEditable="true"}),lt.create(i.doc,[a,u])}return lt.empty}}});return t});L(kO,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const vO=Pt(n=>new gt({key:new yt("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,i)=>{if(!e.length)return;const[r]=e;if(!r)return;const[s]=r.steps;if(r.getMeta("hardbreak")){if(!(s instanceof Vt))return;const{from:a}=s;return i.tr.setNodeMarkup(a,Sl.type(n),void 0,[])}if(s instanceof as){let a=i.tr;const{from:c,to:u}=s;return i.doc.nodesBetween(c,u,(h,f)=>{h.type===Sl.type(n)&&(a=a.setNodeMarkup(f,Sl.type(n),void 0,[]))}),a}}}));L(vO,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const iv=et(["table","code_block"],"hardbreakFilterNodes");L(iv,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const xO=Pt(n=>{const e=n.get(iv.key);return new gt({key:new yt("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(t,i)=>{const r=t.getMeta("hardbreak"),[s]=t.steps;if(r&&s){const{from:o}=s,l=i.doc.resolve(o);let a=l.depth,c=!0;for(;a>0;)e.includes(l.node(a).type.name)&&(c=!1),a--;return c}return!0}})});L(xO,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const CO=Pt(n=>{const e=new yt("MILKDOWN_HEADING_ID"),t=i=>{if(i.composing)return;const r=n.get(qg.key),s=i.state.tr.setMeta("addToHistory",!1);let o=!1;const l={};i.state.doc.descendants((a,c)=>{if(a.type===ii.type(n)){if(a.textContent.trim().length===0)return;const u=a.attrs;let h=r(a);l[h]?(l[h]+=1,h+=`-#${l[h]}`):l[h]=1,u.id!==h&&(o=!0,s.setMeta(e,!0).setNodeMarkup(c,void 0,{...u,id:h}))}}),o&&i.dispatch(s)};return new gt({key:e,view:i=>(t(i),{update:(r,s)=>{r.state.doc.eq(s.doc)||t(r)}})})});L(CO,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const SO=Pt(n=>{const e=(t,i,r)=>{if(!r.selection||t.some(h=>h.getMeta("addToHistory")===!1||!h.isGeneric))return null;const s=ql.type(n),o=Wl.type(n),l=tr.type(n),a=(h,f)=>{let d=!1;const p=`${f+1}.`;return h.label!==p&&(h.label=p,d=!0),d};let c=r.tr,u=!1;return r.doc.descendants((h,f,d,p)=>{if(h.type===o){const m=h.maybeChild(0);(m==null?void 0:m.type)===l&&m.attrs.listType==="ordered"&&(u=!0,c.setNodeMarkup(f,s,{spread:"true"}),h.descendants((g,y,b,w)=>{if(g.type===l){const k={...g.attrs};a(k,w)&&(c=c.setNodeMarkup(y,void 0,k))}return!1}))}else if(h.type===l&&(d==null?void 0:d.type)===s){const m={...h.attrs};let g=!1;m.listType!=="ordered"&&(m.listType="ordered",g=!0),(d==null?void 0:d.maybeChild(0))&&(g=a(m,p)),g&&(c=c.setNodeMarkup(f,void 0,m),u=!0)}}),u?c.setMeta("addToHistory",!1):null};return new gt({key:new yt("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});L(SO,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const nH=[vO,iv,xO,kO,Xk,ev,Qk,tv,nv,Wg,CO,SO].flat(),iH=[KF,GF,JF,YF,ZF,nH].flat();/**
58
58
  * @vue/shared v3.5.27