| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- var st=Object.defineProperty;var rt=(s,e,t)=>e in s?st(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var b=(s,e,t)=>rt(s,typeof e!="symbol"?e+"":e,t);import{d as it,l as W,p as ae,o as R,y as O,T as lt,z as ce,m as B,c as L,A as ue,B as E,C as Be,b as A,D as he,a as Ae,n as ot,k as X,F as pe,G as fe,q as at,f as de,e as Y,u as ct,v as ut,w as ht,H as Pe,I as pt}from"./vue-vendor-DFp1TAzT.js";import{_ as ft,S as dt,T as gt,B as kt,U as bt,a as mt,H as wt,V as xt,W as yt,X as $t,i as _e,o as Ct,Y as G,Z as Ie,J as Oe,$ as St,b as Rt,s as vt,c as Tt,a0 as zt,a1 as J,K as Bt}from"./index-B3bKhTPo.js";var At=Object.defineProperty,Le=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,Ee=(s,e,t)=>e in s?At(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,It=(s,e)=>{for(var t in e||(e={}))Pt.call(e,t)&&Ee(s,t,e[t]);if(Le)for(var t of Le(e))_t.call(e,t)&&Ee(s,t,e[t]);return s};const Ot=["top","right","bottom","left"],Lt=it({name:"Drawer",components:{ClientOnly:bt,ArcoButton:kt,IconHover:gt,IconClose:dt},inheritAttrs:!1,props:{visible:{type:Boolean,default:!1},defaultVisible:{type:Boolean,default:!1},placement:{type:String,default:"right",validator:s=>Ot.includes(s)},title:String,mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:String,cancelText:String,okLoading:{type:Boolean,default:!1},okButtonProps:{type:Object},cancelButtonProps:{type:Object},unmountOnClose:Boolean,width:{type:[Number,String],default:250},height:{type:[Number,String],default:250},popupContainer:{type:[String,Object],default:"body"},drawerStyle:{type:Object},onBeforeOk:{type:Function},onBeforeCancel:{type:Function},escToClose:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1}},emits:{"update:visible":s=>!0,ok:s=>!0,cancel:s=>!0,open:()=>!0,close:()=>!0,beforeOpen:()=>!0,beforeClose:()=>!0},setup(s,{emit:e}){const{popupContainer:t}=at(s),n=mt("drawer"),{t:i}=wt(),r=de(s.defaultVisible),l=Y(()=>{var w;return(w=s.visible)!=null?w:r.value}),o=de(!1),u=Y(()=>s.okLoading||o.value),{teleportContainer:a,containerRef:c}=xt({popupContainer:t,visible:l}),h=de(l.value);let p=!1;const f=w=>{s.escToClose&&w.key===St.ESC&&Q()&&N(w)},m=()=>{s.escToClose&&!p&&(p=!0,Ct(document.documentElement,"keydown",f))},d=()=>{p&&(p=!1,Rt(document.documentElement,"keydown",f))},{zIndex:y,isLastDialog:Q}=yt("dialog",{visible:l}),q=Y(()=>(c==null?void 0:c.value)===document.body);let I=0;const D=()=>{I++,o.value&&(o.value=!1),r.value=!1,e("update:visible",!1)},U=async w=>{const v=I,K=await new Promise(async oe=>{var Te;if(G(s.onBeforeOk)){let T=s.onBeforeOk((ze=!0)=>oe(ze));if((Ie(T)||!Oe(T))&&(o.value=!0),Ie(T))try{T=(Te=await T)!=null?Te:!0}catch{T=!1}Oe(T)&&oe(T)}else oe(!0)});v===I&&(K?(e("ok",w),D()):o.value&&(o.value=!1))},N=w=>{var v;let K=!0;G(s.onBeforeCancel)&&(K=(v=s.onBeforeCancel())!=null?v:!1),K&&(e("cancel",w),D())},j=w=>{s.maskClosable&&N(w)},z=()=>{l.value&&e("open")},tt=()=>{l.value||(h.value=!1,ve(),e("close"))},{setOverflowHidden:Re,resetOverflow:ve}=$t(c);ct(()=>{l.value&&(h.value=!0,Re(),m())}),ut(()=>{ve(),d()}),ht(l,w=>{r.value!==w&&(r.value=w),w?(e("beforeOpen"),h.value=!0,Re(),m()):(e("beforeClose"),d())});const nt=Y(()=>{var w;const v=It({[s.placement]:0},(w=s.drawerStyle)!=null?w:{});return["right","left"].includes(s.placement)?v.width=_e(s.width)?`${s.width}px`:s.width:v.height=_e(s.height)?`${s.height}px`:s.height,v});return{prefixCls:n,style:nt,t:i,mounted:h,computedVisible:l,mergedOkLoading:u,zIndex:y,handleOk:U,handleCancel:N,handleOpen:z,handleClose:tt,handleMask:j,isFixed:q,teleportContainer:a}}});function Et(s,e,t,n,i,r){const l=W("icon-close"),o=W("icon-hover"),u=W("arco-button"),a=W("client-only");return R(),ae(a,null,{default:O(()=>[(R(),ae(lt,{to:s.teleportContainer,disabled:!s.renderToBody},[!s.unmountOnClose||s.computedVisible||s.mounted?ce((R(),L("div",ue({key:0,class:`${s.prefixCls}-container`,style:s.isFixed?{zIndex:s.zIndex}:{zIndex:"inherit",position:"absolute"}},s.$attrs),[E(Be,{name:"fade-drawer",appear:""},{default:O(()=>[s.mask?ce((R(),L("div",{key:0,class:A(`${s.prefixCls}-mask`),onClick:e[0]||(e[0]=(...c)=>s.handleMask&&s.handleMask(...c))},null,2)),[[he,s.computedVisible]]):B("v-if",!0)]),_:1}),E(Be,{name:`slide-${s.placement}-drawer`,appear:"",onAfterEnter:s.handleOpen,onAfterLeave:s.handleClose},{default:O(()=>[ce(Ae("div",{class:A(s.prefixCls),style:ot(s.style)},[s.header?(R(),L("div",{key:0,class:A(`${s.prefixCls}-header`)},[X(s.$slots,"header",{},()=>[s.$slots.title||s.title?(R(),L("div",{key:0,class:A(`${s.prefixCls}-title`)},[X(s.$slots,"title",{},()=>[pe(fe(s.title),1)])],2)):B("v-if",!0),s.closable?(R(),L("div",{key:1,tabindex:"-1",role:"button","aria-label":"Close",class:A(`${s.prefixCls}-close-btn`),onClick:e[1]||(e[1]=(...c)=>s.handleCancel&&s.handleCancel(...c))},[E(o,null,{default:O(()=>[E(l)]),_:1})],2)):B("v-if",!0)])],2)):B("v-if",!0),Ae("div",{class:A(`${s.prefixCls}-body`)},[X(s.$slots,"default")],2),s.footer?(R(),L("div",{key:1,class:A(`${s.prefixCls}-footer`)},[X(s.$slots,"footer",{},()=>[s.hideCancel?B("v-if",!0):(R(),ae(u,ue({key:0},s.cancelButtonProps,{onClick:s.handleCancel}),{default:O(()=>[pe(fe(s.cancelText||s.t("drawer.cancelText")),1)]),_:1},16,["onClick"])),E(u,ue({type:"primary",loading:s.mergedOkLoading},s.okButtonProps,{onClick:s.handleOk}),{default:O(()=>[pe(fe(s.okText||s.t("drawer.okText")),1)]),_:1},16,["loading","onClick"])])],2)):B("v-if",!0)],6),[[he,s.computedVisible]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],16)),[[he,s.computedVisible||s.mounted]]):B("v-if",!0)],8,["to","disabled"]))]),_:3})}var te=ft(Lt,[["render",Et]]),qt=Object.defineProperty,qe=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,De=(s,e,t)=>e in s?qt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ge=(s,e)=>{for(var t in e||(e={}))Dt.call(e,t)&&De(s,t,e[t]);if(qe)for(var t of qe(e))Nt.call(e,t)&&De(s,t,e[t]);return s};const Ne=(s,e)=>{let t=zt("drawer");const n=()=>{a.component&&(a.component.props.visible=!1),G(s.onOk)&&s.onOk()},i=()=>{a.component&&(a.component.props.visible=!1),G(s.onCancel)&&s.onCancel()},r=async()=>{await pt(),t&&(Pe(null,t),document.body.removeChild(t)),t=null,G(s.onClose)&&s.onClose()},l=()=>{a.component&&(a.component.props.visible=!1)},o=c=>{a.component&&Object.entries(c).forEach(([h,p])=>{a.component.props[h]=p})},a=E(te,ge(ge(ge({},{visible:!0,renderToBody:!1,unmountOnClose:!0,onOk:n,onCancel:i,onClose:r}),Bt(s,["content","title","footer","visible","unmountOnClose","onOk","onCancel","onClose"])),{header:typeof s.header=="boolean"?s.header:void 0,footer:typeof s.footer=="boolean"?s.footer:void 0}),{default:J(s.content),header:typeof s.header!="boolean"?J(s.header):void 0,title:J(s.title),footer:typeof s.footer!="boolean"?J(s.footer):void 0});return(e??je._context)&&(a.appContext=e??je._context),Pe(a,t),document.body.appendChild(t),{close:l,update:o}},je=Object.assign(te,{open:Ne,install:(s,e)=>{vt(s,e);const t=Tt(e);s.component(t+te.name,te);const n={open:(i,r=s._context)=>Ne(i,r)};s.config.globalProperties.$drawer=n},_context:null});function be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let _=be();function Fe(s){_=s}const H={exec:()=>null};function k(s,e=""){let t=typeof s=="string"?s:s.source;const n={replace:(i,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(x.caret,"$1"),t=t.replace(i,l),n},getRegex:()=>new RegExp(t,e)};return n}const x={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},jt=/^(?:[ \t]*(?:\n|$))+/,Zt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,F=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qe=/(?:[*+-]|\d{1,9}[.)])/,Ue=k(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Qe).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),me=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ht=/^[^\n]+/,we=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Vt=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",we).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ft=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qe).getRegex(),ie="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",xe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qt=k("^ {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",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ke=k(me).replace("hr",F).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",ie).getRegex(),Ut=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ke).getRegex(),ye={blockquote:Ut,code:Zt,def:Vt,fences:Mt,heading:Gt,hr:F,html:Qt,lheading:Ue,list:Ft,newline:jt,paragraph:Ke,table:H,text:Ht},Ze=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",ie).getRegex(),Kt={...ye,table:Ze,paragraph:k(me).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ze).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",ie).getRegex()},Wt={...ye,html:k(`^ *(?: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:H,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(me).replace("hr",F).replace("heading",` *#{1,6} *[^
- ]`).replace("lheading",Ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},We=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xe=/^( {2,}|\\)\n(?!\s*$)/,Yt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,le=/[\p{P}\p{S}]/u,$e=/[\s\p{P}\p{S}]/u,Ye=/[^\s\p{P}\p{S}]/u,Jt=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,$e).getRegex(),en=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,tn=k(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,le).getRegex(),nn=k("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ye).replace(/punctSpace/g,$e).replace(/punct/g,le).getRegex(),sn=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ye).replace(/punctSpace/g,$e).replace(/punct/g,le).getRegex(),rn=k(/\\(punct)/,"gu").replace(/punct/g,le).getRegex(),ln=k(/^<(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(),on=k(xe).replace("(?:-->|$)","-->").getRegex(),an=k("^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",on).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,cn=k(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Je=k(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",we).getRegex(),et=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",we).getRegex(),un=k("reflink|nolink(?!\\()","g").replace("reflink",Je).replace("nolink",et).getRegex(),Ce={_backpedal:H,anyPunctuation:rn,autolink:ln,blockSkip:en,br:Xe,code:Xt,del:H,emStrongLDelim:tn,emStrongRDelimAst:nn,emStrongRDelimUnd:sn,escape:We,link:cn,nolink:et,punctuation:Jt,reflink:Je,reflinkSearch:un,tag:an,text:Yt,url:H},hn={...Ce,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},ke={...Ce,escape:k(We).replace("])","~|])").getRegex(),url:k(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pn={...ke,br:k(Xe).replace("{2,}","*").getRegex(),text:k(ke.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:ye,gfm:Kt,pedantic:Wt},Z={normal:Ce,gfm:ke,breaks:pn,pedantic:hn},fn={"&":"&","<":"<",">":">",'"':""","'":"'"},Me=s=>fn[s];function S(s,e){if(e){if(x.escapeTest.test(s))return s.replace(x.escapeReplace,Me)}else if(x.escapeTestNoEncode.test(s))return s.replace(x.escapeReplaceNoEncode,Me);return s}function Ge(s){try{s=encodeURI(s).replace(x.percentDecode,"%")}catch{return null}return s}function He(s,e){var r;const t=s.replace(x.findPipe,(l,o,u)=>{let a=!1,c=o;for(;--c>=0&&u[c]==="\\";)a=!a;return a?"|":" |"}),n=t.split(x.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((r=n.at(-1))!=null&&r.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(x.slashPipe,"|");return n}function M(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n&&s.charAt(n-i-1)===e;)i++;return s.slice(0,n-i)}function dn(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function Ve(s,e,t,n,i){const r=e.href,l=e.title||null,o=s[1].replace(i.other.outputLinkReplace,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const u={type:"link",raw:t,href:r,title:l,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,u}return{type:"image",raw:t,href:r,title:l,text:o}}function gn(s,e,t){const n=s.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
- `).map(r=>{const l=r.match(t.other.beginningSpace);if(l===null)return r;const[o]=l;return o.length>=i.length?r.slice(i.length):r}).join(`
- `)}class se{constructor(e){b(this,"options");b(this,"rules");b(this,"lexer");this.options=e||_}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(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:M(n,`
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=gn(n,t[3]||"",this.rules);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(this.rules.other.endingHash.test(n)){const i=M(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.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:M(t[0],`
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=M(t[0],`
- `).split(`
- `),i="",r="";const l=[];for(;n.length>0;){let o=!1;const u=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))u.push(n[a]),o=!0;else if(!o)u.push(n[a]);else break;n=n.slice(a);const c=u.join(`
- `),h=c.replace(this.rules.other.blockquoteSetextReplace,`
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
- ${c}`:c,r=r?`${r}
- ${h}`:h;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,l,!0),this.lexer.state.top=p,n.length===0)break;const f=l.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){const m=f,d=m.raw+`
- `+n.join(`
- `),y=this.blockquote(d);l[l.length-1]=y,i=i.substring(0,i.length-m.raw.length)+y.raw,r=r.substring(0,r.length-m.text.length)+y.text;break}else if((f==null?void 0:f.type)==="list"){const m=f,d=m.raw+`
- `+n.join(`
- `),y=this.list(d);l[l.length-1]=y,i=i.substring(0,i.length-f.raw.length)+y.raw,r=r.substring(0,r.length-m.raw.length)+y.raw,n=d.substring(l.at(-1).raw.length).split(`
- `);continue}}return{type:"blockquote",raw:i,tokens:l,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,r={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 l=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let a=!1,c="",h="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=t[2].split(`
- `,1)[0].replace(this.rules.other.listReplaceTabs,q=>" ".repeat(3*q.length)),f=e.split(`
- `,1)[0],m=!p.trim(),d=0;if(this.options.pedantic?(d=2,h=p.trimStart()):m?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,h=p.slice(d),d+=t[1].length),m&&this.rules.other.blankLine.test(f)&&(c+=f+`
- `,e=e.substring(f.length+1),a=!0),!a){const q=this.rules.other.nextBulletRegex(d),I=this.rules.other.hrRegex(d),D=this.rules.other.fencesBeginRegex(d),U=this.rules.other.headingBeginRegex(d),N=this.rules.other.htmlBeginRegex(d);for(;e;){const j=e.split(`
- `,1)[0];let z;if(f=j,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),z=f):z=f.replace(this.rules.other.tabCharGlobal," "),D.test(f)||U.test(f)||N.test(f)||q.test(f)||I.test(f))break;if(z.search(this.rules.other.nonSpaceChar)>=d||!f.trim())h+=`
- `+z.slice(d);else{if(m||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(p)||U.test(p)||I.test(p))break;h+=`
- `+f}!m&&!f.trim()&&(m=!0),c+=j+`
- `,e=e.substring(j.length+1),p=z.slice(d)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let y=null,Q;this.options.gfm&&(y=this.rules.other.listIsTask.exec(h),y&&(Q=y[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:c,task:!!y,checked:Q,loose:!1,text:h,tokens:[]}),r.raw+=c}const u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let a=0;a<r.items.length;a++)if(this.lexer.state.top=!1,r.items[a].tokens=this.lexer.blockTokens(r.items[a].text,[]),!r.loose){const c=r.items[a].tokens.filter(p=>p.type==="space"),h=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=h}if(r.loose)for(let a=0;a<r.items.length;a++)r.items[a].loose=!0;return r}}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(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=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:r}}}table(e){var o;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=He(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
- `):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const u of i)this.rules.other.tableAlignRight.test(u)?l.align.push("right"):this.rules.other.tableAlignCenter.test(u)?l.align.push("center"):this.rules.other.tableAlignLeft.test(u)?l.align.push("left"):l.align.push(null);for(let u=0;u<n.length;u++)l.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:l.align[u]});for(const u of r)l.rows.push(He(u,l.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[c]})));return l}}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)===`
- `?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:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const l=M(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=dn(t[2],"()");if(l>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(i);l&&(i=l[1],r=l[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ve(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}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(this.rules.other.multipleSpaceGlobal," "),r=t[i.toLowerCase()];if(!r){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Ve(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=[...i[0]].length-1;let o,u,a=l,c=0;const h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+l);(i=h.exec(t))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(u=[...o].length,i[3]||i[4]){a+=u;continue}else if((i[5]||i[6])&&l%3&&!((l+u)%3)){c+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+c);const p=[...i[0]][0].length,f=e.slice(0,l+i.index+p+u);if(Math.min(l,u)%2){const d=f.slice(1,-1);return{type:"em",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}const m=f.slice(2,-2);return{type:"strong",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{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=t[1],i="mailto:"+n):(n=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,r;if(t[2]==="@")i=t[0],r="mailto:"+i;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);i=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class ${constructor(e){b(this,"tokens");b(this,"options");b(this,"state");b(this,"tokenizer");b(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_,this.options.tokenizer=this.options.tokenizer||new se,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={other:x,block:ee.normal,inline:Z.normal};this.options.pedantic?(t.block=ee.pedantic,t.inline=Z.pedantic):this.options.gfm&&(t.block=ee.gfm,this.options.breaks?t.inline=Z.breaks:t.inline=Z.gfm),this.tokenizer.rules=t}static get rules(){return{block:ee,inline:Z}}static lex(e,t){return new $(t).lex(e)}static lexInline(e,t){return new $(t).inlineTokens(e)}lex(e){e=e.replace(x.carriageReturn,`
- `),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=[],n=!1){var i,r,l;for(this.options.pedantic&&(e=e.replace(x.tabCharGlobal," ").replace(x.spaceLine,""));e;){let o;if((r=(i=this.options.extensions)==null?void 0:i.block)!=null&&r.some(a=>(o=a.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const a=t.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
- `:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
- `+o.raw,a.text+=`
- `+o.text,this.inlineQueue.at(-1).src=a.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
- `+o.raw,a.text+=`
- `+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let u=e;if((l=this.options.extensions)!=null&&l.startBlock){let a=1/0;const c=e.slice(1);let h;this.options.extensions.startBlock.forEach(p=>{h=p.call({lexer:this},c),typeof h=="number"&&h>=0&&(a=Math.min(a,h))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){const a=t.at(-1);n&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
- `+o.raw,a.text+=`
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(o),n=u.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
- `+o.raw,a.text+=`
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(o);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=[]){var o,u,a;let n=e,i=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r=!1,l="";for(;e;){r||(l=""),r=!1;let c;if((u=(o=this.options.extensions)==null?void 0:o.inline)!=null&&u.some(p=>(c=p.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const p=t.at(-1);c.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=c.raw,p.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,l)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let h=e;if((a=this.options.extensions)!=null&&a.startInline){let p=1/0;const f=e.slice(1);let m;this.options.extensions.startInline.forEach(d=>{m=d.call({lexer:this},f),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(h=e.substring(0,p+1))}if(c=this.tokenizer.inlineText(h)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(l=c.raw.slice(-1)),r=!0;const p=t.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=c.raw,p.text+=c.text):t.push(c);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}}class re{constructor(e){b(this,"options");b(this,"parser");this.options=e||_}space(e){return""}code({text:e,lang:t,escaped:n}){var l;const i=(l=(t||"").match(x.notSpaceStart))==null?void 0:l[0],r=e.replace(x.endingNewline,"")+`
- `;return i?'<pre><code class="language-'+S(i)+'">'+(n?r:S(r,!0))+`</code></pre>
- `:"<pre><code>"+(n?r:S(r,!0))+`</code></pre>
- `}blockquote({tokens:e}){return`<blockquote>
- ${this.parser.parse(e)}</blockquote>
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
- `}hr(e){return`<hr>
- `}list(e){const t=e.ordered,n=e.start;let i="";for(let o=0;o<e.items.length;o++){const u=e.items[o];i+=this.listitem(u)}const r=t?"ol":"ul",l=t&&n!==1?' start="'+n+'"':"";return"<"+r+l+`>
- `+i+"</"+r+`>
- `}listitem(e){var n;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+S(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
- `}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let i="";for(let r=0;r<e.rows.length;r++){const l=e.rows[r];n="";for(let o=0;o<l.length;o++)n+=this.tablecell(l[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
- <thead>
- `+t+`</thead>
- `+i+`</table>
- `}tablerow({text:e}){return`<tr>
- ${e}</tr>
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),r=Ge(e);if(r===null)return i;e=r;let l='<a href="'+e+'"';return t&&(l+=' title="'+S(t)+'"'),l+=">"+i+"</a>",l}image({href:e,title:t,text:n}){const i=Ge(e);if(i===null)return S(n);e=i;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${S(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}}class Se{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class C{constructor(e){b(this,"options");b(this,"renderer");b(this,"textRenderer");this.options=e||_,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Se}static parse(e,t){return new C(t).parse(e)}static parseInline(e,t){return new C(t).parseInline(e)}parse(e,t=!0){var i,r;let n="";for(let l=0;l<e.length;l++){const o=e[l];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[o.type]){const a=o,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=c||"";continue}}const u=o;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let a=u,c=this.renderer.text(a);for(;l+1<e.length&&e[l+1].type==="text";)a=e[++l],c+=`
- `+this.renderer.text(a);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t=this.renderer){var i,r;let n="";for(let l=0;l<e.length;l++){const o=e[l];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[o.type]){const a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=a||"";continue}}const u=o;switch(u.type){case"escape":{n+=t.text(u);break}case"html":{n+=t.html(u);break}case"link":{n+=t.link(u);break}case"image":{n+=t.image(u);break}case"strong":{n+=t.strong(u);break}case"em":{n+=t.em(u);break}case"codespan":{n+=t.codespan(u);break}case"br":{n+=t.br(u);break}case"del":{n+=t.del(u);break}case"text":{n+=t.text(u);break}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class V{constructor(e){b(this,"options");b(this,"block");this.options=e||_}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?C.parse:C.parseInline}}b(V,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class kn{constructor(...e){b(this,"defaults",be());b(this,"options",this.setOptions);b(this,"parse",this.parseMarkdown(!0));b(this,"parseInline",this.parseMarkdown(!1));b(this,"Parser",C);b(this,"Renderer",re);b(this,"TextRenderer",Se);b(this,"Lexer",$);b(this,"Tokenizer",se);b(this,"Hooks",V);this.use(...e)}walkTokens(e,t){var i,r;let n=[];for(const l of e)switch(n=n.concat(t.call(this,l)),l.type){case"table":{const o=l;for(const u of o.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of o.rows)for(const a of u)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const o=l;n=n.concat(this.walkTokens(o.items,t));break}default:{const o=l;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{const a=o[u].flat(1/0);n=n.concat(this.walkTokens(a,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const l=t.renderers[r.name];l?t.renderers[r.name]=function(...o){let u=r.renderer.apply(this,o);return u===!1&&(u=l.apply(this,o)),u}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[r.level];l?l.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=this.defaults.renderer||new re(this.defaults);for(const l in n.renderer){if(!(l in r))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const o=l,u=n.renderer[o],a=r[o];r[o]=(...c)=>{let h=u.apply(r,c);return h===!1&&(h=a.apply(r,c)),h||""}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new se(this.defaults);for(const l in n.tokenizer){if(!(l in r))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const o=l,u=n.tokenizer[o],a=r[o];r[o]=(...c)=>{let h=u.apply(r,c);return h===!1&&(h=a.apply(r,c)),h}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new V;for(const l in n.hooks){if(!(l in r))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const o=l,u=n.hooks[o],a=r[o];V.passThroughHooks.has(l)?r[o]=c=>{if(this.defaults.async)return Promise.resolve(u.call(r,c)).then(p=>a.call(r,p));const h=u.call(r,c);return a.call(r,h)}:r[o]=(...c)=>{let h=u.apply(r,c);return h===!1&&(h=a.apply(r,c)),h}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,l=n.walkTokens;i.walkTokens=function(o){let u=[];return u.push(l.call(this,o)),r&&(u=u.concat(r.call(this,o))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $.lex(e,t??this.defaults)}parser(e,t){return C.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const r={...i},l={...this.defaults,...r},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&r.async===!1)return o(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 n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=e);const u=l.hooks?l.hooks.provideLexer():e?$.lex:$.lexInline,a=l.hooks?l.hooks.provideParser():e?C.parse:C.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then(c=>u(c,l)).then(c=>l.hooks?l.hooks.processAllTokens(c):c).then(c=>l.walkTokens?Promise.all(this.walkTokens(c,l.walkTokens)).then(()=>c):c).then(c=>a(c,l)).then(c=>l.hooks?l.hooks.postprocess(c):c).catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=u(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let h=a(c,l);return l.hooks&&(h=l.hooks.postprocess(h)),h}catch(c){return o(c)}}}onError(e,t){return n=>{if(n.message+=`
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+S(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const P=new kn;function g(s,e){return P.parse(s,e)}g.options=g.setOptions=function(s){return P.setOptions(s),g.defaults=P.defaults,Fe(g.defaults),g};g.getDefaults=be;g.defaults=_;g.use=function(...s){return P.use(...s),g.defaults=P.defaults,Fe(g.defaults),g};g.walkTokens=function(s,e){return P.walkTokens(s,e)};g.parseInline=P.parseInline;g.Parser=C;g.parser=C.parse;g.Renderer=re;g.TextRenderer=Se;g.Lexer=$;g.lexer=$.lex;g.Tokenizer=se;g.Hooks=V;g.parse=g;g.options;g.setOptions;g.use;g.walkTokens;g.parseInline;C.parse;$.lex;function xn(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{je as D,kn as M,xn as c,g as m};
|