@i14ks/ccv 0.50.0 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/bundle/ccv.mjs +617 -264
  2. package/package.json +1 -1
  3. package/web/assets/{MarkdownTextEditor-DoP0b52_.js → MarkdownTextEditor-JS5gfhvn.js} +1 -1
  4. package/web/assets/{abnfDiagram-S7VZAUFO-CApqnaGR.js → abnfDiagram-S7VZAUFO-NiQLnUk4.js} +1 -1
  5. package/web/assets/{architectureDiagram-YGSQEFNW-jwCcwggk.js → architectureDiagram-YGSQEFNW-CacJXhkP.js} +1 -1
  6. package/web/assets/{blockDiagram-APKKGZFW-Bji4PkTF.js → blockDiagram-APKKGZFW-CQmfctFs.js} +1 -1
  7. package/web/assets/{c4Diagram-KJ2TOQU5-BFRf3dTO.js → c4Diagram-KJ2TOQU5-BvlnxWev.js} +1 -1
  8. package/web/assets/{chunk-2Q5K7J3B-DUFwqu3B.js → chunk-2Q5K7J3B-Cgc58TSE.js} +1 -1
  9. package/web/assets/{chunk-5VM5RSS4-BNCdpRtw.js → chunk-5VM5RSS4-C1bWQfyK.js} +1 -1
  10. package/web/assets/{chunk-HFQBQIA3-D8sImu8E.js → chunk-HFQBQIA3-C7a1_mVn.js} +1 -1
  11. package/web/assets/{chunk-JWPE2WC7-BhL2yBgo.js → chunk-JWPE2WC7-C18blVa-.js} +1 -1
  12. package/web/assets/{chunk-KQLB2F66-pFBglgtP.js → chunk-KQLB2F66-CI40AH6D.js} +2 -2
  13. package/web/assets/{chunk-KS47KZWR-BrLOmWWS.js → chunk-KS47KZWR-DqUN9A3o.js} +1 -1
  14. package/web/assets/{chunk-OY52VR5R-Cgk3JXPf.js → chunk-OY52VR5R-NLJNl2SH.js} +1 -1
  15. package/web/assets/{chunk-TU62E6Q5-e2yCDokg.js → chunk-TU62E6Q5-Dfc2QrQc.js} +1 -1
  16. package/web/assets/{chunk-XXDRQBXY-DU6jFvHG.js → chunk-XXDRQBXY-BbvDRTY2.js} +1 -1
  17. package/web/assets/{classDiagram-v2-L25IHNXF-Bt1zi6CS.js → classDiagram-v2-L25IHNXF-C70BAnHO.js} +1 -1
  18. package/web/assets/{codemirror-CNxAt-Eg.js → codemirror-C9-rbUS5.js} +1 -1
  19. package/web/assets/{codemirrorImages-C30a2wIG.js → codemirrorImages-Ddzgh4gP.js} +1 -1
  20. package/web/assets/{cose-bilkent-JH36ORCC-CYITjt4m.js → cose-bilkent-JH36ORCC-BpSbzUvj.js} +1 -1
  21. package/web/assets/{cynefin-EF2NZ3EQ-BiYmPyip.js → cynefin-EF2NZ3EQ-BOIqStKg.js} +1 -1
  22. package/web/assets/{cynefinDiagram-L36ESFBY-DiITK0W-.js → cynefinDiagram-L36ESFBY-DfDb4Bbh.js} +1 -1
  23. package/web/assets/{dagre-SPEB5RXH-BnOvnJrY.js → dagre-SPEB5RXH-B21shBDF.js} +1 -1
  24. package/web/assets/{diagram-3B7GL73J-DnFw5yRA.js → diagram-3B7GL73J-D5GyZahr.js} +1 -1
  25. package/web/assets/{diagram-DNEMPZML-CLe-W-8E.js → diagram-DNEMPZML-l_jbAuYI.js} +1 -1
  26. package/web/assets/{diagram-L3MUGCDN-xhFV1YT8.js → diagram-L3MUGCDN-Dxg4m10Z.js} +1 -1
  27. package/web/assets/{diagram-LA4NIPWU-S58Cgi0K.js → diagram-LA4NIPWU-Cel9qbbE.js} +1 -1
  28. package/web/assets/{diagram-MHCOC4E2-fbSbD-Tu.js → diagram-MHCOC4E2-BiOEXYq3.js} +1 -1
  29. package/web/assets/{diagram-XPFHEONP-C3K_xR1q.js → diagram-XPFHEONP-BvK5PJyb.js} +1 -1
  30. package/web/assets/{ebnfDiagram-UZSYDL2S-BG_udZa4.js → ebnfDiagram-UZSYDL2S-6zLeUUGj.js} +1 -1
  31. package/web/assets/{elk-XV6XMXQE-DE6K1qve.js → elk-XV6XMXQE-vHNWsDBP.js} +1 -1
  32. package/web/assets/{erDiagram-EYBAPDEH-xkeusKpC.js → erDiagram-EYBAPDEH-B_0_-AXN.js} +1 -1
  33. package/web/assets/{flowDiagram-MALGAFMO-OisK-T0f.js → flowDiagram-MALGAFMO-DHbDByLY.js} +1 -1
  34. package/web/assets/{ganttDiagram-23REXITY-DmQVS3ZV.js → ganttDiagram-23REXITY-B80CTXbo.js} +1 -1
  35. package/web/assets/{gitGraphDiagram-STJD7YCW-Cll-SkVb.js → gitGraphDiagram-STJD7YCW-CkacpGe7.js} +1 -1
  36. package/web/assets/{index-CJzQgsOc.js → index-92k3_wJu.js} +1 -1
  37. package/web/assets/{index-BTQSusTZ.js → index-B36m2pd4.js} +1 -1
  38. package/web/assets/{index-B2l2owfY.js → index-BPYt9SZ5.js} +1 -1
  39. package/web/assets/{index-DM3T56Jf.js → index-BWlmCdoh.js} +1 -1
  40. package/web/assets/{index-CYTyvY7n.js → index-BiVTsO6O.js} +1 -1
  41. package/web/assets/{index-BzBiXh1K.js → index-C-Hx4d-f.js} +1 -1
  42. package/web/assets/{index-CkpIGiUh.js → index-C8qdu2Ys.js} +1 -1
  43. package/web/assets/{index-CcKihMD9.js → index-CIuxUzk9.js} +1 -1
  44. package/web/assets/{index-CUm9rUfI.js → index-CVL9Nmm_.js} +1 -1
  45. package/web/assets/{index-CkV2xkfY.js → index-C_2wUJRx.js} +1 -1
  46. package/web/assets/{index-B_jwjnO_.js → index-Cm5B9oUk.js} +1 -1
  47. package/web/assets/index-CnDNc_gM.js +172 -0
  48. package/web/assets/{index-cu8Fcww3.js → index-CuT0yXRF.js} +1 -1
  49. package/web/assets/{index-CXbAKkq5.js → index-DC0nz24L.js} +1 -1
  50. package/web/assets/{index-D5xJiVmD.js → index-DSvz1p_2.js} +1 -1
  51. package/web/assets/index-DmzLc_Io.css +1 -0
  52. package/web/assets/{index-Zq9V5ZB9.js → index-Ea4Oi4uX.js} +1 -1
  53. package/web/assets/{index-Bta4Smbo.js → index-FQtowISJ.js} +1 -1
  54. package/web/assets/{index-qOoKNKZw.js → index-g768jR3q.js} +1 -1
  55. package/web/assets/{index-DXCiYt0O.js → index-kN0c62Qc.js} +1 -1
  56. package/web/assets/{index-fF3dLvWP.js → index-pc3Dhu5R.js} +1 -1
  57. package/web/assets/{infoDiagram-KBXO4MBG-CFnvxUDW.js → infoDiagram-KBXO4MBG-CU1EkG0-.js} +1 -1
  58. package/web/assets/{ishikawaDiagram-M35NCXHK-CjJXkiZb.js → ishikawaDiagram-M35NCXHK-BZmugbzW.js} +1 -1
  59. package/web/assets/{journeyDiagram-OPLOXDXO-CYBHLPC5.js → journeyDiagram-OPLOXDXO-DDidfWhw.js} +1 -1
  60. package/web/assets/{kanban-definition-BZKZHSQY-BzNwzCFX.js → kanban-definition-BZKZHSQY-DT8uvOWy.js} +1 -1
  61. package/web/assets/{mermaid.core-CFBl9TP8.js → mermaid.core-L3hD6CUN.js} +4 -4
  62. package/web/assets/{mindmap-definition-I2QAS2VK-X8WzviFV.js → mindmap-definition-I2QAS2VK-CglnosNO.js} +1 -1
  63. package/web/assets/{pegDiagram-FD4XPPHP-kvO-a_98.js → pegDiagram-FD4XPPHP-Riow5Koi.js} +1 -1
  64. package/web/assets/{pieDiagram-J4AKIIQI-BEiN8l-e.js → pieDiagram-J4AKIIQI-CK0itELu.js} +1 -1
  65. package/web/assets/{quadrantDiagram-XTYBLID2-Cf-t2xpS.js → quadrantDiagram-XTYBLID2-a0cZCRAm.js} +1 -1
  66. package/web/assets/{railroadDiagram-MRQ6NCDL-Bou3xfYm.js → railroadDiagram-MRQ6NCDL-C-JOz99A.js} +1 -1
  67. package/web/assets/{requirementDiagram-Y7LWUY3S-Ch1ghejU.js → requirementDiagram-Y7LWUY3S-C6ek4quK.js} +1 -1
  68. package/web/assets/{sankeyDiagram-WGJFYUXA-DCjH5hxL.js → sankeyDiagram-WGJFYUXA-CV0CpeMd.js} +1 -1
  69. package/web/assets/{sequenceDiagram-5NDRBG5M-DrspJAAy.js → sequenceDiagram-5NDRBG5M-UAB57p0q.js} +1 -1
  70. package/web/assets/{sizeCapture-INFHLROL-BpOJNwe1.js → sizeCapture-INFHLROL-CEP45PjG.js} +1 -1
  71. package/web/assets/{stateDiagram-v2-FJ4FJNEA-RkYUtnsy.js → stateDiagram-v2-FJ4FJNEA-DtxyTD99.js} +1 -1
  72. package/web/assets/{swimlanes-UMQ2AFYF-BR4cicEg.js → swimlanes-UMQ2AFYF-D0-FWl64.js} +1 -1
  73. package/web/assets/swimlanesDiagram-OMPLPG4O-B5BeOS4_.js +8 -0
  74. package/web/assets/{timeline-definition-SEUHKTQE-Bq2VoDLH.js → timeline-definition-SEUHKTQE-OQG2waQW.js} +1 -1
  75. package/web/assets/{usecaseDiagram-AFA6YXN4-BsB6aBKf.js → usecaseDiagram-AFA6YXN4-DxTFx1Wc.js} +1 -1
  76. package/web/assets/{vennDiagram-NNMJR3RB-8pOZirDr.js → vennDiagram-NNMJR3RB-1Uym6RqY.js} +1 -1
  77. package/web/assets/{wardleyDiagram-S7YFUSEH-Dx-je9ls.js → wardleyDiagram-S7YFUSEH-CqeyKfQR.js} +1 -1
  78. package/web/assets/{xychartDiagram-GGNKY7IX-mpETY7ui.js → xychartDiagram-GGNKY7IX-CGvFnidy.js} +1 -1
  79. package/web/index.html +10 -2
  80. package/web/manifest.webmanifest +13 -0
  81. package/web/notify-sw.js +33 -0
  82. package/web/assets/index-C0GRVSmD.css +0 -1
  83. package/web/assets/index-CM1F7OtV.js +0 -172
  84. package/web/assets/swimlanesDiagram-OMPLPG4O-DGwvhioW.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i14ks/ccv",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "GUI для Claude Code: сессии агента в каталогах проектов, дерево файлов и редактор рядом с разговором.",
6
6
  "homepage": "https://claudevisual.com",
@@ -1,4 +1,4 @@
1
- var Mu=t=>{throw TypeError(t)};var Nu=(t,e,n)=>e.has(t)||Mu("Cannot "+n);var x=(t,e,n)=>(Nu(t,e,"read from private field"),n?n.call(t):e.get(t)),$=(t,e,n)=>e.has(t)?Mu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),D=(t,e,n,r)=>(Nu(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{m as Ne,n as Ug,o as N,S as Gg,q as _f,p as Yg,u as Tu,v as Qg,e as Xg,f as Iu,r as Zg,i as ey}from"./index-CM1F7OtV.js";import{k as ty,b as ny}from"./index-Vcq4gwWv.js";import{g as ry}from"./_commonjsHelpers-CqkleIqs.js";var ct=(function(t){return t.docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t.aiProviderError="aiProviderError",t.aiBuildContextError="aiBuildContextError",t})({}),ut=class extends Error{constructor(t,e,n){super(e,n),this.name="MilkdownError",this.code=t,(n==null?void 0:n.cause)!==void 0&&(this.cause=n.cause)}},iy=(t,e)=>typeof e=="function"?"[Function]":e,Os=t=>JSON.stringify(t,iy);function oy(t){return new ut(ct.docTypeError,`Doc type error, unsupported type: ${Os(t)}`)}function sy(t){return new ut(ct.contextNotFound,`Context "${t}" not found, do you forget to inject it?`)}function ly(t){return new ut(ct.timerNotFound,`Timer "${t}" not found, do you forget to record it?`)}function Ds(){return new ut(ct.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function ay(t,e,n){const r=`Cannot create node for ${"name"in t?t.name:t}`,i=s=>{if(s==null)return"null";if(Array.isArray(s))return`[${s.map(i).join(", ")}]`;if(typeof s=="object")return"toJSON"in s&&typeof s.toJSON=="function"?JSON.stringify(s.toJSON()):"spec"in s?JSON.stringify(s.spec):JSON.stringify(s);if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return JSON.stringify(s);if(typeof s=="function")return`[Function: ${s.name||"anonymous"}]`;try{return String(s)}catch{return"[Unserializable]"}},o=[["[Description]",r],["[Attributes]",e],["[Content]",(n??[]).map(s=>s?typeof s=="object"&&"type"in s?`${s}`:i(s):"null")]].reduce((s,[l,a])=>{const c=`${l}: ${i(a)}.`;return s.concat(c)},[]);return new ut(ct.createNodeInParserFail,o.join(`
1
+ var Mu=t=>{throw TypeError(t)};var Nu=(t,e,n)=>e.has(t)||Mu("Cannot "+n);var x=(t,e,n)=>(Nu(t,e,"read from private field"),n?n.call(t):e.get(t)),$=(t,e,n)=>e.has(t)?Mu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),D=(t,e,n,r)=>(Nu(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{m as Ne,n as Ug,o as N,S as Gg,q as _f,p as Yg,u as Tu,v as Qg,e as Xg,f as Iu,r as Zg,i as ey}from"./index-CnDNc_gM.js";import{k as ty,b as ny}from"./index-Vcq4gwWv.js";import{g as ry}from"./_commonjsHelpers-CqkleIqs.js";var ct=(function(t){return t.docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t.aiProviderError="aiProviderError",t.aiBuildContextError="aiBuildContextError",t})({}),ut=class extends Error{constructor(t,e,n){super(e,n),this.name="MilkdownError",this.code=t,(n==null?void 0:n.cause)!==void 0&&(this.cause=n.cause)}},iy=(t,e)=>typeof e=="function"?"[Function]":e,Os=t=>JSON.stringify(t,iy);function oy(t){return new ut(ct.docTypeError,`Doc type error, unsupported type: ${Os(t)}`)}function sy(t){return new ut(ct.contextNotFound,`Context "${t}" not found, do you forget to inject it?`)}function ly(t){return new ut(ct.timerNotFound,`Timer "${t}" not found, do you forget to record it?`)}function Ds(){return new ut(ct.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function ay(t,e,n){const r=`Cannot create node for ${"name"in t?t.name:t}`,i=s=>{if(s==null)return"null";if(Array.isArray(s))return`[${s.map(i).join(", ")}]`;if(typeof s=="object")return"toJSON"in s&&typeof s.toJSON=="function"?JSON.stringify(s.toJSON()):"spec"in s?JSON.stringify(s.spec):JSON.stringify(s);if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return JSON.stringify(s);if(typeof s=="function")return`[Function: ${s.name||"anonymous"}]`;try{return String(s)}catch{return"[Unserializable]"}},o=[["[Description]",r],["[Attributes]",e],["[Content]",(n??[]).map(s=>s?typeof s=="object"&&"type"in s?`${s}`:i(s):"null")]].reduce((s,[l,a])=>{const c=`${l}: ${i(a)}.`;return s.concat(c)},[]);return new ut(ct.createNodeInParserFail,o.join(`
2
2
  `))}function $f(){return new ut(ct.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function cy(t){return new ut(ct.parserMatchError,`Cannot match target parser for node: ${Os(t)}.`)}function uy(t){return new ut(ct.serializerMatchError,`Cannot match target serializer for node: ${Os(t)}.`)}function hy(t,e){return new ut(ct.getAtomFromSchemaFail,`Cannot get ${t}: ${e} from schema.`)}function Ht(t){return new ut(ct.expectDomTypeError,`Expect to be a dom, but get: ${Os(t)}.`)}function tl(){return new ut(ct.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 fy(t){return new ut(ct.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${t}" in schema.`)}function dy(t){return new ut(ct.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${t}" in schema.`)}var jf=class{constructor(){this.sliceMap=new Map,this.get=t=>{const e=typeof t=="string"?[...this.sliceMap.values()].find(n=>n.type.name===t):this.sliceMap.get(t.id);if(!e){const n=typeof t=="string"?t:t.name;throw sy(n)}return e},this.remove=t=>{const e=typeof t=="string"?[...this.sliceMap.values()].find(n=>n.type.name===t):this.sliceMap.get(t.id);e&&this.sliceMap.delete(e.type.id)},this.has=t=>typeof t=="string"?[...this.sliceMap.values()].some(e=>e.type.name===t):this.sliceMap.has(t.id)}},Nt,Zt,Lr,zf,py=(zf=class{constructor(e,n,r){$(this,Nt);$(this,Zt);$(this,Lr);D(this,Nt,[]),D(this,Lr,()=>{x(this,Nt).forEach(i=>i(x(this,Zt)))}),this.set=i=>{D(this,Zt,i),x(this,Lr).call(this)},this.get=()=>x(this,Zt),this.update=i=>{D(this,Zt,i(x(this,Zt))),x(this,Lr).call(this)},this.type=r,D(this,Zt,n),e.set(r.id,this)}on(e){return x(this,Nt).push(e),()=>{D(this,Nt,x(this,Nt).filter(n=>n!==e))}}once(e){const n=this.on(r=>{e(r),n()});return n}off(e){D(this,Nt,x(this,Nt).filter(n=>n!==e))}offAll(){D(this,Nt,[])}},Nt=new WeakMap,Zt=new WeakMap,Lr=new WeakMap,zf),my=class{constructor(t,e){this.id=Symbol(`Context-${e}`),this.name=e,this._defaultValue=t,this._typeInfo=()=>{throw Ds()}}create(t,e=this._defaultValue){return new py(t,e,this)}},ie=(t,e)=>new my(t,e),io,oo,so,qn,Br,Nn,Fr,_r,$r,Pf,gy=(Pf=class{constructor(t,e,n){$(this,io);$(this,oo);$(this,so);$(this,qn);$(this,Br);$(this,Nn);$(this,Fr);$(this,_r);$(this,$r);D(this,qn,new Set),D(this,Br,new Set),D(this,Nn,new Map),D(this,Fr,new Map),this.read=()=>({metadata:x(this,io),injectedSlices:[...x(this,qn)].map(r=>({name:typeof r=="string"?r:r.name,value:x(this,_r).call(this,r)})),consumedSlices:[...x(this,Br)].map(r=>({name:typeof r=="string"?r:r.name,value:x(this,_r).call(this,r)})),recordedTimers:[...x(this,Nn)].map(([r,{duration:i}])=>({name:r.name,duration:i,status:x(this,$r).call(this,r)})),waitTimers:[...x(this,Fr)].map(([r,{duration:i}])=>({name:r.name,duration:i,status:x(this,$r).call(this,r)}))}),this.onRecord=r=>{x(this,Nn).set(r,{start:Date.now(),duration:0})},this.onClear=r=>{x(this,Nn).delete(r)},this.onDone=r=>{const i=x(this,Nn).get(r);i&&(i.duration=Date.now()-i.start)},this.onWait=(r,i)=>{const o=Date.now();i.finally(()=>{x(this,Fr).set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{x(this,qn).add(r)},this.onRemove=r=>{x(this,qn).delete(r)},this.onUse=r=>{x(this,Br).add(r)},D(this,_r,r=>x(this,oo).get(r).get()),D(this,$r,r=>x(this,so).get(r).status),D(this,oo,t),D(this,so,e),D(this,io,n)}},io=new WeakMap,oo=new WeakMap,so=new WeakMap,qn=new WeakMap,Br=new WeakMap,Nn=new WeakMap,Fr=new WeakMap,_r=new WeakMap,$r=new WeakMap,Pf),en,tn,lo,pt,jr,yy=(jr=class{constructor(e,n,r){$(this,en);$(this,tn);$(this,lo);$(this,pt);this.produce=i=>i&&Object.keys(i).length?new jr(x(this,en),x(this,tn),{...i}):this,this.inject=(i,o)=>{var l;const s=i.create(x(this,en).sliceMap);return o!=null&&s.set(o),(l=x(this,pt))==null||l.onInject(i),this},this.remove=i=>{var o;return x(this,en).remove(i),(o=x(this,pt))==null||o.onRemove(i),this},this.record=i=>{var o;return i.create(x(this,tn).store),(o=x(this,pt))==null||o.onRecord(i),this},this.clearTimer=i=>{var o;return x(this,tn).remove(i),(o=x(this,pt))==null||o.onClear(i),this},this.isInjected=i=>x(this,en).has(i),this.isRecorded=i=>x(this,tn).has(i),this.use=i=>{var o;return(o=x(this,pt))==null||o.onUse(i),x(this,en).get(i)},this.get=i=>this.use(i).get(),this.set=(i,o)=>this.use(i).set(o),this.update=(i,o)=>this.use(i).update(o),this.timer=i=>x(this,tn).get(i),this.done=i=>{var o;this.timer(i).done(),(o=x(this,pt))==null||o.onDone(i)},this.wait=i=>{var s;const o=this.timer(i).start();return(s=x(this,pt))==null||s.onWait(i,o),o},this.waitTimers=async i=>{await Promise.all(this.get(i).map(o=>this.wait(o)))},D(this,en,e),D(this,tn,n),D(this,lo,r),r&&D(this,pt,new gy(e,n,r))}get meta(){return x(this,lo)}get inspector(){return x(this,pt)}},en=new WeakMap,tn=new WeakMap,lo=new WeakMap,pt=new WeakMap,jr),ky=class{constructor(){this.store=new Map,this.get=t=>{const e=this.store.get(t.id);if(!e)throw ly(t.name);return e},this.remove=t=>{this.store.delete(t.id)},this.has=t=>this.store.has(t.id)}},Vr,Tn,Hr,nn,rn,qr,ao,Lf,by=(Lf=class{constructor(t,e){$(this,Vr);$(this,Tn);$(this,Hr);$(this,nn);$(this,rn);$(this,qr);$(this,ao);D(this,Vr,null),D(this,Tn,null),D(this,nn,"pending"),D(this,rn,null),this.start=()=>(x(this,Vr)??D(this,Vr,new Promise((n,r)=>{D(this,Tn,i=>{i instanceof CustomEvent&&i.detail.id===x(this,Hr)&&(D(this,nn,"resolved"),x(this,qr).call(this),i.stopImmediatePropagation(),n())}),x(this,ao).call(this,()=>{x(this,nn)==="pending"&&D(this,nn,"rejected"),x(this,qr).call(this),r(new Error(`Timing ${this.type.name} timeout.`))}),D(this,nn,"pending"),addEventListener(this.type.name,x(this,Tn))})),x(this,Vr)),this.done=()=>{const n=new CustomEvent(this.type.name,{detail:{id:x(this,Hr)}});dispatchEvent(n)},D(this,qr,()=>{x(this,rn)!==null&&(clearTimeout(x(this,rn)),D(this,rn,null)),x(this,Tn)&&removeEventListener(this.type.name,x(this,Tn))}),D(this,ao,n=>{D(this,rn,setTimeout(()=>{D(this,rn,null),n()},this.type.timeout))}),D(this,Hr,Symbol(e.name)),this.type=e,t.set(e.id,this)}get status(){return x(this,nn)}},Vr=new WeakMap,Tn=new WeakMap,Hr=new WeakMap,nn=new WeakMap,rn=new WeakMap,qr=new WeakMap,ao=new WeakMap,Lf),xy=class{constructor(t,e=3e3){this.create=n=>new by(n,this),this.id=Symbol(`Timer-${t}`),this.name=t,this.timeout=e}},qt=(t,e=3e3)=>new xy(t,e);const wy={};function Rs(t,e){const n=wy,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vf(t,r,i)}function Vf(t,e,n){if(Cy(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Au(t.children,e,n)}return Array.isArray(t)?Au(t,e,n):""}function Au(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Vf(t[i],e,n);return r.join("")}function Cy(t){return!!(t&&typeof t=="object")}const vu=document.createElement("i");function za(t){const e="&"+t+";";vu.innerHTML=e;const n=vu.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function At(t,e,n,r){const i=t.length;let o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function yt(t,e){return t.length>0?(At(t,t.length,0,e),t):e}const Eu={}.hasOwnProperty;function Hf(t){const e={};let n=-1;for(;++n<t.length;)Sy(e,t[n]);return e}function Sy(t,e){let n;for(n in e){const i=(Eu.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let s;if(o)for(s in o){Eu.call(i,s)||(i[s]=[]);const l=o[s];My(i[s],Array.isArray(l)?l:l?[l]:[])}}}function My(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);At(t,0,0,r)}function qf(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ae=Pn(/[A-Za-z]/),$e=Pn(/[\dA-Za-z]/),Ny=Pn(/[#-'*+\--9=?A-Z^-~]/);function ds(t){return t!==null&&(t<32||t===127)}const Kl=Pn(/\d/),Ty=Pn(/[\dA-Fa-f]/),Wf=Pn(/[!-/:-@[-`{-~]/);function q(t){return t!==null&&t<-2}function ue(t){return t!==null&&(t<0||t===32)}function te(t){return t===-2||t===-1||t===32}const Mo=Pn(new RegExp("\\p{P}|\\p{S}","u")),lr=Pn(/\s/);function Pn(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function le(t,e,n,r){const i=r?r-1:1/0;let o=0;return s;function s(a){return te(a)?(t.enter(n),l(a)):e(a)}function l(a){return te(a)&&o++<i?(t.consume(a),l):(t.exit(n),e(a))}}function Kf(t,e,n,r,i,o){let s=0;return l;function l(u){return te(u)?(t.enter(r),a(u)):c(u)}function a(u){return te(u)&&s<o?(t.consume(u),s++,a):(t.exit(r),c(u))}function c(u){return s>=i?e(u):n(u)}}const Iy={tokenize:Ay};function Ay(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),le(t,e,"linePrefix")}function i(l){return t.enter("paragraph"),o(l)}function o(l){const a=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,s(l)}function s(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return q(l)?(t.consume(l),t.exit("chunkText"),o):(t.consume(l),s)}}let ps=class{constructor(){this.index=new Map,this.map=[]}add(e,n,r){Ou(this,e,n,r,!1)}addBefore(e,n,r){Ou(this,e,n,r,!0)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const o of i)e.push(o);i=r.pop()}this.map.length=0,this.index.clear()}};function Ou(t,e,n,r,i){if(n===0&&r.length===0)return;const o=t.index.get(e);if(o){o[1]+=n,i?(r.push(...o[2]),o[2]=r):o[2].push(...r);return}const s=[e,n,r];t.map.push(s),t.index.set(e,s)}const vy={tokenize:Ey},Du={tokenize:Oy};function Ey(t){const e=this,n=[];let r=0,i,o,s;return l;function l(w){if(r<n.length){const v=n[r];return e.containerState=v[1],t.attempt(v[0].continuation,a,c)(w)}return c(w)}function a(w){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();const v=e.events.length;let B=v,S;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){S=e.events[B][1].end;break}g(r);let R=v;for(;R<e.events.length;)e.events[R][1].end={...S},R++;const F=new ps;return F.add(B+1,0,e.events.slice(v)),F.add(v,R-v,[]),F.consume(e.events),c(w)}return l(w)}function c(w){if(r===n.length){if(!i)return d(w);if(i.currentConstruct&&i.currentConstruct.concrete)return p(w);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Du,u,h)(w)}function u(w){return i&&C(),g(r),d(w)}function h(w){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,p(w)}function d(w){return e.containerState={},t.attempt(Du,f,p)(w)}function f(w){return r++,n.push([e.currentConstruct,e.containerState]),d(w)}function p(w){if(w===null){i&&C(),g(0),t.consume(w);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(w)}function m(w){if(w===null){y(t.exit("chunkFlow"),!0),g(0),t.consume(w);return}return q(w)?(t.consume(w),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(w),m)}function y(w,v){const B=e.sliceStream(w);if(v&&B.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(B),e.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const R=e.events.length;let F=R,ee,M;for(;F--;)if(e.events[F][0]==="exit"&&e.events[F][1].type==="chunkFlow"){if(ee){M=e.events[F][1].end;break}ee=!0}for(g(r),S=R;S<e.events.length;)e.events[S][1].end={...M},S++;const P=new ps;P.add(F+1,0,e.events.slice(R)),P.add(R,S-R,[]),P.consume(e.events)}}function g(w){let v=n.length;for(;v-- >w;){const B=n[v];e.containerState=B[1],B[0].exit.call(e,t)}n.length=w}function C(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Oy(t,e,n){return le(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jt(t){if(t===null||ue(t)||lr(t))return 1;if(Mo(t))return 2}function zs(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const Jl={name:"attention",resolveAll:Dy,tokenize:Ry};function Dy(t,e){let n=-1,r;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){let i=n;for(;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;const o=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1,s={...t[i][1].end},l={...t[n][1].start};Ru(s,-o),Ru(l,o);const a={type:o>1?"strongSequence":"emphasisSequence",start:s,end:{...t[i][1].end}},c={type:o>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:l},u={type:o>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},h={type:o>1?"strong":"emphasis",start:{...a.start},end:{...c.end}};t[i][1].end={...a.start},t[n][1].start={...c.end},r=[],t[i][1].end.offset-t[i][1].start.offset&&(r=yt(r,[["enter",t[i][1],e],["exit",t[i][1],e]])),r=yt(r,[["enter",h,e],["enter",a,e],["exit",a,e],["enter",u,e]]),r=yt(r,zs(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),r=yt(r,[["exit",u,e],["enter",c,e],["exit",c,e],["exit",h,e]]);let d=0;t[n][1].end.offset-t[n][1].start.offset&&(d=2,r=yt(r,[["enter",t[n][1],e],["exit",t[n][1],e]])),At(t,i-1,n-i+3,r),n=i+r.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Ry(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=jt(r);let o;return s;function s(a){return o=a,t.enter("attentionSequence"),l(a)}function l(a){if(a===o)return t.consume(a),l;const c=t.exit("attentionSequence"),u=jt(a),h=!u||u===2&&i||n.includes(a)&&a!==42&&a!==95,d=!i||i===2&&u||n.includes(r)&&r!==42&&r!==95;return c._open=!!(o===42?h:h&&(i||!d)),c._close=!!(o===42?d:d&&(u||!h)),e(a)}}function Ru(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const zy={name:"autolink",tokenize:Py};function Py(t,e,n){let r=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(f){return Ae(f)?(t.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||$e(f)?(r=1,l(f)):c(f)}function l(f){return f===58?(t.consume(f),r=0,a):(f===43||f===45||f===46||$e(f))&&r++<32?(t.consume(f),l):(r=0,c(f))}function a(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||ds(f)?n(f):(t.consume(f),a)}function c(f){return f===64?(t.consume(f),u):Ny(f)?(t.consume(f),c):n(f)}function u(f){return $e(f)?h(f):n(f)}function h(f){return f===46?(t.consume(f),r=0,u):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):d(f)}function d(f){if((f===45||$e(f))&&r++<63){const p=f===45?d:h;return t.consume(f),p}return n(f)}}const No={partial:!0,tokenize:Ly};function Ly(t,e,n){return r;function r(o){return te(o)?le(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||q(o)?e(o):n(o)}}const Jf={continuation:{tokenize:Fy},exit:_y,name:"blockQuote",tokenize:By};function By(t,e,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return n(s)}function o(s){return te(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function Fy(t,e,n){const r=this;return i;function i(s){return te(s)?le(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(Jf,e,n)(s)}}function _y(t){t.exit("blockQuote")}const Uf={name:"characterEscape",tokenize:$y};function $y(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return Wf(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const Gf={name:"characterReference",tokenize:jy};function jy(t,e,n){const r=this;let i=0,o,s;return l;function l(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),a}function a(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),o=31,s=$e,u(h))}function c(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=Ty,u):(t.enter("characterReferenceValue"),o=7,s=Kl,u(h))}function u(h){if(h===59&&i){const d=t.exit("characterReferenceValue");return s===$e&&!za(r.sliceSerialize(d))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(h)&&i++<o?(t.consume(h),u):n(h)}}const Ul={partial:!0,tokenize:Vy};function Vy(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const zu={concrete:!0,name:"codeFenced",tokenize:Hy};function Hy(t,e,n){const r=this,i={partial:!0,tokenize:B};let o=0,s=0,l;return a;function a(S){return c(S)}function c(S){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,l=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===l?(s++,t.consume(S),u):s<3?n(S):(t.exit("codeFencedFenceSequence"),te(S)?le(t,h,"whitespace")(S):h(S))}function h(S){return S===null||q(S)?(t.exit("codeFencedFence"),r.interrupt?e(S):t.check(Ul,m,v)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(S))}function d(S){return S===null||q(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(S)):te(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),le(t,f,"whitespace")(S)):S===96&&S===l?n(S):(t.consume(S),d)}function f(S){return S===null||q(S)?h(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||q(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(S)):S===96&&S===l?n(S):(t.consume(S),p)}function m(S){return t.attempt(i,v,y)(S)}function y(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),g}function g(S){return o>0&&te(S)?le(t,C,"linePrefix",o+1)(S):C(S)}function C(S){return S===null||q(S)?t.check(Ul,m,v)(S):(t.enter("codeFlowValue"),w(S))}function w(S){return S===null||q(S)?(t.exit("codeFlowValue"),C(S)):(t.consume(S),w)}function v(S){return t.exit("codeFenced"),e(S)}function B(S,R,F){let ee=0;return M;function M(ne){return S.enter("lineEnding"),S.consume(ne),S.exit("lineEnding"),P}function P(ne){return S.enter("codeFencedFence"),te(ne)?le(S,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):j(ne)}function j(ne){return ne===l?(S.enter("codeFencedFenceSequence"),ae(ne)):F(ne)}function ae(ne){return ne===l?(ee++,S.consume(ne),ae):ee>=s?(S.exit("codeFencedFenceSequence"),te(ne)?le(S,he,"whitespace")(ne):he(ne)):F(ne)}function he(ne){return ne===null||q(ne)?(S.exit("codeFencedFence"),R(ne)):F(ne)}}}const nl={name:"codeIndented",tokenize:Wy},qy={partial:!0,tokenize:Ky};function Wy(t,e,n){return r;function r(l){return t.enter("codeIndented"),Kf(t,i,n,"linePrefix",4,4)(l)}function i(l){return l===null?s(l):q(l)?t.attempt(qy,i,s)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||q(l)?(t.exit("codeFlowValue"),i(l)):(t.consume(l),o)}function s(l){return t.exit("codeIndented"),e(l)}}function Ky(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):q(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Kf(t,e,o,"linePrefix",4,4)(s)}function o(s){return q(s)?i(s):n(s)}}const Jy={name:"codeText",previous:Gy,resolve:Uy,tokenize:Yy};function Uy(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Gy(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yy(t,e,n){let r=0,i,o;return s;function s(h){return t.enter("codeText"),t.enter("codeTextSequence"),l(h)}function l(h){return h===96?(t.consume(h),r++,l):(t.exit("codeTextSequence"),a(h))}function a(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),a):h===96?(o=t.enter("codeTextSequence"),i=0,u(h)):q(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),a):(t.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||q(h)?(t.exit("codeTextData"),a(h)):(t.consume(h),c)}function u(h){return h===96?(t.consume(h),i++,u):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(o.type="codeTextData",c(h))}}class Qy{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&wi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);wi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wi(this.left,n.reverse())}}}function wi(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Yf(t){const e={};let n=-1,r,i,o,s,l,a,c;const u=new Qy(t);for(;++n<u.length;){for(;n in e;)n=e[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Xy(u,n)),n=e[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},l=u.slice(i,n),l.unshift(r),u.splice(i,n-i+1,l))}}return At(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Xy(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,a=[],c={};let u,h,d=-1,f=n,p=0,m=0;const y=[m];for(;f;){for(;t.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++d<l.length;)l[d][0]==="exit"&&l[d-1][0]==="enter"&&l[d][1].type===l[d-1][1].type&&l[d][1].start.line!==l[d][1].end.line&&(m=d+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),d=y.length;d--;){const g=l.slice(y[d],y[d+1]),C=o.pop();a.push([C,C+g.length-1]),t.splice(C,2,g)}for(a.reverse(),d=-1;++d<a.length;)c[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return c}const Zy={resolve:tk,tokenize:nk},ek={partial:!0,tokenize:rk};function tk(t){return Yf(t),t}function nk(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):q(l)?t.check(ek,s,o)(l):(t.consume(l),i)}function o(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function s(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function rk(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),le(t,o,"linePrefix")}function o(s){if(s===null||q(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function Qf(t,e,n,r,i,o,s,l,a){const c=a||Number.POSITIVE_INFINITY;let u=0;return h;function h(g){return g===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(g),t.exit(o),d):g===null||g===32||g===41||ds(g)?n(g):(t.enter(r),t.enter(s),t.enter(l),t.enter("chunkString",{contentType:"string"}),m(g))}function d(g){return g===62?(t.enter(o),t.consume(g),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(t.exit("chunkString"),t.exit(l),d(g)):g===null||g===60||q(g)?n(g):(t.consume(g),g===92?p:f)}function p(g){return g===60||g===62||g===92?(t.consume(g),f):f(g)}function m(g){return!u&&(g===null||g===41||ue(g))?(t.exit("chunkString"),t.exit(l),t.exit(s),t.exit(r),e(g)):u<c&&g===40?(t.consume(g),u++,m):g===41?(t.consume(g),u--,m):g===null||g===32||g===40||ds(g)?n(g):(t.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(t.consume(g),m):m(g)}}function Xf(t,e,n,r,i,o){const s=this;let l=0,a;return c;function c(f){return t.enter(r),t.enter(i),t.consume(f),t.exit(i),t.enter(o),u}function u(f){return l>999||f===null||f===91||f===93&&!a||f===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(t.exit(o),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):q(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||q(f)||l++>999?(t.exit("chunkString"),u(f)):(t.consume(f),a||(a=!te(f)),f===92?d:h)}function d(f){return f===91||f===92||f===93?(t.consume(f),l++,h):h(f)}}function Zf(t,e,n,r,i,o){let s;return l;function l(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,a):n(d)}function a(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),a(s)):d===null?n(d):q(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),le(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||q(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?h:u)}function h(d){return d===s||d===92?(t.consume(d),u):u(d)}}function Ai(t,e){let n;return r;function r(i){return q(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):te(i)?le(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const ik={name:"definition",tokenize:sk},ok={partial:!0,tokenize:lk};function sk(t,e,n){const r=this;let i;return o;function o(f){return t.enter("definition"),s(f)}function s(f){return Xf.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=vt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),a):n(f)}function a(f){return ue(f)?Ai(t,c)(f):c(f)}function c(f){return Qf(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return t.attempt(ok,h,h)(f)}function h(f){return te(f)?le(t,d,"whitespace")(f):d(f)}function d(f){return f===null||q(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function lk(t,e,n){return r;function r(l){return ue(l)?Ai(t,i)(l):n(l)}function i(l){return Zf(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return te(l)?le(t,s,"whitespace")(l):s(l)}function s(l){return l===null||q(l)?e(l):n(l)}}const ak={name:"hardBreakEscape",tokenize:ck};function ck(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return q(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const uk={name:"headingAtx",resolve:hk,tokenize:fk};function hk(t,e){let n=t.length-2,r=3;if(t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"};At(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])}return t}function fk(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||ue(u)?(t.exit("atxHeadingSequence"),l(u)):n(u)}function l(u){return u===35?(t.enter("atxHeadingSequence"),a(u)):u===null||q(u)?(t.exit("atxHeading"),e(u)):te(u)?le(t,l,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function a(u){return u===35?(t.consume(u),a):(t.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||ue(u)?(t.exit("atxHeadingText"),l(u)):(t.consume(u),c)}}const ed=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gl=["pre","script","style","textarea"],dk={concrete:!0,name:"htmlFlow",resolveTo:mk,tokenize:gk},pk={partial:!0,tokenize:yk};function mk(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function gk(t,e,n){const r=this;let i,o,s,l,a;return c;function c(b){return u(b)}function u(b){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(b),h}function h(b){return b===33?(t.consume(b),d):b===47?(t.consume(b),o=!0,m):b===63?(t.consume(b),i=3,r.interrupt?e:k):Ae(b)?(t.consume(b),s=String.fromCharCode(b),y):n(b)}function d(b){return b===45?(t.consume(b),i=2,f):b===91?(t.consume(b),i=5,l=0,p):Ae(b)?(t.consume(b),i=4,r.interrupt?e:k):n(b)}function f(b){return b===45?(t.consume(b),r.interrupt?e:k):n(b)}function p(b){const qe="CDATA[";return b===qe.charCodeAt(l++)?(t.consume(b),l===qe.length?r.interrupt?e:j:p):n(b)}function m(b){return Ae(b)?(t.consume(b),s=String.fromCharCode(b),y):n(b)}function y(b){if(b===null||b===47||b===62||ue(b)){const qe=b===47,A=s.toLowerCase();return!qe&&!o&&Gl.includes(A)?(i=1,r.interrupt?e(b):j(b)):ed.includes(s.toLowerCase())?(i=6,qe?(t.consume(b),g):r.interrupt?e(b):j(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?C(b):w(b))}return b===45||$e(b)?(t.consume(b),s+=String.fromCharCode(b),y):n(b)}function g(b){return b===62?(t.consume(b),r.interrupt?e:j):n(b)}function C(b){return te(b)?(t.consume(b),C):M(b)}function w(b){return b===47?(t.consume(b),M):b===58||b===95||Ae(b)?(t.consume(b),v):te(b)?(t.consume(b),w):M(b)}function v(b){return b===45||b===46||b===58||b===95||$e(b)?(t.consume(b),v):B(b)}function B(b){return b===61?(t.consume(b),S):te(b)?(t.consume(b),B):w(b)}function S(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(t.consume(b),a=b,R):te(b)?(t.consume(b),S):F(b)}function R(b){return b===a?(t.consume(b),a=null,ee):b===null||q(b)?n(b):(t.consume(b),R)}function F(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ue(b)?B(b):(t.consume(b),F)}function ee(b){return b===47||b===62||te(b)?w(b):n(b)}function M(b){return b===62?(t.consume(b),P):n(b)}function P(b){return b===null||q(b)?j(b):te(b)?(t.consume(b),P):n(b)}function j(b){return b===45&&i===2?(t.consume(b),ge):b===60&&i===1?(t.consume(b),se):b===62&&i===4?(t.consume(b),nt):b===63&&i===3?(t.consume(b),k):b===93&&i===5?(t.consume(b),Ct):q(b)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(pk,St,ae)(b)):b===null||q(b)?(t.exit("htmlFlowData"),ae(b)):(t.consume(b),j)}function ae(b){return t.check(Ul,he,St)(b)}function he(b){return t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),ne}function ne(b){return b===null||q(b)?ae(b):(t.enter("htmlFlowData"),j(b))}function ge(b){return b===45?(t.consume(b),k):j(b)}function se(b){return b===47?(t.consume(b),s="",Re):j(b)}function Re(b){if(b===62){const qe=s.toLowerCase();return Gl.includes(qe)?(t.consume(b),nt):j(b)}return Ae(b)&&s.length<8?(t.consume(b),s+=String.fromCharCode(b),Re):j(b)}function Ct(b){return b===93?(t.consume(b),k):j(b)}function k(b){return b===62?(t.consume(b),nt):b===45&&i===2?(t.consume(b),k):j(b)}function nt(b){return b===null||q(b)?(t.exit("htmlFlowData"),St(b)):(t.consume(b),nt)}function St(b){return t.exit("htmlFlow"),e(b)}}function yk(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(No,e,n)}}const kk={name:"htmlText",tokenize:bk};function bk(t,e,n){const r=this;let i,o,s;return l;function l(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),a}function a(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),B):k===63?(t.consume(k),w):Ae(k)?(t.consume(k),F):n(k)}function c(k){return k===45?(t.consume(k),u):k===91?(t.consume(k),o=0,p):Ae(k)?(t.consume(k),C):n(k)}function u(k){return k===45?(t.consume(k),f):n(k)}function h(k){return k===null?n(k):k===45?(t.consume(k),d):q(k)?(s=h,se(k)):(t.consume(k),h)}function d(k){return k===45?(t.consume(k),f):h(k)}function f(k){return k===62?ge(k):k===45?d(k):h(k)}function p(k){const nt="CDATA[";return k===nt.charCodeAt(o++)?(t.consume(k),o===nt.length?m:p):n(k)}function m(k){return k===null?n(k):k===93?(t.consume(k),y):q(k)?(s=m,se(k)):(t.consume(k),m)}function y(k){return k===93?(t.consume(k),g):m(k)}function g(k){return k===62?ge(k):k===93?(t.consume(k),g):m(k)}function C(k){return k===null||k===62?ge(k):q(k)?(s=C,se(k)):(t.consume(k),C)}function w(k){return k===null?n(k):k===63?(t.consume(k),v):q(k)?(s=w,se(k)):(t.consume(k),w)}function v(k){return k===62?ge(k):w(k)}function B(k){return Ae(k)?(t.consume(k),S):n(k)}function S(k){return k===45||$e(k)?(t.consume(k),S):R(k)}function R(k){return q(k)?(s=R,se(k)):te(k)?(t.consume(k),R):ge(k)}function F(k){return k===45||$e(k)?(t.consume(k),F):k===47||k===62||ue(k)?ee(k):n(k)}function ee(k){return k===47?(t.consume(k),ge):k===58||k===95||Ae(k)?(t.consume(k),M):q(k)?(s=ee,se(k)):te(k)?(t.consume(k),ee):ge(k)}function M(k){return k===45||k===46||k===58||k===95||$e(k)?(t.consume(k),M):P(k)}function P(k){return k===61?(t.consume(k),j):q(k)?(s=P,se(k)):te(k)?(t.consume(k),P):ee(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),i=k,ae):q(k)?(s=j,se(k)):te(k)?(t.consume(k),j):(t.consume(k),he)}function ae(k){return k===i?(t.consume(k),i=void 0,ne):k===null?n(k):q(k)?(s=ae,se(k)):(t.consume(k),ae)}function he(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ue(k)?ee(k):(t.consume(k),he)}function ne(k){return k===47||k===62||ue(k)?ee(k):n(k)}function ge(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function se(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),Re}function Re(k){return te(k)?le(t,Ct,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):Ct(k)}function Ct(k){return t.enter("htmlTextData"),s(k)}}const Pa={name:"labelEnd",resolveAll:Sk,resolveTo:Mk,tokenize:Nk},xk={tokenize:Tk},wk={tokenize:Ik},Ck={tokenize:Ak};function Sk(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&At(t,0,t.length,n),t}function Mk(t,e){let n=t.length,r=0,i,o,s;for(;n--;){const u=t[n][1];if(i){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;t[n][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(o){if(t[n][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(i=n,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(o=n)}const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},a={type:"label",start:{...t[i][1].start},end:{...t[o][1].end}},c={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[o-2][1].start}};return s=[["enter",l,e],["enter",a,e]],s=yt(s,t.slice(i+1,i+r+3)),s=yt(s,[["enter",c,e]]),s=yt(s,zs(e.parser.constructs.insideSpan.null,t.slice(i+r+4,o-3),e)),s=yt(s,[["exit",c,e],t[o-2],t[o-1],["exit",a,e]]),s=yt(s,t.slice(o+1)),s=yt(s,[["exit",l,e]]),At(t,i,t.length,s),t}function Nk(t,e,n){const r=this,i=r._labelStarts;let o,s;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();o=i[i.length-1]}return l;function l(d){return o?o._inactive?h(d):(s=r.parser.defined.includes(vt(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),a):n(d)}function a(d){return d===40?t.attempt(xk,u,s?u:h)(d):d===91?t.attempt(wk,u,s?c:h)(d):s?u(d):h(d)}function c(d){return t.attempt(Ck,u,h)(d)}function u(d){return i.pop(),e(d)}function h(d){return o._balanced=!0,n(d)}}function Tk(t,e,n){return r;function r(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),i}function i(h){return ue(h)?Ai(t,o)(h):o(h)}function o(h){return h===41?u(h):Qf(t,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ue(h)?Ai(t,a)(h):u(h)}function l(h){return n(h)}function a(h){return h===34||h===39||h===40?Zf(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return ue(h)?Ai(t,u)(h):u(h)}function u(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function Ik(t,e,n){const r=this;return i;function i(l){return Xf.call(r,t,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(vt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function s(l){return n(l)}}function Ak(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const vk={name:"labelStartImage",resolveAll:Pa.resolveAll,tokenize:Ek};function Ek(t,e,n){const r=this;let i;return o;function o(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),s}function s(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),i=t.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),e(a))}}const Ok={name:"labelStartLink",resolveAll:Pa.resolveAll,tokenize:Dk};function Dk(t,e,n){const r=this;let i;return o;function o(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),i=t.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),e(l))}}const rl={name:"lineEnding",tokenize:Rk};function Rk(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),le(t,e,"linePrefix")}}const Xo={name:"thematicBreak",tokenize:zk};function zk(t,e,n){let r=0,i;return o;function o(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,l(c)}function l(c){return c===i?(t.enter("thematicBreakSequence"),a(c)):r>=3&&(c===null||q(c))?(t.exit("thematicBreak"),e(c)):n(c)}function a(c){return c===i?(t.consume(c),r++,a):(t.exit("thematicBreakSequence"),te(c)?le(t,l,"whitespace")(c):l(c))}}const Ue={continuation:{tokenize:Fk},exit:$k,name:"list",tokenize:Bk},Pk={partial:!0,tokenize:jk},Lk={partial:!0,tokenize:_k};function Bk(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Kl(f)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Xo,n,c)(f):c(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),a(f)}return n(f)}function a(f){return Kl(f)&&++s<10?(t.consume(f),a):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),c(f)):n(f)}function c(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(No,r.interrupt?n:u,t.attempt(Pk,d,h))}function u(f){return r.containerState.initialBlankLine=!0,o++,d(f)}function h(f){return te(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function Fk(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(No,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,le(t,e,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!te(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Lk,e,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,le(t,t.attempt(Ue,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function _k(t,e,n){const r=this;return le(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function $k(t){t.exit(this.containerState.type)}function jk(t,e,n){const r=this;return le(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!te(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Pu={name:"setextUnderline",resolveTo:Vk,tokenize:Hk};function Vk(t,e){const n=new ps;let r=t.length,i,o,s;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){i=r;break}t[r][1].type==="paragraph"&&(o=r)}else t[r][1].type==="content"&&n.add(r,1,[]),!s&&t[r][1].type==="definition"&&(s=r);const l={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",s?(n.add(o,0,[["enter",l,e]]),n.add(s+1,0,[["exit",t[i][1],e]]),t[i][1].end={...t[s][1].end}):t[i][1]=l,n.add(t.length,0,[["exit",l,e]]),n.consume(t),t}function Hk(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(t.consume(c),l):(t.exit("setextHeadingLineSequence"),te(c)?le(t,a,"lineSuffix")(c):a(c))}function a(c){return c===null||q(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const qk={tokenize:Wk};function Wk(t){const e=this,n=t.attempt(No,r,t.attempt(this.parser.constructs.flowInitial,i,le(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Zy,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Kk={resolveAll:nd()},Jk=td("string"),Uk=td("text");function td(t){return{resolveAll:nd(t==="text"?Gk:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,l);return s;function s(u){return c(u)?o(u):l(u)}function l(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),a}function a(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),a)}function c(u){if(u===null)return!0;const h=i[u];let d=-1;if(h)for(;++d<h.length;){const f=h[d];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function nd(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function Gk(t,e){const n=new ps;let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){const i=t[r-1][1],o=e.sliceStream(i);let s=o.length,l=-1,a=0,c;for(;s--;){const u=o[s];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)c=!0,a++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){const u={type:r===t.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...u.start},i.start.offset===i.end.offset?Object.assign(i,u):n.add(r,0,[["enter",u,e],["exit",u,e]])}r++}return n.consume(t),t}const Yk={42:Ue,43:Ue,45:Ue,48:Ue,49:Ue,50:Ue,51:Ue,52:Ue,53:Ue,54:Ue,55:Ue,56:Ue,57:Ue,62:Jf},Qk={91:ik},Xk={[-2]:nl,[-1]:nl,32:nl},Zk={35:uk,42:Xo,45:[Pu,Xo],60:dk,61:Pu,95:Xo,96:zu,126:zu},eb={38:Gf,92:Uf},tb={[-5]:rl,[-4]:rl,[-3]:rl,33:vk,38:Gf,42:Jl,60:[zy,kk],91:Ok,92:[ak,Uf],93:Pa,95:Jl,96:Jy},nb={null:[Jl,Kk]},rb={null:[42,95]},ib={null:[]},ob=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:rb,contentInitial:Qk,disable:ib,document:Yk,flow:Zk,flowInitial:Xk,insideSpan:nb,string:eb,text:tb},Symbol.toStringTag,{value:"Module"}));function sb(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const a={attempt:R(B),check:R(S),consume:C,enter:w,exit:v,interrupt:R(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:t,previous:null,sliceSerialize:d,sliceStream:f,write:h};let u=e.tokenize.call(c,a);return e.resolveAll&&o.push(e),c;function h(P){return s=yt(s,P),y(),s[s.length-1]!==null?[]:(F(e,0),c.events=zs(o,c.events,c),c.events)}function d(P,j){return ab(f(P),j)}function f(P){return lb(s,P)}function p(){const{_bufferIndex:P,_index:j,line:ae,column:he,offset:ne}=r;return{_bufferIndex:P,_index:j,line:ae,column:he,offset:ne}}function m(P){i[P.line]=P.column,M()}function y(){for(;r._index<s.length;){const P=s[r._index];if(typeof P=="string"){const j=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<P.length;)g(P.charCodeAt(r._bufferIndex))}else g(P)}}function g(P){u=u(P)}function C(P){q(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,M()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function w(P,j){const ae=j||{};return ae.type=P,ae.start=p(),c.events.push(["enter",ae,c]),l.push(ae),ae}function v(P){const j=l.pop();return j.end=p(),c.events.push(["exit",j,c]),j}function B(P,j){F(P,j.from)}function S(P,j){j.restore()}function R(P,j){return ae;function ae(he,ne,ge){let se,Re,Ct,k;return Array.isArray(he)?St(he):"tokenize"in he?St([he]):nt(he);function nt(O){return _;function _(H){const G=H!==null&&O[H],re=H!==null&&O.null,pe=[...Array.isArray(G)?G:G?[G]:[],...Array.isArray(re)?re:re?[re]:[]];return St(pe)(H)}}function St(O){return se=O,Re=0,O.length===0?ge:b(O[Re])}function b(O){return _;function _(H){return k=ee(),Ct=O,O.partial||(c.currentConstruct=O),O.name&&c.parser.constructs.disable.null.includes(O.name)?A():O.tokenize.call(j?Object.assign(Object.create(c),j):c,a,qe,A)(H)}}function qe(O){return P(Ct,k),ne}function A(O){return k.restore(),++Re<se.length?b(se[Re]):ge}}}function F(P,j){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&At(c.events,j,c.events.length-j,P.resolve(c.events.slice(j),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function ee(){const P=p(),j=c.previous,ae=c.currentConstruct,he=c.events.length,ne=Array.from(l);return{from:he,restore:ge};function ge(){r=P,c.previous=j,c.currentConstruct=ae,c.events.length=he,l=ne,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lb(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,o)];else{if(s=t.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function ab(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
3
3
  `;break}case-3:{s=`\r
4
4
  `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function cb(t){const r={constructs:Hf([ob,...(t||{}).extensions||[]]),content:i(Iy),defined:[],document:i(vy),flow:i(qk),lazy:{},string:i(Jk),text:i(Uk)};return r;function i(o){return s;function s(l){return sb(r,o,l)}}}function ub(t){for(;!Yf(t););return t}const Lu=/[\0\t\n\r]/g;function hb(){let t=1,e="",n=!0,r;return i;function i(o,s,l){o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o));const a=[];let c=0;for(e="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){Lu.lastIndex=c;const u=Lu.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h);if(!u){e=o.slice(c);break}if(d===10&&c===h&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),c<h&&(a.push(o.slice(c,h)),t+=h-c),d){case 0:{a.push(65533),t++;break}case 9:{const f=Math.ceil(t/4)*4;for(a.push(-2);t++<f;)a.push(-1);break}case 10:{a.push(-4),t=1;break}default:r=!0,t=1}c=h+1}return l&&(r&&a.push(-5),e&&a.push(e),a.push(null)),a}}const fb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rd(t){return t.replace(fb,db)}function db(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return qf(n.slice(o?2:1),o?16:10)}return za(n)||t}function vi(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Bu(t.position):"start"in t||"end"in t?Bu(t):"line"in t||"column"in t?Yl(t):""}function Yl(t){return Fu(t&&t.line)+":"+Fu(t&&t.column)}function Bu(t){return Yl(t&&t.start)+"-"+Yl(t&&t.end)}function Fu(t){return t&&typeof t=="number"?t:1}const id={}.hasOwnProperty;function pb(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),mb(n)(ub(cb(n).document().write(hb()(t,e,!0))))}function mb(t){const e={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(wu),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(Mt),blockQuote:s(pe),characterEscape:M,characterReference:M,codeFenced:s(We),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(We,l),codeText:s(ze,l),codeTextData:M,data:M,codeFlowValue:M,definition:s(dt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Se),hardBreakEscape:s(bu),hardBreakTrailing:s(bu),htmlFlow:s(xu,l),htmlFlowData:M,htmlText:s(xu,l),htmlTextData:M,image:s(Vg),label:l,link:s(wu),listItem:s(Hg),listItemValue:f,listOrdered:s(Cu,d),listUnordered:s(Cu),paragraph:s(qg),reference:qe,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Mt),strong:s(Wg),thematicBreak:s(Jg)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:re,autolinkProtocol:G,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:O,characterReferenceMarkerNumeric:O,characterReferenceValue:_,characterReference:H,codeFenced:c(g),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:c(C),codeText:c(ge),codeTextData:P,data:P,definition:c(),definitionDestinationString:B,definitionLabelString:w,definitionTitleString:v,emphasis:c(),hardBreakEscape:c(ae),hardBreakTrailing:c(ae),htmlFlow:c(he),htmlFlowData:P,htmlText:c(ne),htmlTextData:P,image:c(Re),label:k,labelText:Ct,lineEnding:j,link:c(se),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:A,resourceDestinationString:nt,resourceTitleString:St,resource:b,setextHeading:c(ee),setextHeadingLineSequence:F,setextHeadingText:R,strong:c(),thematicBreak:c()}};od(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(T){let z={type:"root",children:[],position:void 0};const Y={stack:[z],tokenStack:[],config:e,enter:a,exit:u,buffer:l,resume:h,data:n},Z=[],Ke=[];let fe=-1;for(;++fe<T.length;)if(Ke.push(T[fe]),T[fe][1].type==="listOrdered"||T[fe][1].type==="listUnordered")if(T[fe][0]==="enter")Z.push(Ke.length-1);else{const Je=Z.pop();o(Ke,Je)}for(T=Ke,fe=-1;++fe<T.length;){const Je=e[T[fe][0]];T[fe][0]==="enter"&&e.beforeEnter.length>0&&i(e.beforeEnter,{...Y,sliceSerialize:T[fe][2].sliceSerialize},T[fe][1]),id.call(Je,T[fe][1].type)&&Je[T[fe][1].type].call({...Y,sliceSerialize:T[fe][2].sliceSerialize},T[fe][1]),T[fe][0]==="exit"&&e.afterExit.length>0&&i(e.afterExit,{...Y,sliceSerialize:T[fe][2].sliceSerialize},T[fe][1])}if(Y.tokenStack.length>0){const Je=Y.tokenStack[Y.tokenStack.length-1];(Je[1]||_u).call(Y,void 0,Je[0])}for(z.position={start:kn(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:kn(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<e.transforms.length;)z=e.transforms[fe](z)||z;return z}function i(T,z,Y){let Z=-1;for(;++Z<T.length;)T[Z].call(z,Y)}function o(T,z){const Y=T.length-1;let Z=z-1,Ke=-1,fe=!1,Je,zt,ki,bi;const xi=[];for(;++Z<=Y;){const rt=T[Z];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Ke++:Ke--,bi=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Je&&!bi&&!Ke&&!ki&&(ki=Z),bi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bi=void 0}if(!Ke&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Ke===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Je){let Cr=Z;for(zt=void 0;Cr--;){const Ut=T[Cr];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;zt&&(T[zt][1].type="lineEndingBlank",fe=!0),Ut[1].type="lineEnding",zt=Cr}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}ki&&(!zt||ki<zt)&&(Je._spread=!0),Je.end=Object.assign({},zt?T[zt][1].start:rt[1].end),xi.push({at:zt||Z,event:["exit",Je,rt[2]]})}if(rt[1].type==="listItemPrefix"){const Cr={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Je=Cr,xi.push({at:Z,event:["enter",Cr,rt[2]]}),ki=void 0,bi=!0}}}const Su=T.splice(z);let el=0;for(Z=-1;++Z<Su.length;){for(;el<xi.length&&xi[el].at===z+Z;)T.push(xi[el++].event);T.push(Su[Z])}T[z][1]._spread=fe}function s(T,z){return Y;function Y(Z){a.call(this,T(Z),Z),z&&z.call(this,Z)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(T,z,Y){this.stack[this.stack.length-1].children.push(T),this.stack.push(T),this.tokenStack.push([z,Y||void 0]),T.position={start:kn(z.start),end:void 0}}function c(T){return z;function z(Y){T&&T.call(this,Y),u.call(this,Y)}}function u(T,z){const Y=this.stack.pop(),Z=this.tokenStack.pop();if(!Z)throw new Error("Cannot close `"+T.type+"` ("+vi({start:T.start,end:T.end})+"): it’s not open");Z[0].type!==T.type&&(z?z.call(this,T,Z[0]):(Z[1]||_u).call(this,T,Z[0])),Y.position.end=kn(T.end)}function h(){return Rs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(T){if(this.data.expectingFirstListItemValue){const z=this.stack[this.stack.length-2];z.start=Number.parseInt(this.sliceSerialize(T),10),this.data.expectingFirstListItemValue=void 0}}function p(){const T=this.resume(),z=this.stack[this.stack.length-1];z.lang=T}function m(){const T=this.resume(),z=this.stack[this.stack.length-1];z.meta=T}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const T=this.resume(),z=this.stack[this.stack.length-1];z.value=T.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const T=this.resume(),z=this.stack[this.stack.length-1];z.value=T.replace(/(\r?\n|\r)$/g,"")}function w(T){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.label=z,Y.identifier=vt(this.sliceSerialize(T)).toLowerCase()}function v(){const T=this.resume(),z=this.stack[this.stack.length-1];z.title=T}function B(){const T=this.resume(),z=this.stack[this.stack.length-1];z.url=T}function S(T){const z=this.stack[this.stack.length-1];if(!z.depth){const Y=this.sliceSerialize(T).length;z.depth=Y}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function F(T){const z=this.stack[this.stack.length-1];z.depth=this.sliceSerialize(T).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function M(T){const Y=this.stack[this.stack.length-1].children;let Z=Y[Y.length-1];(!Z||Z.type!=="text")&&(Z=Kg(),Z.position={start:kn(T.start),end:void 0},Y.push(Z)),this.stack.push(Z)}function P(T){const z=this.stack.pop();z.value+=this.sliceSerialize(T),z.position.end=kn(T.end)}function j(T){const z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Y=z.children[z.children.length-1];Y.position.end=kn(T.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(z.type)&&(M.call(this,T),P.call(this,T))}function ae(){this.data.atHardBreak=!0}function he(){const T=this.resume(),z=this.stack[this.stack.length-1];z.value=T}function ne(){const T=this.resume(),z=this.stack[this.stack.length-1];z.value=T}function ge(){const T=this.resume(),z=this.stack[this.stack.length-1];z.value=T}function se(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=z,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function Re(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=z,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function Ct(T){const z=this.sliceSerialize(T),Y=this.stack[this.stack.length-2];Y.label=rd(z),Y.identifier=vt(z).toLowerCase()}function k(){const T=this.stack[this.stack.length-1],z=this.resume(),Y=this.stack[this.stack.length-1];if(this.data.inReference=!0,Y.type==="link"){const Z=T.children;Y.children=Z}else Y.alt=z}function nt(){const T=this.resume(),z=this.stack[this.stack.length-1];z.url=T}function St(){const T=this.resume(),z=this.stack[this.stack.length-1];z.title=T}function b(){this.data.inReference=void 0}function qe(){this.data.referenceType="collapsed"}function A(T){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.label=z,Y.identifier=vt(this.sliceSerialize(T)).toLowerCase(),this.data.referenceType="full"}function O(T){this.data.characterReferenceType=T.type}function _(T){const z=this.sliceSerialize(T),Y=this.data.characterReferenceType;let Z;Y?(Z=qf(z,Y==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Z=za(z);const Ke=this.stack[this.stack.length-1];Ke.value+=Z}function H(T){const z=this.stack.pop();z.position.end=kn(T.end)}function G(T){P.call(this,T);const z=this.stack[this.stack.length-1];z.url=this.sliceSerialize(T)}function re(T){P.call(this,T);const z=this.stack[this.stack.length-1];z.url="mailto:"+this.sliceSerialize(T)}function pe(){return{type:"blockquote",children:[],position:void 0}}function We(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ze(){return{type:"inlineCode",value:"",position:void 0}}function dt(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Se(){return{type:"emphasis",children:[],position:void 0}}function Mt(){return{type:"heading",depth:0,children:[],position:void 0}}function bu(){return{type:"break",position:void 0}}function xu(){return{type:"html",value:"",position:void 0}}function Vg(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function wu(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Cu(T){return{type:"list",ordered:T.type==="listOrdered",start:null,spread:T._spread,children:[],position:void 0}}function Hg(T){return{type:"listItem",spread:T._spread,checked:null,children:[],position:void 0}}function qg(){return{type:"paragraph",children:[],position:void 0}}function Wg(){return{type:"strong",children:[],position:void 0}}function Kg(){return{type:"text",value:"",position:void 0}}function Jg(){return{type:"thematicBreak",position:void 0}}}function kn(t){return{line:t.line,column:t.column,offset:t.offset}}function od(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?od(t,r):gb(t,r)}}function gb(t,e){let n;for(n in e)if(id.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=e[n];r&&t[n].push(r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function _u(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+vi({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+vi({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+vi({start:e.start,end:e.end})+") is still open")}function Ql(t){const e=this;e.parser=n;function n(r){return pb(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const Ps=(function(t){if(t==null)return xb;if(typeof t=="function")return Ls(t);if(typeof t=="object")return Array.isArray(t)?yb(t):kb(t);if(typeof t=="string")return bb(t);throw new Error("Expected function, string, or object as test")});function yb(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ps(t[n]);return Ls(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function kb(t){const e=t;return Ls(n);function n(r){const i=r;let o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function bb(t){return Ls(e);function e(n){return n&&n.type===t}}function Ls(t){return e;function e(n,r,i){return!!(wb(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function xb(){return!0}function wb(t){return t!==null&&typeof t=="object"&&"type"in t}const sd=Ps(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]),$u={}.hasOwnProperty;function Cb(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const l=r.handlers;if(i&&$u.call(i,t)){const a=String(i[t]);s=$u.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Sb={}.hasOwnProperty;function ld(t,e){let n=-1,r;if(e.extensions)for(;++n<e.extensions.length;)ld(t,e.extensions[n]);for(r in e)if(Sb.call(e,r))switch(r){case"extensions":break;case"unsafe":{ju(t[r],e[r]);break}case"join":{ju(t[r],e[r]);break}case"handlers":{Mb(t[r],e[r]);break}default:t.options[r]=e[r]}return t}function ju(t,e){e&&t.push(...e)}function Mb(t,e){e&&Object.assign(t,e)}function Nb(t,e,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(t,o.current()),Tb);return i(),s}function Tb(t,e,n){return">"+(n?"":" ")+t}function ad(t,e){return Vu(t,e.inConstruct,!0)&&!Vu(t,e.notInConstruct,!1)}function Vu(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Hu(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;){const o=n.unsafe[i];if(o.character===`
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-OY52VR5R-Cgk3JXPf.js";import{p as f}from"./chunk-JWPE2WC7-BhL2yBgo.js";import{_ as n,l as o}from"./mermaid.core-CFBl9TP8.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-BiYmPyip.js";import"./index-CM1F7OtV.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-OY52VR5R-NLJNl2SH.js";import{p as f}from"./chunk-JWPE2WC7-C18blVa-.js";import{_ as n,l as o}from"./mermaid.core-L3hD6CUN.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-BOIqStKg.js";import"./index-CnDNc_gM.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};