@open-wa/api 5.6.0 → 5.6.2

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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/parse-html-description-dmqM3Nvp.js","assets/browser-DKmo4aW7.js","assets/markdown-BSj1FMVF.js"])))=>i.map(i=>d[i]);
2
- import{a as e,s as t,u as n}from"./browser-DKmo4aW7.js";import{Ci as r,Lt as i,Rt as a,Si as o,Ti as s,b as c,g as l,h as u,pi as d,ui as f,v as p,vt as m,xi as h,yt as g}from"./request-example-CA7cFzBE.js";function _(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function v(){}var y=j(/[A-Za-z]/),b=j(/[\dA-Za-z]/),x=j(/[#-'*+\--9=?A-Z^-~]/);function S(e){return e!==null&&(e<32||e===127)}var C=j(/\d/),w=j(/[\dA-Fa-f]/),T=j(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function D(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}var k=j(/\p{P}|\p{S}/u),A=j(/\s/);function j(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ee(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var M=(function(e){if(e==null)return F;if(typeof e==`function`)return P(e);if(typeof e==`object`)return Array.isArray(e)?N(e):te(e);if(typeof e==`string`)return ne(e);throw Error(`Expected function, string, or object as test`)});function N(e){let t=[],n=-1;for(;++n<e.length;)t[n]=M(e[n]);return P(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function te(e){let t=e;return P(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ne(e){return P(t);function t(t){return t&&t.type===e}}function P(e){return t;function t(t,n,r){return!!(re(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function F(){return!0}function re(e){return typeof e==`object`&&!!e&&`type`in e}function ie(e){return e}var I=[],ae=`skip`;function oe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=M(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ie(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=I,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=se(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function se(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?I:[e]}function ce(e,t,n){let r=M((n||{}).ignore||[]),i=le(t),a=-1;for(;++a<i.length;)oe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function le(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ue(e[0]),de(e[1])])}return t}function ue(e){return typeof e==`string`?new RegExp(ee(e),`g`):e}function de(e){return typeof e==`function`?e:function(){return e}}var fe=`phrasing`,pe=[`autolink`,`link`,`image`,`label`];function me(){return{transforms:[Se],enter:{literalAutolink:ge,literalAutolinkEmail:_e,literalAutolinkHttp:_e,literalAutolinkWww:_e},exit:{literalAutolink:xe,literalAutolinkEmail:be,literalAutolinkHttp:ve,literalAutolinkWww:ye}}}function he(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:fe,notInConstruct:pe},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:fe,notInConstruct:pe},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:fe,notInConstruct:pe}]}}function ge(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function _e(e){this.config.enter.autolinkProtocol.call(this,e)}function ve(e){this.config.exit.autolinkProtocol.call(this,e)}function ye(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function be(e){this.config.exit.autolinkEmail.call(this,e)}function xe(e){this.exit(e)}function Se(e){ce(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ce],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,we]],{ignore:[`link`,`linkReference`]})}function Ce(e,t,n,r,i){let a=``;if(!De(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Te(n)))return!1;let o=Ee(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function we(e,t,n,r){return!De(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Te(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ee(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=_(e,`(`),a=_(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function De(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||A(n)||k(n))&&(!t||n!==47)}function L(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}Le.peek=Ie;function Oe(){this.buffer()}function ke(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ae(){this.buffer()}function je(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Me(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ne(e){this.exit(e)}function Pe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fe(e){this.exit(e)}function Ie(){return`[`}function Le(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Re(){return{enter:{gfmFootnoteCallString:Oe,gfmFootnoteCall:ke,gfmFootnoteDefinitionLabelString:Ae,gfmFootnoteDefinition:je},exit:{gfmFootnoteCallString:Me,gfmFootnoteCall:Ne,gfmFootnoteDefinitionLabelString:Pe,gfmFootnoteDefinition:Fe}}}function ze(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Le},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/parse-html-description-XSND5qRr.js","assets/browser-plEqmk2G.js","assets/markdown-BSj1FMVF.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,o as t,s as n}from"./browser-plEqmk2G.js";import{Ci as r,Lt as i,Rt as a,Si as o,Ti as s,b as c,g as l,h as u,pi as d,ui as f,v as p,vt as m,xi as h,yt as g}from"./request-example-ChGpFMrb.js";function _(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function v(){}var y=j(/[A-Za-z]/),b=j(/[\dA-Za-z]/),x=j(/[#-'*+\--9=?A-Z^-~]/);function S(e){return e!==null&&(e<32||e===127)}var C=j(/\d/),w=j(/[\dA-Fa-f]/),T=j(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function D(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}var k=j(/\p{P}|\p{S}/u),A=j(/\s/);function j(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ee(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var M=(function(e){if(e==null)return F;if(typeof e==`function`)return P(e);if(typeof e==`object`)return Array.isArray(e)?N(e):te(e);if(typeof e==`string`)return ne(e);throw Error(`Expected function, string, or object as test`)});function N(e){let t=[],n=-1;for(;++n<e.length;)t[n]=M(e[n]);return P(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function te(e){let t=e;return P(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ne(e){return P(t);function t(t){return t&&t.type===e}}function P(e){return t;function t(t,n,r){return!!(re(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function F(){return!0}function re(e){return typeof e==`object`&&!!e&&`type`in e}function ie(e){return e}var I=[],ae=`skip`;function oe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=M(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ie(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=I,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=se(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function se(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?I:[e]}function ce(e,t,n){let r=M((n||{}).ignore||[]),i=le(t),a=-1;for(;++a<i.length;)oe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function le(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ue(e[0]),de(e[1])])}return t}function ue(e){return typeof e==`string`?new RegExp(ee(e),`g`):e}function de(e){return typeof e==`function`?e:function(){return e}}var fe=`phrasing`,pe=[`autolink`,`link`,`image`,`label`];function me(){return{transforms:[Se],enter:{literalAutolink:ge,literalAutolinkEmail:_e,literalAutolinkHttp:_e,literalAutolinkWww:_e},exit:{literalAutolink:xe,literalAutolinkEmail:be,literalAutolinkHttp:ve,literalAutolinkWww:ye}}}function he(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:fe,notInConstruct:pe},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:fe,notInConstruct:pe},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:fe,notInConstruct:pe}]}}function ge(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function _e(e){this.config.enter.autolinkProtocol.call(this,e)}function ve(e){this.config.exit.autolinkProtocol.call(this,e)}function ye(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function be(e){this.config.exit.autolinkEmail.call(this,e)}function xe(e){this.exit(e)}function Se(e){ce(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ce],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,we]],{ignore:[`link`,`linkReference`]})}function Ce(e,t,n,r,i){let a=``;if(!De(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Te(n)))return!1;let o=Ee(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function we(e,t,n,r){return!De(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Te(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ee(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=_(e,`(`),a=_(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function De(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||A(n)||k(n))&&(!t||n!==47)}function L(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}Le.peek=Ie;function Oe(){this.buffer()}function ke(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ae(){this.buffer()}function je(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Me(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ne(e){this.exit(e)}function Pe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fe(e){this.exit(e)}function Ie(){return`[`}function Le(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Re(){return{enter:{gfmFootnoteCallString:Oe,gfmFootnoteCall:ke,gfmFootnoteDefinitionLabelString:Ae,gfmFootnoteDefinition:je},exit:{gfmFootnoteCallString:Me,gfmFootnoteCall:Ne,gfmFootnoteDefinitionLabelString:Pe,gfmFootnoteDefinition:Fe}}}function ze(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Le},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
3
3
  `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Ve:Be))),s(),o}}function Be(e,t,n){return t===0?e:Ve(e,t,n)}function Ve(e,t,n){return(n?``:` `)+e}var He=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];qe.peek=Je;function Ue(){return{canContainEols:[`delete`],enter:{strikethrough:Ge},exit:{strikethrough:Ke}}}function We(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:He}],handlers:{delete:qe}}}function Ge(e){this.enter({type:`delete`,children:[]},e)}function Ke(e){this.exit(e)}function qe(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Je(){return`~`}function Ye(e){return e.length}function Xe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ye,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ze(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Qe(r[d]);else{let e=Qe(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
4
4
  `)}function Ze(e){return e==null?``:String(e)}function Qe(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var $e={}.hasOwnProperty;function et(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&$e.call(t,e)){let n=String(t[e]);i=$e.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var tt={}.hasOwnProperty;function nt(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)nt(e,t.extensions[n]);for(r in t)if(tt.call(t,r))switch(r){case`extensions`:break;case`unsafe`:rt(e[r],t[r]);break;case`join`:rt(e[r],t[r]);break;case`handlers`:it(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function rt(e,t){t&&e.push(...t)}function it(e,t){t&&Object.assign(e,t)}function at(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),ot);return i(),o}function ot(e,t,n){return`>`+(n?``:` `)+e}function st(e,t){return ct(e,t.inConstruct,!0)&&!ct(e,t.notInConstruct,!1)}function ct(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function lt(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
5
5
  `&&st(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
@@ -35,6 +35,6 @@ import{a as e,s as t,u as n}from"./browser-DKmo4aW7.js";import{Ci as r,Lt as i,R
35
35
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
36
36
  `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Xe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=sn.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Gn(){return{exit:{taskListCheckValueChecked:qn,taskListCheckValueUnchecked:qn,paragraph:Jn}}}function Kn(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Yn}}}function qn(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Jn(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Yn(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=sn.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Xn(){return[me(),Re(),Ue(),In(),Gn()]}function Zn(e){return{extensions:[he(),ze(e),We(),Wn(e),Kn()]}}function R(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function z(e,t){return e.length>0?(R(e,e.length,0,t),e):t}var Qn={}.hasOwnProperty;function $n(e){let t={},n=-1;for(;++n<e.length;)er(t,e[n]);return t}function er(e,t){let n;for(n in t){let r=(Qn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Qn.call(r,a)||(r[a]=[]);let e=i[a];tr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function tr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);R(e,0,0,r)}var nr={tokenize:mr,partial:!0},rr={tokenize:hr,partial:!0},ir={tokenize:gr,partial:!0},ar={tokenize:_r,partial:!0},or={tokenize:vr,partial:!0},sr={name:`wwwAutolink`,tokenize:fr,previous:yr},cr={name:`protocolAutolink`,tokenize:pr,previous:br},B={name:`emailAutolink`,tokenize:dr,previous:xr},V={};function lr(){return{text:V}}for(var ur=48;ur<123;)V[ur]=B,ur++,ur===58?ur=65:ur===91&&(ur=97);V[43]=B,V[45]=B,V[46]=B,V[95]=B,V[72]=[B,cr],V[104]=[B,cr],V[87]=[B,sr],V[119]=[B,sr];function dr(e,t,n){let r=this,i,a;return o;function o(t){return!Sr(t)||!xr.call(r,r.previous)||Cr(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Sr(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(or,u,l)(t):t===45||t===95||b(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&y(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function fr(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!yr.call(r,r.previous)||Cr(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nr,e.attempt(rr,e.attempt(ir,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function pr(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&br.call(r,r.previous)&&!Cr(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(y(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||S(t)||D(t)||A(t)||k(t)?n(t):e.attempt(rr,e.attempt(ir,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function mr(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function hr(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ar,c,s)(t):t===null||D(t)||A(t)||t!==45&&k(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function gr(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ar,t,a)(o):o===null||D(o)||A(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function _r(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||D(o)||A(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||D(e)||A(e)?t(e):r(e)}function a(e){return y(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):y(t)?(e.consume(t),o):n(t)}}function vr(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return b(e)?n(e):t(e)}}function yr(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||D(e)}function br(e){return!y(e)}function xr(e){return!(e===47||Sr(e))}function Sr(e){return e===43||e===45||e===46||e===95||b(e)}function Cr(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function wr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Tr={name:`attention`,resolveAll:Er,tokenize:Dr};function Er(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Or(o,-a),Or(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=z(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=z(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=z(r,wr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=z(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=z(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),R(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Dr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yt(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=yt(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Or(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var kr={name:`autolink`,tokenize:Ar};function Ar(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return y(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||b(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||b(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||S(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):x(t)?(e.consume(t),l):n(t)}function u(e){return b(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||b(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function H(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return O(r)?(e.enter(n),s(r)):t(r)}function s(r){return O(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function jr(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&O(t)?(e.enter(r),c(t)):l(t)}function c(t){return O(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Mr={partial:!0,tokenize:Nr};function Nr(e,t,n){return r;function r(t){return O(t)?H(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||E(e)?t(e):n(e)}}var Pr={continuation:{tokenize:Ir},exit:Lr,name:`blockQuote`,tokenize:Fr};function Fr(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return O(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ir(e,t,n){let r=this;return i;function i(t){return O(t)?H(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Pr,t,n)(r)}}function Lr(e){e.exit(`blockQuote`)}var Rr={name:`characterEscape`,tokenize:zr};function zr(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return T(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Br={name:`characterReference`,tokenize:Vr};function Vr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=b,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=w,u):(e.enter(`characterReferenceValue`),a=7,o=C,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===b&&!pn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Hr={partial:!0,tokenize:Ur};function Ur(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Wr={concrete:!0,name:`codeFenced`,tokenize:Gr};function Gr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),O(t)?H(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||E(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hr,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||E(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):O(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),H(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||E(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||E(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&O(t)?H(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||E(t)?e.check(Hr,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||E(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),O(t)?H(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),O(t)?H(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||E(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Kr={name:`codeIndented`,tokenize:Jr},qr={partial:!0,tokenize:Yr};function Jr(e,t,n){return r;function r(t){return e.enter(`codeIndented`),jr(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):E(t)?e.attempt(qr,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||E(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Yr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):E(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):jr(e,t,a,`linePrefix`,4,4)(o)}function a(e){return E(e)?i(e):n(e)}}var Xr={name:`codeText`,previous:Qr,resolve:Zr,tokenize:$r};function Zr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Qr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $r(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):E(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||E(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ei=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ti(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ti(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ti(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);ti(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ti(this.left,t.reverse())}}}};function ti(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ni(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ei(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ri(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return R(e,0,1/0,u.slice(0)),!l}function ri(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ii={resolve:oi,tokenize:si},ai={partial:!0,tokenize:ci};function oi(e){return ni(e),e}function si(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):E(t)?e.check(ai,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ci(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,a,`linePrefix`)}function a(i){if(i===null||E(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function li(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||S(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||E(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||D(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||S(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ui(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):E(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||E(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!O(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function di(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):E(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||E(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fi(e,t){let n;return r;function r(i){return E(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):O(i)?H(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pi={name:`definition`,tokenize:hi},mi={partial:!0,tokenize:gi};function hi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ui.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=L(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return D(t)?fi(e,l)(t):l(t)}function l(t){return li(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mi,d,d)(t)}function d(t){return O(t)?H(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||E(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gi(e,t,n){return r;function r(t){return D(t)?fi(e,i)(t):n(t)}function i(t){return di(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return O(t)?H(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||E(e)?t(e):n(e)}}var _i={name:`hardBreakEscape`,tokenize:vi};function vi(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return E(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yi={name:`headingAtx`,resolve:bi,tokenize:xi};function bi(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};R(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function xi(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||D(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||E(n)?(e.exit(`atxHeading`),t(n)):O(n)?H(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||D(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Si=`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`.split(`.`),Ci=[`pre`,`script`,`style`,`textarea`],wi={concrete:!0,name:`htmlFlow`,resolveTo:Ei,tokenize:Di},Ti={partial:!0,tokenize:Oi};function Ei(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Di(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):y(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):y(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:M:m):n(i)}function h(t){return y(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||D(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ci.includes(l)?(i=1,r.interrupt?t(s):M(s)):Si.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):M(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):x(s))}return s===45||b(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:M):n(i)}function v(t){return O(t)?(e.consume(t),v):j(t)}function x(t){return t===47?(e.consume(t),j):t===58||t===95||y(t)?(e.consume(t),S):O(t)?(e.consume(t),x):j(t)}function S(t){return t===45||t===46||t===58||t===95||b(t)?(e.consume(t),S):C(t)}function C(t){return t===61?(e.consume(t),w):O(t)?(e.consume(t),C):x(t)}function w(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,T):O(t)?(e.consume(t),w):k(t)}function T(t){return t===c?(e.consume(t),c=null,A):t===null||E(t)?n(t):(e.consume(t),T)}function k(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||D(t)?C(t):(e.consume(t),k)}function A(e){return e===47||e===62||O(e)?x(e):n(e)}function j(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||E(t)?M(t):O(t)?(e.consume(t),ee):n(t)}function M(t){return t===45&&i===2?(e.consume(t),P):t===60&&i===1?(e.consume(t),F):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),ie):E(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ti,oe,N)(t)):t===null||E(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),M)}function N(t){return e.check(Hr,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||E(t)?N(t):(e.enter(`htmlFlowData`),M(t))}function P(t){return t===45?(e.consume(t),I):M(t)}function F(t){return t===47?(e.consume(t),o=``,re):M(t)}function re(t){if(t===62){let n=o.toLowerCase();return Ci.includes(n)?(e.consume(t),ae):M(t)}return y(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):M(t)}function ie(t){return t===93?(e.consume(t),I):M(t)}function I(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),I):M(t)}function ae(t){return t===null||E(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function Oi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mr,t,n)}}var ki={name:`htmlText`,tokenize:Ai};function Ai(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),C):t===63?(e.consume(t),x):y(t)?(e.consume(t),k):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):y(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):E(t)?(o=d,F(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?P(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):E(t)?(o=h,F(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?P(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?P(t):E(t)?(o=v,F(t)):(e.consume(t),v)}function x(t){return t===null?n(t):t===63?(e.consume(t),S):E(t)?(o=x,F(t)):(e.consume(t),x)}function S(e){return e===62?P(e):x(e)}function C(t){return y(t)?(e.consume(t),w):n(t)}function w(t){return t===45||b(t)?(e.consume(t),w):T(t)}function T(t){return E(t)?(o=T,F(t)):O(t)?(e.consume(t),T):P(t)}function k(t){return t===45||b(t)?(e.consume(t),k):t===47||t===62||D(t)?A(t):n(t)}function A(t){return t===47?(e.consume(t),P):t===58||t===95||y(t)?(e.consume(t),j):E(t)?(o=A,F(t)):O(t)?(e.consume(t),A):P(t)}function j(t){return t===45||t===46||t===58||t===95||b(t)?(e.consume(t),j):ee(t)}function ee(t){return t===61?(e.consume(t),M):E(t)?(o=ee,F(t)):O(t)?(e.consume(t),ee):A(t)}function M(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,N):E(t)?(o=M,F(t)):O(t)?(e.consume(t),M):(e.consume(t),te)}function N(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):E(t)?(o=N,F(t)):(e.consume(t),N)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||D(t)?A(t):(e.consume(t),te)}function ne(e){return e===47||e===62||D(e)?A(e):n(e)}function P(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function F(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return O(t)?H(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var ji={name:`labelEnd`,resolveAll:Fi,resolveTo:Ii,tokenize:Li},Mi={tokenize:Ri},Ni={tokenize:zi},Pi={tokenize:Bi};function Fi(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&R(e,0,e.length,n),e}function Ii(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=z(o,e.slice(i+1,i+r+3)),o=z(o,[[`enter`,l,t]]),o=z(o,wr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=z(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=z(o,e.slice(a+1)),o=z(o,[[`exit`,s,t]]),R(e,i,e.length,o),e}function Li(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(L(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Mi,u,o?u:d)(t):t===91?e.attempt(Ni,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Pi,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Ri(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return D(t)?fi(e,a)(t):a(t)}function a(t){return t===41?u(t):li(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return D(t)?fi(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?di(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return D(t)?fi(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function zi(e,t,n){let r=this;return i;function i(t){return ui.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(L(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Bi(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Vi={name:`labelStartImage`,resolveAll:ji.resolveAll,tokenize:Hi};function Hi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ui={name:`labelStartLink`,resolveAll:ji.resolveAll,tokenize:Wi};function Wi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Gi={name:`lineEnding`,tokenize:Ki};function Ki(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}}var qi={name:`thematicBreak`,tokenize:Ji};function Ji(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||E(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),O(t)?H(e,s,`whitespace`)(t):s(t))}}var U={continuation:{tokenize:Qi},exit:ea,name:`list`,tokenize:Zi},Yi={partial:!0,tokenize:ta},Xi={partial:!0,tokenize:$i};function Zi(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:C(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(qi,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return C(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Mr,r.interrupt?n:u,e.attempt(Yi,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return O(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Qi(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!O(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Xi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,H(e,e.attempt(U,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function $i(e,t,n){let r=this;return H(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ea(e){e.exit(this.containerState.type)}function ta(e,t,n){let r=this;return H(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!O(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var na=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){ra(this,e,t,n,!1)}addBefore(e,t,n){ra(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function ra(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var ia={name:`setextUnderline`,resolveTo:aa,tokenize:oa};function aa(e,t){let n=new na,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function oa(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),O(t)?H(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||E(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var sa={tokenize:ha,partial:!0};function ca(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:fa,continuation:{tokenize:pa},exit:ma}},text:{91:{name:`gfmFootnoteCall`,tokenize:da},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:la,resolveTo:ua}}}}function la(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=L(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function ua(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function da(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||D(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(L(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return D(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function fa(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||D(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=L(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return D(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),H(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function pa(e,t,n){return e.check(Mr,t,e.attempt(sa,t,n))}function ma(e){e.exit(`gfmFootnoteDefinition`)}function ha(e,t,n){let r=this;return H(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ga(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&R(o,o.length,0,wr(s,e.slice(r+1,n),t)),R(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),R(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=yt(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=yt(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var _a=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){va(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function va(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function ya(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ba(){return{flow:{null:{name:`table`,tokenize:xa,resolveAll:Sa}}}}function xa(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):E(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):O(t)?H(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||D(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,O(t)?H(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return O(t)?H(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||E(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return O(t)?H(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||E(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||E(n)?(e.exit(`tableRow`),t(n)):O(n)?H(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||D(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Sa(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new _a;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(wa(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Ca(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Ca(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Ca(f,t,o,i,n,d)):(o[0]=o[1],d=Ca(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&wa(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=ya(t.events,n))}return e}function Ca(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ta(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ta(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ta(t.events,n[2]),a=Ta(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ta(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function wa(e,t,n,r,i){let a=[],o=Ta(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ta(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Ea={name:`tasklistCheck`,tokenize:Oa};function Da(){return{text:{91:Ea}}}function Oa(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return D(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return E(r)?t(r):O(r)?e.check({tokenize:ka},t,n)(r):n(r)}}function ka(e,t,n){return H(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Aa(e){return $n([lr(),ca(),ga(e),ba(),Da()])}var ja={};function Ma(e){let t=this,n=e||ja,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Aa(n)),a.push(Xn()),o.push(Zn(n))}function Na(e){let t=this;t.compiler=n;function n(n){return kn(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function Pa(e){if(e)throw e}var Fa=e(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ia(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function La(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ra(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ra(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}function za(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Va(e.position):`start`in e||`end`in e?Va(e):`line`in e||`column`in e?Ba(e):``}function Ba(e){return Ha(e&&e.line)+`:`+Ha(e&&e.column)}function Va(e){return Ba(e&&e.start)+`-`+Ba(e&&e.end)}function Ha(e){return e&&typeof e==`number`?e:1}var W=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=za(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};W.prototype.file=``,W.prototype.name=``,W.prototype.reason=``,W.prototype.message=``,W.prototype.stack=``,W.prototype.column=void 0,W.prototype.line=void 0,W.prototype.ancestors=void 0,W.prototype.cause=void 0,W.prototype.fatal=void 0,W.prototype.place=void 0,W.prototype.ruleId=void 0,W.prototype.source=void 0;var G={basename:Ua,dirname:Wa,extname:Ga,join:Ka,sep:`/`};function Ua(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Ya(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Wa(e){if(Ya(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Ga(e){Ya(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ka(...e){let t=-1,n;for(;++t<e.length;)Ya(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:qa(n)}function qa(e){Ya(e);let t=e.codePointAt(0)===47,n=Ja(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ja(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Ya(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Xa={cwd:Za};function Za(){return`/`}function Qa(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function $a(e){if(typeof e==`string`)e=new URL(e);else if(!Qa(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return eo(e)}function eo(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var to=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],no=class{constructor(e){let t;t=e?Qa(e)?{path:e}:typeof e==`string`||oo(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Xa.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<to.length;){let e=to[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)to.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?G.basename(this.path):void 0}set basename(e){io(e,`basename`),ro(e,`basename`),this.path=G.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?G.dirname(this.path):void 0}set dirname(e){ao(this.basename,`dirname`),this.path=G.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?G.extname(this.path):void 0}set extname(e){if(ro(e,`extname`),ao(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=G.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Qa(e)&&(e=$a(e)),io(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?G.basename(this.path,this.extname):void 0}set stem(e){io(e,`stem`),ro(e,`stem`),this.path=G.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new W(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function ro(e,t){if(e&&e.includes(G.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+G.sep+"`")}function io(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ao(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function oo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var so=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),co=n(Fa(),1),lo={}.hasOwnProperty,uo=new class e extends so{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=La()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,co.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mo(`data`,this.frozen),this.namespace[e]=t,this):lo.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mo(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=_o(e),n=this.parser||this.Parser;return fo(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fo(`process`,this.parser||this.Parser),po(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_o(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);yo(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),fo(`processSync`,this.parser||this.Parser),po(`processSync`,this.compiler||this.Compiler),this.process(e,r),go(`processSync`,`process`,t),n;function r(e,r){t=!0,Pa(e),n=r}}run(e,t,n){ho(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=_o(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),go(`runSync`,`run`,n),r;function i(e,t){Pa(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_o(t),r=this.compiler||this.Compiler;return po(`stringify`,r),ho(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mo(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,co.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ia(o)&&Ia(r)&&(r=(0,co.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fo(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function po(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mo(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ho(e){if(!Ia(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function go(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _o(e){return vo(e)?e:new no(e)}function vo(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yo(e){return typeof e==`string`||bo(e)}function bo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var K=e=>({type:`text`,value:String(e??``).replace(/[\t\n\f\r ]+/g,` `)}),q=e=>({type:`inlineCode`,value:String(e??``)}),J=(...e)=>({type:`paragraph`,children:e}),Y=(...e)=>({type:`strong`,children:e}),X=(e,...t)=>({type:`heading`,depth:e,children:t}),Z=(...e)=>({type:`listItem`,spread:!1,children:e}),Q=e=>({type:`list`,ordered:!1,spread:!1,children:e}),xo=e=>{let t=e.replace(/[\u0000-\u0020\u007f-\u009f]/g,``),n=/^([^/?#]*):/.exec(t)?.[1];return n&&![`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`].includes(n.toLowerCase())?``:e},So=(e,t)=>({type:`link`,url:xo(e),children:[K(t)]}),$=(e,t)=>Z(J(Y(K(`${e}:`)),K(`\xA0`),t)),Co={tokenize:wo};function wo(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return E(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var To={tokenize:Do},Eo={tokenize:Oo};function Do(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return R(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Eo,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Eo,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return E(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;R(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Oo(e,t,n){return H(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var ko={tokenize:Ao};function Ao(e){let t=this,n=e.attempt(Mr,r,e.attempt(this.parser.constructs.flowInitial,i,H(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ii,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var jo={resolveAll:Fo()},Mo=Po(`string`),No=Po(`text`);function Po(e){return{resolveAll:Fo(e===`text`?Io:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Fo(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Io(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Lo=t({attentionMarkers:()=>Go,contentInitial:()=>zo,disable:()=>Ko,document:()=>Ro,flow:()=>Vo,flowInitial:()=>Bo,insideSpan:()=>Wo,string:()=>Ho,text:()=>Uo}),Ro={42:U,43:U,45:U,48:U,49:U,50:U,51:U,52:U,53:U,54:U,55:U,56:U,57:U,62:Pr},zo={91:pi},Bo={[-2]:Kr,[-1]:Kr,32:Kr},Vo={35:yi,42:qi,45:[ia,qi],60:wi,61:ia,95:qi,96:Wr,126:Wr},Ho={38:Br,92:Rr},Uo={[-5]:Gi,[-4]:Gi,[-3]:Gi,33:Vi,38:Br,42:Tr,60:[kr,ki],91:Ui,92:[_i,Rr],93:ji,95:Tr,96:Xr},Wo={null:[Tr,jo]},Go={null:[42,95]},Ko={null:[]};function qo(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=z(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=wr(a,l.events,l),l.events):[]}function f(e,t){return Yo(p(e),t)}function p(e){return Jo(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,D()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){E(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,D()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&R(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Jo(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Yo(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
37
37
  `;break;case-3:o=`\r
38
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Xo(e){let t={constructs:$n([Lo,...(e||{}).extensions||[]]),content:n(Co),defined:[],document:n(To),flow:n(ko),lazy:{},string:n(Mo),text:n(No)};return t;function n(e){return n;function n(n){return qo(t,e,n)}}}function Zo(e){for(;!ni(e););return e}var Qo=/[\0\t\n\r]/g;function $o(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Qo.lastIndex=u,c=Qo.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var es={}.hasOwnProperty;function ts(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ns(n)(Zo(Xo(n).document().write($o()(e,t,!0))))}function ns(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(ee),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:ne,resourceTitleString:P,resource:F,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};is(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];es.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||os).call(a,void 0,e[0])}for(r.position={start:rs(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:rs(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:rs(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||os).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+za({start:e.start,end:e.end})+`): it’s not open`);n.position.end=rs(e.end)}function u(){return Tt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:rs(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=rs(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=rs(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=gn(t),n.identifier=L(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function F(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=mn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=pn(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=rs(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function rs(e){return{line:e.line,column:e.column,offset:e.offset}}function is(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?is(e,r):as(e,r)}}function as(e,t){let n;for(n in t)if(es.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function os(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+za({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+za({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+za({start:t.start,end:t.end})+`) is still open`)}function ss(e){let t=this;t.parser=n;function n(n){return ts(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var cs=uo().use(ss).use(Ma).freeze(),ls=e=>e.type===`html`||`children`in e&&e.children.some(ls),us=e=>{if(`url`in e&&(e.url=xo(e.url)),`children`in e){for(let t of e.children)us(t);let t=e.children.length;if(e.children=e.children.filter(e=>e.type!==`image`&&e.type!==`imageReference`&&!([`strong`,`emphasis`,`delete`,`link`,`linkReference`,`paragraph`,`heading`,`blockquote`,`list`,`listItem`].includes(e.type)&&`children`in e&&e.children.every(e=>e.type===`text`&&!e.value.trim()))),e.children.length!==t){let t=e.children.at(0),n=e.children.at(-1);t?.type===`text`&&(t.value=t.value.trimStart()),n?.type===`text`&&(n.value=n.value.trimEnd())}}delete e.position},ds=e=>{let t=new Set,n=new Set,r=new Map(e.children.filter(e=>e.type===`footnoteDefinition`).map(e=>[e.identifier,e])),i=e=>{e.type===`linkReference`&&t.add(e.identifier),e.type===`footnoteReference`&&n.add(e.identifier),`children`in e&&e.children.forEach(i)};e.children.filter(e=>e.type!==`footnoteDefinition`).forEach(i);for(let e of n)r.get(e)?.children.forEach(i);e.children=e.children.filter(e=>e.type===`definition`?t.has(e.identifier):e.type===`footnoteDefinition`?n.has(e.identifier):e.type!==`paragraph`||e.children.some(e=>e.type!==`text`||e.value.trim()))},fs=()=>{let e=new Map,t=async e=>{let t=cs.parse(e),n=ls(t)||/^\s*>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION|SUCCESS)\]/im.test(e)?await(await s(async()=>{let{parseHtmlDescription:e}=await import(`./parse-html-description-dmqM3Nvp.js`);return{parseHtmlDescription:e}},__vite__mapDeps([0,1,2]))).parseHtmlDescription(e):t;return us(n),ds(n),n.children},n=(e,t)=>{let r={...e};return`identifier`in r&&(r.identifier=`${t}${r.identifier}`,`label`in r&&(r.label=r.identifier),`referenceType`in r&&(r.referenceType=`full`)),`children`in r&&(r.children=r.children.map(e=>n(e,t))),r},r=e=>`identifier`in e||`children`in e&&e.children.some(r);return()=>{let i={nextId:0};return async a=>{if(!a)return[];let o=`description-${i.nextId++}-`,s=e.get(a)??t(a);return e.has(a)||(e.size>=256&&e.clear(),e.set(a,s)),(await s).map(e=>r(e)?n(e,o):e)}}},ps=10,ms=1e4,hs=(e,t=ms)=>{let n=new WeakMap,i=(e,a)=>{if(a>ps||!r(e))return 1;let s=n.get(e)?.get(a);if(s!==void 0)return s;let c=h(e,o);if(!r(c)||c.example!==void 0||Array.isArray(c.examples)&&c.examples.length>0)return 1;let l=1,u=e=>{l<=t&&(l+=i(e,a+1))};r(c.properties)&&Object.values(c.properties).forEach(u),r(c.patternProperties)&&Object.values(c.patternProperties).forEach(u),r(c.additionalProperties)&&u(c.additionalProperties),c.items!==void 0&&u(c.items),Array.isArray(c.prefixItems)&&c.prefixItems.forEach(u),Array.isArray(c.allOf)&&c.allOf.forEach(u);let d=Array.isArray(c.oneOf)?c.oneOf:Array.isArray(c.anyOf)?c.anyOf:[],f=d.find(e=>{let t=h(e,o);return r(t)&&t.type!==`null`}),p=r(c.discriminator)&&c.discriminator.defaultMapping!==void 0?d:[d[0],f],m=0;for(let e of p)e!==void 0&&l<=t&&m<=t&&(m=Math.max(m,i(e,a+1)));l+=m;let g=n.get(e)??new Map;return g.set(a,l),n.set(e,g),l};return i(e,0)},gs=(e,t,n,s=`3.2.0`,c=s)=>{if(e.example!==void 0)return[{value:e.example}];if(e.examples&&Object.keys(e.examples).length)return Object.entries(e.examples).flatMap(([e,t])=>{let n=h(t);if(!r(n))return[];let i={name:e,summary:typeof n.summary==`string`?n.summary:void 0,description:typeof n.description==`string`?n.description:void 0};return n.value===void 0?/^3\.2\./.test(s)&&typeof n.serializedValue==`string`?[{...i,serializedValue:n.serializedValue}]:typeof n.externalValue==`string`?[{...i,externalValue:n.externalValue}]:/^3\.2\./.test(s)&&n.dataValue!==void 0?[{...i,dataValue:n.dataValue}]:[]:[{...i,value:n.value}]});let l=h(e.schema);if(!r(l))return[];if(hs(e.schema)>ms)return[{omitted:!0}];if(d(t)){let t=i(e.schema,void 0,{mode:n,openapiVersion:c});return[t.xml===void 0?{error:`Unable to generate an XML example.`}:{serializedValue:t.xml}]}let u=a(h(e.schema,o),{mode:n});return u===void 0?[]:[{value:u}]},_s=async(e,t,n=`application/json`,r,a=`3.2.0`,o=a)=>{let s=[];for(let c of gs(e,n,r,a,o)){if(s.push(J(Y(K(c.name?`Example: ${c.name}`:`Example:`)))),`omitted`in c){s.push(J(K(`[Generated example omitted because it is too large]`)));continue}if(c.summary&&s.push(J(K(c.summary))),s.push(...await t(c.description)),`error`in c){s.push(J(K(c.error)));continue}if(`externalValue`in c){s.push(J(Y(K(`External value:`)),K(` `),So(c.externalValue,c.externalValue)));continue}if(`serializedValue`in c){s.push({type:`code`,lang:d(n)?`xml`:n.includes(`json`)?`json`:`text`,value:c.serializedValue});continue}let a=d(n),l=`dataValue`in c?c.dataValue:c.value;if(a&&!e.schema&&`value`in c&&(typeof l!=`object`||!l)){s.push({type:`code`,lang:`xml`,value:String(l)});continue}let u=a?i(e.schema,c,{mode:r,openapiVersion:o}):void 0;if(a&&u?.xml===void 0){s.push(J(K(`Unable to generate an XML example.`)));continue}s.push({type:`code`,lang:a?`xml`:`json`,value:u?.xml??JSON.stringify(l,null,2)??``})}return s},vs=async(e,t,n,r,i=r)=>{let a=[];for(let[s,c]of Object.entries(e??{})){if(s.toLowerCase()===`content-type`||!h(c))continue;let e=h(c,o),l=[J(Y(q(s)),K(e.required?` (required)`:``)),...await t(e.description)];`schema`in e&&e.schema!==void 0&&l.push(...n.render(e.schema)),(`example`in e||`examples`in e)&&l.push(...await _s({example:e.example,examples:e.examples},t,`application/json`,void 0,r,i));for(let[a,o]of Object.entries(`content`in e?e.content??{}:{}))l.push(J(Y(K(`Content-Type:`)),K(` ${a}`))),o.schema!==void 0&&l.push(...n.render(o.schema)),l.push(...await _s(o,t,a,void 0,r,i));a.push(Z(...l))}return a.length?[J(Y(K(`Headers:`))),Q(a)]:[]},ys=async(e,t,n,r,i,a=i)=>{let o=t.startsWith(`multipart/`);if(!o&&t!==`application/x-www-form-urlencoded`)return[];let s=[];for(let[t,c]of Object.entries(e??{})){let e=[];for(let[t,n]of[[`contentType`,`Content-Type`],[`style`,`Style`],[`explode`,`Explode`],[`allowReserved`,`Allow reserved`]])c[t]!==void 0&&e.push(Z(J(K(`${n}: `),q(c[t]))));let l=[J(Y(q(t)))];e.length&&l.push(Q(e)),o&&l.push(...await vs(c.headers,n,r,i,a)),s.push(Z(...l))}return s.length?[J(Y(K(`Encoding:`))),Q(s)]:[]},bs=e=>typeof e==`string`?e:JSON.stringify(e)??``,xs=async(e,t)=>{let n=[];for(let[r,i]of Object.entries(e??{})){if(!h(i))continue;let e=h(i,o),a=[J(Y(K(r))),...await t(e.description)];e.operationId&&a.push(J(Y(K(`Operation ID:`)),K(` `),q(e.operationId))),e.operationRef&&a.push(J(Y(K(`Operation reference:`)),K(` `),q(e.operationRef)));let s=Object.entries(e.parameters??{});s.length&&a.push(Q(s.map(([e,t])=>Z(J(Y(K(`${e}:`)),K(` `),q(bs(t))))))),e.requestBody!==void 0&&a.push(J(Y(K(`Request body:`)),K(` `),q(bs(e.requestBody)))),e.server&&a.push(J(Y(K(`Server:`)),K(` `),q(e.server.url))),n.push(Z(...a))}return n.length?[J(Y(K(`Links:`))),Q(n)]:[]},Ss=async(e,t,n)=>{if(!e)return[];let r=[X(4,K(`Authentication`))];e.length||r.push(J(K(`No authentication required.`)));for(let[i,a]of e.entries()){i&&r.push(J(K(`Or:`)));let e=Object.entries(a);if(!e.length){r.push(J(K(`No authentication required.`)));continue}let o=[];for(let[r,i]of e){let e=[J(Y(K(r)),...i?.length?[K(` Scopes: ${i.join(`, `)}`)]:[])],a=h(t?.[r]);a&&(e.push({type:`code`,value:JSON.stringify(a,null,2)}),e.push(...await n(a.description))),o.push(Z(...e))}r.push(Q(o))}return r},Cs=async(e,t,n,r,i,a,{description:s,schemas:c})=>{let l=n===n.toLowerCase()&&m(n)?n.toUpperCase():n,u=e[`x-original-oas-version`]??e.openapi,d=i[`x-scalar-stability`],f=(i.summary||`${l} ${t}`)+(d?` (${d})`:i.deprecated?` ⚠️ Deprecated`:``),p=[$(`Method`,q(l)),$(a?`Webhook`:`Path`,q(t))];i.operationId&&p.push($(`Operation ID`,q(i.operationId))),i.tags&&p.push($(`Tags`,K(i.tags.join(`, `)))),d&&p.push($(`Stability`,K(d)));let g=[X(3,K(f)),Q(p),...await s(i.description)],_=i.servers??r.servers??e.servers;if(_?.length){g.push(X(4,K(`Effective servers`)));let e=[];for(let t of _){let n=[J(q(t.url)),...await s(t.description)],r=Object.entries(t.variables??{});r.length&&n.push(Q(r.map(([e,t])=>Z(J(K(`${e}: `),q(t.default)))))),e.push(Z(...n))}g.push(Q(e))}g.push(...await Ss(i.security??e.security,e.components?.securitySchemes,s));let v=new Map;for(let e of[...r.parameters??[],...i.parameters??[]]){let t=h(e,o);t&&v.set(`${t.in}:${t.name}`,t)}v.size&&g.push(X(4,K(`Parameters`)));for(let t of v.values()){g.push(X(5,q(t.name),K(`${t.required?` required`:``}${t.deprecated?` deprecated`:``}`)));let n=[$(`In`,q(t.in))];`style`in t&&t.style&&n.push($(`Style`,q(t.style))),`explode`in t&&typeof t.explode==`boolean`&&n.push($(`Explode`,q(t.explode))),t.allowEmptyValue&&n.push($(`Allow Empty Value`,K(`true`))),`allowReserved`in t&&t.allowReserved&&n.push($(`Allow Reserved`,K(`true`))),g.push(Q(n),...await s(t.description)),`schema`in t&&t.schema!==void 0&&g.push(...c.render(t.schema)),(`example`in t||`examples`in t)&&g.push(...await _s({example:t.example,examples:t.examples},s,`application/json`,`write`,u,e.openapi));for(let[n,r]of Object.entries(`content`in t?t.content??{}:{}))g.push(X(6,K(`Content-Type: ${n}`))),r.schema!==void 0&&g.push(...c.render(r.schema)),g.push(...await _s(r,s,n,`write`,u,e.openapi))}let y=h(i.requestBody,o);if(y){g.push(X(4,K(`Request Body`)),...await s(y.description)),typeof y.required==`boolean`&&g.push(J(Y(K(`Required:`)),K(` `),q(y.required)));for(let[t,n]of Object.entries(y.content??{}))g.push(X(5,K(`Content-Type: ${t}`))),n.schema!==void 0&&g.push(...c.render(n.schema)),g.push(...await _s(n,s,t,`write`,u,e.openapi)),g.push(...await ys(n.encoding,t,s,c,u,e.openapi))}let b=Object.entries(i.responses??{}).flatMap(([e,t])=>{let n=h(t,o);return n?[{status:e,response:n}]:[]});b.length&&g.push(X(4,K(`Responses`)));for(let{status:t,response:n}of b){g.push(X(5,K(`Status: ${t}${n.description?` ${n.description}`:``}`))),g.push(...await vs(n.headers,s,c,u,e.openapi),...await xs(n.links,s));for(let[t,r]of Object.entries(n.content??{}))g.push(X(6,K(`Content-Type: ${t}`))),r.schema!==void 0&&g.push(...c.render(r.schema)),g.push(...await _s(r,s,t,`read`,u,e.openapi))}return g},ws=64,Ts=1e5,Es=new Set([`allOf`,`anyOf`,`oneOf`,`not`,`properties`,`required`,`items`,`additionalProperties`,`discriminator`,`minItems`,`maxItems`,`uniqueItems`]),Ds=new Set([`$ref`,`$ref-value`,`$global`,`$status`]),Os=(...e)=>({type:`emphasis`,children:e}),ks=e=>{let t=/^#\/components\/schemas\/([^/]+)$/.exec(e);if(!t)return e;try{return f(t[1])}catch{return e}},As=(e,t)=>{let n=r(e)?e.$ref:void 0;if(typeof n==`string`&&typeof t.schema==`object`&&!Object.keys(e).some(e=>Es.has(e)))return t.allOf?.length||t.anyOf?.length||t.oneOf?.length||t.properties.length||t.not!==void 0||t.items!==void 0||t.additionalProperties!==void 0?ks(n):void 0},js=e=>{let t=h(e),n=h(e,o);return typeof t==`boolean`?!r(n)||!Object.keys(n).some(e=>![`$ref`,`$ref-value`,`$global`,`$status`].includes(e))?t:t?n:{...n,allOf:[!1,...Array.isArray(n.allOf)?n.allOf:[]]}:n},Ms=({maxNodes:e=Ts}={})=>{let t=new WeakMap,n=e=>{let n=typeof e==`object`?t.get(e):void 0;if(n)return n;let r=js(e),i=typeof r==`object`?r:{},a=new Set(i.required??[]),o=Object.entries(i.properties??{}).filter(([,e])=>typeof e==`boolean`||typeof e==`object`&&!!e).sort(([e],[t])=>Number(a.has(t))-Number(a.has(e))||e.localeCompare(t)),s={...i,type:typeof r==`boolean`?r?`any`:`never`:i.type,schema:r,required:a,properties:o};return s.name=As(e,s),typeof e==`object`&&t.set(e,s),s},i=(e,t=!1,n=!1,r=!0)=>{if(typeof e.schema==`boolean`)return[K(e.schema?`any (true schema)`:`never (false schema)`)];let i=Array.isArray(e.type)?e.type.join(` | `):e.type,a=r&&(i||t)?[q(i||`object`)]:[],o=(e,t)=>{t!==void 0&&a.push(K(`${a.length?`, `:``}${e}: `),q(t))};o(`schema`,e.name),o(`format`,e.format),e.enum&&o(`possible values`,e.enum.map(e=>JSON.stringify(e)).join(`, `)),e.const!==void 0&&o(`const`,JSON.stringify(e.const)),e.default!==void 0&&o(`default`,JSON.stringify(e.default));for(let t of[`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minLength`,`maxLength`,`pattern`,`minProperties`,`maxProperties`])o(t,e[t]);for(let t of[`readOnly`,`writeOnly`])e[t]&&a.push(K(`${a.length?`, `:``}${t}`));return!n&&e.description&&a.push(K(`${a.length?` — `:``}${e.description}`)),a},a=(t={})=>{let o=new Map,s=new Set(Object.values(t).map(e=>h(e)??e)),c=0,l=(e,t,n,a,o)=>{let s=[];if(r(e)&&Object.keys(e).some(e=>!Ds.has(e))&&!n.hideDetails){let e=i({...t,name:void 0},!1,n.hideDescription);e.length&&s.push(J(...e))}return s.push(J(Os(K(`Schema `),q(a),K(` is shown ${o}.`)))),s},u=(t,a=0,d=[],f={})=>{let p=h(t)??t;if(typeof p==`object`&&d.includes(p))return[J(Os(K(`[Circular Reference]`)))];let m=n(t),g=r(t)&&`$ref`in t&&Object.keys(t).some(e=>Es.has(e))?t:p,_=typeof g==`object`&&g?g:void 0,v=f.name??m.name;if(_&&v!==void 0){let e=o.get(_);if(e!==void 0){let n=f.name===void 0?f:{...f,hideDetails:!0};return l(t,m,n,e,`above`)}if(m.name!==void 0&&f.name===void 0&&a>=ws&&s.has(_))return l(t,m,f,m.name,`below under Schemas`)}if(a>=ws)return[J(K(`[Maximum schema depth reached]`))];if(c>=e)return[J(Os(K(`[Schema output truncated]`)))];if(c++,_&&v!==void 0&&!o.has(_)&&o.set(_,v),typeof m.schema==`boolean`)return f.hideDetails?[]:[J(...i(m))];let y=[...d,p],b=[];for(let[e,t]of[[`allOf`,`All of:`],[`anyOf`,`Any of:`],[`oneOf`,`One of:`]])m[e]?.length&&b.push(J(Y(K(t))),...m[e].flatMap(e=>u(e,a+1,y)));m.not!==void 0&&b.push(J(Y(K(`Not:`))),...u(m.not,a+1,y));let x=m.type===`array`||m.items!==void 0;if(!f.hideDetails){let e=m.type===`object`&&m.properties.length>0||m.type===`array`&&m.items!==void 0,t=i(m,!1,f.hideDescription,!e);t.length&&b.push(J(...t))}if(m.properties.length){let e=m.properties.map(([e,t])=>{let r=n(t),o=[q(e)];m.required.has(e)&&o.push(K(` (required)`));let s=[J(Y(...o)),J(...i(r,!0))];return s.push(...u(t,a+1,y,{hideDetails:!0,property:!0})),Z(...s)});b.push(Q(e))}x&&m.items!==void 0&&b.push(J(Y(K(f.property?`Items:`:`Array of:`))),...u(m.items,a+1,y));let S=[];if(m.minItems!==void 0&&S.push(Z(J(K(`Min items: `),q(m.minItems)))),m.maxItems!==void 0&&S.push(Z(J(K(`Max items: `),q(m.maxItems)))),m.uniqueItems!==void 0&&S.push(Z(J(K(`Unique items: `),q(m.uniqueItems)))),S.length&&b.push(Q(S)),m.additionalProperties!==void 0&&b.push(J(Y(K(`Additional properties:`))),...u(m.additionalProperties,a+1,y)),m.discriminator){b.push(J(Y(K(`Discriminator:`)),K(` `),q(m.discriminator.propertyName)));let e=Object.entries(m.discriminator.mapping??{});e.length&&b.push(Q(e.map(([e,t])=>Z(J(q(e),K(`: `),q(t))))))}return b};return{view:n,render:u,beginSection:()=>{c=0},forDocument:a}};return a()},Ns=uo().use(Ma).use(Na,{bullet:`-`}).freeze(),Ps=()=>{let e=fs(),t=Ms();return async n=>{let r=e(),i=t.forDocument(n.components?.schemas),{info:a}=n,s=[$(`OpenAPI Version`,q(n.openapi)),$(`API Version`,q(a.version))];if(a.termsOfService&&s.push($(`Terms of service`,So(a.termsOfService,a.termsOfService))),a.contact){let e=[K(a.contact.name??``)];s.push(Z(J(Y(K(`Contact:`)),K(` `),...e,...a.contact.url?[K(` `),So(a.contact.url,a.contact.url)]:[],...a.contact.email?[K(` `),So(`mailto:${a.contact.email}`,a.contact.email)]:[])))}a.license&&s.push($(`License`,a.license.url?So(a.license.url,a.license.name??``):K(a.license.name)));let c=[X(1,K(a.title)),Q(s),...await r(a.description)];if(n.servers?.length){c.push(X(2,K(`Servers`)));let e=n.servers.map(e=>{let t=[];e.description&&t.push($(`Description`,K(e.description)));let n=Object.entries(e.variables??{});n.length&&t.push(Z(J(Y(K(`Variables:`))),Q(n.map(([e,t])=>Z(J(q(e),K(` (default: `),q(t.default),K(`)${t.description?`: ${t.description}`:``}`)))))));let r=$(`URL`,q(e.url));return t.length&&r.children.push(Q(t)),r});c.push(Q(e))}if(c.push(...await Ss(n.security,n.components?.securitySchemes,r)),n.tags?.length){c.push(X(2,K(`Tags`)));for(let e of n.tags)c.push(X(3,K(e.name)),...await r(e.description)),e.externalDocs&&c.push(J(So(e.externalDocs.url,e.externalDocs.description??e.externalDocs.url)))}let l=[],d=()=>{if(c.length){let e={type:`root`,children:c.splice(0)};l.push(Ns.stringify(e).trimEnd())}};d();for(let e of[{title:`Operations`,paths:n.paths,webhook:!1},{title:`Webhooks`,paths:n.webhooks,webhook:!0}]){let t=!1;for(let[a,s]of Object.entries(e.paths??{})){let l=p(s);if(!l)continue;let f=[];u(s,(e,t)=>{f.push({method:e,operation:h(t,o)})});for(let{method:o,operation:s}of f)t||=(c.push(X(2,K(e.title))),!0),i.beginSection(),c.push(...await Cs(n,a,o,l,s,e.webhook,{description:r,schemas:i})),d()}}let f=Object.entries(n.components?.schemas??{});f.length&&c.push(X(2,K(`Schemas`)));for(let[e,t]of f){i.beginSection();let a=i.view(t);c.push(X(3,K(a.title??e)),Q([a.type?$(`Type`,q(Array.isArray(a.type)?a.type.join(` | `):a.type)):Z(J(Y(K(`Type:`))))]),...await r(a.description),...i.render(t,0,[],{hideDescription:!0,name:e})),a.type===`object`&&c.push(...await _s({schema:t},r,`application/json`,void 0,n[`x-original-oas-version`]??n.openapi)),d()}return d(),`${l.join(`
38
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Xo(e){let t={constructs:$n([Lo,...(e||{}).extensions||[]]),content:n(Co),defined:[],document:n(To),flow:n(ko),lazy:{},string:n(Mo),text:n(No)};return t;function n(e){return n;function n(n){return qo(t,e,n)}}}function Zo(e){for(;!ni(e););return e}var Qo=/[\0\t\n\r]/g;function $o(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Qo.lastIndex=u,c=Qo.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var es={}.hasOwnProperty;function ts(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ns(n)(Zo(Xo(n).document().write($o()(e,t,!0))))}function ns(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(ee),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:ne,resourceTitleString:P,resource:F,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};is(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];es.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||os).call(a,void 0,e[0])}for(r.position={start:rs(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:rs(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:rs(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||os).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+za({start:e.start,end:e.end})+`): it’s not open`);n.position.end=rs(e.end)}function u(){return Tt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:rs(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=rs(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=rs(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=gn(t),n.identifier=L(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function F(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=mn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=pn(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=rs(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function rs(e){return{line:e.line,column:e.column,offset:e.offset}}function is(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?is(e,r):as(e,r)}}function as(e,t){let n;for(n in t)if(es.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function os(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+za({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+za({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+za({start:t.start,end:t.end})+`) is still open`)}function ss(e){let t=this;t.parser=n;function n(n){return ts(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var cs=uo().use(ss).use(Ma).freeze(),ls=e=>e.type===`html`||`children`in e&&e.children.some(ls),us=e=>{if(`url`in e&&(e.url=xo(e.url)),`children`in e){for(let t of e.children)us(t);let t=e.children.length;if(e.children=e.children.filter(e=>e.type!==`image`&&e.type!==`imageReference`&&!([`strong`,`emphasis`,`delete`,`link`,`linkReference`,`paragraph`,`heading`,`blockquote`,`list`,`listItem`].includes(e.type)&&`children`in e&&e.children.every(e=>e.type===`text`&&!e.value.trim()))),e.children.length!==t){let t=e.children.at(0),n=e.children.at(-1);t?.type===`text`&&(t.value=t.value.trimStart()),n?.type===`text`&&(n.value=n.value.trimEnd())}}delete e.position},ds=e=>{let t=new Set,n=new Set,r=new Map(e.children.filter(e=>e.type===`footnoteDefinition`).map(e=>[e.identifier,e])),i=e=>{e.type===`linkReference`&&t.add(e.identifier),e.type===`footnoteReference`&&n.add(e.identifier),`children`in e&&e.children.forEach(i)};e.children.filter(e=>e.type!==`footnoteDefinition`).forEach(i);for(let e of n)r.get(e)?.children.forEach(i);e.children=e.children.filter(e=>e.type===`definition`?t.has(e.identifier):e.type===`footnoteDefinition`?n.has(e.identifier):e.type!==`paragraph`||e.children.some(e=>e.type!==`text`||e.value.trim()))},fs=()=>{let e=new Map,t=async e=>{let t=cs.parse(e),n=ls(t)||/^\s*>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION|SUCCESS)\]/im.test(e)?await(await s(async()=>{let{parseHtmlDescription:e}=await import(`./parse-html-description-XSND5qRr.js`);return{parseHtmlDescription:e}},__vite__mapDeps([0,1,2]))).parseHtmlDescription(e):t;return us(n),ds(n),n.children},n=(e,t)=>{let r={...e};return`identifier`in r&&(r.identifier=`${t}${r.identifier}`,`label`in r&&(r.label=r.identifier),`referenceType`in r&&(r.referenceType=`full`)),`children`in r&&(r.children=r.children.map(e=>n(e,t))),r},r=e=>`identifier`in e||`children`in e&&e.children.some(r);return()=>{let i={nextId:0};return async a=>{if(!a)return[];let o=`description-${i.nextId++}-`,s=e.get(a)??t(a);return e.has(a)||(e.size>=256&&e.clear(),e.set(a,s)),(await s).map(e=>r(e)?n(e,o):e)}}},ps=10,ms=1e4,hs=(e,t=ms)=>{let n=new WeakMap,i=(e,a)=>{if(a>ps||!r(e))return 1;let s=n.get(e)?.get(a);if(s!==void 0)return s;let c=h(e,o);if(!r(c)||c.example!==void 0||Array.isArray(c.examples)&&c.examples.length>0)return 1;let l=1,u=e=>{l<=t&&(l+=i(e,a+1))};r(c.properties)&&Object.values(c.properties).forEach(u),r(c.patternProperties)&&Object.values(c.patternProperties).forEach(u),r(c.additionalProperties)&&u(c.additionalProperties),c.items!==void 0&&u(c.items),Array.isArray(c.prefixItems)&&c.prefixItems.forEach(u),Array.isArray(c.allOf)&&c.allOf.forEach(u);let d=Array.isArray(c.oneOf)?c.oneOf:Array.isArray(c.anyOf)?c.anyOf:[],f=d.find(e=>{let t=h(e,o);return r(t)&&t.type!==`null`}),p=r(c.discriminator)&&c.discriminator.defaultMapping!==void 0?d:[d[0],f],m=0;for(let e of p)e!==void 0&&l<=t&&m<=t&&(m=Math.max(m,i(e,a+1)));l+=m;let g=n.get(e)??new Map;return g.set(a,l),n.set(e,g),l};return i(e,0)},gs=(e,t,n,s=`3.2.0`,c=s)=>{if(e.example!==void 0)return[{value:e.example}];if(e.examples&&Object.keys(e.examples).length)return Object.entries(e.examples).flatMap(([e,t])=>{let n=h(t);if(!r(n))return[];let i={name:e,summary:typeof n.summary==`string`?n.summary:void 0,description:typeof n.description==`string`?n.description:void 0};return n.value===void 0?/^3\.2\./.test(s)&&typeof n.serializedValue==`string`?[{...i,serializedValue:n.serializedValue}]:typeof n.externalValue==`string`?[{...i,externalValue:n.externalValue}]:/^3\.2\./.test(s)&&n.dataValue!==void 0?[{...i,dataValue:n.dataValue}]:[]:[{...i,value:n.value}]});let l=h(e.schema);if(!r(l))return[];if(hs(e.schema)>ms)return[{omitted:!0}];if(d(t)){let t=i(e.schema,void 0,{mode:n,openapiVersion:c});return[t.xml===void 0?{error:`Unable to generate an XML example.`}:{serializedValue:t.xml}]}let u=a(h(e.schema,o),{mode:n});return u===void 0?[]:[{value:u}]},_s=async(e,t,n=`application/json`,r,a=`3.2.0`,o=a)=>{let s=[];for(let c of gs(e,n,r,a,o)){if(s.push(J(Y(K(c.name?`Example: ${c.name}`:`Example:`)))),`omitted`in c){s.push(J(K(`[Generated example omitted because it is too large]`)));continue}if(c.summary&&s.push(J(K(c.summary))),s.push(...await t(c.description)),`error`in c){s.push(J(K(c.error)));continue}if(`externalValue`in c){s.push(J(Y(K(`External value:`)),K(` `),So(c.externalValue,c.externalValue)));continue}if(`serializedValue`in c){s.push({type:`code`,lang:d(n)?`xml`:n.includes(`json`)?`json`:`text`,value:c.serializedValue});continue}let a=d(n),l=`dataValue`in c?c.dataValue:c.value;if(a&&!e.schema&&`value`in c&&(typeof l!=`object`||!l)){s.push({type:`code`,lang:`xml`,value:String(l)});continue}let u=a?i(e.schema,c,{mode:r,openapiVersion:o}):void 0;if(a&&u?.xml===void 0){s.push(J(K(`Unable to generate an XML example.`)));continue}s.push({type:`code`,lang:a?`xml`:`json`,value:u?.xml??JSON.stringify(l,null,2)??``})}return s},vs=async(e,t,n,r,i=r)=>{let a=[];for(let[s,c]of Object.entries(e??{})){if(s.toLowerCase()===`content-type`||!h(c))continue;let e=h(c,o),l=[J(Y(q(s)),K(e.required?` (required)`:``)),...await t(e.description)];`schema`in e&&e.schema!==void 0&&l.push(...n.render(e.schema)),(`example`in e||`examples`in e)&&l.push(...await _s({example:e.example,examples:e.examples},t,`application/json`,void 0,r,i));for(let[a,o]of Object.entries(`content`in e?e.content??{}:{}))l.push(J(Y(K(`Content-Type:`)),K(` ${a}`))),o.schema!==void 0&&l.push(...n.render(o.schema)),l.push(...await _s(o,t,a,void 0,r,i));a.push(Z(...l))}return a.length?[J(Y(K(`Headers:`))),Q(a)]:[]},ys=async(e,t,n,r,i,a=i)=>{let o=t.startsWith(`multipart/`);if(!o&&t!==`application/x-www-form-urlencoded`)return[];let s=[];for(let[t,c]of Object.entries(e??{})){let e=[];for(let[t,n]of[[`contentType`,`Content-Type`],[`style`,`Style`],[`explode`,`Explode`],[`allowReserved`,`Allow reserved`]])c[t]!==void 0&&e.push(Z(J(K(`${n}: `),q(c[t]))));let l=[J(Y(q(t)))];e.length&&l.push(Q(e)),o&&l.push(...await vs(c.headers,n,r,i,a)),s.push(Z(...l))}return s.length?[J(Y(K(`Encoding:`))),Q(s)]:[]},bs=e=>typeof e==`string`?e:JSON.stringify(e)??``,xs=async(e,t)=>{let n=[];for(let[r,i]of Object.entries(e??{})){if(!h(i))continue;let e=h(i,o),a=[J(Y(K(r))),...await t(e.description)];e.operationId&&a.push(J(Y(K(`Operation ID:`)),K(` `),q(e.operationId))),e.operationRef&&a.push(J(Y(K(`Operation reference:`)),K(` `),q(e.operationRef)));let s=Object.entries(e.parameters??{});s.length&&a.push(Q(s.map(([e,t])=>Z(J(Y(K(`${e}:`)),K(` `),q(bs(t))))))),e.requestBody!==void 0&&a.push(J(Y(K(`Request body:`)),K(` `),q(bs(e.requestBody)))),e.server&&a.push(J(Y(K(`Server:`)),K(` `),q(e.server.url))),n.push(Z(...a))}return n.length?[J(Y(K(`Links:`))),Q(n)]:[]},Ss=async(e,t,n)=>{if(!e)return[];let r=[X(4,K(`Authentication`))];e.length||r.push(J(K(`No authentication required.`)));for(let[i,a]of e.entries()){i&&r.push(J(K(`Or:`)));let e=Object.entries(a);if(!e.length){r.push(J(K(`No authentication required.`)));continue}let o=[];for(let[r,i]of e){let e=[J(Y(K(r)),...i?.length?[K(` Scopes: ${i.join(`, `)}`)]:[])],a=h(t?.[r]);a&&(e.push({type:`code`,value:JSON.stringify(a,null,2)}),e.push(...await n(a.description))),o.push(Z(...e))}r.push(Q(o))}return r},Cs=async(e,t,n,r,i,a,{description:s,schemas:c})=>{let l=n===n.toLowerCase()&&m(n)?n.toUpperCase():n,u=e[`x-original-oas-version`]??e.openapi,d=i[`x-scalar-stability`],f=(i.summary||`${l} ${t}`)+(d?` (${d})`:i.deprecated?` ⚠️ Deprecated`:``),p=[$(`Method`,q(l)),$(a?`Webhook`:`Path`,q(t))];i.operationId&&p.push($(`Operation ID`,q(i.operationId))),i.tags&&p.push($(`Tags`,K(i.tags.join(`, `)))),d&&p.push($(`Stability`,K(d)));let g=[X(3,K(f)),Q(p),...await s(i.description)],_=i.servers??r.servers??e.servers;if(_?.length){g.push(X(4,K(`Effective servers`)));let e=[];for(let t of _){let n=[J(q(t.url)),...await s(t.description)],r=Object.entries(t.variables??{});r.length&&n.push(Q(r.map(([e,t])=>Z(J(K(`${e}: `),q(t.default)))))),e.push(Z(...n))}g.push(Q(e))}g.push(...await Ss(i.security??e.security,e.components?.securitySchemes,s));let v=new Map;for(let e of[...r.parameters??[],...i.parameters??[]]){let t=h(e,o);t&&v.set(`${t.in}:${t.name}`,t)}v.size&&g.push(X(4,K(`Parameters`)));for(let t of v.values()){g.push(X(5,q(t.name),K(`${t.required?` required`:``}${t.deprecated?` deprecated`:``}`)));let n=[$(`In`,q(t.in))];`style`in t&&t.style&&n.push($(`Style`,q(t.style))),`explode`in t&&typeof t.explode==`boolean`&&n.push($(`Explode`,q(t.explode))),t.allowEmptyValue&&n.push($(`Allow Empty Value`,K(`true`))),`allowReserved`in t&&t.allowReserved&&n.push($(`Allow Reserved`,K(`true`))),g.push(Q(n),...await s(t.description)),`schema`in t&&t.schema!==void 0&&g.push(...c.render(t.schema)),(`example`in t||`examples`in t)&&g.push(...await _s({example:t.example,examples:t.examples},s,`application/json`,`write`,u,e.openapi));for(let[n,r]of Object.entries(`content`in t?t.content??{}:{}))g.push(X(6,K(`Content-Type: ${n}`))),r.schema!==void 0&&g.push(...c.render(r.schema)),g.push(...await _s(r,s,n,`write`,u,e.openapi))}let y=h(i.requestBody,o);if(y){g.push(X(4,K(`Request Body`)),...await s(y.description)),typeof y.required==`boolean`&&g.push(J(Y(K(`Required:`)),K(` `),q(y.required)));for(let[t,n]of Object.entries(y.content??{}))g.push(X(5,K(`Content-Type: ${t}`))),n.schema!==void 0&&g.push(...c.render(n.schema)),g.push(...await _s(n,s,t,`write`,u,e.openapi)),g.push(...await ys(n.encoding,t,s,c,u,e.openapi))}let b=Object.entries(i.responses??{}).flatMap(([e,t])=>{let n=h(t,o);return n?[{status:e,response:n}]:[]});b.length&&g.push(X(4,K(`Responses`)));for(let{status:t,response:n}of b){g.push(X(5,K(`Status: ${t}${n.description?` ${n.description}`:``}`))),g.push(...await vs(n.headers,s,c,u,e.openapi),...await xs(n.links,s));for(let[t,r]of Object.entries(n.content??{}))g.push(X(6,K(`Content-Type: ${t}`))),r.schema!==void 0&&g.push(...c.render(r.schema)),g.push(...await _s(r,s,t,`read`,u,e.openapi))}return g},ws=64,Ts=1e5,Es=new Set([`allOf`,`anyOf`,`oneOf`,`not`,`properties`,`required`,`items`,`additionalProperties`,`discriminator`,`minItems`,`maxItems`,`uniqueItems`]),Ds=new Set([`$ref`,`$ref-value`,`$global`,`$status`]),Os=(...e)=>({type:`emphasis`,children:e}),ks=e=>{let t=/^#\/components\/schemas\/([^/]+)$/.exec(e);if(!t)return e;try{return f(t[1])}catch{return e}},As=(e,t)=>{let n=r(e)?e.$ref:void 0;if(typeof n==`string`&&typeof t.schema==`object`&&!Object.keys(e).some(e=>Es.has(e)))return t.allOf?.length||t.anyOf?.length||t.oneOf?.length||t.properties.length||t.not!==void 0||t.items!==void 0||t.additionalProperties!==void 0?ks(n):void 0},js=e=>{let t=h(e),n=h(e,o);return typeof t==`boolean`?!r(n)||!Object.keys(n).some(e=>![`$ref`,`$ref-value`,`$global`,`$status`].includes(e))?t:t?n:{...n,allOf:[!1,...Array.isArray(n.allOf)?n.allOf:[]]}:n},Ms=({maxNodes:e=Ts}={})=>{let t=new WeakMap,n=e=>{let n=typeof e==`object`?t.get(e):void 0;if(n)return n;let r=js(e),i=typeof r==`object`?r:{},a=new Set(i.required??[]),o=Object.entries(i.properties??{}).filter(([,e])=>typeof e==`boolean`||typeof e==`object`&&!!e).sort(([e],[t])=>Number(a.has(t))-Number(a.has(e))||e.localeCompare(t)),s={...i,type:typeof r==`boolean`?r?`any`:`never`:i.type,schema:r,required:a,properties:o};return s.name=As(e,s),typeof e==`object`&&t.set(e,s),s},i=(e,t=!1,n=!1,r=!0)=>{if(typeof e.schema==`boolean`)return[K(e.schema?`any (true schema)`:`never (false schema)`)];let i=Array.isArray(e.type)?e.type.join(` | `):e.type,a=r&&(i||t)?[q(i||`object`)]:[],o=(e,t)=>{t!==void 0&&a.push(K(`${a.length?`, `:``}${e}: `),q(t))};o(`schema`,e.name),o(`format`,e.format),e.enum&&o(`possible values`,e.enum.map(e=>JSON.stringify(e)).join(`, `)),e.const!==void 0&&o(`const`,JSON.stringify(e.const)),e.default!==void 0&&o(`default`,JSON.stringify(e.default));for(let t of[`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minLength`,`maxLength`,`pattern`,`minProperties`,`maxProperties`])o(t,e[t]);for(let t of[`readOnly`,`writeOnly`])e[t]&&a.push(K(`${a.length?`, `:``}${t}`));return!n&&e.description&&a.push(K(`${a.length?` — `:``}${e.description}`)),a},a=(t={})=>{let o=new Map,s=new Set(Object.values(t).map(e=>h(e)??e)),c=0,l=(e,t,n,a,o)=>{let s=[];if(r(e)&&Object.keys(e).some(e=>!Ds.has(e))&&!n.hideDetails){let e=i({...t,name:void 0},!1,n.hideDescription);e.length&&s.push(J(...e))}return s.push(J(Os(K(`Schema `),q(a),K(` is shown ${o}.`)))),s},u=(t,a=0,d=[],f={})=>{let p=h(t)??t;if(typeof p==`object`&&d.includes(p))return[J(Os(K(`[Circular Reference]`)))];let m=n(t),g=r(t)&&`$ref`in t&&Object.keys(t).some(e=>Es.has(e))?t:p,_=typeof g==`object`&&g?g:void 0,v=f.name??m.name;if(_&&v!==void 0){let e=o.get(_);if(e!==void 0){let n=f.name===void 0?f:{...f,hideDetails:!0};return l(t,m,n,e,`above`)}if(m.name!==void 0&&f.name===void 0&&a>=ws&&s.has(_))return l(t,m,f,m.name,`below under Schemas`)}if(a>=ws)return[J(K(`[Maximum schema depth reached]`))];if(c>=e)return[J(Os(K(`[Schema output truncated]`)))];if(c++,_&&v!==void 0&&!o.has(_)&&o.set(_,v),typeof m.schema==`boolean`)return f.hideDetails?[]:[J(...i(m))];let y=[...d,p],b=[];for(let[e,t]of[[`allOf`,`All of:`],[`anyOf`,`Any of:`],[`oneOf`,`One of:`]])m[e]?.length&&b.push(J(Y(K(t))),...m[e].flatMap(e=>u(e,a+1,y)));m.not!==void 0&&b.push(J(Y(K(`Not:`))),...u(m.not,a+1,y));let x=m.type===`array`||m.items!==void 0;if(!f.hideDetails){let e=m.type===`object`&&m.properties.length>0||m.type===`array`&&m.items!==void 0,t=i(m,!1,f.hideDescription,!e);t.length&&b.push(J(...t))}if(m.properties.length){let e=m.properties.map(([e,t])=>{let r=n(t),o=[q(e)];m.required.has(e)&&o.push(K(` (required)`));let s=[J(Y(...o)),J(...i(r,!0))];return s.push(...u(t,a+1,y,{hideDetails:!0,property:!0})),Z(...s)});b.push(Q(e))}x&&m.items!==void 0&&b.push(J(Y(K(f.property?`Items:`:`Array of:`))),...u(m.items,a+1,y));let S=[];if(m.minItems!==void 0&&S.push(Z(J(K(`Min items: `),q(m.minItems)))),m.maxItems!==void 0&&S.push(Z(J(K(`Max items: `),q(m.maxItems)))),m.uniqueItems!==void 0&&S.push(Z(J(K(`Unique items: `),q(m.uniqueItems)))),S.length&&b.push(Q(S)),m.additionalProperties!==void 0&&b.push(J(Y(K(`Additional properties:`))),...u(m.additionalProperties,a+1,y)),m.discriminator){b.push(J(Y(K(`Discriminator:`)),K(` `),q(m.discriminator.propertyName)));let e=Object.entries(m.discriminator.mapping??{});e.length&&b.push(Q(e.map(([e,t])=>Z(J(q(e),K(`: `),q(t))))))}return b};return{view:n,render:u,beginSection:()=>{c=0},forDocument:a}};return a()},Ns=uo().use(Ma).use(Na,{bullet:`-`}).freeze(),Ps=()=>{let e=fs(),t=Ms();return async n=>{let r=e(),i=t.forDocument(n.components?.schemas),{info:a}=n,s=[$(`OpenAPI Version`,q(n.openapi)),$(`API Version`,q(a.version))];if(a.termsOfService&&s.push($(`Terms of service`,So(a.termsOfService,a.termsOfService))),a.contact){let e=[K(a.contact.name??``)];s.push(Z(J(Y(K(`Contact:`)),K(` `),...e,...a.contact.url?[K(` `),So(a.contact.url,a.contact.url)]:[],...a.contact.email?[K(` `),So(`mailto:${a.contact.email}`,a.contact.email)]:[])))}a.license&&s.push($(`License`,a.license.url?So(a.license.url,a.license.name??``):K(a.license.name)));let c=[X(1,K(a.title)),Q(s),...await r(a.description)];if(n.servers?.length){c.push(X(2,K(`Servers`)));let e=n.servers.map(e=>{let t=[];e.description&&t.push($(`Description`,K(e.description)));let n=Object.entries(e.variables??{});n.length&&t.push(Z(J(Y(K(`Variables:`))),Q(n.map(([e,t])=>Z(J(q(e),K(` (default: `),q(t.default),K(`)${t.description?`: ${t.description}`:``}`)))))));let r=$(`URL`,q(e.url));return t.length&&r.children.push(Q(t)),r});c.push(Q(e))}if(c.push(...await Ss(n.security,n.components?.securitySchemes,r)),n.tags?.length){c.push(X(2,K(`Tags`)));for(let e of n.tags)c.push(X(3,K(e.name)),...await r(e.description)),e.externalDocs&&c.push(J(So(e.externalDocs.url,e.externalDocs.description??e.externalDocs.url)))}let l=[],d=()=>{if(c.length){let e={type:`root`,children:c.splice(0)};l.push(Ns.stringify(e).trimEnd())}};d();for(let e of[{title:`Operations`,paths:n.paths,webhook:!1},{title:`Webhooks`,paths:n.webhooks,webhook:!0}]){let t=!1;for(let[a,s]of Object.entries(e.paths??{})){let l=p(s);if(!l)continue;let f=[];u(s,(e,t)=>{f.push({method:e,operation:h(t,o)})});for(let{method:o,operation:s}of f)t||=(c.push(X(2,K(e.title))),!0),i.beginSection(),c.push(...await Cs(n,a,o,l,s,e.webhook,{description:r,schemas:i})),d()}}let f=Object.entries(n.components?.schemas??{});f.length&&c.push(X(2,K(`Schemas`)));for(let[e,t]of f){i.beginSection();let a=i.view(t);c.push(X(3,K(a.title??e)),Q([a.type?$(`Type`,q(Array.isArray(a.type)?a.type.join(` | `):a.type)):Z(J(Y(K(`Type:`))))]),...await r(a.description),...i.render(t,0,[],{hideDescription:!0,name:e})),a.type===`object`&&c.push(...await _s({schema:t},r,`application/json`,void 0,n[`x-original-oas-version`]??n.openapi)),d()}return d(),`${l.join(`
39
39
 
40
40
  `)}\n`}},Fs=new Set(g),Is=e=>{let t=e.toLowerCase();return Fs.has(t)?t:null},Ls=e=>{if(/~(?![01])/.test(e))throw Error(`Invalid JSON pointer escape in "${e}"`);if(e.startsWith(`#/`))return e.slice(1);if(e.startsWith(`/`))return e;throw Error(`Invalid JSON pointer "${e}". JSON pointers must start with "#/"`)},Rs=e=>Ls(e).slice(1).split(`/`).map(e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)),zs=e=>{let t=Rs(e);if(t[0]!==`paths`||!(t.length===3||t.length===4&&t[2]===`additionalOperations`))throw Error(`JSON pointer "${e}" must target an operation object under "/paths/{path}/{method}"`);let n=t[1],r=t.length===4?t[3]:t[2];if(!n||!r||(t.length===3?!Fs.has(r):Fs.has(r)))throw Error(`JSON pointer "${e}" must target an operation object under "/paths/{path}/{method}"`);return{path:n,method:r}},Bs=e=>{let t=e.paths;return r(t)?Object.entries(t).flatMap(([e,t])=>{let n=p(t);return n?[[e,n]]:[]}):[]},Vs=(e,t)=>{let n=Object.fromEntries(Object.entries(e).filter(([e])=>!Fs.has(e)&&e!==`additionalOperations`));return u(e,(e,r)=>{t.includes(e)&&c(n,e,r)}),n},Hs=(e,t)=>l(e,t)?t:Is(t),Us=(e,t)=>{let n=Hs(p(e.paths?.[t.path]),t.method);if(!n)throw Error(`Invalid HTTP method "${t.method}". Supported methods: ${g.join(`, `)}`);let r=e.paths?.[t.path];if(!l(r,n))throw Error(`Operation not found for path "${t.path}" and method "${n.toUpperCase()}"`);return{path:t.path,method:n}},Ws=(e,t)=>Bs(e).flatMap(([e,n])=>{let r=[];return u(n,(n,i)=>{h(i)?.operationId===t&&r.push({path:e,method:n})}),r}),Gs=(e,t)=>{if(`pointer`in t){let n=zs(t.pointer);if(!l(e.paths?.[n.path],n.method))throw Error(`Operation not found at JSON pointer "${t.pointer}"`);return n}if(`operationId`in t){let n=Ws(e,t.operationId);if(!n.length)throw Error(`Operation with operationId "${t.operationId}" was not found`);if(n.length>1){let e=n.map(({path:e,method:t})=>`"${t.toUpperCase()} ${e}"`);throw Error(`Multiple operations found for operationId "${t.operationId}". Use { path, method } instead. Matches: ${e.join(`, `)}`)}return n[0]}return Us(e,t)},Ks=(e,t)=>{let n=Gs(e,t),r=Bs(e).find(([e])=>e===n.path)?.[1];if(!r)throw Error(`Operation not found for path "${n.path}" and method "${n.method.toUpperCase()}"`);return{...e,paths:{[n.path]:Vs(r,[n.method])}}},qs=(e,t={})=>{if(!r(t))throw Error(`Render options must be an object`);let n=Object.keys(t).filter(e=>t[e]!==void 0);if(!n.length)return e;if(n.length!==1||![`operation`,`tag`,`model`,`webhook`,`introduction`].includes(n[0]))throw Error(`Specify exactly one of operation, tag, model, webhook, or introduction`);if(t.introduction!==void 0&&t.introduction!==!0)throw Error(`Introduction selector must be true`);for(let e of[`tag`,`model`])if(t[e]!==void 0&&(typeof t[e]!=`string`||!t[e].length))throw Error(`${e} selector must be a non-empty string`);if(t.operation!==void 0){let e=t.operation;if(!r(e)||!(Object.keys(e).length===1&&(`operationId`in e?typeof e.operationId==`string`&&e.operationId.length:`pointer`in e&&typeof e.pointer==`string`&&e.pointer.length)||Object.keys(e).length===2&&`path`in e&&typeof e.path==`string`&&`method`in e&&typeof e.method==`string`))throw Error(`Invalid operation selector. Use { path, method }, { operationId }, or { pointer }`)}let i={...e,paths:{},webhooks:{},tags:[]},a=[];if(t.operation&&(i.paths=Ks(e,t.operation).paths),t.tag!==void 0){let n=e.tags?.filter(e=>e.name===t.tag)??[];if(n.length>1)throw Error(`Multiple tags found for "${t.tag}"`);i.tags=n.length?n:[{name:t.tag}];for(let[n,r]of Bs(e)){let e=[];u(r,(n,r)=>{h(r)?.tags?.includes(t.tag)&&e.push(n)}),e.length&&(i.paths[n]=Vs(r,e))}if(!n.length&&!Object.keys(i.paths??{}).length)throw Error(`Tag "${t.tag}" was not found`)}if(t.model!==void 0){let n=e.components?.schemas?.[t.model];if(n===void 0||!Object.hasOwn(e.components?.schemas??{},t.model))throw Error(`Model "${t.model}" was not found`);a.push(n)}if(t.webhook!==void 0){let n=t.webhook;if(!r(n)||typeof n.name!=`string`||!n.name||typeof n.method!=`string`||Object.keys(n).length!==2)throw Error(`Invalid webhook selector. Use { name, method }`);let a=p(e.webhooks?.[n.name]),o=Hs(a,n.method);if(!o)throw Error(`Invalid HTTP method "${n.method}"`);if(!a||!l(a,o))throw Error(`Webhook "${n.name}" with method "${o.toUpperCase()}" was not found`);i.webhooks={[n.name]:Vs(a,[o])}}let o=new Set,s=new Set;for(let n of[i.paths,i.webhooks])for(let[r,i]of Object.entries(n??{})){let a=p(i),l={...a,additionalOperations:a.additionalOperations?{...a.additionalOperations}:void 0,parameters:void 0,servers:void 0};u(a,(n,r)=>{let i=h(r);if(!i)return;let u=new Map;for(let e of[...a.parameters??[],...i.parameters??[]]){let t=h(e);t&&u.set(`${t.in}:${t.name}`,e)}let d=i.security??e.security??[];for(let e of d)for(let t of Object.keys(e))o.add(t);for(let e of i.tags??[])s.add(e);c(l,n,{...i,parameters:[...u.values()],servers:i.servers??a.servers??e.servers,security:d,tags:t.tag===void 0?i.tags:[t.tag]})}),n[r]=l}if((t.operation||t.webhook)&&(i.tags=e.tags?.filter(e=>s.has(e.name))??[]),t.introduction)for(let t of e.security??[])for(let e of Object.keys(t))o.add(e);else i.servers=[],i.security=void 0;let d=e.components?.schemas??{},f=new Set(t.model===void 0?[]:[t.model]),m=new WeakSet,g=new Set,_=new Set([`example`,`examples`,`default`,`enum`,`const`,`value`,`dataValue`]),v=new Set([`paths`,`webhooks`,`responses`,`content`,`headers`,`links`,`encoding`,`variables`,`parameters`,`requestBodies`,`securitySchemes`,`pathItems`,`callbacks`,`mediaTypes`,`additionalOperations`,`schemas`,`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`]),y=(e,t=0)=>{if(e&&typeof e==`object`&&!m.has(e)){if(m.add(e),!t&&`$ref`in e&&typeof e.$ref==`string`){let n=e.$ref;if(!g.has(n)){if(g.add(n),n.startsWith(`#/components/schemas/`)){let e=Rs(n)[2];Object.hasOwn(d,e)&&(f.add(e),y(d[e]))}y(h(e),t)}}for(let[n,r]of Object.entries(e))if(n!==`$ref-value`&&(t||!_.has(n)&&!n.startsWith(`x-`))){let e=t?t-1:n===`callbacks`?2:+!!v.has(n);y(r,e)}}};y({paths:i.paths,webhooks:i.webhooks});for(let e of a)y(e);return i.components={...e.components,schemas:Object.fromEntries(Object.entries(d).filter(([e])=>f.has(e))),securitySchemes:Object.fromEntries(Object.entries(e.components?.securitySchemes??{}).filter(([e])=>o.has(e)))},i},Js=async(e,t)=>await Ps()(qs(e,t));export{Tt as a,M as c,Js as createMarkdownFromOpenApi,Qt as i,v as l,no as n,Ct as o,W as r,ae as s,uo as t};