@dudousxd/nestjs-media-dashboard 0.16.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/open-console-button.d.ts +1 -1
- package/dist/react/open-console-button.d.ts.map +1 -1
- package/dist/server/index.cjs +111 -43
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +113 -45
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{ArchivePreview-DOdBOvk3.js → ArchivePreview-h5wYCDJT.js} +1 -1
- package/dist/spa/assets/CertificatePreview-Bm4NkGaO.js +127 -0
- package/dist/spa/assets/MarkdownPreview-Cai2BrTH.js +70 -0
- package/dist/spa/assets/ParquetPreview-DfDTL_6f.js +973 -0
- package/dist/spa/assets/{SheetPreview-emR2KQES.js → SheetPreview-Bfq7dI0a.js} +1 -1
- package/dist/spa/assets/{SqlitePreview-I0YTyJ8b.js → SqlitePreview-JTQDjJJ3.js} +1 -1
- package/dist/spa/assets/{index-DIUJb6qa.js → index-Cjax4szq.js} +1 -1
- package/dist/spa/assets/{preview-DcCWrB9M.js → preview-BjGG6sSu.js} +1 -1
- package/dist/spa/assets/styles-Cui6Yy9Y.js +61 -0
- package/dist/spa/index.html +2 -2
- package/dist/spa/preview.html +2 -2
- package/package.json +40 -26
- package/dist/spa/assets/CertificatePreview-mA7wK3Q3.js +0 -118
- package/dist/spa/assets/MarkdownPreview-BNIkmc7p.js +0 -67
- package/dist/spa/assets/ParquetPreview-BjqCCkAM.js +0 -973
- package/dist/spa/assets/styles-CuahvDe0.js +0 -75
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var ui=Object.defineProperty;var pi=(t,e,n)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var E=(t,e,n)=>pi(t,typeof e!="symbol"?e+"":e,n);import{u as hi,j as K,N as fi,F as di,g as gi,e as mi,f as qn,r as jn,B as Gn,m as bi,S as ki}from"./styles-Cui6Yy9Y.js";/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */function Wn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=Array(e);n<e;n++)s[n]=t[n];return s}function _i(t){if(Array.isArray(t))return t}function xi(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var s,i,a,c,u=[],l=!0,m=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(l=(s=a.call(n)).done)&&(u.push(s.value),u.length!==e);l=!0);}catch(d){m=!0,i=d}finally{try{if(!l&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw i}}return u}}function Ti(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function wi(t,e){return _i(t)||xi(t,e)||yi(t,e)||Ti()}function yi(t,e){if(t){if(typeof t=="string")return Wn(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(t,e):void 0}}const br=Object.entries,Zn=Object.setPrototypeOf,Si=Object.isFrozen,kr=Object.getPrototypeOf,_r=Object.getOwnPropertyDescriptor;let v=Object.freeze,U=Object.seal,ve=Object.create,xr=typeof Reflect<"u"&&Reflect,Qt=xr.apply,Kt=xr.construct;v||(v=function(e){return e});U||(U=function(e){return e});Qt||(Qt=function(e,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];return e.apply(n,i)});Kt||(Kt=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new e(...s)});const ae=D(Array.prototype.forEach),Ai=D(Array.prototype.lastIndexOf),Yn=D(Array.prototype.pop),je=D(Array.prototype.push),Ei=D(Array.prototype.slice),Ri=D(Array.prototype.splice),Me=Array.isArray,Ht=Tr(Set),qt=D(Set.prototype.add),Ge=D(Set.prototype.has),we=D(String.prototype.toLowerCase),jt=D(String.prototype.toString),Xn=D(String.prototype.match),We=D(String.prototype.replace),Vn=D(String.prototype.indexOf),Li=D(String.prototype.trim),Oi=D(Number.prototype.toString),Ii=D(Boolean.prototype.toString),Qn=typeof BigInt>"u"?null:D(BigInt.prototype.toString),Kn=typeof Symbol>"u"?null:D(Symbol.prototype.toString),W=D(Object.prototype.hasOwnProperty),Ze=D(Object.prototype.toString),M=D(RegExp.prototype.test),ce=Tr(TypeError);function D(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return Qt(t,e,s)}}function Tr(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Kt(t,n)}}function A(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:we;if(Zn&&Zn(t,null),!Me(e))return t;let s=e.length;for(;s--;){let i=e[s];if(typeof i=="string"){const a=n(i);a!==i&&(Si(e)||(e[s]=a),i=a)}t[i]=!0}return t}function Pi(t){for(let e=0;e<t.length;e++)W(t,e)||(t[e]=null);return t}function Y(t){const e=ve(null);for(const s of br(t)){var n=wi(s,2);const i=n[0],a=n[1];W(t,i)&&(Me(a)?e[i]=Pi(a):a&&typeof a=="object"&&a.constructor===Object?e[i]=Y(a):e[i]=a)}return e}function Di(t){switch(typeof t){case"string":return t;case"number":return Oi(t);case"boolean":return Ii(t);case"bigint":return Qn?Qn(t):"0";case"symbol":return Kn?Kn(t):"Symbol()";case"undefined":return Ze(t);case"function":case"object":{if(t===null)return Ze(t);const e=t,n=X(e,"toString");if(typeof n=="function"){const s=n(e);return typeof s=="string"?s:Ze(s)}return Ze(t)}default:return Ze(t)}}function X(t,e){for(;t!==null;){const s=_r(t,e);if(s){if(s.get)return D(s.get);if(typeof s.value=="function")return D(s.value)}t=kr(t)}function n(){return null}return n}function zi(t,e){for(;t!==null;){const n=_r(t,e);if(n)return n.get?D(n.get):null;t=kr(t)}return null}function Ci(t){try{return M(t,""),!0}catch{return!1}}const Jn=v(["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"]),Gt=v(["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"]),Wt=v(["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"]),Ni=v(["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"]),Zt=v(["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"]),vi=v(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),er=v(["#text"]),tr=v(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Yt=v(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),nr=v(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),ut=v(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Mi=U(/{{[\w\W]*|^[\w\W]*}}/g),$i=U(/<%[\w\W]*|^[\w\W]*%>/g),Ui=U(/\${[\w\W]*/g),Fi=U(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bi=U(/^aria-[\-\w]+$/),rr=U(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hi=U(/^(?:\w+script|data):/i),qi=U(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ji=U(/^html$/i),Gi=U(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt=U(/<[/\w!]/g),ir=U(/<[/\w]/g),Wi=U(/<\/no(script|embed|frames)/i),sr=U(/\/>/i),C={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Zi=v(A({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Yi=function(){return typeof window>"u"?null:window},Xi=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const a="dompurify"+(s?"#"+s:"");try{return e.createPolicy(a,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},or=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ge=function(e,n,s,i){return W(e,n)&&Me(e[n])?A(i.base?Y(i.base):{},e[n],i.transform):s},Vt=function(e,n,s){const i=W(e,n)?e[n]:void 0;return i&&typeof i=="object"?Y(i):s()};function wr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yi();const e=f=>wr(f);if(e.version="3.4.17",e.removed=[],!t||!t.document||t.document.nodeType!==C.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const s=n,i=s.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,c=t.Node,u=t.Element,l=t.NodeFilter;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const m=t.DOMParser,d=t.trustedTypes,_=u.prototype,g=X(_,"cloneNode"),S=X(_,"remove"),b=X(_,"removeAttributeNode"),L=X(_,"nextSibling"),y=X(_,"childNodes"),B=X(_,"parentNode"),se=X(_,"shadowRoot"),oe=X(_,"attributes"),te=c&&c.prototype?X(c.prototype,"nodeType"):null,pe=c&&c.prototype?X(c.prototype,"nodeName"):null,Ee=c&&c.prototype?X(c.prototype,"ownerDocument"):null,F=function(r){return te?te(r):r.nodeType},V=function(r){return pe?pe(r):r.nodeName},Je=zi(_,"namespaceURI"),bt=function(r){return Je?Je(r):r.namespaceURI};if(typeof a=="function"){const f=n.createElement("template");f.content&&f.content.ownerDocument&&(n=f.content.ownerDocument)}let q,be="",kt,pn=!1,Ue=0;const hn=function(){if(Ue>0)throw ce('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Re=function(r){hn(),Ue++;try{return q.createHTML(r)}finally{Ue--}},Dr=function(r){hn(),Ue++;try{return q.createScriptURL(r)}finally{Ue--}},zr=function(){return pn||(kt=Xi(d,i),pn=!0),kt},et=n,_t=et.implementation,fn=et.createNodeIterator,Cr=et.createDocumentFragment,Nr=et.getElementsByTagName,vr=s.importNode;let O=or();e.isSupported=typeof br=="function"&&typeof B=="function"&&_t&&_t.createHTMLDocument!==void 0;const Mr=Mi,$r=$i,Ur=Ui,Fr=Fi,Br=Bi,Hr=Hi,dn=qi,qr=Gi;let gn=rr,I=null;const xt=A({},[...Jn,...Gt,...Wt,...Zt,...er]);let P=null;const Tt=A({},[...tr,...Yt,...nr,...ut]);let ne=Object.seal(ve(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}})),Fe=null,mn=null;const he=Object.seal(ve(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let bn=!0,wt=!0,kn=!1,yt=!0,le=!1,ke=!0,_e=!1,St=!1,tt=null,nt=null,At=!1,Le=!1,rt=!1,it=!1,_n=!0,xn=!1;const Tn="user-content-";let Et=!0,Rt=!1,xe=null,Oe={},Te=null;const wn=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let yn=null;const Sn=A({},["audio","video","img","source","image","track"]);let An=null;const En=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),st="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",re="http://www.w3.org/1999/xhtml";let Ie=re,Lt=!1,Ot=null;const jr=A({},[st,ot,re],jt),Rn=v(["mi","mo","mn","ms","mtext"]);let It=A({},Rn);const Ln=v(["annotation-xml"]);let Pt=A({},Ln);const Gr=A({},["title","style","font","a","script"]);let Be=null;const Wr=["application/xhtml+xml","text/html"],Zr="text/html";let z=null,Pe=null;const Yr=n.createElement("form"),On=function(r){return r instanceof RegExp||r instanceof Function},Dt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Pe&&Pe===r)return;(!r||typeof r!="object")&&(r={}),r=Y(r),Be=Wr.indexOf(r.PARSER_MEDIA_TYPE)===-1?Zr:r.PARSER_MEDIA_TYPE,z=Be==="application/xhtml+xml"?jt:we,I=ge(r,"ALLOWED_TAGS",xt,{transform:z}),P=ge(r,"ALLOWED_ATTR",Tt,{transform:z}),Ot=ge(r,"ALLOWED_NAMESPACES",jr,{transform:jt}),An=ge(r,"ADD_URI_SAFE_ATTR",En,{transform:z,base:En}),yn=ge(r,"ADD_DATA_URI_TAGS",Sn,{transform:z,base:Sn}),Te=ge(r,"FORBID_CONTENTS",wn,{transform:z}),Fe=ge(r,"FORBID_TAGS",Y({}),{transform:z}),mn=ge(r,"FORBID_ATTR",Y({}),{transform:z}),Oe=W(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?Y(r.USE_PROFILES):r.USE_PROFILES:!1,bn=r.ALLOW_ARIA_ATTR!==!1,wt=r.ALLOW_DATA_ATTR!==!1,kn=r.ALLOW_UNKNOWN_PROTOCOLS||!1,yt=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=r.SAFE_FOR_TEMPLATES||!1,ke=r.SAFE_FOR_XML!==!1,_e=r.WHOLE_DOCUMENT||!1,Le=r.RETURN_DOM||!1,rt=r.RETURN_DOM_FRAGMENT||!1,it=r.RETURN_TRUSTED_TYPE||!1,At=r.FORCE_BODY||!1,_n=r.SANITIZE_DOM!==!1,xn=r.SANITIZE_NAMED_PROPS||!1,Et=r.KEEP_CONTENT!==!1,Rt=r.IN_PLACE||!1,gn=Ci(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:rr,Ie=typeof r.NAMESPACE=="string"?r.NAMESPACE:re,It=Vt(r,"MATHML_TEXT_INTEGRATION_POINTS",()=>A({},Rn)),Pt=Vt(r,"HTML_INTEGRATION_POINTS",()=>A({},Ln));const o=Vt(r,"CUSTOM_ELEMENT_HANDLING",()=>ve(null));if(ne=ve(null),W(o,"tagNameCheck")&&On(o.tagNameCheck)&&(ne.tagNameCheck=o.tagNameCheck),W(o,"attributeNameCheck")&&On(o.attributeNameCheck)&&(ne.attributeNameCheck=o.attributeNameCheck),W(o,"allowCustomizedBuiltInElements")&&typeof o.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=o.allowCustomizedBuiltInElements),U(ne),le&&(wt=!1),rt&&(Le=!0),Oe&&(I=A({},er),P=ve(null),Oe.html===!0&&(A(I,Jn),A(P,tr)),Oe.svg===!0&&(A(I,Gt),A(P,Yt),A(P,ut)),Oe.svgFilters===!0&&(A(I,Wt),A(P,Yt),A(P,ut)),Oe.mathMl===!0&&(A(I,Zt),A(P,nr),A(P,ut))),he.tagCheck=null,he.attributeCheck=null,W(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?he.tagCheck=r.ADD_TAGS:Me(r.ADD_TAGS)&&(I===xt&&(I=Y(I)),A(I,r.ADD_TAGS,z))),W(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?he.attributeCheck=r.ADD_ATTR:Me(r.ADD_ATTR)&&(P===Tt&&(P=Y(P)),A(P,r.ADD_ATTR,z))),W(r,"ADD_FORBID_CONTENTS")&&Me(r.ADD_FORBID_CONTENTS)&&(Te===wn&&(Te=Y(Te)),A(Te,r.ADD_FORBID_CONTENTS,z)),Et&&(I["#text"]=!0),_e&&A(I,["html","head","body"]),I.table&&(A(I,["tbody"]),delete Fe.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw ce('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ce('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const p=q;q=r.TRUSTED_TYPES_POLICY;try{be=Re("")}catch(h){throw q=p,h}}else r.TRUSTED_TYPES_POLICY===null?(q=void 0,be=""):(q===void 0&&(q=zr()),q&&typeof be=="string"&&(be=Re("")));v&&v(r),Pe=r},In=A({},[...Gt,...Wt,...Ni]),Pn=A({},[...Zt,...vi]),Xr=function(r,o,p){return o.namespaceURI===re?r==="svg":o.namespaceURI===st?r==="svg"&&(p==="annotation-xml"||It[p]):!!In[r]},Vr=function(r,o,p){return o.namespaceURI===re?r==="math":o.namespaceURI===ot?r==="math"&&Pt[p]:!!Pn[r]},Qr=function(r,o,p){return o.namespaceURI===ot&&!Pt[p]||o.namespaceURI===st&&!It[p]?!1:!Pn[r]&&(Gr[r]||!In[r])},Kr=function(r){const o=bt(r),p=we(V(r)),h=B(r);let k,x;return h&&F(h)===C.element?(k={namespaceURI:bt(h)},x=we(V(h))):(k={namespaceURI:Ie},x="template"),Ot[o]?o===ot?Xr(p,k,x):o===st?Vr(p,k,x):o===re?Qr(p,k,x):!!(Be==="application/xhtml+xml"&&Ot[o]):!1},fe=function(r){je(e.removed,{element:r});try{B(r).removeChild(r)}catch{if(S(r),!B(r))throw ce("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Dn=function(r,o,p){try{b(r,o)}catch{try{r.removeAttribute(p)}catch{}}},zt=function(r){Nt(r);const o=y(r);o&&ae(Ei(o),h=>{try{S(h)}catch{}});const p=F(r)===C.element?oe(r):null;if(p)for(let h=p.length-1;h>=0;--h){const k=p[h],x=k&&k.name;typeof x=="string"&&Dn(r,k,x)}},De=function(r,o,p){if(!p)try{p=o.getAttributeNode(r)}catch{p=null}je(e.removed,{attribute:p||null,from:o});try{p?b(o,p):o.removeAttribute(r)}catch{try{o.removeAttribute(r)}catch{}}if(r==="is")if(Le||rt)try{fe(o)}catch{}else try{o.setAttribute(r,"")}catch{}},zn=function(r){const o=oe(r);if(o)for(let p=o.length-1;p>=0;--p){const h=o[p],k=h&&h.name;typeof k!="string"||P[z(k)]||Dn(r,h,k)}},Ct=function(r,o){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const h=[r];for(;h.length>0;){const k=h.pop();if(o(k)===!1)continue;if(p&&F(k)===C.element){const w=se(k);de(w)&&h.push(w)}const x=y(k);if(x)for(let w=x.length-1;w>=0;--w)h.push(x[w])}},Nt=function(r){Ct(r,o=>{F(o)===C.element&&zn(o)})},vt=function(r){const o=[];return Ct(r,p=>{o.push(p)},!0),o},Jr=function(r,o){const p=Ht();ae(vt(r),h=>{F(h)===C.element&&qt(p,h)}),ae(o,h=>{F(h)===C.element&&!Ge(p,h)&&zn(h)})},Cn=function(r,o){let p=!1;return ae(e.removed,h=>{h.element&&(p=p||h.element===r,Nt(h.element))}),Jr(r,o),p},ei=8,ti=function(r,o){const p=xe;let h=null;const k=()=>(h||(h=Ht(),ae(o,x=>{qt(h,x)})),h);for(let x=0;;x++){const w=vt(r),N=[r];let ie=!1;if(ae(w,H=>{F(H)===C.documentFragment?je(N,H):!ie&&!Ge(p,H)&&(ie=Ge(k(),H))}),!ie)return;if(x>=ei)throw ce("the tree kept changing during in-place sanitization; refusing to return it");ae(N,(H,j)=>{ni(H,j>0,r,k())})}},ni=function(r,o,p,h){const k=Mt(r);let x;for(;x=k.nextNode();)!Ge(h,x)||Ge(xe,x)||(o&&Q(O.uponSanitizeShadowNode,x,null),Ut(x,p),Ft(x,p),de(x.content)&&qe(x.content))},ri=function(r){xe&&qt(xe,r)},Nn=function(r,o){return ke?r==="patchsrc"?!0:r==="for"&&o!=="label"&&o!=="output":!1},ii=function(r){ke&&Ct(r,o=>{const p=F(o);if(p===C.processingInstruction||p===C.comment&&M(ir,o.data)){try{S(o)}catch{}return!1}if(p===C.element){const h=o,k=z(V(o));try{h.hasAttribute&&h.hasAttribute("patchsrc")&&h.removeAttribute("patchsrc"),h.hasAttribute&&h.hasAttribute("for")&&Nn("for",k)&&h.removeAttribute("for")}catch{}}return!0})},vn=function(r){let o=null,p=null;if(At)r="<remove></remove>"+r;else{const x=Xn(r,/^[\r\n\t ]+/);p=x&&x[0]}Be==="application/xhtml+xml"&&Ie===re&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const h=q?Re(r):r;if(Ie===re)try{o=new m().parseFromString(h,Be)}catch{}if(!o||!o.documentElement){o=_t.createDocument(Ie,"template",null);try{o.documentElement.innerHTML=Lt?be:h}catch{}}const k=o.body||o.documentElement;return r&&p&&k.insertBefore(n.createTextNode(p),k.childNodes[0]||null),Ie===re?Nr.call(o,_e?"html":"body")[0]:_e?o.documentElement:k},Mt=function(r){const o=Ee?Ee(r):r.ownerDocument;return fn.call(o||r,r,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},lt=function(r){return r=We(r,Mr," "),r=We(r,$r," "),r=We(r,Ur," "),r},$t=function(r){var o;Mn(r);const p=(o=r.querySelectorAll)===null||o===void 0?void 0:o.call(r,"template");p&&ae(p,h=>{de(h.content)&&$t(h.content)})},Mn=function(r){r.normalize();const o=Ee?Ee(r):r.ownerDocument,p=fn.call(o||r,r,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let h=p.nextNode();for(;h;)h.data=lt(h.data),h=p.nextNode()},at=function(r){const o=pe?pe(r):null;return typeof o!="string"||z(o)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==oe(r)||typeof r.removeAttribute!="function"||typeof r.removeAttributeNode!="function"||typeof r.getAttributeNode!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==te(r)||r.childNodes!==y(r)},de=function(r){if(!te||typeof r!="object"||r===null)return!1;try{return te(r)===C.documentFragment}catch{return!1}},He=function(r){if(!te||typeof r!="object"||r===null)return!1;try{return typeof te(r)=="number"}catch{return!1}};function Q(f,r,o){f.length!==0&&ae(f,p=>{p.call(e,r,o,Pe)})}const si=function(r,o){return!!(ke&&r.hasChildNodes()&&!He(r.firstElementChild)&&M(Xt,r.textContent)&&M(Xt,r.innerHTML)||ke&&Zi[o]&&F(r)===C.element&&bt(r)===re&&(He(r.firstElementChild)||typeof r.textContent=="string"&&M(Xt,r.textContent))||r.nodeType===C.processingInstruction||ke&&r.nodeType===C.comment&&M(ir,r.data))},ct=function(r,o){if(r instanceof RegExp)return M(r,o);if(r instanceof Function){for(var p=arguments.length,h=new Array(p>2?p-2:0),k=2;k<p;k++)h[k-2]=arguments[k];return!!r(o,...h)}return!1},oi=function(r,o,p){if(!Fe[o]&&Fn(o)&&ct(ne.tagNameCheck,o))return!1;if(Et&&!Te[o]&&!Te[we(o)]){const h=B(r),k=y(r);if(k&&h){const x=k.length;for(let w=x-1;w>=0;--w){const N=r===p?g(k[w],!0):k[w];h.insertBefore(N,L(r))}}}return fe(r),!0},$n=function(r,o,p,h){return r.length===0?o:o===p||o===h?Y(o):o},ze=function(r,o){return r===o||B(r)!==null?!1:(Rt&&Nt(r),!0)},Ut=function(r,o){if(ri(r),Q(O.beforeSanitizeElements,r,null),ze(r,o))return!0;if(at(r))return fe(r),!0;const p=z(V(r));if(I=$n(O.uponSanitizeElement,I,xt,tt),Q(O.uponSanitizeElement,r,{tagName:p,allowedTags:I}),ze(r,o))return!0;if(si(r,p))return fe(r),!0;if(Fe[p]||!(he.tagCheck instanceof Function&&he.tagCheck(p))&&!I[p]){const h=oi(r,p,o);return h===!1&&(Q(O.afterSanitizeElements,r,null),ze(r,o))?!0:h}if(F(r)===C.element&&!Kr(r)||(p==="noscript"||p==="noembed"||p==="noframes")&&M(Wi,r.innerHTML))return fe(r),!0;if(le&&r.nodeType===C.text){const h=lt(r.textContent);r.textContent!==h&&(je(e.removed,{element:r.cloneNode()}),r.textContent=h)}return Q(O.afterSanitizeElements,r,null),ze(r,o)},Un=function(r,o,p){if(mn[o]||Nn(o,r)||_n&&(o==="id"||o==="name")&&(p in n||p in Yr))return!1;const h=P[o]||he.attributeCheck instanceof Function&&he.attributeCheck(o,r);return wt&&M(Fr,o)||bn&&M(Br,o)?!0:h?An[o]||M(gn,We(p,dn,""))||(o==="src"||o==="xlink:href"||o==="href")&&r!=="script"&&Vn(p,"data:")===0&&yn[r]||kn&&!M(Hr,We(p,dn,""))?!0:!p:Fn(r)&&ct(ne.tagNameCheck,r)&&ct(ne.attributeNameCheck,o,r)||o==="is"&&ne.allowCustomizedBuiltInElements&&ct(ne.tagNameCheck,p)},li=A({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Fn=function(r){return!li[we(r)]&&M(qr,r)},ai=function(r,o,p,h){if(q&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!p)switch(d.getAttributeType(r,o)){case"TrustedHTML":return Re(h);case"TrustedScriptURL":return Dr(h)}return h},ci=function(r,o,p,h){try{return p?r.setAttributeNS(p,o,h):r.setAttribute(o,h),at(r)?(fe(r),!1):!0}catch{return De(o,r),!1}},Bn=function(r,o){return ke&&M(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,o)?!0:we(r)==="attributename"&&Xn(o,"href")!==null},Ft=function(r,o){if(Q(O.beforeSanitizeAttributes,r,null),ze(r,o))return;const p=r.attributes;if(!p||at(r))return;P=$n(O.uponSanitizeAttribute,P,Tt,nt);const h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let k=p.length;const x=z(r.nodeName);for(;k--;){const w=p[k],N=w.name,ie=w.namespaceURI,H=w.value,j=z(N),Ce=H;let G=N==="value"?Ce:Li(Ce),Hn=!1;if(h.attrName=j,h.attrValue=G,h.keepAttr=!0,h.forceKeepAttr=void 0,Q(O.uponSanitizeAttribute,r,h),G=h.attrValue,xn&&(j==="id"||j==="name")&&Vn(G,Tn)!==0&&(De(N,r,w),G=Tn+G,Hn=!0),Bn(N,G)){De(N,r,w);continue}if(!h.forceKeepAttr){if(!h.keepAttr){De(N,r,w);continue}if(!yt&&M(sr,G)){De(N,r,w);continue}if(le&&(G=lt(G)),!Un(x,j,G)){De(N,r,w);continue}G=ai(x,j,ie,G),G!==Ce&&ci(r,N,ie,G)&&Hn&&Yn(e.removed)}}Q(O.afterSanitizeAttributes,r,null),ze(r,o)},qe=function(r){let o=null;const p=Mt(r);for(Q(O.beforeSanitizeShadowDOM,r,null);o=p.nextNode();)if(Q(O.uponSanitizeShadowNode,o,null),Ut(o,r),Ft(o,r),de(o.content)&&qe(o.content),F(o)===C.element){const h=se(o);de(h)&&(Bt(h),qe(h))}le&&Mn(r),Q(O.afterSanitizeShadowDOM,r,null)},Bt=function(r){const o=[{node:r,shadow:null}];for(;o.length>0;){const p=o.pop();if(p.shadow){qe(p.shadow);continue}const h=p.node,k=F(h)===C.element,x=y(h);if(x)for(let w=x.length-1;w>=0;--w)o.push({node:x[w],shadow:null});if(k){const w=pe?pe(h):null;if(typeof w=="string"&&z(w)==="template"){const N=h.content;de(N)&&o.push({node:N,shadow:null})}}if(k){const w=se(h);de(w)&&o.push({node:null,shadow:w},{node:w,shadow:null})}}};return e.sanitize=function(f){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,p=null,h=null,k=null;if(Lt=!f,Lt&&(f="<!-->"),typeof f!="string"&&!He(f)&&(f=Di(f),typeof f!="string"))throw ce("dirty is not a string, aborting");if(!e.isSupported)return f;St?(I=tt,P=nt):Dt(r),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(I=Y(I)),O.uponSanitizeAttribute.length>0&&(P=Y(P)),e.removed=[];const x=Rt&&typeof f!="string"&&He(f);let w=[];const N=xe;if(x){ii(f);const j=V(f);if(typeof j=="string"){const Ce=z(j);if(!I[Ce]||Fe[Ce])throw zt(f),ce("root node is forbidden and cannot be sanitized in-place")}if(at(f))throw zt(f),ce("root node is clobbered and cannot be sanitized in-place");w=vt(f),xe=Ht()}else if(He(f))o=vn("<!---->"),p=o.ownerDocument.importNode(f,!0),p.nodeType===C.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?o=p:o.appendChild(p),Bt(o);else{if(!Le&&!le&&!_e&&f.indexOf("<")===-1)return q&&it?Re(f):f;if(o=vn(f),!o)return Le?null:it?be:""}o&&At&&fe(o.firstChild);const ie=x?f:o;try{x&&Bt(f);const j=Mt(ie);for(;h=j.nextNode();)Ut(h,ie),Ft(h,ie),de(h.content)&&qe(h.content);x&&ti(f,w)}catch(j){throw x&&(zt(f),Cn(f,w)),j}finally{xe=N}if(x){if(Cn(f,w))throw ce("a node selected for removal could not be safely returned; refusing to sanitize in place");return le&&$t(f),f}if(Le){if(le&&$t(o),rt)for(k=Cr.call(o.ownerDocument);o.firstChild;)k.appendChild(o.firstChild);else k=o;return(P.shadowroot||P.shadowrootmode)&&(k=vr.call(s,k,!0)),k}let H=_e?o.outerHTML:o.innerHTML;return _e&&I["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&M(ji,o.ownerDocument.doctype.name)&&(H="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
|
|
3
|
+
`+H),le&&(H=lt(H)),q&&it?Re(H):H},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dt(f),St=!0,tt=I,nt=P},e.clearConfig=function(){Pe=null,St=!1,tt=null,nt=null,q=kt,be=""},e.isValidAttribute=function(f,r,o){Pe||Dt({});const p=z(f),h=z(r);return typeof o=="string"&&(Bn(r,o)||!yt&&M(sr,o))?!1:Un(p,h,o)},e.addHook=function(f,r){typeof r=="function"&&W(O,f)&&je(O[f],r)},e.removeHook=function(f,r){if(W(O,f)){if(r!==void 0){const o=Ai(O[f],r);return o===-1?void 0:Ri(O[f],o,1)[0]}return Yn(O[f])}},e.removeHooks=function(f){W(O,f)&&(O[f]=[])},e.removeAllHooks=function(){O=or()},e}var Vi=wr();function nn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ae=nn();function yr(t){Ae=t}var ye={exec:()=>null};function Ne(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function T(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace($.caret,"$1"),n=n.replace(i,c),s},getRegex:()=>new RegExp(n,e)};return s}var Qi=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),$={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ne(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ne(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ne(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ne(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ne(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Qe})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Ne(t=>new RegExp(`^ {0,${t}}>`))},Ki=/^(?:[ \t]*(?:\n|$))+/,Ji=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,es=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ts=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Sr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ar=T(Sr).replace(/bull/g,rn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ns=T(Sr).replace(/bull/g,rn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),sn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,rs=/^[^\n]+/,on=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,is=T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",on).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ss=T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,rn).getRegex(),Qe="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ln=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,os=T("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ln).replace("tag",Qe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Er=t=>T(sn).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qe).getRegex(),ls=Er(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),as=Er(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),cs=T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",as).getRegex(),an={blockquote:cs,code:Ji,def:is,fences:es,heading:ts,hr:Ve,html:os,lheading:Ar,list:ss,newline:Ki,paragraph:ls,table:ye,text:rs},lr=T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qe).getRegex(),us={...an,lheading:ns,table:lr,paragraph:T(sn).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qe).getRegex()},ps={...an,html:T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ln).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:ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(sn).replace("hr",Ve).replace("heading",` *#{1,6} *[^
|
|
4
|
+
]`).replace("lheading",Ar).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rr=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ds=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ue=/[\p{P}\p{S}]/u,$e=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,gs=T(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,$e).getRegex(),ms=/[\p{Pi}\p{Ps}"']/u,Lr=/(?!~)[\p{P}\p{S}]/u,bs=/(?!~)[\s\p{P}\p{S}]/u,ks=/(?:[^\s\p{P}\p{S}]|~)/u,_s=T(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qi?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Or=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xs=T(Or,"u").replace(/punct/g,ue).getRegex(),Ts=T(Or,"u").replace(/punct/g,Lr).getRegex(),ws=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ys=T(ws,"u").replace(/openQuote/g,ms).replace(/punct/g,ue).getRegex(),Ir="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ss=T(Ir,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,$e).replace(/punct/g,ue).getRegex(),As=T(Ir,"gu").replace(/notPunctSpace/g,ks).replace(/punctSpace/g,bs).replace(/punct/g,Lr).getRegex(),Es="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Rs=T(Es,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,$e).replace(/punct/g,ue).getRegex(),Ls=T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,$e).replace(/punct/g,ue).getRegex(),Os="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Is=T(Os,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,$e).replace(/punct/g,ue).getRegex(),Ps=T(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ue).getRegex(),Ds="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zs=T(Ds,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,$e).replace(/punct/g,ue).getRegex(),Cs=T(/\\(punct)/,"gu").replace(/punct/g,ue).getRegex(),Ns=T(/^<(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(),vs=T(ln).replace("(?:-->|$)","-->").getRegex(),Ms=T("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",vs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pr=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,ft=T(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Pr).getRegex(),$s=T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ft).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Us=T(/^!?\[(label)\]\[(ref)\]/).replace("label",ft).replace("ref",on).getRegex(),Fs=T(/^!?\[(ref)\](?:\[\])?/).replace("ref",on).getRegex(),ar=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Bs=T(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Pr).getRegex(),Hs=T("reflink|nolink(?!\\()","g").replace("reflink",T(/^!?\[(label)\]\[(ref)\]/).replace("label",Bs).replace("ref",ar).getRegex()).replace("nolink",T(/^!?\[(ref)\](?:\[\])?/).replace("ref",ar).getRegex()).getRegex(),cr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qs=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,js=T(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,qs).getRegex(),cn={_backpedal:ye,anyPunctuation:Cs,autolink:Ns,blockSkip:_s,br:Rr,code:fs,del:ye,delLDelim:ye,delRDelim:ye,emStrongLDelim:xs,emStrongRDelimAst:Ss,emStrongRDelimUnd:Ls,escape:hs,link:$s,nolink:Fs,punctuation:gs,reflink:Us,reflinkSearch:Hs,tag:Ms,text:ds,url:ye},Gs={...cn,emStrongLDelim:ys,emStrongRDelimAst:Rs,emStrongRDelimUnd:Is,link:T(/^!?\[(label)\]\((.*?)\)/).replace("label",ft).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ft).getRegex()},Jt={...cn,emStrongRDelimAst:As,emStrongLDelim:Ts,delLDelim:Ps,delRDelim:zs,url:T(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",js).replace("protocol",cr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:T(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",cr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Ws={...Jt,br:T(Rr).replace("{2,}","*").getRegex(),text:T(Jt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pt={normal:an,gfm:us,pedantic:ps},Ye={normal:cn,gfm:Jt,breaks:Ws,pedantic:Gs},Zs={"&":"&","<":"<",">":">",'"':""","'":"'"},ur=t=>Zs[t];function Z(t,e){if(e){if($.escapeTest.test(t))return t.replace($.escapeReplace,ur)}else if($.escapeTestNoEncode.test(t))return t.replace($.escapeReplaceNoEncode,ur);return t}function Ys(t){return t.replace($.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"�":String.fromCodePoint(i)})}function pr(t){try{t=encodeURI(t).replace($.percentDecode,"%")}catch{return null}return t}function hr(t,e){var a;let n=t.replace($.findPipe,(c,u,l)=>{let m=!1,d=u;for(;--d>=0&&l[d]==="\\";)m=!m;return m?"|":" |"}),s=n.split($.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!((a=s.at(-1))!=null&&a.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace($.slashPipe,"|");return s}function me(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function fr(t){let e=t.split(`
|
|
5
|
+
`),n=e.length-1;for(;n>=0&&$.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
6
|
+
`)}function dt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Xs(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function dr(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=i,n++;return s}function gr(t,e,n,s,i){let a=e.href,c=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let m=s.state.linkEmitted,d=s.state.inRawBlock;s.state.linkEmitted=!1;let _=s.inlineTokens(u),g=s.state.linkEmitted;if(s.state.linkEmitted=m,s.state.inLink=!1,!l){if(g){s.state.inRawBlock=d;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:a,title:c,text:u,tokens:_}}function Vs(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
|
|
7
|
+
`).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return a.slice(Math.min(u.length,i.length))}).join(`
|
|
8
|
+
`)}function mr(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let u=s.inline.code.exec(e.slice(i));if(u){i+=u[0].length-1;continue}}if(e[i]!=="<")continue;let a=t.slice(n+i),c=s.inline.tag.exec(a)||s.inline.autolink.exec(a);if(c){if(c[0].length>e.length-i)return!0;i+=c[0].length-1}}return!1}var gt=class{constructor(t){E(this,"options");E(this,"rules");E(this,"lexer");this.options=t||Ae}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:fr(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Vs(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=me(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:me(e[0],`
|
|
9
|
+
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:me(e[0],`
|
|
10
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=me(e[0],`
|
|
11
|
+
`).split(`
|
|
12
|
+
`),s="",i="",a=[];for(;n.length>0;){let c=!1,u=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))u.push(n[l]),c=!0;else if(!c)u.push(n[l]);else break;n=n.slice(l);let m=u.join(`
|
|
13
|
+
`),d=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
14
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
15
|
+
${m}`:m,i=i?`${i}
|
|
16
|
+
${d}`:d;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=_,n.length===0)break;let g=a.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let S=g,b=n.join(`
|
|
17
|
+
`),L=S.raw+`
|
|
18
|
+
`+b.replace(this.rules.other.blockquoteSetextReplace2,""),y=this.blockquote(L);a[a.length-1]=y;let B=L.substring(y.raw.length).replace(/^\n/,""),se=B?B.split(`
|
|
19
|
+
`).length:0,oe=se?n.slice(0,-se):n;oe.length>0&&(s=`${s}
|
|
20
|
+
${oe.join(`
|
|
21
|
+
`)}`),i=i.substring(0,i.length-S.text.length)+y.text;break}else if((g==null?void 0:g.type)==="list"){let S=g,b=S.raw+`
|
|
22
|
+
`+n.join(`
|
|
23
|
+
`),L=this.list(b);a[a.length-1]=L,s=s.substring(0,s.length-g.raw.length)+L.raw,i=i.substring(0,i.length-S.raw.length)+L.raw,n=b.substring(a.at(-1).raw.length).split(`
|
|
24
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let l=!1,m="",d="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;m=e[0],t=t.substring(m.length);let _=e[2].split(`
|
|
25
|
+
`,1)[0],g=e[1].length,S=this.options.pedantic?dr(_,g):_.replace(this.rules.other.leadingSpaceTab,B=>dr(B,g)),b=t.split(`
|
|
26
|
+
`,1)[0],L=!S.trim(),y=0;if(this.options.pedantic?(y=2,d=S.trimStart()):L?y=g+1:(y=S.search(this.rules.other.nonSpaceChar),y=y>4?1:y,d=S.slice(y),y+=g),L&&this.rules.other.blankLine.test(b)&&(m+=b+`
|
|
27
|
+
`,t=t.substring(b.length+1),l=!0),!l){let B=this.rules.other.nextBulletRegex(y),se=this.rules.other.hrRegex(y),oe=this.rules.other.fencesBeginRegex(y),te=this.rules.other.headingBeginRegex(y),pe=this.rules.other.htmlBeginRegex(y),Ee=this.rules.other.blockquoteBeginRegex(y);for(;t;){let F=t.split(`
|
|
28
|
+
`,1)[0],V;if(b=F,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),V=b):V=b.replace(this.rules.other.leadingSpaceTab,Je=>Je.replace(this.rules.other.tabCharGlobal," ")),oe.test(b)||te.test(b)||pe.test(b)||Ee.test(b)||B.test(b)||se.test(b))break;if(V.search(this.rules.other.nonSpaceChar)>=y||!b.trim())d+=`
|
|
29
|
+
`+V.slice(y);else{if(L||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||oe.test(S)||te.test(S)||se.test(S))break;d+=`
|
|
30
|
+
`+b}L=!b.trim(),m+=F+`
|
|
31
|
+
`,t=t.substring(F.length+1),S=V.slice(y)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),i.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=m}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let m=l.tokens.filter(_=>_.type==="space"),d=m.length>0&&m.some(_=>this.rules.other.anyLine.test(_.raw));i.loose=d}for(let l of i.items){let m=l.tokens[0];if(l.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let _=this.lexer.inlineQueue.length-1;_>=0;_--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[_].src)){this.lexer.inlineQueue[_].src=this.lexer.inlineQueue[_].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(l.raw);if(d){let _={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=_.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=_.raw+l.tokens[0].raw,l.tokens[0].text=_.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(_)):l.tokens.unshift({type:"paragraph",raw:_.raw,text:_.raw,tokens:[_]}):l.tokens.unshift(_)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let m of l.tokens)m.type==="text"&&(m.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=fr(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=dt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:me(e[0],`
|
|
32
|
+
`),href:s,title:i}}}table(t){var c;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=hr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
33
|
+
`):[],a={type:"table",raw:me(e[0],`
|
|
34
|
+
`),header:[],align:[],rows:[]};if(n.length===s.length){for(let u of s)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of i)a.rows.push(hr(u,a.header.length).map((l,m)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[m]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:me(e[0],`
|
|
35
|
+
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
36
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mr(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let c=me(s.slice(0,-1),"\\");if((s.length-c.length)%2===0)return}else{let c=Xs(e[2],"()");if(c===-2)return;if(c>-1){let u=(e[0].indexOf("!")===0?5:4)+e[1].length+c;e[2]=e[2].substring(0,c),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let i=e[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),gr(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mr(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[dt(i)];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return gr(n,a,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,a,c,u=i,l=0,m=s[0][0],d=n===m,_=m==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(_.lastIndex=0,e=e.slice(-1*t.length+i);(s=_.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(c=[...a].length,s[3]||s[4]){u+=c;continue}else if(s[5]||s[6]){if(i%3&&!((i+c)%3)){l+=c;continue}if(d)break}if(u-=c,u>0)continue;c=Math.min(c,c+u+l);let g=[...s[0]][0].length,S=t.slice(0,i+s.index+g+c);if(Math.min(i,c)%2){let L=S.slice(1,-1);return{type:"em",raw:S,text:L,tokens:this.lexer.inlineTokens(L)}}let b=S.slice(2,-2);return{type:"strong",raw:S,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,a,c,u=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(c=[...a].length,c!==i))continue;if(s[3]||s[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...s[0]][0].length,d=t.slice(0,i+s.index+m+c),_=d.slice(i,-i);return{type:"del",raw:d,text:_,tokens:this.lexer.inlineTokens(_)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let s,i;if(e[2]==="@")s=e[0],i="mailto:"+s;else{let a;do a=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(a!==e[0]);s=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:s,href:i,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:Ys(e[0]),escaped:n}}}},J=class en{constructor(e){E(this,"tokens");E(this,"options");E(this,"state");E(this,"inlineQueue");E(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ae,this.options.tokenizer=this.options.tokenizer||new gt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let n={other:$,block:pt.normal,inline:Ye.normal};this.options.pedantic?(n.block=pt.pedantic,n.inline=Ye.pedantic):this.options.gfm&&(n.block=pt.gfm,this.options.breaks?n.inline=Ye.breaks:n.inline=Ye.gfm),this.tokenizer.rules=n}static get rules(){return{block:pt,inline:Ye}}static lex(e,n){return new en(n).lex(e)}static lexInline(e,n){return new en(n).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
37
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){var a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let l;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(d=>(l=d.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let d=n.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
|
|
38
|
+
`:n.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
39
|
+
`)?"":`
|
|
40
|
+
`)+l.raw,d.text+=`
|
|
41
|
+
`+l.text,this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
42
|
+
`)?"":`
|
|
43
|
+
`)+l.raw,d.text+=`
|
|
44
|
+
`+l.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},n.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),n.push(l);continue}let m=e;if((u=this.options.extensions)!=null&&u.startBlock){let d=1/0,_=e.slice(1),g;this.options.extensions.startBlock.forEach(S=>{g=S.call({lexer:this},_),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(m=e.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(m))){let d=n.at(-1);s&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
|
|
45
|
+
`)?"":`
|
|
46
|
+
`)+l.raw,d.text+=`
|
|
47
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l),s=m.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
48
|
+
`)?"":`
|
|
49
|
+
`)+l.raw,d.text+=`
|
|
50
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],a=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,dt(i.slice(a+1,-1))))&&!(a>1&&this.linkInText(i.slice(1,a-1))))return!0}return!1}inlineTokens(e,n=[]){var u,l,m,d,_;this.tokenizer.lexer=this;let s=e;if(this.tokens.links&&e.includes("[")){let g=this.tokenizer.rules.inline.reflinkSearch,S=b=>{let L=b.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,dt(b.slice(L+1,-1))))return b;if(L>1&&b.charAt(0)!=="!"){let y=b.slice(1,L-1);if(this.linkInText(y))return"["+y.replace(g,S)+"]["+"a".repeat(b.length-L-2)+"]"}return"["+"a".repeat(b.length-2)+"]"};s=s.replace(g,S)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,g=>"+".repeat(g.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(g,S,b)=>{let L=b?b.length:0;return g.slice(0,L)+"["+"a".repeat(g.length-L-2)+"]"}),s=((l=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:l.call({lexer:this},s))??s;let i=!1,a="",c=1/0;for(;e;){if(e.length<c)c=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(a=""),i=!1;let g;if((d=(m=this.options.extensions)==null?void 0:m.inline)!=null&&d.some(b=>(g=b.call({lexer:this},e,n))?(e=e.substring(g.raw.length),n.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let b=n.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):n.push(g);continue}if(g=this.tokenizer.emStrong(e,s,a)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.del(e,s,a)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),n.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),n.push(g);continue}let S=e;if((_=this.options.extensions)!=null&&_.startInline){let b=1/0,L=e.slice(1),y;this.options.extensions.startInline.forEach(B=>{y=B.call({lexer:this},L),typeof y=="number"&&y>=0&&(b=Math.min(b,y))}),b<1/0&&b>=0&&(S=e.substring(0,b+1))}if(g=this.tokenizer.inlineText(S)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(a=g.raw.slice(-1)),i=!0;let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):n.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},mt=class{constructor(t){E(this,"options");E(this,"parser");this.options=t||Ae}space(t){return""}code({text:t,lang:e,escaped:n}){var a;let s=(a=(e||"").match($.notSpaceStart))==null?void 0:a[0],i=t?t.replace($.endingNewline,"")+`
|
|
51
|
+
`:"";return s?'<pre><code class="language-'+Z(s)+'">'+(n?i:Z(i,!0))+`</code></pre>
|
|
52
|
+
`:"<pre><code>"+(n?i:Z(i,!0))+`</code></pre>
|
|
53
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
54
|
+
${this.parser.parse(t)}</blockquote>
|
|
55
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
56
|
+
`}hr(t){return`<hr>
|
|
57
|
+
`}list(t){let e=t.ordered,n=t.start,s="";for(let c=0;c<t.items.length;c++){let u=t.items[c];s+=this.listitem(u)}let i=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
58
|
+
`+s+"</"+i+`>
|
|
59
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
60
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
61
|
+
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let s="";for(let i=0;i<t.rows.length;i++){let a=t.rows[i];n="";for(let c=0;c<a.length;c++)n+=this.tablecell(a[c]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
62
|
+
<thead>
|
|
63
|
+
`+e+`</thead>
|
|
64
|
+
`+s+`</table>
|
|
65
|
+
`}tablerow({text:t}){return`<tr>
|
|
66
|
+
${t}</tr>
|
|
67
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
68
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let a=i?Z(n,!0):this.parser.parseInline(s),c=pr(t);if(c===null)return a;t=Z(c,i);let u='<a href="'+t+'"';return e&&(u+=' title="'+Z(e)+'"'),u+=">"+a+"</a>",u}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=pr(t);if(i===null)return Z(n);t=i;let a=`<img src="${Z(t)}" alt="${Z(n)}"`;return e&&(a+=` title="${Z(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Z(t.text)}},un=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ee=class tn{constructor(e){E(this,"options");E(this,"renderer");E(this,"textRenderer");this.options=e||Ae,this.options.renderer=this.options.renderer||new mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new un}static parse(e,n){return new tn(n).parse(e)}static parseInline(e,n){return new tn(n).parseInline(e)}parse(e){var s,i;this.renderer.parser=this;let n="";for(let a=0;a<e.length;a++){let c=e[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){let l=c,m=this.options.extensions.renderers[l.type].call({parser:this},l);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){n+=m||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){var i,a;this.renderer.parser=this;let s="";for(let c=0;c<e.length;c++){let u=e[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(u.type)){s+=m||"";continue}}let l=u;switch(l.type){case"escape":{s+=n.text(l);break}case"html":{s+=n.html(l);break}case"link":{s+=n.link(l);break}case"image":{s+=n.image(l);break}case"checkbox":{s+=n.checkbox(l);break}case"strong":{s+=n.strong(l);break}case"em":{s+=n.em(l);break}case"codespan":{s+=n.codespan(l);break}case"br":{s+=n.br(l);break}case"del":{s+=n.del(l);break}case"text":{s+=n.text(l);break}default:{let m='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return s}},ht,Xe=(ht=class{constructor(t){E(this,"options");E(this,"block");this.options=t||Ae}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?J.lex:J.lexInline}provideParser(t=this.block){return t?ee.parse:ee.parseInline}},E(ht,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),E(ht,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ht),Qs=class{constructor(...t){E(this,"defaults",nn());E(this,"options",this.setOptions);E(this,"parse",this.parseMarkdown(!0));E(this,"parseInline",this.parseMarkdown(!1));E(this,"Parser",ee);E(this,"Renderer",mt);E(this,"TextRenderer",un);E(this,"Lexer",J);E(this,"Tokenizer",gt);E(this,"Hooks",Xe);this.use(...t)}walkTokens(t,e){var s,i;let n=[];for(let a of t)switch(n=n.concat(e.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,e));for(let u of c.rows)for(let l of u)n=n.concat(this.walkTokens(l.tokens,e));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,e));break}default:{let c=a;(i=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&i[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let l=c[u].flat(1/0);n=n.concat(this.walkTokens(l,e))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...c){let u=i.renderer.apply(this,c);return u===!1&&(u=a.apply(this,c)),u}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new mt(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],l=i[c];i[c]=(...m)=>{let d=u.apply(i,m);return d===!1&&(d=l.apply(i,m)),d||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new gt(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],l=i[c];i[c]=(...m)=>{let d=u.apply(i,m);return d===!1&&(d=l.apply(i,m)),d}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Xe;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],l=i[c];Xe.passThroughHooks.has(a)?i[c]=m=>{if(this.defaults.async&&Xe.passThroughHooksRespectAsync.has(a))return(async()=>{let _=await u.call(i,m);return l.call(i,_)})();let d=u.call(i,m);return l.call(i,d)}:i[c]=(...m)=>{if(this.defaults.async)return(async()=>{let _=await u.apply(i,m);return _===!1&&(_=await l.apply(i,m)),_})();let d=u.apply(i,m);return d===!1&&(d=l.apply(i,m)),d}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(c){let u=[];return u.push(a.call(this,c)),i&&(u=u.concat(i.call(this,c))),u}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return J.lex(t,e??this.defaults)}parser(t,e){return ee.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(e):e,u=await(i.hooks?await i.hooks.provideLexer(t):t?J.lex:J.lexInline)(c,i),l=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let m=await(i.hooks?await i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(m):m})().catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let c=(i.hooks?i.hooks.provideLexer(t):t?J.lex:J.lexInline)(e,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(t,e){return n=>{if(n.message+=`
|
|
69
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Se=new Qs;function R(t,e){return Se.parse(t,e)}R.options=R.setOptions=function(t){return Se.setOptions(t),R.defaults=Se.defaults,yr(R.defaults),R};R.getDefaults=nn;R.defaults=Ae;function Ks(...t){return Se.use(...t),R.defaults=Se.defaults,yr(R.defaults),R}R.use=Ks;R.walkTokens=function(t,e){return Se.walkTokens(t,e)};R.parseInline=Se.parseInline;R.Parser=ee;R.parser=ee.parse;R.Renderer=mt;R.TextRenderer=un;R.Lexer=J;R.lexer=J.lex;R.Tokenizer=gt;R.Hooks=Xe;R.parse=R;R.options;R.setOptions;R.walkTokens;R.parseInline;ee.parse;J.lex;function Js(t){const e=R(t,{async:!1,gfm:!0}),n=Vi.sanitize(e,{RETURN_DOM_FRAGMENT:!0});for(const i of n.querySelectorAll("a[href]"))i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer");const s=document.createElement("div");return s.append(n),s.innerHTML}const eo=["min-h-0 flex-1 overflow-auto rounded-md border border-border bg-black/30 p-4 text-sm leading-relaxed text-zinc-300","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_h1]:mt-6 [&_h1]:mb-3 [&_h1]:border-border [&_h1]:border-b [&_h1]:pb-2 [&_h1]:font-semibold [&_h1]:text-xl [&_h1]:text-zinc-100","[&_h2]:mt-6 [&_h2]:mb-2 [&_h2]:border-border/60 [&_h2]:border-b [&_h2]:pb-1 [&_h2]:font-semibold [&_h2]:text-lg [&_h2]:text-zinc-100","[&_h3]:mt-5 [&_h3]:mb-2 [&_h3]:font-semibold [&_h3]:text-base [&_h3]:text-zinc-100","[&_h4]:mt-4 [&_h4]:mb-1 [&_h4]:font-semibold [&_h4]:text-sm [&_h4]:text-zinc-200","[&_h5]:mt-4 [&_h5]:mb-1 [&_h5]:font-semibold [&_h5]:text-xs [&_h5]:text-zinc-200 [&_h6]:mt-4 [&_h6]:mb-1 [&_h6]:font-semibold [&_h6]:text-xs [&_h6]:text-zinc-400","[&_p]:my-3","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1","[&_li_ul]:my-1 [&_li_ol]:my-1","[&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_a:hover]:text-accent/80","[&_strong]:font-semibold [&_strong]:text-zinc-100 [&_em]:italic [&_del]:text-zinc-500 [&_del]:line-through","[&_code]:rounded [&_code]:bg-zinc-800/70 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[12px] [&_code]:text-zinc-200","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-border [&_pre]:bg-black/40 [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-xs","[&_pre_code]:rounded-none [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-zinc-300","[&_blockquote]:my-3 [&_blockquote]:border-accent/40 [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:text-zinc-400 [&_blockquote]:italic","[&_table]:my-3 [&_table]:w-full [&_table]:border-collapse [&_table]:text-xs","[&_th]:border [&_th]:border-border [&_th]:bg-zinc-900 [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:font-semibold [&_th]:text-zinc-200","[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1 [&_td]:align-top","[&_hr]:my-6 [&_hr]:border-border","[&_img]:my-3 [&_img]:max-w-full [&_img]:rounded-md","[&_input]:mr-1 [&_input]:align-middle"].join(" ");function to({source:t}){const[e,n]=jn.useState("rendered"),s=jn.useMemo(()=>Js(t),[t]);return K.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[K.jsxs("div",{className:"flex shrink-0 flex-wrap gap-1",children:[K.jsx(Gn,{tone:e==="rendered"?"selected":"quiet",onClick:()=>n("rendered"),className:"px-2 py-0.5",children:"Rendered"}),K.jsx(Gn,{tone:e==="source"?"selected":"quiet",onClick:()=>n("source"),className:"px-2 py-0.5",children:"Source"})]}),e==="source"?K.jsx("pre",{className:"mono min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-black/30 p-3 text-xs text-zinc-300",children:t}):K.jsx("div",{className:eo,dangerouslySetInnerHTML:{__html:s}})]})}function io({item:t}){const e=hi({queryKey:["object-text-head",t.disk,t.key],queryFn:()=>bi.objectTextHead(t.disk,t.key,ki),retry:!1,staleTime:6e4});if(e.isLoading)return K.jsx(fi,{children:"Loading…"});if(e.isError||!e.data)return K.jsx(di,{item:t,message:gi(e.error,"Could not read this file.")});const{text:n,bytesRead:s}=e.data,i=s<t.size,a=i?n.slice(0,Math.max(0,n.lastIndexOf(`
|
|
70
|
+
`))):n;return K.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[i&&K.jsxs(mi,{variant:"warn",className:"shrink-0",children:["Sample — the first ",qn(s)," of ",qn(t.size),". The rest of the document isn't loaded; open the original ↗ for the whole file."]}),K.jsx(to,{source:a})]})}export{io as MarkdownPreview,Js as renderMarkdown};
|