@jojovms/scripto 0.0.6 → 0.0.7

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,67 +1,38 @@
1
- (function($,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],v):($=typeof globalThis<"u"?globalThis:$||self,v($.Scripto={},$.React))})(this,function($,v){"use strict";var wi=Object.defineProperty;var Xn=$=>{throw TypeError($)};var _i=($,v,J)=>v in $?wi($,v,{enumerable:!0,configurable:!0,writable:!0,value:J}):$[v]=J;var z=($,v,J)=>_i($,typeof v!="symbol"?v+"":v,J),yi=($,v,J)=>v.has($)||Xn("Cannot "+J);var Kn=($,v,J)=>v.has($)?Xn("Cannot add the same private member more than once"):v instanceof WeakSet?v.add($):v.set($,J);var Ht=($,v,J)=>(yi($,v,"access private method"),J);var Pe,dn,Qn;var J={exports:{}},Ve={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var mn;function Jn(){if(mn)return Ve;mn=1;var l=v,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(c,u,x){var h,w={},g=null,E=null;x!==void 0&&(g=""+x),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(E=u.ref);for(h in u)n.call(u,h)&&!a.hasOwnProperty(h)&&(w[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)w[h]===void 0&&(w[h]=u[h]);return{$$typeof:e,type:c,key:g,ref:E,props:w,_owner:r.current}}return Ve.Fragment=t,Ve.jsx=s,Ve.jsxs=s,Ve}var qe={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var gn;function er(){return gn||(gn=1,process.env.NODE_ENV!=="production"&&function(){var l=v,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),T=Symbol.iterator,m="@@iterator";function C(o){if(o===null||typeof o!="object")return null;var p=T&&o[T]||o[m];return typeof p=="function"?p:null}var j=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function M(o){{for(var p=arguments.length,k=new Array(p>1?p-1:0),y=1;y<p;y++)k[y-1]=arguments[y];ee("error",o,k)}}function ee(o,p,k){{var y=j.ReactDebugCurrentFrame,O=y.getStackAddendum();O!==""&&(p+="%s",k=k.concat([O]));var P=k.map(function(R){return String(R)});P.unshift("Warning: "+p),Function.prototype.apply.call(console[o],console,P)}}var W=!1,ce=!1,ot=!1,an=!1,ln=!1,Ot;Ot=Symbol.for("react.module.reference");function cn(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===a||ln||o===r||o===x||o===h||an||o===E||W||ce||ot||typeof o=="object"&&o!==null&&(o.$$typeof===g||o.$$typeof===w||o.$$typeof===s||o.$$typeof===c||o.$$typeof===u||o.$$typeof===Ot||o.getModuleId!==void 0))}function Y(o,p,k){var y=o.displayName;if(y)return y;var O=p.displayName||p.name||"";return O!==""?k+"("+O+")":k}function ze(o){return o.displayName||"Context"}function oe(o){if(o==null)return null;if(typeof o.tag=="number"&&M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case r:return"StrictMode";case x:return"Suspense";case h:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case c:var p=o;return ze(p)+".Consumer";case s:var k=o;return ze(k._context)+".Provider";case u:return Y(o,o.render,"ForwardRef");case w:var y=o.displayName||null;return y!==null?y:oe(o.type)||"Memo";case g:{var O=o,P=O._payload,R=O._init;try{return oe(R(P))}catch{return null}}}return null}var ue=Object.assign,Ne=0,Ct,Lt,st,It,at,H,lt;function G(){}G.__reactDisabledLog=!0;function Dt(){{if(Ne===0){Ct=console.log,Lt=console.info,st=console.warn,It=console.error,at=console.group,H=console.groupCollapsed,lt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:G,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}Ne++}}function U(){{if(Ne--,Ne===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ue({},o,{value:Ct}),info:ue({},o,{value:Lt}),warn:ue({},o,{value:st}),error:ue({},o,{value:It}),group:ue({},o,{value:at}),groupCollapsed:ue({},o,{value:H}),groupEnd:ue({},o,{value:lt})})}Ne<0&&M("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var be=j.ReactCurrentDispatcher,Me;function fe(o,p,k){{if(Me===void 0)try{throw Error()}catch(O){var y=O.stack.trim().match(/\n( *(at )?)/);Me=y&&y[1]||""}return`
18
- `+Me+o}}var $e=!1,Se;{var Pt=typeof WeakMap=="function"?WeakMap:Map;Se=new Pt}function ct(o,p){if(!o||$e)return"";{var k=Se.get(o);if(k!==void 0)return k}var y;$e=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=be.current,be.current=null,Dt();try{if(p){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(I){y=I}Reflect.construct(o,[],R)}else{try{R.call()}catch(I){y=I}o.call(R.prototype)}}else{try{throw Error()}catch(I){y=I}o()}}catch(I){if(I&&y&&typeof I.stack=="string"){for(var S=I.stack.split(`
19
- `),V=y.stack.split(`
20
- `),d=S.length-1,i=V.length-1;d>=1&&i>=0&&S[d]!==V[i];)i--;for(;d>=1&&i>=0;d--,i--)if(S[d]!==V[i]){if(d!==1||i!==1)do if(d--,i--,i<0||S[d]!==V[i]){var f=`
21
- `+S[d].replace(" at new "," at ");return o.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",o.displayName)),typeof o=="function"&&Se.set(o,f),f}while(d>=1&&i>=0);break}}}finally{$e=!1,be.current=P,U(),Error.prepareStackTrace=O}var b=o?o.displayName||o.name:"",L=b?fe(b):"";return typeof o=="function"&&Se.set(o,L),L}function Ae(o,p,k){return ct(o,!1)}function Fe(o){var p=o.prototype;return!!(p&&p.isReactComponent)}function se(o,p,k){if(o==null)return"";if(typeof o=="function")return ct(o,Fe(o));if(typeof o=="string")return fe(o);switch(o){case x:return fe("Suspense");case h:return fe("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case u:return Ae(o.render);case w:return se(o.type,p,k);case g:{var y=o,O=y._payload,P=y._init;try{return se(P(O),p,k)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,Ue={},Te=j.ReactDebugCurrentFrame;function we(o){if(o){var p=o._owner,k=se(o.type,o._source,p?p.type:null);Te.setExtraStackFrame(k)}else Te.setExtraStackFrame(null)}function He(o,p,k,y,O){{var P=Function.call.bind(xe);for(var R in o)if(P(o,R)){var S=void 0;try{if(typeof o[R]!="function"){var V=Error((y||"React class")+": "+k+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}S=o[R](p,R,y,k,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){S=d}S&&!(S instanceof Error)&&(we(O),M("%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).",y||"React class",k,R,typeof S),we(null)),S instanceof Error&&!(S.message in Ue)&&(Ue[S.message]=!0,we(O),M("Failed %s type: %s",k,S.message),we(null))}}}var Nt=Array.isArray;function Be(o){return Nt(o)}function un(o){{var p=typeof Symbol=="function"&&Symbol.toStringTag,k=p&&o[Symbol.toStringTag]||o.constructor.name||"Object";return k}}function ut(o){try{return Re(o),!1}catch{return!0}}function Re(o){return""+o}function _e(o){if(ut(o))return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",un(o)),Re(o)}var ne=j.ReactCurrentOwner,ft={key:!0,ref:!0,__self:!0,__source:!0},pt,ht;function dt(o){if(xe.call(o,"ref")){var p=Object.getOwnPropertyDescriptor(o,"ref").get;if(p&&p.isReactWarning)return!1}return o.ref!==void 0}function Mt(o){if(xe.call(o,"key")){var p=Object.getOwnPropertyDescriptor(o,"key").get;if(p&&p.isReactWarning)return!1}return o.key!==void 0}function We(o,p){typeof o.ref=="string"&&ne.current}function Ge(o,p){{var k=function(){pt||(pt=!0,M("%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))};k.isReactWarning=!0,Object.defineProperty(o,"key",{get:k,configurable:!0})}}function pe(o,p){{var k=function(){ht||(ht=!0,M("%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))};k.isReactWarning=!0,Object.defineProperty(o,"ref",{get:k,configurable:!0})}}var Oe=function(o,p,k,y,O,P,R){var S={$$typeof:e,type:o,key:p,ref:k,props:R,_owner:P};return S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(S,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(S,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S};function mt(o,p,k,y,O){{var P,R={},S=null,V=null;k!==void 0&&(_e(k),S=""+k),Mt(p)&&(_e(p.key),S=""+p.key),dt(p)&&(V=p.ref,We(p,O));for(P in p)xe.call(p,P)&&!ft.hasOwnProperty(P)&&(R[P]=p[P]);if(o&&o.defaultProps){var d=o.defaultProps;for(P in d)R[P]===void 0&&(R[P]=d[P])}if(S||V){var i=typeof o=="function"?o.displayName||o.name||"Unknown":o;S&&Ge(R,i),V&&pe(R,i)}return Oe(o,S,V,O,y,ne.current,R)}}var je=j.ReactCurrentOwner,jt=j.ReactDebugCurrentFrame;function he(o){if(o){var p=o._owner,k=se(o.type,o._source,p?p.type:null);jt.setExtraStackFrame(k)}else jt.setExtraStackFrame(null)}var Ce;Ce=!1;function gt(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function Le(){{if(je.current){var o=oe(je.current.type);if(o)return`
1
+ (function(L,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],p):(L=typeof globalThis<"u"?globalThis:L||self,p(L.Scripto={},L.jsxRuntime,L.React))})(this,function(L,p,y){"use strict";var dr=Object.defineProperty;var vn=L=>{throw TypeError(L)};var gr=(L,p,y)=>p in L?dr(L,p,{enumerable:!0,configurable:!0,writable:!0,value:y}):L[p]=y;var S=(L,p,y)=>gr(L,typeof p!="symbol"?p+"":p,y),mr=(L,p,y)=>p.has(L)||vn("Cannot "+y);var In=(L,p,y)=>p.has(L)?vn("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(L):p.set(L,y);var qe=(L,p,y)=>(mr(L,p,"access private method"),y);var le,St,Cn;var Lt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vt=y.createContext&&y.createContext(Lt),re=function(){return re=Object.assign||function(l){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(l[i]=e[i])}return l},re.apply(this,arguments)},On=function(l,e){var t={};for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&e.indexOf(n)<0&&(t[n]=l[n]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(l);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(l,n[i])&&(t[n[i]]=l[n[i]]);return t};function It(l){return l&&l.map(function(e,t){return y.createElement(e.tag,re({key:t},e.attr),It(e.child))})}function j(l){return function(e){return y.createElement(Dn,re({attr:re({},l.attr)},e),It(l.child))}}function Dn(l){var e=function(t){var n=l.attr,i=l.size,o=l.title,r=On(l,["attr","size","title"]),a=i||t.size||"1em",c;return t.className&&(c=t.className),l.className&&(c=(c?c+" ":"")+l.className),y.createElement("svg",re({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,r,{className:c,style:re(re({color:l.color||t.color},t.style),l.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&y.createElement("title",null,o),l.children)};return vt!==void 0?y.createElement(vt.Consumer,null,function(t){return e(t)}):e(Lt)}function Nn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"}}]})(l)}function Rn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"}}]})(l)}function Mn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144m224 0L144 368"}}]})(l)}function zn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M320 367.79h76c55 0 100-29.21 100-83.6s-53-81.47-96-83.6c-8.89-85.06-71-136.8-144-136.8-69 0-113.44 45.79-128 91.2-60 5.7-112 43.88-112 106.4s54 106.4 120 106.4h56"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M320 255.79l-64-64-64 64m64 192.42V207.79"}}]})(l)}function Pn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"rect",attr:{width:"336",height:"336",x:"128",y:"128",fill:"none",strokeLinejoin:"round",strokeWidth:"32",rx:"57",ry:"57"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"}}]})(l)}function $n(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 01-48 48H144a48 48 0 01-48-48V96a48 48 0 0148-48h98.75a32 32 0 0122.62 9.37l141.26 141.26a32 32 0 019.37 22.62z"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0032 32h120m-232 80h160m-160 80h160"}}]})(l)}function Un(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M336 176h40a40 40 0 0140 40v208a40 40 0 01-40 40H136a40 40 0 01-40-40V216a40 40 0 0140-40h40"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M176 272l80 80 80-80M256 48v288"}}]})(l)}function Fn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z"}}]})(l)}function Hn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z"}},{tag:"path",attr:{d:"M310.4 336H201.6a25.62 25.62 0 01-25.6-25.6V201.6a25.62 25.62 0 0125.6-25.6h108.8a25.62 25.62 0 0125.6 25.6v108.8a25.62 25.62 0 01-25.6 25.6z"}}]})(l)}function Bn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 48v48m0 320v48m147.08-355.08l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48m-320 0H48m355.08 147.08l-33.94-33.94M142.86 142.86l-33.94-33.94"}},{tag:"circle",attr:{cx:"256",cy:"256",r:"80",fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32"}}]})(l)}function Wn(l){return j({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M126 192H56a8 8 0 00-8 8v112a8 8 0 008 8h69.65a15.93 15.93 0 0110.14 3.54l91.47 74.89A8 8 0 00240 392V120a8 8 0 00-12.74-6.43l-91.47 74.89A15 15 0 01126 192zm194 128c9.74-19.38 16-40.84 16-64 0-23.48-6-44.42-16-64m48 176c19.48-33.92 32-64.06 32-112s-12-77.74-32-112m48 272c30-46 48-91.43 48-160s-18-113-48-160"}}]})(l)}function jn(l){return j({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z"}}]})(l)}const Gn=({onFileLoaded:l})=>{const e=y.useRef(null),[t,n]=y.useState(!1),[i,o]=y.useState(""),[r,a]=y.useState(!1),c=h=>{if(h.length>0){const E=h[0];k(E)?d(E):alert("Please upload a valid Markdown (.md) file.")}},k=h=>h.name.endsWith(".md")||h.name.endsWith(".markdown")||h.type==="text/markdown",d=h=>{const E=new FileReader;E.onload=D=>{l({name:h.name,content:D.target.result})},E.readAsText(h)},T=h=>{h.preventDefault(),h.stopPropagation(),h.type==="dragenter"||h.type==="dragover"?n(!0):(h.type==="dragleave"||h.type==="drop")&&n(!1)},f=h=>{h.preventDefault(),h.stopPropagation(),n(!1),h.dataTransfer.files&&h.dataTransfer.files[0]&&c(h.dataTransfer.files)},w=async()=>{const h=i.trim();if(h){a(!0);try{const E=m(h),D=await fetch(E);if(!D.ok)throw new Error(`HTTP error! status: ${D.status}`);const Y=await D.text();let q=h.substring(h.lastIndexOf("/")+1)||"remote-file.md";q.includes("?")&&(q=q.split("?")[0]),l({name:q,content:Y})}catch(E){console.error("Fetch error:",E),alert(`Failed to load Markdown from URL.
22
2
 
23
- Check the render method of \``+o+"`."}return""}}function fn(o){return""}var zt={};function B(o){{var p=Le();if(!p){var k=typeof o=="string"?o:o.displayName||o.name;k&&(p=`
24
-
25
- Check the top-level render call using <`+k+">.")}return p}}function ye(o,p){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var k=B(p);if(zt[k])return;zt[k]=!0;var y="";o&&o._owner&&o._owner!==je.current&&(y=" It was passed a child from "+oe(o._owner.type)+"."),he(o),M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',k,y),he(null)}}function $t(o,p){{if(typeof o!="object")return;if(Be(o))for(var k=0;k<o.length;k++){var y=o[k];gt(y)&&ye(y,p)}else if(gt(o))o._store&&(o._store.validated=!0);else if(o){var O=C(o);if(typeof O=="function"&&O!==o.entries)for(var P=O.call(o),R;!(R=P.next()).done;)gt(R.value)&&ye(R.value,p)}}}function Ft(o){{var p=o.type;if(p==null||typeof p=="string")return;var k;if(typeof p=="function")k=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===u||p.$$typeof===w))k=p.propTypes;else return;if(k){var y=oe(p);He(k,o.props,"prop",y,o)}else if(p.PropTypes!==void 0&&!Ce){Ce=!0;var O=oe(p);M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kt(o){{for(var p=Object.keys(o.props),k=0;k<p.length;k++){var y=p[k];if(y!=="children"&&y!=="key"){he(o),M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),he(null);break}}o.ref!==null&&(he(o),M("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var bt={};function xt(o,p,k,y,O,P){{var R=cn(o);if(!R){var S="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(S+=" 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 V=fn();V?S+=V:S+=Le();var d;o===null?d="null":Be(o)?d="array":o!==void 0&&o.$$typeof===e?(d="<"+(oe(o.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):d=typeof o,M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,S)}var i=mt(o,p,k,O,P);if(i==null)return i;if(R){var f=p.children;if(f!==void 0)if(y)if(Be(f)){for(var b=0;b<f.length;b++)$t(f[b],o);Object.freeze&&Object.freeze(f)}else M("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 $t(f,o)}if(xe.call(p,"key")){var L=oe(o),I=Object.keys(p).filter(function(de){return de!=="key"}),F=I.length>0?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}";if(!bt[L+F]){var Z=I.length>0?"{"+I.join(": ..., ")+": ...}":"{}";M(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,F,L,Z,L),bt[L+F]=!0}}return o===n?kt(i):Ft(i),i}}function pn(o,p,k){return xt(o,p,k,!0)}function ae(o,p,k){return xt(o,p,k,!1)}var Ee=ae,Ut=pn;qe.Fragment=n,qe.jsx=Ee,qe.jsxs=Ut}()),qe}process.env.NODE_ENV==="production"?J.exports=Jn():J.exports=er();var _=J.exports,kn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},bn=v.createContext&&v.createContext(kn),ve=function(){return ve=Object.assign||function(l){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(l[r]=e[r])}return l},ve.apply(this,arguments)},tr=function(l,e){var t={};for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&e.indexOf(n)<0&&(t[n]=l[n]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(l);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(l,n[r])&&(t[n[r]]=l[n[r]]);return t};function xn(l){return l&&l.map(function(e,t){return v.createElement(e.tag,ve({key:t},e.attr),xn(e.child))})}function re(l){return function(e){return v.createElement(nr,ve({attr:ve({},l.attr)},e),xn(l.child))}}function nr(l){var e=function(t){var n=l.attr,r=l.size,a=l.title,s=tr(l,["attr","size","title"]),c=r||t.size||"1em",u;return t.className&&(u=t.className),l.className&&(u=(u?u+" ":"")+l.className),v.createElement("svg",ve({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,s,{className:u,style:ve(ve({color:l.color||t.color},t.style),l.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&v.createElement("title",null,a),l.children)};return bn!==void 0?v.createElement(bn.Consumer,null,function(t){return e(t)}):e(kn)}function rr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"}}]})(l)}function ir(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"}}]})(l)}function or(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144m224 0L144 368"}}]})(l)}function sr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M320 367.79h76c55 0 100-29.21 100-83.6s-53-81.47-96-83.6c-8.89-85.06-71-136.8-144-136.8-69 0-113.44 45.79-128 91.2-60 5.7-112 43.88-112 106.4s54 106.4 120 106.4h56"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M320 255.79l-64-64-64 64m64 192.42V207.79"}}]})(l)}function ar(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"rect",attr:{width:"336",height:"336",x:"128",y:"128",fill:"none",strokeLinejoin:"round",strokeWidth:"32",rx:"57",ry:"57"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"}}]})(l)}function lr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 01-48 48H144a48 48 0 01-48-48V96a48 48 0 0148-48h98.75a32 32 0 0122.62 9.37l141.26 141.26a32 32 0 019.37 22.62z"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0032 32h120m-232 80h160m-160 80h160"}}]})(l)}function cr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M336 176h40a40 40 0 0140 40v208a40 40 0 01-40 40H136a40 40 0 01-40-40V216a40 40 0 0140-40h40"}},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M176 272l80 80 80-80M256 48v288"}}]})(l)}function ur(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z"}}]})(l)}function fr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z"}},{tag:"path",attr:{d:"M310.4 336H201.6a25.62 25.62 0 01-25.6-25.6V201.6a25.62 25.62 0 0125.6-25.6h108.8a25.62 25.62 0 0125.6 25.6v108.8a25.62 25.62 0 01-25.6 25.6z"}}]})(l)}function pr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 48v48m0 320v48m147.08-355.08l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48m-320 0H48m355.08 147.08l-33.94-33.94M142.86 142.86l-33.94-33.94"}},{tag:"circle",attr:{cx:"256",cy:"256",r:"80",fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32"}}]})(l)}function hr(l){return re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M126 192H56a8 8 0 00-8 8v112a8 8 0 008 8h69.65a15.93 15.93 0 0110.14 3.54l91.47 74.89A8 8 0 00240 392V120a8 8 0 00-12.74-6.43l-91.47 74.89A15 15 0 01126 192zm194 128c9.74-19.38 16-40.84 16-64 0-23.48-6-44.42-16-64m48 176c19.48-33.92 32-64.06 32-112s-12-77.74-32-112m48 272c30-46 48-91.43 48-160s-18-113-48-160"}}]})(l)}function dr(l){return re({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z"}}]})(l)}const mr=({onFileLoaded:l})=>{const e=v.useRef(null),[t,n]=v.useState(!1),[r,a]=v.useState(""),[s,c]=v.useState(!1),u=m=>{if(m.length>0){const C=m[0];x(C)?h(C):alert("Please upload a valid Markdown (.md) file.")}},x=m=>m.name.endsWith(".md")||m.name.endsWith(".markdown")||m.type==="text/markdown",h=m=>{const C=new FileReader;C.onload=j=>{l({name:m.name,content:j.target.result})},C.readAsText(m)},w=m=>{m.preventDefault(),m.stopPropagation(),m.type==="dragenter"||m.type==="dragover"?n(!0):(m.type==="dragleave"||m.type==="drop")&&n(!1)},g=m=>{m.preventDefault(),m.stopPropagation(),n(!1),m.dataTransfer.files&&m.dataTransfer.files[0]&&u(m.dataTransfer.files)},E=async()=>{const m=r.trim();if(m){c(!0);try{const C=T(m),j=await fetch(C);if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const M=await j.text();let ee=m.substring(m.lastIndexOf("/")+1)||"remote-file.md";ee.includes("?")&&(ee=ee.split("?")[0]),l({name:ee,content:M})}catch(C){console.error("Fetch error:",C),alert(`Failed to load Markdown from URL.
31
-
32
- Note: This might be due to CORS restrictions. Try a raw GitHub URL.`)}finally{c(!1)}}},T=m=>{try{if(new URL(m).hostname==="github.com"&&m.includes("/blob/"))return m.replace("github.com","raw.githubusercontent.com").replace("/blob/","/")}catch{}return m};return _.jsxs("section",{className:`upload-zone ${t?"drag-active":""}`,onClick:()=>e.current.click(),onDragEnter:w,onDragLeave:w,onDragOver:w,onDrop:g,id:"upload-area",children:[_.jsx("input",{type:"file",ref:e,accept:".md,.markdown",hidden:!0,onChange:m=>u(m.target.files)}),_.jsxs("div",{className:"upload-content",children:[_.jsx("div",{className:"icon-wrapper",children:_.jsx(sr,{})}),_.jsx("h2",{children:"Drop your Markdown file here"}),_.jsxs("p",{children:["or ",_.jsx("span",{className:"browse-btn",children:"browse files"})]}),_.jsx("div",{className:"divider",children:_.jsx("span",{children:"OR"})}),_.jsxs("div",{className:"url-input-container",onClick:m=>m.stopPropagation(),children:[_.jsx("input",{type:"url",id:"url-input",placeholder:"Paste a raw Markdown URL...",spellCheck:"false",value:r,onChange:m=>a(m.target.value),onKeyDown:m=>m.key==="Enter"&&E()}),_.jsx("button",{id:"url-btn",onClick:E,disabled:s,children:s?"...":"Go"})]}),_.jsxs("p",{className:"sub-text",children:["Supports ",_.jsx("span",{style:{color:"aqua"},children:".md"})," and ",_.jsx("span",{style:{color:"aqua"},children:".markdown"})]})]})]})};function Bt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ie=Bt();function Tn(l){Ie=l}const wn=/[&<>"']/,gr=new RegExp(wn.source,"g"),_n=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,kr=new RegExp(_n.source,"g"),br={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},yn=l=>br[l];function te(l,e){if(e){if(wn.test(l))return l.replace(gr,yn)}else if(_n.test(l))return l.replace(kr,yn);return l}const xr=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Tr(l){return l.replace(xr,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const wr=/(^|[^\[])\^/g;function N(l,e){let t=typeof l=="string"?l:l.source;e=e||"";const n={replace:(r,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(wr,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}function En(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const Ze={exec:()=>null};function vn(l,e){const t=l.replace(/\|/g,(a,s,c)=>{let u=!1,x=s;for(;--x>=0&&c[x]==="\\";)u=!u;return u?"|":" |"}),n=t.split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Tt(l,e,t){const n=l.length;if(n===0)return"";let r=0;for(;r<n&&l.charAt(n-r-1)===e;)r++;return l.slice(0,n-r)}function _r(l,e){if(l.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<l.length;n++)if(l[n]==="\\")n++;else if(l[n]===e[0])t++;else if(l[n]===e[1]&&(t--,t<0))return n;return-1}function Sn(l,e,t,n){const r=e.href,a=e.title?te(e.title):null,s=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){n.state.inLink=!0;const c={type:"link",raw:t,href:r,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,c}return{type:"image",raw:t,href:r,title:a,text:te(s)}}function yr(l,e){const t=l.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
33
- `).map(r=>{const a=r.match(/^\s+/);if(a===null)return r;const[s]=a;return s.length>=n.length?r.slice(n.length):r}).join(`
34
- `)}class wt{constructor(e){z(this,"options");z(this,"rules");z(this,"lexer");this.options=e||Ie}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Tt(n,`
35
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=yr(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const r=Tt(n,"#");(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=Tt(t[0].replace(/^ *>[ \t]?/gm,""),`
36
- `),r=this.lexer.state.top;this.lexer.state.top=!0;const a=this.lexer.blockTokens(n);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:a,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,a={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let c="",u="",x=!1;for(;e;){let h=!1;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let w=t[2].split(`
37
- `,1)[0].replace(/^\t+/,j=>" ".repeat(3*j.length)),g=e.split(`
38
- `,1)[0],E=0;this.options.pedantic?(E=2,u=w.trimStart()):(E=t[2].search(/[^ ]/),E=E>4?1:E,u=w.slice(E),E+=t[1].length);let T=!1;if(!w&&/^ *$/.test(g)&&(c+=g+`
39
- `,e=e.substring(g.length+1),h=!0),!h){const j=new RegExp(`^ {0,${Math.min(3,E-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),M=new RegExp(`^ {0,${Math.min(3,E-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),ee=new RegExp(`^ {0,${Math.min(3,E-1)}}(?:\`\`\`|~~~)`),W=new RegExp(`^ {0,${Math.min(3,E-1)}}#`);for(;e;){const ce=e.split(`
40
- `,1)[0];if(g=ce,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),ee.test(g)||W.test(g)||j.test(g)||M.test(e))break;if(g.search(/[^ ]/)>=E||!g.trim())u+=`
41
- `+g.slice(E);else{if(T||w.search(/[^ ]/)>=4||ee.test(w)||W.test(w)||M.test(w))break;u+=`
42
- `+g}!T&&!g.trim()&&(T=!0),c+=ce+`
43
- `,e=e.substring(ce.length+1),w=g.slice(E)}}a.loose||(x?a.loose=!0:/\n *\n *$/.test(c)&&(x=!0));let m=null,C;this.options.gfm&&(m=/^\[[ xX]\] /.exec(u),m&&(C=m[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:c,task:!!m,checked:C,loose:!1,text:u,tokens:[]}),a.raw+=c}a.items[a.items.length-1].raw=c.trimEnd(),a.items[a.items.length-1].text=u.trimEnd(),a.raw=a.raw.trimEnd();for(let h=0;h<a.items.length;h++)if(this.lexer.state.top=!1,a.items[h].tokens=this.lexer.blockTokens(a.items[h].text,[]),!a.loose){const w=a.items[h].tokens.filter(E=>E.type==="space"),g=w.length>0&&w.some(E=>/\n.*\n/.test(E.raw));a.loose=g}if(a.loose)for(let h=0;h<a.items.length;h++)a.items[h].loose=!0;return a}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:a}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=vn(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),a=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
44
- `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const c of r)/^ *-+: *$/.test(c)?s.align.push("right"):/^ *:-+: *$/.test(c)?s.align.push("center"):/^ *:-+ *$/.test(c)?s.align.push("left"):s.align.push(null);for(const c of n)s.header.push({text:c,tokens:this.lexer.inline(c)});for(const c of a)s.rows.push(vn(c,s.header.length).map(u=>({text:u,tokens:this.lexer.inline(u)})));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
45
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:te(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const s=Tt(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=_r(t[2],"()");if(s>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let r=t[2],a="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],a=s[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(n)?r=r.slice(1):r=r.slice(1,-1)),Sn(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(/\s+/g," "),a=t[r.toLowerCase()];if(!a){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Sn(n,a,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...r[0]].length-1;let c,u,x=s,h=0;const w=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(w.lastIndex=0,t=t.slice(-1*e.length+s);(r=w.exec(t))!=null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(u=[...c].length,r[3]||r[4]){x+=u;continue}else if((r[5]||r[6])&&s%3&&!((s+u)%3)){h+=u;continue}if(x-=u,x>0)continue;u=Math.min(u,u+x+h);const g=[...r[0]][0].length,E=e.slice(0,s+r.index+g+u);if(Math.min(s,u)%2){const m=E.slice(1,-1);return{type:"em",raw:E,text:m,tokens:this.lexer.inlineTokens(m)}}const T=E.slice(2,-2);return{type:"strong",raw:E,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const r=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return r&&a&&(n=n.substring(1,n.length-1)),n=te(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=te(t[1]),r="mailto:"+n):(n=te(t[1]),r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,a;if(t[2]==="@")r=te(t[0]),a="mailto:"+r;else{let s;do s=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(s!==t[0]);r=te(t[0]),t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=te(t[0]),{type:"text",raw:t[0],text:n}}}}const Er=/^(?: *(?:\n|$))+/,vr=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Sr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ar=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,An=/(?:[*+-]|\d{1,9}[.)])/,Rn=N(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,An).getRegex(),Wt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Rr=/^[^\n]+/,Gt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Or=N(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Gt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Cr=N(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,An).getRegex(),_t="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Lr=N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Yt).replace("tag",_t).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),On=N(Wt).replace("hr",Xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_t).getRegex(),Vt={blockquote:N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",On).getRegex(),code:vr,def:Or,fences:Sr,heading:Ar,hr:Xe,html:Lr,lheading:Rn,list:Cr,newline:Er,paragraph:On,table:Ze,text:Rr},Cn=N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_t).getRegex(),Ir={...Vt,table:Cn,paragraph:N(Wt).replace("hr",Xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_t).getRegex()},Dr={...Vt,html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ze,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(Wt).replace("hr",Xe).replace("heading",` *#{1,6} *[^
46
- ]`).replace("lheading",Rn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ln=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,In=/^( {2,}|\\)\n(?!\s*$)/,Nr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ke="\\p{P}$+<=>`^|~",Mr=N(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ke).getRegex(),jr=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,zr=N(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ke).getRegex(),$r=N("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ke).getRegex(),Fr=N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ke).getRegex(),Ur=N(/\\([punct])/,"gu").replace(/punct/g,Ke).getRegex(),Hr=N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Br=N(Yt).replace("(?:-->|$)","-->").getRegex(),Wr=N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Br).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Gr=N(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",yt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Dn=N(/^!?\[(label)\]\[(ref)\]/).replace("label",yt).replace("ref",Gt).getRegex(),Pn=N(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gt).getRegex(),Yr=N("reflink|nolink(?!\\()","g").replace("reflink",Dn).replace("nolink",Pn).getRegex(),qt={_backpedal:Ze,anyPunctuation:Ur,autolink:Hr,blockSkip:jr,br:In,code:Pr,del:Ze,emStrongLDelim:zr,emStrongRDelimAst:$r,emStrongRDelimUnd:Fr,escape:Ln,link:Gr,nolink:Pn,punctuation:Mr,reflink:Dn,reflinkSearch:Yr,tag:Wr,text:Nr,url:Ze},Vr={...qt,link:N(/^!?\[(label)\]\((.*?)\)/).replace("label",yt).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yt).getRegex()},Zt={...qt,escape:N(Ln).replace("])","~|])").getRegex(),url:N(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},qr={...Zt,br:N(In).replace("{2,}","*").getRegex(),text:N(Zt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Et={normal:Vt,gfm:Ir,pedantic:Dr},Qe={normal:qt,gfm:Zt,breaks:qr,pedantic:Vr};class me{constructor(e){z(this,"tokens");z(this,"options");z(this,"state");z(this,"tokenizer");z(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ie,this.options.tokenizer=this.options.tokenizer||new wt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Et.normal,inline:Qe.normal};this.options.pedantic?(t.block=Et.pedantic,t.inline=Qe.pedantic):this.options.gfm&&(t.block=Et.gfm,this.options.breaks?t.inline=Qe.breaks:t.inline=Qe.gfm),this.tokenizer.rules=t}static get rules(){return{block:Et,inline:Qe}}static lex(e,t){return new me(t).lex(e)}static lexInline(e,t){return new me(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
47
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(c,u,x)=>u+" ".repeat(x.length));let n,r,a,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(c=>(n=c.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
48
- `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
49
- `+n.raw,r.text+=`
50
- `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
51
- `+n.raw,r.text+=`
52
- `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let c=1/0;const u=e.slice(1);let x;this.options.extensions.startBlock.forEach(h=>{x=h.call({lexer:this},u),typeof x=="number"&&x>=0&&(c=Math.min(c,x))}),c<1/0&&c>=0&&(a=e.substring(0,c+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){r=t[t.length-1],s&&r.type==="paragraph"?(r.raw+=`
53
- `+n.raw,r.text+=`
54
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=a.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=`
55
- `+n.raw,r.text+=`
56
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,a,s=e,c,u,x;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)h.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,c.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(u||(x=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,x)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const w=e.slice(1);let g;this.options.extensions.startInline.forEach(E=>{g=E.call({lexer:this},w),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(a=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(a)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(x=n.raw.slice(-1)),u=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class vt{constructor(e){z(this,"options");this.options=e||Ie}code(e,t,n){var a;const r=(a=(t||"").match(/^\S*/))==null?void 0:a[0];return e=e.replace(/\n$/,"")+`
57
- `,r?'<pre><code class="language-'+te(r)+'">'+(n?e:te(e,!0))+`</code></pre>
58
- `:"<pre><code>"+(n?e:te(e,!0))+`</code></pre>
3
+ Note: This might be due to CORS restrictions. Try a raw GitHub URL.`)}finally{a(!1)}}},m=h=>{try{if(new URL(h).hostname==="github.com"&&h.includes("/blob/"))return h.replace("github.com","raw.githubusercontent.com").replace("/blob/","/")}catch{}return h};return p.jsxs("section",{className:`upload-zone ${t?"drag-active":""}`,onClick:()=>e.current.click(),onDragEnter:T,onDragLeave:T,onDragOver:T,onDrop:f,id:"upload-area",children:[p.jsx("input",{type:"file",ref:e,accept:".md,.markdown",hidden:!0,onChange:h=>c(h.target.files)}),p.jsxs("div",{className:"upload-content",children:[p.jsx("div",{className:"icon-wrapper",children:p.jsx(zn,{})}),p.jsx("h2",{children:"Drop your Markdown file here"}),p.jsxs("p",{children:["or ",p.jsx("span",{className:"browse-btn",children:"browse files"})]}),p.jsx("div",{className:"divider",children:p.jsx("span",{children:"OR"})}),p.jsxs("div",{className:"url-input-container",onClick:h=>h.stopPropagation(),children:[p.jsx("input",{type:"url",id:"url-input",placeholder:"Paste a raw Markdown URL...",spellCheck:"false",value:i,onChange:h=>o(h.target.value),onKeyDown:h=>h.key==="Enter"&&w()}),p.jsx("button",{id:"url-btn",onClick:w,disabled:r,children:r?"...":"Go"})]}),p.jsxs("p",{className:"sub-text",children:["Supports ",p.jsx("span",{style:{color:"aqua"},children:".md"})," and ",p.jsx("span",{style:{color:"aqua"},children:".markdown"})]})]})]})};function Ze(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let se=Ze();function Ct(l){se=l}const Ot=/[&<>"']/,qn=new RegExp(Ot.source,"g"),Dt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Zn=new RegExp(Dt.source,"g"),Yn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nt=l=>Yn[l];function W(l,e){if(e){if(Ot.test(l))return l.replace(qn,Nt)}else if(Dt.test(l))return l.replace(Zn,Nt);return l}const Vn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xn(l){return l.replace(Vn,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Qn=/(^|[^\[])\^/g;function A(l,e){let t=typeof l=="string"?l:l.source;e=e||"";const n={replace:(i,o)=>{let r=typeof o=="string"?o:o.source;return r=r.replace(Qn,"$1"),t=t.replace(i,r),n},getRegex:()=>new RegExp(t,e)};return n}function Rt(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const ke={exec:()=>null};function Mt(l,e){const t=l.replace(/\|/g,(o,r,a)=>{let c=!1,k=r;for(;--k>=0&&a[k]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Ce(l,e,t){const n=l.length;if(n===0)return"";let i=0;for(;i<n&&l.charAt(n-i-1)===e;)i++;return l.slice(0,n-i)}function Kn(l,e){if(l.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<l.length;n++)if(l[n]==="\\")n++;else if(l[n]===e[0])t++;else if(l[n]===e[1]&&(t--,t<0))return n;return-1}function zt(l,e,t,n){const i=e.href,o=e.title?W(e.title):null,r=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:t,href:i,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:o,text:W(r)}}function Jn(l,e){const t=l.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
4
+ `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[r]=o;return r.length>=n.length?i.slice(n.length):i}).join(`
5
+ `)}class Oe{constructor(e){S(this,"options");S(this,"rules");S(this,"lexer");this.options=e||se}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ce(n,`
6
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=Jn(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=Ce(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=Ce(t[0].replace(/^ *>[ \t]?/gm,""),`
7
+ `),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,o={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const r=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",c="",k=!1;for(;e;){let d=!1;if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let T=t[2].split(`
8
+ `,1)[0].replace(/^\t+/,D=>" ".repeat(3*D.length)),f=e.split(`
9
+ `,1)[0],w=0;this.options.pedantic?(w=2,c=T.trimStart()):(w=t[2].search(/[^ ]/),w=w>4?1:w,c=T.slice(w),w+=t[1].length);let m=!1;if(!T&&/^ *$/.test(f)&&(a+=f+`
10
+ `,e=e.substring(f.length+1),d=!0),!d){const D=new RegExp(`^ {0,${Math.min(3,w-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),Y=new RegExp(`^ {0,${Math.min(3,w-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),q=new RegExp(`^ {0,${Math.min(3,w-1)}}(?:\`\`\`|~~~)`),N=new RegExp(`^ {0,${Math.min(3,w-1)}}#`);for(;e;){const ee=e.split(`
11
+ `,1)[0];if(f=ee,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),q.test(f)||N.test(f)||D.test(f)||Y.test(e))break;if(f.search(/[^ ]/)>=w||!f.trim())c+=`
12
+ `+f.slice(w);else{if(m||T.search(/[^ ]/)>=4||q.test(T)||N.test(T)||Y.test(T))break;c+=`
13
+ `+f}!m&&!f.trim()&&(m=!0),a+=ee+`
14
+ `,e=e.substring(ee.length+1),T=f.slice(w)}}o.loose||(k?o.loose=!0:/\n *\n *$/.test(a)&&(k=!0));let h=null,E;this.options.gfm&&(h=/^\[[ xX]\] /.exec(c),h&&(E=h[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!h,checked:E,loose:!1,text:c,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=c.trimEnd(),o.raw=o.raw.trimEnd();for(let d=0;d<o.items.length;d++)if(this.lexer.state.top=!1,o.items[d].tokens=this.lexer.blockTokens(o.items[d].text,[]),!o.loose){const T=o.items[d].tokens.filter(w=>w.type==="space"),f=T.length>0&&T.some(w=>/\n.*\n/.test(w.raw));o.loose=f}if(o.loose)for(let d=0;d<o.items.length;d++)o.items[d].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=Mt(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
15
+ `):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const a of i)/^ *-+: *$/.test(a)?r.align.push("right"):/^ *:-+: *$/.test(a)?r.align.push("center"):/^ *:-+ *$/.test(a)?r.align.push("left"):r.align.push(null);for(const a of n)r.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of o)r.rows.push(Mt(a,r.header.length).map(c=>({text:c,tokens:this.lexer.inline(c)})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
16
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:W(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const r=Ce(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=Kn(t[2],"()");if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);r&&(i=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),zt(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(/\s+/g," "),o=t[i.toLowerCase()];if(!o){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return zt(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...i[0]].length-1;let a,c,k=r,d=0;const T=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(T.lastIndex=0,t=t.slice(-1*e.length+r);(i=T.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){k+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(k-=c,k>0)continue;c=Math.min(c,c+k+d);const f=[...i[0]][0].length,w=e.slice(0,r+i.index+f+c);if(Math.min(r,c)%2){const h=w.slice(1,-1);return{type:"em",raw:w,text:h,tokens:this.lexer.inlineTokens(h)}}const m=w.slice(2,-2);return{type:"strong",raw:w,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=W(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=W(t[1]),i="mailto:"+n):(n=W(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=W(t[0]),o="mailto:"+i;else{let r;do r=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(r!==t[0]);i=W(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=W(t[0]),{type:"text",raw:t[0],text:n}}}}const ei=/^(?: *(?:\n|$))+/,ti=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,ni=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,be=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ii=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pt=/(?:[*+-]|\d{1,9}[.)])/,$t=A(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Pt).getRegex(),Ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ri=/^[^\n]+/,Ve=/(?!\s*\])(?:\\.|[^\[\]\\])+/,si=A(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ve).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oi=A(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pt).getRegex(),De="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xe=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,li=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Xe).replace("tag",De).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=A(Ye).replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",De).getRegex(),Qe={blockquote:A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ut).getRegex(),code:ti,def:si,fences:ni,heading:ii,hr:be,html:li,lheading:$t,list:oi,newline:ei,paragraph:Ut,table:ke,text:ri},Ft=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",De).getRegex(),ai={...Qe,table:Ft,paragraph:A(Ye).replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ft).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",De).getRegex()},ci={...Qe,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ke,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(Ye).replace("hr",be).replace("heading",` *#{1,6} *[^
17
+ ]`).replace("lheading",$t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ht=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ui=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bt=/^( {2,}|\\)\n(?!\s*$)/,pi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Te="\\p{P}$+<=>`^|~",hi=A(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Te).getRegex(),fi=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,di=A(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Te).getRegex(),gi=A("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Te).getRegex(),mi=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Te).getRegex(),ki=A(/\\([punct])/,"gu").replace(/punct/g,Te).getRegex(),bi=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ti=A(Xe).replace("(?:-->|$)","-->").getRegex(),wi=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ti).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xi=A(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Wt=A(/^!?\[(label)\]\[(ref)\]/).replace("label",Ne).replace("ref",Ve).getRegex(),jt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ve).getRegex(),yi=A("reflink|nolink(?!\\()","g").replace("reflink",Wt).replace("nolink",jt).getRegex(),Ke={_backpedal:ke,anyPunctuation:ki,autolink:bi,blockSkip:fi,br:Bt,code:ui,del:ke,emStrongLDelim:di,emStrongRDelimAst:gi,emStrongRDelimUnd:mi,escape:Ht,link:xi,nolink:jt,punctuation:hi,reflink:Wt,reflinkSearch:yi,tag:wi,text:pi,url:ke},_i={...Ke,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",Ne).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ne).getRegex()},Je={...Ke,escape:A(Ht).replace("])","~|])").getRegex(),url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ei={...Je,br:A(Bt).replace("{2,}","*").getRegex(),text:A(Je.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Re={normal:Qe,gfm:ai,pedantic:ci},we={normal:Ke,gfm:Je,breaks:Ei,pedantic:_i};class V{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"tokenizer");S(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||se,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Re.normal,inline:we.normal};this.options.pedantic?(t.block=Re.pedantic,t.inline=we.pedantic):this.options.gfm&&(t.block=Re.gfm,this.options.breaks?t.inline=we.breaks:t.inline=we.gfm),this.tokenizer.rules=t}static get rules(){return{block:Re,inline:we}}static lex(e,t){return new V(t).lex(e)}static lexInline(e,t){return new V(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
18
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,c,k)=>c+" ".repeat(k.length));let n,i,o,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
19
+ `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
20
+ `+n.raw,i.text+=`
21
+ `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
22
+ `+n.raw,i.text+=`
23
+ `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const c=e.slice(1);let k;this.options.extensions.startBlock.forEach(d=>{k=d.call({lexer:this},c),typeof k=="number"&&k>=0&&(a=Math.min(a,k))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){i=t[t.length-1],r&&i.type==="paragraph"?(i.raw+=`
24
+ `+n.raw,i.text+=`
25
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
26
+ `+n.raw,i.text+=`
27
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,r=e,a,c,k;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(k=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(n=d.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,k)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const T=e.slice(1);let f;this.options.extensions.startInline.forEach(w=>{f=w.call({lexer:this},T),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(k=n.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class Me{constructor(e){S(this,"options");this.options=e||se}code(e,t,n){var o;const i=(o=(t||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
28
+ `,i?'<pre><code class="language-'+W(i)+'">'+(n?e:W(e,!0))+`</code></pre>
29
+ `:"<pre><code>"+(n?e:W(e,!0))+`</code></pre>
59
30
  `}blockquote(e){return`<blockquote>
60
31
  ${e}</blockquote>
61
32
  `}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>
62
33
  `}hr(){return`<hr>
63
- `}list(e,t,n){const r=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
64
- `+e+"</"+r+`>
34
+ `}list(e,t,n){const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
35
+ `+e+"</"+i+`>
65
36
  `}listitem(e,t,n){return`<li>${e}</li>
66
37
  `}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
67
38
  `}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
@@ -71,7 +42,7 @@ ${e}</blockquote>
71
42
  `}tablerow(e){return`<tr>
72
43
  ${e}</tr>
73
44
  `}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
74
- `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=En(e);if(r===null)return n;e=r;let a='<a href="'+e+'"';return t&&(a+=' title="'+t+'"'),a+=">"+n+"</a>",a}image(e,t,n){const r=En(e);if(r===null)return n;e=r;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${t}"`),a+=">",a}text(e){return e}}class Xt{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ge{constructor(e){z(this,"options");z(this,"renderer");z(this,"textRenderer");this.options=e||Ie,this.options.renderer=this.options.renderer||new vt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xt}static parse(e,t){return new ge(t).parse(e)}static parseInline(e,t){return new ge(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const a=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const s=a,c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=c||"";continue}}switch(a.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const s=a;n+=this.renderer.heading(this.parseInline(s.tokens),s.depth,Tr(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=a;n+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=a;let c="",u="";for(let h=0;h<s.header.length;h++)u+=this.renderer.tablecell(this.parseInline(s.header[h].tokens),{header:!0,align:s.align[h]});c+=this.renderer.tablerow(u);let x="";for(let h=0;h<s.rows.length;h++){const w=s.rows[h];u="";for(let g=0;g<w.length;g++)u+=this.renderer.tablecell(this.parseInline(w[g].tokens),{header:!1,align:s.align[g]});x+=this.renderer.tablerow(u)}n+=this.renderer.table(c,x);continue}case"blockquote":{const s=a,c=this.parse(s.tokens);n+=this.renderer.blockquote(c);continue}case"list":{const s=a,c=s.ordered,u=s.start,x=s.loose;let h="";for(let w=0;w<s.items.length;w++){const g=s.items[w],E=g.checked,T=g.task;let m="";if(g.task){const C=this.renderer.checkbox(!!E);x?g.tokens.length>0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=C+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=C+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:C+" "}):m+=C+" "}m+=this.parse(g.tokens,x),h+=this.renderer.listitem(m,T,!!E)}n+=this.renderer.list(h,c,u);continue}case"html":{const s=a;n+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=a;n+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=a,c=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&e[r+1].type==="text";)s=e[++r],c+=`
75
- `+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(c):c;continue}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const a=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=s||"";continue}}switch(a.type){case"escape":{const s=a;n+=t.text(s.text);break}case"html":{const s=a;n+=t.html(s.text);break}case"link":{const s=a;n+=t.link(s.href,s.title,this.parseInline(s.tokens,t));break}case"image":{const s=a;n+=t.image(s.href,s.title,s.text);break}case"strong":{const s=a;n+=t.strong(this.parseInline(s.tokens,t));break}case"em":{const s=a;n+=t.em(this.parseInline(s.tokens,t));break}case"codespan":{const s=a;n+=t.codespan(s.text);break}case"br":{n+=t.br();break}case"del":{const s=a;n+=t.del(this.parseInline(s.tokens,t));break}case"text":{const s=a;n+=t.text(s.text);break}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}}class Je{constructor(e){z(this,"options");this.options=e||Ie}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}z(Je,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Zr{constructor(...e){Kn(this,Pe);z(this,"defaults",Bt());z(this,"options",this.setOptions);z(this,"parse",Ht(this,Pe,dn).call(this,me.lex,ge.parse));z(this,"parseInline",Ht(this,Pe,dn).call(this,me.lexInline,ge.parseInline));z(this,"Parser",ge);z(this,"Renderer",vt);z(this,"TextRenderer",Xt);z(this,"Lexer",me);z(this,"Tokenizer",wt);z(this,"Hooks",Je);this.use(...e)}walkTokens(e,t){var r,a;let n=[];for(const s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{const c=s;for(const u of c.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of c.rows)for(const x of u)n=n.concat(this.walkTokens(x.tokens,t));break}case"list":{const c=s;n=n.concat(this.walkTokens(c.items,t));break}default:{const c=s;(a=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&a[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{const x=c[u].flat(1/0);n=n.concat(this.walkTokens(x,t))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const s=t.renderers[a.name];s?t.renderers[a.name]=function(...c){let u=a.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=t[a.level];s?s.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),r.extensions=t),n.renderer){const a=this.defaults.renderer||new vt(this.defaults);for(const s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const c=s,u=n.renderer[c],x=a[c];a[c]=(...h)=>{let w=u.apply(a,h);return w===!1&&(w=x.apply(a,h)),w||""}}r.renderer=a}if(n.tokenizer){const a=this.defaults.tokenizer||new wt(this.defaults);for(const s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const c=s,u=n.tokenizer[c],x=a[c];a[c]=(...h)=>{let w=u.apply(a,h);return w===!1&&(w=x.apply(a,h)),w}}r.tokenizer=a}if(n.hooks){const a=this.defaults.hooks||new Je;for(const s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const c=s,u=n.hooks[c],x=a[c];Je.passThroughHooks.has(s)?a[c]=h=>{if(this.defaults.async)return Promise.resolve(u.call(a,h)).then(g=>x.call(a,g));const w=u.call(a,h);return x.call(a,w)}:a[c]=(...h)=>{let w=u.apply(a,h);return w===!1&&(w=x.apply(a,h)),w}}r.hooks=a}if(n.walkTokens){const a=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),a&&(u=u.concat(a.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return me.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}}Pe=new WeakSet,dn=function(e,t){return(n,r)=>{const a={...r},s={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const c=Ht(this,Pe,Qn).call(this,!!s.silent,!!s.async);if(typeof n>"u"||n===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(u=>e(u,s)).then(u=>s.hooks?s.hooks.processAllTokens(u):u).then(u=>s.walkTokens?Promise.all(this.walkTokens(u,s.walkTokens)).then(()=>u):u).then(u=>t(u,s)).then(u=>s.hooks?s.hooks.postprocess(u):u).catch(c);try{s.hooks&&(n=s.hooks.preprocess(n));let u=e(n,s);s.hooks&&(u=s.hooks.processAllTokens(u)),s.walkTokens&&this.walkTokens(u,s.walkTokens);let x=t(u,s);return s.hooks&&(x=s.hooks.postprocess(x)),x}catch(u){return c(u)}}},Qn=function(e,t){return n=>{if(n.message+=`
76
- Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+te(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}};const De=new Zr;function D(l,e){return De.parse(l,e)}D.options=D.setOptions=function(l){return De.setOptions(l),D.defaults=De.defaults,Tn(D.defaults),D},D.getDefaults=Bt,D.defaults=Ie,D.use=function(...l){return De.use(...l),D.defaults=De.defaults,Tn(D.defaults),D},D.walkTokens=function(l,e){return De.walkTokens(l,e)},D.parseInline=De.parseInline,D.Parser=ge,D.parser=ge.parse,D.Renderer=vt,D.TextRenderer=Xt,D.Lexer=me,D.lexer=me.lex,D.Tokenizer=wt,D.Hooks=Je,D.parse=D,D.options,D.setOptions,D.use,D.walkTokens,D.parseInline,ge.parse,me.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Nn,setPrototypeOf:Mn,isFrozen:Xr,getPrototypeOf:Kr,getOwnPropertyDescriptor:Qr}=Object;let{freeze:X,seal:ie,create:Kt}=Object,{apply:Qt,construct:Jt}=typeof Reflect<"u"&&Reflect;X||(X=function(e){return e}),ie||(ie=function(e){return e}),Qt||(Qt=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return e.apply(t,r)}),Jt||(Jt=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const St=Q(Array.prototype.forEach),Jr=Q(Array.prototype.lastIndexOf),jn=Q(Array.prototype.pop),et=Q(Array.prototype.push),ei=Q(Array.prototype.splice),At=Q(String.prototype.toLowerCase),en=Q(String.prototype.toString),tn=Q(String.prototype.match),tt=Q(String.prototype.replace),ti=Q(String.prototype.indexOf),ni=Q(String.prototype.trim),le=Q(Object.prototype.hasOwnProperty),K=Q(RegExp.prototype.test),nt=ri(TypeError);function Q(l){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Qt(l,e,n)}}function ri(l){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Jt(l,t)}}function A(l,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:At;Mn&&Mn(l,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const a=t(r);a!==r&&(Xr(e)||(e[n]=a),r=a)}l[r]=!0}return l}function ii(l){for(let e=0;e<l.length;e++)le(l,e)||(l[e]=null);return l}function ke(l){const e=Kt(null);for(const[t,n]of Nn(l))le(l,t)&&(Array.isArray(n)?e[t]=ii(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ke(n):e[t]=n);return e}function rt(l,e){for(;l!==null;){const n=Qr(l,e);if(n){if(n.get)return Q(n.get);if(typeof n.value=="function")return Q(n.value)}l=Kr(l)}function t(){return null}return t}const zn=X(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),nn=X(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rn=X(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),oi=X(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),on=X(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),si=X(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$n=X(["#text"]),Fn=X(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sn=X(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Un=X(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rt=X(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ai=ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),li=ie(/<%[\w\W]*|[\w\W]*%>/gm),ci=ie(/\$\{[\w\W]*/gm),ui=ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),fi=ie(/^aria-[\-\w]+$/),Hn=ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pi=ie(/^(?:\w+script|data):/i),hi=ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bn=ie(/^html$/i),di=ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var Wn=Object.freeze({__proto__:null,ARIA_ATTR:fi,ATTR_WHITESPACE:hi,CUSTOM_ELEMENT:di,DATA_ATTR:ui,DOCTYPE_NAME:Bn,ERB_EXPR:li,IS_ALLOWED_URI:Hn,IS_SCRIPT_OR_DATA:pi,MUSTACHE_EXPR:ai,TMPLIT_EXPR:ci});const it={element:1,text:3,progressingInstruction:7,comment:8,document:9},mi=function(){return typeof window>"u"?null:window},gi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Gn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Yn(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mi();const e=d=>Yn(d);if(e.version="3.3.1",e.removed=[],!l||!l.document||l.document.nodeType!==it.document||!l.Element)return e.isSupported=!1,e;let{document:t}=l;const n=t,r=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:u,NodeFilter:x,NamedNodeMap:h=l.NamedNodeMap||l.MozNamedAttrMap,HTMLFormElement:w,DOMParser:g,trustedTypes:E}=l,T=u.prototype,m=rt(T,"cloneNode"),C=rt(T,"remove"),j=rt(T,"nextSibling"),M=rt(T,"childNodes"),ee=rt(T,"parentNode");if(typeof s=="function"){const d=t.createElement("template");d.content&&d.content.ownerDocument&&(t=d.content.ownerDocument)}let W,ce="";const{implementation:ot,createNodeIterator:an,createDocumentFragment:ln,getElementsByTagName:Ot}=t,{importNode:cn}=n;let Y=Gn();e.isSupported=typeof Nn=="function"&&typeof ee=="function"&&ot&&ot.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ze,ERB_EXPR:oe,TMPLIT_EXPR:ue,DATA_ATTR:Ne,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:Lt,ATTR_WHITESPACE:st,CUSTOM_ELEMENT:It}=Wn;let{IS_ALLOWED_URI:at}=Wn,H=null;const lt=A({},[...zn,...nn,...rn,...on,...$n]);let G=null;const Dt=A({},[...Fn,...sn,...Un,...Rt]);let U=Object.seal(Kt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,Me=null;const fe=Object.seal(Kt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $e=!0,Se=!0,Pt=!1,ct=!0,Ae=!1,Fe=!0,se=!1,xe=!1,Ue=!1,Te=!1,we=!1,He=!1,Nt=!0,Be=!1;const un="user-content-";let ut=!0,Re=!1,_e={},ne=null;const ft=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let pt=null;const ht=A({},["audio","video","img","source","image","track"]);let dt=null;const Mt=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ge="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let Oe=pe,mt=!1,je=null;const jt=A({},[We,Ge,pe],en);let he=A({},["mi","mo","mn","ms","mtext"]),Ce=A({},["annotation-xml"]);const gt=A({},["title","style","font","a","script"]);let Le=null;const fn=["application/xhtml+xml","text/html"],zt="text/html";let B=null,ye=null;const $t=t.createElement("form"),Ft=function(i){return i instanceof RegExp||i instanceof Function},kt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ye&&ye===i)){if((!i||typeof i!="object")&&(i={}),i=ke(i),Le=fn.indexOf(i.PARSER_MEDIA_TYPE)===-1?zt:i.PARSER_MEDIA_TYPE,B=Le==="application/xhtml+xml"?en:At,H=le(i,"ALLOWED_TAGS")?A({},i.ALLOWED_TAGS,B):lt,G=le(i,"ALLOWED_ATTR")?A({},i.ALLOWED_ATTR,B):Dt,je=le(i,"ALLOWED_NAMESPACES")?A({},i.ALLOWED_NAMESPACES,en):jt,dt=le(i,"ADD_URI_SAFE_ATTR")?A(ke(Mt),i.ADD_URI_SAFE_ATTR,B):Mt,pt=le(i,"ADD_DATA_URI_TAGS")?A(ke(ht),i.ADD_DATA_URI_TAGS,B):ht,ne=le(i,"FORBID_CONTENTS")?A({},i.FORBID_CONTENTS,B):ft,be=le(i,"FORBID_TAGS")?A({},i.FORBID_TAGS,B):ke({}),Me=le(i,"FORBID_ATTR")?A({},i.FORBID_ATTR,B):ke({}),_e=le(i,"USE_PROFILES")?i.USE_PROFILES:!1,$e=i.ALLOW_ARIA_ATTR!==!1,Se=i.ALLOW_DATA_ATTR!==!1,Pt=i.ALLOW_UNKNOWN_PROTOCOLS||!1,ct=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=i.SAFE_FOR_TEMPLATES||!1,Fe=i.SAFE_FOR_XML!==!1,se=i.WHOLE_DOCUMENT||!1,Te=i.RETURN_DOM||!1,we=i.RETURN_DOM_FRAGMENT||!1,He=i.RETURN_TRUSTED_TYPE||!1,Ue=i.FORCE_BODY||!1,Nt=i.SANITIZE_DOM!==!1,Be=i.SANITIZE_NAMED_PROPS||!1,ut=i.KEEP_CONTENT!==!1,Re=i.IN_PLACE||!1,at=i.ALLOWED_URI_REGEXP||Hn,Oe=i.NAMESPACE||pe,he=i.MATHML_TEXT_INTEGRATION_POINTS||he,Ce=i.HTML_INTEGRATION_POINTS||Ce,U=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&Ft(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&Ft(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ae&&(Se=!1),we&&(Te=!0),_e&&(H=A({},$n),G=[],_e.html===!0&&(A(H,zn),A(G,Fn)),_e.svg===!0&&(A(H,nn),A(G,sn),A(G,Rt)),_e.svgFilters===!0&&(A(H,rn),A(G,sn),A(G,Rt)),_e.mathMl===!0&&(A(H,on),A(G,Un),A(G,Rt))),i.ADD_TAGS&&(typeof i.ADD_TAGS=="function"?fe.tagCheck=i.ADD_TAGS:(H===lt&&(H=ke(H)),A(H,i.ADD_TAGS,B))),i.ADD_ATTR&&(typeof i.ADD_ATTR=="function"?fe.attributeCheck=i.ADD_ATTR:(G===Dt&&(G=ke(G)),A(G,i.ADD_ATTR,B))),i.ADD_URI_SAFE_ATTR&&A(dt,i.ADD_URI_SAFE_ATTR,B),i.FORBID_CONTENTS&&(ne===ft&&(ne=ke(ne)),A(ne,i.FORBID_CONTENTS,B)),i.ADD_FORBID_CONTENTS&&(ne===ft&&(ne=ke(ne)),A(ne,i.ADD_FORBID_CONTENTS,B)),ut&&(H["#text"]=!0),se&&A(H,["html","head","body"]),H.table&&(A(H,["tbody"]),delete be.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');W=i.TRUSTED_TYPES_POLICY,ce=W.createHTML("")}else W===void 0&&(W=gi(E,r)),W!==null&&typeof ce=="string"&&(ce=W.createHTML(""));X&&X(i),ye=i}},bt=A({},[...nn,...rn,...oi]),xt=A({},[...on,...si]),pn=function(i){let f=ee(i);(!f||!f.tagName)&&(f={namespaceURI:Oe,tagName:"template"});const b=At(i.tagName),L=At(f.tagName);return je[i.namespaceURI]?i.namespaceURI===Ge?f.namespaceURI===pe?b==="svg":f.namespaceURI===We?b==="svg"&&(L==="annotation-xml"||he[L]):!!bt[b]:i.namespaceURI===We?f.namespaceURI===pe?b==="math":f.namespaceURI===Ge?b==="math"&&Ce[L]:!!xt[b]:i.namespaceURI===pe?f.namespaceURI===Ge&&!Ce[L]||f.namespaceURI===We&&!he[L]?!1:!xt[b]&&(gt[b]||!bt[b]):!!(Le==="application/xhtml+xml"&&je[i.namespaceURI]):!1},ae=function(i){et(e.removed,{element:i});try{ee(i).removeChild(i)}catch{C(i)}},Ee=function(i,f){try{et(e.removed,{attribute:f.getAttributeNode(i),from:f})}catch{et(e.removed,{attribute:null,from:f})}if(f.removeAttribute(i),i==="is")if(Te||we)try{ae(f)}catch{}else try{f.setAttribute(i,"")}catch{}},Ut=function(i){let f=null,b=null;if(Ue)i="<remove></remove>"+i;else{const F=tn(i,/^[\r\n\t ]+/);b=F&&F[0]}Le==="application/xhtml+xml"&&Oe===pe&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const L=W?W.createHTML(i):i;if(Oe===pe)try{f=new g().parseFromString(L,Le)}catch{}if(!f||!f.documentElement){f=ot.createDocument(Oe,"template",null);try{f.documentElement.innerHTML=mt?ce:L}catch{}}const I=f.body||f.documentElement;return i&&b&&I.insertBefore(t.createTextNode(b),I.childNodes[0]||null),Oe===pe?Ot.call(f,se?"html":"body")[0]:se?f.documentElement:I},o=function(i){return an.call(i.ownerDocument||i,i,x.SHOW_ELEMENT|x.SHOW_COMMENT|x.SHOW_TEXT|x.SHOW_PROCESSING_INSTRUCTION|x.SHOW_CDATA_SECTION,null)},p=function(i){return i instanceof w&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof h)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},k=function(i){return typeof c=="function"&&i instanceof c};function y(d,i,f){St(d,b=>{b.call(e,i,f,ye)})}const O=function(i){let f=null;if(y(Y.beforeSanitizeElements,i,null),p(i))return ae(i),!0;const b=B(i.nodeName);if(y(Y.uponSanitizeElement,i,{tagName:b,allowedTags:H}),Fe&&i.hasChildNodes()&&!k(i.firstElementChild)&&K(/<[/\w!]/g,i.innerHTML)&&K(/<[/\w!]/g,i.textContent)||i.nodeType===it.progressingInstruction||Fe&&i.nodeType===it.comment&&K(/<[/\w]/g,i.data))return ae(i),!0;if(!(fe.tagCheck instanceof Function&&fe.tagCheck(b))&&(!H[b]||be[b])){if(!be[b]&&R(b)&&(U.tagNameCheck instanceof RegExp&&K(U.tagNameCheck,b)||U.tagNameCheck instanceof Function&&U.tagNameCheck(b)))return!1;if(ut&&!ne[b]){const L=ee(i)||i.parentNode,I=M(i)||i.childNodes;if(I&&L){const F=I.length;for(let Z=F-1;Z>=0;--Z){const de=m(I[Z],!0);de.__removalCount=(i.__removalCount||0)+1,L.insertBefore(de,j(i))}}}return ae(i),!0}return i instanceof u&&!pn(i)||(b==="noscript"||b==="noembed"||b==="noframes")&&K(/<\/no(script|embed|frames)/i,i.innerHTML)?(ae(i),!0):(Ae&&i.nodeType===it.text&&(f=i.textContent,St([ze,oe,ue],L=>{f=tt(f,L," ")}),i.textContent!==f&&(et(e.removed,{element:i.cloneNode()}),i.textContent=f)),y(Y.afterSanitizeElements,i,null),!1)},P=function(i,f,b){if(Nt&&(f==="id"||f==="name")&&(b in t||b in $t))return!1;if(!(Se&&!Me[f]&&K(Ne,f))){if(!($e&&K(Ct,f))){if(!(fe.attributeCheck instanceof Function&&fe.attributeCheck(f,i))){if(!G[f]||Me[f]){if(!(R(i)&&(U.tagNameCheck instanceof RegExp&&K(U.tagNameCheck,i)||U.tagNameCheck instanceof Function&&U.tagNameCheck(i))&&(U.attributeNameCheck instanceof RegExp&&K(U.attributeNameCheck,f)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(f,i))||f==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&K(U.tagNameCheck,b)||U.tagNameCheck instanceof Function&&U.tagNameCheck(b))))return!1}else if(!dt[f]){if(!K(at,tt(b,st,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&i!=="script"&&ti(b,"data:")===0&&pt[i])){if(!(Pt&&!K(Lt,tt(b,st,"")))){if(b)return!1}}}}}}}return!0},R=function(i){return i!=="annotation-xml"&&tn(i,It)},S=function(i){y(Y.beforeSanitizeAttributes,i,null);const{attributes:f}=i;if(!f||p(i))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let L=f.length;for(;L--;){const I=f[L],{name:F,namespaceURI:Z,value:de}=I,Ye=B(F),hn=de;let q=F==="value"?hn:ni(hn);if(b.attrName=Ye,b.attrValue=q,b.keepAttr=!0,b.forceKeepAttr=void 0,y(Y.uponSanitizeAttribute,i,b),q=b.attrValue,Be&&(Ye==="id"||Ye==="name")&&(Ee(F,i),q=un+q),Fe&&K(/((--!?|])>)|<\/(style|title|textarea)/i,q)){Ee(F,i);continue}if(Ye==="attributename"&&tn(q,"href")){Ee(F,i);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){Ee(F,i);continue}if(!ct&&K(/\/>/i,q)){Ee(F,i);continue}Ae&&St([ze,oe,ue],Zn=>{q=tt(q,Zn," ")});const qn=B(i.nodeName);if(!P(qn,Ye,q)){Ee(F,i);continue}if(W&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Z)switch(E.getAttributeType(qn,Ye)){case"TrustedHTML":{q=W.createHTML(q);break}case"TrustedScriptURL":{q=W.createScriptURL(q);break}}if(q!==hn)try{Z?i.setAttributeNS(Z,F,q):i.setAttribute(F,q),p(i)?ae(i):jn(e.removed)}catch{Ee(F,i)}}y(Y.afterSanitizeAttributes,i,null)},V=function d(i){let f=null;const b=o(i);for(y(Y.beforeSanitizeShadowDOM,i,null);f=b.nextNode();)y(Y.uponSanitizeShadowNode,f,null),O(f),S(f),f.content instanceof a&&d(f.content);y(Y.afterSanitizeShadowDOM,i,null)};return e.sanitize=function(d){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,b=null,L=null,I=null;if(mt=!d,mt&&(d="<!-->"),typeof d!="string"&&!k(d))if(typeof d.toString=="function"){if(d=d.toString(),typeof d!="string")throw nt("dirty is not a string, aborting")}else throw nt("toString is not a function");if(!e.isSupported)return d;if(xe||kt(i),e.removed=[],typeof d=="string"&&(Re=!1),Re){if(d.nodeName){const de=B(d.nodeName);if(!H[de]||be[de])throw nt("root node is forbidden and cannot be sanitized in-place")}}else if(d instanceof c)f=Ut("<!---->"),b=f.ownerDocument.importNode(d,!0),b.nodeType===it.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?f=b:f.appendChild(b);else{if(!Te&&!Ae&&!se&&d.indexOf("<")===-1)return W&&He?W.createHTML(d):d;if(f=Ut(d),!f)return Te?null:He?ce:""}f&&Ue&&ae(f.firstChild);const F=o(Re?d:f);for(;L=F.nextNode();)O(L),S(L),L.content instanceof a&&V(L.content);if(Re)return d;if(Te){if(we)for(I=ln.call(f.ownerDocument);f.firstChild;)I.appendChild(f.firstChild);else I=f;return(G.shadowroot||G.shadowrootmode)&&(I=cn.call(n,I,!0)),I}let Z=se?f.outerHTML:f.innerHTML;return se&&H["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&K(Bn,f.ownerDocument.doctype.name)&&(Z="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
77
- `+Z),Ae&&St([ze,oe,ue],de=>{Z=tt(Z,de," ")}),W&&He?W.createHTML(Z):Z},e.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kt(d),xe=!0},e.clearConfig=function(){ye=null,xe=!1},e.isValidAttribute=function(d,i,f){ye||kt({});const b=B(d),L=B(i);return P(b,L,f)},e.addHook=function(d,i){typeof i=="function"&&et(Y[d],i)},e.removeHook=function(d,i){if(i!==void 0){const f=Jr(Y[d],i);return f===-1?void 0:ei(Y[d],f,1)[0]}return jn(Y[d])},e.removeHooks=function(d){Y[d]=[]},e.removeAllHooks=function(){Y=Gn()},e}var ki=Yn();const bi={heading(l,e,t){typeof l=="object"&&l!==null&&(t=l.raw||t,e=l.depth||l.level||e,l=l.text||"");const r=(t||String(l)).toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"");return`<h${e} id="${r}">${l}</h${e}>`}};D.use({renderer:bi});function xi(l){const e=D.parse(l);return ki.sanitize(e,{ADD_ATTR:["id","name"],ADD_TAGS:["h1","h2","h3","h4","h5","h6"]})}const Ti=({content:l,filename:e,onClose:t})=>{const[n,r]=v.useState(""),[a,s]=v.useState(!1),[c,u]=v.useState(!1);v.useEffect(()=>{if(l){const g=xi(l);r(g)}},[l]),v.useEffect(()=>{const g=T=>{var C;const m=(C=T.target.getAttribute("href"))==null?void 0:C.substring(1);if(m){const j=document.getElementById(m);j&&(T.preventDefault(),j.scrollIntoView({behavior:"smooth",block:"start"}))}},E=document.querySelectorAll('.markdown-body a[href^="#"]');return E.forEach(T=>T.addEventListener("click",g)),()=>{E.forEach(T=>T.removeEventListener("click",g))}},[n]);const x=()=>{var g;if(a)window.speechSynthesis.cancel(),s(!1);else{const E=(g=document.getElementById("markdown-content"))==null?void 0:g.innerText;if(!E)return;const T=new SpeechSynthesisUtterance(E);T.rate=1,T.onend=()=>s(!1),T.onerror=()=>s(!1),window.speechSynthesis.speak(T),s(!0)}};v.useEffect(()=>()=>window.speechSynthesis.cancel(),[]);const h=()=>{const g=document.getElementById("markdown-content");if(!g)return;const E=g.innerText,T=g.innerHTML,m=new Blob([T],{type:"text/html"}),C=new Blob([E],{type:"text/plain"}),j=[new ClipboardItem({"text/html":m,"text/plain":C})];navigator.clipboard.write(j).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)}).catch(()=>{navigator.clipboard.writeText(E).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)})})},w=()=>{alert("💡 Tip: To preserve the visual theme in your PDF, make sure to check 'Background graphics' in the print settings window."),window.print()};return _.jsxs("section",{className:"preview-zone",children:[_.jsxs("div",{className:"preview-header",children:[_.jsx("span",{id:"filename-display",children:e||"filename.md"}),_.jsxs("div",{className:"header-actions",children:[_.jsx("button",{className:`icon-btn ${a?"speaking":""}`,onClick:x,title:a?"Stop Reading":"Read Aloud",children:a?_.jsx(fr,{}):_.jsx(hr,{})}),_.jsx("button",{className:"icon-btn",onClick:h,title:"Copy to Clipboard",style:{color:c?"var(--accent-color)":""},children:c?_.jsx(ir,{}):_.jsx(ar,{})}),_.jsx("button",{className:"icon-btn",onClick:w,title:"Save as PDF",children:_.jsx(cr,{})}),_.jsx("button",{className:"icon-btn",onClick:t,title:"Close File",id:"close-btn",children:_.jsx(or,{})})]})]}),_.jsx("div",{id:"markdown-content",className:"markdown-body",dangerouslySetInnerHTML:{__html:n}})]})},Vn=({url:l})=>{const[e,t]=v.useState("light"),[n,r]=v.useState(null),[a,s]=v.useState(!1),c=v.useRef(null);v.useEffect(()=>{const T=localStorage.getItem("theme"),m=window.matchMedia("(prefers-color-scheme: dark)").matches;t(T||(m?"dark":"light"))},[]);const u=()=>{const T=e==="light"?"dark":"light";t(T),localStorage.setItem("theme",T)},x=T=>{try{if(new URL(T).hostname==="github.com"&&T.includes("/blob/"))return T.replace("github.com","raw.githubusercontent.com").replace("/blob/","/")}catch{}return T},h=async T=>{if(T)try{const m=x(T),C=await fetch(m);if(!C.ok)throw new Error("Failed to fetch");const j=await C.text();let M=T.substring(T.lastIndexOf("/")+1)||"remote-file.md";M.includes("?")&&(M=M.split("?")[0]),r({name:M,content:j})}catch(m){console.error("Scripto Load Error:",m)}};v.useEffect(()=>{const T=c.current;if(!T)return;const m=()=>{T.scrollTop>300?s(!0):s(!1)};return T.addEventListener("scroll",m),()=>T.removeEventListener("scroll",m)},[]);const w=()=>{c.current&&c.current.scrollTo({top:0,behavior:"smooth"})},g=T=>{r(T),c.current&&(c.current.scrollTop=0)},E=()=>{r(null);const T=new URL(window.location);T.searchParams.delete("url"),window.history.pushState({},"",T)};return v.useEffect(()=>{const T=new URLSearchParams(window.location.search),m=l||T.get("url");m&&h(m)},[l]),_.jsxs("div",{className:"scripto-wrapper","data-theme":e,children:[_.jsxs("div",{className:"background-blobs",children:[_.jsx("div",{className:"blob blob-1"}),_.jsx("div",{className:"blob blob-2"}),_.jsx("div",{className:"blob blob-3"})]}),_.jsx("button",{id:"theme-toggle","aria-label":"Toggle Theme",onClick:u,children:e==="light"?_.jsx(pr,{}):_.jsx(ur,{})}),_.jsxs("main",{className:"app-container",ref:c,children:[_.jsxs("header",{className:"glass-header",children:[_.jsxs("div",{className:"logo",children:[_.jsx(lr,{}),_.jsxs("h1",{children:["Scr!p",_.jsx("span",{children:"tō"})]})]}),_.jsx("p",{children:"“Simple, elegant visualization — where every mark becomes meaning.”"})]}),n?_.jsx(Ti,{content:n.content,filename:n.name,onClose:E}):_.jsx(mr,{onFileLoaded:g}),_.jsx("footer",{className:"app-footer",children:_.jsxs("p",{children:[" Try it out on  ",_.jsx("a",{href:"https://www.npmjs.com/package/@jojovms/scripto",target:"_blank",rel:"noopener noreferrer",className:"npm-link",title:"View on NPM",children:_.jsx(dr,{style:{fontSize:"2.5em",verticalAlign:"middle",marginRight:"5px"}})}),_.jsx("span",{style:{margin:"0 10px",opacity:.5},children:"|"}),"🎯 App created by ",_.jsx("a",{href:"https://bio.link/shijoshaji",target:"_blank",rel:"noopener noreferrer",children:"Shijo Shaji"})]})})]}),_.jsx("button",{id:"scroll-top-btn","aria-label":"Scroll to Top",className:a?"visible":"",onClick:w,children:_.jsx(rr,{})})]})};$.Scripto=Vn,$.default=Vn,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
45
+ `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const i=Rt(e);if(i===null)return n;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const i=Rt(e);if(i===null)return n;e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class et{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class X{constructor(e){S(this,"options");S(this,"renderer");S(this,"textRenderer");this.options=e||se,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new et}static parse(e,t){return new X(t).parse(e)}static parseInline(e,t){return new X(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const r=o,a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(r.type)){n+=a||"";continue}}switch(o.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const r=o;n+=this.renderer.heading(this.parseInline(r.tokens),r.depth,Xn(this.parseInline(r.tokens,this.textRenderer)));continue}case"code":{const r=o;n+=this.renderer.code(r.text,r.lang,!!r.escaped);continue}case"table":{const r=o;let a="",c="";for(let d=0;d<r.header.length;d++)c+=this.renderer.tablecell(this.parseInline(r.header[d].tokens),{header:!0,align:r.align[d]});a+=this.renderer.tablerow(c);let k="";for(let d=0;d<r.rows.length;d++){const T=r.rows[d];c="";for(let f=0;f<T.length;f++)c+=this.renderer.tablecell(this.parseInline(T[f].tokens),{header:!1,align:r.align[f]});k+=this.renderer.tablerow(c)}n+=this.renderer.table(a,k);continue}case"blockquote":{const r=o,a=this.parse(r.tokens);n+=this.renderer.blockquote(a);continue}case"list":{const r=o,a=r.ordered,c=r.start,k=r.loose;let d="";for(let T=0;T<r.items.length;T++){const f=r.items[T],w=f.checked,m=f.task;let h="";if(f.task){const E=this.renderer.checkbox(!!w);k?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=E+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=E+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:E+" "}):h+=E+" "}h+=this.parse(f.tokens,k),d+=this.renderer.listitem(h,m,!!w)}n+=this.renderer.list(d,a,c);continue}case"html":{const r=o;n+=this.renderer.html(r.text,r.block);continue}case"paragraph":{const r=o;n+=this.renderer.paragraph(this.parseInline(r.tokens));continue}case"text":{let r=o,a=r.tokens?this.parseInline(r.tokens):r.text;for(;i+1<e.length&&e[i+1].type==="text";)r=e[++i],a+=`
46
+ `+(r.tokens?this.parseInline(r.tokens):r.text);n+=t?this.renderer.paragraph(a):a;continue}default:{const r='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const r=this.options.extensions.renderers[o.type].call({parser:this},o);if(r!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=r||"";continue}}switch(o.type){case"escape":{const r=o;n+=t.text(r.text);break}case"html":{const r=o;n+=t.html(r.text);break}case"link":{const r=o;n+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break}case"image":{const r=o;n+=t.image(r.href,r.title,r.text);break}case"strong":{const r=o;n+=t.strong(this.parseInline(r.tokens,t));break}case"em":{const r=o;n+=t.em(this.parseInline(r.tokens,t));break}case"codespan":{const r=o;n+=t.codespan(r.text);break}case"br":{n+=t.br();break}case"del":{const r=o;n+=t.del(this.parseInline(r.tokens,t));break}case"text":{const r=o;n+=t.text(r.text);break}default:{const r='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return n}}class xe{constructor(e){S(this,"options");this.options=e||se}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}S(xe,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ai{constructor(...e){In(this,le);S(this,"defaults",Ze());S(this,"options",this.setOptions);S(this,"parse",qe(this,le,St).call(this,V.lex,X.parse));S(this,"parseInline",qe(this,le,St).call(this,V.lexInline,X.parseInline));S(this,"Parser",X);S(this,"Renderer",Me);S(this,"TextRenderer",et);S(this,"Lexer",V);S(this,"Tokenizer",Oe);S(this,"Hooks",xe);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const a=r;for(const c of a.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const k of c)n=n.concat(this.walkTokens(k.tokens,t));break}case"list":{const a=r;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=r;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const k=a[c].flat(1/0);n=n.concat(this.walkTokens(k,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),n.renderer){const o=this.defaults.renderer||new Me(this.defaults);for(const r in n.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(r==="options")continue;const a=r,c=n.renderer[a],k=o[a];o[a]=(...d)=>{let T=c.apply(o,d);return T===!1&&(T=k.apply(o,d)),T||""}}i.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Oe(this.defaults);for(const r in n.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,c=n.tokenizer[a],k=o[a];o[a]=(...d)=>{let T=c.apply(o,d);return T===!1&&(T=k.apply(o,d)),T}}i.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new xe;for(const r in n.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,c=n.hooks[a],k=o[a];xe.passThroughHooks.has(r)?o[a]=d=>{if(this.defaults.async)return Promise.resolve(c.call(o,d)).then(f=>k.call(o,f));const T=c.call(o,d);return k.call(o,T)}:o[a]=(...d)=>{let T=c.apply(o,d);return T===!1&&(T=k.apply(o,d)),T}}i.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,r=n.walkTokens;i.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),o&&(c=c.concat(o.call(this,a))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return V.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}}le=new WeakSet,St=function(e,t){return(n,i)=>{const o={...i},r={...this.defaults,...o};this.defaults.async===!0&&o.async===!1&&(r.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),r.async=!0);const a=qe(this,le,Cn).call(this,!!r.silent,!!r.async);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(c=>e(c,r)).then(c=>r.hooks?r.hooks.processAllTokens(c):c).then(c=>r.walkTokens?Promise.all(this.walkTokens(c,r.walkTokens)).then(()=>c):c).then(c=>t(c,r)).then(c=>r.hooks?r.hooks.postprocess(c):c).catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));let c=e(n,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let k=t(c,r);return r.hooks&&(k=r.hooks.postprocess(k)),k}catch(c){return a(c)}}},Cn=function(e,t){return n=>{if(n.message+=`
47
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}};const oe=new Ai;function _(l,e){return oe.parse(l,e)}_.options=_.setOptions=function(l){return oe.setOptions(l),_.defaults=oe.defaults,Ct(_.defaults),_},_.getDefaults=Ze,_.defaults=se,_.use=function(...l){return oe.use(...l),_.defaults=oe.defaults,Ct(_.defaults),_},_.walkTokens=function(l,e){return oe.walkTokens(l,e)},_.parseInline=oe.parseInline,_.Parser=X,_.parser=X.parse,_.Renderer=Me,_.TextRenderer=et,_.Lexer=V,_.lexer=V.lex,_.Tokenizer=Oe,_.Hooks=xe,_.parse=_,_.options,_.setOptions,_.use,_.walkTokens,_.parseInline,X.parse,V.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Gt,setPrototypeOf:qt,isFrozen:Si,getPrototypeOf:Li,getOwnPropertyDescriptor:vi}=Object;let{freeze:$,seal:G,create:tt}=Object,{apply:nt,construct:it}=typeof Reflect<"u"&&Reflect;$||($=function(e){return e}),G||(G=function(e){return e}),nt||(nt=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(t,i)}),it||(it=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const ze=F(Array.prototype.forEach),Ii=F(Array.prototype.lastIndexOf),Zt=F(Array.prototype.pop),ye=F(Array.prototype.push),Ci=F(Array.prototype.splice),Pe=F(String.prototype.toLowerCase),rt=F(String.prototype.toString),st=F(String.prototype.match),_e=F(String.prototype.replace),Oi=F(String.prototype.indexOf),Di=F(String.prototype.trim),Z=F(Object.prototype.hasOwnProperty),U=F(RegExp.prototype.test),Ee=Ni(TypeError);function F(l){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return nt(l,e,n)}}function Ni(l){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return it(l,t)}}function x(l,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pe;qt&&qt(l,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=t(i);o!==i&&(Si(e)||(e[n]=o),i=o)}l[i]=!0}return l}function Ri(l){for(let e=0;e<l.length;e++)Z(l,e)||(l[e]=null);return l}function Q(l){const e=tt(null);for(const[t,n]of Gt(l))Z(l,t)&&(Array.isArray(n)?e[t]=Ri(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=Q(n):e[t]=n);return e}function Ae(l,e){for(;l!==null;){const n=vi(l,e);if(n){if(n.get)return F(n.get);if(typeof n.value=="function")return F(n.value)}l=Li(l)}function t(){return null}return t}const Yt=$(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ot=$(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lt=$(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Mi=$(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),at=$(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zi=$(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vt=$(["#text"]),Xt=$(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ct=$(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Qt=$(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$e=$(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pi=G(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$i=G(/<%[\w\W]*|[\w\W]*%>/gm),Ui=G(/\$\{[\w\W]*/gm),Fi=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hi=G(/^aria-[\-\w]+$/),Kt=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bi=G(/^(?:\w+script|data):/i),Wi=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jt=G(/^html$/i),ji=G(/^[a-z][.\w]*(-[.\w]+)+$/i);var en=Object.freeze({__proto__:null,ARIA_ATTR:Hi,ATTR_WHITESPACE:Wi,CUSTOM_ELEMENT:ji,DATA_ATTR:Fi,DOCTYPE_NAME:Jt,ERB_EXPR:$i,IS_ALLOWED_URI:Kt,IS_SCRIPT_OR_DATA:Bi,MUSTACHE_EXPR:Pi,TMPLIT_EXPR:Ui});const Se={element:1,text:3,progressingInstruction:7,comment:8,document:9},Gi=function(){return typeof window>"u"?null:window},qi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},tn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nn(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gi();const e=b=>nn(b);if(e.version="3.3.1",e.removed=[],!l||!l.document||l.document.nodeType!==Se.document||!l.Element)return e.isSupported=!1,e;let{document:t}=l;const n=t,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:c,NodeFilter:k,NamedNodeMap:d=l.NamedNodeMap||l.MozNamedAttrMap,HTMLFormElement:T,DOMParser:f,trustedTypes:w}=l,m=c.prototype,h=Ae(m,"cloneNode"),E=Ae(m,"remove"),D=Ae(m,"nextSibling"),Y=Ae(m,"childNodes"),q=Ae(m,"parentNode");if(typeof r=="function"){const b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let N,ee="";const{implementation:ut,createNodeIterator:Ki,createDocumentFragment:Ji,getElementsByTagName:er}=t,{importNode:tr}=n;let H=tn();e.isSupported=typeof Gt=="function"&&typeof q=="function"&&ut&&ut.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pt,ERB_EXPR:ht,TMPLIT_EXPR:ft,DATA_ATTR:nr,ARIA_ATTR:ir,IS_SCRIPT_OR_DATA:rr,ATTR_WHITESPACE:rn,CUSTOM_ELEMENT:sr}=en;let{IS_ALLOWED_URI:sn}=en,R=null;const on=x({},[...Yt,...ot,...lt,...at,...Vt]);let M=null;const ln=x({},[...Xt,...ct,...Qt,...$e]);let I=Object.seal(tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Le=null,dt=null;const ue=Object.seal(tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let an=!0,gt=!0,cn=!1,un=!0,pe=!1,Ue=!0,ae=!1,mt=!1,kt=!1,he=!1,Fe=!1,He=!1,pn=!0,hn=!1;const or="user-content-";let bt=!0,ve=!1,fe={},K=null;const Tt=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let fn=null;const dn=x({},["audio","video","img","source","image","track"]);let wt=null;const gn=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Be="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",te="http://www.w3.org/1999/xhtml";let de=te,xt=!1,yt=null;const lr=x({},[Be,We,te],rt);let je=x({},["mi","mo","mn","ms","mtext"]),Ge=x({},["annotation-xml"]);const ar=x({},["title","style","font","a","script"]);let Ie=null;const cr=["application/xhtml+xml","text/html"],ur="text/html";let O=null,ge=null;const pr=t.createElement("form"),mn=function(s){return s instanceof RegExp||s instanceof Function},_t=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ge&&ge===s)){if((!s||typeof s!="object")&&(s={}),s=Q(s),Ie=cr.indexOf(s.PARSER_MEDIA_TYPE)===-1?ur:s.PARSER_MEDIA_TYPE,O=Ie==="application/xhtml+xml"?rt:Pe,R=Z(s,"ALLOWED_TAGS")?x({},s.ALLOWED_TAGS,O):on,M=Z(s,"ALLOWED_ATTR")?x({},s.ALLOWED_ATTR,O):ln,yt=Z(s,"ALLOWED_NAMESPACES")?x({},s.ALLOWED_NAMESPACES,rt):lr,wt=Z(s,"ADD_URI_SAFE_ATTR")?x(Q(gn),s.ADD_URI_SAFE_ATTR,O):gn,fn=Z(s,"ADD_DATA_URI_TAGS")?x(Q(dn),s.ADD_DATA_URI_TAGS,O):dn,K=Z(s,"FORBID_CONTENTS")?x({},s.FORBID_CONTENTS,O):Tt,Le=Z(s,"FORBID_TAGS")?x({},s.FORBID_TAGS,O):Q({}),dt=Z(s,"FORBID_ATTR")?x({},s.FORBID_ATTR,O):Q({}),fe=Z(s,"USE_PROFILES")?s.USE_PROFILES:!1,an=s.ALLOW_ARIA_ATTR!==!1,gt=s.ALLOW_DATA_ATTR!==!1,cn=s.ALLOW_UNKNOWN_PROTOCOLS||!1,un=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=s.SAFE_FOR_TEMPLATES||!1,Ue=s.SAFE_FOR_XML!==!1,ae=s.WHOLE_DOCUMENT||!1,he=s.RETURN_DOM||!1,Fe=s.RETURN_DOM_FRAGMENT||!1,He=s.RETURN_TRUSTED_TYPE||!1,kt=s.FORCE_BODY||!1,pn=s.SANITIZE_DOM!==!1,hn=s.SANITIZE_NAMED_PROPS||!1,bt=s.KEEP_CONTENT!==!1,ve=s.IN_PLACE||!1,sn=s.ALLOWED_URI_REGEXP||Kt,de=s.NAMESPACE||te,je=s.MATHML_TEXT_INTEGRATION_POINTS||je,Ge=s.HTML_INTEGRATION_POINTS||Ge,I=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&mn(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&mn(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),pe&&(gt=!1),Fe&&(he=!0),fe&&(R=x({},Vt),M=[],fe.html===!0&&(x(R,Yt),x(M,Xt)),fe.svg===!0&&(x(R,ot),x(M,ct),x(M,$e)),fe.svgFilters===!0&&(x(R,lt),x(M,ct),x(M,$e)),fe.mathMl===!0&&(x(R,at),x(M,Qt),x(M,$e))),s.ADD_TAGS&&(typeof s.ADD_TAGS=="function"?ue.tagCheck=s.ADD_TAGS:(R===on&&(R=Q(R)),x(R,s.ADD_TAGS,O))),s.ADD_ATTR&&(typeof s.ADD_ATTR=="function"?ue.attributeCheck=s.ADD_ATTR:(M===ln&&(M=Q(M)),x(M,s.ADD_ATTR,O))),s.ADD_URI_SAFE_ATTR&&x(wt,s.ADD_URI_SAFE_ATTR,O),s.FORBID_CONTENTS&&(K===Tt&&(K=Q(K)),x(K,s.FORBID_CONTENTS,O)),s.ADD_FORBID_CONTENTS&&(K===Tt&&(K=Q(K)),x(K,s.ADD_FORBID_CONTENTS,O)),bt&&(R["#text"]=!0),ae&&x(R,["html","head","body"]),R.table&&(x(R,["tbody"]),delete Le.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=s.TRUSTED_TYPES_POLICY,ee=N.createHTML("")}else N===void 0&&(N=qi(w,i)),N!==null&&typeof ee=="string"&&(ee=N.createHTML(""));$&&$(s),ge=s}},kn=x({},[...ot,...lt,...Mi]),bn=x({},[...at,...zi]),hr=function(s){let u=q(s);(!u||!u.tagName)&&(u={namespaceURI:de,tagName:"template"});const g=Pe(s.tagName),v=Pe(u.tagName);return yt[s.namespaceURI]?s.namespaceURI===We?u.namespaceURI===te?g==="svg":u.namespaceURI===Be?g==="svg"&&(v==="annotation-xml"||je[v]):!!kn[g]:s.namespaceURI===Be?u.namespaceURI===te?g==="math":u.namespaceURI===We?g==="math"&&Ge[v]:!!bn[g]:s.namespaceURI===te?u.namespaceURI===We&&!Ge[v]||u.namespaceURI===Be&&!je[v]?!1:!bn[g]&&(ar[g]||!kn[g]):!!(Ie==="application/xhtml+xml"&&yt[s.namespaceURI]):!1},J=function(s){ye(e.removed,{element:s});try{q(s).removeChild(s)}catch{E(s)}},ce=function(s,u){try{ye(e.removed,{attribute:u.getAttributeNode(s),from:u})}catch{ye(e.removed,{attribute:null,from:u})}if(u.removeAttribute(s),s==="is")if(he||Fe)try{J(u)}catch{}else try{u.setAttribute(s,"")}catch{}},Tn=function(s){let u=null,g=null;if(kt)s="<remove></remove>"+s;else{const C=st(s,/^[\r\n\t ]+/);g=C&&C[0]}Ie==="application/xhtml+xml"&&de===te&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const v=N?N.createHTML(s):s;if(de===te)try{u=new f().parseFromString(v,Ie)}catch{}if(!u||!u.documentElement){u=ut.createDocument(de,"template",null);try{u.documentElement.innerHTML=xt?ee:v}catch{}}const P=u.body||u.documentElement;return s&&g&&P.insertBefore(t.createTextNode(g),P.childNodes[0]||null),de===te?er.call(u,ae?"html":"body")[0]:ae?u.documentElement:P},wn=function(s){return Ki.call(s.ownerDocument||s,s,k.SHOW_ELEMENT|k.SHOW_COMMENT|k.SHOW_TEXT|k.SHOW_PROCESSING_INSTRUCTION|k.SHOW_CDATA_SECTION,null)},Et=function(s){return s instanceof T&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof d)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},xn=function(s){return typeof a=="function"&&s instanceof a};function ne(b,s,u){ze(b,g=>{g.call(e,s,u,ge)})}const yn=function(s){let u=null;if(ne(H.beforeSanitizeElements,s,null),Et(s))return J(s),!0;const g=O(s.nodeName);if(ne(H.uponSanitizeElement,s,{tagName:g,allowedTags:R}),Ue&&s.hasChildNodes()&&!xn(s.firstElementChild)&&U(/<[/\w!]/g,s.innerHTML)&&U(/<[/\w!]/g,s.textContent)||s.nodeType===Se.progressingInstruction||Ue&&s.nodeType===Se.comment&&U(/<[/\w]/g,s.data))return J(s),!0;if(!(ue.tagCheck instanceof Function&&ue.tagCheck(g))&&(!R[g]||Le[g])){if(!Le[g]&&En(g)&&(I.tagNameCheck instanceof RegExp&&U(I.tagNameCheck,g)||I.tagNameCheck instanceof Function&&I.tagNameCheck(g)))return!1;if(bt&&!K[g]){const v=q(s)||s.parentNode,P=Y(s)||s.childNodes;if(P&&v){const C=P.length;for(let B=C-1;B>=0;--B){const ie=h(P[B],!0);ie.__removalCount=(s.__removalCount||0)+1,v.insertBefore(ie,D(s))}}}return J(s),!0}return s instanceof c&&!hr(s)||(g==="noscript"||g==="noembed"||g==="noframes")&&U(/<\/no(script|embed|frames)/i,s.innerHTML)?(J(s),!0):(pe&&s.nodeType===Se.text&&(u=s.textContent,ze([pt,ht,ft],v=>{u=_e(u,v," ")}),s.textContent!==u&&(ye(e.removed,{element:s.cloneNode()}),s.textContent=u)),ne(H.afterSanitizeElements,s,null),!1)},_n=function(s,u,g){if(pn&&(u==="id"||u==="name")&&(g in t||g in pr))return!1;if(!(gt&&!dt[u]&&U(nr,u))){if(!(an&&U(ir,u))){if(!(ue.attributeCheck instanceof Function&&ue.attributeCheck(u,s))){if(!M[u]||dt[u]){if(!(En(s)&&(I.tagNameCheck instanceof RegExp&&U(I.tagNameCheck,s)||I.tagNameCheck instanceof Function&&I.tagNameCheck(s))&&(I.attributeNameCheck instanceof RegExp&&U(I.attributeNameCheck,u)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(u,s))||u==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&U(I.tagNameCheck,g)||I.tagNameCheck instanceof Function&&I.tagNameCheck(g))))return!1}else if(!wt[u]){if(!U(sn,_e(g,rn,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&s!=="script"&&Oi(g,"data:")===0&&fn[s])){if(!(cn&&!U(rr,_e(g,rn,"")))){if(g)return!1}}}}}}}return!0},En=function(s){return s!=="annotation-xml"&&st(s,sr)},An=function(s){ne(H.beforeSanitizeAttributes,s,null);const{attributes:u}=s;if(!u||Et(s))return;const g={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let v=u.length;for(;v--;){const P=u[v],{name:C,namespaceURI:B,value:ie}=P,me=O(C),At=ie;let z=C==="value"?At:Di(At);if(g.attrName=me,g.attrValue=z,g.keepAttr=!0,g.forceKeepAttr=void 0,ne(H.uponSanitizeAttribute,s,g),z=g.attrValue,hn&&(me==="id"||me==="name")&&(ce(C,s),z=or+z),Ue&&U(/((--!?|])>)|<\/(style|title|textarea)/i,z)){ce(C,s);continue}if(me==="attributename"&&st(z,"href")){ce(C,s);continue}if(g.forceKeepAttr)continue;if(!g.keepAttr){ce(C,s);continue}if(!un&&U(/\/>/i,z)){ce(C,s);continue}pe&&ze([pt,ht,ft],Ln=>{z=_e(z,Ln," ")});const Sn=O(s.nodeName);if(!_n(Sn,me,z)){ce(C,s);continue}if(N&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!B)switch(w.getAttributeType(Sn,me)){case"TrustedHTML":{z=N.createHTML(z);break}case"TrustedScriptURL":{z=N.createScriptURL(z);break}}if(z!==At)try{B?s.setAttributeNS(B,C,z):s.setAttribute(C,z),Et(s)?J(s):Zt(e.removed)}catch{ce(C,s)}}ne(H.afterSanitizeAttributes,s,null)},fr=function b(s){let u=null;const g=wn(s);for(ne(H.beforeSanitizeShadowDOM,s,null);u=g.nextNode();)ne(H.uponSanitizeShadowNode,u,null),yn(u),An(u),u.content instanceof o&&b(u.content);ne(H.afterSanitizeShadowDOM,s,null)};return e.sanitize=function(b){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,g=null,v=null,P=null;if(xt=!b,xt&&(b="<!-->"),typeof b!="string"&&!xn(b))if(typeof b.toString=="function"){if(b=b.toString(),typeof b!="string")throw Ee("dirty is not a string, aborting")}else throw Ee("toString is not a function");if(!e.isSupported)return b;if(mt||_t(s),e.removed=[],typeof b=="string"&&(ve=!1),ve){if(b.nodeName){const ie=O(b.nodeName);if(!R[ie]||Le[ie])throw Ee("root node is forbidden and cannot be sanitized in-place")}}else if(b instanceof a)u=Tn("<!---->"),g=u.ownerDocument.importNode(b,!0),g.nodeType===Se.element&&g.nodeName==="BODY"||g.nodeName==="HTML"?u=g:u.appendChild(g);else{if(!he&&!pe&&!ae&&b.indexOf("<")===-1)return N&&He?N.createHTML(b):b;if(u=Tn(b),!u)return he?null:He?ee:""}u&&kt&&J(u.firstChild);const C=wn(ve?b:u);for(;v=C.nextNode();)yn(v),An(v),v.content instanceof o&&fr(v.content);if(ve)return b;if(he){if(Fe)for(P=Ji.call(u.ownerDocument);u.firstChild;)P.appendChild(u.firstChild);else P=u;return(M.shadowroot||M.shadowrootmode)&&(P=tr.call(n,P,!0)),P}let B=ae?u.outerHTML:u.innerHTML;return ae&&R["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&U(Jt,u.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
48
+ `+B),pe&&ze([pt,ht,ft],ie=>{B=_e(B,ie," ")}),N&&He?N.createHTML(B):B},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(b),mt=!0},e.clearConfig=function(){ge=null,mt=!1},e.isValidAttribute=function(b,s,u){ge||_t({});const g=O(b),v=O(s);return _n(g,v,u)},e.addHook=function(b,s){typeof s=="function"&&ye(H[b],s)},e.removeHook=function(b,s){if(s!==void 0){const u=Ii(H[b],s);return u===-1?void 0:Ci(H[b],u,1)[0]}return Zt(H[b])},e.removeHooks=function(b){H[b]=[]},e.removeAllHooks=function(){H=tn()},e}var Zi=nn();const Yi={heading(l,e,t){typeof l=="object"&&l!==null&&(t=l.raw||t,e=l.depth||l.level||e,l=l.text||"");const i=(t||String(l)).toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"");return`<h${e} id="${i}">${l}</h${e}>`}};_.use({renderer:Yi});function Vi(l){const e=_.parse(l);return Zi.sanitize(e,{ADD_ATTR:["id","name"],ADD_TAGS:["h1","h2","h3","h4","h5","h6"]})}const Xi=({content:l,filename:e,onClose:t})=>{const[n,i]=y.useState(""),[o,r]=y.useState(!1),[a,c]=y.useState(!1);y.useEffect(()=>{if(l){const f=Vi(l);i(f)}},[l]),y.useEffect(()=>{const f=m=>{var E;const h=(E=m.target.getAttribute("href"))==null?void 0:E.substring(1);if(h){const D=document.getElementById(h);D&&(m.preventDefault(),D.scrollIntoView({behavior:"smooth",block:"start"}))}},w=document.querySelectorAll('.markdown-body a[href^="#"]');return w.forEach(m=>m.addEventListener("click",f)),()=>{w.forEach(m=>m.removeEventListener("click",f))}},[n]);const k=()=>{var f;if(o)window.speechSynthesis.cancel(),r(!1);else{const w=(f=document.getElementById("markdown-content"))==null?void 0:f.innerText;if(!w)return;const m=new SpeechSynthesisUtterance(w);m.rate=1,m.onend=()=>r(!1),m.onerror=()=>r(!1),window.speechSynthesis.speak(m),r(!0)}};y.useEffect(()=>()=>window.speechSynthesis.cancel(),[]);const d=()=>{const f=document.getElementById("markdown-content");if(!f)return;const w=f.innerText,m=f.innerHTML,h=new Blob([m],{type:"text/html"}),E=new Blob([w],{type:"text/plain"}),D=[new ClipboardItem({"text/html":h,"text/plain":E})];navigator.clipboard.write(D).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)}).catch(()=>{navigator.clipboard.writeText(w).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})})},T=()=>{alert("💡 Tip: To preserve the visual theme in your PDF, make sure to check 'Background graphics' in the print settings window."),window.print()};return p.jsxs("section",{className:"preview-zone",children:[p.jsxs("div",{className:"preview-header",children:[p.jsx("span",{id:"filename-display",children:e||"filename.md"}),p.jsxs("div",{className:"header-actions",children:[p.jsx("button",{className:`icon-btn ${o?"speaking":""}`,onClick:k,title:o?"Stop Reading":"Read Aloud",children:o?p.jsx(Hn,{}):p.jsx(Wn,{})}),p.jsx("button",{className:"icon-btn",onClick:d,title:"Copy to Clipboard",style:{color:a?"var(--accent-color)":""},children:a?p.jsx(Rn,{}):p.jsx(Pn,{})}),p.jsx("button",{className:"icon-btn",onClick:T,title:"Save as PDF",children:p.jsx(Un,{})}),p.jsx("button",{className:"icon-btn",onClick:t,title:"Close File",id:"close-btn",children:p.jsx(Mn,{})})]})]}),p.jsx("div",{id:"markdown-content",className:"markdown-body",dangerouslySetInnerHTML:{__html:n}})]})},Qi=({url:l})=>{const[e,t]=y.useState("light"),[n,i]=y.useState(null),[o,r]=y.useState(!1),a=y.useRef(null);y.useEffect(()=>{const m=localStorage.getItem("theme"),h=window.matchMedia("(prefers-color-scheme: dark)").matches;t(m||(h?"dark":"light"))},[]);const c=()=>{const m=e==="light"?"dark":"light";t(m),localStorage.setItem("theme",m)},k=m=>{try{if(new URL(m).hostname==="github.com"&&m.includes("/blob/"))return m.replace("github.com","raw.githubusercontent.com").replace("/blob/","/")}catch{}return m},d=async m=>{if(m)try{const h=k(m),E=await fetch(h);if(!E.ok)throw new Error("Failed to fetch");const D=await E.text();let Y=m.substring(m.lastIndexOf("/")+1)||"remote-file.md";Y.includes("?")&&(Y=Y.split("?")[0]),i({name:Y,content:D})}catch(h){console.error("Scripto Load Error:",h)}};y.useEffect(()=>{const m=a.current;if(!m)return;const h=()=>{m.scrollTop>300?r(!0):r(!1)};return m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)},[]);const T=()=>{a.current&&a.current.scrollTo({top:0,behavior:"smooth"})},f=m=>{i(m),a.current&&(a.current.scrollTop=0)},w=()=>{i(null);const m=new URL(window.location);m.searchParams.delete("url"),window.history.pushState({},"",m)};return y.useEffect(()=>{const m=new URLSearchParams(window.location.search),h=l||m.get("url");h&&d(h)},[l]),p.jsxs("div",{className:"scripto-wrapper","data-theme":e,children:[p.jsxs("div",{className:"background-blobs",children:[p.jsx("div",{className:"blob blob-1"}),p.jsx("div",{className:"blob blob-2"}),p.jsx("div",{className:"blob blob-3"})]}),p.jsx("button",{id:"theme-toggle","aria-label":"Toggle Theme",onClick:c,children:e==="light"?p.jsx(Bn,{}):p.jsx(Fn,{})}),p.jsxs("main",{className:"app-container",ref:a,children:[p.jsxs("header",{className:"glass-header",children:[p.jsxs("div",{className:"logo",children:[p.jsx($n,{}),p.jsxs("h1",{children:["Scr!p",p.jsx("span",{children:"tō"})]})]}),p.jsx("p",{children:"“Simple, elegant visualization — where every mark becomes meaning.”"})]}),n?p.jsx(Xi,{content:n.content,filename:n.name,onClose:w}):p.jsx(Gn,{onFileLoaded:f}),p.jsx("footer",{className:"app-footer",children:p.jsxs("p",{children:[" Try it out on  ",p.jsx("a",{href:"https://www.npmjs.com/package/@jojovms/scripto",target:"_blank",rel:"noopener noreferrer",className:"npm-link",title:"View on NPM",children:p.jsx(jn,{style:{fontSize:"2.5em",verticalAlign:"middle",marginRight:"5px"}})}),p.jsx("span",{style:{margin:"0 10px",opacity:.5},children:"|"}),"🎯 App created by ",p.jsx("a",{href:"https://bio.link/shijoshaji",target:"_blank",rel:"noopener noreferrer",children:"Shijo Shaji"})]})})]}),p.jsx("button",{id:"scroll-top-btn","aria-label":"Scroll to Top",className:o?"visible":"",onClick:T,children:p.jsx(Nn,{})})]})};L.Scripto=Qi,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});