diff --git a/assets/lib/waline/waline.js b/assets/lib/waline/waline.js index 05ec5fe56..28c384f75 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.4.0/dist/waline.umd.js + * Original file: /npm/@waline/client@3.4.1/dist/waline.umd.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ @@ -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 br(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 h=a.apply(s,u);return h===!1&&(h=c.apply(s,u)),h||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new vr(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 h=a.apply(s,u);return h===!1&&(h=c.apply(s,u)),h}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new Tn;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];Tn.passThroughHooks.has(l)?s[o]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(d=>c.call(s,d));const h=a.call(s,u);return c.call(s,h)}:s[o]=(...u)=>{let h=a.apply(s,u);return h===!1&&(h=c.apply(s,u)),h}}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 Je.lex(t,n??this.defaults)}parser(t,n){return Ye.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?Je.lex:Je.lexInline,c=l.hooks?l.hooks.provideParser():t?Ye.parse:Ye.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 h=c(u,l);return l.hooks&&(h=l.hooks.postprocess(h)),h}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:

"+it(r.message+"",!0)+"
";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}}const Pt=new Nl;function ge(e,t){return Pt.parse(e,t)}ge.options=ge.setOptions=function(e){return Pt.setOptions(e),ge.defaults=Pt.defaults,Tl(ge.defaults),ge},ge.getDefaults=pi,ge.defaults=Ot,ge.use=function(...e){return Pt.use(...e),ge.defaults=Pt.defaults,Tl(ge.defaults),ge},ge.walkTokens=function(e,t){return Pt.walkTokens(e,t)},ge.parseInline=Pt.parseInline,ge.Parser=Ye,ge.parser=Ye.parse,ge.Renderer=br,ge.TextRenderer=ki,ge.Lexer=Je,ge.lexer=Je.lex,ge.Tokenizer=vr,ge.Hooks=Tn,ge.parse=ge;function Yu(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=Bl(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Vl(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.");Vl(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const i=Bl(n),s=i?e.langPrefix+Gl(i):e.emptyLangClass,l=s?` class="${s}"`:"";return t=t.replace(/\n$/,""),`
${r?t:Gl(t,!0)}
 
`}}}}function Bl(e){return(e||"").match(/\S*/)[0]}function Vl(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Wl=/[&<>"']/,Qu=new RegExp(Wl.source,"g"),ql=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xu=new RegExp(ql.source,"g"),ef={"&":"&","<":"<",">":">",'"':""","'":"'"},Kl=e=>ef[e];function Gl(e,t){if(t){if(Wl.test(e))return e.replace(Qu,Kl)}else if(ql.test(e))return e.replace(Xu,Kl);return e}const tf=/\$.*?\$/,nf=/^\$(.*?)\$/,rf=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,sf=e=>[{name:"blockMath",level:"block",tokenizer(t){const n=rf.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(tf);return n!==-1?n:t.length},tokenizer(t){const n=nf.exec(t);if(n!==null)return{type:"html",raw:n[0],text:e(!1,n[1])}}}],Zl=(e="",t={})=>e.replace(/:(.+?):/g,(n,r)=>t[r]?`${r}`:n),lf=(e,{emojiMap:t,highlighter:n,texRenderer:r})=>{const i=new Nl;if(i.setOptions({breaks:!0}),n&&i.use(Yu({highlight:n})),r){const s=sf(r);i.use({extensions:s})}return i.parse(Zl(e,t))},xi=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},of=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),af=e=>e.match(/[\u4E00-\u9FD5]/gu),cf=e=>{var t,n;return(((t=of(e))==null?void 0:t.reduce((r,i)=>r+(["",",","."].includes(i.trim())?0:i.trim().split(/\s+/u).length),0))??0)+(((n=af(e))==null?void 0:n.length)??0)},uf=async()=>{if(!navigator)return"";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},Jl=({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&&Ai({serverURL:jn(e),paths:Array.from(s).map(l=>Ki(xi(l)??t)),lang:r,signal:i.signal}).then(l=>{s.forEach((o,a)=>{o.innerText=l[a].toString()})}).catch(Rl),i.abort.bind(i)},Yl=({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"})]),ff=()=>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"})),hf=()=>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"})),df=()=>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"})]),pf=({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"})]),gf=()=>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"})]),mf=()=>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"})),vf=()=>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"})),bf=()=>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"})),yf=()=>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"}))),wf=()=>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"})]),kf=()=>Yt("WALINE_USER_META",{nick:"",mail:"",link:""}),xf=()=>Yt("WALINE_COMMENT_BOX_EDITOR",""),_f="WALINE_LIKE";let Ql=null;const Xl=()=>Ql??(Ql=Yt(_f,[])),Cf="WALINE_REACTION";let eo=null;const $f=()=>eo??(eo=Yt(Cf,{}));var _i={},gt={},mt={},to;function no(){if(to)return mt;to=1;var e=mt&&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{d(l.next(g))}catch(k){c(k)}}function h(g){try{d(l.throw(g))}catch(k){c(k)}}function d(g){g.done?a(g.value):o(g.value).then(u,h)}d((l=l.apply(r,i||[])).next())})},t=mt&&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(d){return function(g){return h([d,g])}}function h(d){if(l)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(s=0)),s;)try{if(l=1,o&&(a=d[0]&2?o.return:d[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,d[1])).done)return a;switch(o=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,o=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[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),h=new t.ReCaptchaInstance(s,u,grecaptcha);i.successfulLoadingConsumers.forEach(function(d){return d(h)}),i.successfulLoadingConsumers=[],l.autoHideBadge&&h.hideBadge(),i.instance=h,a(h)}).catch(function(u){i.errorLoadingRunnable.forEach(function(h){return h(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 h=document.createElement("script");h.setAttribute("recaptcha-v3-script",""),h.setAttribute("async",""),h.setAttribute("defer","");var d="https://www.google.com/recaptcha/api.js";l?o?d="https://recaptcha.net/recaptcha/enterprise.js":d="https://recaptcha.net/recaptcha/api.js":o&&(d="https://www.google.com/recaptcha/enterprise.js"),c&&(d=c),a.render&&(a.render=void 0);var g=this.buildQueryString(a);return h.src=d+"?render=explicit"+g,new Promise(function(k,v){h.addEventListener("load",u.waitForScriptToLoad(function(){k(h)},o),!1),h.onerror=function($){i.setLoadingState(n.NOT_LOADED),v($)},document.head.appendChild(h)})},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 gt.load=r.load,gt.getInstance=r.getInstance,gt}var io;function Rf(){return io||(io=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReCaptchaInstance=e.getInstance=e.load=void 0;var t=Sf();Object.defineProperty(e,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(e,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=no();Object.defineProperty(e,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(_i)),_i}var Af=Rf();const so={},Tf=e=>{const t=so[e]??(so[e]=Af.load(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:n=>t.then(r=>r.execute(n))}},Ef=e=>({execute:async t=>{const{load:n}=mu("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await n();const r=window==null?void 0:window.turnstile;return new Promise(i=>{r==null||r.ready(()=>{r==null||r.render(".wl-captcha-container",{sitekey:e,action:t,size:"compact",callback:i})})})}}),Lf="WALINE_USER";let lo=null;const yr=()=>lo??(lo=Yt(Lf,{})),If={key:0,class:"wl-reaction"},Mf=["textContent"],Of={class:"wl-reaction-list"},Pf=["onClick"],jf={class:"wl-reaction-img"},zf=["src","alt"],Ff=["textContent"],Df=["textContent"];var Hf=pn({__name:"ArticleReaction",setup(e,{expose:t}){t();const n=$f(),r=Qn("config"),i=W(-1),s=W([]),l=_e(()=>r.value.locale),o=_e(()=>r.value.reaction.length>0),a=_e(()=>{const{reaction:d,path:g}=r.value;return d.map((k,v)=>({icon:k,desc:l.value[`reaction${v}`],active:n.value[g]===v}))});let c;const u=async()=>{if(!o.value)return;const{serverURL:d,lang:g,path:k,reaction:v}=r.value,$=new AbortController;c=$.abort.bind($);const b=await xr({serverURL:d,lang:g,paths:[k],type:v.map((C,U)=>`reaction${U}`),signal:$.signal});s.value=v.map((C,U)=>b[0][`reaction${U}`])},h=async d=>{if(i.value===-1){const{serverURL:g,lang:k,path:v}=r.value,$=n.value[v];i.value=d,$!==void 0&&(await On({serverURL:g,lang:k,path:v,type:`reaction${$}`,action:"desc"}),s.value[$]=Math.max(s.value[$]-1,0)),$!==d&&(await On({serverURL:g,lang:k,path:v,type:`reaction${d}`}),s.value[d]=(s.value[d]||0)+1),$===d?delete n.value[v]:n.value[v]=d,i.value=-1}};return mn(()=>{Ke(()=>[r.value.serverURL,r.value.path],()=>{u()},{immediate:!0})}),Yr(()=>c==null?void 0:c()),(d,g)=>a.value.length?(I(),P("div",If,[H("div",{class:"wl-reaction-title",textContent:X(l.value.reactionTitle)},null,8,Mf),H("ul",Of,[(I(!0),P(he,null,qe(a.value,({active:k,icon:v,desc:$},b)=>(I(),P("li",{key:b,class:ve(["wl-reaction-item",{active:k}]),onClick:C=>h(b)},[H("div",jf,[H("img",{src:v,alt:$},null,8,zf),i.value===b?(I(),ut(q(En),{key:0,class:"wl-reaction-loading"})):(I(),P("div",{key:1,class:"wl-reaction-votes",textContent:X(s.value[b]||0)},null,8,Ff))]),H("div",{class:"wl-reaction-text",textContent:X($)},null,8,Df)],10,Pf))),128))])])):Y("v-if",!0)}}),Ln=new Map;function Uf(e){var t=Ln.get(e);t&&t.destroy()}function Nf(e){var t=Ln.get(e);t&&t.update()}var In=null;typeof window>"u"?((In=function(e){return e}).destroy=function(e){return e},In.update=function(e){return e}):((In=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"&&!Ln.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(h){r.removeEventListener("autosize:destroy",a),r.removeEventListener("autosize:update",u),r.removeEventListener("input",o),window.removeEventListener("resize",u),Object.keys(h).forEach(function(d){return r.style[d]=h[d]}),Ln.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",Ln.set(r,{destroy:a,update:u}),u()}function c(h){var d,g,k=h.restoreTextAlign,v=k===void 0?null:k,$=h.testForHeightReduction,b=$===void 0||$,C=l.overflowY;if(r.scrollHeight!==0&&(l.resize==="vertical"?r.style.resize="none":l.resize==="both"&&(r.style.resize="horizontal"),b&&(d=function(T){for(var j=[];T&&T.parentNode&&T.parentNode instanceof Element;)T.parentNode.scrollTop&&j.push([T.parentNode,T.parentNode.scrollTop]),T=T.parentNode;return function(){return j.forEach(function(K){var z=K[0],G=K[1];z.style.scrollBehavior="auto",z.scrollTop=G,z.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",v&&(r.style.textAlign=v),d&&d(),s!==g&&(r.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),s=g),C!==l.overflow&&!v)){var U=l.textAlign;l.overflow==="hidden"&&(r.style.textAlign=U==="start"?"end":"start"),c({restoreTextAlign:U,testForHeightReduction:!0})}}function u(){c({testForHeightReduction:!0,restoreTextAlign:null})}}(n)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Uf),e},In.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Nf),e});var oo=In;const Bf=["data-index"],Vf=["src","title","onClick"];var Wf=pn({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:t}){const n=e;t();let r=null;const i=W(null),s=W({}),l=W([]),o=()=>{const d=Math.floor((i.value.getBoundingClientRect().width+n.gap)/(n.columnWidth+n.gap));return d>0?d:1},a=d=>new Array(d).fill(null).map(()=>[]),c=async d=>{var g;if(d>=n.items.length)return;await Kt();const k=Array.from(((g=i.value)==null?void 0:g.children)??[]).reduce((v,$)=>$.getBoundingClientRect().height{if(l.value.length===o()&&!d)return;l.value=a(o());const g=window.scrollY;await c(0),window.scrollTo({top:g})},h=d=>{s.value[d.target.src]=!0};return mn(()=>{u(!0),r=new ResizeObserver(()=>{u()}),r.observe(i.value),Ke(()=>[n.items],()=>{s.value={},u(!0)}),Ke(()=>[n.columnWidth,n.gap],()=>{u()})}),Ma(()=>r.unobserve(i.value)),(d,g)=>(I(),P("div",{ref_key:"wall",ref:i,class:"wl-gallery",style:rn({gap:`${d.gap}px`})},[(I(!0),P(he,null,qe(l.value,(k,v)=>(I(),P("div",{key:v,class:"wl-gallery-column","data-index":v,style:rn({gap:`${d.gap}px`})},[(I(!0),P(he,null,qe(k,$=>(I(),P(he,{key:$},[s.value[d.items[$].src]?Y("v-if",!0):(I(),ut(q(En),{key:0,size:36,style:{margin:"20px auto"}})),H("img",{class:"wl-gallery-item",src:d.items[$].src,title:d.items[$].title,loading:"lazy",onLoad:h,onClick:b=>d.$emit("insert",`![](${d.items[$].src})`)},null,40,Vf)],64))),128))],12,Bf))),128))],4))}});const qf={key:0,class:"wl-login-info"},Kf={class:"wl-avatar"},Gf=["title"],Zf=["title"],Jf=["src"],Yf=["title","textContent"],Qf={class:"wl-panel"},Xf=["for","textContent"],eh=["id","onUpdate:modelValue","name","type"],th=["placeholder"],nh={class:"wl-preview"},rh=["innerHTML"],ih={class:"wl-footer"},sh={class:"wl-actions"},lh={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},oh=["title"],ah=["title"],ch=["title","aria-label"],uh=["title"],fh={class:"wl-info"},hh={class:"wl-text-number"},dh={key:0},ph=["textContent"],gh=["textContent"],mh=["disabled"],vh=["placeholder"],bh={key:1,class:"wl-loading"},yh={key:0,class:"wl-tab-wrapper"},wh=["title","onClick"],kh=["src","alt"],xh={key:0,class:"wl-tabs"},_h=["onClick"],Ch=["src","alt","title"],$h=["title"];var ao=pn({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:t}){const n=e,r=t,i=Qn("config"),s=xf(),l=kf(),o=yr(),a=W({}),c=W(null),u=W(null),h=W(null),d=W(null),g=W(null),k=W(null),v=W(null),$=W({tabs:[],map:{}}),b=W(0),C=W(!1),U=W(!1),T=W(!1),j=W(""),K=W(0),z=un({loading:!0,list:[]}),G=W(0),je=W(!1),Z=W(""),ie=W(!1),be=W(!1),F=_e(()=>i.value.locale),Q=_e(()=>{var O;return!!((O=o.value)!=null&&O.token)}),ce=_e(()=>i.value.imageUploader!==!1),Ce=O=>{const A=c.value,N=A.selectionStart,pe=A.selectionEnd||0,f=A.scrollTop;s.value=A.value.substring(0,N)+O+A.value.substring(pe,A.value.length),A.focus(),A.selectionStart=N+O.length,A.selectionEnd=N+O.length,A.scrollTop=f},we=O=>{if(ie.value)return;const A=O.key;(O.ctrlKey||O.metaKey)&&A==="Enter"&&De()},ke=O=>{const A=`![${i.value.locale.uploading} ${O.name}]()`;return Ce(A),ie.value=!0,Promise.resolve().then(()=>i.value.imageUploader(O)).then(N=>{s.value=s.value.replace(A,`\r -![${O.name}](${N})`)}).catch(N=>{alert(N.message),s.value=s.value.replace(A,"")}).then(()=>{ie.value=!1})},Ie=O=>{var A;if((A=O.dataTransfer)!=null&&A.items){const N=Al(O.dataTransfer.items);N&&ce.value&&(ke(N),O.preventDefault())}},kt=O=>{if(O.clipboardData){const A=Al(O.clipboardData.items);A&&ce.value&&ke(A)}},jt=()=>{const O=u.value;O.files&&ce.value&&ke(O.files[0]).then(()=>{O.value=""})},De=async()=>{var O,A,N,pe,f,p;const{serverURL:m,lang:w,login:y,wordLimit:x,requiredMeta:E,recaptchaV3Key:R,turnstileKey:S}=i.value,_=await uf(),M={comment:Z.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:i.value.path,ua:_};if(!n.edit)if((O=o.value)!=null&&O.token)M.nick=o.value.display_name,M.mail=o.value.email,M.link=o.value.url;else{if(y==="force")return;if(E.includes("nick")&&!M.nick)return(A=a.value.nick)==null||A.focus(),alert(F.value.nickError);if(E.includes("mail")&&!M.mail||M.mail&&!zo(M.mail))return(N=a.value.mail)==null||N.focus(),alert(F.value.mailError);M.nick||(M.nick=F.value.anonymous)}if(!M.comment){(pe=c.value)==null||pe.focus();return}if(!je.value)return alert(F.value.wordHint.replace("$0",x[0].toString()).replace("$1",x[1].toString()).replace("$2",K.value.toString()));M.comment=Zl(M.comment,$.value.map),n.replyId&&n.rootId&&(M.pid=n.replyId,M.rid=n.rootId,M.at=n.replyUser),ie.value=!0;try{R&&(M.recaptchaV3=await Tf(R).execute("social")),S&&(M.turnstile=await Ef(S).execute("social"));const L={serverURL:m,lang:w,token:(f=o.value)==null?void 0:f.token,comment:M},D=await(n.edit?Xt({objectId:n.edit.objectId,...L}):Si(L));if(ie.value=!1,D.errmsg)return alert(D.errmsg);r("submit",D.data),s.value="",j.value="",await Kt(),n.replyId&&r("cancelReply"),(p=n.edit)!=null&&p.objectId&&r("cancelEdit")}catch(L){ie.value=!1,alert(L.message)}},wr=O=>{O.preventDefault();const{lang:A,serverURL:N}=i.value;Ti({serverURL:N,lang:A}).then(pe=>{o.value=pe,(pe.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(pe)),r("log")})},Ci=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},kr=O=>{O.preventDefault();const{lang:A,serverURL:N}=i.value,pe=800,f=800,p=(window.innerWidth-pe)/2,m=(window.innerHeight-f)/2,w=new URLSearchParams({lng:A,token:o.value.token}),y=window.open(`${N}/ui/profile?${w.toString()}`,"_blank",`width=${pe},height=${f},left=${p},top=${m},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);y==null||y.postMessage({type:"TOKEN",data:o.value.token},"*")},zt=O=>{var A,N,pe,f;!((A=h.value)!=null&&A.contains(O.target))&&!((N=d.value)!=null&&N.contains(O.target))&&(C.value=!1),!((pe=g.value)!=null&&pe.contains(O.target))&&!((f=k.value)!=null&&f.contains(O.target))&&(U.value=!1)},Ft=async O=>{var A;const{scrollTop:N,clientHeight:pe,scrollHeight:f}=O.target,p=(pe+N)/f,m=i.value.search,w=((A=v.value)==null?void 0:A.value)??"";p<.9||z.loading||be.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)]:be.value=!0,z.loading=!1,setTimeout(()=>{O.target.scrollTop=N},50))},Qt=ru(O=>{z.list=[],be.value=!1,Ft(O)},300);return Ke([i,K],([O,A])=>{const{wordLimit:N}=O;N?AN[1]?(G.value=N[1],je.value=!1):(G.value=N[1],je.value=!0):(G.value=0,je.value=!0)},{immediate:!0}),fr("click",zt),fr("message",({data:O})=>{!O||O.type!=="profile"||(o.value={...o.value,...O.data},[localStorage,sessionStorage].filter(A=>A.getItem("WALINE_USER")).forEach(A=>A.setItem("WALINE_USER",JSON.stringify(o))))}),Ke(U,async O=>{var A;if(!O)return;const N=i.value.search;v.value&&(v.value.value=""),z.loading=!0,z.list=await(((A=N.default)==null?void 0:A.call(N))??N.search("")),z.loading=!1}),mn(()=>{var O;(O=n.edit)!=null&&O.objectId&&(s.value=n.edit.orig),Ke(()=>s.value,A=>{const{highlighter:N,texRenderer:pe}=i.value;Z.value=A,j.value=lf(A,{emojiMap:$.value.map,highlighter:N,texRenderer:pe}),K.value=cf(A),A?oo(c.value):oo.destroy(c.value)},{immediate:!0}),Ke(()=>i.value.emoji,A=>ku(A).then(N=>{$.value=N}),{immediate:!0})}),(O,A)=>{var N,pe;return I(),P("div",{key:q(o).token,class:"wl-comment"},[q(i).login!=="disable"&&Q.value&&!((N=O.edit)!=null&&N.objectId)?(I(),P("div",qf,[H("div",Kf,[H("button",{type:"submit",class:"wl-logout-btn",title:F.value.logout,onClick:Ci},[oe(q(Yl),{size:14})],8,Gf),H("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:F.value.profile,onClick:kr},[H("img",{src:q(o).avatar,alt:"avatar"},null,8,Jf)],8,Zf)]),H("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:F.value.profile,onClick:kr,textContent:X(q(o).display_name)},null,8,Yf)])):Y("v-if",!0),H("div",Qf,[q(i).login!=="force"&&q(i).meta.length&&!Q.value?(I(),P("div",{key:0,class:ve(["wl-header",`item${q(i).meta.length}`])},[(I(!0),P(he,null,qe(q(i).meta,f=>(I(),P("div",{key:f,class:"wl-header-item"},[H("label",{for:`wl-${f}`,textContent:X(F.value[f]+(q(i).requiredMeta.includes(f)||!q(i).requiredMeta.length?"":`(${F.value.optional})`))},null,8,Xf),Jn(H("input",{id:`wl-${f}`,ref_for:!0,ref:p=>{p&&(a.value[f]=p)},"onUpdate:modelValue":p=>q(l)[f]=p,class:ve(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,eh),[[qc,q(l)[f]]])]))),128))],2)):Y("v-if",!0),Jn(H("textarea",{id:"wl-edit",ref_key:"editorRef",ref:c,"onUpdate:modelValue":A[0]||(A[0]=f=>xe(s)?s.value=f:null),class:"wl-editor",placeholder:O.replyUser?`@${O.replyUser}`:F.value.placeholder,onKeydown:we,onDrop:Ie,onPaste:kt},null,40,th),[[fi,q(s)]]),Jn(H("div",nh,[A[7]||(A[7]=H("hr",null,null,-1)),H("h4",null,X(F.value.preview)+":",1),H("div",{class:"wl-content",innerHTML:j.value},null,8,rh)],512),[[ol,T.value]]),H("div",ih,[H("div",sh,[H("a",lh,[oe(q(mf))]),Jn(H("button",{ref_key:"emojiButtonRef",ref:h,type:"button",class:ve(["wl-action",{active:C.value}]),title:F.value.emoji,onClick:A[1]||(A[1]=f=>C.value=!C.value)},[oe(q(hf))],10,oh),[[ol,$.value.tabs.length]]),q(i).search?(I(),P("button",{key:0,ref_key:"gifButtonRef",ref:g,type:"button",class:ve(["wl-action",{active:U.value}]),title:F.value.gif,onClick:A[2]||(A[2]=f=>U.value=!U.value)},[oe(q(wf))],10,ah)):Y("v-if",!0),H("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:u,class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:jt},null,544),ce.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:F.value.uploadImage,"aria-label":F.value.uploadImage},[oe(q(df))],8,ch)):Y("v-if",!0),H("button",{type:"button",class:ve(["wl-action",{active:T.value}]),title:F.value.preview,onClick:A[3]||(A[3]=f=>T.value=!T.value)},[oe(q(gf))],10,uh)]),H("div",fh,[A[9]||(A[9]=H("div",{class:"wl-captcha-container"},null,-1)),H("div",hh,[ft(X(K.value)+" ",1),q(i).wordLimit?(I(),P("span",dh,[A[8]||(A[8]=ft("  /  ")),H("span",{class:ve({illegal:!je.value}),textContent:X(G.value)},null,10,ph)])):Y("v-if",!0),ft("  "+X(F.value.word),1)]),q(i).login!=="disable"&&!Q.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:wr,textContent:X(F.value.login)},null,8,gh)):Y("v-if",!0),q(i).login!=="force"||Q.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:ie.value,onClick:De},[ie.value?(I(),ut(q(En),{key:0,size:16})):(I(),P(he,{key:1},[ft(X(F.value.submit),1)],64))],8,mh)):Y("v-if",!0)]),H("div",{ref_key:"gifPopupRef",ref:k,class:ve(["wl-gif-popup",{display:U.value}])},[H("input",{ref_key:"gifSearchInputRef",ref:v,type:"text",placeholder:F.value.gifSearchPlaceholder,onInput:A[4]||(A[4]=(...f)=>q(Qt)&&q(Qt)(...f))},null,40,vh),z.list.length?(I(),ut(Wf,{key:0,items:z.list,"column-width":200,gap:6,onInsert:A[5]||(A[5]=f=>Ce(f)),onScroll:Ft},null,8,["items"])):Y("v-if",!0),z.loading?(I(),P("div",bh,[oe(q(En),{size:30})])):Y("v-if",!0)],2),H("div",{ref_key:"emojiPopupRef",ref:d,class:ve(["wl-emoji-popup",{display:C.value}])},[(I(!0),P(he,null,qe($.value.tabs,(f,p)=>(I(),P(he,{key:f.name},[p===b.value?(I(),P("div",yh,[(I(!0),P(he,null,qe(f.items,m=>(I(),P("button",{key:m,type:"button",title:m,onClick:w=>Ce(`:${m}:`)},[C.value?(I(),P("img",{key:0,class:"wl-emoji",src:$.value.map[m],alt:m,loading:"lazy",referrerPolicy:"no-referrer"},null,8,kh)):Y("v-if",!0)],8,wh))),128))])):Y("v-if",!0)],64))),128)),$.value.tabs.length>1?(I(),P("div",xh,[(I(!0),P(he,null,qe($.value.tabs,(f,p)=>(I(),P("button",{key:f.name,type:"button",class:ve(["wl-tab",{active:b.value===p}]),onClick:m=>b.value=p},[H("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Ch)],10,_h))),128))])):Y("v-if",!0)],2)])]),O.replyId||(pe=O.edit)!=null&&pe.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:F.value.cancelReply,onClick:A[6]||(A[6]=f=>O.replyId?r("cancelReply"):r("cancelEdit"))},[oe(q(Yl),{size:24})],8,$h)):Y("v-if",!0)])}}});const Sh=["id"],Rh={class:"wl-user","aria-hidden":"true"},Ah=["src"],Th={class:"wl-card"},Eh={class:"wl-head"},Lh=["href"],Ih={key:1,class:"wl-nick"},Mh=["textContent"],Oh=["textContent"],Ph=["textContent"],jh=["textContent"],zh=["textContent"],Fh={class:"wl-comment-actions"},Dh=["title"],Hh=["title"],Uh={class:"wl-meta","aria-hidden":"true"},Nh=["data-value","textContent"],Bh={key:0,class:"wl-content"},Vh={key:0},Wh=["href"],qh=["innerHTML"],Kh={key:1,class:"wl-admin-actions"},Gh={class:"wl-comment-status"},Zh=["disabled","onClick","textContent"],Jh={key:3,class:"wl-quote"};var Yh=pn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:t}){const n=e,r=t,i=["approved","waiting","spam"],s=Qn("config"),l=Xl(),o=gu(),a=yr(),c=_e(()=>s.value.locale),u=_e(()=>{const{link:b}=n.comment;return b?Zi(b)?b:`https://${b}`:""}),h=_e(()=>l.value.includes(n.comment.objectId)),d=_e(()=>Po(new Date(n.comment.time),o.value,c.value)),g=_e(()=>a.value.type==="administrator"),k=_e(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),v=_e(()=>{var b;return n.comment.objectId===((b=n.reply)==null?void 0:b.objectId)}),$=_e(()=>{var b;return n.comment.objectId===((b=n.edit)==null?void 0:b.objectId)});return(b,C)=>{var U;const T=Pa("CommentCard",!0);return I(),P("div",{id:b.comment.objectId,class:"wl-card-item"},[H("div",Rh,[b.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:b.comment.avatar,alt:""},null,8,Ah)):Y("v-if",!0),b.comment.type?(I(),ut(q(yf),{key:1})):Y("v-if",!0)]),H("div",Th,[H("div",Eh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(b.comment.nick),9,Lh)):(I(),P("span",Ih,X(b.comment.nick),1)),b.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Mh)):Y("v-if",!0),b.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(b.comment.label)},null,8,Oh)):Y("v-if",!0),b.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,Ph)):Y("v-if",!0),typeof b.comment.level=="number"?(I(),P("span",{key:5,class:ve(`wl-badge level${b.comment.level}`),textContent:X(c.value[`level${b.comment.level}`]||`Level ${b.comment.level}`)},null,10,jh)):Y("v-if",!0),H("span",{class:"wl-time",textContent:X(d.value)},null,8,zh),H("div",Fh,[g.value||k.value?(I(),P(he,{key:0},[H("button",{type:"button",class:"wl-edit",onClick:C[0]||(C[0]=j=>r("edit",b.comment))},[oe(q(bf))]),H("button",{type:"button",class:"wl-delete",onClick:C[1]||(C[1]=j=>r("delete",b.comment))},[oe(q(ff))])],64)):Y("v-if",!0),H("button",{type:"button",class:"wl-like",title:h.value?c.value.cancelLike:c.value.like,onClick:C[2]||(C[2]=j=>r("like",b.comment))},[oe(q(pf),{active:h.value},null,8,["active"]),ft(" "+X("like"in b.comment?b.comment.like:""),1)],8,Dh),H("button",{type:"button",class:ve(["wl-reply",{active:v.value}]),title:v.value?c.value.cancelReply:c.value.reply,onClick:C[3]||(C[3]=j=>r("reply",v.value?null:b.comment))},[oe(q(vf))],10,Hh)])]),H("div",Uh,[(I(),P(he,null,qe(["addr","browser","os"],j=>(I(),P(he,null,[b.comment[j]?(I(),P("span",{key:j,class:ve(`wl-${j}`),"data-value":b.comment[j],textContent:X(b.comment[j])},null,10,Nh)):Y("v-if",!0)],64))),64))]),$.value?Y("v-if",!0):(I(),P("div",Bh,[b.comment.reply_user?(I(),P("p",Vh,[H("a",{href:"#"+b.comment.pid},"@"+X(b.comment.reply_user.nick),9,Wh),C[17]||(C[17]=H("span",null,": ",-1))])):Y("v-if",!0),H("div",{innerHTML:b.comment.comment},null,8,qh)])),g.value&&!$.value?(I(),P("div",Kh,[H("span",Gh,[(I(),P(he,null,qe(i,j=>H("button",{key:j,type:"submit",class:ve(`wl-btn wl-${j}`),disabled:b.comment.status===j,onClick:K=>r("status",{status:j,comment:b.comment}),textContent:X(c.value[j])},null,10,Zh)),64))]),g.value&&!("rid"in b.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:C[4]||(C[4]=j=>r("sticky",b.comment))},X(b.comment.sticky?c.value.unsticky:c.value.sticky),1)):Y("v-if",!0)])):Y("v-if",!0),v.value||$.value?(I(),P("div",{key:2,class:ve({"wl-reply-wrapper":v.value,"wl-edit-wrapper":$.value})},[oe(ao,{edit:b.edit,"reply-id":(U=b.reply)==null?void 0:U.objectId,"reply-user":b.comment.nick,"root-id":b.rootId,onLog:C[5]||(C[5]=j=>r("log")),onCancelReply:C[6]||(C[6]=j=>r("reply",null)),onCancelEdit:C[7]||(C[7]=j=>r("edit",null)),onSubmit:C[8]||(C[8]=j=>r("submit",j))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Y("v-if",!0),"children"in b.comment?(I(),P("div",Jh,[(I(!0),P(he,null,qe(b.comment.children,j=>(I(),ut(T,{key:j.objectId,comment:j,reply:b.reply,edit:b.edit,"root-id":b.rootId,onLog:C[9]||(C[9]=K=>r("log")),onDelete:C[10]||(C[10]=K=>r("delete",K)),onEdit:C[11]||(C[11]=K=>r("edit",K)),onLike:C[12]||(C[12]=K=>r("like",K)),onReply:C[13]||(C[13]=K=>r("reply",K)),onStatus:C[14]||(C[14]=K=>r("status",K)),onSticky:C[15]||(C[15]=K=>r("sticky",K)),onSubmit:C[16]||(C[16]=K=>r("submit",K))},null,8,["comment","reply","edit","root-id"]))),128))])):Y("v-if",!0)])],8,Sh)}}});const co="3.4.0",Qh={"data-waline":""},Xh={class:"wl-meta-head"},ed={class:"wl-count"},td=["textContent"],nd={class:"wl-sort"},rd=["onClick"],id={class:"wl-cards"},sd={key:1,class:"wl-operation"},ld=["textContent"],od={key:2,class:"wl-loading"},ad=["textContent"],cd={key:4,class:"wl-operation"},ud=["textContent"],fd={key:5,class:"wl-power"};var hd=pn({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const t=e,n={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},r=Object.keys(n),i=yr(),s=Xl(),l=W("loading"),o=W(0),a=W(1),c=W(0),u=_e(()=>Io(t)),h=W(u.value.commentSorting),d=W([]),g=W(null),k=W(null),v=_e(()=>Mo(u.value.dark)),$=_e(()=>u.value.locale);bu(v,{id:"waline-darkmode"});let b;const C=F=>{var Q;const{serverURL:ce,path:Ce,pageSize:we}=u.value,ke=new AbortController;l.value="loading",b==null||b(),$i({serverURL:ce,lang:u.value.lang,path:Ce,pageSize:we,sortBy:n[h.value],page:F,signal:ke.signal,token:(Q=i.value)==null?void 0:Q.token}).then(Ie=>{l.value="success",o.value=Ie.count,d.value.push(...Ie.data),a.value=F,c.value=Ie.totalPages}).catch(Ie=>{Ie.name!=="AbortError"&&(console.error(Ie.message),l.value="error")}),b=ke.abort.bind(ke)},U=()=>C(a.value+1),T=()=>{o.value=0,d.value=[],C(1)},j=F=>{h.value!==F&&(h.value=F,T())},K=F=>{g.value=F},z=F=>{k.value=F},G=F=>{if(k.value)k.value.comment=F.comment,k.value.orig=F.orig;else if("rid"in F){const Q=d.value.find(({objectId:ce})=>ce===F.rid);if(!Q)return;Array.isArray(Q.children)||(Q.children=[]),Q.children.push(F)}else d.value.unshift(F),o.value+=1},je=async({comment:F,status:Q})=>{var ce;if(F.status===Q)return;const{serverURL:Ce,lang:we}=u.value;await Xt({serverURL:Ce,lang:we,token:(ce=i.value)==null?void 0:ce.token,objectId:F.objectId,comment:{status:Q}}),F.status=Q},Z=async F=>{var Q;if("rid"in F)return;const{serverURL:ce,lang:Ce}=u.value;await Xt({serverURL:ce,lang:Ce,token:(Q=i.value)==null?void 0:Q.token,objectId:F.objectId,comment:{sticky:F.sticky?0:1}}),F.sticky=!F.sticky},ie=async({objectId:F})=>{var Q;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:ce,lang:Ce}=u.value;await Ri({serverURL:ce,lang:Ce,token:(Q=i.value)==null?void 0:Q.token,objectId:F}),d.value.some((we,ke)=>we.objectId===F?(d.value=d.value.filter((Ie,kt)=>kt!==ke),!0):we.children.some((Ie,kt)=>Ie.objectId===F?(d.value[ke].children=we.children.filter((jt,De)=>De!==kt),!0):!1))},be=async F=>{var Q;const{serverURL:ce,lang:Ce}=u.value,{objectId:we}=F,ke=s.value.includes(we);await Xt({serverURL:ce,lang:Ce,objectId:we,token:(Q=i.value)==null?void 0:Q.token,comment:{like:!ke}}),ke?s.value=s.value.filter(Ie=>Ie!==we):(s.value=[...s.value,we],s.value.length>50&&(s.value=s.value.slice(-50))),F.like=(F.like||0)+(ke?-1:1)};return Ua("config",u),mn(()=>{Ke(()=>[t.serverURL,t.path],()=>T(),{immediate:!0})}),Yr(()=>b==null?void 0:b()),(F,Q)=>(I(),P("div",Qh,[oe(Hf),!g.value&&!k.value?(I(),ut(ao,{key:0,onLog:T,onSubmit:G})):Y("v-if",!0),H("div",Xh,[H("div",ed,[o.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(o.value)},null,8,td)):Y("v-if",!0),ft(" "+X($.value.comment),1)]),H("ul",nd,[(I(!0),P(he,null,qe(q(r),ce=>(I(),P("li",{key:ce,class:ve([ce===h.value?"active":""]),onClick:Ce=>j(ce)},X($.value[ce]),11,rd))),128))])]),H("div",id,[(I(!0),P(he,null,qe(d.value,ce=>(I(),ut(Yh,{key:ce.objectId,"root-id":ce.objectId,comment:ce,reply:g.value,edit:k.value,onLog:T,onReply:K,onEdit:z,onSubmit:G,onStatus:je,onDelete:ie,onSticky:Z,onLike:be},null,8,["root-id","comment","reply","edit"]))),128))]),l.value==="error"?(I(),P("div",sd,[H("button",{type:"button",class:"wl-btn",onClick:T,textContent:X($.value.refresh)},null,8,ld)])):l.value==="loading"?(I(),P("div",od,[oe(q(En),{size:30})])):d.value.length?a.value{t.forEach((n,r)=>{const i=e[r].time;typeof i=="number"&&(n.innerText=i.toString())})},fo=({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=xi(c);return u!==null&&t!==u},a=c=>Ei({serverURL:jn(e),paths:c.map(u=>xi(u)??t),lang:i,signal:s.signal}).then(u=>uo(u,c)).catch(Rl);if(r){const c=l.filter(h=>!o(h)),u=l.filter(o);Li({serverURL:jn(e),path:t,lang:i}).then(h=>uo(h,c)),u.length&&a(u)}else a(l);return s.abort.bind(s)},dd=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...i})=>{const s=e?di(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=un({...i}),o=un({comment:n,pageview:r,path:t}),a=()=>{o.comment&&Jl({serverURL:l.serverURL,path:o.path,...Dt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&fo({serverURL:l.serverURL,path:o.path,...Dt(o.pageview)?{selector:o.pageview}:{}})},u=s?Jc(()=>ne(hd,{path:o.path,...l})):null;u&&u.mount(s);const h=Ws(a),d=Ws(c);return{el:s,update:({comment:g,pageview:k,path:v=window.location.pathname,...$}={})=>{Object.entries($).forEach(([b,C])=>{l[b]=C}),o.path=v,g!==void 0&&(o.comment=g),k!==void 0&&(o.pageview=k)},destroy:()=>{u==null||u.unmount(),h(),d()}}},pd=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{var i;const s=yr(),l=di(e),o=new AbortController;return Ii({serverURL:t,count:n,lang:r,signal:o.signal,token:(i=s.value)==null?void 0:i.token}).then(a=>l&&a.length?(l.innerHTML=`
    ${a.map(c=>`
  • ${c.nick}:${c.comment}
  • `).join("")}
`,{comments:a,destroy:()=>{o.abort(),l.innerHTML=""}}):{comments:a,destroy:()=>o.abort()})},gd=({el:e,serverURL:t,count:n,locale:r,lang:i=navigator.language,mode:s="list"})=>{const l=di(e),o=new AbortController;return Mi({serverURL:t,pageSize:n,lang:i,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Wi(i),...typeof r=="object"?r:{}},l.innerHTML=``,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};re.RecentComments=pd,re.UserList=gd,re.addComment=Si,re.commentCount=Jl,re.defaultLocales=Pn,re.deleteComment=Ri,re.fetchCommentCount=Ai,re.getArticleCounter=xr,re.getComment=$i,re.getPageview=Ei,re.getRecentComment=Ii,re.getUserList=Mi,re.init=dd,re.login=Ti,re.pageviewCount=fo,re.updateArticleCounter=On,re.updateComment=Xt,re.updatePageview=Li,re.version=co}); +![${O.name}](${N})`)}).catch(N=>{alert(N.message),s.value=s.value.replace(A,"")}).then(()=>{ie.value=!1})},Ie=O=>{var A;if((A=O.dataTransfer)!=null&&A.items){const N=Al(O.dataTransfer.items);N&&ce.value&&(ke(N),O.preventDefault())}},kt=O=>{if(O.clipboardData){const A=Al(O.clipboardData.items);A&&ce.value&&ke(A)}},jt=()=>{const O=u.value;O.files&&ce.value&&ke(O.files[0]).then(()=>{O.value=""})},De=async()=>{var O,A,N,pe,f,p;const{serverURL:m,lang:w,login:y,wordLimit:x,requiredMeta:E,recaptchaV3Key:R,turnstileKey:S}=i.value,_=await uf(),M={comment:Z.value,nick:l.value.nick,mail:l.value.mail,link:l.value.link,url:i.value.path,ua:_};if(!n.edit)if((O=o.value)!=null&&O.token)M.nick=o.value.display_name,M.mail=o.value.email,M.link=o.value.url;else{if(y==="force")return;if(E.includes("nick")&&!M.nick)return(A=a.value.nick)==null||A.focus(),alert(F.value.nickError);if(E.includes("mail")&&!M.mail||M.mail&&!zo(M.mail))return(N=a.value.mail)==null||N.focus(),alert(F.value.mailError);M.nick||(M.nick=F.value.anonymous)}if(!M.comment){(pe=c.value)==null||pe.focus();return}if(!je.value)return alert(F.value.wordHint.replace("$0",x[0].toString()).replace("$1",x[1].toString()).replace("$2",K.value.toString()));M.comment=Zl(M.comment,$.value.map),n.replyId&&n.rootId&&(M.pid=n.replyId,M.rid=n.rootId,M.at=n.replyUser),ie.value=!0;try{R&&(M.recaptchaV3=await Tf(R).execute("social")),S&&(M.turnstile=await Ef(S).execute("social"));const L={serverURL:m,lang:w,token:(f=o.value)==null?void 0:f.token,comment:M},D=await(n.edit?Xt({objectId:n.edit.objectId,...L}):Si(L));if(ie.value=!1,D.errmsg)return alert(D.errmsg);r("submit",D.data),s.value="",j.value="",await Kt(),n.replyId&&r("cancelReply"),(p=n.edit)!=null&&p.objectId&&r("cancelEdit")}catch(L){ie.value=!1,alert(L.message)}},wr=O=>{O.preventDefault();const{lang:A,serverURL:N}=i.value;Ti({serverURL:N,lang:A}).then(pe=>{o.value=pe,(pe.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(pe)),r("log")})},Ci=()=>{o.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),r("log")},kr=O=>{O.preventDefault();const{lang:A,serverURL:N}=i.value,pe=800,f=800,p=(window.innerWidth-pe)/2,m=(window.innerHeight-f)/2,w=new URLSearchParams({lng:A,token:o.value.token}),y=window.open(`${N}/ui/profile?${w.toString()}`,"_blank",`width=${pe},height=${f},left=${p},top=${m},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);y==null||y.postMessage({type:"TOKEN",data:o.value.token},"*")},zt=O=>{var A,N,pe,f;!((A=h.value)!=null&&A.contains(O.target))&&!((N=d.value)!=null&&N.contains(O.target))&&(C.value=!1),!((pe=g.value)!=null&&pe.contains(O.target))&&!((f=k.value)!=null&&f.contains(O.target))&&(U.value=!1)},Ft=async O=>{var A;const{scrollTop:N,clientHeight:pe,scrollHeight:f}=O.target,p=(pe+N)/f,m=i.value.search,w=((A=v.value)==null?void 0:A.value)??"";p<.9||z.loading||be.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)]:be.value=!0,z.loading=!1,setTimeout(()=>{O.target.scrollTop=N},50))},Qt=ru(O=>{z.list=[],be.value=!1,Ft(O)},300);return Ke([i,K],([O,A])=>{const{wordLimit:N}=O;N?AN[1]?(G.value=N[1],je.value=!1):(G.value=N[1],je.value=!0):(G.value=0,je.value=!0)},{immediate:!0}),fr("click",zt),fr("message",({data:O})=>{!O||O.type!=="profile"||(o.value={...o.value,...O.data},[localStorage,sessionStorage].filter(A=>A.getItem("WALINE_USER")).forEach(A=>A.setItem("WALINE_USER",JSON.stringify(o))))}),Ke(U,async O=>{var A;if(!O)return;const N=i.value.search;v.value&&(v.value.value=""),z.loading=!0,z.list=await(((A=N.default)==null?void 0:A.call(N))??N.search("")),z.loading=!1}),mn(()=>{var O;(O=n.edit)!=null&&O.objectId&&(s.value=n.edit.orig),Ke(()=>s.value,A=>{const{highlighter:N,texRenderer:pe}=i.value;Z.value=A,j.value=lf(A,{emojiMap:$.value.map,highlighter:N,texRenderer:pe}),K.value=cf(A),A?oo(c.value):oo.destroy(c.value)},{immediate:!0}),Ke(()=>i.value.emoji,A=>ku(A).then(N=>{$.value=N}),{immediate:!0})}),(O,A)=>{var N,pe;return I(),P("div",{key:q(o).token,class:"wl-comment"},[q(i).login!=="disable"&&Q.value&&!((N=O.edit)!=null&&N.objectId)?(I(),P("div",qf,[H("div",Kf,[H("button",{type:"submit",class:"wl-logout-btn",title:F.value.logout,onClick:Ci},[oe(q(Yl),{size:14})],8,Gf),H("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:F.value.profile,onClick:kr},[H("img",{src:q(o).avatar,alt:"avatar"},null,8,Jf)],8,Zf)]),H("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:F.value.profile,onClick:kr,textContent:X(q(o).display_name)},null,8,Yf)])):Y("v-if",!0),H("div",Qf,[q(i).login!=="force"&&q(i).meta.length&&!Q.value?(I(),P("div",{key:0,class:ve(["wl-header",`item${q(i).meta.length}`])},[(I(!0),P(he,null,qe(q(i).meta,f=>(I(),P("div",{key:f,class:"wl-header-item"},[H("label",{for:`wl-${f}`,textContent:X(F.value[f]+(q(i).requiredMeta.includes(f)||!q(i).requiredMeta.length?"":`(${F.value.optional})`))},null,8,Xf),Jn(H("input",{id:`wl-${f}`,ref_for:!0,ref:p=>{p&&(a.value[f]=p)},"onUpdate:modelValue":p=>q(l)[f]=p,class:ve(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,eh),[[qc,q(l)[f]]])]))),128))],2)):Y("v-if",!0),Jn(H("textarea",{id:"wl-edit",ref_key:"editorRef",ref:c,"onUpdate:modelValue":A[0]||(A[0]=f=>xe(s)?s.value=f:null),class:"wl-editor",placeholder:O.replyUser?`@${O.replyUser}`:F.value.placeholder,onKeydown:we,onDrop:Ie,onPaste:kt},null,40,th),[[fi,q(s)]]),Jn(H("div",nh,[A[7]||(A[7]=H("hr",null,null,-1)),H("h4",null,X(F.value.preview)+":",1),H("div",{class:"wl-content",innerHTML:j.value},null,8,rh)],512),[[ol,T.value]]),H("div",ih,[H("div",sh,[H("a",lh,[oe(q(mf))]),Jn(H("button",{ref_key:"emojiButtonRef",ref:h,type:"button",class:ve(["wl-action",{active:C.value}]),title:F.value.emoji,onClick:A[1]||(A[1]=f=>C.value=!C.value)},[oe(q(hf))],10,oh),[[ol,$.value.tabs.length]]),q(i).search?(I(),P("button",{key:0,ref_key:"gifButtonRef",ref:g,type:"button",class:ve(["wl-action",{active:U.value}]),title:F.value.gif,onClick:A[2]||(A[2]=f=>U.value=!U.value)},[oe(q(wf))],10,ah)):Y("v-if",!0),H("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:u,class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:jt},null,544),ce.value?(I(),P("label",{key:1,for:"wl-image-upload",class:"wl-action",title:F.value.uploadImage,"aria-label":F.value.uploadImage},[oe(q(df))],8,ch)):Y("v-if",!0),H("button",{type:"button",class:ve(["wl-action",{active:T.value}]),title:F.value.preview,onClick:A[3]||(A[3]=f=>T.value=!T.value)},[oe(q(gf))],10,uh)]),H("div",fh,[A[9]||(A[9]=H("div",{class:"wl-captcha-container"},null,-1)),H("div",hh,[ft(X(K.value)+" ",1),q(i).wordLimit?(I(),P("span",dh,[A[8]||(A[8]=ft("  /  ")),H("span",{class:ve({illegal:!je.value}),textContent:X(G.value)},null,10,ph)])):Y("v-if",!0),ft("  "+X(F.value.word),1)]),q(i).login!=="disable"&&!Q.value?(I(),P("button",{key:0,type:"button",class:"wl-btn",onClick:wr,textContent:X(F.value.login)},null,8,gh)):Y("v-if",!0),q(i).login!=="force"||Q.value?(I(),P("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:ie.value,onClick:De},[ie.value?(I(),ut(q(En),{key:0,size:16})):(I(),P(he,{key:1},[ft(X(F.value.submit),1)],64))],8,mh)):Y("v-if",!0)]),H("div",{ref_key:"gifPopupRef",ref:k,class:ve(["wl-gif-popup",{display:U.value}])},[H("input",{ref_key:"gifSearchInputRef",ref:v,type:"text",placeholder:F.value.gifSearchPlaceholder,onInput:A[4]||(A[4]=(...f)=>q(Qt)&&q(Qt)(...f))},null,40,vh),z.list.length?(I(),ut(Wf,{key:0,items:z.list,"column-width":200,gap:6,onInsert:A[5]||(A[5]=f=>Ce(f)),onScroll:Ft},null,8,["items"])):Y("v-if",!0),z.loading?(I(),P("div",bh,[oe(q(En),{size:30})])):Y("v-if",!0)],2),H("div",{ref_key:"emojiPopupRef",ref:d,class:ve(["wl-emoji-popup",{display:C.value}])},[(I(!0),P(he,null,qe($.value.tabs,(f,p)=>(I(),P(he,{key:f.name},[p===b.value?(I(),P("div",yh,[(I(!0),P(he,null,qe(f.items,m=>(I(),P("button",{key:m,type:"button",title:m,onClick:w=>Ce(`:${m}:`)},[C.value?(I(),P("img",{key:0,class:"wl-emoji",src:$.value.map[m],alt:m,loading:"lazy",referrerPolicy:"no-referrer"},null,8,kh)):Y("v-if",!0)],8,wh))),128))])):Y("v-if",!0)],64))),128)),$.value.tabs.length>1?(I(),P("div",xh,[(I(!0),P(he,null,qe($.value.tabs,(f,p)=>(I(),P("button",{key:f.name,type:"button",class:ve(["wl-tab",{active:b.value===p}]),onClick:m=>b.value=p},[H("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Ch)],10,_h))),128))])):Y("v-if",!0)],2)])]),O.replyId||(pe=O.edit)!=null&&pe.objectId?(I(),P("button",{key:1,type:"button",class:"wl-close",title:F.value.cancelReply,onClick:A[6]||(A[6]=f=>O.replyId?r("cancelReply"):r("cancelEdit"))},[oe(q(Yl),{size:24})],8,$h)):Y("v-if",!0)])}}});const Sh=["id"],Rh={class:"wl-user","aria-hidden":"true"},Ah=["src"],Th={class:"wl-card"},Eh={class:"wl-head"},Lh=["href"],Ih={key:1,class:"wl-nick"},Mh=["textContent"],Oh=["textContent"],Ph=["textContent"],jh=["textContent"],zh=["textContent"],Fh={class:"wl-comment-actions"},Dh=["title"],Hh=["title"],Uh={class:"wl-meta","aria-hidden":"true"},Nh=["data-value","textContent"],Bh={key:0,class:"wl-content"},Vh={key:0},Wh=["href"],qh=["innerHTML"],Kh={key:1,class:"wl-admin-actions"},Gh={class:"wl-comment-status"},Zh=["disabled","onClick","textContent"],Jh={key:3,class:"wl-quote"};var Yh=pn({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:t}){const n=e,r=t,i=["approved","waiting","spam"],s=Qn("config"),l=Xl(),o=gu(),a=yr(),c=_e(()=>s.value.locale),u=_e(()=>{const{link:b}=n.comment;return b?Zi(b)?b:`https://${b}`:""}),h=_e(()=>l.value.includes(n.comment.objectId)),d=_e(()=>Po(new Date(n.comment.time),o.value,c.value)),g=_e(()=>a.value.type==="administrator"),k=_e(()=>n.comment.user_id&&a.value.objectId===n.comment.user_id),v=_e(()=>{var b;return n.comment.objectId===((b=n.reply)==null?void 0:b.objectId)}),$=_e(()=>{var b;return n.comment.objectId===((b=n.edit)==null?void 0:b.objectId)});return(b,C)=>{var U;const T=Pa("CommentCard",!0);return I(),P("div",{id:b.comment.objectId,class:"wl-card-item"},[H("div",Rh,[b.comment.avatar?(I(),P("img",{key:0,class:"wl-user-avatar",src:b.comment.avatar,alt:""},null,8,Ah)):Y("v-if",!0),b.comment.type?(I(),ut(q(yf),{key:1})):Y("v-if",!0)]),H("div",Th,[H("div",Eh,[u.value?(I(),P("a",{key:0,class:"wl-nick",href:u.value,target:"_blank",rel:"nofollow noopener noreferrer"},X(b.comment.nick),9,Lh)):(I(),P("span",Ih,X(b.comment.nick),1)),b.comment.type==="administrator"?(I(),P("span",{key:2,class:"wl-badge",textContent:X(c.value.admin)},null,8,Mh)):Y("v-if",!0),b.comment.label?(I(),P("span",{key:3,class:"wl-badge",textContent:X(b.comment.label)},null,8,Oh)):Y("v-if",!0),b.comment.sticky?(I(),P("span",{key:4,class:"wl-badge",textContent:X(c.value.sticky)},null,8,Ph)):Y("v-if",!0),typeof b.comment.level=="number"?(I(),P("span",{key:5,class:ve(`wl-badge level${b.comment.level}`),textContent:X(c.value[`level${b.comment.level}`]||`Level ${b.comment.level}`)},null,10,jh)):Y("v-if",!0),H("span",{class:"wl-time",textContent:X(d.value)},null,8,zh),H("div",Fh,[g.value||k.value?(I(),P(he,{key:0},[H("button",{type:"button",class:"wl-edit",onClick:C[0]||(C[0]=j=>r("edit",b.comment))},[oe(q(bf))]),H("button",{type:"button",class:"wl-delete",onClick:C[1]||(C[1]=j=>r("delete",b.comment))},[oe(q(ff))])],64)):Y("v-if",!0),H("button",{type:"button",class:"wl-like",title:h.value?c.value.cancelLike:c.value.like,onClick:C[2]||(C[2]=j=>r("like",b.comment))},[oe(q(pf),{active:h.value},null,8,["active"]),ft(" "+X("like"in b.comment?b.comment.like:""),1)],8,Dh),H("button",{type:"button",class:ve(["wl-reply",{active:v.value}]),title:v.value?c.value.cancelReply:c.value.reply,onClick:C[3]||(C[3]=j=>r("reply",v.value?null:b.comment))},[oe(q(vf))],10,Hh)])]),H("div",Uh,[(I(),P(he,null,qe(["addr","browser","os"],j=>(I(),P(he,null,[b.comment[j]?(I(),P("span",{key:j,class:ve(`wl-${j}`),"data-value":b.comment[j],textContent:X(b.comment[j])},null,10,Nh)):Y("v-if",!0)],64))),64))]),$.value?Y("v-if",!0):(I(),P("div",Bh,[b.comment.reply_user?(I(),P("p",Vh,[H("a",{href:"#"+b.comment.pid},"@"+X(b.comment.reply_user.nick),9,Wh),C[17]||(C[17]=H("span",null,": ",-1))])):Y("v-if",!0),H("div",{innerHTML:b.comment.comment},null,8,qh)])),g.value&&!$.value?(I(),P("div",Kh,[H("span",Gh,[(I(),P(he,null,qe(i,j=>H("button",{key:j,type:"submit",class:ve(`wl-btn wl-${j}`),disabled:b.comment.status===j,onClick:K=>r("status",{status:j,comment:b.comment}),textContent:X(c.value[j])},null,10,Zh)),64))]),g.value&&!("rid"in b.comment)?(I(),P("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:C[4]||(C[4]=j=>r("sticky",b.comment))},X(b.comment.sticky?c.value.unsticky:c.value.sticky),1)):Y("v-if",!0)])):Y("v-if",!0),v.value||$.value?(I(),P("div",{key:2,class:ve({"wl-reply-wrapper":v.value,"wl-edit-wrapper":$.value})},[oe(ao,{edit:b.edit,"reply-id":(U=b.reply)==null?void 0:U.objectId,"reply-user":b.comment.nick,"root-id":b.rootId,onLog:C[5]||(C[5]=j=>r("log")),onCancelReply:C[6]||(C[6]=j=>r("reply",null)),onCancelEdit:C[7]||(C[7]=j=>r("edit",null)),onSubmit:C[8]||(C[8]=j=>r("submit",j))},null,8,["edit","reply-id","reply-user","root-id"])],2)):Y("v-if",!0),"children"in b.comment?(I(),P("div",Jh,[(I(!0),P(he,null,qe(b.comment.children,j=>(I(),ut(T,{key:j.objectId,comment:j,reply:b.reply,edit:b.edit,"root-id":b.rootId,onLog:C[9]||(C[9]=K=>r("log")),onDelete:C[10]||(C[10]=K=>r("delete",K)),onEdit:C[11]||(C[11]=K=>r("edit",K)),onLike:C[12]||(C[12]=K=>r("like",K)),onReply:C[13]||(C[13]=K=>r("reply",K)),onStatus:C[14]||(C[14]=K=>r("status",K)),onSticky:C[15]||(C[15]=K=>r("sticky",K)),onSubmit:C[16]||(C[16]=K=>r("submit",K))},null,8,["comment","reply","edit","root-id"]))),128))])):Y("v-if",!0)])],8,Sh)}}});const co="3.4.1",Qh={"data-waline":""},Xh={class:"wl-meta-head"},ed={class:"wl-count"},td=["textContent"],nd={class:"wl-sort"},rd=["onClick"],id={class:"wl-cards"},sd={key:1,class:"wl-operation"},ld=["textContent"],od={key:2,class:"wl-loading"},ad=["textContent"],cd={key:4,class:"wl-operation"},ud=["textContent"],fd={key:5,class:"wl-power"};var hd=pn({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const t=e,n={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},r=Object.keys(n),i=yr(),s=Xl(),l=W("loading"),o=W(0),a=W(1),c=W(0),u=_e(()=>Io(t)),h=W(u.value.commentSorting),d=W([]),g=W(null),k=W(null),v=_e(()=>Mo(u.value.dark)),$=_e(()=>u.value.locale);bu(v,{id:"waline-darkmode"});let b;const C=F=>{var Q;const{serverURL:ce,path:Ce,pageSize:we}=u.value,ke=new AbortController;l.value="loading",b==null||b(),$i({serverURL:ce,lang:u.value.lang,path:Ce,pageSize:we,sortBy:n[h.value],page:F,signal:ke.signal,token:(Q=i.value)==null?void 0:Q.token}).then(Ie=>{l.value="success",o.value=Ie.count,d.value.push(...Ie.data),a.value=F,c.value=Ie.totalPages}).catch(Ie=>{Ie.name!=="AbortError"&&(console.error(Ie.message),l.value="error")}),b=ke.abort.bind(ke)},U=()=>C(a.value+1),T=()=>{o.value=0,d.value=[],C(1)},j=F=>{h.value!==F&&(h.value=F,T())},K=F=>{g.value=F},z=F=>{k.value=F},G=F=>{if(k.value)k.value.comment=F.comment,k.value.orig=F.orig;else if("rid"in F){const Q=d.value.find(({objectId:ce})=>ce===F.rid);if(!Q)return;Array.isArray(Q.children)||(Q.children=[]),Q.children.push(F)}else d.value.unshift(F),o.value+=1},je=async({comment:F,status:Q})=>{var ce;if(F.status===Q)return;const{serverURL:Ce,lang:we}=u.value;await Xt({serverURL:Ce,lang:we,token:(ce=i.value)==null?void 0:ce.token,objectId:F.objectId,comment:{status:Q}}),F.status=Q},Z=async F=>{var Q;if("rid"in F)return;const{serverURL:ce,lang:Ce}=u.value;await Xt({serverURL:ce,lang:Ce,token:(Q=i.value)==null?void 0:Q.token,objectId:F.objectId,comment:{sticky:F.sticky?0:1}}),F.sticky=!F.sticky},ie=async({objectId:F})=>{var Q;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:ce,lang:Ce}=u.value;await Ri({serverURL:ce,lang:Ce,token:(Q=i.value)==null?void 0:Q.token,objectId:F}),d.value.some((we,ke)=>we.objectId===F?(d.value=d.value.filter((Ie,kt)=>kt!==ke),!0):we.children.some((Ie,kt)=>Ie.objectId===F?(d.value[ke].children=we.children.filter((jt,De)=>De!==kt),!0):!1))},be=async F=>{var Q;const{serverURL:ce,lang:Ce}=u.value,{objectId:we}=F,ke=s.value.includes(we);await Xt({serverURL:ce,lang:Ce,objectId:we,token:(Q=i.value)==null?void 0:Q.token,comment:{like:!ke}}),ke?s.value=s.value.filter(Ie=>Ie!==we):(s.value=[...s.value,we],s.value.length>50&&(s.value=s.value.slice(-50))),F.like=(F.like||0)+(ke?-1:1)};return Ua("config",u),mn(()=>{Ke(()=>[t.serverURL,t.path],()=>T(),{immediate:!0})}),Yr(()=>b==null?void 0:b()),(F,Q)=>(I(),P("div",Qh,[oe(Hf),!g.value&&!k.value?(I(),ut(ao,{key:0,onLog:T,onSubmit:G})):Y("v-if",!0),H("div",Xh,[H("div",ed,[o.value?(I(),P("span",{key:0,class:"wl-num",textContent:X(o.value)},null,8,td)):Y("v-if",!0),ft(" "+X($.value.comment),1)]),H("ul",nd,[(I(!0),P(he,null,qe(q(r),ce=>(I(),P("li",{key:ce,class:ve([ce===h.value?"active":""]),onClick:Ce=>j(ce)},X($.value[ce]),11,rd))),128))])]),H("div",id,[(I(!0),P(he,null,qe(d.value,ce=>(I(),ut(Yh,{key:ce.objectId,"root-id":ce.objectId,comment:ce,reply:g.value,edit:k.value,onLog:T,onReply:K,onEdit:z,onSubmit:G,onStatus:je,onDelete:ie,onSticky:Z,onLike:be},null,8,["root-id","comment","reply","edit"]))),128))]),l.value==="error"?(I(),P("div",sd,[H("button",{type:"button",class:"wl-btn",onClick:T,textContent:X($.value.refresh)},null,8,ld)])):l.value==="loading"?(I(),P("div",od,[oe(q(En),{size:30})])):d.value.length?a.value{t.forEach((n,r)=>{const i=e[r].time;typeof i=="number"&&(n.innerText=i.toString())})},fo=({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=xi(c);return u!==null&&t!==u},a=c=>Ei({serverURL:jn(e),paths:c.map(u=>xi(u)??t),lang:i,signal:s.signal}).then(u=>uo(u,c)).catch(Rl);if(r){const c=l.filter(h=>!o(h)),u=l.filter(o);Li({serverURL:jn(e),path:t,lang:i}).then(h=>uo(h,c)),u.length&&a(u)}else a(l);return s.abort.bind(s)},dd=({el:e="#waline",path:t=window.location.pathname,comment:n=!1,pageview:r=!1,...i})=>{const s=e?di(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=un({...i}),o=un({comment:n,pageview:r,path:t}),a=()=>{o.comment&&Jl({serverURL:l.serverURL,path:o.path,...Dt(o.comment)?{selector:o.comment}:{}})},c=()=>{o.pageview&&fo({serverURL:l.serverURL,path:o.path,...Dt(o.pageview)?{selector:o.pageview}:{}})},u=s?Jc(()=>ne(hd,{path:o.path,...l})):null;u&&u.mount(s);const h=Ws(a),d=Ws(c);return{el:s,update:({comment:g,pageview:k,path:v=window.location.pathname,...$}={})=>{Object.entries($).forEach(([b,C])=>{l[b]=C}),o.path=v,g!==void 0&&(o.comment=g),k!==void 0&&(o.pageview=k)},destroy:()=>{u==null||u.unmount(),h(),d()}}},pd=({el:e,serverURL:t,count:n,lang:r=navigator.language})=>{var i;const s=yr(),l=di(e),o=new AbortController;return Ii({serverURL:t,count:n,lang:r,signal:o.signal,token:(i=s.value)==null?void 0:i.token}).then(a=>l&&a.length?(l.innerHTML=`
    ${a.map(c=>`
  • ${c.nick}:${c.comment}
  • `).join("")}
`,{comments:a,destroy:()=>{o.abort(),l.innerHTML=""}}):{comments:a,destroy:()=>o.abort()})},gd=({el:e,serverURL:t,count:n,locale:r,lang:i=navigator.language,mode:s="list"})=>{const l=di(e),o=new AbortController;return Mi({serverURL:t,pageSize:n,lang:i,signal:o.signal}).then(a=>!l||!a.length?{users:a,destroy:()=>o.abort()}:(r={...Wi(i),...typeof r=="object"?r:{}},l.innerHTML=``,{users:a,destroy:()=>{o.abort(),l.innerHTML=""}}))};re.RecentComments=pd,re.UserList=gd,re.addComment=Si,re.commentCount=Jl,re.defaultLocales=Pn,re.deleteComment=Ri,re.fetchCommentCount=Ai,re.getArticleCounter=xr,re.getComment=$i,re.getPageview=Ei,re.getRecentComment=Ii,re.getUserList=Mi,re.init=dd,re.login=Ti,re.pageviewCount=fo,re.updateArticleCounter=On,re.updateComment=Xt,re.updatePageview=Li,re.version=co}); //# sourceMappingURL=waline.umd.js.map diff --git a/dependencies.json b/dependencies.json index 713be8931..c2f58f352 100644 --- a/dependencies.json +++ b/dependencies.json @@ -17,7 +17,7 @@ }, { "name": "@waline/client", - "version": "3.4.0", + "version": "3.4.1", "files": [ { "remote": "dist/waline.css",