import{Ga as gt,a as xt,bb as dt}from"./chunk-VMREMWJS.min.js";import{c as ue}from"./chunk-P42HNYSU.min.js";var ae={};function Un(n,r){let t=r||ae,e=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return yt(n,e,u)}function yt(n,r,t){if(oe(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return kt(n.children,r,t)}return Array.isArray(n)?kt(n,r,t):""}function kt(n,r,t){let e=[],u=-1;for(;++uu?0:u+r:r=r>u?u:r,t=t>0?t:0,e.length<1e4)i=Array.from(e),i.unshift(r,t),[].splice.apply(n,i);else for(t&&[].splice.apply(n,[r,t]);a0?(Z(n,n.length,0,r),n):r}var bt={}.hasOwnProperty;function St(n){let r={},t=-1;for(;++ti))return;let j=r.events.length,H=j,M,Q;for(;H--;)if(r.events[H][0]==="exit"&&r.events[H][1].type==="chunkFlow"){if(M){Q=r.events[H][1].end;break}M=!0}for(b(e),d=j;dw;){let _=t[P];r.containerState=_[1],_[0].exit.call(r,n)}t.length=w}function R(){u.write([null]),a=void 0,u=void 0,r.containerState._closeFlow=void 0}}function me(n,r,t){return C(n,n.attempt(this.parser.constructs.document,r,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zn(n){if(n===null||V(n)||Ct(n))return 1;if(At(n))return 2}function yn(n,r,t){let e=[],u=-1;for(;++u1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;let y=Object.assign({},n[e][1].end),h=Object.assign({},n[t][1].start);Lt(y,-p),Lt(h,p),i={type:p>1?"strongSequence":"emphasisSequence",start:y,end:Object.assign({},n[e][1].end)},o={type:p>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:h},a={type:p>1?"strongText":"emphasisText",start:Object.assign({},n[e][1].end),end:Object.assign({},n[t][1].start)},u={type:p>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},o.end)},n[e][1].end=Object.assign({},i.start),n[t][1].start=Object.assign({},o.end),m=[],n[e][1].end.offset-n[e][1].start.offset&&(m=J(m,[["enter",n[e][1],r],["exit",n[e][1],r]])),m=J(m,[["enter",u,r],["enter",i,r],["exit",i,r],["enter",a,r]]),m=J(m,yn(r.parser.constructs.insideSpan.null,n.slice(e+1,t),r)),m=J(m,[["exit",a,r],["enter",o,r],["exit",o,r],["exit",u,r]]),n[t][1].end.offset-n[t][1].start.offset?(c=2,m=J(m,[["enter",n[t][1],r],["exit",n[t][1],r]])):c=0,Z(n,e-1,t-e+3,m),t=e+m.length-c-2;break}}for(t=-1;++t=4?i(m):t(m)}function i(m){return m===null?p(m):S(m)?n.attempt(we,i,p)(m):(n.enter("codeFlowValue"),o(m))}function o(m){return m===null||S(m)?(n.exit("codeFlowValue"),i(m)):(n.consume(m),o)}function p(m){return n.exit("codeIndented"),r(m)}}function Ce(n,r,t){let e=this;return u;function u(i){return e.parser.lazy[e.now().line]?t(i):S(i)?(n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),u):C(n,a,"linePrefix",5)(i)}function a(i){let o=e.events[e.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(i):S(i)?u(i):t(i)}}var Gn={name:"codeText",tokenize:Ie,resolve:Ae,previous:ze};function Ae(n){let r=n.length-4,t=3,e,u;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(e=t;++e=4?r(i):n.interrupt(e.parser.constructs.flow,t,r)(i)}}function Rn(n,r,t,e,u,a,i,o,p){let m=p||Number.POSITIVE_INFINITY,c=0;return y;function y(b){return b===60?(n.enter(e),n.enter(u),n.enter(a),n.consume(b),n.exit(a),h):b===null||b===41||In(b)?t(b):(n.enter(e),n.enter(i),n.enter(o),n.enter("chunkString",{contentType:"string"}),L(b))}function h(b){return b===62?(n.enter(a),n.consume(b),n.exit(a),n.exit(u),n.exit(e),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(n.exit("chunkString"),n.exit(o),h(b)):b===null||b===60||S(b)?t(b):(n.consume(b),b===92?g:x)}function g(b){return b===60||b===62||b===92?(n.consume(b),x):x(b)}function L(b){return b===40?++c>m?t(b):(n.consume(b),L):b===41?c--?(n.consume(b),L):(n.exit("chunkString"),n.exit(o),n.exit(i),n.exit(e),r(b)):b===null||V(b)?c?t(b):(n.exit("chunkString"),n.exit(o),n.exit(i),n.exit(e),r(b)):In(b)?t(b):(n.consume(b),b===92?O:L)}function O(b){return b===40||b===41||b===92?(n.consume(b),L):L(b)}}function jn(n,r,t,e,u,a){let i=this,o=0,p;return m;function m(x){return n.enter(e),n.enter(u),n.consume(x),n.exit(u),n.enter(a),c}function c(x){return x===null||x===91||x===93&&!p||x===94&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs||o>999?t(x):x===93?(n.exit(a),n.enter(u),n.consume(x),n.exit(u),n.exit(e),r):S(x)?(n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),c):(n.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||S(x)||o++>999?(n.exit("chunkString"),c(x)):(n.consume(x),p=p||!I(x),x===92?h:y)}function h(x){return x===91||x===92||x===93?(n.consume(x),o++,y):y(x)}}function qn(n,r,t,e,u,a){let i;return o;function o(h){return n.enter(e),n.enter(u),n.consume(h),n.exit(u),i=h===40?41:h,p}function p(h){return h===i?(n.enter(u),n.consume(h),n.exit(u),n.exit(e),r):(n.enter(a),m(h))}function m(h){return h===i?(n.exit(a),p(i)):h===null?t(h):S(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),C(n,m,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===i||h===null||S(h)?(n.exit("chunkString"),m(h)):(n.consume(h),h===92?y:c)}function y(h){return h===i||h===92?(n.consume(h),c):c(h)}}function fn(n,r){let t;return e;function e(u){return S(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),t=!0,e):I(u)?C(n,e,t?"linePrefix":"lineSuffix")(u):r(u)}}function on(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Kn={name:"definition",tokenize:_e},Pe={tokenize:Me,partial:!0};function _e(n,r,t){let e=this,u;return a;function a(p){return n.enter("definition"),jn.call(e,n,i,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function i(p){return u=on(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),p===58?(n.enter("definitionMarker"),n.consume(p),n.exit("definitionMarker"),fn(n,Rn(n,n.attempt(Pe,C(n,o,"whitespace"),C(n,o,"whitespace")),t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):t(p)}function o(p){return p===null||S(p)?(n.exit("definition"),e.parser.defined.includes(u)||e.parser.defined.push(u),r(p)):t(p)}}function Me(n,r,t){return e;function e(i){return V(i)?fn(n,u)(i):t(i)}function u(i){return i===34||i===39||i===40?qn(n,C(n,a,"whitespace"),t,"definitionTitle","definitionTitleMarker","definitionTitleString")(i):t(i)}function a(i){return i===null||S(i)?r(i):t(i)}}var Xn={name:"hardBreakEscape",tokenize:Re};function Re(n,r,t){return e;function e(a){return n.enter("hardBreakEscape"),n.enter("escapeMarker"),n.consume(a),u}function u(a){return S(a)?(n.exit("escapeMarker"),n.exit("hardBreakEscape"),r(a)):t(a)}}var vn={name:"headingAtx",tokenize:qe,resolve:je};function je(n,r){let t=n.length-2,e=3,u,a;return n[e][1].type==="whitespace"&&(e+=2),t-2>e&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(e===t-1||t-4>e&&n[t-2][1].type==="whitespace")&&(t-=e+1===t?2:4),t>e&&(u={type:"atxHeadingText",start:n[e][1].start,end:n[t][1].end},a={type:"chunkText",start:n[e][1].start,end:n[t][1].end,contentType:"text"},Z(n,e,t-e+1,[["enter",u,r],["enter",a,r],["exit",a,r],["exit",u,r]])),n}function qe(n,r,t){let e=this,u=0;return a;function a(c){return n.enter("atxHeading"),n.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&u++<6?(n.consume(c),i):c===null||V(c)?(n.exit("atxHeadingSequence"),e.interrupt?r(c):o(c)):t(c)}function o(c){return c===35?(n.enter("atxHeadingSequence"),p(c)):c===null||S(c)?(n.exit("atxHeading"),r(c)):I(c)?C(n,o,"whitespace")(c):(n.enter("atxHeadingText"),m(c))}function p(c){return c===35?(n.consume(c),p):(n.exit("atxHeadingSequence"),o(c))}function m(c){return c===null||c===35||V(c)?(n.exit("atxHeadingText"),o(c)):(n.consume(c),m)}}var Ot=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nt=["pre","script","style","textarea"];var tt={name:"htmlFlow",tokenize:Ve,resolveTo:Ne,concrete:!0},He={tokenize:We,partial:!0};function Ne(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 Ve(n,r,t){let e=this,u,a,i,o,p;return m;function m(l){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(l),c}function c(l){return l===33?(n.consume(l),y):l===47?(n.consume(l),g):l===63?(n.consume(l),u=3,e.interrupt?r:G):v(l)?(n.consume(l),i=String.fromCharCode(l),a=!0,L):t(l)}function y(l){return l===45?(n.consume(l),u=2,h):l===91?(n.consume(l),u=5,i="CDATA[",o=0,x):v(l)?(n.consume(l),u=4,e.interrupt?r:G):t(l)}function h(l){return l===45?(n.consume(l),e.interrupt?r:G):t(l)}function x(l){return l===i.charCodeAt(o++)?(n.consume(l),o===i.length?e.interrupt?r:A:x):t(l)}function g(l){return v(l)?(n.consume(l),i=String.fromCharCode(l),L):t(l)}function L(l){return l===null||l===47||l===62||V(l)?l!==47&&a&&nt.includes(i.toLowerCase())?(u=1,e.interrupt?r(l):A(l)):Ot.includes(i.toLowerCase())?(u=6,l===47?(n.consume(l),O):e.interrupt?r(l):A(l)):(u=7,e.interrupt&&!e.parser.lazy[e.now().line]?t(l):a?R(l):b(l)):l===45||K(l)?(n.consume(l),i+=String.fromCharCode(l),L):t(l)}function O(l){return l===62?(n.consume(l),e.interrupt?r:A):t(l)}function b(l){return I(l)?(n.consume(l),b):M(l)}function R(l){return l===47?(n.consume(l),M):l===58||l===95||v(l)?(n.consume(l),w):I(l)?(n.consume(l),R):M(l)}function w(l){return l===45||l===46||l===58||l===95||K(l)?(n.consume(l),w):P(l)}function P(l){return l===61?(n.consume(l),_):I(l)?(n.consume(l),P):R(l)}function _(l){return l===null||l===60||l===61||l===62||l===96?t(l):l===34||l===39?(n.consume(l),p=l,d):I(l)?(n.consume(l),_):(p=null,j(l))}function d(l){return l===null||S(l)?t(l):l===p?(n.consume(l),H):(n.consume(l),d)}function j(l){return l===null||l===34||l===39||l===60||l===61||l===62||l===96||V(l)?P(l):(n.consume(l),j)}function H(l){return l===47||l===62||I(l)?R(l):t(l)}function M(l){return l===62?(n.consume(l),Q):t(l)}function Q(l){return I(l)?(n.consume(l),Q):l===null||S(l)?A(l):t(l)}function A(l){return l===45&&u===2?(n.consume(l),U):l===60&&u===1?(n.consume(l),X):l===62&&u===4?(n.consume(l),N):l===63&&u===3?(n.consume(l),G):l===93&&u===5?(n.consume(l),W):S(l)&&(u===6||u===7)?n.check(He,N,D)(l):l===null||S(l)?D(l):(n.consume(l),A)}function D(l){return n.exit("htmlFlowData"),E(l)}function E(l){return l===null?s(l):S(l)?n.attempt({tokenize:z,partial:!0},E,s)(l):(n.enter("htmlFlowData"),A(l))}function z(l,En,mn){return dn;function dn(en){return l.enter("lineEnding"),l.consume(en),l.exit("lineEnding"),wn}function wn(en){return e.parser.lazy[e.now().line]?mn(en):En(en)}}function U(l){return l===45?(n.consume(l),G):A(l)}function X(l){return l===47?(n.consume(l),i="",nn):A(l)}function nn(l){return l===62&&nt.includes(i.toLowerCase())?(n.consume(l),N):v(l)&&i.length<8?(n.consume(l),i+=String.fromCharCode(l),nn):A(l)}function W(l){return l===93?(n.consume(l),G):A(l)}function G(l){return l===62?(n.consume(l),N):l===45&&u===2?(n.consume(l),G):A(l)}function N(l){return l===null||S(l)?(n.exit("htmlFlowData"),s(l)):(n.consume(l),N)}function s(l){return n.exit("htmlFlow"),r(l)}}function We(n,r,t){return e;function e(u){return n.exit("htmlFlowData"),n.enter("lineEndingBlank"),n.consume(u),n.exit("lineEndingBlank"),n.attempt(cn,r,t)}}var et={name:"htmlText",tokenize:Qe};function Qe(n,r,t){let e=this,u,a,i,o;return p;function p(s){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(s),m}function m(s){return s===33?(n.consume(s),c):s===47?(n.consume(s),j):s===63?(n.consume(s),_):v(s)?(n.consume(s),Q):t(s)}function c(s){return s===45?(n.consume(s),y):s===91?(n.consume(s),a="CDATA[",i=0,O):v(s)?(n.consume(s),P):t(s)}function y(s){return s===45?(n.consume(s),h):t(s)}function h(s){return s===null||s===62?t(s):s===45?(n.consume(s),x):g(s)}function x(s){return s===null||s===62?t(s):g(s)}function g(s){return s===null?t(s):s===45?(n.consume(s),L):S(s)?(o=g,W(s)):(n.consume(s),g)}function L(s){return s===45?(n.consume(s),N):g(s)}function O(s){return s===a.charCodeAt(i++)?(n.consume(s),i===a.length?b:O):t(s)}function b(s){return s===null?t(s):s===93?(n.consume(s),R):S(s)?(o=b,W(s)):(n.consume(s),b)}function R(s){return s===93?(n.consume(s),w):b(s)}function w(s){return s===62?N(s):s===93?(n.consume(s),w):b(s)}function P(s){return s===null||s===62?N(s):S(s)?(o=P,W(s)):(n.consume(s),P)}function _(s){return s===null?t(s):s===63?(n.consume(s),d):S(s)?(o=_,W(s)):(n.consume(s),_)}function d(s){return s===62?N(s):_(s)}function j(s){return v(s)?(n.consume(s),H):t(s)}function H(s){return s===45||K(s)?(n.consume(s),H):M(s)}function M(s){return S(s)?(o=M,W(s)):I(s)?(n.consume(s),M):N(s)}function Q(s){return s===45||K(s)?(n.consume(s),Q):s===47||s===62||V(s)?A(s):t(s)}function A(s){return s===47?(n.consume(s),N):s===58||s===95||v(s)?(n.consume(s),D):S(s)?(o=A,W(s)):I(s)?(n.consume(s),A):N(s)}function D(s){return s===45||s===46||s===58||s===95||K(s)?(n.consume(s),D):E(s)}function E(s){return s===61?(n.consume(s),z):S(s)?(o=E,W(s)):I(s)?(n.consume(s),E):A(s)}function z(s){return s===null||s===60||s===61||s===62||s===96?t(s):s===34||s===39?(n.consume(s),u=s,U):S(s)?(o=z,W(s)):I(s)?(n.consume(s),z):(n.consume(s),u=void 0,nn)}function U(s){return s===u?(n.consume(s),X):s===null?t(s):S(s)?(o=U,W(s)):(n.consume(s),U)}function X(s){return s===62||s===47||V(s)?A(s):t(s)}function nn(s){return s===null||s===34||s===39||s===60||s===61||s===96?t(s):s===62||V(s)?A(s):(n.consume(s),nn)}function W(s){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),C(n,G,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function G(s){return n.enter("htmlTextData"),o(s)}function N(s){return s===62?(n.consume(s),n.exit("htmlTextData"),n.exit("htmlText"),r):t(s)}}var xn={name:"labelEnd",tokenize:Je,resolveTo:Ge,resolveAll:Ye},Ue={tokenize:Ke},$e={tokenize:Xe},Ze={tokenize:ve};function Ye(n){let r=-1,t;for(;++r-1&&(i[0]=i[0].slice(e)),a>0&&i.push(n[u].slice(0,a))),i}function gr(n,r){let t=-1,e=[],u;for(;++tFr,contentInitial:()=>kr,disable:()=>Cr,document:()=>dr,flow:()=>br,flowInitial:()=>yr,insideSpan:()=>wr,string:()=>Sr,text:()=>Er});var dr={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:On},kr={91:Kn},yr={[-2]:Ln,[-1]:Ln,32:Ln},br={35:vn,42:gn,45:[Hn,gn],60:tt,61:Hn,95:gn,96:_n,126:_n},Sr={38:Pn,92:Dn},Er={[-5]:Bn,[-4]:Bn,[-3]:Bn,33:rt,38:Pn,42:Tn,60:[Yn,et],91:it,92:[Xn,Dn],93:xn,95:Tn,96:Gn},wr={null:[Tn,Pt]},Fr={null:[42,95]},Cr={null:[]};function Ht(n={}){let r=St([ut].concat(n.extensions||[])),t={defined:[],lazy:{},constructs:r,content:e(zt),document:e(Tt),flow:e(Dt),string:e(_t),text:e(Mt)};return t;function e(u){return a;function a(i){return qt(t,u,i)}}}var Nt=/[\0\t\n\r]/g;function Vt(){let n=1,r="",t=!0,e;return u;function u(a,i,o){let p=[],m,c,y,h,x;for(a=r+a.toString(i),y=0,r="",t&&(a.charCodeAt(0)===65279&&y++,t=void 0);y13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"\uFFFD":String.fromCharCode(t)}var Ar=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qt(n){return n.replace(Ar,zr)}function zr(n,r,t){if(r)return r;if(t.charCodeAt(0)===35){let u=t.charCodeAt(1),a=u===120||u===88;return Nn(t.slice(a?2:1),a?16:10)}return bn(t)||n}function Sn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Ut(n.position):"start"in n||"end"in n?Ut(n):"line"in n||"column"in n?at(n):""}function at(n){return $t(n&&n.line)+":"+$t(n&&n.column)}function Ut(n){return at(n&&n.start)+"-"+at(n&&n.end)}function $t(n){return n&&typeof n=="number"?n:1}var Yt={}.hasOwnProperty,Vn=function(n,r,t){return typeof r!="string"&&(t=r,r=void 0),Ir(t)(Wt(Ht(t).document().write(Vt()(n,r,!0))))};function Ir(n){let r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ht),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(ct),blockQuote:o(kn),characterEscape:A,characterReference:A,codeFenced:o(hn),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:o(hn,p),codeText:o(Wn,p),codeTextData:A,data:A,codeFlowValue:A,definition:o(Kt),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:o(Xt),hardBreakEscape:o(pt),hardBreakTrailing:o(pt),htmlFlow:o(mt,p),htmlFlowData:A,htmlText:o(mt,p),htmlTextData:A,image:o(vt),label:p,link:o(ht),listItem:o(ne),listItemValue:g,listOrdered:o(ft,x),listUnordered:o(ft),paragraph:o(te),reference:dn,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:o(ct),strong:o(ee),thematicBreak:o(ie)},exit:{atxHeading:c(),atxHeadingSequence:j,autolink:c(),autolinkEmail:rn,autolinkProtocol:Fn,blockQuote:c(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:en,characterReferenceMarkerNumeric:en,characterReferenceValue:$,codeFenced:c(R),codeFencedFence:b,codeFencedFenceInfo:L,codeFencedFenceMeta:O,codeFlowValue:D,codeIndented:c(w),codeText:c(nn),codeTextData:D,data:D,definition:c(),definitionDestinationString:d,definitionLabelString:P,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(z),hardBreakTrailing:c(z),htmlFlow:c(U),htmlFlowData:D,htmlText:c(X),htmlTextData:D,image:c(G),label:s,labelText:N,lineEnding:E,link:c(W),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:wn,resourceDestinationString:l,resourceTitleString:En,resource:mn,setextHeading:c(Q),setextHeadingLineSequence:M,setextHeadingText:H,strong:c(),thematicBreak:c()}};Gt(r,(n||{}).mdastExtensions||[]);let t={};return e;function e(f){let k={type:"root",children:[]},F={stack:[k],tokenStack:[],config:r,enter:m,exit:y,buffer:p,resume:h,setData:a,getData:i},T=[],B=-1;for(;++B0){let tn=F.tokenStack[F.tokenStack.length-1];(tn[1]||Zt).call(F,void 0,tn[0])}for(k.position={start:pn(f.length>0?f[0][1].start:{line:1,column:1,offset:0}),end:pn(f.length>0?f[f.length-2][1].end:{line:1,column:1,offset:0})},B=-1;++B{c!==0&&(u++,e.push([])),m.split(" ").forEach(y=>{y&&e[u].push({content:y,type:o})})}):(i.type==="strong"||i.type==="emphasis")&&i.children.forEach(p=>{a(p,i.type)})}return t.forEach(i=>{i.type==="paragraph"&&i.children.forEach(o=>{a(o)})}),e}function Or(n){let{children:r}=Vn(n);function t(e){return e.type==="text"?e.value.replace(/\n/g,"
"):e.type==="strong"?`${e.children.map(t).join("")}`:e.type==="emphasis"?`${e.children.map(t).join("")}`:e.type==="paragraph"?`

${e.children.map(t).join("")}

`:`Unsupported markdown: ${e.type}`}return r.map(t).join("")}function Dr(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(r=>r.segment):[...n]}function Pr(n,r){let t=Dr(r.content);return Jt(n,[],t,r.type)}function Jt(n,r,t,e){if(t.length===0)return[{content:r.join(""),type:e},{content:"",type:e}];let[u,...a]=t,i=[...r,u];return n([{content:i.join(""),type:e}])?Jt(n,i,a,e):(r.length===0&&u&&(r.push(u),t.shift()),[{content:r.join(""),type:e},{content:t.join(""),type:e}])}function _r(n,r){if(n.some(({content:t})=>t.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return ot(n,r)}function ot(n,r,t=[],e=[]){if(n.length===0)return e.length>0&&t.push(e),t.length>0?t:[];let u="";n[0].content===" "&&(u=" ",n.shift());let a=n.shift()??{content:" ",type:"normal"},i=[...e];if(u!==""&&i.push({content:u,type:"normal"}),i.push(a),r(i))return ot(n,r,t,i);if(e.length>0)t.push(e),n.unshift(a);else if(a.content){let[o,p]=Pr(r,a);t.push([o]),p.content&&n.unshift(p)}return ot(n,r,t)}function Mr(n,r){r&&n.attr("style",r)}function Rr(n,r,t,e,u=!1){let a=n.append("foreignObject"),i=a.append("xhtml:div"),o=r.label,p=r.isNode?"nodeLabel":"edgeLabel";i.html(` "+o+""),Mr(i,r.labelStyle),i.style("display","table-cell"),i.style("white-space","nowrap"),i.style("max-width",t+"px"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),u&&i.attr("class","labelBkg");let m=i.node().getBoundingClientRect();return m.width===t&&(i.style("display","table"),i.style("white-space","break-spaces"),i.style("width",t+"px"),m=i.node().getBoundingClientRect()),a.style("width",m.width),a.style("height",m.height),a.node()}function lt(n,r,t){return n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",r*t-.1+"em").attr("dy",t+"em")}function jr(n,r,t){let e=n.append("text"),u=lt(e,1,r);st(u,t);let a=u.node().getComputedTextLength();return e.remove(),a}function to(n,r,t){var e;let u=n.append("text"),a=lt(u,1,r);st(a,[{content:t,type:"normal"}]);let i=(e=a.node())==null?void 0:e.getBoundingClientRect();return i&&u.remove(),i}function qr(n,r,t,e=!1){let a=r.append("g"),i=a.insert("rect").attr("class","background"),o=a.append("text").attr("y","-10.1"),p=0;for(let m of t){let c=h=>jr(a,1.1,h)<=n,y=c(m)?[m]:_r(m,c);for(let h of y){let x=lt(o,p,1.1);st(x,h),p++}}if(e){let m=o.node().getBBox(),c=2;return i.attr("x",-c).attr("y",-c).attr("width",m.width+2*c).attr("height",m.height+2*c),a.node()}else return o.node()}function st(n,r){n.text(""),r.forEach((t,e)=>{let u=n.append("tspan").attr("font-style",t.type==="emphasis"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",t.type==="strong"?"bold":"normal");e===0?u.text(t.content):u.text(" "+t.content)})}var eo=(n,r="",{style:t="",isTitle:e=!1,classes:u="",useHtmlLabels:a=!0,isNode:i=!0,width:o=200,addSvgBackground:p=!1}={})=>{if(gt.info("createText",r,t,e,u,a,i,p),a){let m=Or(r),c={isNode:i,label:dt(m).replace(/fa[blrs]?:fa-[\w-]+/g,h=>``),labelStyle:t.replace("fill:","color:")};return Rr(n,c,o,u,p)}else{let m=Br(r);return qr(o,n,m,p)}};export{to as a,eo as b}; //# sourceMappingURL=chunk-EA6H37XC.min.js.map