UNPKG

@asafarim/simple-md-viewer

Version:

A professional markdown viewer with file tree navigation, directory content browsing, and advanced YAML front matter support

37 lines (34 loc) 889 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),zt=require("react-router-dom");var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nl={exports:{}},Jt={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yu;function _y(){if(Yu)return Jt;Yu=1;var e=ne,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(s,l,u){var d,c={},f=null,p=null;u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(c[d]=l[d]);if(s&&s.defaultProps)for(d in l=s.defaultProps,l)c[d]===void 0&&(c[d]=l[d]);return{$$typeof:t,type:s,key:f,ref:p,props:c,_owner:a.current}}return Jt.Fragment=n,Jt.jsx=o,Jt.jsxs=o,Jt}var en={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ku;function Iy(){return Ku||(Ku=1,process.env.NODE_ENV!=="production"&&function(){var e=ne,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,g="@@iterator";function E(k){if(k===null||typeof k!="object")return null;var P=h&&k[h]||k[g];return typeof P=="function"?P:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(k){{for(var P=arguments.length,H=new Array(P>1?P-1:0),se=1;se<P;se++)H[se-1]=arguments[se];y("error",k,H)}}function y(k,P,H){{var se=T.ReactDebugCurrentFrame,be=se.getStackAddendum();be!==""&&(P+="%s",H=H.concat([be]));var Ae=H.map(function(fe){return String(fe)});Ae.unshift("Warning: "+P),Function.prototype.apply.call(console[k],console,Ae)}}var R=!1,w=!1,v=!1,x=!1,C=!1,N;N=Symbol.for("react.module.reference");function _(k){return!!(typeof k=="string"||typeof k=="function"||k===r||k===i||C||k===a||k===u||k===d||x||k===p||R||w||v||typeof k=="object"&&k!==null&&(k.$$typeof===f||k.$$typeof===c||k.$$typeof===o||k.$$typeof===s||k.$$typeof===l||k.$$typeof===N||k.getModuleId!==void 0))}function O(k,P,H){var se=k.displayName;if(se)return se;var be=P.displayName||P.name||"";return be!==""?H+"("+be+")":H}function F(k){return k.displayName||"Context"}function G(k){if(k==null)return null;if(typeof k.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case s:var P=k;return F(P)+".Consumer";case o:var H=k;return F(H._context)+".Provider";case l:return O(k,k.render,"ForwardRef");case c:var se=k.displayName||null;return se!==null?se:G(k.type)||"Memo";case f:{var be=k,Ae=be._payload,fe=be._init;try{return G(fe(Ae))}catch{return null}}}return null}var W=Object.assign,j=0,Z,re,K,te,m,D,B;function b(){}b.__reactDisabledLog=!0;function M(){{if(j===0){Z=console.log,re=console.info,K=console.warn,te=console.error,m=console.group,D=console.groupCollapsed,B=console.groupEnd;var k={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:k,log:k,warn:k,error:k,group:k,groupCollapsed:k,groupEnd:k})}j++}}function V(){{if(j--,j===0){var k={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},k,{value:Z}),info:W({},k,{value:re}),warn:W({},k,{value:K}),error:W({},k,{value:te}),group:W({},k,{value:m}),groupCollapsed:W({},k,{value:D}),groupEnd:W({},k,{value:B})})}j<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=T.ReactCurrentDispatcher,Y;function J(k,P,H){{if(Y===void 0)try{throw Error()}catch(be){var se=be.stack.trim().match(/\n( *(at )?)/);Y=se&&se[1]||""}return` `+Y+k}}var oe=!1,ae;{var Te=typeof WeakMap=="function"?WeakMap:Map;ae=new Te}function z(k,P){if(!k||oe)return"";{var H=ae.get(k);if(H!==void 0)return H}var se;oe=!0;var be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ae;Ae=q.current,q.current=null,M();try{if(P){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(Ge){se=Ge}Reflect.construct(k,[],fe)}else{try{fe.call()}catch(Ge){se=Ge}k.call(fe.prototype)}}else{try{throw Error()}catch(Ge){se=Ge}k()}}catch(Ge){if(Ge&&se&&typeof Ge.stack=="string"){for(var pe=Ge.stack.split(` `),Ue=se.stack.split(` `),Ie=pe.length-1,xe=Ue.length-1;Ie>=1&&xe>=0&&pe[Ie]!==Ue[xe];)xe--;for(;Ie>=1&&xe>=0;Ie--,xe--)if(pe[Ie]!==Ue[xe]){if(Ie!==1||xe!==1)do if(Ie--,xe--,xe<0||pe[Ie]!==Ue[xe]){var Je=` `+pe[Ie].replace(" at new "," at ");return k.displayName&&Je.includes("<anonymous>")&&(Je=Je.replace("<anonymous>",k.displayName)),typeof k=="function"&&ae.set(k,Je),Je}while(Ie>=1&&xe>=0);break}}}finally{oe=!1,q.current=Ae,V(),Error.prepareStackTrace=be}var Dt=k?k.displayName||k.name:"",At=Dt?J(Dt):"";return typeof k=="function"&&ae.set(k,At),At}function Ce(k,P,H){return z(k,!1)}function X(k){var P=k.prototype;return!!(P&&P.isReactComponent)}function We(k,P,H){if(k==null)return"";if(typeof k=="function")return z(k,X(k));if(typeof k=="string")return J(k);switch(k){case u:return J("Suspense");case d:return J("SuspenseList")}if(typeof k=="object")switch(k.$$typeof){case l:return Ce(k.render);case c:return We(k.type,P,H);case f:{var se=k,be=se._payload,Ae=se._init;try{return We(Ae(be),P,H)}catch{}}}return""}var Ye=Object.prototype.hasOwnProperty,gt={},Xt=T.ReactDebugCurrentFrame;function Ot(k){if(k){var P=k._owner,H=We(k.type,k._source,P?P.type:null);Xt.setExtraStackFrame(H)}else Xt.setExtraStackFrame(null)}function yn(k,P,H,se,be){{var Ae=Function.call.bind(Ye);for(var fe in k)if(Ae(k,fe)){var pe=void 0;try{if(typeof k[fe]!="function"){var Ue=Error((se||"React class")+": "+H+" type `"+fe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof k[fe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ue.name="Invariant Violation",Ue}pe=k[fe](P,fe,se,H,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ie){pe=Ie}pe&&!(pe instanceof Error)&&(Ot(be),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",se||"React class",H,fe,typeof pe),Ot(null)),pe instanceof Error&&!(pe.message in gt)&&(gt[pe.message]=!0,Ot(be),S("Failed %s type: %s",H,pe.message),Ot(null))}}}var Sn=Array.isArray;function Zt(k){return Sn(k)}function Qn(k){{var P=typeof Symbol=="function"&&Symbol.toStringTag,H=P&&k[Symbol.toStringTag]||k.constructor.name||"Object";return H}}function Jn(k){try{return vn(k),!1}catch{return!0}}function vn(k){return""+k}function Tn(k){if(Jn(k))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qn(k)),vn(k)}var L=T.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0},ie,me,he;he={};function Ke(k){if(Ye.call(k,"ref")){var P=Object.getOwnPropertyDescriptor(k,"ref").get;if(P&&P.isReactWarning)return!1}return k.ref!==void 0}function st(k){if(Ye.call(k,"key")){var P=Object.getOwnPropertyDescriptor(k,"key").get;if(P&&P.isReactWarning)return!1}return k.key!==void 0}function it(k,P){if(typeof k.ref=="string"&&L.current&&P&&L.current.stateNode!==P){var H=G(L.current.type);he[H]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',G(L.current.type),k.ref),he[H]=!0)}}function vt(k,P){{var H=function(){ie||(ie=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",P))};H.isReactWarning=!0,Object.defineProperty(k,"key",{get:H,configurable:!0})}}function Tt(k,P){{var H=function(){me||(me=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",P))};H.isReactWarning=!0,Object.defineProperty(k,"ref",{get:H,configurable:!0})}}var _e=function(k,P,H,se,be,Ae,fe){var pe={$$typeof:t,type:k,key:P,ref:H,props:fe,_owner:Ae};return pe._store={},Object.defineProperty(pe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(pe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:se}),Object.defineProperty(pe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.freeze&&(Object.freeze(pe.props),Object.freeze(pe)),pe};function Qt(k,P,H,se,be){{var Ae,fe={},pe=null,Ue=null;H!==void 0&&(Tn(H),pe=""+H),st(P)&&(Tn(P.key),pe=""+P.key),Ke(P)&&(Ue=P.ref,it(P,be));for(Ae in P)Ye.call(P,Ae)&&!$.hasOwnProperty(Ae)&&(fe[Ae]=P[Ae]);if(k&&k.defaultProps){var Ie=k.defaultProps;for(Ae in Ie)fe[Ae]===void 0&&(fe[Ae]=Ie[Ae])}if(pe||Ue){var xe=typeof k=="function"?k.displayName||k.name||"Unknown":k;pe&&vt(fe,xe),Ue&&Tt(fe,xe)}return _e(k,pe,Ue,be,se,L.current,fe)}}var Xe=T.ReactCurrentOwner,qu=T.ReactDebugCurrentFrame;function Lt(k){if(k){var P=k._owner,H=We(k.type,k._source,P?P.type:null);qu.setExtraStackFrame(H)}else qu.setExtraStackFrame(null)}var er;er=!1;function tr(k){return typeof k=="object"&&k!==null&&k.$$typeof===t}function Gu(){{if(Xe.current){var k=G(Xe.current.type);if(k)return` Check the render method of \``+k+"`."}return""}}function by(k){{if(k!==void 0){var P=k.fileName.replace(/^.*[\\\/]/,""),H=k.lineNumber;return` Check your code at `+P+":"+H+"."}return""}}var zu={};function Ey(k){{var P=Gu();if(!P){var H=typeof k=="string"?k:k.displayName||k.name;H&&(P=` Check the top-level render call using <`+H+">.")}return P}}function ju(k,P){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var H=Ey(P);if(zu[H])return;zu[H]=!0;var se="";k&&k._owner&&k._owner!==Xe.current&&(se=" It was passed a child from "+G(k._owner.type)+"."),Lt(k),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',H,se),Lt(null)}}function Hu(k,P){{if(typeof k!="object")return;if(Zt(k))for(var H=0;H<k.length;H++){var se=k[H];tr(se)&&ju(se,P)}else if(tr(k))k._store&&(k._store.validated=!0);else if(k){var be=E(k);if(typeof be=="function"&&be!==k.entries)for(var Ae=be.call(k),fe;!(fe=Ae.next()).done;)tr(fe.value)&&ju(fe.value,P)}}}function yy(k){{var P=k.type;if(P==null||typeof P=="string")return;var H;if(typeof P=="function")H=P.propTypes;else if(typeof P=="object"&&(P.$$typeof===l||P.$$typeof===c))H=P.propTypes;else return;if(H){var se=G(P);yn(H,k.props,"prop",se,k)}else if(P.PropTypes!==void 0&&!er){er=!0;var be=G(P);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",be||"Unknown")}typeof P.getDefaultProps=="function"&&!P.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Sy(k){{for(var P=Object.keys(k.props),H=0;H<P.length;H++){var se=P[H];if(se!=="children"&&se!=="key"){Lt(k),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",se),Lt(null);break}}k.ref!==null&&(Lt(k),S("Invalid attribute `ref` supplied to `React.Fragment`."),Lt(null))}}var Vu={};function Wu(k,P,H,se,be,Ae){{var fe=_(k);if(!fe){var pe="";(k===void 0||typeof k=="object"&&k!==null&&Object.keys(k).length===0)&&(pe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ue=by(be);Ue?pe+=Ue:pe+=Gu();var Ie;k===null?Ie="null":Zt(k)?Ie="array":k!==void 0&&k.$$typeof===t?(Ie="<"+(G(k.type)||"Unknown")+" />",pe=" Did you accidentally export a JSX literal instead of a component?"):Ie=typeof k,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ie,pe)}var xe=Qt(k,P,H,be,Ae);if(xe==null)return xe;if(fe){var Je=P.children;if(Je!==void 0)if(se)if(Zt(Je)){for(var Dt=0;Dt<Je.length;Dt++)Hu(Je[Dt],k);Object.freeze&&Object.freeze(Je)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Hu(Je,k)}if(Ye.call(P,"key")){var At=G(k),Ge=Object.keys(P).filter(function(Ry){return Ry!=="key"}),nr=Ge.length>0?"{key: someKey, "+Ge.join(": ..., ")+": ...}":"{key: someKey}";if(!Vu[At+nr]){var ky=Ge.length>0?"{"+Ge.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,nr,At,ky,At),Vu[At+nr]=!0}}return k===r?Sy(xe):yy(xe),xe}}function vy(k,P,H){return Wu(k,P,H,!0)}function Ty(k,P,H){return Wu(k,P,H,!1)}var Ay=Ty,wy=vy;en.Fragment=r,en.jsx=Ay,en.jsxs=wy}()),en}process.env.NODE_ENV==="production"?Nl.exports=_y():Nl.exports=Iy();var I=Nl.exports;const Xu=["http","https","mailto","tel"];function Cy(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let a=-1;for(;++a<Xu.length;){const i=Xu[a];if(r===i.length&&t.slice(0,i.length).toLowerCase()===i)return t}return a=t.indexOf("?"),a!==-1&&r>a||(a=t.indexOf("#"),a!==-1&&r>a)?t:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */var xy=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const $h=Vt(xy);function sn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zu(e.position):"start"in e||"end"in e?Zu(e):"line"in e||"column"in e?Ol(e):""}function Ol(e){return Qu(e&&e.line)+":"+Qu(e&&e.column)}function Zu(e){return Ol(e&&e.start)+"-"+Ol(e&&e.end)}function Qu(e){return e&&typeof e=="number"?e:1}class nt extends Error{constructor(t,n,r){const a=[null,null];let i={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?a[1]=r:(a[0]=r.slice(0,o),a[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(i=n.position):"start"in n||"end"in n?i=n:("line"in n||"column"in n)&&(i.start=n)),this.name=sn(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=i.start.line,this.column=i.start.column,this.position=i,this.source=a[0],this.ruleId=a[1],this.file,this.actual,this.expected,this.url,this.note}}nt.prototype.file="";nt.prototype.name="";nt.prototype.reason="";nt.prototype.message="";nt.prototype.stack="";nt.prototype.fatal=null;nt.prototype.column=null;nt.prototype.line=null;nt.prototype.source=null;nt.prototype.ruleId=null;nt.prototype.position=null;const lt={basename:Ny,dirname:Oy,extname:Ly,join:Dy,sep:"/"};function Ny(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gn(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.charCodeAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;a--;)if(e.charCodeAt(a)===47){if(i){n=a+1;break}}else o<0&&(i=!0,o=a+1),s>-1&&(e.charCodeAt(a)===t.charCodeAt(s--)?s<0&&(r=a):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Oy(e){if(gn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Ly(e){gn(e);let t=e.length,n=-1,r=0,a=-1,i=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function Dy(...e){let t=-1,n;for(;++t<e.length;)gn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Fy(n)}function Fy(e){gn(e);const t=e.charCodeAt(0)===47;let n=My(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function My(e,t){let n="",r=0,a=-1,i=0,o=-1,s,l;for(;++o<=e.length;){if(o<e.length)s=e.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(a===o-1||i===1))if(a!==o-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=o,i=0;continue}}else if(n.length>0){n="",r=0,a=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),r=o-a-1;a=o,i=0}else s===46&&i>-1?i++:i=-1}return n}function gn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Py={cwd:Uy};function Uy(){return"/"}function Ll(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function By(e){if(typeof e=="string")e=new URL(e);else if(!Ll(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return $y(e)}function $y(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.charCodeAt(n)===37&&t.charCodeAt(n+1)===50){const r=t.charCodeAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const rr=["history","path","basename","stem","extname","dirname"];class qh{constructor(t){let n;t?typeof t=="string"||qy(t)?n={value:t}:Ll(t)?n={path:t}:n=t:n={},this.data={},this.messages=[],this.history=[],this.cwd=Py.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++r<rr.length;){const i=rr[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)rr.includes(a)||(this[a]=n[a])}get path(){return this.history[this.history.length-1]}set path(t){Ll(t)&&(t=By(t)),ir(t,"path"),this.path!==t&&this.history.push(t)}get dirname(){return typeof this.path=="string"?lt.dirname(this.path):void 0}set dirname(t){Ju(this.basename,"dirname"),this.path=lt.join(t||"",this.basename)}get basename(){return typeof this.path=="string"?lt.basename(this.path):void 0}set basename(t){ir(t,"basename"),ar(t,"basename"),this.path=lt.join(this.dirname||"",t)}get extname(){return typeof this.path=="string"?lt.extname(this.path):void 0}set extname(t){if(ar(t,"extname"),Ju(this.dirname,"extname"),t){if(t.charCodeAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=lt.join(this.dirname,this.stem+(t||""))}get stem(){return typeof this.path=="string"?lt.basename(this.path,this.extname):void 0}set stem(t){ir(t,"stem"),ar(t,"stem"),this.path=lt.join(this.dirname||"",t+(this.extname||""))}toString(t){return(this.value||"").toString(t||void 0)}message(t,n,r){const a=new nt(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=null,a}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}}function ar(e,t){if(e&&e.includes(lt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+lt.sep+"`")}function ir(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ju(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qy(e){return $h(e)}function ec(e){if(e)throw e}var Cn=Object.prototype.hasOwnProperty,Gh=Object.prototype.toString,tc=Object.defineProperty,nc=Object.getOwnPropertyDescriptor,rc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Gh.call(t)==="[object Array]"},ac=function(t){if(!t||Gh.call(t)!=="[object Object]")return!1;var n=Cn.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Cn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||Cn.call(t,a)},ic=function(t,n){tc&&n.name==="__proto__"?tc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},oc=function(t,n){if(n==="__proto__")if(Cn.call(t,n)){if(nc)return nc(t,n).value}else return;return t[n]},Gy=function e(){var t,n,r,a,i,o,s=arguments[0],l=1,u=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=oc(s,n),a=oc(t,n),s!==a&&(d&&a&&(ac(a)||(i=rc(a)))?(i?(i=!1,o=r&&rc(r)?r:[]):o=r&&ac(r)?r:{},ic(s,{name:n,newValue:e(d,o,a)})):typeof a<"u"&&ic(s,{name:n,newValue:a}));return s};const sc=Vt(Gy);function Dl(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zy(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...a);function s(l,...u){const d=e[++i];let c=-1;if(l){o(l);return}for(;++c<a.length;)(u[c]===null||u[c]===void 0)&&(u[c]=a[c]);a=u,d?jy(d,s)(...u):o(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function jy(e,t){let n;return r;function r(...o){const s=e.length>o.length;let l;s&&o.push(a);try{l=e.apply(this,o)}catch(u){const d=u;if(s&&n)throw d;return a(d)}s||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(o,...s){n||(n=!0,t(o,...s))}function i(o){a(null,o)}}const Hy=jh().freeze(),zh={}.hasOwnProperty;function jh(){const e=zy(),t=[];let n={},r,a=-1;return i.data=o,i.Parser=void 0,i.Compiler=void 0,i.freeze=s,i.attachers=t,i.use=l,i.parse=u,i.stringify=d,i.run=c,i.runSync=f,i.process=p,i.processSync=h,i;function i(){const g=jh();let E=-1;for(;++E<t.length;)g.use(...t[E]);return g.data(sc(!0,{},n)),g}function o(g,E){return typeof g=="string"?arguments.length===2?(lr("data",r),n[g]=E,i):zh.call(n,g)&&n[g]||null:g?(lr("data",r),n=g,i):n}function s(){if(r)return i;for(;++a<t.length;){const[g,...E]=t[a];if(E[0]===!1)continue;E[0]===!0&&(E[0]=void 0);const T=g.call(i,...E);typeof T=="function"&&e.use(T)}return r=!0,a=Number.POSITIVE_INFINITY,i}function l(g,...E){let T;if(lr("use",r),g!=null)if(typeof g=="function")w(g,...E);else if(typeof g=="object")Array.isArray(g)?R(g):y(g);else throw new TypeError("Expected usable value, not `"+g+"`");return T&&(n.settings=Object.assign(n.settings||{},T)),i;function S(v){if(typeof v=="function")w(v);else if(typeof v=="object")if(Array.isArray(v)){const[x,...C]=v;w(x,...C)}else y(v);else throw new TypeError("Expected usable value, not `"+v+"`")}function y(v){R(v.plugins),v.settings&&(T=Object.assign(T||{},v.settings))}function R(v){let x=-1;if(v!=null)if(Array.isArray(v))for(;++x<v.length;){const C=v[x];S(C)}else throw new TypeError("Expected a list of plugins, not `"+v+"`")}function w(v,x){let C=-1,N;for(;++C<t.length;)if(t[C][0]===v){N=t[C];break}N?(Dl(N[1])&&Dl(x)&&(x=sc(!0,N[1],x)),N[1]=x):t.push([...arguments])}}function u(g){i.freeze();const E=tn(g),T=i.Parser;return or("parse",T),lc(T,"parse")?new T(String(E),E).parse():T(String(E),E)}function d(g,E){i.freeze();const T=tn(E),S=i.Compiler;return sr("stringify",S),uc(g),lc(S,"compile")?new S(g,T).compile():S(g,T)}function c(g,E,T){if(uc(g),i.freeze(),!T&&typeof E=="function"&&(T=E,E=void 0),!T)return new Promise(S);S(null,T);function S(y,R){e.run(g,tn(E),w);function w(v,x,C){x=x||g,v?R(v):y?y(x):T(null,x,C)}}}function f(g,E){let T,S;return i.run(g,E,y),cc("runSync","run",S),T;function y(R,w){ec(R),T=w,S=!0}}function p(g,E){if(i.freeze(),or("process",i.Parser),sr("process",i.Compiler),!E)return new Promise(T);T(null,E);function T(S,y){const R=tn(g);i.run(i.parse(R),R,(v,x,C)=>{if(v||!x||!C)w(v);else{const N=i.stringify(x,C);N==null||(Yy(N)?C.value=N:C.result=N),w(v,C)}});function w(v,x){v||!x?y(v):S?S(x):E(null,x)}}}function h(g){let E;i.freeze(),or("processSync",i.Parser),sr("processSync",i.Compiler);const T=tn(g);return i.process(T,S),cc("processSync","process",E),T;function S(y){E=!0,ec(y)}}}function lc(e,t){return typeof e=="function"&&e.prototype&&(Vy(e.prototype)||t in e.prototype)}function Vy(e){let t;for(t in e)if(zh.call(e,t))return!0;return!1}function or(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function sr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function lr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uc(e){if(!Dl(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tn(e){return Wy(e)?e:new qh(e)}function Wy(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Yy(e){return typeof e=="string"||$h(e)}const Ky={};function Xy(e,t){const n=t||Ky,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hh(e,r,a)}function Hh(e,t,n){if(Zy(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dc(e.children,t,n)}return Array.isArray(e)?dc(e,t,n):""}function dc(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Hh(e[a],t,n);return r.join("")}function Zy(e){return!!(e&&typeof e=="object")}function Qe(e,t,n,r){const a=e.length;let i=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a: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);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function tt(e,t){return e.length>0?(Qe(e,e.length,0,t),e):t}const pc={}.hasOwnProperty;function Vh(e){const t={};let n=-1;for(;++n<e.length;)Qy(t,e[n]);return t}function Qy(e,t){let n;for(n in t){const a=(pc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){pc.call(a,o)||(a[o]=[]);const s=i[o];Jy(a[o],Array.isArray(s)?s:s?[s]:[])}}}function Jy(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Qe(e,0,0,r)}const eS=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,$e=yt(/[A-Za-z]/),Me=yt(/[\dA-Za-z]/),tS=yt(/[#-'*+\--9=?A-Z^-~]/);function Ln(e){return e!==null&&(e<32||e===127)}const Fl=yt(/\d/),nS=yt(/[\dA-Fa-f]/),rS=yt(/[!-/:-@[-`{-~]/);function ee(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const qn=yt(eS),It=yt(/\s/);function yt(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function ge(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return de(l)?(e.enter(n),s(l)):t(l)}function s(l){return de(l)&&i++<a?(e.consume(l),s):(e.exit(n),t(l))}}const aS={tokenize:iS};function iS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ge(e,t,"linePrefix")}function a(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ee(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),o)}}const oS={tokenize:sS},fc={tokenize:lS};function sS(e){const t=this,n=[];let r=0,a,i,o;return s;function s(y){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,u)(y)}return u(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&S();const R=t.events.length;let w=R,v;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){v=t.events[w][1].end;break}T(r);let x=R;for(;x<t.events.length;)t.events[x][1].end=Object.assign({},v),x++;return Qe(t.events,w+1,0,t.events.slice(R)),t.events.length=x,u(y)}return s(y)}function u(y){if(r===n.length){if(!a)return f(y);if(a.currentConstruct&&a.currentConstruct.concrete)return h(y);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fc,d,c)(y)}function d(y){return a&&S(),T(r),f(y)}function c(y){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(y)}function f(y){return t.containerState={},e.attempt(fc,p,h)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function h(y){if(y===null){a&&S(),T(0),e.consume(y);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),g(y)}function g(y){if(y===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(y);return}return ee(y)?(e.consume(y),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(y),g)}function E(y,R){const w=t.sliceStream(y);if(R&&w.push(null),y.previous=i,i&&(i.next=y),i=y,a.defineSkip(y.start),a.write(w),t.parser.lazy[y.start.line]){let v=a.events.length;for(;v--;)if(a.events[v][1].start.offset<o&&(!a.events[v][1].end||a.events[v][1].end.offset>o))return;const x=t.events.length;let C=x,N,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(N){_=t.events[C][1].end;break}N=!0}for(T(r),v=x;v<t.events.length;)t.events[v][1].end=Object.assign({},_),v++;Qe(t.events,C+1,0,t.events.slice(x)),t.events.length=v}}function T(y){let R=n.length;for(;R-- >y;){const w=n[R];t.containerState=w[1],w[0].exit.call(t,e)}n.length=y}function S(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function lS(e,t,n){return ge(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Dn(e){if(e===null||we(e)||It(e))return 1;if(qn(e))return 2}function Gn(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ml={name:"attention",tokenize:cS,resolveAll:uS};function uS(e,t){let n=-1,r,a,i,o,s,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);gc(c,-l),gc(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:c,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=tt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=tt(u,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",i,t]]),u=tt(u,Gn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=tt(u,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=tt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Qe(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Dn(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const u=e.exit("attentionSequence"),d=Dn(l),c=!d||d===2&&a||n.includes(l),f=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?c:c&&(a||!f)),u._close=!!(i===42?f:f&&(d||!c)),t(l)}}function gc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dS={name:"autolink",tokenize:pS};function pS(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return $e(p)?(e.consume(p),o):u(p)}function o(p){return p===43||p===45||p===46||Me(p)?(r=1,s(p)):u(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Me(p))&&r++<32?(e.consume(p),s):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ln(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):tS(p)?(e.consume(p),u):n(p)}function d(p){return Me(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Me(p))&&r++<63){const h=p===45?f:c;return e.consume(p),h}return n(p)}}const mn={tokenize:fS,partial:!0};function fS(e,t,n){return r;function r(i){return de(i)?ge(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ee(i)?t(i):n(i)}}const Wh={name:"blockQuote",tokenize:gS,continuation:{tokenize:mS},exit:hS};function gS(e,t,n){const r=this;return a;function a(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return de(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function mS(e,t,n){const r=this;return a;function a(o){return de(o)?ge(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Wh,t,n)(o)}}function hS(e){e.exit("blockQuote")}const Yh={name:"characterEscape",tokenize:bS};function bS(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return rS(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const mc=document.createElement("i");function eu(e){const t="&"+e+";";mc.innerHTML=t;const n=mc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}const Kh={name:"characterReference",tokenize:ES};function ES(e,t,n){const r=this;let a=0,i,o;return s;function s(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,o=Me,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=nS,d):(e.enter("characterReferenceValue"),i=7,o=Fl,d(c))}function d(c){if(c===59&&a){const f=e.exit("characterReferenceValue");return o===Me&&!eu(r.sliceSerialize(f))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(c)&&a++<i?(e.consume(c),d):n(c)}}const hc={tokenize:SS,partial:!0},bc={name:"codeFenced",tokenize:yS,concrete:!0};function yS(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,o=0,s;return l;function l(v){return u(v)}function u(v){const x=r.events[r.events.length-1];return i=x&&x[1].type==="linePrefix"?x[2].sliceSerialize(x[1],!0).length:0,s=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(v)}function d(v){return v===s?(o++,e.consume(v),d):o<3?n(v):(e.exit("codeFencedFenceSequence"),de(v)?ge(e,c,"whitespace")(v):c(v))}function c(v){return v===null||ee(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(hc,g,R)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===null||ee(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(v)):de(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ge(e,p,"whitespace")(v)):v===96&&v===s?n(v):(e.consume(v),f)}function p(v){return v===null||ee(v)?c(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||ee(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(v)):v===96&&v===s?n(v):(e.consume(v),h)}function g(v){return e.attempt(a,R,E)(v)}function E(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),T}function T(v){return i>0&&de(v)?ge(e,S,"linePrefix",i+1)(v):S(v)}function S(v){return v===null||ee(v)?e.check(hc,g,R)(v):(e.enter("codeFlowValue"),y(v))}function y(v){return v===null||ee(v)?(e.exit("codeFlowValue"),S(v)):(e.consume(v),y)}function R(v){return e.exit("codeFenced"),t(v)}function w(v,x,C){let N=0;return _;function _(j){return v.enter("lineEnding"),v.consume(j),v.exit("lineEnding"),O}function O(j){return v.enter("codeFencedFence"),de(j)?ge(v,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===s?(v.enter("codeFencedFenceSequence"),G(j)):C(j)}function G(j){return j===s?(N++,v.consume(j),G):N>=o?(v.exit("codeFencedFenceSequence"),de(j)?ge(v,W,"whitespace")(j):W(j)):C(j)}function W(j){return j===null||ee(j)?(v.exit("codeFencedFence"),x(j)):C(j)}}}function SS(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const ur={name:"codeIndented",tokenize:TS},vS={tokenize:AS,partial:!0};function TS(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),ge(e,i,"linePrefix",4+1)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):ee(u)?e.attempt(vS,o,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ee(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function AS(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):ee(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):ge(e,i,"linePrefix",4+1)(o)}function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):ee(o)?a(o):n(o)}}const wS={name:"codeText",tokenize:_S,resolve:kS,previous:RS};function kS(e){let t=e.length-4,n=3,r,a;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;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function RS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _S(e,t,n){let r=0,a,i;return o;function o(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(i=e.enter("codeTextSequence"),a=0,d(c)):ee(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ee(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function d(c){return c===96?(e.consume(c),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(i.type="codeTextData",u(c))}}function Xh(e){const t={};let n=-1,r,a,i,o,s,l,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,IS(e,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(o=e[i],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(a&&(e[a][1].type="lineEndingBlank"),o[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},e[a][1].start),s=e.slice(a,n),s.unshift(r),Qe(e,a,n-a+1,s))}}return!u}function IS(e,t){const n=e[t][1],r=e[t][2];let a=t-1;const i=[],o=n._tokenizer||r.parser[n.contentType](n.start),s=o.events,l=[],u={};let d,c,f=-1,p=n,h=0,g=0;const E=[g];for(;p;){for(;e[++a][1]!==p;);i.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),c=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&&(g=f+1,E.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):E.pop(),f=E.length;f--;){const T=s.slice(E[f],E[f+1]),S=i.pop();l.unshift([S,S+T.length-1]),Qe(e,S,2,T)}for(f=-1;++f<l.length;)u[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return u}const CS={tokenize:OS,resolve:NS},xS={tokenize:LS,partial:!0};function NS(e){return Xh(e),e}function OS(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(s)}function a(s){return s===null?i(s):ee(s)?e.check(xS,o,i)(s):(e.consume(s),a)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function LS(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ge(e,i,"linePrefix")}function i(o){if(o===null||ee(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Zh(e,t,n,r,a,i,o,s,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return c;function c(T){return T===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(T),e.exit(i),f):T===null||T===32||T===41||Ln(T)?n(T):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(T))}function f(T){return T===62?(e.enter(i),e.consume(T),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===62?(e.exit("chunkString"),e.exit(s),f(T)):T===null||T===60||ee(T)?n(T):(e.consume(T),T===92?h:p)}function h(T){return T===60||T===62||T===92?(e.consume(T),p):p(T)}function g(T){return!d&&(T===null||T===41||we(T))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(T)):d<u&&T===40?(e.consume(T),d++,g):T===41?(e.consume(T),d--,g):T===null||T===32||T===40||Ln(T)?n(T):(e.consume(T),T===92?E:g)}function E(T){return T===40||T===41||T===92?(e.consume(T),g):g(T)}}function Qh(e,t,n,r,a,i){const o=this;let s=0,l;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(i),d}function d(p){return s>999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||ee(p)||s++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!de(p)),p===92?f:c)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}}function Jh(e,t,n,r,a,i){let o;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(a),e.consume(f),e.exit(a),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(a),e.consume(f),e.exit(a),e.exit(r),t):(e.enter(i),u(f))}function u(f){return f===o?(e.exit(i),l(o)):f===null?n(f):ee(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ge(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||ee(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?c:d)}function c(f){return f===o||f===92?(e.consume(f),d):d(f)}}function ln(e,t){let n;return r;function r(a){return ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):de(a)?ge(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}function ot(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const DS={name:"definition",tokenize:MS},FS={tokenize:PS,partial:!0};function MS(e,t,n){const r=this;let a;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return Qh.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return a=ot(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return we(p)?ln(e,u)(p):u(p)}function u(p){return Zh(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(FS,c,c)(p)}function c(p){return de(p)?ge(e,f,"whitespace")(p):f(p)}function f(p){return p===null||ee(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function PS(e,t,n){return r;function r(s){return we(s)?ln(e,a)(s):n(s)}function a(s){return Jh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return de(s)?ge(e,o,"whitespace")(s):o(s)}function o(s){return s===null||ee(s)?t(s):n(s)}}const US={name:"hardBreakEscape",tokenize:BS};function BS(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ee(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const $S={name:"headingAtx",tokenize:GS,resolve:qS};function qS(e,t){let n=e.length-2,r=3,a,i;return e[r][