1
0
mirror of https://github.com/StarGazer114/stargazer114.github.io.git synced 2025-01-09 06:48:17 +08:00
stargazer114.github.io/pluginsSrc/@waline/client/dist/waline.js

85 lines
168 KiB
JavaScript
Raw Permalink Normal View History

2025-01-05 20:41:38 +08:00
var xo=Object.defineProperty;var _o=(e,t,n)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var As=(e,t,n)=>_o(e,typeof t!="symbol"?t+"":t,n);const Es={"Content-Type":"application/json"},tt=e=>`${e.replace(/\/?$/,"/")}api/`,kt=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},_r=({serverURL:e,lang:t,paths:n,type:r,signal:s})=>fetch(`${tt(e)}article?path=${encodeURIComponent(n.join(","))}&type=${encodeURIComponent(r.join(","))}&lang=${t}`,{signal:s}).then(i=>i.json()).then(i=>kt(i,"Get counter").data),Pn=({serverURL:e,lang:t,path:n,type:r,action:s})=>fetch(`${tt(e)}article?lang=${t}`,{method:"POST",headers:Es,body:JSON.stringify({path:n,type:r,action:s})}).then(i=>i.json()).then(i=>kt(i,"Update counter").data),Ts=({serverURL:e,lang:t,path:n,page:r,pageSize:s,sortBy:i,signal:l,token:o})=>{const a={};return o&&(a.Authorization=`Bearer ${o}`),fetch(`${tt(e)}comment?path=${encodeURIComponent(n)}&pageSize=${s}&page=${r}&lang=${t}&sortBy=${i}`,{signal:l,headers:a}).then(c=>c.json()).then(c=>kt(c,"Get comment data").data)},Ls=({serverURL:e,lang:t,token:n,comment:r})=>{const s={"Content-Type":"application/json"};return n&&(s.Authorization=`Bearer ${n}`),fetch(`${tt(e)}comment?lang=${t}`,{method:"POST",headers:s,body:JSON.stringify(r)}).then(i=>i.json())},Is=({serverURL:e,lang:t,token:n,objectId:r})=>fetch(`${tt(e)}comment/${r}?lang=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(s=>kt(s,"Delete comment")),Xt=({serverURL:e,lang:t,token:n,objectId:r,comment:s})=>fetch(`${tt(e)}comment/${r}?lang=${t}`,{method:"PUT",headers:{...Es,Authorization:`Bearer ${n}`},body:JSON.stringify(s)}).then(i=>i.json()).then(i=>kt(i,"Update comment")),Ms=({serverURL:e,lang:t,paths:n,signal:r})=>fetch(`${tt(e)}comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=${t}`,{signal:r}).then(s=>s.json()).then(s=>kt(s,"Get comment count").data),Ps=({lang:e,serverURL:t})=>{const n=(window.innerWidth-450)/2,r=(window.innerHeight-450)/2,s=window.open(`${t.replace(/\/$/,"")}/ui/login?lng=${encodeURIComponent(e)}`,"_blank",`width=450,height=450,left=${n},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);return s==null||s.postMessage({type:"TOKEN",data:null},"*"),new Promise(i=>{const l=({data:o})=>{!o||typeof o!="object"||o.type!=="userInfo"||o.data.token&&(s==null||s.close(),window.removeEventListener("message",l),i(o.data))};window.addEventListener("message",l)})},Os=({serverURL:e,lang:t,paths:n,signal:r})=>_r({serverURL:e,lang:t,paths:n,type:["time"],signal:r}),js=e=>Pn({...e,type:"time",action:"inc"}),zs=({serverURL:e,lang:t,count:n,signal:r,token:s})=>{const i={};return s&&(i.Authorization=`Bearer ${s}`),fetch(`${tt(e)}comment?type=recent&count=${n}&lang=${t}`,{signal:r,headers:i}).then(l=>l.json())},Fs=({serverURL:e,signal:t,pageSize:n,lang:r})=>fetch(`${tt(e)}user?pageSize=${n}&lang=${r}`,{signal:t}).then(s=>s.json()).then(s=>kt(s,"user list")).then(s=>s.data),Co=["nick","mail","link"],Ds=e=>e.filter(t=>Co.includes(t)),Hs=["//unpkg.com/@waline/emojis@1.1.0/weibo"],So=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],$o=e=>new Promise((t,n)=>{if(e.size>128e3)return n(new Error("File too large! File size limit 128KB"));const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=n}),Ro=e=>e?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',Ao=e=>{const t=async(n,r={})=>fetch(`https://api.giphy.com/v1/gifs/${n}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...r}).toString()}`).then(s=>s.json()).then(({data:s})=>s.map(i=>({title:i.title,src:i.images.downsized_medium.url})));return{search:n=>t("
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),Bs=Ge(["Nombre de usuario","El nombre de usuario no puede tener menos de 3 bytes.","Correo electrónico","Por favor confirma tu dirección de correo electrónico.","Sitio web","Opcional","Comenta aquí...","Sin comentarios todavía.","Enviar","Like","Anular like","Responder","Anular respuesta","Comentarios","Recargar","Cargar Más...","Previsualizar","Emoji","Subir Imagen","segundos atrás","minutos atrás","horas atrás","días atrás","justo ahora","Subiendo","Iniciar sesión","cerrar sesión","Admin","Fijado","Palabras",`Por favor escriba entre $0 y $1 palabras!
El número actual de palabras: $2`,"Anónimo","Enanos","Hobbits","Ents","Magos","Elfos","Maiar","GIF","Buscar GIF","Perfil","Aprobado","Esperando","Spam","Desfijar","Más antiguos","Más recientes","Más vistos","¿Qué piensas?"]),Vs=Ge(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots !
Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),Ws=Ge(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),zo=Ge(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras!
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),qs=Ge(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов!
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),Ks=Ge(["Tên","Tên không được nhỏ hơn 3 ký tự.","E-Mail","Vui lòng xác nhập địa chỉ email của bạn.","Website","Tùy chọn","Hãy bình luận có văn hoá!","Chưa có bình luận","Gửi","Thích","Bỏ thích","Trả lời","Hủy bỏ","bình luận","Làm mới","Tải thêm...","Xem trước","Emoji","Tải lên hình ảnh","giây trước","phút trước","giờ trước","ngày trước","Vừa xong","Đang tải lên","Đăng nhập","đăng xuất","Quản trị viên","Dính","từ",`Bình luận phải độ dài giữa $0 $1 từ!
Số từ hiện tại: $2`,"Vô danh","Người lùn","Người tí hon","Thần rừng","Pháp sư","Tiên tộc","Maiar","Ảnh GIF","Tìm kiếm ảnh GIF","thông tin cá nhân","Đã được phê duyệt","Đang chờ đợi","Thư rác","Không dính","lâu đời nhất","muộn nhất","nóng nhất","What do you think?"]),Gs=Ge(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 $1 字之间
当前字数$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),Fo=Ge(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 $1 字之間
目前字數$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const Zs="en-US",On={zh:Gs,"zh-cn":Gs,"zh-tw":Fo,en:Ns,"en-us":Ns,fr:Vs,"fr-fr":Vs,jp:Ws,"jp-jp":Ws,"pt-br":zo,ru:qs,"ru-ru":qs,vi:Ks,"vi-vn":Ks,de:jo,es:Bs,"es-mx":Bs},Js=e=>On[e.toLowerCase()]||On[Zs.toLowerCase()],Ys=e=>Object.keys(On).includes(e.toLowerCase())?e:Zs,Xs={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},Do=Object.keys(Xs),jn=Symbol("waline-config"),Qs=e=>{try{e=decodeURI(e)}catch{}return e},ei=(e="")=>e.replace(/\/$/u,""),ti=e=>/^(https?:)?\/\//.test(e),zn=e=>{const t=ei(e);return ti(t)?t:`https://${t}`},Ho=e=>Array.isArray(e)?e:e?[0,e]:!1,Sr=(e,t)=>typeof e=="function"?e:e===!1?!1:t,Uo=({serverURL:e,path:t=location.pathname,lang:n=typeof navigator>"u"?"en-US":navigator.language,locale:r,emoji:s=Hs,meta:i=["nick","mail","link"],requiredMeta:l=[],dark:o=!1,pageSize:a=10,wordLimit:c,imageUploader:u,highlighter:h,texRenderer:p,copyright:g=!0,login:x="enable",search:b,reaction:S,recaptchaV3Key:y="",turnstileKey:_="",commentSorting:H="latest",...T})=>({serverURL:zn(e),path:Qs(t),lang:Ys(n),locale:{...Js(Ys(n)),...typeof r=="object"?r:{}},wordLimit:Ho(c),meta:Ds(i),requiredMeta:Ds(l),imageUploader:Sr(u,$o),highlighter:Sr(h,Po),texRenderer:Sr(p,Ro),dark:o,emoji:typeof s=="boolean"?s?Hs:[]:s,pageSize:a,login:x,copyright:g,search:b===!1?!1:typeof b=="object"?b:Ao(n),recaptchaV3Key:y,turnstileKey:_,reaction:Array.isArray(S)?S:S===!0?So:[],commentSorting:H,...T}),zt=e=>typeof e=="string",$r="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",No=e=>zt(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${$r}}`:`${e}${$r}`:e===!0?`:root${$r}`:"",Rr=(e,t)=>{let n=e.toString();for(;n.length<t;)n="0"+n;return n},Bo=e=>{const t=Rr(e.getDate(),2),n=Rr(e.getMonth()+1,2);return`${Rr(e.getFullYear(),2)}-${n}-${t}`},Vo=(e,t,n)=>{if(!e)return"";const r=zt(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,s=t.getTime()-r.getTime(),i=Math.floor(s/(24*3600*1e3));if(i===0){const l=s%864e5,o=Math.floor(l/(3600*1e3));if(o===0){const a=l%36e5,c=Math.floor(a/(60*1e3));if(c===0){const u=a%6e4;return`${Math.round(u/1e3)} ${n.seconds}`}return`${c} ${n.minutes}`}return`${o} ${n.hours}`}return i<0?n.now:i<8?`${i} ${n.days}`:Bo(r)},Wo=/^[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])?)*$/,qo=e=>Wo.test(e);/**
* @vue/shared v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function Ar(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ie={},Ft=[],xt=()=>{},Ko=()=>!1,Fn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Er=e=>e.startsWith("onUpdate:"),je=Object.assign,ni=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Go=Object.prototype.hasOwnProperty,te=(e,t)=>Go.call(e,t),W=Array.isArray,Dt=e=>Qt(e)==="[object Map]",Ht=e=>Qt(e)==="[object Set]",ri=e=>Qt(e)==="[object Date]",le=e=>typeof e=="function",be=e=>typeof e=="string",Ze=e=>typeof e=="symbol",de=e=>e!==null&&typeof e=="object",si=e=>(de(e)||le(e))&&le(e.then)&&le(e.catch),ii=Object.prototype.toString,Qt=e=>ii.call(e),Zo=e=>Qt(e).slice(8,-1),li=e=>Qt(e)==="[object Object]",Tr=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,en=Ar(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Dn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Jo=/-(\w)/g,ze=Dn(e=>e.replace(Jo,(t,n)=>n?n.toUpperCase():"")),Yo=/\B([A-Z])/g,_t=Dn(e=>e.replace(Yo,"-$1").toLowerCase()),Hn=Dn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Lr=Dn(e=>e?`on${Hn(e)}`:""),dt=(e,t)=>!Object.is(e,t),Un=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},oi=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Nn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ai;const tn=()=>ai||(ai=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function nn(e){if(W(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=be(r)?ta(r):nn(r);if(s)for(const i in s)t[i]=s[i]}return t}else if(be(e)||de(e))return e}const Xo=/;(?![^(]*\))/g,Qo=/:([^]+)/,ea=/\/\*[^]*?\*\//g;function ta(e){const t={};return e.replace(ea,"").split(Xo).forEach(n=>{if(n){const r=n.split(Qo);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function me(e){let t="";if(be(e))t=e;else if(W(e))for(let n=0;n<e.length;n++){const r=me(e[n]);r&&(t+=r+" ")}else if(de(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const na="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ra=Ar(na);function ci(e){return!!e||e===""}function sa(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ct(e[r],t[r]);return n}function Ct(e,t){if(e===t)return!0;let n=ri(e),r=ri(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Ze(e),r=Ze(t),n||r)return e===t;if(n=W(e),r=W(t),n||r)return n&&r?sa(e,t):!1;if(n=de(e),r=de(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const l in e){const o=e.hasOwnProperty(l),a=t.hasOwnProperty(l);if(o&&!a||!o&&a||!Ct(e[l],t[l]))return!1}}return String(e)===String(t)}function Ir(e,t){return e.findIndex(n=>Ct(n,t))}const ui=e=>!!(e&&e.__v_isRef===!0),ee=e=>be(e)?e:e==null?"":W(e)||de(e)&&(e.toString===ii||!le(e.toString))?ui(e)?ee(e.value):JSON.stringify(e,fi,2):String(e),fi=(e,t)=>ui(t)?fi(e,t.value):Dt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],i)=>(n[Mr(r,i)+" =>"]=s,n),{})}:Ht(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Mr(n))}:Ze(t)?Mr(t):de(t)&&!W(t)&&!li(t)?String(t):t,Mr=(e,t="")=>{var n;return Ze(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Se;class ia{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Se,!t&&Se&&(this.index=(Se.scopes||(Se.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Se;try{return Se=this,t()}finally{Se=n}}}on(){Se=this}off(){Se=this.parent}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function hi(){return Se}function la(e,t=!1){Se&&Se.cleanups.push(e)}let ue;const Pr=new WeakSet;class pi{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Se&&Se.active&&Se.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Pr.has(this)&&(Pr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,wi(this),mi(this);const t=ue,n=Ve;ue=this,Ve=!0;try{return this.fn()}finally{vi(this),ue=t,Ve=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Fr(t);this.deps=this.depsTail=void 0,wi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Pr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){zr(this)&&this.run()}get dirty(){return zr(this)}}let di=0,rn,sn;function gi(e,t=!1){if(e.flags|=8,t){e.next=sn,sn=e;return}e.next=rn,rn=e}function Or(){di++}function jr(){if(--di>0)return;if(sn){let t=sn;for(sn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rn;){let t=rn;for(rn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function mi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vi(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Fr(r),oa(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function zr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ln))return;e.globalVersion=ln;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!zr(e)){e.flags&=-3;return}const n=ue,r=Ve;ue=e,Ve=!0;try{mi(e);const s=e.fn(e._value);(t.version===0||dt(s,e._value))&&(e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ue=n,Ve=r,vi(e),e.flags&=-3}}function Fr(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Fr(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function oa(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const yi=[];function St(){yi.push(Ve),Ve=!1}function $t(){const e=yi.pop();Ve=e===void 0?!0:e}function wi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ue;ue=void 0;try{t()}finally{ue=n}}}let ln=0;class aa{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class
* @vue/runtime-core v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function fn(e,t,n,r){try{return r?e(...r):e()}catch(s){Gn(s,t,n)}}function it(e,t,n,r){if(le(e)){const s=fn(e,t,n,r);return s&&si(s)&&s.catch(i=>{Gn(i,t,n)}),s}if(W(e)){const s=[];for(let i=0;i<e.length;i++)s.push(it(e[i],t,n,r));return s}}function Gn(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||ie;if(t){let o=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;o;){const u=o.ec;if(u){for(let h=0;h<u.length;h++)if(u[h](e,a,c)===!1)return}o=o.parent}if(i){St(),fn(i,null,10,[e,a,c]),$t();return}}Ma(e,n,s,r,l)}function Ma(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const $e=[];let Je=-1;const Bt=[];let gt=null,Vt=0;const Ii=Promise.resolve();let Zn=null;function Wt(e){const t=Zn||Ii;return e?t.then(this?e.bind(this):e):t}function Pa(e){let t=Je+1,n=$e.length;for(;t<n;){const r=t+n>>>1,s=$e[r],i=hn(s);i<e||i===e&&s.flags&2?t=r+1:n=r}return t}function Zr(e){if(!(e.flags&1)){const t=hn(e),n=$e[$e.length-1];!n||!(e.flags&2)&&t>=hn(n)?$e.push(e):$e.splice(Pa(t),0,e),e.flags|=1,Mi()}}function Mi(){Zn||(Zn=Ii.then(ji))}function Oa(e){W(e)?Bt.push(...e):gt&&e.id===-1?gt.splice(Vt+1,0,e):e.flags&1||(Bt.push(e),e.flags|=1),Mi()}function Pi(e,t,n=Je+1){for(;n<$e.length;n++){const r=$e[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;$e.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Oi(e){if(Bt.length){const t=[...new Set(Bt)].sort((n,r)=>hn(n)-hn(r));if(Bt.length=0,gt){gt.push(...t);return}for(gt=t,Vt=0;Vt<gt.length;Vt++){const n=gt[Vt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}gt=null,Vt=0}}const hn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ji(e){try{for(Je=0;Je<$e.length;Je++){const t=$e[Je];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Je<$e.length;Je++){const t=$e[Je];t&&(t.flags&=-2)}Je=-1,$e.length=0,Oi(),Zn=null,($e.length||Bt.length)&&ji()}}let Te=null,zi=null;function Jn(e){const t=Te;return Te=e,zi=e&&e.type.__scopeId||null,t}function ja(e,t=Te,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&nl(-1);const i=Jn(t);let l;try{l=e(...s)}finally{Jn(i),r._d&&nl(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function Yn(e,t){if(Te===null)return e;const n=ir(Te),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,l,o,a=ie]=t[s];i&&(le(i)&&(i={mounted:i,updated:i}),i.deep&&st(l),r.push({dir:i,instance:n,value:l,oldValue:void 0,arg:o,modifiers:a}))}return e}function Tt(e,t,n,r){const s=e.dirs,i=t&&t.dirs;for(let l=0;l<s.length;l++){const o=s[l];i&&(o.oldValue=i[l].value);let a=o.dir[r];a&&(St(),it(a,n,8,[e.el,o,e,t]),$t())}}const za=Symbol("_vte"),Fa=e=>e.__isTeleport;function Jr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Jr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function pn(e,t){return le(e)?je({name:e.name},t,{setup:e}):e}function Da(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function mt(e){const t=il(),n=Ei(null);if(t){const s=t.refs===ie?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Xn(e,t,n,r,s=!1){if(W(e)){e.forEach((x,b)=>Xn(x,t&&(W(t)?t[b]:t),n,r,s));return}if(dn(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Xn(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?ir(r.component):r.el,l=s?null:i,{i:o,r:a}=e,c=t&&t.r,u=o.refs===ie?o.refs={}:o.refs,h=o.setupState,p=ne(h),g=h===ie?()=>!1:x=>te(p,x);if(c!=null&&c!==a&&(be(c)?(u[c]=null,g(c)&&(h[c]=null)):we(c)&&(c.value=null)),le(a))fn(a,o,12,[l,u]);else{const x=be(a),b=we(a);if(x||b){const S=()=>{if(e.f){const y=x?g(a)?h[a]:u[a]:a.value;s?W(y)&&ni(y,i):W(y)?y.includes(i)||y.push(i):x?(u[a]=[i],g(a)&&(h[a]=u[a])):(a.value=[i],e.k&&(u[e.k]=a.value))}else x?(u[a]=l,g(a)&&(h[a]=l)):b&&(a.value=l,e.k&&(u[e.k]=l))};l?(S.id=-1,Pe(S,n)):S()}}}tn().requestIdleCallback,tn().cancelIdleCallback;const dn=e=>!!e.type.__asyncLoader,Ha=e=>e.type.__isKeepAlive;fu
* @vue/runtime-dom v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let cs;const fl=typeof window<"u"&&window.trustedTypes;if(fl)try{cs=fl.createPolicy("vue",{createHTML:e=>e})}catch{}const hl=cs?e=>cs.createHTML(e):e=>e,Ic="http://www.w3.org/2000/svg",Mc="http://www.w3.org/1998/Math/MathML",at=typeof document<"u"?document:null,pl=at&&at.createElement("template"),Pc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?at.createElementNS(Ic,e):t==="mathml"?at.createElementNS(Mc,e):n?at.createElement(e,{is:n}):at.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>at.createTextNode(e),createComment:e=>at.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>at.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,i){const l=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{pl.innerHTML=hl(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const o=pl.content;if(r==="svg"||r==="mathml"){const a=o.firstChild;for(;a.firstChild;)o.appendChild(a.firstChild);o.removeChild(a)}t.insertBefore(o,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Oc=Symbol("_vtc");function jc(e,t,n){const r=e[Oc];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const lr=Symbol("_vod"),dl=Symbol("_vsh"),gl={beforeMount(e,{value:t},{transition:n}){e[lr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):kn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),kn(e,!0),r.enter(e)):r.leave(e,()=>{kn(e,!1)}):kn(e,t))},beforeUnmount(e,{value:t}){kn(e,t)}};function kn(e,t){e.style.display=t?e[lr]:"none",e[dl]=!t}const zc=Symbol(""),Fc=/(^|;)\s*display\s*:/;function Dc(e,t,n){const r=e.style,s=be(n);let i=!1;if(n&&!s){if(t)if(be(t))for(const l of t.split(";")){const o=l.slice(0,l.indexOf(":")).trim();n[o]==null&&or(r,o,"")}else for(const l in t)n[l]==null&&or(r,l,"");for(const l in n)l==="display"&&(i=!0),or(r,l,n[l])}else if(s){if(t!==n){const l=r[zc];l&&(n+=";"+l),r.cssText=n,i=Fc.test(n)}}else t&&e.removeAttribute("style");lr in e&&(e[lr]=i?r.display:"",e[dl]&&(r.display="none"))}const ml=/\s*!important$/;function or(e,t,n){if(W(n))n.forEach(r=>or(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Hc(e,t);ml.test(n)?e.setProperty(_t(r),n.replace(ml,""),"important"):e[r]=n}}const vl=["Webkit","Moz","ms"],us={};function Hc(e,t){const n=us[t];if(n)return n;let r=ze(t);if(r!=="filter"&&r in e)return us[t]=r;r=Hn(r);for(let s=0;s<vl.length;s++){const i=vl[s]+r;if(i in e)return us[t]=i}return t}const bl="http://www.w3.org/1999/xlink";function yl(e,t,n,r,s,i=ra(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(bl,t.slice(6,t.length)):e.setAttributeNS(bl,t,n):n==null||i&&!ci(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Ze(n)?String(n):n)}function wl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?hl(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const o=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(o!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){const o=typeof e[t];o==="boolean"?n=ci(n):n==null&&o==="string"?(n="",l=!0):o==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(s||t)}function ct(e,t,n,r){e.addEventListener(t,n,r)}function Uc(e,t,n,r){e.removeEventListener(t,n,r)}const kl=Symbol("_vei");function Nc(e,t,n,r,s=null){const i=e[kl]||(e[kl]={}),l=i[t];if(r&&l)l.value=r;else{const[o,a]=Bc(t);if(r){const c=i[t]=qc(r,s);ct(e,o,c,a)}else l&&(Uc(e,o,l,a),i[t]=void 0)}}const xl=/(?:Once|Passive|Capture)$/;function Bc(e){let t;if(xl
]`).replace("lheading",Dl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bl=/^( {2,}|\\)\n(?!\s*$)/,Bu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,mr=/[\p{P}\p{S}]/u,ws=/[\s\p{P}\p{S}]/u,Vl=/[^\s\p{P}\p{S}]/u,Vu=ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ws).getRegex(),Wu=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,qu=ae(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,mr).getRegex(),Ku=ae("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Vl).replace(/punctSpace/g,ws).replace(/punct/g,mr).getRegex(),Gu=ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Vl).replace(/punctSpace/g,ws).replace(/punct/g,mr).getRegex(),Zu=ae(/\\(punct)/,"gu").replace(/punct/g,mr).getRegex(),Ju=ae(/^<(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(),Yu=ae(bs).replace("(?:-->|$)","-->").getRegex(),Xu=ae("^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",Yu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Qu=ae(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",vr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Wl=ae(/^!?\[(label)\]\[(ref)\]/).replace("label",vr).replace("ref",vs).getRegex(),ql=ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",vs).getRegex(),ef=ae("reflink|nolink(?!\\()","g").replace("reflink",Wl).replace("nolink",ql).getRegex(),ks={_backpedal:_n,anyPunctuation:Zu,autolink:Ju,blockSkip:Wu,br:Bl,code:Nu,del:_n,emStrongLDelim:qu,emStrongRDelimAst:Ku,emStrongRDelimUnd:Gu,escape:Nl,link:Qu,nolink:ql,punctuation:Vu,reflink:Wl,reflinkSearch:ef,tag:Xu,text:Bu,url:_n},tf={...ks,link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",vr).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vr).getRegex()},xs={...ks,escape:ae(Nl).replace("])","~|])").getRegex(),url:ae(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},nf={...xs,br:ae(Bl).replace("{2,}","*").getRegex(),text:ae(xs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},br={normal:ys,gfm:Hu,pedantic:Uu},Sn={normal:ks,gfm:xs,breaks:nf,pedantic:tf},rf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Kl=e=>rf[e];function Qe(e,t){if(t){if(Ae.escapeTest.test(e))return e.replace(Ae.escapeReplace,Kl)}else if(Ae.escapeTestNoEncode.test(e))return e.replace(Ae.escapeReplaceNoEncode,Kl);return e}function Gl(e){try{e=encodeURI(e).replace(Ae.percentDecode,"%")}catch{return n
`).map(i=>{const l=i.match(n.other.beginningSpace);if(l===null)return i;const[o]=l;return o.length>=s.length?i.slice(s.length):i}).join(`
`)}class yr{options;rules;lexer;constructor(t){this.options=t||Mt}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:$n(r,`
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],s=lf(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:s}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){const s=$n(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:$n(n[0],`
`)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=$n(n[0],`
`).split(`
`),s="",i="";const l=[];for(;r.length>0;){let o=!1;const a=[];let c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),o=!0;else if(!o)a.push(r[c]);else break;r=r.slice(c);const u=a.join(`
`),h=u.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
${u}`:u,i=i?`${i}
${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,r.length===0)break;const g=l.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const x=g,b=x.raw+`
`+r.join(`
`),S=this.blockquote(b);l[l.length-1]=S,s=s.substring(0,s.length-x.raw.length)+S.raw,i=i.substring(0,i.length-x.text.length)+S.text;break}else if((g==null?void 0:g.type)==="list"){const x=g,b=x.raw+`
`+r.join(`
`),S=this.list(b);l[l.length-1]=S,s=s.substring(0,s.length-g.raw.length)+S.raw,i=i.substring(0,i.length-x.raw.length)+S.raw,r=b.substring(l.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const s=r.length>1,i={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");const l=this.rules.other.listItemRegex(r);let o=!1;for(;t;){let c=!1,u="",h="";if(!(n=l.exec(t))||this.rules.block.hr.test(t))break;u=n[0],t=t.substring(u.length);let p=n[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),g=t.split(`
`,1)[0],x=!p.trim(),b=0;if(this.options.pedantic?(b=2,h=p.trimStart()):x?b=n[1].length+1:(b=n[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,h=p.slice(b),b+=n[1].length),x&&this.rules.other.blankLine.test(g)&&(u+=g+`
`,t=t.substring(g.length+1),c=!0),!c){const _=this.rules.other.nextBulletRegex(b),H=this.rules.other.hrRegex(b),T=this.rules.other.fencesBeginRegex(b),O=this.rules.other.headingBeginRegex(b),K=this.rules.other.htmlBeginRegex(b);for(;t;){const z=t.split(`
`,1)[0];let J;if(g=z,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),J=g):J=g.replace(this.rules.other.tabCharGlobal," "),T.test(g)||O.test(g)||K.test(g)||_.test(g)||H.test(g))break;if(J.search(this.rules.other.nonSpaceChar)>=b||!g.trim())h+=`
`+J.slice(b);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(p)||O.test(p)||H.test(p))break;h+=`
`+g}!x&&!g.trim()&&(x=!0),u+=z+`
`,t=t.substring(z.length+1),p=J.slice(b)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0));let S=null,y;this.options.gfm&&(S=this.rules.other.listIsTask.exec(h),S&&(y=S[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!S,checked:y,loose:!1,text:h,tokens:[]}),i.raw+=u}const a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const u=i.items[c].tokens.filter(p=>p.type==="space"),h=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=h}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:s,title:i}}}table(t){var o;const n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;const r=Zl(n[1]),s=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=n[3])!=null&&o.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],l={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===s.length){for(const a of s)this.rules.other.tableAlignRight.test(a)?l.align.push("right"):this.rules.other.tableAlignCenter.test(a)?l.align.push("center"):this.rules.other.tableAlignLeft.test(a)?l.align.push("left"):l.align.push(null);for(let a=0;a<r.length;a++)l.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:l.align[a]});for(const a of i)l.rows.push(Zl(a,l.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:l.align[u]})));return l}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const l=$n(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=sf(n[2],"()");if(l>-1){const a=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let s=n[2],i="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],i=l[3])}else i=n[3]?n[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),Jl(n,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=n[s.toLowerCase()];if(!i){const l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return Jl(r,i,r[0],this.lexer,this.rules)}}emStrong(t,n,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const l=[...s[0]].length-1;let o,a,c=l,u=0;const h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*t.length+l);(s=h.exec(n))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(a=[...o].length,s[3]||s[4]){c+=a;continue}else if((s[5]||s[6])&&l%3&&!((l+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);const p=[...s[0]][0].length,g=t.slice(0,l+s.index+p+a);if(Math.min(l,a)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,s;return n[2]==="@"?(r=n[1],s="mailto:"+r):(r=n[1],s=r),{type:"link",raw:n[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let n;if(n=this.rules.inline.url.exec(t)){let s,i;if(n[2]==="@")s=n[0],i="mailto:"+s;else{let l;do l=n[0],n[0]=((r=this.rules.inline._backpedal.exec(n[0]))==null?void 0:r[0])??"";while(l!==n[0]);s=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){const r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}}class
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,i,l;for(this.options.pedantic&&(t=t.replace(Ae.tabCharGlobal," ").replace(Ae.spaceLine,""));t;){let o;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(c=>(o=c.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);const c=n.at(-1);o.raw.length===1&&c!==void 0?c.raw+=`
`:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
`+o.raw,c.text+=`
`+o.text,this.inlineQueue.at(-1).src=c.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
`+o.raw,c.text+=`
`+o.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}let a=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0;const u=t.slice(1);let h;this.options.extensions.startBlock.forEach(p=>{h=p.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(a=t.substring(0,c+1))}if(this.state.top&&(o=this.tokenizer.paragraph(a))){const c=n.at(-1);r&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
`+o.raw,c.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(o),r=a.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
`+o.raw,c.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(o);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var o,a,c;let r=t,s=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,l="";for(;t;){i||(l=""),i=!1;let u;if((a=(o=this.options.extensions)==null?void 0:o.inline)!=null&&a.some(p=>(u=p.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const p=n.at(-1);u.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=u.raw,p.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,l)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let h=t;if((c=this.options.extensions)!=null&&c.startInline){let p=1/0;const g=t.slice(1);let x;this.options.extensions.startInline.forEach(b=>{x=b.call({lexer:this},g),typeof x=="number"&&x>=0&&(p=Math.min(p,x))}),p<1/0&&p>=0&&(h=t.substring(0,p+1))}if(u=this.tokenizer.inlineText(h)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(l=u.raw.slice(-1)),i=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=u.raw,p.text+=u.text):n.push(u);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}}class wr{options;parser;constructor(t){this.options=t||Mt}space(t){return""}code({text:t,lang:n,escaped:r}){var l;const s=(l=(n||"").match(Ae.notSpaceStart))==null?void 0:l[0],i=t.replace(Ae.endingNewline,"")+`
`;return s?'<pre><code class="language-'+Qe(s)+'">'+(r?i:Qe(i,!0))+`</code></pre>
`:"<pre><code>"+(r?i:Qe(i,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
`}hr(t){return`<hr>
`}list(t){const n=t.ordered,r=t.start;let s="";for(let o=0;o<t.items.length;o++){const a=t.items[o];s+=this.listitem(a)}const i=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+i+l+`>
`+s+"</"+i+`>
`}listitem(t){var r;let n="";if(t.task){const s=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=s+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=s+" "+Qe(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):n+=s+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let n="",r="";for(let i=0;i<t.header.length;i++)r+=this.tablecell(t.header[i]);n+=this.tablerow({text:r});let s="";for(let i=0;i<t.rows.length;i++){const l=t.rows[i];r="";for(let o=0;o<l.length;o++)r+=this.tablecell(l[o]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
<thead>
`+n+`</thead>
`+s+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){const n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Qe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){const s=this.parser.parseInline(r),i=Gl(t);if(i===null)return s;t=i;let l='<a href="'+t+'"';return n&&(l+=' title="'+Qe(n)+'"'),l+=">"+s+"</a>",l}image({href:t,title:n,text:r}){const s=Gl(t);if(s===null)return Qe(r);t=s;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${Qe(n)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Qe(t.text)}}class _s{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}}class qe{options;renderer;textRenderer;constructor(t){this.options=t||Mt,this.options.renderer=this.options.renderer||new wr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _s}static parse(t,n){return new qe(n).parse(t)}static parseInline(t,n){return new qe(n).parseInline(t)}parse(t,n=!0){var s,i;let r="";for(let l=0;l<t.length;l++){const o=t[l];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[o.type]){const c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){r+=u||"";continue}}const a=o;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let c=a,u=this.renderer.text(c);for(;l+1<t.length&&t[l+1].type==="text";)c=t[++l],u+=`
`+this.renderer.text(c);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,n=this.renderer){var s,i;let r="";for(let l=0;l<t.length;l++){const o=t[l];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[o.type]){const c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=c||"";continue}}const a=o;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}}class Rn{options;block;constructor(t){this.options=t||Mt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?We.lex:We.lexInline}provideParser(){return this.block?qe.parse:qe.parseInline}}As(Rn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Yl{defaults=gs();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=qe;Renderer=wr;TextRenderer=_s;Lexer=We;Tokenizer=yr;Hooks=Rn;constructor(...t){this.use(...t)}walkTokens(t,n){var s,i;let r=[];for(const l of t)switch(r=r.concat(n.call(this,l)),l.type){case"table":{const o=l;for(const a of o.header)r=r.concat(this.walkTokens(a.tokens,n));for(const a of o.rows)for(const c of a)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const o=l;r=r.concat(this.walkTokens(o.items,n));break}default:{const o=l;(i=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const c=o[a].flat(1/0);r=r.concat(this.walkTokens(c,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const l=n.renderers[i.name];l?n.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=n[i.level];l?l.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),s.extensions=n),r.renderer){const i=this.defaults.renderer||new wr(this.defaults);for(const l in r.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const o=l,a=r.renderer[o],c=i[o];i[o]=(...u)=>{let h=a.apply(i,u);return h===!1&&(h=c.apply(i,u)),h||""}}s.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new yr(this.defaults);for(const l in r.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const o=l,a=r.tokenizer[o],c=i[o];i[o]=(...u)=>{let h=a.apply(i,u);return h===!1&&(h=c.apply(i,u)),h}}s.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new Rn;for(const l in r.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const o=l,a=r.hooks[o],c=i[o];Rn.passThroughHooks.has(l)?i[o]=u=>{if(this.default
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+Qe(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}}const Pt=new Yl;function pe(e,t){return Pt.parse(e,t)}pe.options=pe.setOptions=function(e){return Pt.setOptions(e),pe.defaults=Pt.defaults,zl(pe.defaults),pe},pe.getDefaults=gs,pe.defaults=Mt,pe.use=function(...e){return Pt.use(...e),pe.defaults=Pt.defaults,zl(pe.defaults),pe},pe.walkTokens=function(e,t){return Pt.walkTokens(e,t)},pe.parseInline=Pt.parseInline,pe.Parser=qe,pe.parser=qe.parse,pe.Renderer=wr,pe.TextRenderer=_s,pe.Lexer=We,pe.lexer=We.lex,pe.Tokenizer=yr,pe.Hooks=Rn,pe.parse=pe;function of(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const n=Xl(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Ql(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Ql(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=Xl(n),i=s?e.langPrefix+ro(s):e.emptyLangClass,l=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${l}>${r?t:ro(t,!0)}
</code></pre>`}}}}function Xl(e){return(e||"").match(/\S*/)[0]}function Ql(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const eo=/[&<>"']/,af=new RegExp(eo.source,"g"),to=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cf=new RegExp(to.source,"g"),uf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},no=e=>uf[e];function ro(e,t){if(t){if(eo.test(e))return e.replace(af,no)}else if(to.test(e))return e.replace(cf,no);return e}const ff=/\$.*?\$/,hf=/^\$(.*?)\$/,pf=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,df=e=>[{name:"blockMath",level:"block",tokenizer(t){const n=pf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!0,n[1])}}},{name:"inlineMath",level:"inline",start(t){const n=t.search(ff);return n!==-1?n:t.length},tokenizer(t){const n=hf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!1,n[1])}}}],so=(e="",t={})=>e.replace(/:(.+?):/g,(n,r)=>t[r]?`<img class="wl-emoji" src="${t[r]}" alt="${r}">`:n),gf=(e,{emojiMap:t,highlighter:n,texRenderer:r})=>{const s=new Yl;if(s.setOptions({breaks:!0}),n&&s.use(of({highlight:n})),r){const i=df(r);s.use({extensions:i})}return s.parse(so(e,t))},Cs=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},mf=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),vf=e=>e.match(/[\u4E00-\u9FD5]/gu),bf=e=>{var t,n;return(((t=mf(e))==null?void 0:t.reduce((r,s)=>r+(["",",","."].includes(s.trim())?0:s.trim().split(/\s+/u).length),0))??0)+(((n=vf(e))==null?void 0:n.length)??0)},yf=async()=>{const{userAgentData:e}=navigator;let t=navigator.userAgent;if(!e||e.platform!=="Windows")return t;const{platformVersion:n}=await e.getHighEntropyValues(["platformVersion"]);return n&&parseInt(n.split(".")[0])>=13&&(t=t.replace("Windows NT 10.0","Windows NT 11.0")),t},io=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:r=navigator.language})=>{const s=new AbortController,i=document.querySelectorAll(n);return i.length&&Ms({serverURL:zn(e),paths:Array.from(i).map(l=>Qs(Cs(l)??t)),lang:r,signal:s.signal}).then(l=>{i.forEach((o,a)=>{o.innerText=l[a].toString()})}).catch(Ol),s.abort.bind(s)},lo=({size:e})=>re("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[re("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),re("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),wf=()=>re("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},re("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),kf=()=>re("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},re("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-14
![${j.name}](${V})`)}).catch(V=>{alert(V.message),i.value=i.value.replace(R,"")}).then(()=>{M.value=!1})},Jt=j=>{var R;if((R=j.dataTransfer)!=null&&R.items){const V=jl(j.dataTransfer.items);V&&ye.value&&(pt(V),j.preventDefault())}},Ln=j=>{if(j.clipboardData){const R=jl(j.clipboardData.items);R&&ye.value&&pt(R)}},Ot=()=>{const j=u.value;j.files&&ye.value&&pt(j.files[0]).then(()=>{j.value=""})},Ne=async()=>{var j;const{serverURL:R,lang:V,login:he,wordLimit:f,requiredMeta:d,recaptchaV3Key:m,turnstileKey:w}=s.value,v={comment:Z.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:s.value.path,ua:await yf()};if(!n.edit)if(o.value.token)v.nick=o.value.display_name,v.mail=o.value.email,v.link=o.value.url;else{if(he==="force")return;if(d.includes("nick")&&!v.nick){a.value.nick.focus(),alert(B.value.nickError);return}if(d.includes("mail")&&!v.mail||v.mail&&!qo(v.mail)){a.value.mail.focus(),alert(B.value.mailError);return}v.nick||(v.nick=B.value.anonymous)}if(!v.comment){c.value.focus();return}if(!Ee.value){alert(B.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",K.value.toString()));return}v.comment=so(v.comment,S.value.map),n.replyId&&n.rootId&&(v.pid=n.replyId,v.rid=n.rootId,v.at=n.replyUser),M.value=!0;try{m&&(v.recaptchaV3=await Ff(m).execute("social")),w&&(v.turnstile=await Df(w).execute("social"));const k={serverURL:R,lang:V,token:o.value.token,comment:v},E=await(n.edit?Xt({objectId:n.edit.objectId,...k}):Ls(k));if(M.value=!1,E.errmsg){alert(E.errmsg);return}r("submit",E.data),i.value="",O.value="",await Wt(),n.replyId&&r("cancelReply"),(j=n.edit)!=null&&j.objectId&&r("cancelEdit")}catch(k){M.value=!1,alert(k.message)}},In=j=>{j.preventDefault();const{lang:R,serverURL:V}=s.value;Ps({serverURL:V,lang:R}).then(he=>{o.value=he,(he.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(he)),r("log")})},xr=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},Mn=j=>{j.preventDefault();const{lang:R,serverURL:V}=s.value,he=800,f=800,d=(window.innerWidth-he)/2,m=(window.innerHeight-f)/2,w=new URLSearchParams({lng:R,token:o.value.token}),v=window.open(`${V}/ui/profile?${w.toString()}`,"_blank",`width=${he},height=${f},left=${d},top=${m},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);v==null||v.postMessage({type:"TOKEN",data:o.value.token},"*")},yt=j=>{var R,V,he,f;!((R=h.value)!=null&&R.contains(j.target))&&!((V=p.value)!=null&&V.contains(j.target))&&(_.value=!1),!((he=g.value)!=null&&he.contains(j.target))&&!((f=x.value)!=null&&f.contains(j.target))&&(H.value=!1)},wt=async j=>{var R;const{scrollTop:V,clientHeight:he,scrollHeight:f}=j.target,d=(he+V)/f,m=s.value.search,w=((R=b.value)==null?void 0:R.value)??"";d<.9||z.loading||G.value||(z.loading=!0,(m.more&&z.list.length?await m.more(w,z.list.length):await m.search(w)).length?z.list=[...z.list,...m.more&&z.list.length?await m.more(w,z.list.length):await m.search(w)]:G.value=!0,z.loading=!1,setTimeout(()=>{j.target.scrollTop=V},50))},jt=fu(j=>{z.list=[],G.value=!1,wt(j)},300);return He([s,K],([j,R])=>{const{wordLimit:V}=j;V?R<V[0]&&V[0]!==0?(J.value=V[0],Ee.value=!1):R>V[1]?(J.value=V[1],Ee.value=!1):(J.value=V[1],Ee.value=!0):(J.value=0,Ee.value=!0)},{immediate:!0}),hr("click",yt),hr("message",({data:j})=>{!j||j.type!=="profile"||(o.value={...o.value,...j.data},[localStorage,sessionStorage].filter(R=>R.getItem("WALINE_USER")).forEach(R=>{R.setItem("WALINE_USER",JSON.stringify(o))}))}),He(H,async j=>{var R;if(!j)return;const V=s.value.search;b.value&&(b.value.value=""),z.loading=!0,z.list=await(((R=V.default)==null?void 0:R.call(V))??V.search("")),z.loading=!1}),gn(()=>{var j;(j=n.edit)!=null&&j.objectId&&(i.value=n.edit.orig),He(()=>i.value,R=>{const{highlighter:V,texRenderer:he}=s.value;Z.value=R,O.value=gf(R,{emojiMap:S.value.map,highlighter:V,texRenderer:he}),K.value=bf(R),R?vo(c.value):vo.destroy(c.value)},{immediate:!0}),He(()=>s.value.emoji,R=>Eu(R).then(V=>{S.value=V}),{immediate:!0})}),(j,R)=>{var V,he;return L(),P("div"
//# sourceMappingURL=waline.js.map