agent-remnote 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-remnote",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "agent-remnote": "./cli.js"
@@ -8,15 +8,17 @@
8
8
  "files": [
9
9
  "cli.js",
10
10
  "dist",
11
+ "plugin-artifacts",
11
12
  "LICENSE",
12
13
  "README.md",
13
14
  "CHANGELOG.md"
14
15
  ],
15
16
  "type": "module",
16
17
  "scripts": {
18
+ "prepare:plugin-artifacts": "node --import tsx ./scripts/prepare-plugin-artifacts.ts",
17
19
  "cli": "node --import tsx ./src/main.ts",
18
20
  "dev": "node --import tsx ./src/main.ts",
19
- "build": "bun build ./src/main.ts --target node --packages bundle --external better-sqlite3 --outdir dist",
21
+ "build": "npm run prepare:plugin-artifacts && bun build ./src/main.ts --target node --packages bundle --external better-sqlite3 --outdir dist",
20
22
  "build:verified": "npm run build && node ./scripts/assert-bundled-effect-cli-patch.js",
21
23
  "smoke:dist": "npm run build && node ./cli.js --help",
22
24
  "prepack": "npm run build:verified",
Binary file
@@ -0,0 +1,50 @@
1
+ # agent-remnote Bridge Plugin (Vite)
2
+
3
+ This is the RemNote plugin package under `packages/plugin/`, built with Vite (Rollup).
4
+
5
+ ## Build Outputs (aligned with RemNote constraints)
6
+
7
+ - `dist/` contains: `manifest.json`, `index.js`, `index-sandbox.js`, `index.css`, `index-sandbox.css`, `index.html`
8
+ - Other dependencies / split chunks are included as `*-<hash>.js` and bundled into `PluginZip.zip`
9
+
10
+ ## Build & Install
11
+
12
+ 1. Build and zip
13
+
14
+ ```bash
15
+ cd packages/plugin
16
+ npm run build # outputs dist/ and PluginZip.zip
17
+ ```
18
+
19
+ 2. Install the local plugin zip in RemNote
20
+
21
+ - RemNote → Settings → Plugins → Developer → Install From Zip
22
+ - Select `packages/plugin/PluginZip.zip`
23
+
24
+ Note: `public/manifest.json` currently uses the same `id` as the webpack version. If you need to install both side-by-side,
25
+ change the `id` first.
26
+
27
+ ## Local Preview (optional)
28
+
29
+ ```bash
30
+ cd packages/plugin
31
+ npm run dev
32
+ ```
33
+
34
+ Then open:
35
+
36
+ - `http://localhost:8080/index.html?widgetName=index`
37
+
38
+ ## Built Dist Preview
39
+
40
+ ```bash
41
+ cd packages/plugin
42
+ npm run build
43
+ npx serve dist -l 8080
44
+ ```
45
+
46
+ Notes:
47
+
48
+ - Some static servers normalize `/index.html` to `/` and drop the query string.
49
+ - `dist/index.html` now falls back to the `index` widget on `/`, which avoids requests like `undefined-sandbox.js`.
50
+ - If you need to preview a non-`index` widget, use a static server that preserves `?widgetName=...`.
@@ -0,0 +1 @@
1
+ import{f as c,m as s}from"./index-dJjNfQvw.js";function h(e,n,r,t){const l=e.length;let i=0,u;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,r=r>0?r:0,t.length<1e4)u=Array.from(t),u.unshift(n,r),e.splice(...u);else for(r&&e.splice(n,r);i<t.length;)u=t.slice(i,i+1e4),u.unshift(n,0),e.splice(...u),i+=1e4,n+=1e4}function k(e,n){return e.length>0?(h(e,e.length,0,n),e):n}const a={}.hasOwnProperty;function d(e){const n={};let r=-1;for(;++r<e.length;)p(n,e[r]);return n}function p(e,n){let r;for(r in n){const l=(a.call(e,r)?e[r]:void 0)||(e[r]={}),i=n[r];let u;if(i)for(u in i){a.call(l,u)||(l[u]=[]);const o=i[u];g(l[u],Array.isArray(o)?o:o?[o]:[])}}}function g(e,n){let r=-1;const t=[];for(;++r<n.length;)(n[r].add==="after"?e:t).push(n[r]);h(e,0,0,t)}function x(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function w(e,n,r,t){const l=t?t-1:Number.POSITIVE_INFINITY;let i=0;return u;function u(f){return c(f)?(e.enter(r),o(f)):n(f)}function o(f){return c(f)&&i++<l?(e.consume(f),o):(e.exit(r),n(f))}}function I(e,n,r){const t=[];let l=-1;for(;++l<e.length;){const i=e[l].resolveAll;i&&!t.includes(i)&&(n=i(n,r),t.push(i))}return n}const A={partial:!0,tokenize:y};function y(e,n,r){return t;function t(i){return c(i)?w(e,l,"linePrefix")(i):l(i)}function l(i){return i===null||s(i)?n(i):r(i)}}export{A as b,d as c,w as f,x as n,k as p,I as r,h as s};
@@ -0,0 +1,3 @@
1
+ import{d as Wn,a as pt,b as mt}from"./index-CMP2i-HY.js";import{f as O,s as sn,p as G,r as Bn,n as fn,b as wn,c as ft}from"./blank-line-B2rM3oxN.js";import{m as w,c as Nn,a as nn,b as v,d as En,e as gt,f as _,g as xt,h as kt,i as Tn,j as $,t as dt}from"./index-dJjNfQvw.js";import{s as yn}from"./index-Ch_qCilz.js";const bt={tokenize:St};function St(n){const r=n.attempt(this.parser.constructs.contentInitial,t,a);let e;return r;function t(s){if(s===null){n.consume(s);return}return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),O(n,r,"linePrefix")}function a(s){return n.enter("paragraph"),i(s)}function i(s){const f=n.enter("chunkText",{contentType:"text",previous:e});return e&&(e.next=f),e=f,u(s)}function u(s){if(s===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(s);return}return w(s)?(n.consume(s),n.exit("chunkText"),i):(n.consume(s),u)}}const yt={tokenize:It},Dn={tokenize:wt};function It(n){const r=this,e=[];let t=0,a,i,u;return s;function s(S){if(t<e.length){const M=e[t];return r.containerState=M[1],n.attempt(M[0].continuation,f,h)(S)}return h(S)}function f(S){if(t++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,a&&R();const M=r.events.length;let D=M,k;for(;D--;)if(r.events[D][0]==="exit"&&r.events[D][1].type==="chunkFlow"){k=r.events[D][1].end;break}b(t);let B=M;for(;B<r.events.length;)r.events[B][1].end={...k},B++;return sn(r.events,D+1,0,r.events.slice(M)),r.events.length=B,h(S)}return s(S)}function h(S){if(t===e.length){if(!a)return g(S);if(a.currentConstruct&&a.currentConstruct.concrete)return T(S);r.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Dn,m,p)(S)}function m(S){return a&&R(),b(t),g(S)}function p(S){return r.parser.lazy[r.now().line]=t!==e.length,u=r.now().offset,T(S)}function g(S){return r.containerState={},n.attempt(Dn,c,T)(S)}function c(S){return t++,e.push([r.currentConstruct,r.containerState]),g(S)}function T(S){if(S===null){a&&R(),b(0),n.consume(S);return}return a=a||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),F(S)}function F(S){if(S===null){q(n.exit("chunkFlow"),!0),b(0),n.consume(S);return}return w(S)?(n.consume(S),q(n.exit("chunkFlow")),t=0,r.interrupt=void 0,s):(n.consume(S),F)}function q(S,M){const D=r.sliceStream(S);if(M&&D.push(null),S.previous=i,i&&(i.next=S),i=S,a.defineSkip(S.start),a.write(D),r.parser.lazy[S.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<u&&(!a.events[k][1].end||a.events[k][1].end.offset>u))return;const B=r.events.length;let H=B,P,L;for(;H--;)if(r.events[H][0]==="exit"&&r.events[H][1].type==="chunkFlow"){if(P){L=r.events[H][1].end;break}P=!0}for(b(t),k=B;k<r.events.length;)r.events[k][1].end={...L},k++;sn(r.events,H+1,0,r.events.slice(B)),r.events.length=k}}function b(S){let M=e.length;for(;M-- >S;){const D=e[M];r.containerState=D[1],D[0].exit.call(r,n)}e.length=S}function R(){a.write([null]),i=void 0,a=void 0,r.containerState._closeFlow=void 0}}function wt(n,r,e){return O(n,n.attempt(this.parser.constructs.document,r,e),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const Fn={name:"attention",resolveAll:zt,tokenize:Ct};function zt(n,r){let e=-1,t,a,i,u,s,f,h,m;for(;++e<n.length;)if(n[e][0]==="enter"&&n[e][1].type==="attentionSequence"&&n[e][1]._close){for(t=e;t--;)if(n[t][0]==="exit"&&n[t][1].type==="attentionSequence"&&n[t][1]._open&&r.sliceSerialize(n[t][1]).charCodeAt(0)===r.sliceSerialize(n[e][1]).charCodeAt(0)){if((n[t][1]._close||n[e][1]._open)&&(n[e][1].end.offset-n[e][1].start.offset)%3&&!((n[t][1].end.offset-n[t][1].start.offset+n[e][1].end.offset-n[e][1].start.offset)%3))continue;f=n[t][1].end.offset-n[t][1].start.offset>1&&n[e][1].end.offset-n[e][1].start.offset>1?2:1;const p={...n[t][1].end},g={...n[e][1].start};qn(p,-f),qn(g,f),u={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...n[t][1].end}},s={type:f>1?"strongSequence":"emphasisSequence",start:{...n[e][1].start},end:g},i={type:f>1?"strongText":"emphasisText",start:{...n[t][1].end},end:{...n[e][1].start}},a={type:f>1?"strong":"emphasis",start:{...u.start},end:{...s.end}},n[t][1].end={...u.start},n[e][1].start={...s.end},h=[],n[t][1].end.offset-n[t][1].start.offset&&(h=G(h,[["enter",n[t][1],r],["exit",n[t][1],r]])),h=G(h,[["enter",a,r],["enter",u,r],["exit",u,r],["enter",i,r]]),h=G(h,Bn(r.parser.constructs.insideSpan.null,n.slice(t+1,e),r)),h=G(h,[["exit",i,r],["enter",s,r],["exit",s,r],["exit",a,r]]),n[e][1].end.offset-n[e][1].start.offset?(m=2,h=G(h,[["enter",n[e][1],r],["exit",n[e][1],r]])):m=0,sn(n,t-1,e-t+3,h),e=t+h.length-m-2;break}}for(e=-1;++e<n.length;)n[e][1].type==="attentionSequence"&&(n[e][1].type="data");return n}function Ct(n,r){const e=this.parser.constructs.attentionMarkers.null,t=this.previous,a=Nn(t);let i;return u;function u(f){return i=f,n.enter("attentionSequence"),s(f)}function s(f){if(f===i)return n.consume(f),s;const h=n.exit("attentionSequence"),m=Nn(f),p=!m||m===2&&a||e.includes(f),g=!a||a===2&&m||e.includes(t);return h._open=!!(i===42?p:p&&(a||!g)),h._close=!!(i===42?g:g&&(m||!p)),r(f)}}function qn(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const Et={name:"autolink",tokenize:Tt};function Tt(n,r,e){let t=0;return a;function a(c){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(c),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),i}function i(c){return nn(c)?(n.consume(c),u):c===64?e(c):h(c)}function u(c){return c===43||c===45||c===46||v(c)?(t=1,s(c)):h(c)}function s(c){return c===58?(n.consume(c),t=0,f):(c===43||c===45||c===46||v(c))&&t++<32?(n.consume(c),s):(t=0,h(c))}function f(c){return c===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(c),n.exit("autolinkMarker"),n.exit("autolink"),r):c===null||c===32||c===60||En(c)?e(c):(n.consume(c),f)}function h(c){return c===64?(n.consume(c),m):gt(c)?(n.consume(c),h):e(c)}function m(c){return v(c)?p(c):e(c)}function p(c){return c===46?(n.consume(c),t=0,m):c===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(c),n.exit("autolinkMarker"),n.exit("autolink"),r):g(c)}function g(c){if((c===45||v(c))&&t++<63){const T=c===45?g:p;return n.consume(c),T}return e(c)}}const Yn={continuation:{tokenize:Bt},exit:_t,name:"blockQuote",tokenize:Ft};function Ft(n,r,e){const t=this;return a;function a(u){if(u===62){const s=t.containerState;return s.open||(n.enter("blockQuote",{_container:!0}),s.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(u),n.exit("blockQuoteMarker"),i}return e(u)}function i(u){return _(u)?(n.enter("blockQuotePrefixWhitespace"),n.consume(u),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(u))}}function Bt(n,r,e){const t=this;return a;function a(u){return _(u)?O(n,i,"linePrefix",t.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):i(u)}function i(u){return n.attempt(Yn,r,e)(u)}}function _t(n){n.exit("blockQuote")}const $n={name:"characterEscape",tokenize:Pt};function Pt(n,r,e){return t;function t(i){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(i),n.exit("escapeMarker"),a}function a(i){return xt(i)?(n.enter("characterEscapeValue"),n.consume(i),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):e(i)}}const Gn={name:"characterReference",tokenize:At};function At(n,r,e){const t=this;let a=0,i,u;return s;function s(p){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),f}function f(p){return p===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(p),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),i=31,u=v,m(p))}function h(p){return p===88||p===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(p),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),i=6,u=kt,m):(n.enter("characterReferenceValue"),i=7,u=Tn,m(p))}function m(p){if(p===59&&a){const g=n.exit("characterReferenceValue");return u===v&&!Wn(t.sliceSerialize(g))?e(p):(n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return u(p)&&a++<i?(n.consume(p),m):e(p)}}const Rn={partial:!0,tokenize:Ot},Hn={concrete:!0,name:"codeFenced",tokenize:Lt};function Lt(n,r,e){const t=this,a={partial:!0,tokenize:D};let i=0,u=0,s;return f;function f(k){return h(k)}function h(k){const B=t.events[t.events.length-1];return i=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,s=k,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(k)}function m(k){return k===s?(u++,n.consume(k),m):u<3?e(k):(n.exit("codeFencedFenceSequence"),_(k)?O(n,p,"whitespace")(k):p(k))}function p(k){return k===null||w(k)?(n.exit("codeFencedFence"),t.interrupt?r(k):n.check(Rn,F,M)(k)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||w(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),p(k)):_(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),O(n,c,"whitespace")(k)):k===96&&k===s?e(k):(n.consume(k),g)}function c(k){return k===null||w(k)?p(k):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(k))}function T(k){return k===null||w(k)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),p(k)):k===96&&k===s?e(k):(n.consume(k),T)}function F(k){return n.attempt(a,M,q)(k)}function q(k){return n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),b}function b(k){return i>0&&_(k)?O(n,R,"linePrefix",i+1)(k):R(k)}function R(k){return k===null||w(k)?n.check(Rn,F,M)(k):(n.enter("codeFlowValue"),S(k))}function S(k){return k===null||w(k)?(n.exit("codeFlowValue"),R(k)):(n.consume(k),S)}function M(k){return n.exit("codeFenced"),r(k)}function D(k,B,H){let P=0;return L;function L(E){return k.enter("lineEnding"),k.consume(E),k.exit("lineEnding"),I}function I(E){return k.enter("codeFencedFence"),_(E)?O(k,y,"linePrefix",t.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):y(E)}function y(E){return E===s?(k.enter("codeFencedFenceSequence"),N(E)):H(E)}function N(E){return E===s?(P++,k.consume(E),N):P>=u?(k.exit("codeFencedFenceSequence"),_(E)?O(k,V,"whitespace")(E):V(E)):H(E)}function V(E){return E===null||w(E)?(k.exit("codeFencedFence"),B(E)):H(E)}}}function Ot(n,r,e){const t=this;return a;function a(u){return u===null?e(u):(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i)}function i(u){return t.parser.lazy[t.now().line]?e(u):r(u)}}const zn={name:"codeIndented",tokenize:Nt},Mt={partial:!0,tokenize:Dt};function Nt(n,r,e){const t=this;return a;function a(h){return n.enter("codeIndented"),O(n,i,"linePrefix",5)(h)}function i(h){const m=t.events[t.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(h):e(h)}function u(h){return h===null?f(h):w(h)?n.attempt(Mt,u,f)(h):(n.enter("codeFlowValue"),s(h))}function s(h){return h===null||w(h)?(n.exit("codeFlowValue"),u(h)):(n.consume(h),s)}function f(h){return n.exit("codeIndented"),r(h)}}function Dt(n,r,e){const t=this;return a;function a(u){return t.parser.lazy[t.now().line]?e(u):w(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),a):O(n,i,"linePrefix",5)(u)}function i(u){const s=t.events[t.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?r(u):w(u)?a(u):e(u)}}const qt={name:"codeText",previous:Ht,resolve:Rt,tokenize:Vt};function Rt(n){let r=n.length-4,e=3,t,a;if((n[e][1].type==="lineEnding"||n[e][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(t=e;++t<r;)if(n[t][1].type==="codeTextData"){n[e][1].type="codeTextPadding",n[r][1].type="codeTextPadding",e+=2,r-=2;break}}for(t=e-1,r++;++t<=r;)a===void 0?t!==r&&n[t][1].type!=="lineEnding"&&(a=t):(t===r||n[t][1].type==="lineEnding")&&(n[a][1].type="codeTextData",t!==a+2&&(n[a][1].end=n[t-1][1].end,n.splice(a+2,t-a-2),r-=t-a-2,t=a+2),a=void 0);return n}function Ht(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Vt(n,r,e){let t=0,a,i;return u;function u(p){return n.enter("codeText"),n.enter("codeTextSequence"),s(p)}function s(p){return p===96?(n.consume(p),t++,s):(n.exit("codeTextSequence"),f(p))}function f(p){return p===null?e(p):p===32?(n.enter("space"),n.consume(p),n.exit("space"),f):p===96?(i=n.enter("codeTextSequence"),a=0,m(p)):w(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),f):(n.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||w(p)?(n.exit("codeTextData"),f(p)):(n.consume(p),h)}function m(p){return p===96?(n.consume(p),a++,m):a===t?(n.exit("codeTextSequence"),n.exit("codeText"),r(p)):(i.type="codeTextData",h(p))}}class Qt{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,e){const t=e??Number.POSITIVE_INFINITY;return t<this.left.length?this.left.slice(r,t):r>this.left.length?this.right.slice(this.right.length-t+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-t+this.left.length).reverse())}splice(r,e,t){const a=e||0;this.setCursor(Math.trunc(r));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return t&&dn(this.left,t),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),dn(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),dn(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const e=this.left.splice(r,Number.POSITIVE_INFINITY);dn(this.right,e.reverse())}else{const e=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);dn(this.left,e.reverse())}}}function dn(n,r){let e=0;if(r.length<1e4)n.push(...r);else for(;e<r.length;)n.push(...r.slice(e,e+1e4)),e+=1e4}function Jn(n){const r={};let e=-1,t,a,i,u,s,f,h;const m=new Qt(n);for(;++e<m.length;){for(;e in r;)e=r[e];if(t=m.get(e),e&&t[1].type==="chunkFlow"&&m.get(e-1)[1].type==="listItemPrefix"&&(f=t[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(t[0]==="enter")t[1].contentType&&(Object.assign(r,jt(m,e)),e=r[e],h=!0);else if(t[1]._container){for(i=e,a=void 0;i--;)if(u=m.get(i),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=i);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(t[1].end={...m.get(a)[1].start},s=m.slice(a,e),s.unshift(t),m.splice(a,e-a+1,s))}}return sn(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function jt(n,r){const e=n.get(r)[1],t=n.get(r)[2];let a=r-1;const i=[];let u=e._tokenizer;u||(u=t.parser[e.contentType](e.start),e._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const s=u.events,f=[],h={};let m,p,g=-1,c=e,T=0,F=0;const q=[F];for(;c;){for(;n.get(++a)[1]!==c;);i.push(a),c._tokenizer||(m=t.sliceStream(c),c.next||m.push(null),p&&u.defineSkip(c.start),c._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),c._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=c,c=c.next}for(c=e;++g<s.length;)s[g][0]==="exit"&&s[g-1][0]==="enter"&&s[g][1].type===s[g-1][1].type&&s[g][1].start.line!==s[g][1].end.line&&(F=g+1,q.push(F),c._tokenizer=void 0,c.previous=void 0,c=c.next);for(u.events=[],c?(c._tokenizer=void 0,c.previous=void 0):q.pop(),g=q.length;g--;){const b=s.slice(q[g],q[g+1]),R=i.pop();f.push([R,R+b.length-1]),n.splice(R,2,b)}for(f.reverse(),g=-1;++g<f.length;)h[T+f[g][0]]=T+f[g][1],T+=f[g][1]-f[g][0]-1;return h}const Ut={resolve:Yt,tokenize:$t},Wt={partial:!0,tokenize:Gt};function Yt(n){return Jn(n),n}function $t(n,r){let e;return t;function t(s){return n.enter("content"),e=n.enter("chunkContent",{contentType:"content"}),a(s)}function a(s){return s===null?i(s):w(s)?n.check(Wt,u,i)(s):(n.consume(s),a)}function i(s){return n.exit("chunkContent"),n.exit("content"),r(s)}function u(s){return n.consume(s),n.exit("chunkContent"),e.next=n.enter("chunkContent",{contentType:"content",previous:e}),e=e.next,a}}function Gt(n,r,e){const t=this;return a;function a(u){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),O(n,i,"linePrefix")}function i(u){if(u===null||w(u))return e(u);const s=t.events[t.events.length-1];return!t.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?r(u):n.interrupt(t.parser.constructs.flow,e,r)(u)}}function Kn(n,r,e,t,a,i,u,s,f){const h=f||Number.POSITIVE_INFINITY;let m=0;return p;function p(b){return b===60?(n.enter(t),n.enter(a),n.enter(i),n.consume(b),n.exit(i),g):b===null||b===32||b===41||En(b)?e(b):(n.enter(t),n.enter(u),n.enter(s),n.enter("chunkString",{contentType:"string"}),F(b))}function g(b){return b===62?(n.enter(i),n.consume(b),n.exit(i),n.exit(a),n.exit(t),r):(n.enter(s),n.enter("chunkString",{contentType:"string"}),c(b))}function c(b){return b===62?(n.exit("chunkString"),n.exit(s),g(b)):b===null||b===60||w(b)?e(b):(n.consume(b),b===92?T:c)}function T(b){return b===60||b===62||b===92?(n.consume(b),c):c(b)}function F(b){return!m&&(b===null||b===41||$(b))?(n.exit("chunkString"),n.exit(s),n.exit(u),n.exit(t),r(b)):m<h&&b===40?(n.consume(b),m++,F):b===41?(n.consume(b),m--,F):b===null||b===32||b===40||En(b)?e(b):(n.consume(b),b===92?q:F)}function q(b){return b===40||b===41||b===92?(n.consume(b),F):F(b)}}function Xn(n,r,e,t,a,i){const u=this;let s=0,f;return h;function h(c){return n.enter(t),n.enter(a),n.consume(c),n.exit(a),n.enter(i),m}function m(c){return s>999||c===null||c===91||c===93&&!f||c===94&&!s&&"_hiddenFootnoteSupport"in u.parser.constructs?e(c):c===93?(n.exit(i),n.enter(a),n.consume(c),n.exit(a),n.exit(t),r):w(c)?(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),p(c))}function p(c){return c===null||c===91||c===93||w(c)||s++>999?(n.exit("chunkString"),m(c)):(n.consume(c),f||(f=!_(c)),c===92?g:p)}function g(c){return c===91||c===92||c===93?(n.consume(c),s++,p):p(c)}}function Zn(n,r,e,t,a,i){let u;return s;function s(g){return g===34||g===39||g===40?(n.enter(t),n.enter(a),n.consume(g),n.exit(a),u=g===40?41:g,f):e(g)}function f(g){return g===u?(n.enter(a),n.consume(g),n.exit(a),n.exit(t),r):(n.enter(i),h(g))}function h(g){return g===u?(n.exit(i),f(u)):g===null?e(g):w(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),O(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===u||g===null||w(g)?(n.exit("chunkString"),h(g)):(n.consume(g),g===92?p:m)}function p(g){return g===u||g===92?(n.consume(g),m):m(g)}}function bn(n,r){let e;return t;function t(a){return w(a)?(n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),e=!0,t):_(a)?O(n,t,e?"linePrefix":"lineSuffix")(a):r(a)}}const Jt={name:"definition",tokenize:Xt},Kt={partial:!0,tokenize:Zt};function Xt(n,r,e){const t=this;let a;return i;function i(c){return n.enter("definition"),u(c)}function u(c){return Xn.call(t,n,s,e,"definitionLabel","definitionLabelMarker","definitionLabelString")(c)}function s(c){return a=fn(t.sliceSerialize(t.events[t.events.length-1][1]).slice(1,-1)),c===58?(n.enter("definitionMarker"),n.consume(c),n.exit("definitionMarker"),f):e(c)}function f(c){return $(c)?bn(n,h)(c):h(c)}function h(c){return Kn(n,m,e,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(c)}function m(c){return n.attempt(Kt,p,p)(c)}function p(c){return _(c)?O(n,g,"whitespace")(c):g(c)}function g(c){return c===null||w(c)?(n.exit("definition"),t.parser.defined.push(a),r(c)):e(c)}}function Zt(n,r,e){return t;function t(s){return $(s)?bn(n,a)(s):e(s)}function a(s){return Zn(n,i,e,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return _(s)?O(n,u,"whitespace")(s):u(s)}function u(s){return s===null||w(s)?r(s):e(s)}}const vt={name:"hardBreakEscape",tokenize:ne};function ne(n,r,e){return t;function t(i){return n.enter("hardBreakEscape"),n.consume(i),a}function a(i){return w(i)?(n.exit("hardBreakEscape"),r(i)):e(i)}}const te={name:"headingAtx",resolve:ee,tokenize:re};function ee(n,r){let e=n.length-2,t=3,a,i;return n[t][1].type==="whitespace"&&(t+=2),e-2>t&&n[e][1].type==="whitespace"&&(e-=2),n[e][1].type==="atxHeadingSequence"&&(t===e-1||e-4>t&&n[e-2][1].type==="whitespace")&&(e-=t+1===e?2:4),e>t&&(a={type:"atxHeadingText",start:n[t][1].start,end:n[e][1].end},i={type:"chunkText",start:n[t][1].start,end:n[e][1].end,contentType:"text"},sn(n,t,e-t+1,[["enter",a,r],["enter",i,r],["exit",i,r],["exit",a,r]])),n}function re(n,r,e){let t=0;return a;function a(m){return n.enter("atxHeading"),i(m)}function i(m){return n.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&t++<6?(n.consume(m),u):m===null||$(m)?(n.exit("atxHeadingSequence"),s(m)):e(m)}function s(m){return m===35?(n.enter("atxHeadingSequence"),f(m)):m===null||w(m)?(n.exit("atxHeading"),r(m)):_(m)?O(n,s,"whitespace")(m):(n.enter("atxHeadingText"),h(m))}function f(m){return m===35?(n.consume(m),f):(n.exit("atxHeadingSequence"),s(m))}function h(m){return m===null||m===35||$(m)?(n.exit("atxHeadingText"),s(m)):(n.consume(m),h)}}const ie=["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"],Vn=["pre","script","style","textarea"],ue={concrete:!0,name:"htmlFlow",resolveTo:se,tokenize:oe},ae={partial:!0,tokenize:he},le={partial:!0,tokenize:ce};function se(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function oe(n,r,e){const t=this;let a,i,u,s,f;return h;function h(o){return m(o)}function m(o){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(o),p}function p(o){return o===33?(n.consume(o),g):o===47?(n.consume(o),i=!0,F):o===63?(n.consume(o),a=3,t.interrupt?r:l):nn(o)?(n.consume(o),u=String.fromCharCode(o),q):e(o)}function g(o){return o===45?(n.consume(o),a=2,c):o===91?(n.consume(o),a=5,s=0,T):nn(o)?(n.consume(o),a=4,t.interrupt?r:l):e(o)}function c(o){return o===45?(n.consume(o),t.interrupt?r:l):e(o)}function T(o){const X="CDATA[";return o===X.charCodeAt(s++)?(n.consume(o),s===X.length?t.interrupt?r:y:T):e(o)}function F(o){return nn(o)?(n.consume(o),u=String.fromCharCode(o),q):e(o)}function q(o){if(o===null||o===47||o===62||$(o)){const X=o===47,on=u.toLowerCase();return!X&&!i&&Vn.includes(on)?(a=1,t.interrupt?r(o):y(o)):ie.includes(u.toLowerCase())?(a=6,X?(n.consume(o),b):t.interrupt?r(o):y(o)):(a=7,t.interrupt&&!t.parser.lazy[t.now().line]?e(o):i?R(o):S(o))}return o===45||v(o)?(n.consume(o),u+=String.fromCharCode(o),q):e(o)}function b(o){return o===62?(n.consume(o),t.interrupt?r:y):e(o)}function R(o){return _(o)?(n.consume(o),R):L(o)}function S(o){return o===47?(n.consume(o),L):o===58||o===95||nn(o)?(n.consume(o),M):_(o)?(n.consume(o),S):L(o)}function M(o){return o===45||o===46||o===58||o===95||v(o)?(n.consume(o),M):D(o)}function D(o){return o===61?(n.consume(o),k):_(o)?(n.consume(o),D):S(o)}function k(o){return o===null||o===60||o===61||o===62||o===96?e(o):o===34||o===39?(n.consume(o),f=o,B):_(o)?(n.consume(o),k):H(o)}function B(o){return o===f?(n.consume(o),f=null,P):o===null||w(o)?e(o):(n.consume(o),B)}function H(o){return o===null||o===34||o===39||o===47||o===60||o===61||o===62||o===96||$(o)?D(o):(n.consume(o),H)}function P(o){return o===47||o===62||_(o)?S(o):e(o)}function L(o){return o===62?(n.consume(o),I):e(o)}function I(o){return o===null||w(o)?y(o):_(o)?(n.consume(o),I):e(o)}function y(o){return o===45&&a===2?(n.consume(o),U):o===60&&a===1?(n.consume(o),Q):o===62&&a===4?(n.consume(o),K):o===63&&a===3?(n.consume(o),l):o===93&&a===5?(n.consume(o),tn):w(o)&&(a===6||a===7)?(n.exit("htmlFlowData"),n.check(ae,en,N)(o)):o===null||w(o)?(n.exit("htmlFlowData"),N(o)):(n.consume(o),y)}function N(o){return n.check(le,V,en)(o)}function V(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),E}function E(o){return o===null||w(o)?N(o):(n.enter("htmlFlowData"),y(o))}function U(o){return o===45?(n.consume(o),l):y(o)}function Q(o){return o===47?(n.consume(o),u="",J):y(o)}function J(o){if(o===62){const X=u.toLowerCase();return Vn.includes(X)?(n.consume(o),K):y(o)}return nn(o)&&u.length<8?(n.consume(o),u+=String.fromCharCode(o),J):y(o)}function tn(o){return o===93?(n.consume(o),l):y(o)}function l(o){return o===62?(n.consume(o),K):o===45&&a===2?(n.consume(o),l):y(o)}function K(o){return o===null||w(o)?(n.exit("htmlFlowData"),en(o)):(n.consume(o),K)}function en(o){return n.exit("htmlFlow"),r(o)}}function ce(n,r,e){const t=this;return a;function a(u){return w(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i):e(u)}function i(u){return t.parser.lazy[t.now().line]?e(u):r(u)}}function he(n,r,e){return t;function t(a){return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),n.attempt(wn,r,e)}}const pe={name:"htmlText",tokenize:me};function me(n,r,e){const t=this;let a,i,u;return s;function s(l){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(l),f}function f(l){return l===33?(n.consume(l),h):l===47?(n.consume(l),D):l===63?(n.consume(l),S):nn(l)?(n.consume(l),H):e(l)}function h(l){return l===45?(n.consume(l),m):l===91?(n.consume(l),i=0,T):nn(l)?(n.consume(l),R):e(l)}function m(l){return l===45?(n.consume(l),c):e(l)}function p(l){return l===null?e(l):l===45?(n.consume(l),g):w(l)?(u=p,Q(l)):(n.consume(l),p)}function g(l){return l===45?(n.consume(l),c):p(l)}function c(l){return l===62?U(l):l===45?g(l):p(l)}function T(l){const K="CDATA[";return l===K.charCodeAt(i++)?(n.consume(l),i===K.length?F:T):e(l)}function F(l){return l===null?e(l):l===93?(n.consume(l),q):w(l)?(u=F,Q(l)):(n.consume(l),F)}function q(l){return l===93?(n.consume(l),b):F(l)}function b(l){return l===62?U(l):l===93?(n.consume(l),b):F(l)}function R(l){return l===null||l===62?U(l):w(l)?(u=R,Q(l)):(n.consume(l),R)}function S(l){return l===null?e(l):l===63?(n.consume(l),M):w(l)?(u=S,Q(l)):(n.consume(l),S)}function M(l){return l===62?U(l):S(l)}function D(l){return nn(l)?(n.consume(l),k):e(l)}function k(l){return l===45||v(l)?(n.consume(l),k):B(l)}function B(l){return w(l)?(u=B,Q(l)):_(l)?(n.consume(l),B):U(l)}function H(l){return l===45||v(l)?(n.consume(l),H):l===47||l===62||$(l)?P(l):e(l)}function P(l){return l===47?(n.consume(l),U):l===58||l===95||nn(l)?(n.consume(l),L):w(l)?(u=P,Q(l)):_(l)?(n.consume(l),P):U(l)}function L(l){return l===45||l===46||l===58||l===95||v(l)?(n.consume(l),L):I(l)}function I(l){return l===61?(n.consume(l),y):w(l)?(u=I,Q(l)):_(l)?(n.consume(l),I):P(l)}function y(l){return l===null||l===60||l===61||l===62||l===96?e(l):l===34||l===39?(n.consume(l),a=l,N):w(l)?(u=y,Q(l)):_(l)?(n.consume(l),y):(n.consume(l),V)}function N(l){return l===a?(n.consume(l),a=void 0,E):l===null?e(l):w(l)?(u=N,Q(l)):(n.consume(l),N)}function V(l){return l===null||l===34||l===39||l===60||l===61||l===96?e(l):l===47||l===62||$(l)?P(l):(n.consume(l),V)}function E(l){return l===47||l===62||$(l)?P(l):e(l)}function U(l){return l===62?(n.consume(l),n.exit("htmlTextData"),n.exit("htmlText"),r):e(l)}function Q(l){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),J}function J(l){return _(l)?O(n,tn,"linePrefix",t.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):tn(l)}function tn(l){return n.enter("htmlTextData"),u(l)}}const _n={name:"labelEnd",resolveAll:ke,resolveTo:de,tokenize:be},fe={tokenize:Se},ge={tokenize:ye},xe={tokenize:Ie};function ke(n){let r=-1;const e=[];for(;++r<n.length;){const t=n[r][1];if(e.push(n[r]),t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd"){const a=t.type==="labelImage"?4:2;t.type="data",r+=a}}return n.length!==e.length&&sn(n,0,n.length,e),n}function de(n,r){let e=n.length,t=0,a,i,u,s;for(;e--;)if(a=n[e][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;n[e][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(n[e][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=e,a.type!=="labelLink")){t=2;break}}else a.type==="labelEnd"&&(u=e);const f={type:n[i][1].type==="labelLink"?"link":"image",start:{...n[i][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[i][1].start},end:{...n[u][1].end}},m={type:"labelText",start:{...n[i+t+2][1].end},end:{...n[u-2][1].start}};return s=[["enter",f,r],["enter",h,r]],s=G(s,n.slice(i+1,i+t+3)),s=G(s,[["enter",m,r]]),s=G(s,Bn(r.parser.constructs.insideSpan.null,n.slice(i+t+4,u-3),r)),s=G(s,[["exit",m,r],n[u-2],n[u-1],["exit",h,r]]),s=G(s,n.slice(u+1)),s=G(s,[["exit",f,r]]),sn(n,i,n.length,s),n}function be(n,r,e){const t=this;let a=t.events.length,i,u;for(;a--;)if((t.events[a][1].type==="labelImage"||t.events[a][1].type==="labelLink")&&!t.events[a][1]._balanced){i=t.events[a][1];break}return s;function s(g){return i?i._inactive?p(g):(u=t.parser.defined.includes(fn(t.sliceSerialize({start:i.end,end:t.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(g),n.exit("labelMarker"),n.exit("labelEnd"),f):e(g)}function f(g){return g===40?n.attempt(fe,m,u?m:p)(g):g===91?n.attempt(ge,m,u?h:p)(g):u?m(g):p(g)}function h(g){return n.attempt(xe,m,p)(g)}function m(g){return r(g)}function p(g){return i._balanced=!0,e(g)}}function Se(n,r,e){return t;function t(p){return n.enter("resource"),n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),a}function a(p){return $(p)?bn(n,i)(p):i(p)}function i(p){return p===41?m(p):Kn(n,u,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return $(p)?bn(n,f)(p):m(p)}function s(p){return e(p)}function f(p){return p===34||p===39||p===40?Zn(n,h,e,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return $(p)?bn(n,m)(p):m(p)}function m(p){return p===41?(n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),n.exit("resource"),r):e(p)}}function ye(n,r,e){const t=this;return a;function a(s){return Xn.call(t,n,i,u,"reference","referenceMarker","referenceString")(s)}function i(s){return t.parser.defined.includes(fn(t.sliceSerialize(t.events[t.events.length-1][1]).slice(1,-1)))?r(s):e(s)}function u(s){return e(s)}}function Ie(n,r,e){return t;function t(i){return n.enter("reference"),n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),a}function a(i){return i===93?(n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),n.exit("reference"),r):e(i)}}const we={name:"labelStartImage",resolveAll:_n.resolveAll,tokenize:ze};function ze(n,r,e){const t=this;return a;function a(s){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(s),n.exit("labelImageMarker"),i}function i(s){return s===91?(n.enter("labelMarker"),n.consume(s),n.exit("labelMarker"),n.exit("labelImage"),u):e(s)}function u(s){return s===94&&"_hiddenFootnoteSupport"in t.parser.constructs?e(s):r(s)}}const Ce={name:"labelStartLink",resolveAll:_n.resolveAll,tokenize:Ee};function Ee(n,r,e){const t=this;return a;function a(u){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(u),n.exit("labelMarker"),n.exit("labelLink"),i}function i(u){return u===94&&"_hiddenFootnoteSupport"in t.parser.constructs?e(u):r(u)}}const Cn={name:"lineEnding",tokenize:Te};function Te(n,r){return e;function e(t){return n.enter("lineEnding"),n.consume(t),n.exit("lineEnding"),O(n,r,"linePrefix")}}const In={name:"thematicBreak",tokenize:Fe};function Fe(n,r,e){let t=0,a;return i;function i(h){return n.enter("thematicBreak"),u(h)}function u(h){return a=h,s(h)}function s(h){return h===a?(n.enter("thematicBreakSequence"),f(h)):t>=3&&(h===null||w(h))?(n.exit("thematicBreak"),r(h)):e(h)}function f(h){return h===a?(n.consume(h),t++,f):(n.exit("thematicBreakSequence"),_(h)?O(n,s,"whitespace")(h):s(h))}}const W={continuation:{tokenize:Ae},exit:Oe,name:"list",tokenize:Pe},Be={partial:!0,tokenize:Me},_e={partial:!0,tokenize:Le};function Pe(n,r,e){const t=this,a=t.events[t.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return s;function s(c){const T=t.containerState.type||(c===42||c===43||c===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!t.containerState.marker||c===t.containerState.marker:Tn(c)){if(t.containerState.type||(t.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),c===42||c===45?n.check(In,e,h)(c):h(c);if(!t.interrupt||c===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),f(c)}return e(c)}function f(c){return Tn(c)&&++u<10?(n.consume(c),f):(!t.interrupt||u<2)&&(t.containerState.marker?c===t.containerState.marker:c===41||c===46)?(n.exit("listItemValue"),h(c)):e(c)}function h(c){return n.enter("listItemMarker"),n.consume(c),n.exit("listItemMarker"),t.containerState.marker=t.containerState.marker||c,n.check(wn,t.interrupt?e:m,n.attempt(Be,g,p))}function m(c){return t.containerState.initialBlankLine=!0,i++,g(c)}function p(c){return _(c)?(n.enter("listItemPrefixWhitespace"),n.consume(c),n.exit("listItemPrefixWhitespace"),g):e(c)}function g(c){return t.containerState.size=i+t.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(c)}}function Ae(n,r,e){const t=this;return t.containerState._closeFlow=void 0,n.check(wn,a,i);function a(s){return t.containerState.furtherBlankLines=t.containerState.furtherBlankLines||t.containerState.initialBlankLine,O(n,r,"listItemIndent",t.containerState.size+1)(s)}function i(s){return t.containerState.furtherBlankLines||!_(s)?(t.containerState.furtherBlankLines=void 0,t.containerState.initialBlankLine=void 0,u(s)):(t.containerState.furtherBlankLines=void 0,t.containerState.initialBlankLine=void 0,n.attempt(_e,r,u)(s))}function u(s){return t.containerState._closeFlow=!0,t.interrupt=void 0,O(n,n.attempt(W,r,e),"linePrefix",t.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Le(n,r,e){const t=this;return O(n,a,"listItemIndent",t.containerState.size+1);function a(i){const u=t.events[t.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===t.containerState.size?r(i):e(i)}}function Oe(n){n.exit(this.containerState.type)}function Me(n,r,e){const t=this;return O(n,a,"listItemPrefixWhitespace",t.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const u=t.events[t.events.length-1];return!_(i)&&u&&u[1].type==="listItemPrefixWhitespace"?r(i):e(i)}}const Qn={name:"setextUnderline",resolveTo:Ne,tokenize:De};function Ne(n,r){let e=n.length,t,a,i;for(;e--;)if(n[e][0]==="enter"){if(n[e][1].type==="content"){t=e;break}n[e][1].type==="paragraph"&&(a=e)}else n[e][1].type==="content"&&n.splice(e,1),!i&&n[e][1].type==="definition"&&(i=e);const u={type:"setextHeading",start:{...n[t][1].start},end:{...n[n.length-1][1].end}};return n[a][1].type="setextHeadingText",i?(n.splice(a,0,["enter",u,r]),n.splice(i+1,0,["exit",n[t][1],r]),n[t][1].end={...n[i][1].end}):n[t][1]=u,n.push(["exit",u,r]),n}function De(n,r,e){const t=this;let a;return i;function i(h){let m=t.events.length,p;for(;m--;)if(t.events[m][1].type!=="lineEnding"&&t.events[m][1].type!=="linePrefix"&&t.events[m][1].type!=="content"){p=t.events[m][1].type==="paragraph";break}return!t.parser.lazy[t.now().line]&&(t.interrupt||p)?(n.enter("setextHeadingLine"),a=h,u(h)):e(h)}function u(h){return n.enter("setextHeadingLineSequence"),s(h)}function s(h){return h===a?(n.consume(h),s):(n.exit("setextHeadingLineSequence"),_(h)?O(n,f,"lineSuffix")(h):f(h))}function f(h){return h===null||w(h)?(n.exit("setextHeadingLine"),r(h)):e(h)}}const qe={tokenize:Re};function Re(n){const r=this,e=n.attempt(wn,t,n.attempt(this.parser.constructs.flowInitial,a,O(n,n.attempt(this.parser.constructs.flow,a,n.attempt(Ut,a)),"linePrefix")));return e;function t(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),r.currentConstruct=void 0,e}function a(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),r.currentConstruct=void 0,e}}const He={resolveAll:nt()},Ve=vn("string"),Qe=vn("text");function vn(n){return{resolveAll:nt(n==="text"?je:void 0),tokenize:r};function r(e){const t=this,a=this.parser.constructs[n],i=e.attempt(a,u,s);return u;function u(m){return h(m)?i(m):s(m)}function s(m){if(m===null){e.consume(m);return}return e.enter("data"),e.consume(m),f}function f(m){return h(m)?(e.exit("data"),i(m)):(e.consume(m),f)}function h(m){if(m===null)return!0;const p=a[m];let g=-1;if(p)for(;++g<p.length;){const c=p[g];if(!c.previous||c.previous.call(t,t.previous))return!0}return!1}}}function nt(n){return r;function r(e,t){let a=-1,i;for(;++a<=e.length;)i===void 0?e[a]&&e[a][1].type==="data"&&(i=a,a++):(!e[a]||e[a][1].type!=="data")&&(a!==i+2&&(e[i][1].end=e[a-1][1].end,e.splice(i+2,a-i-2),a=i+2),i=void 0);return n?n(e,t):e}}function je(n,r){let e=0;for(;++e<=n.length;)if((e===n.length||n[e][1].type==="lineEnding")&&n[e-1][1].type==="data"){const t=n[e-1][1],a=r.sliceStream(t);let i=a.length,u=-1,s=0,f;for(;i--;){const h=a[i];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)s++,u--;if(u)break;u=-1}else if(h===-2)f=!0,s++;else if(h!==-1){i++;break}}if(r._contentTypeTextTrailing&&e===n.length&&(s=0),s){const h={type:e===n.length||f||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?u:t.start._bufferIndex+u,_index:t.start._index+i,line:t.end.line,column:t.end.column-s,offset:t.end.offset-s},end:{...t.end}};t.end={...h.start},t.start.offset===t.end.offset?Object.assign(t,h):(n.splice(e,0,["enter",h,r],["exit",h,r]),e+=2)}e++}return n}const Ue={42:W,43:W,45:W,48:W,49:W,50:W,51:W,52:W,53:W,54:W,55:W,56:W,57:W,62:Yn},We={91:Jt},Ye={[-2]:zn,[-1]:zn,32:zn},$e={35:te,42:In,45:[Qn,In],60:ue,61:Qn,95:In,96:Hn,126:Hn},Ge={38:Gn,92:$n},Je={[-5]:Cn,[-4]:Cn,[-3]:Cn,33:we,38:Gn,42:Fn,60:[Et,pe],91:Ce,92:[vt,$n],93:_n,95:Fn,96:qt},Ke={null:[Fn,He]},Xe={null:[42,95]},Ze={null:[]},ve=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Xe,contentInitial:We,disable:Ze,document:Ue,flow:$e,flowInitial:Ye,insideSpan:Ke,string:Ge,text:Je},Symbol.toStringTag,{value:"Module"}));function nr(n,r,e){let t={_bufferIndex:-1,_index:0,line:e&&e.line||1,column:e&&e.column||1,offset:e&&e.offset||0};const a={},i=[];let u=[],s=[];const f={attempt:B(D),check:B(k),consume:R,enter:S,exit:M,interrupt:B(k,{interrupt:!0})},h={code:null,containerState:{},defineSkip:F,events:[],now:T,parser:n,previous:null,sliceSerialize:g,sliceStream:c,write:p};let m=r.tokenize.call(h,f);return r.resolveAll&&i.push(r),h;function p(I){return u=G(u,I),q(),u[u.length-1]!==null?[]:(H(r,0),h.events=Bn(i,h.events,h),h.events)}function g(I,y){return er(c(I),y)}function c(I){return tr(u,I)}function T(){const{_bufferIndex:I,_index:y,line:N,column:V,offset:E}=t;return{_bufferIndex:I,_index:y,line:N,column:V,offset:E}}function F(I){a[I.line]=I.column,L()}function q(){let I;for(;t._index<u.length;){const y=u[t._index];if(typeof y=="string")for(I=t._index,t._bufferIndex<0&&(t._bufferIndex=0);t._index===I&&t._bufferIndex<y.length;)b(y.charCodeAt(t._bufferIndex));else b(y)}}function b(I){m=m(I)}function R(I){w(I)?(t.line++,t.column=1,t.offset+=I===-3?2:1,L()):I!==-1&&(t.column++,t.offset++),t._bufferIndex<0?t._index++:(t._bufferIndex++,t._bufferIndex===u[t._index].length&&(t._bufferIndex=-1,t._index++)),h.previous=I}function S(I,y){const N=y||{};return N.type=I,N.start=T(),h.events.push(["enter",N,h]),s.push(N),N}function M(I){const y=s.pop();return y.end=T(),h.events.push(["exit",y,h]),y}function D(I,y){H(I,y.from)}function k(I,y){y.restore()}function B(I,y){return N;function N(V,E,U){let Q,J,tn,l;return Array.isArray(V)?en(V):"tokenize"in V?en([V]):K(V);function K(j){return gn;function gn(an){const hn=an!==null&&j[an],pn=an!==null&&j.null,Sn=[...Array.isArray(hn)?hn:hn?[hn]:[],...Array.isArray(pn)?pn:pn?[pn]:[]];return en(Sn)(an)}}function en(j){return Q=j,J=0,j.length===0?U:o(j[J])}function o(j){return gn;function gn(an){return l=P(),tn=j,j.partial||(h.currentConstruct=j),j.name&&h.parser.constructs.disable.null.includes(j.name)?on():j.tokenize.call(y?Object.assign(Object.create(h),y):h,f,X,on)(an)}}function X(j){return I(tn,l),E}function on(j){return l.restore(),++J<Q.length?o(Q[J]):U}}}function H(I,y){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&sn(h.events,y,h.events.length-y,I.resolve(h.events.slice(y),h)),I.resolveTo&&(h.events=I.resolveTo(h.events,h))}function P(){const I=T(),y=h.previous,N=h.currentConstruct,V=h.events.length,E=Array.from(s);return{from:V,restore:U};function U(){t=I,h.previous=y,h.currentConstruct=N,h.events.length=V,s=E,L()}}function L(){t.line in a&&t.column<2&&(t.column=a[t.line],t.offset+=a[t.line]-1)}}function tr(n,r){const e=r.start._index,t=r.start._bufferIndex,a=r.end._index,i=r.end._bufferIndex;let u;if(e===a)u=[n[e].slice(t,i)];else{if(u=n.slice(e,a),t>-1){const s=u[0];typeof s=="string"?u[0]=s.slice(t):u.shift()}i>0&&u.push(n[a].slice(0,i))}return u}function er(n,r){let e=-1;const t=[];let a;for(;++e<n.length;){const i=n[e];let u;if(typeof i=="string")u=i;else switch(i){case-5:{u="\r";break}case-4:{u=`
2
+ `;break}case-3:{u=`\r
3
+ `;break}case-2:{u=r?" ":" ";break}case-1:{if(!r&&a)continue;u=" ";break}default:u=String.fromCharCode(i)}a=i===-2,t.push(u)}return t.join("")}function rr(n){const t={constructs:ft([ve,...(n||{}).extensions||[]]),content:a(bt),defined:[],document:a(yt),flow:a(qe),lazy:{},string:a(Ve),text:a(Qe)};return t;function a(i){return u;function u(s){return nr(t,i,s)}}}function ir(n){for(;!Jn(n););return n}const jn=/[\0\t\n\r]/g;function ur(){let n=1,r="",e=!0,t;return a;function a(i,u,s){const f=[];let h,m,p,g,c;for(i=r+(typeof i=="string"?i.toString():new TextDecoder(u||void 0).decode(i)),p=0,r="",e&&(i.charCodeAt(0)===65279&&p++,e=void 0);p<i.length;){if(jn.lastIndex=p,h=jn.exec(i),g=h&&h.index!==void 0?h.index:i.length,c=i.charCodeAt(g),!h){r=i.slice(p);break}if(c===10&&p===g&&t)f.push(-3),t=void 0;else switch(t&&(f.push(-5),t=void 0),p<g&&(f.push(i.slice(p,g)),n+=g-p),c){case 0:{f.push(65533),n++;break}case 9:{for(m=Math.ceil(n/4)*4,f.push(-2);n++<m;)f.push(-1);break}case 10:{f.push(-4),n=1;break}default:t=!0,n=1}p=g+1}return s&&(t&&f.push(-5),r&&f.push(r),f.push(null)),f}}const tt={}.hasOwnProperty;function ar(n,r,e){return typeof r!="string"&&(e=r,r=void 0),lr(e)(ir(rr(e).document().write(ur()(n,r,!0))))}function lr(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(On),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Pn),blockQuote:i(pn),characterEscape:P,characterReference:P,codeFenced:i(Sn),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:i(Sn,u),codeText:i(rt,u),codeTextData:P,data:P,codeFlowValue:P,definition:i(it),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:i(ut),hardBreakEscape:i(An),hardBreakTrailing:i(An),htmlFlow:i(Ln,u),htmlFlowData:P,htmlText:i(Ln,u),htmlTextData:P,image:i(at),label:u,link:i(On),listItem:i(lt),listItemValue:g,listOrdered:i(Mn,p),listUnordered:i(Mn),paragraph:i(st),reference:o,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:i(Pn),strong:i(ot),thematicBreak:i(ht)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:hn,autolinkProtocol:an,blockQuote:f(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:on,characterReferenceMarkerNumeric:on,characterReferenceValue:j,characterReference:gn,codeFenced:f(q),codeFencedFence:F,codeFencedFenceInfo:c,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:f(b),codeText:f(E),codeTextData:L,data:L,definition:f(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(y),hardBreakTrailing:f(y),htmlFlow:f(N),htmlFlowData:L,htmlText:f(V),htmlTextData:L,image:f(Q),label:tn,labelText:J,lineEnding:I,link:f(U),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:X,resourceDestinationString:l,resourceTitleString:K,resource:en,setextHeading:f(H),setextHeadingLineSequence:B,setextHeadingText:k,strong:f(),thematicBreak:f()}};et(r,(n||{}).mdastExtensions||[]);const e={};return t;function t(x){let d={type:"root",children:[]};const z={stack:[d],tokenStack:[],config:r,enter:s,exit:h,buffer:u,resume:m,data:e},C=[];let A=-1;for(;++A<x.length;)if(x[A][1].type==="listOrdered"||x[A][1].type==="listUnordered")if(x[A][0]==="enter")C.push(A);else{const Z=C.pop();A=a(x,Z,A)}for(A=-1;++A<x.length;){const Z=r[x[A][0]];tt.call(Z,x[A][1].type)&&Z[x[A][1].type].call(Object.assign({sliceSerialize:x[A][2].sliceSerialize},z),x[A][1])}if(z.tokenStack.length>0){const Z=z.tokenStack[z.tokenStack.length-1];(Z[1]||Un).call(z,void 0,Z[0])}for(d.position={start:ln(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:ln(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},A=-1;++A<r.transforms.length;)d=r.transforms[A](d)||d;return d}function a(x,d,z){let C=d-1,A=-1,Z=!1,cn,rn,xn,kn;for(;++C<=z;){const Y=x[C];switch(Y[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Y[0]==="enter"?A++:A--,kn=void 0;break}case"lineEndingBlank":{Y[0]==="enter"&&(cn&&!kn&&!A&&!xn&&(xn=C),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!A&&Y[0]==="enter"&&Y[1].type==="listItemPrefix"||A===-1&&Y[0]==="exit"&&(Y[1].type==="listUnordered"||Y[1].type==="listOrdered")){if(cn){let mn=C;for(rn=void 0;mn--;){const un=x[mn];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;rn&&(x[rn][1].type="lineEndingBlank",Z=!0),un[1].type="lineEnding",rn=mn}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}xn&&(!rn||xn<rn)&&(cn._spread=!0),cn.end=Object.assign({},rn?x[rn][1].start:Y[1].end),x.splice(rn||C,0,["exit",cn,Y[2]]),C++,z++}if(Y[1].type==="listItemPrefix"){const mn={type:"listItem",_spread:!1,start:Object.assign({},Y[1].start),end:void 0};cn=mn,x.splice(C,0,["enter",mn,Y[2]]),C++,z++,xn=void 0,kn=!0}}}return x[d][1]._spread=Z,z}function i(x,d){return z;function z(C){s.call(this,x(C),C),d&&d.call(this,C)}}function u(){this.stack.push({type:"fragment",children:[]})}function s(x,d,z){this.stack[this.stack.length-1].children.push(x),this.stack.push(x),this.tokenStack.push([d,z||void 0]),x.position={start:ln(d.start),end:void 0}}function f(x){return d;function d(z){x&&x.call(this,z),h.call(this,z)}}function h(x,d){const z=this.stack.pop(),C=this.tokenStack.pop();if(C)C[0].type!==x.type&&(d?d.call(this,x,C[0]):(C[1]||Un).call(this,x,C[0]));else throw new Error("Cannot close `"+x.type+"` ("+yn({start:x.start,end:x.end})+"): it’s not open");z.position.end=ln(x.end)}function m(){return dt(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(x){if(this.data.expectingFirstListItemValue){const d=this.stack[this.stack.length-2];d.start=Number.parseInt(this.sliceSerialize(x),10),this.data.expectingFirstListItemValue=void 0}}function c(){const x=this.resume(),d=this.stack[this.stack.length-1];d.lang=x}function T(){const x=this.resume(),d=this.stack[this.stack.length-1];d.meta=x}function F(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function q(){const x=this.resume(),d=this.stack[this.stack.length-1];d.value=x.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const x=this.resume(),d=this.stack[this.stack.length-1];d.value=x.replace(/(\r?\n|\r)$/g,"")}function R(x){const d=this.resume(),z=this.stack[this.stack.length-1];z.label=d,z.identifier=fn(this.sliceSerialize(x)).toLowerCase()}function S(){const x=this.resume(),d=this.stack[this.stack.length-1];d.title=x}function M(){const x=this.resume(),d=this.stack[this.stack.length-1];d.url=x}function D(x){const d=this.stack[this.stack.length-1];if(!d.depth){const z=this.sliceSerialize(x).length;d.depth=z}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function B(x){const d=this.stack[this.stack.length-1];d.depth=this.sliceSerialize(x).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function P(x){const z=this.stack[this.stack.length-1].children;let C=z[z.length-1];(!C||C.type!=="text")&&(C=ct(),C.position={start:ln(x.start),end:void 0},z.push(C)),this.stack.push(C)}function L(x){const d=this.stack.pop();d.value+=this.sliceSerialize(x),d.position.end=ln(x.end)}function I(x){const d=this.stack[this.stack.length-1];if(this.data.atHardBreak){const z=d.children[d.children.length-1];z.position.end=ln(x.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(d.type)&&(P.call(this,x),L.call(this,x))}function y(){this.data.atHardBreak=!0}function N(){const x=this.resume(),d=this.stack[this.stack.length-1];d.value=x}function V(){const x=this.resume(),d=this.stack[this.stack.length-1];d.value=x}function E(){const x=this.resume(),d=this.stack[this.stack.length-1];d.value=x}function U(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const d=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=d,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function Q(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const d=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=d,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function J(x){const d=this.sliceSerialize(x),z=this.stack[this.stack.length-2];z.label=pt(d),z.identifier=fn(d).toLowerCase()}function tn(){const x=this.stack[this.stack.length-1],d=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){const C=x.children;z.children=C}else z.alt=d}function l(){const x=this.resume(),d=this.stack[this.stack.length-1];d.url=x}function K(){const x=this.resume(),d=this.stack[this.stack.length-1];d.title=x}function en(){this.data.inReference=void 0}function o(){this.data.referenceType="collapsed"}function X(x){const d=this.resume(),z=this.stack[this.stack.length-1];z.label=d,z.identifier=fn(this.sliceSerialize(x)).toLowerCase(),this.data.referenceType="full"}function on(x){this.data.characterReferenceType=x.type}function j(x){const d=this.sliceSerialize(x),z=this.data.characterReferenceType;let C;z?(C=mt(d,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):C=Wn(d);const A=this.stack[this.stack.length-1];A.value+=C}function gn(x){const d=this.stack.pop();d.position.end=ln(x.end)}function an(x){L.call(this,x);const d=this.stack[this.stack.length-1];d.url=this.sliceSerialize(x)}function hn(x){L.call(this,x);const d=this.stack[this.stack.length-1];d.url="mailto:"+this.sliceSerialize(x)}function pn(){return{type:"blockquote",children:[]}}function Sn(){return{type:"code",lang:null,meta:null,value:""}}function rt(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ut(){return{type:"emphasis",children:[]}}function Pn(){return{type:"heading",depth:0,children:[]}}function An(){return{type:"break"}}function Ln(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function On(){return{type:"link",title:null,url:"",children:[]}}function Mn(x){return{type:"list",ordered:x.type==="listOrdered",start:null,spread:x._spread,children:[]}}function lt(x){return{type:"listItem",spread:x._spread,checked:null,children:[]}}function st(){return{type:"paragraph",children:[]}}function ot(){return{type:"strong",children:[]}}function ct(){return{type:"text",value:""}}function ht(){return{type:"thematicBreak"}}}function ln(n){return{line:n.line,column:n.column,offset:n.offset}}function et(n,r){let e=-1;for(;++e<r.length;){const t=r[e];Array.isArray(t)?et(n,t):sr(n,t)}}function sr(n,r){let e;for(e in r)if(tt.call(r,e))switch(e){case"canContainEols":{const t=r[e];t&&n[e].push(...t);break}case"transforms":{const t=r[e];t&&n[e].push(...t);break}case"enter":case"exit":{const t=r[e];t&&Object.assign(n[e],t);break}}}function Un(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+yn({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+yn({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+yn({start:r.start,end:r.end})+") is still open")}function mr(n){const r=this;r.parser=e;function e(t){return ar(t,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}export{mr as default};
@@ -0,0 +1,12 @@
1
+ import{c as I,t as P}from"./index-dJjNfQvw.js";const w=function(n){if(n==null)return H;if(typeof n=="function")return g(n);if(typeof n=="object")return Array.isArray(n)?N(n):U(n);if(typeof n=="string")return Q(n);throw new Error("Expected function, string, or object as test")};function N(n){const r=[];let e=-1;for(;++e<n.length;)r[e]=w(n[e]);return g(c);function c(...u){let f=-1;for(;++f<r.length;)if(r[f].apply(this,u))return!0;return!1}}function U(n){const r=n;return g(e);function e(c){const u=c;let f;for(f in n)if(u[f]!==r[f])return!1;return!0}}function Q(n){return g(r);function r(e){return e&&e.type===n}}function g(n){return r;function r(e,c,u){return!!(K(e)&&n.call(this,e,typeof c=="number"?c:void 0,u||void 0))}}function H(){return!0}function K(n){return n!==null&&typeof n=="object"&&"type"in n}const T=[],D=!0,v=!1,G="skip";function J(n,r,e,c){let u;typeof r=="function"&&typeof e!="function"?(c=e,e=r):u=r;const f=w(u),o=c?-1:1;l(n,void 0,[])();function l(t,i,s){const a=t&&typeof t=="object"?t:{};if(typeof a.type=="string"){const d=typeof a.tagName=="string"?a.tagName:typeof a.name=="string"?a.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(t.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=T,p,m,_;if((!r||f(t,i,s[s.length-1]||void 0))&&(d=W(e(t,s)),d[0]===v))return d;if("children"in t&&t.children){const k=t;if(k.children&&d[0]!==G)for(m=(c?k.children.length:-1)+o,_=s.concat(k);m>-1&&m<k.children.length;){const j=k.children[m];if(p=l(j,m,_)(),p[0]===v)return p;m=typeof p[1]=="number"?p[1]:m+o}}return d}}}function W(n){return Array.isArray(n)?n:typeof n=="number"?[D,n]:n==null?T:[n]}function X(n,r,e,c){const u=e.enter("blockquote"),f=e.createTracker(c);f.move("> "),f.shift(2);const o=e.indentLines(e.containerFlow(n,f.current()),Y);return u(),o}function Y(n,r,e){return">"+(e?"":" ")+n}function Z(n,r){return A(n,r.inConstruct,!0)&&!A(n,r.notInConstruct,!1)}function A(n,r,e){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return e;let c=-1;for(;++c<r.length;)if(n.includes(r[c]))return!0;return!1}function E(n,r,e,c){let u=-1;for(;++u<e.unsafe.length;)if(e.unsafe[u].character===`
2
+ `&&Z(e.stack,e.unsafe[u]))return/[ \t]/.test(c.before)?"":" ";return`\\
3
+ `}function V(n,r){const e=String(n);let c=e.indexOf(r),u=c,f=0,o=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;c!==-1;)c===u?++f>o&&(o=f):f=1,u=c+r.length,c=e.indexOf(r,u);return o}function ee(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function ne(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function re(n,r,e,c){const u=ne(e),f=n.value||"",o=u==="`"?"GraveAccent":"Tilde";if(ee(n,e)){const a=e.enter("codeIndented"),h=e.indentLines(f,te);return a(),h}const l=e.createTracker(c),t=u.repeat(Math.max(V(f,u)+1,3)),i=e.enter("codeFenced");let s=l.move(t);if(n.lang){const a=e.enter(`codeFencedLang${o}`);s+=l.move(e.safe(n.lang,{before:s,after:" ",encode:["`"],...l.current()})),a()}if(n.lang&&n.meta){const a=e.enter(`codeFencedMeta${o}`);s+=l.move(" "),s+=l.move(e.safe(n.meta,{before:s,after:`
4
+ `,encode:["`"],...l.current()})),a()}return s+=l.move(`
5
+ `),f&&(s+=l.move(f+`
6
+ `)),s+=l.move(t),i(),s}function te(n,r,e){return(e?"":" ")+n}function y(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function ie(n,r,e,c){const u=y(e),f=u==='"'?"Quote":"Apostrophe",o=e.enter("definition");let l=e.enter("label");const t=e.createTracker(c);let i=t.move("[");return i+=t.move(e.safe(e.associationId(n),{before:i,after:"]",...t.current()})),i+=t.move("]: "),l(),!n.url||/[\0- \u007F]/.test(n.url)?(l=e.enter("destinationLiteral"),i+=t.move("<"),i+=t.move(e.safe(n.url,{before:i,after:">",...t.current()})),i+=t.move(">")):(l=e.enter("destinationRaw"),i+=t.move(e.safe(n.url,{before:i,after:n.title?" ":`
7
+ `,...t.current()}))),l(),n.title&&(l=e.enter(`title${f}`),i+=t.move(" "+u),i+=t.move(e.safe(n.title,{before:i,after:u,...t.current()})),i+=t.move(u),l()),o(),i}function oe(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function x(n){return"&#x"+n.toString(16).toUpperCase()+";"}function b(n,r,e){const c=I(n),u=I(r);return c===void 0?u===void 0?e==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:c===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}R.peek=ce;function R(n,r,e,c){const u=oe(e),f=e.enter("emphasis"),o=e.createTracker(c),l=o.move(u);let t=o.move(e.containerPhrasing(n,{after:u,before:l,...o.current()}));const i=t.charCodeAt(0),s=b(c.before.charCodeAt(c.before.length-1),i,u);s.inside&&(t=x(i)+t.slice(1));const a=t.charCodeAt(t.length-1),h=b(c.after.charCodeAt(0),a,u);h.inside&&(t=t.slice(0,-1)+x(a));const d=o.move(u);return f(),e.attentionEncodeSurroundingInfo={after:h.outside,before:s.outside},l+t+d}function ce(n,r,e){return e.options.emphasis||"*"}function ue(n,r,e,c){let u,f,o;typeof r=="function"&&typeof e!="function"?(f=void 0,o=r,u=e):(f=r,o=e,u=c),J(n,f,l,u);function l(t,i){const s=i[i.length-1],a=s?s.children.indexOf(t):void 0;return o(t,a,s)}}function le(n,r){let e=!1;return ue(n,function(c){if("value"in c&&/\r?\n|\r/.test(c.value)||c.type==="break")return e=!0,v}),!!((!n.depth||n.depth<3)&&P(n)&&(r.options.setext||e))}function fe(n,r,e,c){const u=Math.max(Math.min(6,n.depth||1),1),f=e.createTracker(c);if(le(n,e)){const s=e.enter("headingSetext"),a=e.enter("phrasing"),h=e.containerPhrasing(n,{...f.current(),before:`
8
+ `,after:`
9
+ `});return a(),s(),h+`
10
+ `+(u===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
11
+ `))+1))}const o="#".repeat(u),l=e.enter("headingAtx"),t=e.enter("phrasing");f.move(o+" ");let i=e.containerPhrasing(n,{before:"# ",after:`
12
+ `,...f.current()});return/^[\t ]/.test(i)&&(i=x(i.charCodeAt(0))+i.slice(1)),i=i?o+" "+i:o,e.options.closeAtx&&(i+=" "+o),t(),l(),i}S.peek=se;function S(n){return n.value||""}function se(){return"<"}F.peek=ae;function F(n,r,e,c){const u=y(e),f=u==='"'?"Quote":"Apostrophe",o=e.enter("image");let l=e.enter("label");const t=e.createTracker(c);let i=t.move("![");return i+=t.move(e.safe(n.alt,{before:i,after:"]",...t.current()})),i+=t.move("]("),l(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(l=e.enter("destinationLiteral"),i+=t.move("<"),i+=t.move(e.safe(n.url,{before:i,after:">",...t.current()})),i+=t.move(">")):(l=e.enter("destinationRaw"),i+=t.move(e.safe(n.url,{before:i,after:n.title?" ":")",...t.current()}))),l(),n.title&&(l=e.enter(`title${f}`),i+=t.move(" "+u),i+=t.move(e.safe(n.title,{before:i,after:u,...t.current()})),i+=t.move(u),l()),i+=t.move(")"),o(),i}function ae(){return"!"}L.peek=he;function L(n,r,e,c){const u=n.referenceType,f=e.enter("imageReference");let o=e.enter("label");const l=e.createTracker(c);let t=l.move("![");const i=e.safe(n.alt,{before:t,after:"]",...l.current()});t+=l.move(i+"]["),o();const s=e.stack;e.stack=[],o=e.enter("reference");const a=e.safe(e.associationId(n),{before:t,after:"]",...l.current()});return o(),e.stack=s,f(),u==="full"||!i||i!==a?t+=l.move(a+"]"):u==="shortcut"?t=t.slice(0,-1):t+=l.move("]"),t}function he(){return"!"}z.peek=de;function z(n,r,e){let c=n.value||"",u="`",f=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(c);)u+="`";for(/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^`|`$/.test(c))&&(c=" "+c+" ");++f<e.unsafe.length;){const o=e.unsafe[f],l=e.compilePattern(o);let t;if(o.atBreak)for(;t=l.exec(c);){let i=t.index;c.charCodeAt(i)===10&&c.charCodeAt(i-1)===13&&i--,c=c.slice(0,i)+" "+c.slice(t.index+1)}}return u+c+u}function de(){return"`"}function O(n,r){const e=P(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(e===n.url||"mailto:"+e===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}B.peek=me;function B(n,r,e,c){const u=y(e),f=u==='"'?"Quote":"Apostrophe",o=e.createTracker(c);let l,t;if(O(n,e)){const s=e.stack;e.stack=[],l=e.enter("autolink");let a=o.move("<");return a+=o.move(e.containerPhrasing(n,{before:a,after:">",...o.current()})),a+=o.move(">"),l(),e.stack=s,a}l=e.enter("link"),t=e.enter("label");let i=o.move("[");return i+=o.move(e.containerPhrasing(n,{before:i,after:"](",...o.current()})),i+=o.move("]("),t(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(t=e.enter("destinationLiteral"),i+=o.move("<"),i+=o.move(e.safe(n.url,{before:i,after:">",...o.current()})),i+=o.move(">")):(t=e.enter("destinationRaw"),i+=o.move(e.safe(n.url,{before:i,after:n.title?" ":")",...o.current()}))),t(),n.title&&(t=e.enter(`title${f}`),i+=o.move(" "+u),i+=o.move(e.safe(n.title,{before:i,after:u,...o.current()})),i+=o.move(u),t()),i+=o.move(")"),l(),i}function me(n,r,e){return O(n,e)?"<":"["}$.peek=pe;function $(n,r,e,c){const u=n.referenceType,f=e.enter("linkReference");let o=e.enter("label");const l=e.createTracker(c);let t=l.move("[");const i=e.containerPhrasing(n,{before:t,after:"]",...l.current()});t+=l.move(i+"]["),o();const s=e.stack;e.stack=[],o=e.enter("reference");const a=e.safe(e.associationId(n),{before:t,after:"]",...l.current()});return o(),e.stack=s,f(),u==="full"||!i||i!==a?t+=l.move(a+"]"):u==="shortcut"?t=t.slice(0,-1):t+=l.move("]"),t}function pe(){return"["}function C(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function ke(n){const r=C(n),e=n.options.bulletOther;if(!e)return r==="*"?"-":"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(e===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+e+"`) to be different");return e}function xe(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function q(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function be(n,r,e,c){const u=e.enter("list"),f=e.bulletCurrent;let o=n.ordered?xe(e):C(e);const l=n.ordered?o==="."?")":".":ke(e);let t=r&&e.bulletLastUsed?o===e.bulletLastUsed:!1;if(!n.ordered){const s=n.children?n.children[0]:void 0;if((o==="*"||o==="-")&&s&&(!s.children||!s.children[0])&&e.stack[e.stack.length-1]==="list"&&e.stack[e.stack.length-2]==="listItem"&&e.stack[e.stack.length-3]==="list"&&e.stack[e.stack.length-4]==="listItem"&&e.indexStack[e.indexStack.length-1]===0&&e.indexStack[e.indexStack.length-2]===0&&e.indexStack[e.indexStack.length-3]===0&&(t=!0),q(e)===o&&s){let a=-1;for(;++a<n.children.length;){const h=n.children[a];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){t=!0;break}}}}t&&(o=l),e.bulletCurrent=o;const i=e.containerFlow(n,c);return e.bulletLastUsed=o,e.bulletCurrent=f,u(),i}function ge(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function ve(n,r,e,c){const u=ge(e);let f=e.bulletCurrent||C(e);r&&r.type==="list"&&r.ordered&&(f=(typeof r.start=="number"&&r.start>-1?r.start:1)+(e.options.incrementListMarker===!1?0:r.children.indexOf(n))+f);let o=f.length+1;(u==="tab"||u==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(o=Math.ceil(o/4)*4);const l=e.createTracker(c);l.move(f+" ".repeat(o-f.length)),l.shift(o);const t=e.enter("listItem"),i=e.indentLines(e.containerFlow(n,l.current()),s);return t(),i;function s(a,h,d){return h?(d?"":" ".repeat(o))+a:(d?f:f+" ".repeat(o-f.length))+a}}function we(n,r,e,c){const u=e.enter("paragraph"),f=e.enter("phrasing"),o=e.containerPhrasing(n,c);return f(),u(),o}const ye=w(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ce(n,r,e,c){return(n.children.some(function(o){return ye(o)})?e.containerPhrasing:e.containerFlow).call(e,n,c)}function _e(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}M.peek=Ie;function M(n,r,e,c){const u=_e(e),f=e.enter("strong"),o=e.createTracker(c),l=o.move(u+u);let t=o.move(e.containerPhrasing(n,{after:u,before:l,...o.current()}));const i=t.charCodeAt(0),s=b(c.before.charCodeAt(c.before.length-1),i,u);s.inside&&(t=x(i)+t.slice(1));const a=t.charCodeAt(t.length-1),h=b(c.after.charCodeAt(0),a,u);h.inside&&(t=t.slice(0,-1)+x(a));const d=o.move(u+u);return f(),e.attentionEncodeSurroundingInfo={after:h.outside,before:s.outside},l+t+d}function Ie(n,r,e){return e.options.strong||"*"}function Ae(n,r,e,c){return e.safe(n.value,c)}function Ee(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function Pe(n,r,e){const c=(q(e)+(e.options.ruleSpaces?" ":"")).repeat(Ee(e));return e.options.ruleSpaces?c.slice(0,-1):c}const Re={blockquote:X,break:E,code:re,definition:ie,emphasis:R,hardBreak:E,heading:fe,html:S,image:F,imageReference:L,inlineCode:z,link:B,linkReference:$,list:be,listItem:ve,paragraph:we,root:Ce,strong:M,text:Ae,thematicBreak:Pe};export{le as a,w as c,x as e,ee as f,Re as h,Z as p,J as v};
@@ -0,0 +1,20 @@
1
+ import{f as w,a as y,e as C,p as B,h as F}from"./index-BnR23rlw.js";import{a as L}from"./index-CMP2i-HY.js";import"./index-dJjNfQvw.js";const b={}.hasOwnProperty;function S(e,n){const a=n||{};function t(c,...r){let i=t.invalid;const o=t.handlers;if(c&&b.call(c,e)){const l=String(c[e]);i=b.call(o,l)?o[l]:t.unknown}if(i)return i.call(this,c,...r)}return t.handlers=a.handlers||{},t.invalid=a.invalid,t.unknown=a.unknown,t}const j={}.hasOwnProperty;function x(e,n){let a=-1,t;if(n.extensions)for(;++a<n.extensions.length;)x(e,n.extensions[a]);for(t in n)if(j.call(n,t))switch(t){case"extensions":break;case"unsafe":{m(e[t],n[t]);break}case"join":{m(e[t],n[t]);break}case"handlers":{v(e[t],n[t]);break}default:e.options[t]=n[t]}return e}function m(e,n){n&&e.push(...n)}function v(e,n){n&&Object.assign(e,n)}const I=[T];function T(e,n,a,t){if(n.type==="code"&&w(n,t)&&(e.type==="list"||e.type===n.type&&w(e,t)))return!1;if("spread"in a&&typeof a.spread=="boolean")return e.type==="paragraph"&&(e.type===n.type||n.type==="definition"||n.type==="heading"&&y(n,t))?void 0:a.spread?1:0}const k=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],G=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
2
+ `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:k},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
3
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:k},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
4
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:k},{atBreak:!0,character:"+",after:`(?:[ \r
5
+ ])`},{atBreak:!0,character:"-",after:`(?:[ \r
6
+ -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
7
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:k},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:k},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:k},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:k},{atBreak:!0,character:"~"}];function P(e){return e.label||!e.identifier?e.label||"":L(e.identifier)}function M(e){if(!e._compiled){const n=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function E(e,n,a){const t=n.indexStack,c=e.children||[],r=[];let i=-1,o=a.before,l;t.push(-1);let h=n.createTracker(a);for(;++i<c.length;){const s=c[i];let f;if(t[t.length-1]=i,i+1<c.length){let d=n.handle.handlers[c[i+1].type];d&&d.peek&&(d=d.peek),f=d?d(c[i+1],e,n,{before:"",after:"",...h.current()}).charAt(0):""}else f=a.after;r.length>0&&(o==="\r"||o===`
8
+ `)&&s.type==="html"&&(r[r.length-1]=r[r.length-1].replace(/(\r?\n|\r)$/," "),o=" ",h=n.createTracker(a),h.move(r.join("")));let u=n.handle(s,e,n,{...h.current(),after:f,before:o});l&&l===u.slice(0,1)&&(u=C(l.charCodeAt(0))+u.slice(1));const p=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,l=void 0,p&&(r.length>0&&p.before&&o===r[r.length-1].slice(-1)&&(r[r.length-1]=r[r.length-1].slice(0,-1)+C(o.charCodeAt(0))),p.after&&(l=f)),h.move(u),r.push(u),o=u.slice(-1)}return t.pop(),r.join("")}function R(e,n,a){const t=n.indexStack,c=e.children||[],r=n.createTracker(a),i=[];let o=-1;for(t.push(-1);++o<c.length;){const l=c[o];t[t.length-1]=o,i.push(r.move(n.handle(l,e,n,{before:`
9
+ `,after:`
10
+ `,...r.current()}))),l.type!=="list"&&(n.bulletLastUsed=void 0),o<c.length-1&&i.push(r.move(_(l,c[o+1],e,n)))}return t.pop(),i.join("")}function _(e,n,a,t){let c=t.join.length;for(;c--;){const r=t.join[c](e,n,a,t);if(r===!0||r===1)break;if(typeof r=="number")return`
11
+ `.repeat(1+r);if(r===!1)return`
12
+
13
+ <!---->
14
+
15
+ `}return`
16
+
17
+ `}const $=/\r?\n|\r/g;function z(e,n){const a=[];let t=0,c=0,r;for(;r=$.exec(e);)i(e.slice(t,r.index)),a.push(r[0]),t=r.index+r[0].length,c++;return i(e.slice(t)),a.join("");function i(o){a.push(n(o,c,!o))}}function D(e,n,a){const t=(a.before||"")+(n||"")+(a.after||""),c=[],r=[],i={};let o=-1;for(;++o<e.unsafe.length;){const s=e.unsafe[o];if(!B(e.stack,s))continue;const f=e.compilePattern(s);let u;for(;u=f.exec(t);){const p="before"in s||!!s.atBreak,d="after"in s,g=u.index+(p?u[1].length:0);c.includes(g)?(i[g].before&&!p&&(i[g].before=!1),i[g].after&&!d&&(i[g].after=!1)):(c.push(g),i[g]={before:p,after:d})}}c.sort(O);let l=a.before?a.before.length:0;const h=t.length-(a.after?a.after.length:0);for(o=-1;++o<c.length;){const s=c[o];s<l||s>=h||s+1<h&&c[o+1]===s+1&&i[s].after&&!i[s+1].before&&!i[s+1].after||c[o-1]===s-1&&i[s].before&&!i[s-1].before&&!i[s-1].after||(l!==s&&r.push(A(t.slice(l,s),"\\")),l=s,/[!-/:-@[-`{-~]/.test(t.charAt(s))&&(!a.encode||!a.encode.includes(t.charAt(s)))?r.push("\\"):(r.push(C(t.charCodeAt(s))),l++))}return r.push(A(t.slice(l,h),a.after)),r.join("")}function O(e,n){return e-n}function A(e,n){const a=/\\(?=[!-/:-@[-`{-~])/g,t=[],c=[],r=e+n;let i=-1,o=0,l;for(;l=a.exec(r);)t.push(l.index);for(;++i<t.length;)o!==t[i]&&c.push(e.slice(o,t[i])),c.push("\\"),o=t[i];return c.push(e.slice(o)),c.join("")}function Z(e){const n=e||{},a=n.now||{};let t=n.lineShift||0,c=a.line||1,r=a.column||1;return{move:l,current:i,shift:o};function i(){return{now:{line:c,column:r},lineShift:t}}function o(h){t+=h}function l(h){const s=h||"",f=s.split(/\r?\n|\r/g),u=f[f.length-1];return c+=f.length-1,r=f.length===1?r+u.length:1+u.length+t,s}}function Q(e,n){const a=n||{},t={associationId:P,containerPhrasing:J,containerFlow:K,createTracker:Z,compilePattern:M,enter:r,handlers:{...F},handle:void 0,indentLines:z,indexStack:[],join:[...I],options:{},safe:N,stack:[],unsafe:[...G]};x(t,a),t.options.tightDefinitions&&t.join.push(q),t.handle=S("type",{invalid:H,unknown:U,handlers:t.handlers});let c=t.handle(e,void 0,t,{before:`
18
+ `,after:`
19
+ `,now:{line:1,column:1},lineShift:0});return c&&c.charCodeAt(c.length-1)!==10&&c.charCodeAt(c.length-1)!==13&&(c+=`
20
+ `),c;function r(i){return t.stack.push(i),o;function o(){t.stack.pop()}}}function H(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function U(e){const n=e;throw new Error("Cannot handle unknown node `"+n.type+"`")}function q(e,n){if(e.type==="definition"&&e.type===n.type)return 0}function J(e,n){return E(e,this,n)}function K(e,n){return R(e,this,n)}function N(e,n){return D(this,e,n)}function Y(e){const n=this;n.compiler=a;function a(t){return Q(t,{...n.data("settings"),...e,extensions:n.data("toMarkdownExtensions")||[]})}}export{Y as default};
@@ -0,0 +1 @@
1
+ const a=document.createElement("i");function o(r){const t="&"+r+";";a.innerHTML=t;const e=a.textContent;return e.charCodeAt(e.length-1)===59&&r!=="semi"||e===t?!1:e}function d(r,t){const e=Number.parseInt(r,t);return e<9||e===11||e>13&&e<32||e>126&&e<160||e>55295&&e<57344||e>64975&&e<65008||(e&65535)===65535||(e&65535)===65534||e>1114111?"�":String.fromCodePoint(e)}const i=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function u(r){return r.replace(i,s)}function s(r,t,e){if(t)return t;if(e.charCodeAt(0)===35){const n=e.charCodeAt(1),c=n===120||n===88;return d(e.slice(c?2:1),c?16:10)}return o(e)||r}export{u as a,d as b,o as d};