From a4fa882ece3664244f0639f78d36acc3cd2a2d96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Jan 2025 00:31:01 +0000 Subject: [PATCH] chore(deps): bump @waline/client from 3.5.0 to 3.5.1 (#1429) --- assets/lib/waline/waline.js | 6 +++--- dependencies.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/lib/waline/waline.js b/assets/lib/waline/waline.js index 98989920d..0a703ad47 100644 --- a/assets/lib/waline/waline.js +++ b/assets/lib/waline/waline.js @@ -1,6 +1,6 @@ /** * Skipped minification because the original files appears to be already minified. - * Original file: /npm/@waline/client@3.5.0/dist/waline.umd.js + * Original file: /npm/@waline/client@3.5.1/dist/waline.umd.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ @@ -13,7 +13,7 @@ var Id=Object.defineProperty;var Md=(re,Ae,Ee)=>Ae in re?Id(re,Ae,{enumerable:!0 Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),Vi=qe(["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 có độ dài giữa $0 và $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?"]),Wi=qe(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间! 当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),Fo=qe(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間! -目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const qi="en-US",On={zh:Wi,"zh-cn":Wi,"zh-tw":Fo,en:Di,"en-us":Di,fr:Ui,"fr-fr":Ui,jp:Ni,"jp-jp":Ni,"pt-br":zo,ru:Bi,"ru-ru":Bi,vi:Vi,"vi-vn":Vi,de:jo,es:Hi,"es-mx":Hi},Ki=e=>On[e.toLowerCase()]||On[qi.toLowerCase()],Gi=e=>Object.keys(On).includes(e.toLowerCase())?e:qi,Zi={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},Do=Object.keys(Zi),jn=Symbol("waline-config"),Ji=e=>{try{e=decodeURI(e)}catch{}return e},Yi=(e="")=>e.replace(/\/$/u,""),Qi=e=>/^(https?:)?\/\//.test(e),zn=e=>{const t=Yi(e);return Qi(t)?t:`https://${t}`},Ho=e=>Array.isArray(e)?e:e?[0,e]:!1,jt=(e,t)=>e==="built-in"||!e?t:e==="disabled"?null:e,Uo=({serverURL:e,path:t=location.pathname,lang:n=typeof navigator>"u"?"en-US":navigator.language,locale:r,emoji:i=zi,meta:s=["nick","mail","link"],requiredMeta:l=[],dark:o=!1,pageSize:a=10,wordLimit:c,imageUploader:u,highlighter:f,texRenderer:p,noCopyright:g=!1,login:x="enable",search:b,reaction:T,recaptchaV3Key:k="",turnstileKey:_="",commentSorting:N="latest",...L})=>({serverURL:zn(e),path:Ji(t),lang:Gi(n),locale:{...Ki(Gi(n)),...typeof r=="object"?r:{}},wordLimit:Ho(c),meta:ji(s),requiredMeta:ji(l),imageUploader:jt(u,$o),highlighter:jt(f,Po),texRenderer:jt(p,Ro),emoji:jt(i,zi),search:jt(b,Ao(n)),dark:o,pageSize:a,login:x,noCopyright:g,recaptchaV3Key:k,turnstileKey:_,reaction:jt(T,So),commentSorting:N,...L}),zt=e=>typeof e=="string",Rr="{--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${Rr}}`:`${e}${Rr}`:e===!0?`:root${Rr}`:"",Ar=(e,t)=>{let n=e.toString();for(;n.length{const t=Ar(e.getDate(),2),n=Ar(e.getMonth()+1,2);return`${Ar(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,i=t.getTime()-r.getTime(),s=Math.floor(i/(24*3600*1e3));if(s===0){const l=i%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 s<0?n.now:s<8?`${s} ${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);/** +目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const qi="en-US",On={zh:Wi,"zh-cn":Wi,"zh-tw":Fo,en:Di,"en-us":Di,fr:Ui,"fr-fr":Ui,jp:Ni,"jp-jp":Ni,"pt-br":zo,ru:Bi,"ru-ru":Bi,vi:Vi,"vi-vn":Vi,de:jo,es:Hi,"es-mx":Hi},Ki=e=>On[e.toLowerCase()]||On[qi.toLowerCase()],Gi=e=>Object.keys(On).includes(e.toLowerCase())?e:qi,Zi={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},Do=Object.keys(Zi),jn=Symbol("waline-config"),Ji=e=>{try{e=decodeURI(e)}catch{}return e},Yi=(e="")=>e.replace(/\/$/u,""),Qi=e=>/^(https?:)?\/\//.test(e),zn=e=>{const t=Yi(e);return Qi(t)?t:`https://${t}`},Ho=e=>Array.isArray(e)?e:e?[0,e]:!1,jt=(e,t)=>e==null||e===!0?t:e===!1?null:e,Uo=({serverURL:e,path:t=location.pathname,lang:n=typeof navigator>"u"?"en-US":navigator.language,locale:r,meta:i=["nick","mail","link"],requiredMeta:s=[],dark:l=!1,pageSize:o=10,wordLimit:a,noCopyright:c=!1,login:u="enable",recaptchaV3Key:f="",turnstileKey:p="",commentSorting:g="latest",emoji:x=zi,imageUploader:b,highlighter:T,texRenderer:k,search:_,reaction:N,...L})=>({serverURL:zn(e),path:Ji(t),lang:Gi(n),locale:{...Ki(Gi(n)),...typeof r=="object"?r:{}},wordLimit:Ho(a),meta:ji(i),requiredMeta:ji(s),dark:l,pageSize:o,commentSorting:g,login:u,noCopyright:c,recaptchaV3Key:f,turnstileKey:p,...L,reaction:jt(N,So),imageUploader:jt(b,$o),highlighter:jt(T,Po),texRenderer:jt(k,Ro),emoji:jt(x,zi),search:jt(_,Ao(n))}),zt=e=>typeof e=="string",Rr="{--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${Rr}}`:`${e}${Rr}`:e===!0?`:root${Rr}`:"",Ar=(e,t)=>{let n=e.toString();for(;n.length{const t=Ar(e.getDate(),2),n=Ar(e.getMonth()+1,2);return`${Ar(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,i=t.getTime()-r.getTime(),s=Math.floor(i/(24*3600*1e3));if(s===0){const l=i%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 s<0?n.now:s<8?`${s} ${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 @@ -86,5 +86,5 @@ ${t} `+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 i,s;let r="";for(let l=0;l{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 i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const l=n.renderers[s.name];l?n.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=n[s.level];l?l.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){const s=this.defaults.renderer||new wr(this.defaults);for(const l in r.renderer){if(!(l in s))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const o=l,a=r.renderer[o],c=s[o];s[o]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new yr(this.defaults);for(const l in r.tokenizer){if(!(l in s))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const o=l,a=r.tokenizer[o],c=s[o];s[o]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new An;for(const l in r.hooks){if(!(l in s))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const o=l,a=r.hooks[o],c=s[o];An.passThroughHooks.has(l)?s[o]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(p=>c.call(s,p));const f=a.call(s,u);return c.call(s,f)}:s[o]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f}}i.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,l=r.walkTokens;i.walkTokens=function(o){let a=[];return a.push(l.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Be.lex(t,n??this.defaults)}parser(t,n){return Ve.parse(t,n??this.defaults)}parseMarkdown(t){return(r,i)=>{const s={...i},l={...this.defaults,...s},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=t);const a=l.hooks?l.hooks.provideLexer():t?Be.lex:Be.lexInline,c=l.hooks?l.hooks.provideParser():t?Ve.parse:Ve.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(r):r).then(u=>a(u,l)).then(u=>l.hooks?l.hooks.processAllTokens(u):u).then(u=>l.walkTokens?Promise.all(this.walkTokens(u,l.walkTokens)).then(()=>u):u).then(u=>c(u,l)).then(u=>l.hooks?l.hooks.postprocess(u):u).catch(o);try{l.hooks&&(r=l.hooks.preprocess(r));let u=a(r,l);l.hooks&&(u=l.hooks.processAllTokens(u)),l.walkTokens&&this.walkTokens(u,l.walkTokens);let f=c(u,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(u){return o(u)}}}onError(t,n){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,t){const i="

An error occurred:

"+Ye(r.message+"",!0)+"
";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}}const It=new Xl;function he(e,t){return It.parse(e,t)}he.options=he.setOptions=function(e){return It.setOptions(e),he.defaults=It.defaults,zl(he.defaults),he},he.getDefaults=gi,he.defaults=Lt,he.use=function(...e){return It.use(...e),he.defaults=It.defaults,zl(he.defaults),he},he.walkTokens=function(e,t){return It.walkTokens(e,t)},he.parseInline=It.parseInline,he.Parser=Ve,he.parser=Ve.parse,he.Renderer=wr,he.TextRenderer=_i,he.Lexer=Be,he.lexer=Be.lex,he.Tokenizer=yr,he.Hooks=An,he.parse=he;function hf(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=eo(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(to(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.");to(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const i=eo(n),s=i?e.langPrefix+so(i):e.emptyLangClass,l=s?` class="${s}"`:"";return t=t.replace(/\n$/,""),`
${r?t:so(t,!0)}
 
`}}}}function eo(e){return(e||"").match(/\S*/)[0]}function to(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const no=/[&<>"']/,df=new RegExp(no.source,"g"),ro=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,pf=new RegExp(ro.source,"g"),gf={"&":"&","<":"<",">":">",'"':""","'":"'"},io=e=>gf[e];function so(e,t){if(t){if(no.test(e))return e.replace(df,io)}else if(ro.test(e))return e.replace(pf,io);return e}const mf=/\$.*?\$/,vf=/^\$(.*?)\$/,bf=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,yf=e=>[{name:"blockMath",level:"block",tokenizer(t){const n=bf.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(mf);return n!==-1?n:t.length},tokenizer(t){const n=vf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!1,n[1])}}}],lo=(e="",t={})=>e.replace(/:(.+?):/g,(n,r)=>t[r]?`${r}`:n),wf=(e,{emojiMap:t,highlighter:n,texRenderer:r})=>{const i=new Xl;if(i.setOptions({breaks:!0}),n&&i.use(hf({highlight:n})),r){const s=yf(r);i.use({extensions:s})}return i.parse(lo(e,t))},Ci=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},kf=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),xf=e=>e.match(/[\u4E00-\u9FD5]/gu),_f=e=>{var t,n;return(((t=kf(e))==null?void 0:t.reduce((r,i)=>r+(["",",","."].includes(i.trim())?0:i.trim().split(/\s+/u).length),0))??0)+(((n=xf(e))==null?void 0:n.length)??0)},Cf=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},oo=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-comment-count",lang:r=navigator.language})=>{const i=new AbortController,s=document.querySelectorAll(n);return s.length&&Ti({serverURL:zn(e),paths:Array.from(s).map(l=>Ji(Ci(l)??t)),lang:r,signal:i.signal}).then(l=>{s.forEach((o,a)=>{o.innerText=l[a].toString()})}).catch(Ol),i.abort.bind(i)},ao=({size:e})=>ne("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[ne("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"}),ne("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"})]),Sf=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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"})),$f=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("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-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Rf=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),ne("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Af=({active:e=!1})=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),Ef=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[ne("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),ne("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Tf=()=>ne("svg",{width:"16",height:"16",ariaHidden:"true"},ne("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Lf=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),If=()=>ne("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},ne("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Mf=()=>ne("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},ne("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),En=({size:e=100})=>ne("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},ne("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},ne("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Pf=()=>ne("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[ne("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),ne("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Of=()=>Zt("WALINE_USER_META",{nick:"",mail:"",link:""}),jf=()=>Zt("WALINE_COMMENT_BOX_EDITOR",""),zf="WALINE_LIKE",Ff=Zt(zf,[]),co=()=>Ff,Df="WALINE_REACTION",Hf=Zt(Df,{}),Uf=()=>Hf;var Si={},vt={},Mt={},uo;function fo(){if(uo)return Mt;uo=1;var e=Mt.__awaiter||function(r,i,s,l){function o(a){return a instanceof s?a:new s(function(c){c(a)})}return new(s||(s=Promise))(function(a,c){function u(g){try{p(l.next(g))}catch(x){c(x)}}function f(g){try{p(l.throw(g))}catch(x){c(x)}}function p(g){g.done?a(g.value):o(g.value).then(u,f)}p((l=l.apply(r,i||[])).next())})},t=Mt.__generator||function(r,i){var s={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},l,o,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(g){return f([p,g])}}function f(p){if(l)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(s=0)),s;)try{if(l=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,o=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]"u")return Promise.reject(new Error("This is a library for the browser!"));if(i.getLoadingState()===n.LOADED)return i.instance.getSiteKey()===s?Promise.resolve(i.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(i.getLoadingState()===n.LOADING)return s!==i.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise(function(a,c){i.successfulLoadingConsumers.push(function(u){return a(u)}),i.errorLoadingRunnable.push(function(u){return c(u)})});i.instanceSiteKey=s,i.setLoadingState(n.LOADING);var o=new i;return new Promise(function(a,c){o.loadScript(s,l.useRecaptchaNet||!1,l.useEnterprise||!1,l.renderParameters?l.renderParameters:{},l.customUrl).then(function(){i.setLoadingState(n.LOADED);var u=o.doExplicitRender(grecaptcha,s,l.explicitRenderParameters?l.explicitRenderParameters:{},l.useEnterprise||!1),f=new t.ReCaptchaInstance(s,u,grecaptcha);i.successfulLoadingConsumers.forEach(function(p){return p(f)}),i.successfulLoadingConsumers=[],l.autoHideBadge&&f.hideBadge(),i.instance=f,a(f)}).catch(function(u){i.errorLoadingRunnable.forEach(function(f){return f(u)}),i.errorLoadingRunnable=[],c(u)})})},i.getInstance=function(){return i.instance},i.setLoadingState=function(s){i.loadingState=s},i.getLoadingState=function(){return i.loadingState===null?n.NOT_LOADED:i.loadingState},i.prototype.loadScript=function(s,l,o,a,c){var u=this;l===void 0&&(l=!1),o===void 0&&(o=!1),a===void 0&&(a={}),c===void 0&&(c="");var f=document.createElement("script");f.setAttribute("recaptcha-v3-script",""),f.setAttribute("async",""),f.setAttribute("defer","");var p="https://www.google.com/recaptcha/api.js";l?o?p="https://recaptcha.net/recaptcha/enterprise.js":p="https://recaptcha.net/recaptcha/api.js":o&&(p="https://www.google.com/recaptcha/enterprise.js"),c&&(p=c),a.render&&(a.render=void 0);var g=this.buildQueryString(a);return f.src=p+"?render=explicit"+g,new Promise(function(x,b){f.addEventListener("load",u.waitForScriptToLoad(function(){x(f)},o),!1),f.onerror=function(T){i.setLoadingState(n.NOT_LOADED),b(T)},document.head.appendChild(f)})},i.prototype.buildQueryString=function(s){var l=Object.keys(s);return l.length<1?"":"&"+Object.keys(s).filter(function(o){return!!s[o]}).map(function(o){return o+"="+s[o]}).join("&")},i.prototype.waitForScriptToLoad=function(s,l){var o=this;return function(){window.grecaptcha===void 0?setTimeout(function(){o.waitForScriptToLoad(s,l)},i.SCRIPT_LOAD_DELAY):l?window.grecaptcha.enterprise.ready(function(){s()}):window.grecaptcha.ready(function(){s()})}},i.prototype.doExplicitRender=function(s,l,o,a){var c=e({sitekey:l},o);return o.container?a?s.enterprise.render(o.container,c):s.render(o.container,c):a?s.enterprise.render(c):s.render(c)},i.loadingState=null,i.instance=null,i.instanceSiteKey=null,i.successfulLoadingConsumers=[],i.errorLoadingRunnable=[],i.SCRIPT_LOAD_DELAY=25,i}();return vt.load=r.load,vt.getInstance=r.getInstance,vt}var po;function Bf(){return po||(po=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReCaptchaInstance=e.getInstance=e.load=void 0;var t=Nf();Object.defineProperty(e,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(e,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=fo();Object.defineProperty(e,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(Si)),Si}var Vf=Bf();const go={},Wf=e=>{const t=go[e]??(go[e]=Vf.load(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:n=>t.then(r=>r.execute(n))}},qf=e=>({execute:async t=>{const{load:n}=Cu("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await n();const r=window.turnstile;return new Promise(i=>{r==null||r.ready(()=>{r.render(".wl-captcha-container",{sitekey:e,action:t,size:"compact",callback:i})})})}}),Kf=Zt("WALINE_USER",{}),kr=()=>Kf,Gf={key:0,class:"wl-reaction"},Zf=["textContent"],Jf={class:"wl-reaction-list"},Yf=["onClick"],Qf={class:"wl-reaction-img"},Xf=["src","alt"],eh=["textContent"],th=["textContent"];var nh=dn({__name:"ArticleReaction",setup(e){const t=Uf(),n=Xn(jn),r=J(-1),i=J([]),s=me(()=>n.value.locale),l=me(()=>n.value.reaction.length>0),o=me(()=>{const{reaction:f,path:p}=n.value;return f.length?f.map((g,x)=>({icon:g,desc:s.value[`reaction${x}`],active:t.value[p]===x})):null});let a;const c=async()=>{if(!l.value)return;const{serverURL:f,lang:p,path:g,reaction:x}=n.value,b=new AbortController;a=b.abort.bind(b);const[T]=await Sr({serverURL:f,lang:p,paths:[g],type:x.map((k,_)=>`reaction${_}`),signal:b.signal});i.value=x.map((k,_)=>T[`reaction${_}`])},u=async f=>{if(r.value!==-1)return;const{serverURL:p,lang:g,path:x}=n.value,b=t.value[x];r.value=f,b!==void 0&&(await Pn({serverURL:p,lang:g,path:x,type:`reaction${b}`,action:"desc"}),i.value[b]=Math.max(i.value[b]-1,0)),b!==f&&(await Pn({serverURL:p,lang:g,path:x,type:`reaction${f}`}),i.value[f]=(i.value[f]||0)+1),b===f?delete t.value[x]:t.value[x]=f,r.value=-1};return gn(()=>{_n(()=>[n.value.serverURL,n.value.path],()=>c())}),Xr(()=>{a==null||a()}),(f,p)=>o.value?(I(),P("div",Gf,[F("div",{class:"wl-reaction-title",textContent:X(s.value.reactionTitle)},null,8,Zf),F("ul",Jf,[(I(!0),P(ue,null,De(o.value,({active:g,icon:x,desc:b},T)=>(I(),P("li",{key:T,class:ge(["wl-reaction-item",{active:g}]),onClick:k=>u(T)},[F("div",Qf,[F("img",{src:x,alt:b},null,8,Xf),r.value===T?(I(),ot(K(En),{key:0,class:"wl-reaction-loading"})):(I(),P("div",{key:1,class:"wl-reaction-votes",textContent:X(i.value[T]||0)},null,8,eh))]),F("div",{class:"wl-reaction-text",textContent:X(b)},null,8,th)],10,Yf))),128))])])):Y("v-if",!0)}}),Tn=new Map;function rh(e){var t=Tn.get(e);t&&t.destroy()}function ih(e){var t=Tn.get(e);t&&t.update()}var Ln=null;typeof window>"u"?((Ln=function(e){return e}).destroy=function(e){return e},Ln.update=function(e){return e}):((Ln=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(n){return function(r){if(r&&r.nodeName&&r.nodeName==="TEXTAREA"&&!Tn.has(r)){var i,s=null,l=window.getComputedStyle(r),o=(i=r.value,function(){c({testForHeightReduction:i===""||!r.value.startsWith(i),restoreTextAlign:null}),i=r.value}),a=(function(f){r.removeEventListener("autosize:destroy",a),r.removeEventListener("autosize:update",u),r.removeEventListener("input",o),window.removeEventListener("resize",u),Object.keys(f).forEach(function(p){return r.style[p]=f[p]}),Tn.delete(r)}).bind(r,{height:r.style.height,resize:r.style.resize,textAlign:r.style.textAlign,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",a),r.addEventListener("autosize:update",u),r.addEventListener("input",o),window.addEventListener("resize",u),r.style.overflowX="hidden",r.style.wordWrap="break-word",Tn.set(r,{destroy:a,update:u}),u()}function c(f){var p,g,x=f.restoreTextAlign,b=x===void 0?null:x,T=f.testForHeightReduction,k=T===void 0||T,_=l.overflowY;if(r.scrollHeight!==0&&(l.resize==="vertical"?r.style.resize="none":l.resize==="both"&&(r.style.resize="horizontal"),k&&(p=function(L){for(var O=[];L&&L.parentNode&&L.parentNode instanceof Element;)L.parentNode.scrollTop&&O.push([L.parentNode,L.parentNode.scrollTop]),L=L.parentNode;return function(){return O.forEach(function(G){var j=G[0],Q=G[1];j.style.scrollBehavior="auto",j.scrollTop=Q,j.style.scrollBehavior=null})}}(r),r.style.height=""),g=l.boxSizing==="content-box"?r.scrollHeight-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):r.scrollHeight+parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),l.maxHeight!=="none"&&g>parseFloat(l.maxHeight)?(l.overflowY==="hidden"&&(r.style.overflow="scroll"),g=parseFloat(l.maxHeight)):l.overflowY!=="hidden"&&(r.style.overflow="hidden"),r.style.height=g+"px",b&&(r.style.textAlign=b),p&&p(),s!==g&&(r.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),s=g),_!==l.overflow&&!b)){var N=l.textAlign;l.overflow==="hidden"&&(r.style.textAlign=N==="start"?"end":"start"),c({restoreTextAlign:N,testForHeightReduction:!0})}}function u(){c({testForHeightReduction:!0,restoreTextAlign:null})}}(n)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],rh),e},Ln.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],ih),e});var mo=Ln;const sh=["data-index"],lh=["src","title","onClick"];var oh=dn({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e){const t=e;let n=null;const r=pt("wall"),i=J({}),s=J([]),l=()=>{const f=Math.floor((r.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return f>0?f:1},o=f=>new Array(f).fill(null).map(()=>[]),a=async f=>{var p;if(f>=t.items.length)return;await Wt();const g=Array.from(((p=r.value)==null?void 0:p.children)??[]).reduce((x,b)=>b.getBoundingClientRect().height{if(s.value.length===l()&&!f)return;s.value=o(l());const p=window.scrollY;await a(0),window.scrollTo({top:p})},u=f=>{i.value[f.target.src]=!0};return gn(()=>{c(!0),n=new ResizeObserver(()=>{c()}),n.observe(r.value),lt(()=>[t.items],()=>{i.value={},c(!0)}),lt(()=>[t.columnWidth,t.gap],()=>{c()})}),Ua(()=>{n.unobserve(r.value)}),(f,p)=>(I(),P("div",{ref_key:"wall",ref:r,class:"wl-gallery",style:nn({gap:`${f.gap}px`})},[(I(!0),P(ue,null,De(s.value,(g,x)=>(I(),P("div",{key:x,class:"wl-gallery-column","data-index":x,style:nn({gap:`${f.gap}px`})},[(I(!0),P(ue,null,De(g,b=>(I(),P(ue,{key:b},[i.value[f.items[b].src]?Y("v-if",!0):(I(),ot(K(En),{key:0,size:36,style:{margin:"20px auto"}})),F("img",{class:"wl-gallery-item",src:f.items[b].src,title:f.items[b].title,loading:"lazy",onLoad:u,onClick:T=>f.$emit("insert",`![](${f.items[b].src})`)},null,40,lh)],64))),128))],12,sh))),128))],4))}});const ah={key:0,class:"wl-login-info"},ch={class:"wl-avatar"},uh=["title"],fh=["title"],hh=["src"],dh=["title","textContent"],ph={class:"wl-panel"},gh=["for","textContent"],mh=["id","onUpdate:modelValue","name","type"],vh=["placeholder"],bh={class:"wl-preview"},yh=["innerHTML"],wh={class:"wl-footer"},kh={class:"wl-actions"},xh={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},_h=["title"],Ch=["title"],Sh=["title","aria-label"],$h=["title"],Rh={class:"wl-info"},Ah={class:"wl-text-number"},Eh={key:0},Th=["textContent"],Lh=["textContent"],Ih=["disabled"],Mh=["placeholder"],Ph={key:1,class:"wl-loading"},Oh={key:0,class:"wl-tab-wrapper"},jh=["title","onClick"],zh=["src","alt"],Fh={key:0,class:"wl-tabs"},Dh=["onClick"],Hh=["src","alt","title"],Uh=["title"];var vo=dn({__name:"CommentBox",props:{edit:{},rootId:{},replyId:{},replyUser:{}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:t}){const n=e,r=t,i=Xn(jn),s=jf(),l=Of(),o=kr(),a=J({}),c=pt("textarea"),u=pt("image-uploader"),f=pt("emoji-button"),p=pt("emoji-popup"),g=pt("gif-button"),x=pt("gif-popup"),b=pt("gif-search"),T=J({tabs:[],map:{}}),k=J(0),_=J(!1),N=J(!1),L=J(!1),O=J(""),G=J(0),j=cn({loading:!0,list:[]}),Q=J(0),be=J(!1),Qe=J(""),E=J(!1),V=J(!1),D=me(()=>i.value.locale),pe=me(()=>!!o.value.token),ke=me(()=>lu(i.value.imageUploader)),ye=z=>{const R=c.value,W=R.selectionStart,h=R.selectionEnd||0,d=R.scrollTop;s.value=R.value.substring(0,W)+z+R.value.substring(h,R.value.length),R.focus(),R.selectionStart=W+z.length,R.selectionEnd=W+z.length,R.scrollTop=d},ft=({key:z,ctrlKey:R,metaKey:W})=>{E.value||(R||W)&&z==="Enter"&&We()},bt=async z=>{const R=`![${i.value.locale.uploading} ${z.name}]()`;ye(R),E.value=!0;try{const W=await i.value.imageUploader(z);s.value=s.value.replace(R,`\r -![${z.name}](${W})`)}catch(W){alert(W.message),s.value=s.value.replace(R,"")}finally{E.value=!1}},In=z=>{var R;if((R=z.dataTransfer)!=null&&R.items){const W=jl(z.dataTransfer.items);W&&ke.value&&(bt(W),z.preventDefault())}},xr=z=>{if(z.clipboardData){const R=jl(z.clipboardData.items);R&&ke.value&&bt(R)}},Jt=()=>{const z=u.value;z.files&&ke.value&&bt(z.files[0]).then(()=>{z.value=""})},We=async()=>{var z;const{serverURL:R,lang:W,login:h,wordLimit:d,requiredMeta:m,recaptchaV3Key:y,turnstileKey:w}=i.value,v={comment:Qe.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:i.value.path,ua:await Cf()};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(h==="force")return;if(m.includes("nick")&&!v.nick){a.value.nick.focus(),alert(D.value.nickError);return}if(m.includes("mail")&&!v.mail||v.mail&&!qo(v.mail)){a.value.mail.focus(),alert(D.value.mailError);return}v.nick||(v.nick=D.value.anonymous)}if(!v.comment){c.value.focus();return}if(!be.value){alert(D.value.wordHint.replace("$0",d[0].toString()).replace("$1",d[1].toString()).replace("$2",G.value.toString()));return}v.comment=lo(v.comment,T.value.map),n.replyId&&n.rootId&&(v.pid=n.replyId,v.rid=n.rootId,v.at=n.replyUser),E.value=!0;try{y&&(v.recaptchaV3=await Wf(y).execute("social")),w&&(v.turnstile=await qf(w).execute("social"));const A={serverURL:R,lang:W,token:o.value.token,comment:v},S=await(n.edit?Qt({objectId:n.edit.objectId,...A}):Ai(A));if(E.value=!1,S.errmsg){alert(S.errmsg);return}r("submit",S.data),s.value="",O.value="",await Wt(),n.replyId&&r("cancelReply"),(z=n.edit)!=null&&z.objectId&&r("cancelEdit")}catch(A){E.value=!1,alert(A.message)}},_r=z=>{z.preventDefault();const{lang:R,serverURL:W}=i.value;Li({serverURL:W,lang:R}).then(h=>{o.value=h,(h.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(h)),r("log")})},$i=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},Cr=z=>{z.preventDefault();const{lang:R,serverURL:W}=i.value,h=800,d=800,m=(window.innerWidth-h)/2,y=(window.innerHeight-d)/2,w=new URLSearchParams({lng:R,token:o.value.token}),v=window.open(`${W}/ui/profile?${w.toString()}`,"_blank",`width=${h},height=${d},left=${m},top=${y},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);v==null||v.postMessage({type:"TOKEN",data:o.value.token},"*")},Pt=z=>{var R,W,h,d;!((R=f.value)!=null&&R.contains(z.target))&&!((W=p.value)!=null&&W.contains(z.target))&&(_.value=!1),!((h=g.value)!=null&&h.contains(z.target))&&!((d=x.value)!=null&&d.contains(z.target))&&(N.value=!1)},Ot=async z=>{var R;const{scrollTop:W,clientHeight:h,scrollHeight:d}=z.target,m=(h+W)/d,y=i.value.search,w=((R=b.value)==null?void 0:R.value)??"";m<.9||j.loading||V.value||(j.loading=!0,(y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)).length?j.list=[...j.list,...y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)]:V.value=!0,j.loading=!1,setTimeout(()=>{z.target.scrollTop=W},50))},Yt=fu(z=>{j.list=[],V.value=!1,Ot(z)},300);return hr("click",Pt),hr("message",({data:z})=>{!z||z.type!=="profile"||(o.value={...o.value,...z.data},[localStorage,sessionStorage].filter(R=>R.getItem("WALINE_USER")).forEach(R=>{R.setItem("WALINE_USER",JSON.stringify(o))}))}),_n([i,G],([z,R])=>{const{wordLimit:W}=z;W?RW[1]?(Q.value=W[1],be.value=!1):(Q.value=W[1],be.value=!0):(Q.value=0,be.value=!0)}),lt(N,async z=>{var R;if(!z)return;const W=i.value.search;b.value&&(b.value.value=""),j.loading=!0,j.list=await(((R=W.default)==null?void 0:R.call(W))??W.search("")),j.loading=!1}),gn(()=>{var z;(z=n.edit)!=null&&z.objectId&&(s.value=n.edit.orig),_n(()=>s.value,R=>{const{highlighter:W,texRenderer:h}=i.value;Qe.value=R,O.value=wf(R,{emojiMap:T.value.map,highlighter:W,texRenderer:h}),G.value=_f(R),R?mo(c.value):mo.destroy(c.value)}),_n(()=>i.value.emoji,async R=>{T.value=await Tu(R)})}),(z,R)=>{var W,h;return I(),P("div",{key:K(o).token,class:"wl-comment"},[K(i).login!=="disable"&&pe.value&&!((W=z.edit)!=null&&W.objectId)?(I(),P("div",ah,[F("div",ch,[F("button",{type:"submit",class:"wl-logout-btn",title:D.value.logout,onClick:$i},[ae(K(ao),{size:14})],8,uh),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Cr},[F("img",{src:K(o).avatar,alt:"avatar"},null,8,hh)],8,fh)]),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Cr,textContent:X(K(o).display_name)},null,8,dh)])):Y("v-if",!0),F("div",ph,[K(i).login!=="force"&&K(i).meta.length&&!pe.value?(I(),P("div",{key:0,class:ge(["wl-header",`item${K(i).meta.length}`])},[(I(!0),P(ue,null,De(K(i).meta,d=>(I(),P("div",{key:d,class:"wl-header-item"},[F("label",{for:`wl-${d}`,textContent:X(D.value[d]+(K(i).requiredMeta.includes(d)||!K(i).requiredMeta.length?"":`(${D.value.optional})`))},null,8,gh),Yn(F("input",{id:`wl-${d}`,ref_for:!0,ref:m=>{m&&(a.value[d]=m)},"onUpdate:modelValue":m=>K(l)[d]=m,class:ge(["wl-input",`wl-${d}`]),name:d,type:d==="mail"?"email":"text"},null,10,mh),[[Xc,K(l)[d]]])]))),128))],2)):Y("v-if",!0),Yn(F("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":R[0]||(R[0]=d=>we(s)?s.value=d:null),class:"wl-editor",placeholder:z.replyUser?`@${z.replyUser}`:D.value.placeholder,onKeydown:ft,onDrop:In,onPaste:xr},null,40,vh),[[hi,K(s)]]),Yn(F("div",bh,[R[7]||(R[7]=F("hr",null,null,-1)),F("h4",null,X(D.value.preview)+":",1),F("div",{class:"wl-content",innerHTML:O.value},null,8,yh)],512),[[dl,L.value]]),F("div",wh,[F("div",kh,[F("a",xh,[ae(K(Tf))]),Yn(F("button",{ref:"emoji-button",type:"button",class:ge(["wl-action",{active:_.value}]),title:D.value.emoji,onClick:R[1]||(R[1]=d=>_.value=!_.value)},[ae(K($f))],10,_h),[[dl,T.value.tabs.length]]),K(i).search?(I(),P("button",{key:0,ref:"gif-button",type:"button",class:ge(["wl-action",{active:N.value}]),title:D.value.gif,onClick:R[2]||(R[2]=d=>N.value=!N.value)},[ae(K(Pf))],10,Ch)):Y("v-if",!0),F("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Jt},null,544),ke.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:D.value.uploadImage,"aria-label":D.value.uploadImage},[ae(K(Rf))],8,Sh)):Y("v-if",!0),F("button",{type:"button",class:ge(["wl-action",{active:L.value}]),title:D.value.preview,onClick:R[3]||(R[3]=d=>L.value=!L.value)},[ae(K(Ef))],10,$h)]),F("div",Rh,[R[9]||(R[9]=F("div",{class:"wl-captcha-container"},null,-1)),F("div",Ah,[at(X(G.value)+" ",1),K(i).wordLimit?(I(),P("span",Eh,[R[8]||(R[8]=at("  /  ")),F("span",{class:ge({illegal:!be.value}),textContent:X(Q.value)},null,10,Th)])):Y("v-if",!0),at("  "+X(D.value.word),1)]),K(i).login!=="disable"&&!pe.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:_r,textContent:X(D.value.login)},null,8,Lh)):Y("v-if",!0),K(i).login!=="force"||pe.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:E.value,onClick:We},[E.value?(I(),ot(K(En),{key:0,size:16})):(I(),P(ue,{key:1},[at(X(D.value.submit),1)],64))],8,Ih)):Y("v-if",!0)]),F("div",{ref:"gif-popup",class:ge(["wl-gif-popup",{display:N.value}])},[F("input",{ref:"gif-search",type:"text",placeholder:D.value.gifSearchPlaceholder,onInput:R[4]||(R[4]=(...d)=>K(Yt)&&K(Yt)(...d))},null,40,Mh),j.list.length?(I(),ot(oh,{key:0,items:j.list,"column-width":200,gap:6,onInsert:R[5]||(R[5]=d=>ye(d)),onScroll:Ot},null,8,["items"])):Y("v-if",!0),j.loading?(I(),P("div",Ph,[ae(K(En),{size:30})])):Y("v-if",!0)],2),F("div",{ref:"emoji-popup",class:ge(["wl-emoji-popup",{display:_.value}])},[(I(!0),P(ue,null,De(T.value.tabs,(d,m)=>(I(),P(ue,{key:d.name},[m===k.value?(I(),P("div",Oh,[(I(!0),P(ue,null,De(d.items,y=>(I(),P("button",{key:y,type:"button",title:y,onClick:w=>ye(`:${y}:`)},[_.value?(I(),P("img",{key:0,class:"wl-emoji",src:T.value.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,zh)):Y("v-if",!0)],8,jh))),128))])):Y("v-if",!0)],64))),128)),T.value.tabs.length>1?(I(),P("div",Fh,[(I(!0),P(ue,null,De(T.value.tabs,(d,m)=>(I(),P("button",{key:d.name,type:"button",class:ge(["wl-tab",{active:k.value===m}]),onClick:y=>k.value=m},[F("img",{class:"wl-emoji",src:d.icon,alt:d.name,title:d.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Hh)],10,Dh))),128))])):Y("v-if",!0)],2)])]),z.replyId||(h=z.edit)!=null&&h.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:D.value.cancelReply,onClick:R[6]||(R[6]=d=>z.replyId?r("cancelReply"):r("cancelEdit"))},[ae(K(ao),{size:24})],8,Uh)):Y("v-if",!0)])}}});const Nh=["id"],Bh={class:"wl-user","aria-hidden":"true"},Vh=["src"],Wh={class:"wl-card"},qh={class:"wl-head"},Kh=["href"],Gh={key:1,class:"wl-nick"},Zh=["textContent"],Jh=["textContent"],Yh=["textContent"],Qh=["textContent"],Xh=["textContent"],ed={class:"wl-comment-actions"},td=["title"],nd=["title"],rd={class:"wl-meta","aria-hidden":"true"},id=["data-value","textContent"],sd={key:0,class:"wl-content"},ld={key:0},od=["href"],ad=["innerHTML"],cd={key:1,class:"wl-admin-actions"},ud={class:"wl-comment-status"},fd=["disabled","onClick","textContent"],hd={key:3,class:"wl-quote"};var dd=dn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:t}){const n=e,r=t,i=["approved","waiting","spam"],s=Xn(jn),l=co(),o=_u(),a=kr(),c=me(()=>s.value.locale),u=me(()=>{const{link:k}=n.comment;return k?Qi(k)?k:`https://${k}`:""}),f=me(()=>l.value.includes(n.comment.objectId)),p=me(()=>Vo(new Date(n.comment.time),o.value,c.value)),g=me(()=>a.value.type==="administrator"),x=me(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),b=me(()=>{var k;return n.comment.objectId===((k=n.reply)==null?void 0:k.objectId)}),T=me(()=>{var k;return n.comment.objectId===((k=n.edit)==null?void 0:k.objectId)});return(k,_)=>{var N;const L=Ba("CommentCard",!0);return I(),P("div",{id:k.comment.objectId.toString(),class:"wl-card-item"},[F("div",Bh,[k.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:k.comment.avatar,alt:""},null,8,Vh)):Y("v-if",!0),k.comment.type?(I(),ot(K(Mf),{key:1})):Y("v-if",!0)]),F("div",Wh,[F("div",qh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(k.comment.nick),9,Kh)):(I(),P("span",Gh,X(k.comment.nick),1)),k.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Zh)):Y("v-if",!0),k.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(k.comment.label)},null,8,Jh)):Y("v-if",!0),k.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,Yh)):Y("v-if",!0),typeof k.comment.level=="number"?(I(),P("span",{key:5,class:ge(`wl-badge level${k.comment.level}`),textContent:X(c.value[`level${k.comment.level}`]||`Level ${k.comment.level}`)},null,10,Qh)):Y("v-if",!0),F("span",{class:"wl-time",textContent:X(p.value)},null,8,Xh),F("div",ed,[g.value||x.value?(I(),P(ue,{key:0},[F("button",{type:"button",class:"wl-edit",onClick:_[0]||(_[0]=O=>r("edit",k.comment))},[ae(K(If))]),F("button",{type:"button",class:"wl-delete",onClick:_[1]||(_[1]=O=>r("delete",k.comment))},[ae(K(Sf))])],64)):Y("v-if",!0),F("button",{type:"button",class:"wl-like",title:f.value?c.value.cancelLike:c.value.like,onClick:_[2]||(_[2]=O=>r("like",k.comment))},[ae(K(Af),{active:f.value},null,8,["active"]),at(" "+X("like"in k.comment?k.comment.like:""),1)],8,td),F("button",{type:"button",class:ge(["wl-reply",{active:b.value}]),title:b.value?c.value.cancelReply:c.value.reply,onClick:_[3]||(_[3]=O=>r("reply",b.value?null:k.comment))},[ae(K(Lf))],10,nd)])]),F("div",rd,[(I(),P(ue,null,De(["addr","browser","os"],O=>(I(),P(ue,null,[k.comment[O]?(I(),P("span",{key:O,class:ge(`wl-${O}`),"data-value":k.comment[O],textContent:X(k.comment[O])},null,10,id)):Y("v-if",!0)],64))),64))]),T.value?Y("v-if",!0):(I(),P("div",sd,["reply_user"in k.comment&&k.comment.reply_user?(I(),P("p",ld,[F("a",{href:"#"+k.comment.pid},"@"+X(k.comment.reply_user.nick),9,od),_[17]||(_[17]=F("span",null,": ",-1))])):Y("v-if",!0),F("div",{innerHTML:k.comment.comment},null,8,ad)])),g.value&&!T.value?(I(),P("div",cd,[F("span",ud,[(I(),P(ue,null,De(i,O=>F("button",{key:O,type:"submit",class:ge(`wl-btn wl-${O}`),disabled:k.comment.status===O,onClick:G=>r("status",{status:O,comment:k.comment}),textContent:X(c.value[O])},null,10,fd)),64))]),g.value&&!("rid"in k.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:_[4]||(_[4]=O=>r("sticky",k.comment))},X(k.comment.sticky?c.value.unsticky:c.value.sticky),1)):Y("v-if",!0)])):Y("v-if",!0),b.value||T.value?(I(),P("div",{key:2,class:ge({"wl-reply-wrapper":b.value,"wl-edit-wrapper":T.value})},[ae(vo,{edit:k.edit,"reply-id":(N=k.reply)==null?void 0:N.objectId,"reply-user":k.comment.nick,"root-id":k.rootId,onLog:_[5]||(_[5]=O=>r("log")),onCancelReply:_[6]||(_[6]=O=>r("reply",null)),onCancelEdit:_[7]||(_[7]=O=>r("edit",null)),onSubmit:_[8]||(_[8]=O=>r("submit",O))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Y("v-if",!0),"children"in k.comment?(I(),P("div",hd,[(I(!0),P(ue,null,De(k.comment.children,O=>(I(),ot(L,{key:O.objectId,comment:O,reply:k.reply,edit:k.edit,"root-id":k.rootId,onLog:_[9]||(_[9]=G=>r("log")),onDelete:_[10]||(_[10]=G=>r("delete",G)),onEdit:_[11]||(_[11]=G=>r("edit",G)),onLike:_[12]||(_[12]=G=>r("like",G)),onReply:_[13]||(_[13]=G=>r("reply",G)),onStatus:_[14]||(_[14]=G=>r("status",G)),onSticky:_[15]||(_[15]=G=>r("sticky",G)),onSubmit:_[16]||(_[16]=G=>r("submit",G))},null,8,["comment","reply","edit","root-id"]))),128))])):Y("v-if",!0)])],8,Nh)}}});const bo="3.5.0",pd={"data-waline":""},gd={class:"wl-meta-head"},md={class:"wl-count"},vd=["textContent"],bd={class:"wl-sort"},yd=["onClick"],wd={class:"wl-cards"},kd={key:1,class:"wl-operation"},xd=["textContent"],_d={key:2,class:"wl-loading"},Cd=["textContent"],Sd={key:4,class:"wl-operation"},$d=["textContent"],Rd={key:5,class:"wl-power"};var Ad=dn({__name:"WalineComment",props:{serverURL:{},path:{},meta:{},requiredMeta:{},wordLimit:{},pageSize:{},lang:{},locale:{},commentSorting:{},dark:{type:[String,Boolean]},emoji:{},search:{},highlighter:{type:[Function,String]},imageUploader:{type:[Function,String]},texRenderer:{type:[Function,String]},login:{},noCopyright:{type:Boolean},recaptchaV3Key:{},turnstileKey:{},reaction:{}},setup(e){const t=e,n=kr(),r=co(),i=J("loading"),s=J(0),l=J(1),o=J(0),a=me(()=>Uo(t)),c=J(a.value.commentSorting),u=J([]),f=J(null),p=J(null),g=me(()=>No(a.value.dark)),x=me(()=>a.value.locale);$u(g,{id:"waline-darkmode"});let b=null;const T=E=>{const{serverURL:V,path:D,pageSize:pe}=a.value,ke=new AbortController;i.value="loading",b==null||b(),Ri({serverURL:V,lang:a.value.lang,path:D,pageSize:pe,sortBy:Zi[c.value],page:E,signal:ke.signal,token:n.value.token}).then(ye=>{i.value="success",s.value=ye.count,u.value.push(...ye.data),l.value=E,o.value=ye.totalPages}).catch(ye=>{ye.name!=="AbortError"&&(console.error(ye.message),i.value="error")}),b=ke.abort.bind(ke)},k=()=>{T(l.value+1)},_=()=>{s.value=0,u.value=[],T(1)},N=E=>{c.value!==E&&(c.value=E,_())},L=E=>{f.value=E},O=E=>{p.value=E},G=E=>{if(p.value)p.value.comment=E.comment,p.value.orig=E.orig;else if("rid"in E){const V=u.value.find(({objectId:D})=>D===E.rid);if(!V)return;Array.isArray(V.children)||(V.children=[]),V.children.push(E)}else u.value.unshift(E),s.value+=1},j=async({comment:E,status:V})=>{if(E.status===V)return;const{serverURL:D,lang:pe}=a.value;await Qt({serverURL:D,lang:pe,token:n.value.token,objectId:E.objectId,comment:{status:V}}),E.status=V},Q=async E=>{if("rid"in E)return;const{serverURL:V,lang:D}=a.value;await Qt({serverURL:V,lang:D,token:n.value.token,objectId:E.objectId,comment:{sticky:E.sticky?0:1}}),E.sticky=!E.sticky},be=async({objectId:E})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:V,lang:D}=a.value;await Ei({serverURL:V,lang:D,token:n.value.token,objectId:E}),u.value.some((pe,ke)=>pe.objectId===E?(u.value=u.value.filter((ye,ft)=>ft!==ke),!0):pe.children.some((ye,ft)=>ye.objectId===E?(u.value[ke].children=pe.children.filter((bt,In)=>In!==ft),!0):!1))},Qe=async E=>{const{serverURL:V,lang:D}=a.value,{objectId:pe}=E,ke=r.value.includes(pe);await Qt({serverURL:V,lang:D,objectId:pe,token:n.value.token,comment:{like:!ke}}),ke?r.value=r.value.filter(ye=>ye!==pe):(r.value=[...r.value,pe],r.value.length>50&&(r.value=r.value.slice(-50))),E.like=Math.max(0,(E.like||0)+(ke?-1:1))};return Za(jn,a),gn(()=>{_n(()=>[t.serverURL,t.path],()=>{_()})}),Xr(()=>{b==null||b()}),(E,V)=>(I(),P("div",pd,[ae(nh),!f.value&&!p.value?(I(),ot(vo,{key:0,onLog:_,onSubmit:G})):Y("v-if",!0),F("div",gd,[F("div",md,[s.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(s.value)},null,8,vd)):Y("v-if",!0),at(" "+X(x.value.comment),1)]),F("ul",bd,[(I(!0),P(ue,null,De(K(Do),D=>(I(),P("li",{key:D,class:ge([D===c.value?"active":""]),onClick:pe=>N(D)},X(x.value[D]),11,yd))),128))])]),F("div",wd,[(I(!0),P(ue,null,De(u.value,D=>(I(),ot(dd,{key:D.objectId,"root-id":D.objectId,comment:D,reply:f.value,edit:p.value,onLog:_,onReply:L,onEdit:O,onSubmit:G,onStatus:j,onDelete:be,onSticky:Q,onLike:Qe},null,8,["root-id","comment","reply","edit"]))),128))]),i.value==="error"?(I(),P("div",kd,[F("button",{type:"button",class:"wl-btn",onClick:_,textContent:X(x.value.refresh)},null,8,xd)])):i.value==="loading"?(I(),P("div",_d,[ae(K(En),{size:30})])):u.value.length?l.value{t.forEach((n,r)=>{const i=e[r].time;typeof i=="number"&&(n.innerText=i.toString())})},wo=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:r=!0,lang:i=navigator.language})=>{const s=new AbortController,l=Array.from(document.querySelectorAll(n)),o=c=>{const u=Ci(c);return u!==null&&t!==u},a=c=>Ii({serverURL:zn(e),paths:c.map(u=>Ci(u)??t),lang:i,signal:s.signal}).then(u=>yo(u,c)).catch(Ol);if(r){const c=l.filter(f=>!o(f)),u=l.filter(o);Mi({serverURL:zn(e),path:t,lang:i}).then(f=>yo(f,c)),u.length&&a(u)}else a(l);return s.abort.bind(s)},Ed=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...i})=>{const s=e?pi(e):null;if(e&&!s)throw new Error("Option 'el' do not match any domElement!");if(!i.serverURL)throw new Error("Option 'serverURL' is missing!");const l=cn({...i}),o=cn({comment:n,pageview:r,path:t}),a=()=>{o.comment&&oo({serverURL:l.serverURL,path:o.path,...zt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&wo({serverURL:l.serverURL,path:o.path,...zt(o.pageview)?{selector:o.pageview}:{}})};let u=null;s&&(u=ru(()=>ne(Ad,{path:o.path,...l})),u.mount(s));const f=Zs(a),p=Zs(c);return{el:s,update:({comment:g,pageview:x,path:b=window.location.pathname,...T}={})=>{Object.entries(T).forEach(([k,_])=>{l[k]=_}),o.path=b,g!==void 0&&(o.comment=g),x!==void 0&&(o.pageview=x)},destroy:()=>{u==null||u.unmount(),f(),p()}}},Td=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{const i=kr(),s=pi(e),l=new AbortController;return Pi({serverURL:t,count:n,lang:r,signal:l.signal,token:i.value.token}).then(o=>s&&o.length?(s.innerHTML=`
    ${o.map(a=>`
  • ${a.nick}:${a.comment}
  • `).join("")}
`,{comments:o,destroy:()=>{l.abort(),s.innerHTML=""}}):{comments:o,destroy:()=>l.abort()})},Ld=({el:e,serverURL:t,count:n,locale:r,lang:i=navigator.language,mode:s="list"})=>{const l=pi(e),o=new AbortController;return Oi({serverURL:t,pageSize:n,lang:i,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Ki(i),...typeof r=="object"?r:{}},l.innerHTML=``,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};re.RecentComments=Td,re.UserList=Ld,re.addComment=Ai,re.commentCount=oo,re.defaultLocales=On,re.deleteComment=Ei,re.fetchCommentCount=Ti,re.getArticleCounter=Sr,re.getComment=Ri,re.getPageview=Ii,re.getRecentComment=Pi,re.getUserList=Oi,re.init=Ed,re.login=Li,re.pageviewCount=wo,re.updateArticleCounter=Pn,re.updateComment=Qt,re.updatePageview=Mi,re.version=bo}); +![${z.name}](${W})`)}catch(W){alert(W.message),s.value=s.value.replace(R,"")}finally{E.value=!1}},In=z=>{var R;if((R=z.dataTransfer)!=null&&R.items){const W=jl(z.dataTransfer.items);W&&ke.value&&(bt(W),z.preventDefault())}},xr=z=>{if(z.clipboardData){const R=jl(z.clipboardData.items);R&&ke.value&&bt(R)}},Jt=()=>{const z=u.value;z.files&&ke.value&&bt(z.files[0]).then(()=>{z.value=""})},We=async()=>{var z;const{serverURL:R,lang:W,login:h,wordLimit:d,requiredMeta:m,recaptchaV3Key:y,turnstileKey:w}=i.value,v={comment:Qe.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:i.value.path,ua:await Cf()};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(h==="force")return;if(m.includes("nick")&&!v.nick){a.value.nick.focus(),alert(D.value.nickError);return}if(m.includes("mail")&&!v.mail||v.mail&&!qo(v.mail)){a.value.mail.focus(),alert(D.value.mailError);return}v.nick||(v.nick=D.value.anonymous)}if(!v.comment){c.value.focus();return}if(!be.value){alert(D.value.wordHint.replace("$0",d[0].toString()).replace("$1",d[1].toString()).replace("$2",G.value.toString()));return}v.comment=lo(v.comment,T.value.map),n.replyId&&n.rootId&&(v.pid=n.replyId,v.rid=n.rootId,v.at=n.replyUser),E.value=!0;try{y&&(v.recaptchaV3=await Wf(y).execute("social")),w&&(v.turnstile=await qf(w).execute("social"));const A={serverURL:R,lang:W,token:o.value.token,comment:v},S=await(n.edit?Qt({objectId:n.edit.objectId,...A}):Ai(A));if(E.value=!1,S.errmsg){alert(S.errmsg);return}r("submit",S.data),s.value="",O.value="",await Wt(),n.replyId&&r("cancelReply"),(z=n.edit)!=null&&z.objectId&&r("cancelEdit")}catch(A){E.value=!1,alert(A.message)}},_r=z=>{z.preventDefault();const{lang:R,serverURL:W}=i.value;Li({serverURL:W,lang:R}).then(h=>{o.value=h,(h.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(h)),r("log")})},$i=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},Cr=z=>{z.preventDefault();const{lang:R,serverURL:W}=i.value,h=800,d=800,m=(window.innerWidth-h)/2,y=(window.innerHeight-d)/2,w=new URLSearchParams({lng:R,token:o.value.token}),v=window.open(`${W}/ui/profile?${w.toString()}`,"_blank",`width=${h},height=${d},left=${m},top=${y},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);v==null||v.postMessage({type:"TOKEN",data:o.value.token},"*")},Pt=z=>{var R,W,h,d;!((R=f.value)!=null&&R.contains(z.target))&&!((W=p.value)!=null&&W.contains(z.target))&&(_.value=!1),!((h=g.value)!=null&&h.contains(z.target))&&!((d=x.value)!=null&&d.contains(z.target))&&(N.value=!1)},Ot=async z=>{var R;const{scrollTop:W,clientHeight:h,scrollHeight:d}=z.target,m=(h+W)/d,y=i.value.search,w=((R=b.value)==null?void 0:R.value)??"";m<.9||j.loading||V.value||(j.loading=!0,(y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)).length?j.list=[...j.list,...y.more&&j.list.length?await y.more(w,j.list.length):await y.search(w)]:V.value=!0,j.loading=!1,setTimeout(()=>{z.target.scrollTop=W},50))},Yt=fu(z=>{j.list=[],V.value=!1,Ot(z)},300);return hr("click",Pt),hr("message",({data:z})=>{!z||z.type!=="profile"||(o.value={...o.value,...z.data},[localStorage,sessionStorage].filter(R=>R.getItem("WALINE_USER")).forEach(R=>{R.setItem("WALINE_USER",JSON.stringify(o))}))}),_n([i,G],([z,R])=>{const{wordLimit:W}=z;W?RW[1]?(Q.value=W[1],be.value=!1):(Q.value=W[1],be.value=!0):(Q.value=0,be.value=!0)}),lt(N,async z=>{var R;if(!z)return;const W=i.value.search;b.value&&(b.value.value=""),j.loading=!0,j.list=await(((R=W.default)==null?void 0:R.call(W))??W.search("")),j.loading=!1}),gn(()=>{var z;(z=n.edit)!=null&&z.objectId&&(s.value=n.edit.orig),_n(()=>s.value,R=>{const{highlighter:W,texRenderer:h}=i.value;Qe.value=R,O.value=wf(R,{emojiMap:T.value.map,highlighter:W,texRenderer:h}),G.value=_f(R),R?mo(c.value):mo.destroy(c.value)}),_n(()=>i.value.emoji,async R=>{T.value=await Tu(R)})}),(z,R)=>{var W,h;return I(),P("div",{key:K(o).token,class:"wl-comment"},[K(i).login!=="disable"&&pe.value&&!((W=z.edit)!=null&&W.objectId)?(I(),P("div",ah,[F("div",ch,[F("button",{type:"submit",class:"wl-logout-btn",title:D.value.logout,onClick:$i},[ae(K(ao),{size:14})],8,uh),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Cr},[F("img",{src:K(o).avatar,alt:"avatar"},null,8,hh)],8,fh)]),F("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:D.value.profile,onClick:Cr,textContent:X(K(o).display_name)},null,8,dh)])):Y("v-if",!0),F("div",ph,[K(i).login!=="force"&&K(i).meta.length&&!pe.value?(I(),P("div",{key:0,class:ge(["wl-header",`item${K(i).meta.length}`])},[(I(!0),P(ue,null,De(K(i).meta,d=>(I(),P("div",{key:d,class:"wl-header-item"},[F("label",{for:`wl-${d}`,textContent:X(D.value[d]+(K(i).requiredMeta.includes(d)||!K(i).requiredMeta.length?"":`(${D.value.optional})`))},null,8,gh),Yn(F("input",{id:`wl-${d}`,ref_for:!0,ref:m=>{m&&(a.value[d]=m)},"onUpdate:modelValue":m=>K(l)[d]=m,class:ge(["wl-input",`wl-${d}`]),name:d,type:d==="mail"?"email":"text"},null,10,mh),[[Xc,K(l)[d]]])]))),128))],2)):Y("v-if",!0),Yn(F("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":R[0]||(R[0]=d=>we(s)?s.value=d:null),class:"wl-editor",placeholder:z.replyUser?`@${z.replyUser}`:D.value.placeholder,onKeydown:ft,onDrop:In,onPaste:xr},null,40,vh),[[hi,K(s)]]),Yn(F("div",bh,[R[7]||(R[7]=F("hr",null,null,-1)),F("h4",null,X(D.value.preview)+":",1),F("div",{class:"wl-content",innerHTML:O.value},null,8,yh)],512),[[dl,L.value]]),F("div",wh,[F("div",kh,[F("a",xh,[ae(K(Tf))]),Yn(F("button",{ref:"emoji-button",type:"button",class:ge(["wl-action",{active:_.value}]),title:D.value.emoji,onClick:R[1]||(R[1]=d=>_.value=!_.value)},[ae(K($f))],10,_h),[[dl,T.value.tabs.length]]),K(i).search?(I(),P("button",{key:0,ref:"gif-button",type:"button",class:ge(["wl-action",{active:N.value}]),title:D.value.gif,onClick:R[2]||(R[2]=d=>N.value=!N.value)},[ae(K(Pf))],10,Ch)):Y("v-if",!0),F("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Jt},null,544),ke.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:D.value.uploadImage,"aria-label":D.value.uploadImage},[ae(K(Rf))],8,Sh)):Y("v-if",!0),F("button",{type:"button",class:ge(["wl-action",{active:L.value}]),title:D.value.preview,onClick:R[3]||(R[3]=d=>L.value=!L.value)},[ae(K(Ef))],10,$h)]),F("div",Rh,[R[9]||(R[9]=F("div",{class:"wl-captcha-container"},null,-1)),F("div",Ah,[at(X(G.value)+" ",1),K(i).wordLimit?(I(),P("span",Eh,[R[8]||(R[8]=at("  /  ")),F("span",{class:ge({illegal:!be.value}),textContent:X(Q.value)},null,10,Th)])):Y("v-if",!0),at("  "+X(D.value.word),1)]),K(i).login!=="disable"&&!pe.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:_r,textContent:X(D.value.login)},null,8,Lh)):Y("v-if",!0),K(i).login!=="force"||pe.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:E.value,onClick:We},[E.value?(I(),ot(K(En),{key:0,size:16})):(I(),P(ue,{key:1},[at(X(D.value.submit),1)],64))],8,Ih)):Y("v-if",!0)]),F("div",{ref:"gif-popup",class:ge(["wl-gif-popup",{display:N.value}])},[F("input",{ref:"gif-search",type:"text",placeholder:D.value.gifSearchPlaceholder,onInput:R[4]||(R[4]=(...d)=>K(Yt)&&K(Yt)(...d))},null,40,Mh),j.list.length?(I(),ot(oh,{key:0,items:j.list,"column-width":200,gap:6,onInsert:R[5]||(R[5]=d=>ye(d)),onScroll:Ot},null,8,["items"])):Y("v-if",!0),j.loading?(I(),P("div",Ph,[ae(K(En),{size:30})])):Y("v-if",!0)],2),F("div",{ref:"emoji-popup",class:ge(["wl-emoji-popup",{display:_.value}])},[(I(!0),P(ue,null,De(T.value.tabs,(d,m)=>(I(),P(ue,{key:d.name},[m===k.value?(I(),P("div",Oh,[(I(!0),P(ue,null,De(d.items,y=>(I(),P("button",{key:y,type:"button",title:y,onClick:w=>ye(`:${y}:`)},[_.value?(I(),P("img",{key:0,class:"wl-emoji",src:T.value.map[y],alt:y,loading:"lazy",referrerPolicy:"no-referrer"},null,8,zh)):Y("v-if",!0)],8,jh))),128))])):Y("v-if",!0)],64))),128)),T.value.tabs.length>1?(I(),P("div",Fh,[(I(!0),P(ue,null,De(T.value.tabs,(d,m)=>(I(),P("button",{key:d.name,type:"button",class:ge(["wl-tab",{active:k.value===m}]),onClick:y=>k.value=m},[F("img",{class:"wl-emoji",src:d.icon,alt:d.name,title:d.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Hh)],10,Dh))),128))])):Y("v-if",!0)],2)])]),z.replyId||(h=z.edit)!=null&&h.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:D.value.cancelReply,onClick:R[6]||(R[6]=d=>z.replyId?r("cancelReply"):r("cancelEdit"))},[ae(K(ao),{size:24})],8,Uh)):Y("v-if",!0)])}}});const Nh=["id"],Bh={class:"wl-user","aria-hidden":"true"},Vh=["src"],Wh={class:"wl-card"},qh={class:"wl-head"},Kh=["href"],Gh={key:1,class:"wl-nick"},Zh=["textContent"],Jh=["textContent"],Yh=["textContent"],Qh=["textContent"],Xh=["textContent"],ed={class:"wl-comment-actions"},td=["title"],nd=["title"],rd={class:"wl-meta","aria-hidden":"true"},id=["data-value","textContent"],sd={key:0,class:"wl-content"},ld={key:0},od=["href"],ad=["innerHTML"],cd={key:1,class:"wl-admin-actions"},ud={class:"wl-comment-status"},fd=["disabled","onClick","textContent"],hd={key:3,class:"wl-quote"};var dd=dn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:t}){const n=e,r=t,i=["approved","waiting","spam"],s=Xn(jn),l=co(),o=_u(),a=kr(),c=me(()=>s.value.locale),u=me(()=>{const{link:k}=n.comment;return k?Qi(k)?k:`https://${k}`:""}),f=me(()=>l.value.includes(n.comment.objectId)),p=me(()=>Vo(new Date(n.comment.time),o.value,c.value)),g=me(()=>a.value.type==="administrator"),x=me(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),b=me(()=>{var k;return n.comment.objectId===((k=n.reply)==null?void 0:k.objectId)}),T=me(()=>{var k;return n.comment.objectId===((k=n.edit)==null?void 0:k.objectId)});return(k,_)=>{var N;const L=Ba("CommentCard",!0);return I(),P("div",{id:k.comment.objectId.toString(),class:"wl-card-item"},[F("div",Bh,[k.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:k.comment.avatar,alt:""},null,8,Vh)):Y("v-if",!0),k.comment.type?(I(),ot(K(Mf),{key:1})):Y("v-if",!0)]),F("div",Wh,[F("div",qh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(k.comment.nick),9,Kh)):(I(),P("span",Gh,X(k.comment.nick),1)),k.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Zh)):Y("v-if",!0),k.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(k.comment.label)},null,8,Jh)):Y("v-if",!0),k.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,Yh)):Y("v-if",!0),typeof k.comment.level=="number"?(I(),P("span",{key:5,class:ge(`wl-badge level${k.comment.level}`),textContent:X(c.value[`level${k.comment.level}`]||`Level ${k.comment.level}`)},null,10,Qh)):Y("v-if",!0),F("span",{class:"wl-time",textContent:X(p.value)},null,8,Xh),F("div",ed,[g.value||x.value?(I(),P(ue,{key:0},[F("button",{type:"button",class:"wl-edit",onClick:_[0]||(_[0]=O=>r("edit",k.comment))},[ae(K(If))]),F("button",{type:"button",class:"wl-delete",onClick:_[1]||(_[1]=O=>r("delete",k.comment))},[ae(K(Sf))])],64)):Y("v-if",!0),F("button",{type:"button",class:"wl-like",title:f.value?c.value.cancelLike:c.value.like,onClick:_[2]||(_[2]=O=>r("like",k.comment))},[ae(K(Af),{active:f.value},null,8,["active"]),at(" "+X("like"in k.comment?k.comment.like:""),1)],8,td),F("button",{type:"button",class:ge(["wl-reply",{active:b.value}]),title:b.value?c.value.cancelReply:c.value.reply,onClick:_[3]||(_[3]=O=>r("reply",b.value?null:k.comment))},[ae(K(Lf))],10,nd)])]),F("div",rd,[(I(),P(ue,null,De(["addr","browser","os"],O=>(I(),P(ue,null,[k.comment[O]?(I(),P("span",{key:O,class:ge(`wl-${O}`),"data-value":k.comment[O],textContent:X(k.comment[O])},null,10,id)):Y("v-if",!0)],64))),64))]),T.value?Y("v-if",!0):(I(),P("div",sd,["reply_user"in k.comment&&k.comment.reply_user?(I(),P("p",ld,[F("a",{href:"#"+k.comment.pid},"@"+X(k.comment.reply_user.nick),9,od),_[17]||(_[17]=F("span",null,": ",-1))])):Y("v-if",!0),F("div",{innerHTML:k.comment.comment},null,8,ad)])),g.value&&!T.value?(I(),P("div",cd,[F("span",ud,[(I(),P(ue,null,De(i,O=>F("button",{key:O,type:"submit",class:ge(`wl-btn wl-${O}`),disabled:k.comment.status===O,onClick:G=>r("status",{status:O,comment:k.comment}),textContent:X(c.value[O])},null,10,fd)),64))]),g.value&&!("rid"in k.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:_[4]||(_[4]=O=>r("sticky",k.comment))},X(k.comment.sticky?c.value.unsticky:c.value.sticky),1)):Y("v-if",!0)])):Y("v-if",!0),b.value||T.value?(I(),P("div",{key:2,class:ge({"wl-reply-wrapper":b.value,"wl-edit-wrapper":T.value})},[ae(vo,{edit:k.edit,"reply-id":(N=k.reply)==null?void 0:N.objectId,"reply-user":k.comment.nick,"root-id":k.rootId,onLog:_[5]||(_[5]=O=>r("log")),onCancelReply:_[6]||(_[6]=O=>r("reply",null)),onCancelEdit:_[7]||(_[7]=O=>r("edit",null)),onSubmit:_[8]||(_[8]=O=>r("submit",O))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Y("v-if",!0),"children"in k.comment?(I(),P("div",hd,[(I(!0),P(ue,null,De(k.comment.children,O=>(I(),ot(L,{key:O.objectId,comment:O,reply:k.reply,edit:k.edit,"root-id":k.rootId,onLog:_[9]||(_[9]=G=>r("log")),onDelete:_[10]||(_[10]=G=>r("delete",G)),onEdit:_[11]||(_[11]=G=>r("edit",G)),onLike:_[12]||(_[12]=G=>r("like",G)),onReply:_[13]||(_[13]=G=>r("reply",G)),onStatus:_[14]||(_[14]=G=>r("status",G)),onSticky:_[15]||(_[15]=G=>r("sticky",G)),onSubmit:_[16]||(_[16]=G=>r("submit",G))},null,8,["comment","reply","edit","root-id"]))),128))])):Y("v-if",!0)])],8,Nh)}}});const bo="3.5.1",pd={"data-waline":""},gd={class:"wl-meta-head"},md={class:"wl-count"},vd=["textContent"],bd={class:"wl-sort"},yd=["onClick"],wd={class:"wl-cards"},kd={key:1,class:"wl-operation"},xd=["textContent"],_d={key:2,class:"wl-loading"},Cd=["textContent"],Sd={key:4,class:"wl-operation"},$d=["textContent"],Rd={key:5,class:"wl-power"};var Ad=dn({__name:"WalineComment",props:{serverURL:{},path:{},meta:{},requiredMeta:{},wordLimit:{},pageSize:{},lang:{},locale:{},commentSorting:{},dark:{type:[String,Boolean]},login:{},noCopyright:{type:Boolean},recaptchaV3Key:{},turnstileKey:{},reaction:{},emoji:{},search:{},highlighter:{type:Function},imageUploader:{type:Function},texRenderer:{type:Function}},setup(e){const t=e,n=kr(),r=co(),i=J("loading"),s=J(0),l=J(1),o=J(0),a=me(()=>Uo(t)),c=J(a.value.commentSorting),u=J([]),f=J(null),p=J(null),g=me(()=>No(a.value.dark)),x=me(()=>a.value.locale);$u(g,{id:"waline-darkmode"});let b=null;const T=E=>{const{serverURL:V,path:D,pageSize:pe}=a.value,ke=new AbortController;i.value="loading",b==null||b(),Ri({serverURL:V,lang:a.value.lang,path:D,pageSize:pe,sortBy:Zi[c.value],page:E,signal:ke.signal,token:n.value.token}).then(ye=>{i.value="success",s.value=ye.count,u.value.push(...ye.data),l.value=E,o.value=ye.totalPages}).catch(ye=>{ye.name!=="AbortError"&&(console.error(ye.message),i.value="error")}),b=ke.abort.bind(ke)},k=()=>{T(l.value+1)},_=()=>{s.value=0,u.value=[],T(1)},N=E=>{c.value!==E&&(c.value=E,_())},L=E=>{f.value=E},O=E=>{p.value=E},G=E=>{if(p.value)p.value.comment=E.comment,p.value.orig=E.orig;else if("rid"in E){const V=u.value.find(({objectId:D})=>D===E.rid);if(!V)return;Array.isArray(V.children)||(V.children=[]),V.children.push(E)}else u.value.unshift(E),s.value+=1},j=async({comment:E,status:V})=>{if(E.status===V)return;const{serverURL:D,lang:pe}=a.value;await Qt({serverURL:D,lang:pe,token:n.value.token,objectId:E.objectId,comment:{status:V}}),E.status=V},Q=async E=>{if("rid"in E)return;const{serverURL:V,lang:D}=a.value;await Qt({serverURL:V,lang:D,token:n.value.token,objectId:E.objectId,comment:{sticky:E.sticky?0:1}}),E.sticky=!E.sticky},be=async({objectId:E})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:V,lang:D}=a.value;await Ei({serverURL:V,lang:D,token:n.value.token,objectId:E}),u.value.some((pe,ke)=>pe.objectId===E?(u.value=u.value.filter((ye,ft)=>ft!==ke),!0):pe.children.some((ye,ft)=>ye.objectId===E?(u.value[ke].children=pe.children.filter((bt,In)=>In!==ft),!0):!1))},Qe=async E=>{const{serverURL:V,lang:D}=a.value,{objectId:pe}=E,ke=r.value.includes(pe);await Qt({serverURL:V,lang:D,objectId:pe,token:n.value.token,comment:{like:!ke}}),ke?r.value=r.value.filter(ye=>ye!==pe):(r.value=[...r.value,pe],r.value.length>50&&(r.value=r.value.slice(-50))),E.like=Math.max(0,(E.like||0)+(ke?-1:1))};return Za(jn,a),gn(()=>{_n(()=>[t.serverURL,t.path],()=>{_()})}),Xr(()=>{b==null||b()}),(E,V)=>(I(),P("div",pd,[ae(nh),!f.value&&!p.value?(I(),ot(vo,{key:0,onLog:_,onSubmit:G})):Y("v-if",!0),F("div",gd,[F("div",md,[s.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(s.value)},null,8,vd)):Y("v-if",!0),at(" "+X(x.value.comment),1)]),F("ul",bd,[(I(!0),P(ue,null,De(K(Do),D=>(I(),P("li",{key:D,class:ge([D===c.value?"active":""]),onClick:pe=>N(D)},X(x.value[D]),11,yd))),128))])]),F("div",wd,[(I(!0),P(ue,null,De(u.value,D=>(I(),ot(dd,{key:D.objectId,"root-id":D.objectId,comment:D,reply:f.value,edit:p.value,onLog:_,onReply:L,onEdit:O,onSubmit:G,onStatus:j,onDelete:be,onSticky:Q,onLike:Qe},null,8,["root-id","comment","reply","edit"]))),128))]),i.value==="error"?(I(),P("div",kd,[F("button",{type:"button",class:"wl-btn",onClick:_,textContent:X(x.value.refresh)},null,8,xd)])):i.value==="loading"?(I(),P("div",_d,[ae(K(En),{size:30})])):u.value.length?l.value{t.forEach((n,r)=>{const i=e[r].time;typeof i=="number"&&(n.innerText=i.toString())})},wo=({serverURL:e,path:t=window.location.pathname,selector:n=".waline-pageview-count",update:r=!0,lang:i=navigator.language})=>{const s=new AbortController,l=Array.from(document.querySelectorAll(n)),o=c=>{const u=Ci(c);return u!==null&&t!==u},a=c=>Ii({serverURL:zn(e),paths:c.map(u=>Ci(u)??t),lang:i,signal:s.signal}).then(u=>yo(u,c)).catch(Ol);if(r){const c=l.filter(f=>!o(f)),u=l.filter(o);Mi({serverURL:zn(e),path:t,lang:i}).then(f=>yo(f,c)),u.length&&a(u)}else a(l);return s.abort.bind(s)},Ed=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...i})=>{const s=e?pi(e):null;if(e&&!s)throw new Error("Option 'el' do not match any domElement!");if(!i.serverURL)throw new Error("Option 'serverURL' is missing!");const l=cn({...i}),o=cn({comment:n,pageview:r,path:t}),a=()=>{o.comment&&oo({serverURL:l.serverURL,path:o.path,...zt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&wo({serverURL:l.serverURL,path:o.path,...zt(o.pageview)?{selector:o.pageview}:{}})};let u=null;s&&(u=ru(()=>ne(Ad,{path:o.path,...l})),u.mount(s));const f=Zs(a),p=Zs(c);return{el:s,update:({comment:g,pageview:x,path:b=window.location.pathname,...T}={})=>{Object.entries(T).forEach(([k,_])=>{l[k]=_}),o.path=b,g!==void 0&&(o.comment=g),x!==void 0&&(o.pageview=x)},destroy:()=>{u==null||u.unmount(),f(),p()}}},Td=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{const i=kr(),s=pi(e),l=new AbortController;return Pi({serverURL:t,count:n,lang:r,signal:l.signal,token:i.value.token}).then(o=>s&&o.length?(s.innerHTML=`
    ${o.map(a=>`
  • ${a.nick}:${a.comment}
  • `).join("")}
`,{comments:o,destroy:()=>{l.abort(),s.innerHTML=""}}):{comments:o,destroy:()=>l.abort()})},Ld=({el:e,serverURL:t,count:n,locale:r,lang:i=navigator.language,mode:s="list"})=>{const l=pi(e),o=new AbortController;return Oi({serverURL:t,pageSize:n,lang:i,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Ki(i),...typeof r=="object"?r:{}},l.innerHTML=``,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};re.RecentComments=Td,re.UserList=Ld,re.addComment=Ai,re.commentCount=oo,re.defaultLocales=On,re.deleteComment=Ei,re.fetchCommentCount=Ti,re.getArticleCounter=Sr,re.getComment=Ri,re.getPageview=Ii,re.getRecentComment=Pi,re.getUserList=Oi,re.init=Ed,re.login=Li,re.pageviewCount=wo,re.updateArticleCounter=Pn,re.updateComment=Qt,re.updatePageview=Mi,re.version=bo}); //# sourceMappingURL=waline.umd.js.map diff --git a/dependencies.json b/dependencies.json index 3389cf6a9..ff0ec2336 100644 --- a/dependencies.json +++ b/dependencies.json @@ -17,7 +17,7 @@ }, { "name": "@waline/client", - "version": "3.5.0", + "version": "3.5.1", "files": [ { "remote": "dist/waline.css",