62 lines
78 KiB
Python
62 lines
78 KiB
Python
import{c as Pt,d as be,u as We,r as K,w as Dt,a as W,o as P,h as zt,b,n as T,e as d,i as xe,t as R,x as cr,j as ge,z as ur,l as L,_ as Re,G as pr,v as Le,E as me,k as Ut,T as Ft,K as hr,X as Nn,H as dr,y as fr,D as gr,p as mr,L as kr,f as br,M as xr,I as wr,J as yr}from"./index-B3zfsvgW.js";import{S as _r,C as Tr,Q as vr,u as Ar,P as Er,d as Sr}from"./PageHeader-Y9MICulD.js";import{F as Pn}from"./file-Ceuyr6iv.js";import{H as Rr}from"./hard-drive-5GIKYPKr.js";import{E as Lr,T as Cr}from"./trash-CdDjPTBr.js";import{C as Dr}from"./copy-DV195_ld.js";import"./box-COy3AQAQ.js";const Ir=Pt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const $r=Pt("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const zn=Pt("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Mr={class:"mb-6 relative"},Or={class:"relative"},Nr=["placeholder","readonly"],Pr={key:0,class:"absolute inset-y-0 right-0 flex items-center pr-3"},zr=["disabled"],Ur={class:"flex items-center justify-center relative z-10"},Fr=be({__name:"RetrieveForm",props:{inputStatus:{},error:{type:Boolean}},emits:["submit","update:code"],setup(r,{expose:e,emit:t}){const{t:s}=We(),n=t,l=xe("isDarkMode"),i=K(""),a=K(!1),u=K();return Dt(i,c=>{n("update:code",c)}),e({focus:()=>u.value?.focus()}),(c,h)=>(P(),W("form",{onSubmit:h[3]||(h[3]=zt(m=>c.$emit("submit"),["prevent"]))},[b("div",Mr,[b("label",{for:"code",class:T(["block text-sm font-medium mb-2",[d(l)?"text-gray-300":"text-gray-800"]])},R(d(s)("retrieve.codeInput.label")),3),b("div",Or,[cr(b("input",{id:"code","onUpdate:modelValue":h[0]||(h[0]=m=>i.value=m),type:"text",ref_key:"codeInput",ref:u,class:T(["w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10",[d(l)?"bg-gray-700 bg-opacity-50":"bg-gray-100",{"ring-2 ring-red-500":c.error},d(l)?"text-gray-300":"text-gray-800"]]),placeholder:d(s)("retrieve.codeInput.placeholder"),required:"",readonly:c.inputStatus.readonly,maxlength:"5",onFocus:h[1]||(h[1]=m=>a.value=!0),onBlur:h[2]||(h[2]=m=>a.value=!1)},null,42,Nr),[[ur,i.value]]),c.inputStatus.loading?(P(),W("div",Pr,[...h[4]||(h[4]=[b("span",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-500"},null,-1)])])):ge("",!0)]),b("div",{class:T(["absolute -bottom-0.5 left-2 h-0.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 transition-all duration-300 ease-in-out",{"w-97-100":a.value,"w-0":!a.value}])},null,2)]),b("button",{type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-3 px-4 rounded-lg hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group",disabled:c.inputStatus.loading},[b("span",Ur,[b("span",null,R(c.inputStatus.loading?d(s)("common.loading"):d(s)("retrieve.submit")),1),L(d(Ir),{class:"w-5 h-5 ml-2 transition-transform duration-300 transform group-hover:translate-x-1"})]),h[5]||(h[5]=b("span",{class:"absolute top-0 left-0 w-full h-full bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 opacity-0 group-hover:opacity-100 transition-opacity duration-300"},null,-1))],8,zr)],32))}}),Br=Re(Fr,[["__scopeId","data-v-8f0be1b0"]]),Hr={key:0,class:"mb-6 text-center"},Gr=be({__name:"PageFooter",props:{linkText:{},linkTo:{},drawerText:{}},emits:["toggle-drawer"],setup(r){const{t:e}=We(),t=xe("isDarkMode");return(s,n)=>{const l=pr("router-link");return P(),W("div",null,[s.linkText&&s.linkTo?(P(),W("div",Hr,[L(l,{to:s.linkTo,class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:Le(()=>[me(R(s.linkText),1)]),_:1},8,["to"])])):ge("",!0),b("div",{class:T(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[d(t)?"bg-gray-800":"bg-gray-100"]])},[b("span",{class:T(["text-sm flex items-center",[d(t)?"text-gray-300":"text-gray-800"]])},[L(d(_r),{class:"w-4 h-4 mr-1 text-green-400"}),me(" "+R(d(e)("send.secureEncryption")),1)],2),b("button",{onClick:n[0]||(n[0]=i=>s.$emit("toggle-drawer")),class:T(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[d(t)?"text-indigo-400":"text-indigo-600"]])},[me(R(s.drawerText)+" ",1),L(d(Tr),{class:"w-4 h-4 ml-1"})],2)],2)])}}}),Wr=be({__name:"SideDrawer",props:{visible:{type:Boolean},title:{}},emits:["close"],setup(r){const e=xe("isDarkMode");return(t,s)=>(P(),Ut(Ft,{name:"drawer"},{default:Le(()=>[t.visible?(P(),W("div",{key:0,class:T(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[d(e)?"bg-gray-900":"bg-white"]])},[b("div",{class:T(["flex justify-between items-center p-6 border-b",[d(e)?"border-gray-700":"border-gray-200"]])},[b("h3",{class:T(["text-2xl font-bold",[d(e)?"text-white":"text-gray-800"]])},R(t.title),3),b("button",{onClick:s[0]||(s[0]=n=>t.$emit("close")),class:T(["hover:text-white transition duration-300",[d(e)?"text-gray-400":"text-gray-800"]])},[L(d(Nn),{class:"w-6 h-6"})],2)],2),hr(t.$slots,"default",{},void 0,!0)],2)):ge("",!0)]),_:3}))}}),qr=Re(Wr,[["__scopeId","data-v-9c6698ec"]]),jr={key:0,class:"space-y-4"},Zr={class:"flex items-center"},Xr={class:"font-medium"},Yr={class:"flex items-center"},Vr={class:"font-medium"},Qr={class:"flex items-center"},Kr={class:"font-medium"},Jr={class:"flex items-center"},es={class:"font-medium"},ts={key:0,class:"ml-2"},ns={key:1},rs=["href"],ss={key:1,class:"mt-6 flex flex-col items-center"},is={class:"bg-white p-2 rounded-lg shadow-md"},os=be({__name:"FileDetailModal",props:{visible:{type:Boolean},record:{}},emits:["close","preview-content"],setup(r){const{t:e}=We(),t=xe("isDarkMode"),s=window.location.origin,n=i=>i.downloadUrl?i.downloadUrl.startsWith("http")?i.downloadUrl:`${s}${i.downloadUrl}`:"",l=i=>i.downloadUrl?`${s}${i.downloadUrl}`:`${s}?code=${i.code}`;return(i,a)=>(P(),Ut(Ft,{name:"fade"},{default:Le(()=>[i.visible?(P(),W("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:a[2]||(a[2]=zt(u=>i.$emit("close"),["self"]))},[b("div",{class:T(["p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg overflow-hidden",[d(t)?"bg-gray-800 bg-opacity-70":"bg-white bg-opacity-95"]])},[b("h3",{class:T(["text-2xl font-bold mb-6 truncate",[d(t)?"text-white":"text-gray-800"]])},R(d(e)("fileDetail.title")),3),i.record?(P(),W("div",jr,[b("div",Zr,[L(d(Pn),{class:T(["w-6 h-6 mr-3 flex-shrink-0",[d(t)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),b("p",{class:T([[d(t)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[b("span",Xr,R(d(e)("fileRecord.filename"))+":",1),me(R(i.record.filename),1)],2)]),b("div",Yr,[L(d($r),{class:T(["w-6 h-6 mr-3 flex-shrink-0",[d(t)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),b("p",{class:T([[d(t)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[b("span",Vr,R(d(e)("fileRecord.date"))+":",1),me(R(i.record.date),1)],2)]),b("div",Qr,[L(d(Rr),{class:T(["w-6 h-6 mr-3 flex-shrink-0",[d(t)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),b("p",{class:T([[d(t)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[b("span",Kr,R(d(e)("fileRecord.size"))+":",1),me(R(i.record.size),1)],2)]),b("div",Jr,[L(d(zn),{class:T(["w-6 h-6 mr-3",[d(t)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),b("p",{class:T([d(t)?"text-gray-300":"text-gray-800"])},[b("span",es,R(d(e)("fileDetail.content"))+":",1)],2),i.record.filename==="Text"?(P(),W("div",ts,[b("button",{onClick:a[0]||(a[0]=u=>i.$emit("preview-content")),class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"},R(d(e)("fileDetail.previewContent")),1)])):(P(),W("div",ns,[b("a",{href:n(i.record),target:"_blank",rel:"noopener noreferrer",class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"},R(d(e)("fileDetail.download")),9,rs)]))])])):ge("",!0),i.record?(P(),W("div",ss,[b("h4",{class:T(["text-lg font-semibold mb-3",[d(t)?"text-white":"text-gray-800"]])},R(d(e)("fileDetail.qrCode")),3),b("div",is,[L(vr,{value:l(i.record),size:128,level:"M"},null,8,["value"])]),b("p",{class:T(["mt-2 text-sm",[d(t)?"text-gray-400":"text-gray-600"]])},R(d(e)("fileDetail.scanQrCode")),3)])):ge("",!0),b("button",{onClick:a[1]||(a[1]=u=>i.$emit("close")),class:"mt-8 w-full bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105"},R(d(e)("common.close")),1)],2)])):ge("",!0)]),_:1}))}}),ls=Re(os,[["__scopeId","data-v-5c3436d6"]]),as={class:"flex-grow overflow-y-auto p-6"},cs={class:"flex-shrink-0 mr-4"},us={class:"flex-grow min-w-0 mr-4"},ps={class:"flex-shrink-0 flex space-x-2"},hs=["onClick"],ds=["onClick"],fs=["onClick"],gs=be({__name:"FileRecordList",props:{records:{}},emits:["view-details","download-record","delete-record"],setup(r){const e=xe("isDarkMode");return(t,s)=>(P(),W("div",as,[L(dr,{name:"list",tag:"div",class:"space-y-4"},{default:Le(()=>[(P(!0),W(fr,null,gr(t.records,n=>(P(),W("div",{key:n.id,class:T(["bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102",[d(e)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[b("div",cs,[L(d(Pn),{class:T(["w-10 h-10",[d(e)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),b("div",us,[b("p",{class:T(["font-medium text-lg truncate",[d(e)?"text-white":"text-gray-800"]])},R(n.filename),3),b("p",{class:T(["text-sm truncate",[d(e)?"text-gray-400":"text-gray-600"]])},R(n.date)+" · "+R(n.size),3)]),b("div",ps,[b("button",{onClick:l=>t.$emit("view-details",n),class:T(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[d(e)?"hover:bg-indigo-400 text-indigo-400":"hover:bg-indigo-100 text-indigo-600"]])},[L(d(Lr),{class:"w-5 h-5"})],10,hs),b("button",{onClick:l=>t.$emit("download-record",n),class:T(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[d(e)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[L(d(zn),{class:"w-5 h-5"})],10,ds),b("button",{onClick:l=>t.$emit("delete-record",n.id),class:T(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[d(e)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[L(d(Cr),{class:"w-5 h-5"})],10,fs)])],2))),128))]),_:1})]))}}),ms=Re(gs,[["__scopeId","data-v-31facf40"]]),ks={class:"flex justify-between items-center mb-4 flex-shrink-0"},bs={class:"flex items-center gap-3"},xs={class:"flex-1 overflow-y-auto custom-scrollbar"},ws=["innerHTML"],ys=be({__name:"ContentPreviewModal",props:{visible:{type:Boolean},renderedContent:{}},emits:["close","copy-content"],setup(r){const{t:e}=We(),t=xe("isDarkMode");return(s,n)=>(P(),Ut(Ft,{name:"fade"},{default:Le(()=>[s.visible?(P(),W("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:n[2]||(n[2]=zt(l=>s.$emit("close"),["self"]))},[b("div",{class:T(["p-6 rounded-2xl max-w-3xl w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 max-h-[85vh] overflow-hidden flex flex-col",[d(t)?"bg-gray-800":"bg-white"]])},[b("div",ks,[b("h3",{class:T(["text-2xl font-bold",[d(t)?"text-white":"text-gray-800"]])},R(d(e)("contentPreview.title")),3),b("div",bs,[b("button",{onClick:n[0]||(n[0]=l=>s.$emit("copy-content")),class:T(["px-4 py-1.5 rounded-lg transition duration-300 flex items-center gap-2 text-sm font-medium",[d(t)?"bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white":"bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-900"]])},[L(d(Dr),{class:"w-4 h-4"}),me(" "+R(d(e)("common.copy")),1)],2),b("button",{onClick:n[1]||(n[1]=l=>s.$emit("close")),class:T(["p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10",[d(t)?"text-gray-400 hover:text-white hover:bg-white":"text-gray-500 hover:text-gray-900 hover:bg-black"]])},[L(d(Nn),{class:"w-5 h-5"})],2)])]),b("div",xs,[b("div",{class:T(["prose max-w-none p-6 rounded-xl break-words overflow-wrap-anywhere",[d(t)?"prose-invert bg-gray-900 bg-opacity-50":"bg-gray-50"]]),innerHTML:s.renderedContent},null,10,ws)])],2)])):ge("",!0)]),_:1}))}}),_s=Re(ys,[["__scopeId","data-v-eb3f9cc8"]]);var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},rt={exports:{}},Ts=rt.exports,yn;function vs(){return yn||(yn=1,(function(r,e){(function(t,s){s()})(Ts,function(){function t(c,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function s(c,h,m){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){u(f.response,h,m)},f.onerror=function(){console.error("could not download file")},f.send()}function n(c){var h=new XMLHttpRequest;h.open("HEAD",c,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function l(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(h)}}var i=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Je=="object"&&Je.global===Je?Je:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=i.saveAs||(typeof window!="object"||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,h,m){var f=i.URL||i.webkitURL,y=document.createElement("a");h=h||c.name||"download",y.download=h,y.rel="noopener",typeof c=="string"?(y.href=c,y.origin===location.origin?l(y):n(y.href)?s(c,h,m):l(y,y.target="_blank")):(y.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(y.href)},4e4),setTimeout(function(){l(y)},0))}:"msSaveOrOpenBlob"in navigator?function(c,h,m){if(h=h||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(t(c,m),h);else if(n(c))s(c,h,m);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){l(f)})}}:function(c,h,m,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return s(c,h,m);var y=c.type==="application/octet-stream",v=/constructor/i.test(i.HTMLElement)||i.safari,$=/CriOS\/[\d]+/.test(navigator.userAgent);if(($||y&&v||a)&&typeof FileReader<"u"){var V=new FileReader;V.onloadend=function(){var U=V.result;U=$?U:U.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=U:location=U,f=null},V.readAsDataURL(c)}else{var J=i.URL||i.webkitURL,ee=J.createObjectURL(c);f?f.location=ee:location.href=ee,f=null,setTimeout(function(){J.revokeObjectURL(ee)},4e4)}});i.saveAs=u.saveAs=u,r.exports=u})})(rt)),rt.exports}var As=vs();function Bt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var we=Bt();function Un(r){we=r}var Ge={exec:()=>null};function A(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(q.caret,"$1"),t=t.replace(n,i),s},getRegex:()=>new RegExp(t,e)};return s}var q={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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Es=/^(?:[ \t]*(?:\n|$))+/,Ss=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Rs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ls=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ht=/(?:[*+-]|\d{1,9}[.)])/,Fn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Bn=A(Fn).replace(/bull/g,Ht).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/).replace(/\|table/g,"").getRegex(),Cs=A(Fn).replace(/bull/g,Ht).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ds=/^[^\n]+/,Wt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Is=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$s=A(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ht).getRegex(),ct="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",qt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ms=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qt).replace("tag",ct).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Hn=A(Gt).replace("hr",qe).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",ct).getRegex(),Os=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Hn).getRegex(),jt={blockquote:Os,code:Ss,def:Is,fences:Rs,heading:Ls,hr:qe,html:Ms,lheading:Bn,list:$s,newline:Es,paragraph:Hn,table:Ge,text:Ds},_n=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qe).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",ct).getRegex(),Ns={...jt,lheading:Cs,table:_n,paragraph:A(Gt).replace("hr",qe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_n).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",ct).getRegex()},Ps={...jt,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qt).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:Ge,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(Gt).replace("hr",qe).replace("heading",` *#{1,6} *[^
|
||
]`).replace("lheading",Bn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Us=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gn=/^( {2,}|\\)\n(?!\s*$)/,Fs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ut=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,Wn=/[^\s\p{P}\p{S}]/u,Bs=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),qn=/(?!~)[\p{P}\p{S}]/u,Hs=/(?!~)[\s\p{P}\p{S}]/u,Gs=/(?:[^\s\p{P}\p{S}]|~)/u,Ws=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,jn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qs=A(jn,"u").replace(/punct/g,ut).getRegex(),js=A(jn,"u").replace(/punct/g,qn).getRegex(),Zn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zs=A(Zn,"gu").replace(/notPunctSpace/g,Wn).replace(/punctSpace/g,Zt).replace(/punct/g,ut).getRegex(),Xs=A(Zn,"gu").replace(/notPunctSpace/g,Gs).replace(/punctSpace/g,Hs).replace(/punct/g,qn).getRegex(),Ys=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wn).replace(/punctSpace/g,Zt).replace(/punct/g,ut).getRegex(),Vs=A(/\\(punct)/,"gu").replace(/punct/g,ut).getRegex(),Qs=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ks=A(qt).replace("(?:-->|$)","-->").getRegex(),Js=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ks).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ot=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,ei=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ot).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xn=A(/^!?\[(label)\]\[(ref)\]/).replace("label",ot).replace("ref",Wt).getRegex(),Yn=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wt).getRegex(),ti=A("reflink|nolink(?!\\()","g").replace("reflink",Xn).replace("nolink",Yn).getRegex(),Xt={_backpedal:Ge,anyPunctuation:Vs,autolink:Qs,blockSkip:Ws,br:Gn,code:Us,del:Ge,emStrongLDelim:qs,emStrongRDelimAst:Zs,emStrongRDelimUnd:Ys,escape:zs,link:ei,nolink:Yn,punctuation:Bs,reflink:Xn,reflinkSearch:ti,tag:Js,text:Fs,url:Ge},ni={...Xt,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",ot).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot).getRegex()},It={...Xt,emStrongRDelimAst:Xs,emStrongLDelim:js,url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ri={...It,br:A(Gn).replace("{2,}","*").getRegex(),text:A(It.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},et={normal:jt,gfm:Ns,pedantic:Ps},Ne={normal:Xt,gfm:It,breaks:ri,pedantic:ni},si={"&":"&","<":"<",">":">",'"':""","'":"'"},Tn=r=>si[r];function re(r,e){if(e){if(q.escapeTest.test(r))return r.replace(q.escapeReplace,Tn)}else if(q.escapeTestNoEncode.test(r))return r.replace(q.escapeReplaceNoEncode,Tn);return r}function vn(r){try{r=encodeURI(r).replace(q.percentDecode,"%")}catch{return null}return r}function An(r,e){let t=r.replace(q.findPipe,(l,i,a)=>{let u=!1,c=i;for(;--c>=0&&a[c]==="\\";)u=!u;return u?"|":" |"}),s=t.split(q.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(q.slashPipe,"|");return s}function Pe(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s&&r.charAt(s-n-1)===e;)n++;return r.slice(0,s-n)}function ii(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function En(r,e,t,s,n){let l=e.href,i=e.title||null,a=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let u={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:l,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,u}function oi(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
||
`).map(l=>{let i=l.match(t.other.beginningSpace);if(i===null)return l;let[a]=i;return a.length>=n.length?l.slice(n.length):l}).join(`
|
||
`)}var lt=class{options;rules;lexer;constructor(r){this.options=r||we}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Pe(t,`
|
||
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=oi(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Pe(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Pe(e[0],`
|
||
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=Pe(e[0],`
|
||
`).split(`
|
||
`),s="",n="",l=[];for(;t.length>0;){let i=!1,a=[],u;for(u=0;u<t.length;u++)if(this.rules.other.blockquoteStart.test(t[u]))a.push(t[u]),i=!0;else if(!i)a.push(t[u]);else break;t=t.slice(u);let c=a.join(`
|
||
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
||
${c}`:c,n=n?`${n}
|
||
${h}`:h;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,l,!0),this.lexer.state.top=m,t.length===0)break;let f=l.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let y=f,v=y.raw+`
|
||
`+t.join(`
|
||
`),$=this.blockquote(v);l[l.length-1]=$,s=s.substring(0,s.length-y.raw.length)+$.raw,n=n.substring(0,n.length-y.text.length)+$.text;break}else if(f?.type==="list"){let y=f,v=y.raw+`
|
||
`+t.join(`
|
||
`),$=this.list(v);l[l.length-1]=$,s=s.substring(0,s.length-f.raw.length)+$.raw,n=n.substring(0,n.length-y.raw.length)+$.raw,t=v.substring(l.at(-1).raw.length).split(`
|
||
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let l=this.rules.other.listItemRegex(t),i=!1;for(;r;){let u=!1,c="",h="";if(!(e=l.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let m=e[2].split(`
|
||
`,1)[0].replace(this.rules.other.listReplaceTabs,J=>" ".repeat(3*J.length)),f=r.split(`
|
||
`,1)[0],y=!m.trim(),v=0;if(this.options.pedantic?(v=2,h=m.trimStart()):y?v=e[1].length+1:(v=e[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=m.slice(v),v+=e[1].length),y&&this.rules.other.blankLine.test(f)&&(c+=f+`
|
||
`,r=r.substring(f.length+1),u=!0),!u){let J=this.rules.other.nextBulletRegex(v),ee=this.rules.other.hrRegex(v),U=this.rules.other.fencesBeginRegex(v),D=this.rules.other.headingBeginRegex(v),se=this.rules.other.htmlBeginRegex(v);for(;r;){let ie=r.split(`
|
||
`,1)[0],te;if(f=ie,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),te=f):te=f.replace(this.rules.other.tabCharGlobal," "),U.test(f)||D.test(f)||se.test(f)||J.test(f)||ee.test(f))break;if(te.search(this.rules.other.nonSpaceChar)>=v||!f.trim())h+=`
|
||
`+te.slice(v);else{if(y||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(m)||D.test(m)||ee.test(m))break;h+=`
|
||
`+f}!y&&!f.trim()&&(y=!0),c+=ie+`
|
||
`,r=r.substring(ie.length+1),m=te.slice(v)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let $=null,V;this.options.gfm&&($=this.rules.other.listIsTask.exec(h),$&&(V=$[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!$,checked:V,loose:!1,text:h,tokens:[]}),n.raw+=c}let a=n.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let u=0;u<n.items.length;u++)if(this.lexer.state.top=!1,n.items[u].tokens=this.lexer.blockTokens(n.items[u].text,[]),!n.loose){let c=n.items[u].tokens.filter(m=>m.type==="space"),h=c.length>0&&c.some(m=>this.rules.other.anyLine.test(m.raw));n.loose=h}if(n.loose)for(let u=0;u<n.items.length;u++)n.items[u].loose=!0;return n}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=An(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?l.align.push("right"):this.rules.other.tableAlignCenter.test(i)?l.align.push("center"):this.rules.other.tableAlignLeft.test(i)?l.align.push("left"):l.align.push(null);for(let i=0;i<t.length;i++)l.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:l.align[i]});for(let i of n)l.rows.push(An(i,l.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[u]})));return l}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
||
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);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(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let l=Pe(t.slice(0,-1),"\\");if((t.length-l.length)%2===0)return}else{let l=ii(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],n=l[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),En(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let l=t[0].charAt(0);return{type:"text",raw:l,text:l}}return En(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,l,i,a=n,u=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*r.length+n);(s=c.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){a+=i;continue}else if((s[5]||s[6])&&n%3&&!((n+i)%3)){u+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+u);let h=[...s[0]][0].length,m=r.slice(0,n+s.index+h+i);if(Math.min(n,i)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let f=m.slice(2,-2);return{type:"strong",raw:m,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},pe=class $t{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||we,this.options.tokenizer=this.options.tokenizer||new lt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:q,block:et.normal,inline:Ne.normal};this.options.pedantic?(t.block=et.pedantic,t.inline=Ne.pedantic):this.options.gfm&&(t.block=et.gfm,this.options.breaks?t.inline=Ne.breaks:t.inline=Ne.gfm),this.tokenizer.rules=t}static get rules(){return{block:et,inline:Ne}}static lex(e,t){return new $t(t).lex(e)}static lexInline(e,t){return new $t(t).inlineTokens(e)}lex(e){e=e.replace(q.carriageReturn,`
|
||
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(q.tabCharGlobal," ").replace(q.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=t.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
|
||
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||
`)?"":`
|
||
`)+n.raw,i.text+=`
|
||
`+n.text,this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||
`)?"":`
|
||
`)+n.raw,i.text+=`
|
||
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let l=e;if(this.options.extensions?.startBlock){let i=1/0,a=e.slice(1),u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},a),typeof u=="number"&&u>=0&&(i=Math.min(i,u))}),i<1/0&&i>=0&&(l=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){let i=t.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
||
`)?"":`
|
||
`)+n.raw,i.text+=`
|
||
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),s=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
||
`)?"":`
|
||
`)+n.raw,i.text+=`
|
||
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,i="";for(;e;){l||(i=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(f=>{m=f.call({lexer:this},h),typeof m=="number"&&m>=0&&(c=Math.min(c,m))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),l=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},at=class{options;parser;constructor(r){this.options=r||we}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(q.notSpaceStart)?.[0],n=r.replace(q.endingNewline,"")+`
|
||
`;return s?'<pre><code class="language-'+re(s)+'">'+(t?n:re(n,!0))+`</code></pre>
|
||
`:"<pre><code>"+(t?n:re(n,!0))+`</code></pre>
|
||
`}blockquote({tokens:r}){return`<blockquote>
|
||
${this.parser.parse(r)}</blockquote>
|
||
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
||
`}hr(r){return`<hr>
|
||
`}list(r){let e=r.ordered,t=r.start,s="";for(let i=0;i<r.items.length;i++){let a=r.items[i];s+=this.listitem(a)}let n=e?"ol":"ul",l=e&&t!==1?' start="'+t+'"':"";return"<"+n+l+`>
|
||
`+s+"</"+n+`>
|
||
`}listitem(r){let e="";if(r.task){let t=this.checkbox({checked:!!r.checked});r.loose?r.tokens[0]?.type==="paragraph"?(r.tokens[0].text=t+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=t+" "+re(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`<li>${e}</li>
|
||
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
||
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let l=r.rows[n];t="";for(let i=0;i<l.length;i++)t+=this.tablecell(l[i]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
||
<thead>
|
||
`+e+`</thead>
|
||
`+s+`</table>
|
||
`}tablerow({text:r}){return`<tr>
|
||
${r}</tr>
|
||
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
||
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${re(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=vn(r);if(n===null)return s;r=n;let l='<a href="'+r+'"';return e&&(l+=' title="'+re(e)+'"'),l+=">"+s+"</a>",l}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=vn(r);if(n===null)return re(t);r=n;let l=`<img src="${r}" alt="${t}"`;return e&&(l+=` title="${re(e)}"`),l+=">",l}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:re(r.text)}},Yt=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},he=class Mt{options;renderer;textRenderer;constructor(e){this.options=e||we,this.options.renderer=this.options.renderer||new at,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yt}static parse(e,t){return new Mt(t).parse(e)}static parseInline(e,t){return new Mt(t).parseInline(e)}parse(e,t=!0){let s="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let a=l,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=u||"";continue}}let i=l;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let a=i,u=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],u+=`
|
||
`+this.renderer.text(a);t?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=a||"";continue}}let i=l;switch(i.type){case"escape":{s+=t.text(i);break}case"html":{s+=t.html(i);break}case"link":{s+=t.link(i);break}case"image":{s+=t.image(i);break}case"strong":{s+=t.strong(i);break}case"em":{s+=t.em(i);break}case"codespan":{s+=t.codespan(i);break}case"br":{s+=t.br(i);break}case"del":{s+=t.del(i);break}case"text":{s+=t.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},st=class{options;block;constructor(r){this.options=r||we}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?pe.lex:pe.lexInline}provideParser(){return this.block?he.parse:he.parseInline}},li=class{defaults=Bt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=he;Renderer=at;TextRenderer=Yt;Lexer=pe;Tokenizer=lt;Hooks=st;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let l of n.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of n.rows)for(let i of l)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(l=>{let i=n[l].flat(1/0);t=t.concat(this.walkTokens(i,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let l=e.renderers[n.name];l?e.renderers[n.name]=function(...i){let a=n.renderer.apply(this,i);return a===!1&&(a=l.apply(this,i)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[n.level];l?l.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new at(this.defaults);for(let l in t.renderer){if(!(l in n))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,a=t.renderer[i],u=n[i];n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new lt(this.defaults);for(let l in t.tokenizer){if(!(l in n))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,a=t.tokenizer[i],u=n[i];n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new st;for(let l in t.hooks){if(!(l in n))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,a=t.hooks[i],u=n[i];st.passThroughHooks.has(l)?n[i]=c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(m=>u.call(n,m));let h=a.call(n,c);return u.call(n,h)}:n[i]=(...c)=>{let h=a.apply(n,c);return h===!1&&(h=u.apply(n,c)),h}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,l=t.walkTokens;s.walkTokens=function(i){let a=[];return a.push(l.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return pe.lex(r,e??this.defaults)}parser(r,e){return he.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return l(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 l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=r);let i=n.hooks?n.hooks.provideLexer():r?pe.lex:pe.lexInline,a=n.hooks?n.hooks.provideParser():r?he.parse:he.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(e):e).then(u=>i(u,n)).then(u=>n.hooks?n.hooks.processAllTokens(u):u).then(u=>n.walkTokens?Promise.all(this.walkTokens(u,n.walkTokens)).then(()=>u):u).then(u=>a(u,n)).then(u=>n.hooks?n.hooks.postprocess(u):u).catch(l);try{n.hooks&&(e=n.hooks.preprocess(e));let u=i(e,n);n.hooks&&(u=n.hooks.processAllTokens(u)),n.walkTokens&&this.walkTokens(u,n.walkTokens);let c=a(u,n);return n.hooks&&(c=n.hooks.postprocess(c)),c}catch(u){return l(u)}}}onError(r,e){return t=>{if(t.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+re(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ke=new li;function E(r,e){return ke.parse(r,e)}E.options=E.setOptions=function(r){return ke.setOptions(r),E.defaults=ke.defaults,Un(E.defaults),E};E.getDefaults=Bt;E.defaults=we;E.use=function(...r){return ke.use(...r),E.defaults=ke.defaults,Un(E.defaults),E};E.walkTokens=function(r,e){return ke.walkTokens(r,e)};E.parseInline=ke.parseInline;E.Parser=he;E.parser=he.parse;E.Renderer=at;E.TextRenderer=Yt;E.Lexer=pe;E.lexer=pe.lex;E.Tokenizer=lt;E.Hooks=st;E.parse=E;E.options;E.setOptions;E.use;E.walkTokens;E.parseInline;he.parse;pe.lex;const{entries:Vn,setPrototypeOf:Sn,isFrozen:ai,getPrototypeOf:ci,getOwnPropertyDescriptor:ui}=Object;let{freeze:j,seal:Y,create:Qn}=Object,{apply:Ot,construct:Nt}=typeof Reflect<"u"&&Reflect;j||(j=function(e){return e});Y||(Y=function(e){return e});Ot||(Ot=function(e,t,s){return e.apply(t,s)});Nt||(Nt=function(e,t){return new e(...t)});const tt=Z(Array.prototype.forEach),pi=Z(Array.prototype.lastIndexOf),Rn=Z(Array.prototype.pop),ze=Z(Array.prototype.push),hi=Z(Array.prototype.splice),it=Z(String.prototype.toLowerCase),Et=Z(String.prototype.toString),Ln=Z(String.prototype.match),Ue=Z(String.prototype.replace),di=Z(String.prototype.indexOf),fi=Z(String.prototype.trim),Q=Z(Object.prototype.hasOwnProperty),G=Z(RegExp.prototype.test),Fe=gi(TypeError);function Z(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return Ot(r,e,s)}}function gi(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Nt(r,t)}}function w(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:it;Sn&&Sn(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){const l=t(n);l!==n&&(ai(e)||(e[s]=l),n=l)}r[n]=!0}return r}function mi(r){for(let e=0;e<r.length;e++)Q(r,e)||(r[e]=null);return r}function ue(r){const e=Qn(null);for(const[t,s]of Vn(r))Q(r,t)&&(Array.isArray(s)?e[t]=mi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ue(s):e[t]=s);return e}function Be(r,e){for(;r!==null;){const s=ui(r,e);if(s){if(s.get)return Z(s.get);if(typeof s.value=="function")return Z(s.value)}r=ci(r)}function t(){return null}return t}const Cn=j(["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","section","select","shadow","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"]),St=j(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Rt=j(["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"]),ki=j(["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"]),Lt=j(["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"]),bi=j(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dn=j(["#text"]),In=j(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ct=j(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$n=j(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),nt=j(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xi=Y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wi=Y(/<%[\w\W]*|[\w\W]*%>/gm),yi=Y(/\$\{[\w\W]*/gm),_i=Y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ti=Y(/^aria-[\-\w]+$/),Kn=Y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vi=Y(/^(?:\w+script|data):/i),Ai=Y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jn=Y(/^html$/i),Ei=Y(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mn=Object.freeze({__proto__:null,ARIA_ATTR:Ti,ATTR_WHITESPACE:Ai,CUSTOM_ELEMENT:Ei,DATA_ATTR:_i,DOCTYPE_NAME:Jn,ERB_EXPR:wi,IS_ALLOWED_URI:Kn,IS_SCRIPT_OR_DATA:vi,MUSTACHE_EXPR:xi,TMPLIT_EXPR:yi});const He={element:1,text:3,progressingInstruction:7,comment:8,document:9},Si=function(){return typeof window>"u"?null:window},Ri=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(s=t.getAttribute(n));const l="dompurify"+(s?"#"+s:"");try{return e.createPolicy(l,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function er(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Si();const e=k=>er(k);if(e.version="3.2.6",e.removed=[],!r||!r.document||r.document.nodeType!==He.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r;const s=t,n=s.currentScript,{DocumentFragment:l,HTMLTemplateElement:i,Node:a,Element:u,NodeFilter:c,NamedNodeMap:h=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:m,DOMParser:f,trustedTypes:y}=r,v=u.prototype,$=Be(v,"cloneNode"),V=Be(v,"remove"),J=Be(v,"nextSibling"),ee=Be(v,"childNodes"),U=Be(v,"parentNode");if(typeof i=="function"){const k=t.createElement("template");k.content&&k.content.ownerDocument&&(t=k.content.ownerDocument)}let D,se="";const{implementation:ie,createNodeIterator:te,createDocumentFragment:pt,getElementsByTagName:ht}=t,{importNode:dt}=s;let I=On();e.isSupported=typeof Vn=="function"&&typeof U=="function"&&ie&&ie.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:de,ERB_EXPR:Ce,TMPLIT_EXPR:x,DATA_ATTR:_,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:oe,ATTR_WHITESPACE:De,CUSTOM_ELEMENT:ft}=Mn;let{IS_ALLOWED_URI:Vt}=Mn,O=null;const Qt=w({},[...Cn,...St,...Rt,...Lt,...Dn]);let z=null;const Kt=w({},[...In,...Ct,...$n,...nt]);let C=Object.seal(Qn(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}})),Ie=null,gt=null,Jt=!0,mt=!0,en=!1,tn=!0,ye=!1,je=!0,fe=!1,kt=!1,bt=!1,_e=!1,Ze=!1,Xe=!1,nn=!0,rn=!1;const tr="user-content-";let xt=!0,$e=!1,Te={},ve=null;const sn=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let on=null;const ln=w({},["audio","video","img","source","image","track"]);let wt=null;const an=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ve="http://www.w3.org/2000/svg",le="http://www.w3.org/1999/xhtml";let Ae=le,yt=!1,_t=null;const nr=w({},[Ye,Ve,le],Et);let Qe=w({},["mi","mo","mn","ms","mtext"]),Ke=w({},["annotation-xml"]);const rr=w({},["title","style","font","a","script"]);let Me=null;const sr=["application/xhtml+xml","text/html"],ir="text/html";let N=null,Ee=null;const or=t.createElement("form"),cn=function(o){return o instanceof RegExp||o instanceof Function},Tt=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ee&&Ee===o)){if((!o||typeof o!="object")&&(o={}),o=ue(o),Me=sr.indexOf(o.PARSER_MEDIA_TYPE)===-1?ir:o.PARSER_MEDIA_TYPE,N=Me==="application/xhtml+xml"?Et:it,O=Q(o,"ALLOWED_TAGS")?w({},o.ALLOWED_TAGS,N):Qt,z=Q(o,"ALLOWED_ATTR")?w({},o.ALLOWED_ATTR,N):Kt,_t=Q(o,"ALLOWED_NAMESPACES")?w({},o.ALLOWED_NAMESPACES,Et):nr,wt=Q(o,"ADD_URI_SAFE_ATTR")?w(ue(an),o.ADD_URI_SAFE_ATTR,N):an,on=Q(o,"ADD_DATA_URI_TAGS")?w(ue(ln),o.ADD_DATA_URI_TAGS,N):ln,ve=Q(o,"FORBID_CONTENTS")?w({},o.FORBID_CONTENTS,N):sn,Ie=Q(o,"FORBID_TAGS")?w({},o.FORBID_TAGS,N):ue({}),gt=Q(o,"FORBID_ATTR")?w({},o.FORBID_ATTR,N):ue({}),Te=Q(o,"USE_PROFILES")?o.USE_PROFILES:!1,Jt=o.ALLOW_ARIA_ATTR!==!1,mt=o.ALLOW_DATA_ATTR!==!1,en=o.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=o.SAFE_FOR_TEMPLATES||!1,je=o.SAFE_FOR_XML!==!1,fe=o.WHOLE_DOCUMENT||!1,_e=o.RETURN_DOM||!1,Ze=o.RETURN_DOM_FRAGMENT||!1,Xe=o.RETURN_TRUSTED_TYPE||!1,bt=o.FORCE_BODY||!1,nn=o.SANITIZE_DOM!==!1,rn=o.SANITIZE_NAMED_PROPS||!1,xt=o.KEEP_CONTENT!==!1,$e=o.IN_PLACE||!1,Vt=o.ALLOWED_URI_REGEXP||Kn,Ae=o.NAMESPACE||le,Qe=o.MATHML_TEXT_INTEGRATION_POINTS||Qe,Ke=o.HTML_INTEGRATION_POINTS||Ke,C=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&cn(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(C.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&cn(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(C.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(C.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(mt=!1),Ze&&(_e=!0),Te&&(O=w({},Dn),z=[],Te.html===!0&&(w(O,Cn),w(z,In)),Te.svg===!0&&(w(O,St),w(z,Ct),w(z,nt)),Te.svgFilters===!0&&(w(O,Rt),w(z,Ct),w(z,nt)),Te.mathMl===!0&&(w(O,Lt),w(z,$n),w(z,nt))),o.ADD_TAGS&&(O===Qt&&(O=ue(O)),w(O,o.ADD_TAGS,N)),o.ADD_ATTR&&(z===Kt&&(z=ue(z)),w(z,o.ADD_ATTR,N)),o.ADD_URI_SAFE_ATTR&&w(wt,o.ADD_URI_SAFE_ATTR,N),o.FORBID_CONTENTS&&(ve===sn&&(ve=ue(ve)),w(ve,o.FORBID_CONTENTS,N)),xt&&(O["#text"]=!0),fe&&w(O,["html","head","body"]),O.table&&(w(O,["tbody"]),delete Ie.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=o.TRUSTED_TYPES_POLICY,se=D.createHTML("")}else D===void 0&&(D=Ri(y,n)),D!==null&&typeof se=="string"&&(se=D.createHTML(""));j&&j(o),Ee=o}},un=w({},[...St,...Rt,...ki]),pn=w({},[...Lt,...bi]),lr=function(o){let p=U(o);(!p||!p.tagName)&&(p={namespaceURI:Ae,tagName:"template"});const g=it(o.tagName),S=it(p.tagName);return _t[o.namespaceURI]?o.namespaceURI===Ve?p.namespaceURI===le?g==="svg":p.namespaceURI===Ye?g==="svg"&&(S==="annotation-xml"||Qe[S]):!!un[g]:o.namespaceURI===Ye?p.namespaceURI===le?g==="math":p.namespaceURI===Ve?g==="math"&&Ke[S]:!!pn[g]:o.namespaceURI===le?p.namespaceURI===Ve&&!Ke[S]||p.namespaceURI===Ye&&!Qe[S]?!1:!pn[g]&&(rr[g]||!un[g]):!!(Me==="application/xhtml+xml"&&_t[o.namespaceURI]):!1},ne=function(o){ze(e.removed,{element:o});try{U(o).removeChild(o)}catch{V(o)}},Se=function(o,p){try{ze(e.removed,{attribute:p.getAttributeNode(o),from:p})}catch{ze(e.removed,{attribute:null,from:p})}if(p.removeAttribute(o),o==="is")if(_e||Ze)try{ne(p)}catch{}else try{p.setAttribute(o,"")}catch{}},hn=function(o){let p=null,g=null;if(bt)o="<remove></remove>"+o;else{const M=Ln(o,/^[\r\n\t ]+/);g=M&&M[0]}Me==="application/xhtml+xml"&&Ae===le&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const S=D?D.createHTML(o):o;if(Ae===le)try{p=new f().parseFromString(S,Me)}catch{}if(!p||!p.documentElement){p=ie.createDocument(Ae,"template",null);try{p.documentElement.innerHTML=yt?se:S}catch{}}const F=p.body||p.documentElement;return o&&g&&F.insertBefore(t.createTextNode(g),F.childNodes[0]||null),Ae===le?ht.call(p,fe?"html":"body")[0]:fe?p.documentElement:F},dn=function(o){return te.call(o.ownerDocument||o,o,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},vt=function(o){return o instanceof m&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof h)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},fn=function(o){return typeof a=="function"&&o instanceof a};function ae(k,o,p){tt(k,g=>{g.call(e,o,p,Ee)})}const gn=function(o){let p=null;if(ae(I.beforeSanitizeElements,o,null),vt(o))return ne(o),!0;const g=N(o.nodeName);if(ae(I.uponSanitizeElement,o,{tagName:g,allowedTags:O}),je&&o.hasChildNodes()&&!fn(o.firstElementChild)&&G(/<[/\w!]/g,o.innerHTML)&&G(/<[/\w!]/g,o.textContent)||o.nodeType===He.progressingInstruction||je&&o.nodeType===He.comment&&G(/<[/\w]/g,o.data))return ne(o),!0;if(!O[g]||Ie[g]){if(!Ie[g]&&kn(g)&&(C.tagNameCheck instanceof RegExp&&G(C.tagNameCheck,g)||C.tagNameCheck instanceof Function&&C.tagNameCheck(g)))return!1;if(xt&&!ve[g]){const S=U(o)||o.parentNode,F=ee(o)||o.childNodes;if(F&&S){const M=F.length;for(let X=M-1;X>=0;--X){const ce=$(F[X],!0);ce.__removalCount=(o.__removalCount||0)+1,S.insertBefore(ce,J(o))}}}return ne(o),!0}return o instanceof u&&!lr(o)||(g==="noscript"||g==="noembed"||g==="noframes")&&G(/<\/no(script|embed|frames)/i,o.innerHTML)?(ne(o),!0):(ye&&o.nodeType===He.text&&(p=o.textContent,tt([de,Ce,x],S=>{p=Ue(p,S," ")}),o.textContent!==p&&(ze(e.removed,{element:o.cloneNode()}),o.textContent=p)),ae(I.afterSanitizeElements,o,null),!1)},mn=function(o,p,g){if(nn&&(p==="id"||p==="name")&&(g in t||g in or))return!1;if(!(mt&&!gt[p]&&G(_,p))){if(!(Jt&&G(H,p))){if(!z[p]||gt[p]){if(!(kn(o)&&(C.tagNameCheck instanceof RegExp&&G(C.tagNameCheck,o)||C.tagNameCheck instanceof Function&&C.tagNameCheck(o))&&(C.attributeNameCheck instanceof RegExp&&G(C.attributeNameCheck,p)||C.attributeNameCheck instanceof Function&&C.attributeNameCheck(p))||p==="is"&&C.allowCustomizedBuiltInElements&&(C.tagNameCheck instanceof RegExp&&G(C.tagNameCheck,g)||C.tagNameCheck instanceof Function&&C.tagNameCheck(g))))return!1}else if(!wt[p]){if(!G(Vt,Ue(g,De,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&o!=="script"&&di(g,"data:")===0&&on[o])){if(!(en&&!G(oe,Ue(g,De,"")))){if(g)return!1}}}}}}return!0},kn=function(o){return o!=="annotation-xml"&&Ln(o,ft)},bn=function(o){ae(I.beforeSanitizeAttributes,o,null);const{attributes:p}=o;if(!p||vt(o))return;const g={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let S=p.length;for(;S--;){const F=p[S],{name:M,namespaceURI:X,value:ce}=F,Oe=N(M),At=ce;let B=M==="value"?At:fi(At);if(g.attrName=Oe,g.attrValue=B,g.keepAttr=!0,g.forceKeepAttr=void 0,ae(I.uponSanitizeAttribute,o,g),B=g.attrValue,rn&&(Oe==="id"||Oe==="name")&&(Se(M,o),B=tr+B),je&&G(/((--!?|])>)|<\/(style|title)/i,B)){Se(M,o);continue}if(g.forceKeepAttr)continue;if(!g.keepAttr){Se(M,o);continue}if(!tn&&G(/\/>/i,B)){Se(M,o);continue}ye&&tt([de,Ce,x],wn=>{B=Ue(B,wn," ")});const xn=N(o.nodeName);if(!mn(xn,Oe,B)){Se(M,o);continue}if(D&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!X)switch(y.getAttributeType(xn,Oe)){case"TrustedHTML":{B=D.createHTML(B);break}case"TrustedScriptURL":{B=D.createScriptURL(B);break}}if(B!==At)try{X?o.setAttributeNS(X,M,B):o.setAttribute(M,B),vt(o)?ne(o):Rn(e.removed)}catch{Se(M,o)}}ae(I.afterSanitizeAttributes,o,null)},ar=function k(o){let p=null;const g=dn(o);for(ae(I.beforeSanitizeShadowDOM,o,null);p=g.nextNode();)ae(I.uponSanitizeShadowNode,p,null),gn(p),bn(p),p.content instanceof l&&k(p.content);ae(I.afterSanitizeShadowDOM,o,null)};return e.sanitize=function(k){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,g=null,S=null,F=null;if(yt=!k,yt&&(k="<!-->"),typeof k!="string"&&!fn(k))if(typeof k.toString=="function"){if(k=k.toString(),typeof k!="string")throw Fe("dirty is not a string, aborting")}else throw Fe("toString is not a function");if(!e.isSupported)return k;if(kt||Tt(o),e.removed=[],typeof k=="string"&&($e=!1),$e){if(k.nodeName){const ce=N(k.nodeName);if(!O[ce]||Ie[ce])throw Fe("root node is forbidden and cannot be sanitized in-place")}}else if(k instanceof a)p=hn("<!---->"),g=p.ownerDocument.importNode(k,!0),g.nodeType===He.element&&g.nodeName==="BODY"||g.nodeName==="HTML"?p=g:p.appendChild(g);else{if(!_e&&!ye&&!fe&&k.indexOf("<")===-1)return D&&Xe?D.createHTML(k):k;if(p=hn(k),!p)return _e?null:Xe?se:""}p&&bt&&ne(p.firstChild);const M=dn($e?k:p);for(;S=M.nextNode();)gn(S),bn(S),S.content instanceof l&&ar(S.content);if($e)return k;if(_e){if(Ze)for(F=pt.call(p.ownerDocument);p.firstChild;)F.appendChild(p.firstChild);else F=p;return(z.shadowroot||z.shadowrootmode)&&(F=dt.call(s,F,!0)),F}let X=fe?p.outerHTML:p.innerHTML;return fe&&O["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&G(Jn,p.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
||
`+X),ye&&tt([de,Ce,x],ce=>{X=Ue(X,ce," ")}),D&&Xe?D.createHTML(X):X},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tt(k),kt=!0},e.clearConfig=function(){Ee=null,kt=!1},e.isValidAttribute=function(k,o,p){Ee||Tt({});const g=N(k),S=N(o);return mn(g,S,p)},e.addHook=function(k,o){typeof o=="function"&&ze(I[k],o)},e.removeHook=function(k,o){if(o!==void 0){const p=pi(I[k],o);return p===-1?void 0:hi(I[k],p,1)[0]}return Rn(I[k])},e.removeHooks=function(k){I[k]=[]},e.removeAllHooks=function(){I=On()},e}var Li=er();const Ci={class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300"},Di={class:"w-full max-w-md relative z-10"},Ii={class:"p-8"},$i=be({__name:"RetrievewFileView",setup(r){const{t:e}=We(),t=mr(),s=window.location.origin,n=wr(),l=xe("isDarkMode"),i=Ar(),{receiveData:a}=kr(i),u=K(""),c=K({readonly:!1,loading:!1}),h=K(""),m=K(null),f=K(!1),y=xr(),v=a,$=JSON.parse(localStorage.getItem("config")||"{}"),V=K(null);br(()=>{V.value&&V.value.focus();const x=y.query.code;x&&typeof x=="string"&&(u.value=x)}),Dt(u,x=>{x.length===5&&U()});const J=x=>x.downloadUrl?x.downloadUrl.startsWith("http")?x.downloadUrl:`${s}${x.downloadUrl}`:"",ee=async()=>{m.value&&m.value.content&&await Sr(m.value.content,{successMsg:e("fileRecord.contentCopied"),errorMsg:e("fileRecord.copyFailed")})},U=async()=>{if(u.value.length!==5){t.showAlert(e("retrieve.messages.invalidCode"),"error");return}c.value.readonly=!0,c.value.loading=!0;try{const x=await yr.post("/share/select/",{code:u.value}),_=x.data||x;if(_&&_.code===200)if(_.detail){const H=_.detail.text.startsWith("/share/download")||_.detail.name!=="Text",oe={id:Date.now(),code:_.detail.code,filename:_.detail.name,size:D(_.detail.size),downloadUrl:H?_.detail.text:null,content:H?null:_.detail.text,date:new Date().toLocaleString()};let De=!0;i.receiveData.forEach(ft=>{ft.code===oe.code&&(De=!1)}),De&&i.addReceiveData(oe),H?m.value=oe:(m.value=oe,I.value=!0),t.showAlert(e("retrieve.messages.retrieveSuccess"),"success")}else t.showAlert(e("retrieve.messages.invalidCodeError"),"error");else t.showAlert(e("retrieve.messages.retrieveFailure")+_.detail,"error")}catch(x){console.error("Retrieve failed:",x);const _=x,H=_?.response?.data?.detail||_?.message||e("retrieve.messages.unknownError");t.showAlert(e("retrieve.messages.networkError")+H,"error")}finally{c.value.readonly=!1,c.value.loading=!1,u.value=""}},D=x=>{if(x===0)return"0 "+e("fileSize.bytes");const _=1024,H=[e("fileSize.bytes"),e("fileSize.kb"),e("fileSize.mb"),e("fileSize.gb"),e("fileSize.tb")],oe=Math.floor(Math.log(x)/Math.log(_));return parseFloat((x/Math.pow(_,oe)).toFixed(2))+" "+H[oe]},se=x=>{m.value=x},ie=x=>{const _=v.value.findIndex(H=>H.id===x);_!==-1&&i.deleteReceiveData(_)},te=()=>{f.value=!f.value},pt=()=>{n.push("/send")},ht=x=>x.downloadUrl?`${s}${x.downloadUrl}`:`${s}?code=${x.code}`,dt=x=>{if(x.downloadUrl)window.open(`${x.downloadUrl.startsWith("http")?"":s}${x.downloadUrl}`,"_blank");else if(x.content){const _=new Blob([x.content],{type:"text/plain;charset=utf-8"});As.saveAs(_,`${x.filename}.txt`)}},I=K(!1),de=K("");Dt(()=>m.value?.content,async x=>{if(x)try{const _=await E(x);de.value=Li.sanitize(_,{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","code","pre","a","img"],ALLOWED_ATTR:["href","src","alt","title","class"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})}catch(_){console.error("Markdown 渲染失败:",_),de.value=x}else de.value=""},{immediate:!0});const Ce=()=>{I.value=!0};return(x,_)=>(P(),W("div",Ci,[b("div",Di,[b("div",{class:T(["rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300",[d(l)?"bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[b("div",Ii,[L(Er,{title:d($).name,onTitleClick:pt},null,8,["title"]),L(Br,{"input-status":c.value,error:!!h.value,onSubmit:U,"onUpdate:code":_[0]||(_[0]=H=>u.value=H),ref:"retrieveFormRef"},null,8,["input-status","error"])]),L(Gr,{"link-text":x.$t("retrieve.needSendFile"),"link-to":"/send","drawer-text":x.$t("retrieve.recordsDrawer"),onToggleDrawer:te},null,8,["link-text","drawer-text"])],2)]),L(qr,{visible:f.value,title:x.$t("retrieve.recordsDrawer"),onClose:te},{default:Le(()=>[L(ms,{records:d(v),onViewDetails:se,onDownloadRecord:dt,onDeleteRecord:ie},null,8,["records"])]),_:1},8,["visible","title"]),L(ls,{visible:!!m.value,record:m.value,onClose:_[1]||(_[1]=H=>m.value=null),onShowContentPreview:Ce,"get-download-url":J,"get-qr-code-value":ht},null,8,["visible","record"]),L(_s,{visible:I.value,"rendered-content":de.value,onClose:_[2]||(_[2]=H=>I.value=!1),onCopyContent:ee},null,8,["visible","rendered-content"])]))}}),Bi=Re($i,[["__scopeId","data-v-a89ba9bf"]]);export{Bi as default};
|