@waline/client
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -1,2 +0,2 @@ | ||
const h=t=>`${t.replace(/\/?$/,"/")}api/`,i=(t,e="")=>{if(typeof t=="object"&&t.errno)throw new TypeError(`${e} failed with ${t.errno}: ${t.errmsg}`);return t},g=({serverURL:t,lang:e,paths:r,signal:o})=>fetch(`${h(t)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${e}`,{signal:o}).then(n=>n.json()).then(n=>i(n,"Get comment count").data),p=t=>{try{t=decodeURI(t)}catch{}return t},m=(t="")=>t.replace(/\/$/u,""),u=t=>/^(https?:)?\/\//.test(t),d=t=>{const e=m(t);return u(e)?e:`https://${e}`},$=t=>{t.name!=="AbortError"&&console.error(t.message)},f=t=>{const{path:e}=t.dataset;return e!=null&&e.length?e:null},v=({serverURL:t,path:e=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(t),paths:Array.from(a).map(c=>p(f(c)??e)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.4.1";export{v as commentCount,w as version}; | ||
const h=t=>`${t.replace(/\/?$/,"/")}api/`,i=(t,e="")=>{if(typeof t=="object"&&t.errno)throw new TypeError(`${e} failed with ${t.errno}: ${t.errmsg}`);return t},g=({serverURL:t,lang:e,paths:r,signal:o})=>fetch(`${h(t)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${e}`,{signal:o}).then(n=>n.json()).then(n=>i(n,"Get comment count").data),p=t=>{try{t=decodeURI(t)}catch{}return t},m=(t="")=>t.replace(/\/$/u,""),u=t=>/^(https?:)?\/\//.test(t),d=t=>{const e=m(t);return u(e)?e:`https://${e}`},$=t=>{t.name!=="AbortError"&&console.error(t.message)},f=t=>{const{path:e}=t.dataset;return e!=null&&e.length?e:null},v=({serverURL:t,path:e=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(t),paths:Array.from(a).map(c=>p(f(c)??e)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.4.2";export{v as commentCount,w as version}; | ||
//# sourceMappingURL=comment.js.map |
@@ -1,12 +0,12 @@ | ||
import{h as M,defineComponent as ce,inject as we,ref as C,computed as W,onMounted as ge,watch as ae,onUnmounted as Ve,openBlock as r,createElementBlock as s,createElementVNode as m,toDisplayString as A,Fragment as B,renderList as J,normalizeClass as D,createBlock as ne,unref as w,createCommentVNode as $,onBeforeUnmount as ft,normalizeStyle as Ue,nextTick as He,reactive as yt,createVNode as O,withDirectives as he,vModelDynamic as wt,isRef as kt,vModelText as bt,vShow as Te,createTextVNode as ie,resolveComponent as Ct,provide as $t}from"vue";import{useStorage as oe,useScriptTag as It,useDebounceFn as Et,useEventListener as Fe,useNow as Lt,useStyleTag as xt}from"@vueuse/core";import{getArticleCounter as At,updateArticleCounter as Ne,updateComment as fe,addComment as Mt,login as St,deleteComment as Rt,getComment as jt}from"@waline/api";import We from"autosize";import{Marked as zt}from"marked";import{markedHighlight as _t}from"marked-highlight";import{load as Vt}from"recaptcha-v3";const Be=({size:e})=>M("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[M("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"}),M("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"})]),Ut=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Ht=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Tt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"}),M("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"})]),Ft=({active:e=!1})=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"})]),Nt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"}),M("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"})]),Wt=()=>M("svg",{width:"16",height:"16",ariaHidden:"true"},M("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"})),Bt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Pt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Dt=()=>M("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},M("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"})),ue=({size:e=100})=>M("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},M("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},M("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Ot=()=>M("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[M("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"}),M("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"})]),qt=()=>oe("WALINE_USER_META",{nick:"",mail:"",link:""}),Gt=()=>oe("WALINE_COMMENT_BOX_EDITOR",""),Kt="WALINE_LIKE";let Pe=null;const De=()=>Pe??(Pe=oe(Kt,[])),Zt="WALINE_REACTION";let Oe=null;const Xt=()=>Oe??(Oe=oe(Zt,{})),qe={},Jt=e=>{const a=qe[e]??(qe[e]=Vt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>a.then(l=>l.execute(t))}},Yt=e=>({execute:async a=>{const{load:t}=It("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const l=window==null?void 0:window.turnstile;return new Promise(n=>{l==null||l.ready(()=>{l==null||l.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:n})})})}}),Qt="WALINE_USER";let Ge=null;const ke=()=>Ge??(Ge=oe(Qt,{})),el={key:0,class:"wl-reaction"},tl=["textContent"],ll={class:"wl-reaction-list"},al=["onClick"],nl={class:"wl-reaction-img"},il=["src","alt"],ol=["textContent"],rl=["textContent"];var sl=ce({__name:"ArticleReaction",setup(e,{expose:a}){a();const t=Xt(),l=we("config"),n=C(-1),v=C([]),E=W(()=>l.value.locale),y=W(()=>l.value.reaction.length>0),z=W(()=>{const{reaction:d,path:S}=l.value;return d.map((R,k)=>({icon:R,desc:E.value[`reaction${k}`],active:t.value[S]===k}))});let b;const I=async()=>{if(!y.value)return;const{serverURL:d,lang:S,path:R,reaction:k}=l.value,g=new AbortController;b=g.abort.bind(g);const o=await At({serverURL:d,lang:S,paths:[R],type:k.map((p,F)=>`reaction${F}`),signal:g.signal});v.value=k.map((p,F)=>o[0][`reaction${F}`])},U=async d=>{if(n.value===-1){const{serverURL:S,lang:R,path:k}=l.value,g=t.value[k];n.value=d,g!==void 0&&(await Ne({serverURL:S,lang:R,path:k,type:`reaction${g}`,action:"desc"}),v.value[g]=Math.max(v.value[g]-1,0)),g!==d&&(await Ne({serverURL:S,lang:R,path:k,type:`reaction${d}`}),v.value[d]=(v.value[d]||0)+1),g===d?delete t.value[k]:t.value[k]=d,n.value=-1}};return ge(()=>{ae(()=>[l.value.serverURL,l.value.path],()=>{I()},{immediate:!0})}),Ve(()=>b==null?void 0:b()),(d,S)=>z.value.length?(r(),s("div",el,[m("div",{class:"wl-reaction-title",textContent:A(E.value.reactionTitle)},null,8,tl),m("ul",ll,[(r(!0),s(B,null,J(z.value,({active:R,icon:k,desc:g},o)=>(r(),s("li",{key:o,class:D(["wl-reaction-item",{active:R}]),onClick:p=>U(o)},[m("div",nl,[m("img",{src:k,alt:g},null,8,il),n.value===o?(r(),ne(w(ue),{key:0,class:"wl-reaction-loading"})):(r(),s("div",{key:1,class:"wl-reaction-votes",textContent:A(v.value[o]||0)},null,8,ol))]),m("div",{class:"wl-reaction-text",textContent:A(g)},null,8,rl)],10,al))),128))])])):$("v-if",!0)}});const cl=["data-index"],ul=["src","title","onClick"];var ml=ce({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const t=e;a();let l=null;const n=C(null),v=C({}),E=C([]),y=()=>{const d=Math.floor((n.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return d>0?d:1},z=d=>new Array(d).fill(null).map(()=>[]),b=async d=>{var S;if(d>=t.items.length)return;await He();const R=Array.from(((S=n.value)==null?void 0:S.children)??[]).reduce((k,g)=>g.getBoundingClientRect().height<k.getBoundingClientRect().height?g:k);E.value[Number(R.dataset.index)].push(d),await b(d+1)},I=async(d=!1)=>{if(E.value.length===y()&&!d)return;E.value=z(y());const S=window.scrollY;await b(0),window.scrollTo({top:S})},U=d=>{v.value[d.target.src]=!0};return ge(()=>{I(!0),l=new ResizeObserver(()=>{I()}),l.observe(n.value),ae(()=>[t.items],()=>{v.value={},I(!0)}),ae(()=>[t.columnWidth,t.gap],()=>{I()})}),ft(()=>l.unobserve(n.value)),(d,S)=>(r(),s("div",{ref_key:"wall",ref:n,class:"wl-gallery",style:Ue({gap:`${d.gap}px`})},[(r(!0),s(B,null,J(E.value,(R,k)=>(r(),s("div",{key:k,class:"wl-gallery-column","data-index":k,style:Ue({gap:`${d.gap}px`})},[(r(!0),s(B,null,J(R,g=>(r(),s(B,{key:g},[v.value[d.items[g].src]?$("v-if",!0):(r(),ne(w(ue),{key:0,size:36,style:{margin:"20px auto"}})),m("img",{class:"wl-gallery-item",src:d.items[g].src,title:d.items[g].title,loading:"lazy",onLoad:U,onClick:o=>d.$emit("insert",`![](${d.items[g].src})`)},null,40,ul)],64))),128))],12,cl))),128))],4))}});const vl=e=>{try{e=decodeURI(e)}catch{}return e},Ke=(e="")=>e.replace(/\/$/u,""),Ze=e=>/^(https?:)?\/\//.test(e),dl=["nick","mail","link"],Xe=e=>e.filter(a=>dl.includes(a)),Je=["//unpkg.com/@waline/emojis@1.1.0/weibo"],pl=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],gl=e=>new Promise((a,t)=>{if(e.size>128e3)return t(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>{var n;return a(((n=l.result)==null?void 0:n.toString())??"")},l.onerror=t}),hl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',fl=e=>{const a=async(t,l={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...l}).toString()}`).then(n=>n.json()).then(({data:n})=>n.map(v=>({title:v.title,src:v.images.downsized_medium.url})));return{search:t=>a("search",{q:t,offset:"0"}),default:()=>a("trending",{}),more:(t,l=0)=>a("search",{q:t,offset:l.toString()})}},yl=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,wl=/</,kl=/(?:^|\s)\/\/(.+?)$/gm,bl=/\/\*([\S\s]*?)\*\//gm,Cl=new RegExp(`(${yl.source}|${wl.source})|((?:${kl.source})|(?:${bl.source}))`,"gmi"),Ye=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],be={},$l=e=>{let a=0;return e.replace(Cl,(t,l,n)=>{if(n)return`<span style="color: slategray">${n}</span>`;if(l==="<")return"<";let v;be[l]?v=be[l]:(v=Ye[a],be[l]=v);const E=`<span style="color: #${v}">${l}</span>`;return a=++a%Ye.length,E})},Il=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],Q=e=>Object.fromEntries(e.map((a,t)=>[Il[t],a]));var El=Q(["Benutzername","Der Benutzername darf nicht weniger als 3 Bytes umfassen.","E-Mail","Bitte bestätigen Sie Ihre E-Mail-Adresse.","Webseite","Optional","Kommentieren Sie hier...","Noch keine Kommentare.","Senden","Gefällt mir","Gefällt mir nicht mehr","Antworten","Antwort abbrechen","Kommentare","Aktualisieren","Mehr laden...","Vorschau","Emoji","Ein Bild hochladen","Vor einigen Sekunden","Vor einigen Minuten","Vor einigen Stunden","Vor einigen Tagen","Gerade eben","Hochladen läuft","Anmelden","Abmelden","Admin","Angeheftet","Wörter","Bitte geben Sie Kommentare zwischen $0 und $1 Wörtern ein! Aktuelle Anzahl der Wörter: $2","Anonym","Zwerge","Hobbits","Ents","Magier","Elfen","Maïar","GIF","Nach einem GIF suchen","Profil","Genehmigt","Ausstehend","Spam","Lösen","Älteste","Neueste","Am beliebtesten","Was denken Sie?"]),Qe=Q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words! | ||
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),et=Q(["Nombre de usuario","El nombre de usuario no puede tener menos de 3 bytes.","Correo electrónico","Por favor confirma tu dirección de correo electrónico.","Sitio web","Opcional","Comenta aquí...","Sin comentarios todavía.","Enviar","Like","Anular like","Responder","Anular respuesta","Comentarios","Recargar","Cargar Más...","Previsualizar","Emoji","Subir Imagen","segundos atrás","minutos atrás","horas atrás","días atrás","justo ahora","Subiendo","Iniciar sesión","cerrar sesión","Admin","Fijado","Palabras",`Por favor escriba entre $0 y $1 palabras! | ||
El número actual de palabras: $2`,"Anónimo","Enanos","Hobbits","Ents","Magos","Elfos","Maiar","GIF","Buscar GIF","Perfil","Aprobado","Esperando","Spam","Desfijar","Más antiguos","Más recientes","Más vistos","¿Qué piensas?"]),tt=Q(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots ! | ||
Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),lt=Q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません! | ||
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),Ll=Q(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras! | ||
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),at=Q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов! | ||
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),nt=Q(["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?"]),it=Q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间! | ||
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),xl=Q(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間! | ||
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const ot="en-US",Ce={zh:it,"zh-cn":it,"zh-tw":xl,en:Qe,"en-us":Qe,fr:tt,"fr-fr":tt,jp:lt,"jp-jp":lt,"pt-br":Ll,ru:at,"ru-ru":at,vi:nt,"vi-vn":nt,de:El,es:et,"es-mx":et},Al=e=>Ce[e.toLowerCase()]||Ce[ot.toLowerCase()],rt=e=>Object.keys(Ce).includes(e.toLowerCase())?e:ot,Ml=e=>{const a=Ke(e);return Ze(a)?a:`https://${a}`},Sl=e=>Array.isArray(e)?e:e?[0,e]:!1,$e=(e,a)=>typeof e=="function"?e:e===!1?!1:a,Rl=({serverURL:e,path:a=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:l,emoji:n=Je,meta:v=["nick","mail","link"],requiredMeta:E=[],dark:y=!1,pageSize:z=10,wordLimit:b,imageUploader:I,highlighter:U,texRenderer:d,copyright:S=!0,login:R="enable",search:k,reaction:g,recaptchaV3Key:o="",turnstileKey:p="",commentSorting:F="latest",...q})=>({serverURL:Ml(e),path:vl(a),lang:rt(t),locale:{...Al(rt(t)),...typeof l=="object"?l:{}},wordLimit:Sl(b),meta:Xe(v),requiredMeta:Xe(E),imageUploader:$e(I,gl),highlighter:$e(U,$l),texRenderer:$e(d,hl),dark:y,emoji:typeof n=="boolean"?n?Je:[]:n,pageSize:z,login:R,copyright:S,search:k===!1?!1:typeof k=="object"?k:fl(t),recaptchaV3Key:o,turnstileKey:p,reaction:Array.isArray(g)?g:g===!0?pl:[],commentSorting:F,...q}),Ie=e=>typeof e=="string",Ee="{--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}",jl=e=>Ie(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ee}}`:`${e}${Ee}`:e===!0?`:root${Ee}`:"",Le=(e,a)=>{let t=e.toString();for(;t.length<a;)t="0"+t;return t},zl=e=>{const a=Le(e.getDate(),2),t=Le(e.getMonth()+1,2);return`${Le(e.getFullYear(),2)}-${t}-${a}`},_l=(e,a,t)=>{if(!e)return"";const l=Ie(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,n=a.getTime()-l.getTime(),v=Math.floor(n/(24*3600*1e3));if(v===0){const E=n%864e5,y=Math.floor(E/(3600*1e3));if(y===0){const z=E%36e5,b=Math.floor(z/(60*1e3));if(b===0){const I=z%6e4;return`${Math.round(I/1e3)} ${t.seconds}`}return`${b} ${t.minutes}`}return`${y} ${t.hours}`}return v<0?t.now:v<8?`${v} ${t.days}`:zl(l)},Vl=/^[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])?)*$/,Ul=e=>Vl.test(e),Hl=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),Tl=e=>{const a=oe("WALINE_EMOJI",{}),t=Hl(e);if(t){const l=a.value[e];if(l)return Promise.resolve(l)}return fetch(`${e}/info.json`).then(l=>l.json()).then(l=>{const n={folder:e,...l};return t&&(a.value[e]=n),n})},st=(e,a="",t="",l="")=>`${a?`${a}/`:""}${t}${e}${l?`.${l}`:""}`,Fl=e=>Promise.all(e.map(a=>Ie(a)?Tl(Ke(a)):Promise.resolve(a))).then(a=>{const t={tabs:[],map:{}};return a.forEach(l=>{const{name:n,folder:v,icon:E,prefix:y="",type:z,items:b}=l;t.tabs.push({name:n,icon:st(E,v,y,z),items:b.map(I=>{const U=`${y}${I}`;return t.map[U]=st(I,v,y,z),U})})}),t}),Nl=e=>e.type.includes("image"),ct=e=>{const a=Array.from(e).find(Nl);return a?a.getAsFile():null},Wl=/\$.*?\$/,Bl=/^\$(.*?)\$/,Pl=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Dl=e=>[{name:"blockMath",level:"block",tokenizer(a){const t=Pl.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!0,t[1])}}},{name:"inlineMath",level:"inline",start(a){const t=a.search(Wl);return t!==-1?t:a.length},tokenizer(a){const t=Bl.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!1,t[1])}}}],ut=(e="",a={})=>e.replace(/:(.+?):/g,(t,l)=>a[l]?`<img class="wl-emoji" src="${a[l]}" alt="${l}">`:t),Ol=(e,{emojiMap:a,highlighter:t,texRenderer:l})=>{const n=new zt;if(n.setOptions({breaks:!0}),t&&n.use(_t({highlight:t})),l){const v=Dl(l);n.use({extensions:v})}return n.parse(ut(e,a))},ql=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Gl=e=>e.match(/[\u4E00-\u9FD5]/gu),Kl=e=>{var a,t;return(((a=ql(e))==null?void 0:a.reduce((l,n)=>l+(["",",","."].includes(n.trim())?0:n.trim().split(/\s+/u).length),0))??0)+(((t=Gl(e))==null?void 0:t.length)??0)},Zl=async()=>{if(!navigator)return"";const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:t}=await e.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},Xl={key:0,class:"wl-login-info"},Jl={class:"wl-avatar"},Yl=["title"],Ql=["title"],ea=["src"],ta=["title","textContent"],la={class:"wl-panel"},aa=["for","textContent"],na=["id","onUpdate:modelValue","name","type"],ia=["placeholder"],oa={class:"wl-preview"},ra=["innerHTML"],sa={class:"wl-footer"},ca={class:"wl-actions"},ua={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},ma=["title"],va=["title"],da=["title","aria-label"],pa=["title"],ga={class:"wl-info"},ha={class:"wl-text-number"},fa={key:0},ya=["textContent"],wa=["textContent"],ka=["disabled"],ba=["placeholder"],Ca={key:1,class:"wl-loading"},$a={key:0,class:"wl-tab-wrapper"},Ia=["title","onClick"],Ea=["src","alt"],La={key:0,class:"wl-tabs"},xa=["onClick"],Aa=["src","alt","title"],Ma=["title"];var mt=ce({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:a}){const t=e,l=a,n=we("config"),v=Gt(),E=qt(),y=ke(),z=C({}),b=C(null),I=C(null),U=C(null),d=C(null),S=C(null),R=C(null),k=C(null),g=C({tabs:[],map:{}}),o=C(0),p=C(!1),F=C(!1),q=C(!1),L=C(""),_=C(0),H=yt({loading:!0,list:[]}),te=C(0),le=C(!1),me=C(""),Y=C(!1),re=C(!1),u=W(()=>n.value.locale),x=W(()=>{var c;return!!((c=y.value)!=null&&c.token)}),j=W(()=>n.value.imageUploader!==!1),G=c=>{const i=b.value,h=i.selectionStart,V=i.selectionEnd||0,f=i.scrollTop;v.value=i.value.substring(0,h)+c+i.value.substring(V,i.value.length),i.focus(),i.selectionStart=h+c.length,i.selectionEnd=h+c.length,i.scrollTop=f},K=c=>{if(Y.value)return;const i=c.key;(c.ctrlKey||c.metaKey)&&i==="Enter"&&ve()},Z=c=>{const i=`![${n.value.locale.uploading} ${c.name}]()`;return G(i),Y.value=!0,Promise.resolve().then(()=>n.value.imageUploader(c)).then(h=>{v.value=v.value.replace(i,`\r | ||
![${c.name}](${h})`)}).catch(h=>{alert(h.message),v.value=v.value.replace(i,"")}).then(()=>{Y.value=!1})},X=c=>{var i;if((i=c.dataTransfer)!=null&&i.items){const h=ct(c.dataTransfer.items);h&&j.value&&(Z(h),c.preventDefault())}},se=c=>{if(c.clipboardData){const i=ct(c.clipboardData.items);i&&j.value&&Z(i)}},xe=()=>{const c=I.value;c.files&&j.value&&Z(c.files[0]).then(()=>{c.value=""})},ve=async()=>{var c,i,h,V,f,P;const{serverURL:N,lang:ee,login:de,wordLimit:Re,requiredMeta:je,recaptchaV3Key:ze,turnstileKey:_e}=n.value,ht=await Zl(),T={comment:me.value,nick:E.value.nick,mail:E.value.mail,link:E.value.link,url:n.value.path,ua:ht};if(!t.edit)if((c=y.value)!=null&&c.token)T.nick=y.value.display_name,T.mail=y.value.email,T.link=y.value.url;else{if(de==="force")return;if(je.includes("nick")&&!T.nick)return(i=z.value.nick)==null||i.focus(),alert(u.value.nickError);if(je.includes("mail")&&!T.mail||T.mail&&!Ul(T.mail))return(h=z.value.mail)==null||h.focus(),alert(u.value.mailError);T.nick||(T.nick=u.value.anonymous)}if(!T.comment){(V=b.value)==null||V.focus();return}if(!le.value)return alert(u.value.wordHint.replace("$0",Re[0].toString()).replace("$1",Re[1].toString()).replace("$2",_.value.toString()));T.comment=ut(T.comment,g.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{ze&&(T.recaptchaV3=await Jt(ze).execute("social")),_e&&(T.turnstile=await Yt(_e).execute("social"));const pe={serverURL:N,lang:ee,token:(f=y.value)==null?void 0:f.token,comment:T},ye=await(t.edit?fe({objectId:t.edit.objectId,...pe}):Mt(pe));if(Y.value=!1,ye.errmsg)return alert(ye.errmsg);l("submit",ye.data),v.value="",L.value="",await He(),t.replyId&&l("cancelReply"),(P=t.edit)!=null&&P.objectId&&l("cancelEdit")}catch(pe){Y.value=!1,alert(pe.message)}},dt=c=>{c.preventDefault();const{lang:i,serverURL:h}=n.value;St({serverURL:h,lang:i}).then(V=>{y.value=V,(V.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(V)),l("log")})},pt=()=>{y.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),l("log")},Ae=c=>{c.preventDefault();const{lang:i,serverURL:h}=n.value,V=800,f=800,P=(window.innerWidth-V)/2,N=(window.innerHeight-f)/2,ee=new URLSearchParams({lng:i,token:y.value.token}),de=window.open(`${h}/ui/profile?${ee.toString()}`,"_blank",`width=${V},height=${f},left=${P},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);de==null||de.postMessage({type:"TOKEN",data:y.value.token},"*")},gt=c=>{var i,h,V,f;!((i=U.value)!=null&&i.contains(c.target))&&!((h=d.value)!=null&&h.contains(c.target))&&(p.value=!1),!((V=S.value)!=null&&V.contains(c.target))&&!((f=R.value)!=null&&f.contains(c.target))&&(F.value=!1)},Me=async c=>{var i;const{scrollTop:h,clientHeight:V,scrollHeight:f}=c.target,P=(V+h)/f,N=n.value.search,ee=((i=k.value)==null?void 0:i.value)??"";P<.9||H.loading||re.value||(H.loading=!0,(N.more&&H.list.length?await N.more(ee,H.list.length):await N.search(ee)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(ee,H.list.length):await N.search(ee)]:re.value=!0,H.loading=!1,setTimeout(()=>{c.target.scrollTop=h},50))},Se=Et(c=>{H.list=[],re.value=!1,Me(c)},300);return ae([n,_],([c,i])=>{const{wordLimit:h}=c;h?i<h[0]&&h[0]!==0?(te.value=h[0],le.value=!1):i>h[1]?(te.value=h[1],le.value=!1):(te.value=h[1],le.value=!0):(te.value=0,le.value=!0)},{immediate:!0}),Fe("click",gt),Fe("message",({data:c})=>{!c||c.type!=="profile"||(y.value={...y.value,...c.data},[localStorage,sessionStorage].filter(i=>i.getItem("WALINE_USER")).forEach(i=>i.setItem("WALINE_USER",JSON.stringify(y))))}),ae(F,async c=>{var i;if(!c)return;const h=n.value.search;k.value&&(k.value.value=""),H.loading=!0,H.list=await(((i=h.default)==null?void 0:i.call(h))??h.search("")),H.loading=!1}),ge(()=>{var c;(c=t.edit)!=null&&c.objectId&&(v.value=t.edit.orig),ae(()=>v.value,i=>{const{highlighter:h,texRenderer:V}=n.value;me.value=i,L.value=Ol(i,{emojiMap:g.value.map,highlighter:h,texRenderer:V}),_.value=Kl(i),i?We(b.value):We.destroy(b.value)},{immediate:!0}),ae(()=>n.value.emoji,i=>Fl(i).then(h=>{g.value=h}),{immediate:!0})}),(c,i)=>{var h,V;return r(),s("div",{key:w(y).token,class:"wl-comment"},[w(n).login!=="disable"&&x.value&&!((h=c.edit)!=null&&h.objectId)?(r(),s("div",Xl,[m("div",Jl,[m("button",{type:"submit",class:"wl-logout-btn",title:u.value.logout,onClick:pt},[O(w(Be),{size:14})],8,Yl),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u.value.profile,onClick:Ae},[m("img",{src:w(y).avatar,alt:"avatar"},null,8,ea)],8,Ql)]),m("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u.value.profile,onClick:Ae,textContent:A(w(y).display_name)},null,8,ta)])):$("v-if",!0),m("div",la,[w(n).login!=="force"&&w(n).meta.length&&!x.value?(r(),s("div",{key:0,class:D(["wl-header",`item${w(n).meta.length}`])},[(r(!0),s(B,null,J(w(n).meta,f=>(r(),s("div",{key:f,class:"wl-header-item"},[m("label",{for:`wl-${f}`,textContent:A(u.value[f]+(w(n).requiredMeta.includes(f)||!w(n).requiredMeta.length?"":`(${u.value.optional})`))},null,8,aa),he(m("input",{id:`wl-${f}`,ref_for:!0,ref:P=>{P&&(z.value[f]=P)},"onUpdate:modelValue":P=>w(E)[f]=P,class:D(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,na),[[wt,w(E)[f]]])]))),128))],2)):$("v-if",!0),he(m("textarea",{id:"wl-edit",ref_key:"editorRef",ref:b,"onUpdate:modelValue":i[0]||(i[0]=f=>kt(v)?v.value=f:null),class:"wl-editor",placeholder:c.replyUser?`@${c.replyUser}`:u.value.placeholder,onKeydown:K,onDrop:X,onPaste:se},null,40,ia),[[bt,w(v)]]),he(m("div",oa,[i[7]||(i[7]=m("hr",null,null,-1)),m("h4",null,A(u.value.preview)+":",1),m("div",{class:"wl-content",innerHTML:L.value},null,8,ra)],512),[[Te,q.value]]),m("div",sa,[m("div",ca,[m("a",ua,[O(w(Wt))]),he(m("button",{ref_key:"emojiButtonRef",ref:U,type:"button",class:D(["wl-action",{active:p.value}]),title:u.value.emoji,onClick:i[1]||(i[1]=f=>p.value=!p.value)},[O(w(Ht))],10,ma),[[Te,g.value.tabs.length]]),w(n).search?(r(),s("button",{key:0,ref_key:"gifButtonRef",ref:S,type:"button",class:D(["wl-action",{active:F.value}]),title:u.value.gif,onClick:i[2]||(i[2]=f=>F.value=!F.value)},[O(w(Ot))],10,va)):$("v-if",!0),m("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:I,class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:xe},null,544),j.value?(r(),s("label",{key:1,for:"wl-image-upload",class:"wl-action",title:u.value.uploadImage,"aria-label":u.value.uploadImage},[O(w(Tt))],8,da)):$("v-if",!0),m("button",{type:"button",class:D(["wl-action",{active:q.value}]),title:u.value.preview,onClick:i[3]||(i[3]=f=>q.value=!q.value)},[O(w(Nt))],10,pa)]),m("div",ga,[i[9]||(i[9]=m("div",{class:"wl-captcha-container"},null,-1)),m("div",ha,[ie(A(_.value)+" ",1),w(n).wordLimit?(r(),s("span",fa,[i[8]||(i[8]=ie(" / ")),m("span",{class:D({illegal:!le.value}),textContent:A(te.value)},null,10,ya)])):$("v-if",!0),ie(" "+A(u.value.word),1)]),w(n).login!=="disable"&&!x.value?(r(),s("button",{key:0,type:"button",class:"wl-btn",onClick:dt,textContent:A(u.value.login)},null,8,wa)):$("v-if",!0),w(n).login!=="force"||x.value?(r(),s("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:ve},[Y.value?(r(),ne(w(ue),{key:0,size:16})):(r(),s(B,{key:1},[ie(A(u.value.submit),1)],64))],8,ka)):$("v-if",!0)]),m("div",{ref_key:"gifPopupRef",ref:R,class:D(["wl-gif-popup",{display:F.value}])},[m("input",{ref_key:"gifSearchInputRef",ref:k,type:"text",placeholder:u.value.gifSearchPlaceholder,onInput:i[4]||(i[4]=(...f)=>w(Se)&&w(Se)(...f))},null,40,ba),H.list.length?(r(),ne(ml,{key:0,items:H.list,"column-width":200,gap:6,onInsert:i[5]||(i[5]=f=>G(f)),onScroll:Me},null,8,["items"])):$("v-if",!0),H.loading?(r(),s("div",Ca,[O(w(ue),{size:30})])):$("v-if",!0)],2),m("div",{ref_key:"emojiPopupRef",ref:d,class:D(["wl-emoji-popup",{display:p.value}])},[(r(!0),s(B,null,J(g.value.tabs,(f,P)=>(r(),s(B,{key:f.name},[P===o.value?(r(),s("div",$a,[(r(!0),s(B,null,J(f.items,N=>(r(),s("button",{key:N,type:"button",title:N,onClick:ee=>G(`:${N}:`)},[p.value?(r(),s("img",{key:0,class:"wl-emoji",src:g.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Ea)):$("v-if",!0)],8,Ia))),128))])):$("v-if",!0)],64))),128)),g.value.tabs.length>1?(r(),s("div",La,[(r(!0),s(B,null,J(g.value.tabs,(f,P)=>(r(),s("button",{key:f.name,type:"button",class:D(["wl-tab",{active:o.value===P}]),onClick:N=>o.value=P},[m("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Aa)],10,xa))),128))])):$("v-if",!0)],2)])]),c.replyId||(V=c.edit)!=null&&V.objectId?(r(),s("button",{key:1,type:"button",class:"wl-close",title:u.value.cancelReply,onClick:i[6]||(i[6]=f=>c.replyId?l("cancelReply"):l("cancelEdit"))},[O(w(Be),{size:24})],8,Ma)):$("v-if",!0)])}}});const Sa=["id"],Ra={class:"wl-user","aria-hidden":"true"},ja=["src"],za={class:"wl-card"},_a={class:"wl-head"},Va=["href"],Ua={key:1,class:"wl-nick"},Ha=["textContent"],Ta=["textContent"],Fa=["textContent"],Na=["textContent"],Wa=["textContent"],Ba={class:"wl-comment-actions"},Pa=["title"],Da=["title"],Oa={class:"wl-meta","aria-hidden":"true"},qa=["data-value","textContent"],Ga={key:0,class:"wl-content"},Ka={key:0},Za=["href"],Xa=["innerHTML"],Ja={key:1,class:"wl-admin-actions"},Ya={class:"wl-comment-status"},Qa=["disabled","onClick","textContent"],en={key:3,class:"wl-quote"};var tn=ce({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const t=e,l=a,n=["approved","waiting","spam"],v=we("config"),E=De(),y=Lt(),z=ke(),b=W(()=>v.value.locale),I=W(()=>{const{link:o}=t.comment;return o?Ze(o)?o:`https://${o}`:""}),U=W(()=>E.value.includes(t.comment.objectId)),d=W(()=>_l(new Date(t.comment.time),y.value,b.value)),S=W(()=>z.value.type==="administrator"),R=W(()=>t.comment.user_id&&z.value.objectId===t.comment.user_id),k=W(()=>{var o;return t.comment.objectId===((o=t.reply)==null?void 0:o.objectId)}),g=W(()=>{var o;return t.comment.objectId===((o=t.edit)==null?void 0:o.objectId)});return(o,p)=>{var F;const q=Ct("CommentCard",!0);return r(),s("div",{id:o.comment.objectId,class:"wl-card-item"},[m("div",Ra,[o.comment.avatar?(r(),s("img",{key:0,class:"wl-user-avatar",src:o.comment.avatar,alt:""},null,8,ja)):$("v-if",!0),o.comment.type?(r(),ne(w(Dt),{key:1})):$("v-if",!0)]),m("div",za,[m("div",_a,[I.value?(r(),s("a",{key:0,class:"wl-nick",href:I.value,target:"_blank",rel:"nofollow noopener noreferrer"},A(o.comment.nick),9,Va)):(r(),s("span",Ua,A(o.comment.nick),1)),o.comment.type==="administrator"?(r(),s("span",{key:2,class:"wl-badge",textContent:A(b.value.admin)},null,8,Ha)):$("v-if",!0),o.comment.label?(r(),s("span",{key:3,class:"wl-badge",textContent:A(o.comment.label)},null,8,Ta)):$("v-if",!0),o.comment.sticky?(r(),s("span",{key:4,class:"wl-badge",textContent:A(b.value.sticky)},null,8,Fa)):$("v-if",!0),typeof o.comment.level=="number"?(r(),s("span",{key:5,class:D(`wl-badge level${o.comment.level}`),textContent:A(b.value[`level${o.comment.level}`]||`Level ${o.comment.level}`)},null,10,Na)):$("v-if",!0),m("span",{class:"wl-time",textContent:A(d.value)},null,8,Wa),m("div",Ba,[S.value||R.value?(r(),s(B,{key:0},[m("button",{type:"button",class:"wl-edit",onClick:p[0]||(p[0]=L=>l("edit",o.comment))},[O(w(Pt))]),m("button",{type:"button",class:"wl-delete",onClick:p[1]||(p[1]=L=>l("delete",o.comment))},[O(w(Ut))])],64)):$("v-if",!0),m("button",{type:"button",class:"wl-like",title:U.value?b.value.cancelLike:b.value.like,onClick:p[2]||(p[2]=L=>l("like",o.comment))},[O(w(Ft),{active:U.value},null,8,["active"]),ie(" "+A("like"in o.comment?o.comment.like:""),1)],8,Pa),m("button",{type:"button",class:D(["wl-reply",{active:k.value}]),title:k.value?b.value.cancelReply:b.value.reply,onClick:p[3]||(p[3]=L=>l("reply",k.value?null:o.comment))},[O(w(Bt))],10,Da)])]),m("div",Oa,[(r(),s(B,null,J(["addr","browser","os"],L=>(r(),s(B,null,[o.comment[L]?(r(),s("span",{key:L,class:D(`wl-${L}`),"data-value":o.comment[L],textContent:A(o.comment[L])},null,10,qa)):$("v-if",!0)],64))),64))]),g.value?$("v-if",!0):(r(),s("div",Ga,[o.comment.reply_user?(r(),s("p",Ka,[m("a",{href:"#"+o.comment.pid},"@"+A(o.comment.reply_user.nick),9,Za),p[17]||(p[17]=m("span",null,": ",-1))])):$("v-if",!0),m("div",{innerHTML:o.comment.comment},null,8,Xa)])),S.value&&!g.value?(r(),s("div",Ja,[m("span",Ya,[(r(),s(B,null,J(n,L=>m("button",{key:L,type:"submit",class:D(`wl-btn wl-${L}`),disabled:o.comment.status===L,onClick:_=>l("status",{status:L,comment:o.comment}),textContent:A(b.value[L])},null,10,Qa)),64))]),S.value&&!("rid"in o.comment)?(r(),s("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:p[4]||(p[4]=L=>l("sticky",o.comment))},A(o.comment.sticky?b.value.unsticky:b.value.sticky),1)):$("v-if",!0)])):$("v-if",!0),k.value||g.value?(r(),s("div",{key:2,class:D({"wl-reply-wrapper":k.value,"wl-edit-wrapper":g.value})},[O(mt,{edit:o.edit,"reply-id":(F=o.reply)==null?void 0:F.objectId,"reply-user":o.comment.nick,"root-id":o.rootId,onLog:p[5]||(p[5]=L=>l("log")),onCancelReply:p[6]||(p[6]=L=>l("reply",null)),onCancelEdit:p[7]||(p[7]=L=>l("edit",null)),onSubmit:p[8]||(p[8]=L=>l("submit",L))},null,8,["edit","reply-id","reply-user","root-id"])],2)):$("v-if",!0),"children"in o.comment?(r(),s("div",en,[(r(!0),s(B,null,J(o.comment.children,L=>(r(),ne(q,{key:L.objectId,comment:L,reply:o.reply,edit:o.edit,"root-id":o.rootId,onLog:p[9]||(p[9]=_=>l("log")),onDelete:p[10]||(p[10]=_=>l("delete",_)),onEdit:p[11]||(p[11]=_=>l("edit",_)),onLike:p[12]||(p[12]=_=>l("like",_)),onReply:p[13]||(p[13]=_=>l("reply",_)),onStatus:p[14]||(p[14]=_=>l("status",_)),onSticky:p[15]||(p[15]=_=>l("sticky",_)),onSubmit:p[16]||(p[16]=_=>l("submit",_))},null,8,["comment","reply","edit","root-id"]))),128))])):$("v-if",!0)])],8,Sa)}}});const vt="3.4.1",ln={"data-waline":""},an={class:"wl-meta-head"},nn={class:"wl-count"},on=["textContent"],rn={class:"wl-sort"},sn=["onClick"],cn={class:"wl-cards"},un={key:1,class:"wl-operation"},mn=["textContent"],vn={key:2,class:"wl-loading"},dn=["textContent"],pn={key:4,class:"wl-operation"},gn=["textContent"],hn={key:5,class:"wl-power"};var fn=ce({__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 a=e,t={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},l=Object.keys(t),n=ke(),v=De(),E=C("loading"),y=C(0),z=C(1),b=C(0),I=W(()=>Rl(a)),U=C(I.value.commentSorting),d=C([]),S=C(null),R=C(null),k=W(()=>jl(I.value.dark)),g=W(()=>I.value.locale);xt(k,{id:"waline-darkmode"});let o;const p=u=>{var x;const{serverURL:j,path:G,pageSize:K}=I.value,Z=new AbortController;E.value="loading",o==null||o(),jt({serverURL:j,lang:I.value.lang,path:G,pageSize:K,sortBy:t[U.value],page:u,signal:Z.signal,token:(x=n.value)==null?void 0:x.token}).then(X=>{E.value="success",y.value=X.count,d.value.push(...X.data),z.value=u,b.value=X.totalPages}).catch(X=>{X.name!=="AbortError"&&(console.error(X.message),E.value="error")}),o=Z.abort.bind(Z)},F=()=>p(z.value+1),q=()=>{y.value=0,d.value=[],p(1)},L=u=>{U.value!==u&&(U.value=u,q())},_=u=>{S.value=u},H=u=>{R.value=u},te=u=>{if(R.value)R.value.comment=u.comment,R.value.orig=u.orig;else if("rid"in u){const x=d.value.find(({objectId:j})=>j===u.rid);if(!x)return;Array.isArray(x.children)||(x.children=[]),x.children.push(u)}else d.value.unshift(u),y.value+=1},le=async({comment:u,status:x})=>{var j;if(u.status===x)return;const{serverURL:G,lang:K}=I.value;await fe({serverURL:G,lang:K,token:(j=n.value)==null?void 0:j.token,objectId:u.objectId,comment:{status:x}}),u.status=x},me=async u=>{var x;if("rid"in u)return;const{serverURL:j,lang:G}=I.value;await fe({serverURL:j,lang:G,token:(x=n.value)==null?void 0:x.token,objectId:u.objectId,comment:{sticky:u.sticky?0:1}}),u.sticky=!u.sticky},Y=async({objectId:u})=>{var x;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:j,lang:G}=I.value;await Rt({serverURL:j,lang:G,token:(x=n.value)==null?void 0:x.token,objectId:u}),d.value.some((K,Z)=>K.objectId===u?(d.value=d.value.filter((X,se)=>se!==Z),!0):K.children.some((X,se)=>X.objectId===u?(d.value[Z].children=K.children.filter((xe,ve)=>ve!==se),!0):!1))},re=async u=>{var x;const{serverURL:j,lang:G}=I.value,{objectId:K}=u,Z=v.value.includes(K);await fe({serverURL:j,lang:G,objectId:K,token:(x=n.value)==null?void 0:x.token,comment:{like:!Z}}),Z?v.value=v.value.filter(X=>X!==K):(v.value=[...v.value,K],v.value.length>50&&(v.value=v.value.slice(-50))),u.like=(u.like||0)+(Z?-1:1)};return $t("config",I),ge(()=>{ae(()=>[a.serverURL,a.path],()=>q(),{immediate:!0})}),Ve(()=>o==null?void 0:o()),(u,x)=>(r(),s("div",ln,[O(sl),!S.value&&!R.value?(r(),ne(mt,{key:0,onLog:q,onSubmit:te})):$("v-if",!0),m("div",an,[m("div",nn,[y.value?(r(),s("span",{key:0,class:"wl-num",textContent:A(y.value)},null,8,on)):$("v-if",!0),ie(" "+A(g.value.comment),1)]),m("ul",rn,[(r(!0),s(B,null,J(w(l),j=>(r(),s("li",{key:j,class:D([j===U.value?"active":""]),onClick:G=>L(j)},A(g.value[j]),11,sn))),128))])]),m("div",cn,[(r(!0),s(B,null,J(d.value,j=>(r(),ne(tn,{key:j.objectId,"root-id":j.objectId,comment:j,reply:S.value,edit:R.value,onLog:q,onReply:_,onEdit:H,onSubmit:te,onStatus:le,onDelete:Y,onSticky:me,onLike:re},null,8,["root-id","comment","reply","edit"]))),128))]),E.value==="error"?(r(),s("div",un,[m("button",{type:"button",class:"wl-btn",onClick:q,textContent:A(g.value.refresh)},null,8,mn)])):E.value==="loading"?(r(),s("div",vn,[O(w(ue),{size:30})])):d.value.length?z.value<b.value?(r(),s("div",pn,[m("button",{type:"button",class:"wl-btn",onClick:F,textContent:A(g.value.more)},null,8,gn)])):$("v-if",!0):(r(),s("div",{key:3,class:"wl-empty",textContent:A(g.value.sofa)},null,8,dn)),I.value.copyright?(r(),s("div",hn,[x[0]||(x[0]=ie(" Powered by ")),x[1]||(x[1]=m("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),ie(" v"+A(w(vt)),1)])):$("v-if",!0)]))}});export{fn as Waline,vt as version}; | ||
import{h as M,defineComponent as re,inject as ye,ref as j,computed as B,onMounted as ve,watch as ee,onUnmounted as Se,openBlock as r,createElementBlock as s,createElementVNode as u,toDisplayString as L,Fragment as D,renderList as Z,normalizeClass as O,createBlock as te,unref as k,createCommentVNode as $,useTemplateRef as le,onBeforeUnmount as pt,normalizeStyle as je,nextTick as Re,reactive as gt,createVNode as K,withDirectives as de,vModelDynamic as ht,isRef as ft,vModelText as yt,vShow as ze,createTextVNode as ae,resolveComponent as wt,provide as kt}from"vue";import{useStorage as ie,useScriptTag as bt,useDebounceFn as Ct,useEventListener as Ve,useNow as $t,useStyleTag as Et}from"@vueuse/core";import{getArticleCounter as It,updateArticleCounter as Ue,updateComment as pe,addComment as Lt,login as xt,deleteComment as Mt,getComment as At}from"@waline/api";import _e from"autosize";import{Marked as St}from"marked";import{markedHighlight as jt}from"marked-highlight";import{load as Rt}from"recaptcha-v3";const He=({size:e})=>M("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[M("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"}),M("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"})]),zt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Vt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Ut=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"}),M("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"})]),_t=({active:e=!1})=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"})]),Ht=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[M("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"}),M("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"})]),Tt=()=>M("svg",{width:"16",height:"16",ariaHidden:"true"},M("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"})),Ft=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Nt=()=>M("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},M("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"})),Wt=()=>M("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},M("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"})),se=({size:e=100})=>M("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},M("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},M("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Bt=()=>M("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[M("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"}),M("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"})]),Dt=()=>ie("WALINE_USER_META",{nick:"",mail:"",link:""}),Pt=()=>ie("WALINE_COMMENT_BOX_EDITOR",""),Ot="WALINE_LIKE";let Te=null;const Fe=()=>Te??(Te=ie(Ot,[])),qt="WALINE_REACTION";let Ne=null;const Gt=()=>Ne??(Ne=ie(qt,{})),We={},Kt=e=>{const a=We[e]??(We[e]=Rt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>a.then(l=>l.execute(t))}},Zt=e=>({execute:async a=>{const{load:t}=bt("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const l=window.turnstile;return new Promise(n=>{l==null||l.ready(()=>{l.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:n})})})}}),Xt="WALINE_USER";let Be=null;const we=()=>Be??(Be=ie(Xt,{})),Yt=["nick","mail","link"],De=e=>e.filter(a=>Yt.includes(a)),Pe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Jt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],Qt=e=>new Promise((a,t)=>{if(e.size>128e3)return t(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>a(l.result),l.onerror=t}),el=e=>e?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',tl=e=>{const a=async(t,l={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...l}).toString()}`).then(n=>n.json()).then(({data:n})=>n.map(v=>({title:v.title,src:v.images.downsized_medium.url})));return{search:t=>a("search",{q:t,offset:"0"}),default:()=>a("trending",{}),more:(t,l=0)=>a("search",{q:t,offset:l.toString()})}},ll=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,al=/</,nl=/(?:^|\s)\/\/(.+?)$/gm,il=/\/\*([\S\s]*?)\*\//gm,ol=new RegExp(`(${ll.source}|${al.source})|((?:${nl.source})|(?:${il.source}))`,"gmi"),Oe=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],ke={},rl=e=>{let a=0;return e.replace(ol,(t,l,n)=>{if(n)return`<span style="color: slategray">${n}</span>`;if(l==="<")return"<";let v;ke[l]?v=ke[l]:(v=Oe[a],ke[l]=v);const A=`<span style="color: #${v}">${l}</span>`;return a=++a%Oe.length,A})},sl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],J=e=>Object.fromEntries(e.map((a,t)=>[sl[t],a]));var cl=J(["Benutzername","Der Benutzername darf nicht weniger als 3 Bytes umfassen.","E-Mail","Bitte bestätigen Sie Ihre E-Mail-Adresse.","Webseite","Optional","Kommentieren Sie hier...","Noch keine Kommentare.","Senden","Gefällt mir","Gefällt mir nicht mehr","Antworten","Antwort abbrechen","Kommentare","Aktualisieren","Mehr laden...","Vorschau","Emoji","Ein Bild hochladen","Vor einigen Sekunden","Vor einigen Minuten","Vor einigen Stunden","Vor einigen Tagen","Gerade eben","Hochladen läuft","Anmelden","Abmelden","Admin","Angeheftet","Wörter","Bitte geben Sie Kommentare zwischen $0 und $1 Wörtern ein! Aktuelle Anzahl der Wörter: $2","Anonym","Zwerge","Hobbits","Ents","Magier","Elfen","Maïar","GIF","Nach einem GIF suchen","Profil","Genehmigt","Ausstehend","Spam","Lösen","Älteste","Neueste","Am beliebtesten","Was denken Sie?"]),qe=J(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words! | ||
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),Ge=J(["Nombre de usuario","El nombre de usuario no puede tener menos de 3 bytes.","Correo electrónico","Por favor confirma tu dirección de correo electrónico.","Sitio web","Opcional","Comenta aquí...","Sin comentarios todavía.","Enviar","Like","Anular like","Responder","Anular respuesta","Comentarios","Recargar","Cargar Más...","Previsualizar","Emoji","Subir Imagen","segundos atrás","minutos atrás","horas atrás","días atrás","justo ahora","Subiendo","Iniciar sesión","cerrar sesión","Admin","Fijado","Palabras",`Por favor escriba entre $0 y $1 palabras! | ||
El número actual de palabras: $2`,"Anónimo","Enanos","Hobbits","Ents","Magos","Elfos","Maiar","GIF","Buscar GIF","Perfil","Aprobado","Esperando","Spam","Desfijar","Más antiguos","Más recientes","Más vistos","¿Qué piensas?"]),Ke=J(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots ! | ||
Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),Ze=J(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません! | ||
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),ul=J(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras! | ||
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),Xe=J(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов! | ||
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),Ye=J(["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?"]),Je=J(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间! | ||
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),ml=J(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間! | ||
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const Qe="en-US",be={zh:Je,"zh-cn":Je,"zh-tw":ml,en:qe,"en-us":qe,fr:Ke,"fr-fr":Ke,jp:Ze,"jp-jp":Ze,"pt-br":ul,ru:Xe,"ru-ru":Xe,vi:Ye,"vi-vn":Ye,de:cl,es:Ge,"es-mx":Ge},vl=e=>be[e.toLowerCase()]||be[Qe.toLowerCase()],et=e=>Object.keys(be).includes(e.toLowerCase())?e:Qe,tt={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},dl=Object.keys(tt),ge=Symbol("waline-config"),pl={key:0,class:"wl-reaction"},gl=["textContent"],hl={class:"wl-reaction-list"},fl=["onClick"],yl={class:"wl-reaction-img"},wl=["src","alt"],kl=["textContent"],bl=["textContent"];var Cl=re({__name:"ArticleReaction",setup(e,{expose:a}){a();const t=Gt(),l=ye(ge),n=j(-1),v=j([]),A=B(()=>l.value.locale),b=B(()=>l.value.reaction.length>0),E=B(()=>{const{reaction:d,path:z}=l.value;return d.map((R,w)=>({icon:R,desc:A.value[`reaction${w}`],active:t.value[z]===w}))});let C;const x=async()=>{if(!b.value)return;const{serverURL:d,lang:z,path:R,reaction:w}=l.value,g=new AbortController;C=g.abort.bind(g);const o=await It({serverURL:d,lang:z,paths:[R],type:w.map((m,W)=>`reaction${W}`),signal:g.signal});v.value=w.map((m,W)=>o[0][`reaction${W}`])},N=async d=>{if(n.value===-1){const{serverURL:z,lang:R,path:w}=l.value,g=t.value[w];n.value=d,g!==void 0&&(await Ue({serverURL:z,lang:R,path:w,type:`reaction${g}`,action:"desc"}),v.value[g]=Math.max(v.value[g]-1,0)),g!==d&&(await Ue({serverURL:z,lang:R,path:w,type:`reaction${d}`}),v.value[d]=(v.value[d]||0)+1),g===d?delete t.value[w]:t.value[w]=d,n.value=-1}};return ve(()=>{ee(()=>[l.value.serverURL,l.value.path],()=>{x()},{immediate:!0})}),Se(()=>{C()}),(d,z)=>E.value.length?(r(),s("div",pl,[u("div",{class:"wl-reaction-title",textContent:L(A.value.reactionTitle)},null,8,gl),u("ul",hl,[(r(!0),s(D,null,Z(E.value,({active:R,icon:w,desc:g},o)=>(r(),s("li",{key:o,class:O(["wl-reaction-item",{active:R}]),onClick:m=>N(o)},[u("div",yl,[u("img",{src:w,alt:g},null,8,wl),n.value===o?(r(),te(k(se),{key:0,class:"wl-reaction-loading"})):(r(),s("div",{key:1,class:"wl-reaction-votes",textContent:L(v.value[o]||0)},null,8,kl))]),u("div",{class:"wl-reaction-text",textContent:L(g)},null,8,bl)],10,fl))),128))])])):$("v-if",!0)}});const $l=["data-index"],El=["src","title","onClick"];var Il=re({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const t=e;a();let l=null;const n=le("wall"),v=j({}),A=j([]),b=()=>{const d=Math.floor((n.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return d>0?d:1},E=d=>new Array(d).fill(null).map(()=>[]),C=async d=>{var z;if(d>=t.items.length)return;await Re();const R=Array.from(((z=n.value)==null?void 0:z.children)??[]).reduce((w,g)=>g.getBoundingClientRect().height<w.getBoundingClientRect().height?g:w);A.value[Number(R.dataset.index)].push(d),await C(d+1)},x=async(d=!1)=>{if(A.value.length===b()&&!d)return;A.value=E(b());const z=window.scrollY;await C(0),window.scrollTo({top:z})},N=d=>{v.value[d.target.src]=!0};return ve(()=>{x(!0),l=new ResizeObserver(()=>{x()}),l.observe(n.value),ee(()=>[t.items],()=>{v.value={},x(!0)}),ee(()=>[t.columnWidth,t.gap],()=>{x()})}),pt(()=>{l.unobserve(n.value)}),(d,z)=>(r(),s("div",{ref_key:"wall",ref:n,class:"wl-gallery",style:je({gap:`${d.gap}px`})},[(r(!0),s(D,null,Z(A.value,(R,w)=>(r(),s("div",{key:w,class:"wl-gallery-column","data-index":w,style:je({gap:`${d.gap}px`})},[(r(!0),s(D,null,Z(R,g=>(r(),s(D,{key:g},[v.value[d.items[g].src]?$("v-if",!0):(r(),te(k(se),{key:0,size:36,style:{margin:"20px auto"}})),u("img",{class:"wl-gallery-item",src:d.items[g].src,title:d.items[g].title,loading:"lazy",onLoad:N,onClick:o=>d.$emit("insert",`![](${d.items[g].src})`)},null,40,El)],64))),128))],12,$l))),128))],4))}});const Ll=e=>{try{e=decodeURI(e)}catch{}return e},lt=(e="")=>e.replace(/\/$/u,""),at=e=>/^(https?:)?\/\//.test(e),xl=e=>{const a=lt(e);return at(a)?a:`https://${a}`},Ml=e=>Array.isArray(e)?e:e?[0,e]:!1,Ce=(e,a)=>typeof e=="function"?e:e===!1?!1:a,Al=({serverURL:e,path:a=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:l,emoji:n=Pe,meta:v=["nick","mail","link"],requiredMeta:A=[],dark:b=!1,pageSize:E=10,wordLimit:C,imageUploader:x,highlighter:N,texRenderer:d,copyright:z=!0,login:R="enable",search:w,reaction:g,recaptchaV3Key:o="",turnstileKey:m="",commentSorting:W="latest",...X})=>({serverURL:xl(e),path:Ll(a),lang:et(t),locale:{...vl(et(t)),...typeof l=="object"?l:{}},wordLimit:Ml(C),meta:De(v),requiredMeta:De(A),imageUploader:Ce(x,Qt),highlighter:Ce(N,rl),texRenderer:Ce(d,el),dark:b,emoji:typeof n=="boolean"?n?Pe:[]:n,pageSize:E,login:R,copyright:z,search:w===!1?!1:typeof w=="object"?w:tl(t),recaptchaV3Key:o,turnstileKey:m,reaction:Array.isArray(g)?g:g===!0?Jt:[],commentSorting:W,...X}),$e=e=>typeof e=="string",Ee="{--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}",Sl=e=>$e(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ee}}`:`${e}${Ee}`:e===!0?`:root${Ee}`:"",Ie=(e,a)=>{let t=e.toString();for(;t.length<a;)t="0"+t;return t},jl=e=>{const a=Ie(e.getDate(),2),t=Ie(e.getMonth()+1,2);return`${Ie(e.getFullYear(),2)}-${t}-${a}`},Rl=(e,a,t)=>{if(!e)return"";const l=$e(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,n=a.getTime()-l.getTime(),v=Math.floor(n/(24*3600*1e3));if(v===0){const A=n%864e5,b=Math.floor(A/(3600*1e3));if(b===0){const E=A%36e5,C=Math.floor(E/(60*1e3));if(C===0){const x=E%6e4;return`${Math.round(x/1e3)} ${t.seconds}`}return`${C} ${t.minutes}`}return`${b} ${t.hours}`}return v<0?t.now:v<8?`${v} ${t.days}`:jl(l)},zl=/^[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])?)*$/,Vl=e=>zl.test(e),Ul=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),_l=e=>{const a=ie("WALINE_EMOJI",{}),t=Ul(e);if(t){const l=a.value[e];if(l)return Promise.resolve(l)}return fetch(`${e}/info.json`).then(l=>l.json()).then(l=>{const n={folder:e,...l};return t&&(a.value[e]=n),n})},nt=(e,a="",t="",l="")=>`${a?`${a}/`:""}${t}${e}${l?`.${l}`:""}`,Hl=e=>Promise.all(e.map(a=>$e(a)?_l(lt(a)):Promise.resolve(a))).then(a=>{const t={tabs:[],map:{}};return a.forEach(l=>{const{name:n,folder:v,icon:A,prefix:b="",type:E,items:C}=l;t.tabs.push({name:n,icon:nt(A,v,b,E),items:C.map(x=>{const N=`${b}${x}`;return t.map[N]=nt(x,v,b,E),N})})}),t}),Tl=e=>e.type.includes("image"),it=e=>{const a=Array.from(e).find(Tl);return a?a.getAsFile():null},Fl=/\$.*?\$/,Nl=/^\$(.*?)\$/,Wl=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Bl=e=>[{name:"blockMath",level:"block",tokenizer(a){const t=Wl.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!0,t[1])}}},{name:"inlineMath",level:"inline",start(a){const t=a.search(Fl);return t!==-1?t:a.length},tokenizer(a){const t=Nl.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!1,t[1])}}}],ot=(e="",a={})=>e.replace(/:(.+?):/g,(t,l)=>a[l]?`<img class="wl-emoji" src="${a[l]}" alt="${l}">`:t),Dl=(e,{emojiMap:a,highlighter:t,texRenderer:l})=>{const n=new St;if(n.setOptions({breaks:!0}),t&&n.use(jt({highlight:t})),l){const v=Bl(l);n.use({extensions:v})}return n.parse(ot(e,a))},Pl=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Ol=e=>e.match(/[\u4E00-\u9FD5]/gu),ql=e=>{var a,t;return(((a=Pl(e))==null?void 0:a.reduce((l,n)=>l+(["",",","."].includes(n.trim())?0:n.trim().split(/\s+/u).length),0))??0)+(((t=Ol(e))==null?void 0:t.length)??0)},Gl=async()=>{const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:t}=await e.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},Kl={key:0,class:"wl-login-info"},Zl={class:"wl-avatar"},Xl=["title"],Yl=["title"],Jl=["src"],Ql=["title","textContent"],ea={class:"wl-panel"},ta=["for","textContent"],la=["id","onUpdate:modelValue","name","type"],aa=["placeholder"],na={class:"wl-preview"},ia=["innerHTML"],oa={class:"wl-footer"},ra={class:"wl-actions"},sa={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},ca=["title"],ua=["title"],ma=["title","aria-label"],va=["title"],da={class:"wl-info"},pa={class:"wl-text-number"},ga={key:0},ha=["textContent"],fa=["textContent"],ya=["disabled"],wa=["placeholder"],ka={key:1,class:"wl-loading"},ba={key:0,class:"wl-tab-wrapper"},Ca=["title","onClick"],$a=["src","alt"],Ea={key:0,class:"wl-tabs"},Ia=["onClick"],La=["src","alt","title"],xa=["title"];var rt=re({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:a}){const t=e,l=a,n=ye(ge),v=Pt(),A=Dt(),b=we(),E=j({}),C=le("textarea"),x=le("image-uploader"),N=le("emoji-button"),d=le("emoji-popup"),z=le("gif-button"),R=le("gif-popup"),w=le("gif-search"),g=j({tabs:[],map:{}}),o=j(0),m=j(!1),W=j(!1),X=j(!1),I=j(""),V=j(0),H=gt({loading:!0,list:[]}),ne=j(0),Q=j(!1),ce=j(""),p=j(!1),S=j(!1),h=B(()=>n.value.locale),T=B(()=>!!b.value.token),q=B(()=>n.value.imageUploader!==!1),G=c=>{const i=C.value,y=i.selectionStart,_=i.selectionEnd||0,f=i.scrollTop;v.value=i.value.substring(0,y)+c+i.value.substring(_,i.value.length),i.focus(),i.selectionStart=y+c.length,i.selectionEnd=y+c.length,i.scrollTop=f},oe=c=>{if(p.value)return;const i=c.key;(c.ctrlKey||c.metaKey)&&i==="Enter"&&Le()},ue=c=>{const i=`![${n.value.locale.uploading} ${c.name}]()`;return G(i),p.value=!0,Promise.resolve().then(()=>n.value.imageUploader(c)).then(y=>{v.value=v.value.replace(i,`\r | ||
![${c.name}](${y})`)}).catch(y=>{alert(y.message),v.value=v.value.replace(i,"")}).then(()=>{p.value=!1})},he=c=>{var i;if((i=c.dataTransfer)!=null&&i.items){const y=it(c.dataTransfer.items);y&&q.value&&(ue(y),c.preventDefault())}},ct=c=>{if(c.clipboardData){const i=it(c.clipboardData.items);i&&q.value&&ue(i)}},ut=()=>{const c=x.value;c.files&&q.value&&ue(c.files[0]).then(()=>{c.value=""})},Le=async()=>{var c;const{serverURL:i,lang:y,login:_,wordLimit:f,requiredMeta:P,recaptchaV3Key:F,turnstileKey:Y}=n.value,U={comment:ce.value,nick:A.value.nick,mail:A.value.mail,link:A.value.link,url:n.value.path,ua:await Gl()};if(!t.edit)if(b.value.token)U.nick=b.value.display_name,U.mail=b.value.email,U.link=b.value.url;else{if(_==="force")return;if(P.includes("nick")&&!U.nick){E.value.nick.focus(),alert(h.value.nickError);return}if(P.includes("mail")&&!U.mail||U.mail&&!Vl(U.mail)){E.value.mail.focus(),alert(h.value.mailError);return}U.nick||(U.nick=h.value.anonymous)}if(!U.comment){C.value.focus();return}if(!Q.value){alert(h.value.wordHint.replace("$0",f[0].toString()).replace("$1",f[1].toString()).replace("$2",V.value.toString()));return}U.comment=ot(U.comment,g.value.map),t.replyId&&t.rootId&&(U.pid=t.replyId,U.rid=t.rootId,U.at=t.replyUser),p.value=!0;try{F&&(U.recaptchaV3=await Kt(F).execute("social")),Y&&(U.turnstile=await Zt(Y).execute("social"));const me={serverURL:i,lang:y,token:b.value.token,comment:U},fe=await(t.edit?pe({objectId:t.edit.objectId,...me}):Lt(me));if(p.value=!1,fe.errmsg){alert(fe.errmsg);return}l("submit",fe.data),v.value="",I.value="",await Re(),t.replyId&&l("cancelReply"),(c=t.edit)!=null&&c.objectId&&l("cancelEdit")}catch(me){p.value=!1,alert(me.message)}},mt=c=>{c.preventDefault();const{lang:i,serverURL:y}=n.value;xt({serverURL:y,lang:i}).then(_=>{b.value=_,(_.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(_)),l("log")})},vt=()=>{b.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),l("log")},xe=c=>{c.preventDefault();const{lang:i,serverURL:y}=n.value,_=800,f=800,P=(window.innerWidth-_)/2,F=(window.innerHeight-f)/2,Y=new URLSearchParams({lng:i,token:b.value.token}),U=window.open(`${y}/ui/profile?${Y.toString()}`,"_blank",`width=${_},height=${f},left=${P},top=${F},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);U==null||U.postMessage({type:"TOKEN",data:b.value.token},"*")},dt=c=>{var i,y,_,f;!((i=N.value)!=null&&i.contains(c.target))&&!((y=d.value)!=null&&y.contains(c.target))&&(m.value=!1),!((_=z.value)!=null&&_.contains(c.target))&&!((f=R.value)!=null&&f.contains(c.target))&&(W.value=!1)},Me=async c=>{var i;const{scrollTop:y,clientHeight:_,scrollHeight:f}=c.target,P=(_+y)/f,F=n.value.search,Y=((i=w.value)==null?void 0:i.value)??"";P<.9||H.loading||S.value||(H.loading=!0,(F.more&&H.list.length?await F.more(Y,H.list.length):await F.search(Y)).length?H.list=[...H.list,...F.more&&H.list.length?await F.more(Y,H.list.length):await F.search(Y)]:S.value=!0,H.loading=!1,setTimeout(()=>{c.target.scrollTop=y},50))},Ae=Ct(c=>{H.list=[],S.value=!1,Me(c)},300);return ee([n,V],([c,i])=>{const{wordLimit:y}=c;y?i<y[0]&&y[0]!==0?(ne.value=y[0],Q.value=!1):i>y[1]?(ne.value=y[1],Q.value=!1):(ne.value=y[1],Q.value=!0):(ne.value=0,Q.value=!0)},{immediate:!0}),Ve("click",dt),Ve("message",({data:c})=>{!c||c.type!=="profile"||(b.value={...b.value,...c.data},[localStorage,sessionStorage].filter(i=>i.getItem("WALINE_USER")).forEach(i=>{i.setItem("WALINE_USER",JSON.stringify(b))}))}),ee(W,async c=>{var i;if(!c)return;const y=n.value.search;w.value&&(w.value.value=""),H.loading=!0,H.list=await(((i=y.default)==null?void 0:i.call(y))??y.search("")),H.loading=!1}),ve(()=>{var c;(c=t.edit)!=null&&c.objectId&&(v.value=t.edit.orig),ee(()=>v.value,i=>{const{highlighter:y,texRenderer:_}=n.value;ce.value=i,I.value=Dl(i,{emojiMap:g.value.map,highlighter:y,texRenderer:_}),V.value=ql(i),i?_e(C.value):_e.destroy(C.value)},{immediate:!0}),ee(()=>n.value.emoji,i=>Hl(i).then(y=>{g.value=y}),{immediate:!0})}),(c,i)=>{var y,_;return r(),s("div",{key:k(b).token,class:"wl-comment"},[k(n).login!=="disable"&&T.value&&!((y=c.edit)!=null&&y.objectId)?(r(),s("div",Kl,[u("div",Zl,[u("button",{type:"submit",class:"wl-logout-btn",title:h.value.logout,onClick:vt},[K(k(He),{size:14})],8,Xl),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:h.value.profile,onClick:xe},[u("img",{src:k(b).avatar,alt:"avatar"},null,8,Jl)],8,Yl)]),u("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:h.value.profile,onClick:xe,textContent:L(k(b).display_name)},null,8,Ql)])):$("v-if",!0),u("div",ea,[k(n).login!=="force"&&k(n).meta.length&&!T.value?(r(),s("div",{key:0,class:O(["wl-header",`item${k(n).meta.length}`])},[(r(!0),s(D,null,Z(k(n).meta,f=>(r(),s("div",{key:f,class:"wl-header-item"},[u("label",{for:`wl-${f}`,textContent:L(h.value[f]+(k(n).requiredMeta.includes(f)||!k(n).requiredMeta.length?"":`(${h.value.optional})`))},null,8,ta),de(u("input",{id:`wl-${f}`,ref_for:!0,ref:P=>{P&&(E.value[f]=P)},"onUpdate:modelValue":P=>k(A)[f]=P,class:O(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,la),[[ht,k(A)[f]]])]))),128))],2)):$("v-if",!0),de(u("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":i[0]||(i[0]=f=>ft(v)?v.value=f:null),class:"wl-editor",placeholder:c.replyUser?`@${c.replyUser}`:h.value.placeholder,onKeydown:oe,onDrop:he,onPaste:ct},null,40,aa),[[yt,k(v)]]),de(u("div",na,[i[7]||(i[7]=u("hr",null,null,-1)),u("h4",null,L(h.value.preview)+":",1),u("div",{class:"wl-content",innerHTML:I.value},null,8,ia)],512),[[ze,X.value]]),u("div",oa,[u("div",ra,[u("a",sa,[K(k(Tt))]),de(u("button",{ref:"emoji-button",type:"button",class:O(["wl-action",{active:m.value}]),title:h.value.emoji,onClick:i[1]||(i[1]=f=>m.value=!m.value)},[K(k(Vt))],10,ca),[[ze,g.value.tabs.length]]),k(n).search?(r(),s("button",{key:0,ref:"gif-button",type:"button",class:O(["wl-action",{active:W.value}]),title:h.value.gif,onClick:i[2]||(i[2]=f=>W.value=!W.value)},[K(k(Bt))],10,ua)):$("v-if",!0),u("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:ut},null,544),q.value?(r(),s("label",{key:1,for:"wl-image-upload",class:"wl-action",title:h.value.uploadImage,"aria-label":h.value.uploadImage},[K(k(Ut))],8,ma)):$("v-if",!0),u("button",{type:"button",class:O(["wl-action",{active:X.value}]),title:h.value.preview,onClick:i[3]||(i[3]=f=>X.value=!X.value)},[K(k(Ht))],10,va)]),u("div",da,[i[9]||(i[9]=u("div",{class:"wl-captcha-container"},null,-1)),u("div",pa,[ae(L(V.value)+" ",1),k(n).wordLimit?(r(),s("span",ga,[i[8]||(i[8]=ae(" / ")),u("span",{class:O({illegal:!Q.value}),textContent:L(ne.value)},null,10,ha)])):$("v-if",!0),ae(" "+L(h.value.word),1)]),k(n).login!=="disable"&&!T.value?(r(),s("button",{key:0,type:"button",class:"wl-btn",onClick:mt,textContent:L(h.value.login)},null,8,fa)):$("v-if",!0),k(n).login!=="force"||T.value?(r(),s("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:p.value,onClick:Le},[p.value?(r(),te(k(se),{key:0,size:16})):(r(),s(D,{key:1},[ae(L(h.value.submit),1)],64))],8,ya)):$("v-if",!0)]),u("div",{ref:"gif-popup",class:O(["wl-gif-popup",{display:W.value}])},[u("input",{ref:"gif-search",type:"text",placeholder:h.value.gifSearchPlaceholder,onInput:i[4]||(i[4]=(...f)=>k(Ae)&&k(Ae)(...f))},null,40,wa),H.list.length?(r(),te(Il,{key:0,items:H.list,"column-width":200,gap:6,onInsert:i[5]||(i[5]=f=>G(f)),onScroll:Me},null,8,["items"])):$("v-if",!0),H.loading?(r(),s("div",ka,[K(k(se),{size:30})])):$("v-if",!0)],2),u("div",{ref:"emoji-popup",class:O(["wl-emoji-popup",{display:m.value}])},[(r(!0),s(D,null,Z(g.value.tabs,(f,P)=>(r(),s(D,{key:f.name},[P===o.value?(r(),s("div",ba,[(r(!0),s(D,null,Z(f.items,F=>(r(),s("button",{key:F,type:"button",title:F,onClick:Y=>G(`:${F}:`)},[m.value?(r(),s("img",{key:0,class:"wl-emoji",src:g.value.map[F],alt:F,loading:"lazy",referrerPolicy:"no-referrer"},null,8,$a)):$("v-if",!0)],8,Ca))),128))])):$("v-if",!0)],64))),128)),g.value.tabs.length>1?(r(),s("div",Ea,[(r(!0),s(D,null,Z(g.value.tabs,(f,P)=>(r(),s("button",{key:f.name,type:"button",class:O(["wl-tab",{active:o.value===P}]),onClick:F=>o.value=P},[u("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,La)],10,Ia))),128))])):$("v-if",!0)],2)])]),c.replyId||(_=c.edit)!=null&&_.objectId?(r(),s("button",{key:1,type:"button",class:"wl-close",title:h.value.cancelReply,onClick:i[6]||(i[6]=f=>c.replyId?l("cancelReply"):l("cancelEdit"))},[K(k(He),{size:24})],8,xa)):$("v-if",!0)])}}});const Ma=["id"],Aa={class:"wl-user","aria-hidden":"true"},Sa=["src"],ja={class:"wl-card"},Ra={class:"wl-head"},za=["href"],Va={key:1,class:"wl-nick"},Ua=["textContent"],_a=["textContent"],Ha=["textContent"],Ta=["textContent"],Fa=["textContent"],Na={class:"wl-comment-actions"},Wa=["title"],Ba=["title"],Da={class:"wl-meta","aria-hidden":"true"},Pa=["data-value","textContent"],Oa={key:0,class:"wl-content"},qa={key:0},Ga=["href"],Ka=["innerHTML"],Za={key:1,class:"wl-admin-actions"},Xa={class:"wl-comment-status"},Ya=["disabled","onClick","textContent"],Ja={key:3,class:"wl-quote"};var Qa=re({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:a}){const t=e,l=a,n=["approved","waiting","spam"],v=ye(ge),A=Fe(),b=$t(),E=we(),C=B(()=>v.value.locale),x=B(()=>{const{link:o}=t.comment;return o?at(o)?o:`https://${o}`:""}),N=B(()=>A.value.includes(t.comment.objectId)),d=B(()=>Rl(new Date(t.comment.time),b.value,C.value)),z=B(()=>E.value.type==="administrator"),R=B(()=>t.comment.user_id&&E.value.objectId===t.comment.user_id),w=B(()=>{var o;return t.comment.objectId===((o=t.reply)==null?void 0:o.objectId)}),g=B(()=>{var o;return t.comment.objectId===((o=t.edit)==null?void 0:o.objectId)});return(o,m)=>{var W;const X=wt("CommentCard",!0);return r(),s("div",{id:o.comment.objectId,class:"wl-card-item"},[u("div",Aa,[o.comment.avatar?(r(),s("img",{key:0,class:"wl-user-avatar",src:o.comment.avatar,alt:""},null,8,Sa)):$("v-if",!0),o.comment.type?(r(),te(k(Wt),{key:1})):$("v-if",!0)]),u("div",ja,[u("div",Ra,[x.value?(r(),s("a",{key:0,class:"wl-nick",href:x.value,target:"_blank",rel:"nofollow noopener noreferrer"},L(o.comment.nick),9,za)):(r(),s("span",Va,L(o.comment.nick),1)),o.comment.type==="administrator"?(r(),s("span",{key:2,class:"wl-badge",textContent:L(C.value.admin)},null,8,Ua)):$("v-if",!0),o.comment.label?(r(),s("span",{key:3,class:"wl-badge",textContent:L(o.comment.label)},null,8,_a)):$("v-if",!0),o.comment.sticky?(r(),s("span",{key:4,class:"wl-badge",textContent:L(C.value.sticky)},null,8,Ha)):$("v-if",!0),typeof o.comment.level=="number"?(r(),s("span",{key:5,class:O(`wl-badge level${o.comment.level}`),textContent:L(C.value[`level${o.comment.level}`]||`Level ${o.comment.level}`)},null,10,Ta)):$("v-if",!0),u("span",{class:"wl-time",textContent:L(d.value)},null,8,Fa),u("div",Na,[z.value||R.value?(r(),s(D,{key:0},[u("button",{type:"button",class:"wl-edit",onClick:m[0]||(m[0]=I=>l("edit",o.comment))},[K(k(Nt))]),u("button",{type:"button",class:"wl-delete",onClick:m[1]||(m[1]=I=>l("delete",o.comment))},[K(k(zt))])],64)):$("v-if",!0),u("button",{type:"button",class:"wl-like",title:N.value?C.value.cancelLike:C.value.like,onClick:m[2]||(m[2]=I=>l("like",o.comment))},[K(k(_t),{active:N.value},null,8,["active"]),ae(" "+L("like"in o.comment?o.comment.like:""),1)],8,Wa),u("button",{type:"button",class:O(["wl-reply",{active:w.value}]),title:w.value?C.value.cancelReply:C.value.reply,onClick:m[3]||(m[3]=I=>l("reply",w.value?null:o.comment))},[K(k(Ft))],10,Ba)])]),u("div",Da,[(r(),s(D,null,Z(["addr","browser","os"],I=>(r(),s(D,null,[o.comment[I]?(r(),s("span",{key:I,class:O(`wl-${I}`),"data-value":o.comment[I],textContent:L(o.comment[I])},null,10,Pa)):$("v-if",!0)],64))),64))]),g.value?$("v-if",!0):(r(),s("div",Oa,["reply_user"in o.comment&&o.comment.reply_user?(r(),s("p",qa,[u("a",{href:"#"+o.comment.pid},"@"+L(o.comment.reply_user.nick),9,Ga),m[17]||(m[17]=u("span",null,": ",-1))])):$("v-if",!0),u("div",{innerHTML:o.comment.comment},null,8,Ka)])),z.value&&!g.value?(r(),s("div",Za,[u("span",Xa,[(r(),s(D,null,Z(n,I=>u("button",{key:I,type:"submit",class:O(`wl-btn wl-${I}`),disabled:o.comment.status===I,onClick:V=>l("status",{status:I,comment:o.comment}),textContent:L(C.value[I])},null,10,Ya)),64))]),z.value&&!("rid"in o.comment)?(r(),s("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:m[4]||(m[4]=I=>l("sticky",o.comment))},L(o.comment.sticky?C.value.unsticky:C.value.sticky),1)):$("v-if",!0)])):$("v-if",!0),w.value||g.value?(r(),s("div",{key:2,class:O({"wl-reply-wrapper":w.value,"wl-edit-wrapper":g.value})},[K(rt,{edit:o.edit,"reply-id":(W=o.reply)==null?void 0:W.objectId,"reply-user":o.comment.nick,"root-id":o.rootId,onLog:m[5]||(m[5]=I=>l("log")),onCancelReply:m[6]||(m[6]=I=>l("reply",null)),onCancelEdit:m[7]||(m[7]=I=>l("edit",null)),onSubmit:m[8]||(m[8]=I=>l("submit",I))},null,8,["edit","reply-id","reply-user","root-id"])],2)):$("v-if",!0),"children"in o.comment?(r(),s("div",Ja,[(r(!0),s(D,null,Z(o.comment.children,I=>(r(),te(X,{key:I.objectId,comment:I,reply:o.reply,edit:o.edit,"root-id":o.rootId,onLog:m[9]||(m[9]=V=>l("log")),onDelete:m[10]||(m[10]=V=>l("delete",V)),onEdit:m[11]||(m[11]=V=>l("edit",V)),onLike:m[12]||(m[12]=V=>l("like",V)),onReply:m[13]||(m[13]=V=>l("reply",V)),onStatus:m[14]||(m[14]=V=>l("status",V)),onSticky:m[15]||(m[15]=V=>l("sticky",V)),onSubmit:m[16]||(m[16]=V=>l("submit",V))},null,8,["comment","reply","edit","root-id"]))),128))])):$("v-if",!0)])],8,Ma)}}});const st="3.4.2",en={"data-waline":""},tn={class:"wl-meta-head"},ln={class:"wl-count"},an=["textContent"],nn={class:"wl-sort"},on=["onClick"],rn={class:"wl-cards"},sn={key:1,class:"wl-operation"},cn=["textContent"],un={key:2,class:"wl-loading"},mn=["textContent"],vn={key:4,class:"wl-operation"},dn=["textContent"],pn={key:5,class:"wl-power"};var gn=re({__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 a=e,t=we(),l=Fe(),n=j("loading"),v=j(0),A=j(1),b=j(0),E=B(()=>Al(a)),C=j(E.value.commentSorting),x=j([]),N=j(null),d=j(null),z=B(()=>Sl(E.value.dark)),R=B(()=>E.value.locale);Et(z,{id:"waline-darkmode"});let w=null;const g=p=>{const{serverURL:S,path:h,pageSize:T}=E.value,q=new AbortController;n.value="loading",w==null||w(),At({serverURL:S,lang:E.value.lang,path:h,pageSize:T,sortBy:tt[C.value],page:p,signal:q.signal,token:t.value.token}).then(G=>{n.value="success",v.value=G.count,x.value.push(...G.data),A.value=p,b.value=G.totalPages}).catch(G=>{G.name!=="AbortError"&&(console.error(G.message),n.value="error")}),w=q.abort.bind(q)},o=()=>{g(A.value+1)},m=()=>{v.value=0,x.value=[],g(1)},W=p=>{C.value!==p&&(C.value=p,m())},X=p=>{N.value=p},I=p=>{d.value=p},V=p=>{if(d.value)d.value.comment=p.comment,d.value.orig=p.orig;else if("rid"in p){const S=x.value.find(({objectId:h})=>h===p.rid);if(!S)return;Array.isArray(S.children)||(S.children=[]),S.children.push(p)}else x.value.unshift(p),v.value+=1},H=async({comment:p,status:S})=>{if(p.status===S)return;const{serverURL:h,lang:T}=E.value;await pe({serverURL:h,lang:T,token:t.value.token,objectId:p.objectId,comment:{status:S}}),p.status=S},ne=async p=>{if("rid"in p)return;const{serverURL:S,lang:h}=E.value;await pe({serverURL:S,lang:h,token:t.value.token,objectId:p.objectId,comment:{sticky:p.sticky?0:1}}),p.sticky=!p.sticky},Q=async({objectId:p})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:S,lang:h}=E.value;await Mt({serverURL:S,lang:h,token:t.value.token,objectId:p}),x.value.some((T,q)=>T.objectId===p?(x.value=x.value.filter((G,oe)=>oe!==q),!0):T.children.some((G,oe)=>G.objectId===p?(x.value[q].children=T.children.filter((ue,he)=>he!==oe),!0):!1))},ce=async p=>{const{serverURL:S,lang:h}=E.value,{objectId:T}=p,q=l.value.includes(T);await pe({serverURL:S,lang:h,objectId:T,token:t.value.token,comment:{like:!q}}),q?l.value=l.value.filter(G=>G!==T):(l.value=[...l.value,T],l.value.length>50&&(l.value=l.value.slice(-50))),p.like=Math.max(0,(p.like||0)+(q?-1:1))};return kt(ge,E),ve(()=>{ee(()=>[a.serverURL,a.path],()=>{m()},{immediate:!0})}),Se(()=>{w==null||w()}),(p,S)=>(r(),s("div",en,[K(Cl),!N.value&&!d.value?(r(),te(rt,{key:0,onLog:m,onSubmit:V})):$("v-if",!0),u("div",tn,[u("div",ln,[v.value?(r(),s("span",{key:0,class:"wl-num",textContent:L(v.value)},null,8,an)):$("v-if",!0),ae(" "+L(R.value.comment),1)]),u("ul",nn,[(r(!0),s(D,null,Z(k(dl),h=>(r(),s("li",{key:h,class:O([h===C.value?"active":""]),onClick:T=>W(h)},L(R.value[h]),11,on))),128))])]),u("div",rn,[(r(!0),s(D,null,Z(x.value,h=>(r(),te(Qa,{key:h.objectId,"root-id":h.objectId,comment:h,reply:N.value,edit:d.value,onLog:m,onReply:X,onEdit:I,onSubmit:V,onStatus:H,onDelete:Q,onSticky:ne,onLike:ce},null,8,["root-id","comment","reply","edit"]))),128))]),n.value==="error"?(r(),s("div",sn,[u("button",{type:"button",class:"wl-btn",onClick:m,textContent:L(R.value.refresh)},null,8,cn)])):n.value==="loading"?(r(),s("div",un,[K(k(se),{size:30})])):x.value.length?A.value<b.value?(r(),s("div",vn,[u("button",{type:"button",class:"wl-btn",onClick:o,textContent:L(R.value.more)},null,8,dn)])):$("v-if",!0):(r(),s("div",{key:3,class:"wl-empty",textContent:L(R.value.sofa)},null,8,mn)),E.value.copyright?(r(),s("div",pn,[S[0]||(S[0]=ae(" Powered by ")),S[1]||(S[1]=u("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),ae(" v"+L(k(st)),1)])):$("v-if",!0)]))}});export{gn as Waline,st as version}; | ||
//# sourceMappingURL=component.js.map |
@@ -1,2 +0,2 @@ | ||
const v="3.4.1",$={"Content-Type":"application/json"},h=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},f=({serverURL:e,lang:t,paths:r,type:o,signal:a})=>fetch(`${h(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${t}`,{signal:a}).then(n=>n.json()).then(n=>u(n,"Get counter").data),U=({serverURL:e,lang:t,path:r,type:o,action:a})=>fetch(`${h(e)}article?lang=${t}`,{method:"POST",headers:$,body:JSON.stringify({path:r,type:o,action:a})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),R=({serverURL:e,lang:t,paths:r,signal:o})=>f({serverURL:e,lang:t,paths:r,type:["time"],signal:o}),w=e=>U({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},y=(e,t)=>{t.forEach((r,o)=>{const a=e[o].time;typeof a=="number"&&(r.innerText=a.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:o=!0,lang:a=navigator.language})=>{const n=new AbortController,i=Array.from(document.querySelectorAll(r)),p=l=>{const s=m(l);return s!==null&&t!==s},g=l=>R({serverURL:d(e),paths:l.map(s=>m(s)??t),lang:a,signal:n.signal}).then(s=>y(s,l)).catch(j);if(o){const l=i.filter(c=>!p(c)),s=i.filter(p);w({serverURL:d(e),path:t,lang:a}).then(c=>y(c,l)),s.length&&g(s)}else g(i);return n.abort.bind(n)};export{S as pageviewCount,v as version}; | ||
const v="3.4.2",$={"Content-Type":"application/json"},h=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},f=({serverURL:e,lang:t,paths:r,type:o,signal:a})=>fetch(`${h(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${t}`,{signal:a}).then(n=>n.json()).then(n=>u(n,"Get counter").data),U=({serverURL:e,lang:t,path:r,type:o,action:a})=>fetch(`${h(e)}article?lang=${t}`,{method:"POST",headers:$,body:JSON.stringify({path:r,type:o,action:a})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),R=({serverURL:e,lang:t,paths:r,signal:o})=>f({serverURL:e,lang:t,paths:r,type:["time"],signal:o}),w=e=>U({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>{const{path:t}=e.dataset;return t!=null&&t.length?t:null},y=(e,t)=>{t.forEach((r,o)=>{const a=e[o].time;typeof a=="number"&&(r.innerText=a.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:o=!0,lang:a=navigator.language})=>{const n=new AbortController,i=Array.from(document.querySelectorAll(r)),p=l=>{const s=m(l);return s!==null&&t!==s},g=l=>R({serverURL:d(e),paths:l.map(s=>m(s)??t),lang:a,signal:n.signal}).then(s=>y(s,l)).catch(j);if(o){const l=i.filter(c=>!p(c)),s=i.filter(p);w({serverURL:d(e),path:t,lang:a}).then(c=>y(c,l)),s.length&&g(s)}else g(i);return n.abort.bind(n)};export{S as pageviewCount,v as version}; | ||
//# sourceMappingURL=pageview.js.map |
@@ -1,12 +0,12 @@ | ||
import{fetchCommentCount as Rt,getArticleCounter as xt,updateArticleCounter as Fe,updateComment as he,addComment as Mt,login as St,deleteComment as jt,getComment as Ut,updatePageview as zt,getPageview as _t,getRecentComment as Vt,getUserList as Ht}from"@waline/api";export*from"@waline/api";import{h as x,defineComponent as ue,inject as $e,ref as E,computed as P,onMounted as fe,watch as ae,onUnmounted as Ne,openBlock as s,createElementBlock as m,createElementVNode as p,toDisplayString as M,Fragment as W,renderList as J,normalizeClass as D,createBlock as ne,unref as L,createCommentVNode as I,onBeforeUnmount as Tt,normalizeStyle as Pe,nextTick as We,reactive as Le,createVNode as O,withDirectives as we,vModelDynamic as Ft,isRef as Nt,vModelText as Pt,vShow as Be,createTextVNode as ie,resolveComponent as Wt,provide as Bt,createApp as Dt,watchEffect as De}from"vue";import{useStorage as oe,useScriptTag as Ot,useDebounceFn as qt,useEventListener as Oe,useNow as Gt,useStyleTag as Kt}from"@vueuse/core";import qe from"autosize";import{Marked as Zt}from"marked";import{markedHighlight as Xt}from"marked-highlight";import{load as Jt}from"recaptcha-v3";const Yt=["nick","mail","link"],Ge=e=>e.filter(a=>Yt.includes(a)),Ke=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Qt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],el=e=>new Promise((a,t)=>{if(e.size>128e3)return t(new Error("File too large! File size limit 128KB"));const l=new FileReader;l.readAsDataURL(e),l.onload=()=>{var n;return a(((n=l.result)==null?void 0:n.toString())??"")},l.onerror=t}),tl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',ll=e=>{const a=async(t,l={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...l}).toString()}`).then(n=>n.json()).then(({data:n})=>n.map(r=>({title:r.title,src:r.images.downsized_medium.url})));return{search:t=>a("search",{q:t,offset:"0"}),default:()=>a("trending",{}),more:(t,l=0)=>a("search",{q:t,offset:l.toString()})}},al=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,nl=/</,il=/(?:^|\s)\/\/(.+?)$/gm,ol=/\/\*([\S\s]*?)\*\//gm,rl=new RegExp(`(${al.source}|${nl.source})|((?:${il.source})|(?:${ol.source}))`,"gmi"),Ze=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Ee={},sl=e=>{let a=0;return e.replace(rl,(t,l,n)=>{if(n)return`<span style="color: slategray">${n}</span>`;if(l==="<")return"<";let r;Ee[l]?r=Ee[l]:(r=Ze[a],Ee[l]=r);const f=`<span style="color: #${r}">${l}</span>`;return a=++a%Ze.length,f})},cl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],Q=e=>Object.fromEntries(e.map((a,t)=>[cl[t],a]));var ul=Q(["Benutzername","Der Benutzername darf nicht weniger als 3 Bytes umfassen.","E-Mail","Bitte bestätigen Sie Ihre E-Mail-Adresse.","Webseite","Optional","Kommentieren Sie hier...","Noch keine Kommentare.","Senden","Gefällt mir","Gefällt mir nicht mehr","Antworten","Antwort abbrechen","Kommentare","Aktualisieren","Mehr laden...","Vorschau","Emoji","Ein Bild hochladen","Vor einigen Sekunden","Vor einigen Minuten","Vor einigen Stunden","Vor einigen Tagen","Gerade eben","Hochladen läuft","Anmelden","Abmelden","Admin","Angeheftet","Wörter","Bitte geben Sie Kommentare zwischen $0 und $1 Wörtern ein! Aktuelle Anzahl der Wörter: $2","Anonym","Zwerge","Hobbits","Ents","Magier","Elfen","Maïar","GIF","Nach einem GIF suchen","Profil","Genehmigt","Ausstehend","Spam","Lösen","Älteste","Neueste","Am beliebtesten","Was denken Sie?"]),Xe=Q(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words! | ||
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),Je=Q(["Nombre de usuario","El nombre de usuario no puede tener menos de 3 bytes.","Correo electrónico","Por favor confirma tu dirección de correo electrónico.","Sitio web","Opcional","Comenta aquí...","Sin comentarios todavía.","Enviar","Like","Anular like","Responder","Anular respuesta","Comentarios","Recargar","Cargar Más...","Previsualizar","Emoji","Subir Imagen","segundos atrás","minutos atrás","horas atrás","días atrás","justo ahora","Subiendo","Iniciar sesión","cerrar sesión","Admin","Fijado","Palabras",`Por favor escriba entre $0 y $1 palabras! | ||
El número actual de palabras: $2`,"Anónimo","Enanos","Hobbits","Ents","Magos","Elfos","Maiar","GIF","Buscar GIF","Perfil","Aprobado","Esperando","Spam","Desfijar","Más antiguos","Más recientes","Más vistos","¿Qué piensas?"]),Ye=Q(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots ! | ||
Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),Qe=Q(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません! | ||
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),ml=Q(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras! | ||
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),et=Q(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов! | ||
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),tt=Q(["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?"]),lt=Q(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间! | ||
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),vl=Q(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間! | ||
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const at="en-US",ye={zh:lt,"zh-cn":lt,"zh-tw":vl,en:Xe,"en-us":Xe,fr:Ye,"fr-fr":Ye,jp:Qe,"jp-jp":Qe,"pt-br":ml,ru:et,"ru-ru":et,vi:tt,"vi-vn":tt,de:ul,es:Je,"es-mx":Je},nt=e=>ye[e.toLowerCase()]||ye[at.toLowerCase()],it=e=>Object.keys(ye).includes(e.toLowerCase())?e:at,ot=e=>{try{e=decodeURI(e)}catch{}return e},rt=(e="")=>e.replace(/\/$/u,""),st=e=>/^(https?:)?\/\//.test(e),ke=e=>{const a=rt(e);return st(a)?a:`https://${a}`},dl=e=>Array.isArray(e)?e:e?[0,e]:!1,Ie=(e,a)=>typeof e=="function"?e:e===!1?!1:a,pl=({serverURL:e,path:a=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:l,emoji:n=Ke,meta:r=["nick","mail","link"],requiredMeta:f=[],dark:c=!1,pageSize:C=10,wordLimit:u,imageUploader:w,highlighter:U,texRenderer:g,copyright:S=!0,login:j="enable",search:$,reaction:y,recaptchaV3Key:i="",turnstileKey:h="",commentSorting:F="latest",...q})=>({serverURL:ke(e),path:ot(a),lang:it(t),locale:{...nt(it(t)),...typeof l=="object"?l:{}},wordLimit:dl(u),meta:Ge(r),requiredMeta:Ge(f),imageUploader:Ie(w,el),highlighter:Ie(U,sl),texRenderer:Ie(g,tl),dark:c,emoji:typeof n=="boolean"?n?Ke:[]:n,pageSize:C,login:j,copyright:S,search:$===!1?!1:typeof $=="object"?$:ll(t),recaptchaV3Key:i,turnstileKey:h,reaction:Array.isArray(y)?y:y===!0?Qt:[],commentSorting:F,...q}),re=e=>typeof e=="string",Ae="{--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}",gl=e=>re(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ae}}`:`${e}${Ae}`:e===!0?`:root${Ae}`:"",Re=(e,a)=>{let t=e.toString();for(;t.length<a;)t="0"+t;return t},hl=e=>{const a=Re(e.getDate(),2),t=Re(e.getMonth()+1,2);return`${Re(e.getFullYear(),2)}-${t}-${a}`},fl=(e,a,t)=>{if(!e)return"";const l=re(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,n=a.getTime()-l.getTime(),r=Math.floor(n/(24*3600*1e3));if(r===0){const f=n%864e5,c=Math.floor(f/(3600*1e3));if(c===0){const C=f%36e5,u=Math.floor(C/(60*1e3));if(u===0){const w=C%6e4;return`${Math.round(w/1e3)} ${t.seconds}`}return`${u} ${t.minutes}`}return`${c} ${t.hours}`}return r<0?t.now:r<8?`${r} ${t.days}`:hl(l)},wl=/^[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])?)*$/,yl=e=>wl.test(e),kl=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),bl=e=>{const a=oe("WALINE_EMOJI",{}),t=kl(e);if(t){const l=a.value[e];if(l)return Promise.resolve(l)}return fetch(`${e}/info.json`).then(l=>l.json()).then(l=>{const n={folder:e,...l};return t&&(a.value[e]=n),n})},ct=(e,a="",t="",l="")=>`${a?`${a}/`:""}${t}${e}${l?`.${l}`:""}`,Cl=e=>Promise.all(e.map(a=>re(a)?bl(rt(a)):Promise.resolve(a))).then(a=>{const t={tabs:[],map:{}};return a.forEach(l=>{const{name:n,folder:r,icon:f,prefix:c="",type:C,items:u}=l;t.tabs.push({name:n,icon:ct(f,r,c,C),items:u.map(w=>{const U=`${c}${w}`;return t.map[U]=ct(w,r,c,C),U})})}),t}),ut=e=>{e.name!=="AbortError"&&console.error(e.message)},xe=e=>e instanceof HTMLElement?e:re(e)?document.querySelector(e):null,$l=e=>e.type.includes("image"),mt=e=>{const a=Array.from(e).find($l);return a?a.getAsFile():null},Ll=/\$.*?\$/,El=/^\$(.*?)\$/,Il=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Al=e=>[{name:"blockMath",level:"block",tokenizer(a){const t=Il.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!0,t[1])}}},{name:"inlineMath",level:"inline",start(a){const t=a.search(Ll);return t!==-1?t:a.length},tokenizer(a){const t=El.exec(a);if(t!==null)return{type:"html",raw:t[0],text:e(!1,t[1])}}}],vt=(e="",a={})=>e.replace(/:(.+?):/g,(t,l)=>a[l]?`<img class="wl-emoji" src="${a[l]}" alt="${l}">`:t),Rl=(e,{emojiMap:a,highlighter:t,texRenderer:l})=>{const n=new Zt;if(n.setOptions({breaks:!0}),t&&n.use(Xt({highlight:t})),l){const r=Al(l);n.use({extensions:r})}return n.parse(vt(e,a))},Me=e=>{const{path:a}=e.dataset;return a!=null&&a.length?a:null},xl=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Ml=e=>e.match(/[\u4E00-\u9FD5]/gu),Sl=e=>{var a,t;return(((a=xl(e))==null?void 0:a.reduce((l,n)=>l+(["",",","."].includes(n.trim())?0:n.trim().split(/\s+/u).length),0))??0)+(((t=Ml(e))==null?void 0:t.length)??0)},jl=async()=>{if(!navigator)return"";const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:t}=await e.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},dt=({serverURL:e,path:a=window.location.pathname,selector:t=".waline-comment-count",lang:l=navigator.language})=>{const n=new AbortController,r=document.querySelectorAll(t);return r.length&&Rt({serverURL:ke(e),paths:Array.from(r).map(f=>ot(Me(f)??a)),lang:l,signal:n.signal}).then(f=>{r.forEach((c,C)=>{c.innerText=f[C].toString()})}).catch(ut),n.abort.bind(n)},pt=({size:e})=>x("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[x("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"}),x("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"})]),Ul=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),zl=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),_l=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"}),x("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"})]),Vl=({active:e=!1})=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"})]),Hl=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"}),x("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"})]),Tl=()=>x("svg",{width:"16",height:"16",ariaHidden:"true"},x("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"})),Fl=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),Nl=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),Pl=()=>x("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},x("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"})),me=({size:e=100})=>x("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},x("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},x("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Wl=()=>x("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[x("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"}),x("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"})]),Bl=()=>oe("WALINE_USER_META",{nick:"",mail:"",link:""}),Dl=()=>oe("WALINE_COMMENT_BOX_EDITOR",""),Ol="WALINE_LIKE";let gt=null;const ht=()=>gt??(gt=oe(Ol,[])),ql="WALINE_REACTION";let ft=null;const Gl=()=>ft??(ft=oe(ql,{})),wt={},Kl=e=>{const a=wt[e]??(wt[e]=Jt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>a.then(l=>l.execute(t))}},Zl=e=>({execute:async a=>{const{load:t}=Ot("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const l=window==null?void 0:window.turnstile;return new Promise(n=>{l==null||l.ready(()=>{l==null||l.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:n})})})}}),Xl="WALINE_USER";let yt=null;const be=()=>yt??(yt=oe(Xl,{})),Jl={key:0,class:"wl-reaction"},Yl=["textContent"],Ql={class:"wl-reaction-list"},ea=["onClick"],ta={class:"wl-reaction-img"},la=["src","alt"],aa=["textContent"],na=["textContent"];var ia=ue({__name:"ArticleReaction",setup(e,{expose:a}){a();const t=Gl(),l=$e("config"),n=E(-1),r=E([]),f=P(()=>l.value.locale),c=P(()=>l.value.reaction.length>0),C=P(()=>{const{reaction:g,path:S}=l.value;return g.map((j,$)=>({icon:j,desc:f.value[`reaction${$}`],active:t.value[S]===$}))});let u;const w=async()=>{if(!c.value)return;const{serverURL:g,lang:S,path:j,reaction:$}=l.value,y=new AbortController;u=y.abort.bind(y);const i=await xt({serverURL:g,lang:S,paths:[j],type:$.map((h,F)=>`reaction${F}`),signal:y.signal});r.value=$.map((h,F)=>i[0][`reaction${F}`])},U=async g=>{if(n.value===-1){const{serverURL:S,lang:j,path:$}=l.value,y=t.value[$];n.value=g,y!==void 0&&(await Fe({serverURL:S,lang:j,path:$,type:`reaction${y}`,action:"desc"}),r.value[y]=Math.max(r.value[y]-1,0)),y!==g&&(await Fe({serverURL:S,lang:j,path:$,type:`reaction${g}`}),r.value[g]=(r.value[g]||0)+1),y===g?delete t.value[$]:t.value[$]=g,n.value=-1}};return fe(()=>{ae(()=>[l.value.serverURL,l.value.path],()=>{w()},{immediate:!0})}),Ne(()=>u==null?void 0:u()),(g,S)=>C.value.length?(s(),m("div",Jl,[p("div",{class:"wl-reaction-title",textContent:M(f.value.reactionTitle)},null,8,Yl),p("ul",Ql,[(s(!0),m(W,null,J(C.value,({active:j,icon:$,desc:y},i)=>(s(),m("li",{key:i,class:D(["wl-reaction-item",{active:j}]),onClick:h=>U(i)},[p("div",ta,[p("img",{src:$,alt:y},null,8,la),n.value===i?(s(),ne(L(me),{key:0,class:"wl-reaction-loading"})):(s(),m("div",{key:1,class:"wl-reaction-votes",textContent:M(r.value[i]||0)},null,8,aa))]),p("div",{class:"wl-reaction-text",textContent:M(y)},null,8,na)],10,ea))),128))])])):I("v-if",!0)}});const oa=["data-index"],ra=["src","title","onClick"];var sa=ue({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const t=e;a();let l=null;const n=E(null),r=E({}),f=E([]),c=()=>{const g=Math.floor((n.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return g>0?g:1},C=g=>new Array(g).fill(null).map(()=>[]),u=async g=>{var S;if(g>=t.items.length)return;await We();const j=Array.from(((S=n.value)==null?void 0:S.children)??[]).reduce(($,y)=>y.getBoundingClientRect().height<$.getBoundingClientRect().height?y:$);f.value[Number(j.dataset.index)].push(g),await u(g+1)},w=async(g=!1)=>{if(f.value.length===c()&&!g)return;f.value=C(c());const S=window.scrollY;await u(0),window.scrollTo({top:S})},U=g=>{r.value[g.target.src]=!0};return fe(()=>{w(!0),l=new ResizeObserver(()=>{w()}),l.observe(n.value),ae(()=>[t.items],()=>{r.value={},w(!0)}),ae(()=>[t.columnWidth,t.gap],()=>{w()})}),Tt(()=>l.unobserve(n.value)),(g,S)=>(s(),m("div",{ref_key:"wall",ref:n,class:"wl-gallery",style:Pe({gap:`${g.gap}px`})},[(s(!0),m(W,null,J(f.value,(j,$)=>(s(),m("div",{key:$,class:"wl-gallery-column","data-index":$,style:Pe({gap:`${g.gap}px`})},[(s(!0),m(W,null,J(j,y=>(s(),m(W,{key:y},[r.value[g.items[y].src]?I("v-if",!0):(s(),ne(L(me),{key:0,size:36,style:{margin:"20px auto"}})),p("img",{class:"wl-gallery-item",src:g.items[y].src,title:g.items[y].title,loading:"lazy",onLoad:U,onClick:i=>g.$emit("insert",`![](${g.items[y].src})`)},null,40,ra)],64))),128))],12,oa))),128))],4))}});const ca={key:0,class:"wl-login-info"},ua={class:"wl-avatar"},ma=["title"],va=["title"],da=["src"],pa=["title","textContent"],ga={class:"wl-panel"},ha=["for","textContent"],fa=["id","onUpdate:modelValue","name","type"],wa=["placeholder"],ya={class:"wl-preview"},ka=["innerHTML"],ba={class:"wl-footer"},Ca={class:"wl-actions"},$a={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},La=["title"],Ea=["title"],Ia=["title","aria-label"],Aa=["title"],Ra={class:"wl-info"},xa={class:"wl-text-number"},Ma={key:0},Sa=["textContent"],ja=["textContent"],Ua=["disabled"],za=["placeholder"],_a={key:1,class:"wl-loading"},Va={key:0,class:"wl-tab-wrapper"},Ha=["title","onClick"],Ta=["src","alt"],Fa={key:0,class:"wl-tabs"},Na=["onClick"],Pa=["src","alt","title"],Wa=["title"];var kt=ue({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:a}){const t=e,l=a,n=$e("config"),r=Dl(),f=Bl(),c=be(),C=E({}),u=E(null),w=E(null),U=E(null),g=E(null),S=E(null),j=E(null),$=E(null),y=E({tabs:[],map:{}}),i=E(0),h=E(!1),F=E(!1),q=E(!1),A=E(""),_=E(0),H=Le({loading:!0,list:[]}),te=E(0),le=E(!1),ve=E(""),Y=E(!1),se=E(!1),d=P(()=>n.value.locale),R=P(()=>{var v;return!!((v=c.value)!=null&&v.token)}),z=P(()=>n.value.imageUploader!==!1),G=v=>{const o=u.value,k=o.selectionStart,V=o.selectionEnd||0,b=o.scrollTop;r.value=o.value.substring(0,k)+v+o.value.substring(V,o.value.length),o.focus(),o.selectionStart=k+v.length,o.selectionEnd=k+v.length,o.scrollTop=b},K=v=>{if(Y.value)return;const o=v.key;(v.ctrlKey||v.metaKey)&&o==="Enter"&&de()},Z=v=>{const o=`![${n.value.locale.uploading} ${v.name}]()`;return G(o),Y.value=!0,Promise.resolve().then(()=>n.value.imageUploader(v)).then(k=>{r.value=r.value.replace(o,`\r | ||
![${v.name}](${k})`)}).catch(k=>{alert(k.message),r.value=r.value.replace(o,"")}).then(()=>{Y.value=!1})},X=v=>{var o;if((o=v.dataTransfer)!=null&&o.items){const k=mt(v.dataTransfer.items);k&&z.value&&(Z(k),v.preventDefault())}},ce=v=>{if(v.clipboardData){const o=mt(v.clipboardData.items);o&&z.value&&Z(o)}},Se=()=>{const v=w.value;v.files&&z.value&&Z(v.files[0]).then(()=>{v.value=""})},de=async()=>{var v,o,k,V,b,B;const{serverURL:N,lang:ee,login:pe,wordLimit:_e,requiredMeta:Ve,recaptchaV3Key:He,turnstileKey:Te}=n.value,At=await jl(),T={comment:ve.value,nick:f.value.nick,mail:f.value.mail,link:f.value.link,url:n.value.path,ua:At};if(!t.edit)if((v=c.value)!=null&&v.token)T.nick=c.value.display_name,T.mail=c.value.email,T.link=c.value.url;else{if(pe==="force")return;if(Ve.includes("nick")&&!T.nick)return(o=C.value.nick)==null||o.focus(),alert(d.value.nickError);if(Ve.includes("mail")&&!T.mail||T.mail&&!yl(T.mail))return(k=C.value.mail)==null||k.focus(),alert(d.value.mailError);T.nick||(T.nick=d.value.anonymous)}if(!T.comment){(V=u.value)==null||V.focus();return}if(!le.value)return alert(d.value.wordHint.replace("$0",_e[0].toString()).replace("$1",_e[1].toString()).replace("$2",_.value.toString()));T.comment=vt(T.comment,y.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{He&&(T.recaptchaV3=await Kl(He).execute("social")),Te&&(T.turnstile=await Zl(Te).execute("social"));const ge={serverURL:N,lang:ee,token:(b=c.value)==null?void 0:b.token,comment:T},Ce=await(t.edit?he({objectId:t.edit.objectId,...ge}):Mt(ge));if(Y.value=!1,Ce.errmsg)return alert(Ce.errmsg);l("submit",Ce.data),r.value="",A.value="",await We(),t.replyId&&l("cancelReply"),(B=t.edit)!=null&&B.objectId&&l("cancelEdit")}catch(ge){Y.value=!1,alert(ge.message)}},Lt=v=>{v.preventDefault();const{lang:o,serverURL:k}=n.value;St({serverURL:k,lang:o}).then(V=>{c.value=V,(V.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(V)),l("log")})},Et=()=>{c.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),l("log")},je=v=>{v.preventDefault();const{lang:o,serverURL:k}=n.value,V=800,b=800,B=(window.innerWidth-V)/2,N=(window.innerHeight-b)/2,ee=new URLSearchParams({lng:o,token:c.value.token}),pe=window.open(`${k}/ui/profile?${ee.toString()}`,"_blank",`width=${V},height=${b},left=${B},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);pe==null||pe.postMessage({type:"TOKEN",data:c.value.token},"*")},It=v=>{var o,k,V,b;!((o=U.value)!=null&&o.contains(v.target))&&!((k=g.value)!=null&&k.contains(v.target))&&(h.value=!1),!((V=S.value)!=null&&V.contains(v.target))&&!((b=j.value)!=null&&b.contains(v.target))&&(F.value=!1)},Ue=async v=>{var o;const{scrollTop:k,clientHeight:V,scrollHeight:b}=v.target,B=(V+k)/b,N=n.value.search,ee=((o=$.value)==null?void 0:o.value)??"";B<.9||H.loading||se.value||(H.loading=!0,(N.more&&H.list.length?await N.more(ee,H.list.length):await N.search(ee)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(ee,H.list.length):await N.search(ee)]:se.value=!0,H.loading=!1,setTimeout(()=>{v.target.scrollTop=k},50))},ze=qt(v=>{H.list=[],se.value=!1,Ue(v)},300);return ae([n,_],([v,o])=>{const{wordLimit:k}=v;k?o<k[0]&&k[0]!==0?(te.value=k[0],le.value=!1):o>k[1]?(te.value=k[1],le.value=!1):(te.value=k[1],le.value=!0):(te.value=0,le.value=!0)},{immediate:!0}),Oe("click",It),Oe("message",({data:v})=>{!v||v.type!=="profile"||(c.value={...c.value,...v.data},[localStorage,sessionStorage].filter(o=>o.getItem("WALINE_USER")).forEach(o=>o.setItem("WALINE_USER",JSON.stringify(c))))}),ae(F,async v=>{var o;if(!v)return;const k=n.value.search;$.value&&($.value.value=""),H.loading=!0,H.list=await(((o=k.default)==null?void 0:o.call(k))??k.search("")),H.loading=!1}),fe(()=>{var v;(v=t.edit)!=null&&v.objectId&&(r.value=t.edit.orig),ae(()=>r.value,o=>{const{highlighter:k,texRenderer:V}=n.value;ve.value=o,A.value=Rl(o,{emojiMap:y.value.map,highlighter:k,texRenderer:V}),_.value=Sl(o),o?qe(u.value):qe.destroy(u.value)},{immediate:!0}),ae(()=>n.value.emoji,o=>Cl(o).then(k=>{y.value=k}),{immediate:!0})}),(v,o)=>{var k,V;return s(),m("div",{key:L(c).token,class:"wl-comment"},[L(n).login!=="disable"&&R.value&&!((k=v.edit)!=null&&k.objectId)?(s(),m("div",ca,[p("div",ua,[p("button",{type:"submit",class:"wl-logout-btn",title:d.value.logout,onClick:Et},[O(L(pt),{size:14})],8,ma),p("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:d.value.profile,onClick:je},[p("img",{src:L(c).avatar,alt:"avatar"},null,8,da)],8,va)]),p("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:d.value.profile,onClick:je,textContent:M(L(c).display_name)},null,8,pa)])):I("v-if",!0),p("div",ga,[L(n).login!=="force"&&L(n).meta.length&&!R.value?(s(),m("div",{key:0,class:D(["wl-header",`item${L(n).meta.length}`])},[(s(!0),m(W,null,J(L(n).meta,b=>(s(),m("div",{key:b,class:"wl-header-item"},[p("label",{for:`wl-${b}`,textContent:M(d.value[b]+(L(n).requiredMeta.includes(b)||!L(n).requiredMeta.length?"":`(${d.value.optional})`))},null,8,ha),we(p("input",{id:`wl-${b}`,ref_for:!0,ref:B=>{B&&(C.value[b]=B)},"onUpdate:modelValue":B=>L(f)[b]=B,class:D(["wl-input",`wl-${b}`]),name:b,type:b==="mail"?"email":"text"},null,10,fa),[[Ft,L(f)[b]]])]))),128))],2)):I("v-if",!0),we(p("textarea",{id:"wl-edit",ref_key:"editorRef",ref:u,"onUpdate:modelValue":o[0]||(o[0]=b=>Nt(r)?r.value=b:null),class:"wl-editor",placeholder:v.replyUser?`@${v.replyUser}`:d.value.placeholder,onKeydown:K,onDrop:X,onPaste:ce},null,40,wa),[[Pt,L(r)]]),we(p("div",ya,[o[7]||(o[7]=p("hr",null,null,-1)),p("h4",null,M(d.value.preview)+":",1),p("div",{class:"wl-content",innerHTML:A.value},null,8,ka)],512),[[Be,q.value]]),p("div",ba,[p("div",Ca,[p("a",$a,[O(L(Tl))]),we(p("button",{ref_key:"emojiButtonRef",ref:U,type:"button",class:D(["wl-action",{active:h.value}]),title:d.value.emoji,onClick:o[1]||(o[1]=b=>h.value=!h.value)},[O(L(zl))],10,La),[[Be,y.value.tabs.length]]),L(n).search?(s(),m("button",{key:0,ref_key:"gifButtonRef",ref:S,type:"button",class:D(["wl-action",{active:F.value}]),title:d.value.gif,onClick:o[2]||(o[2]=b=>F.value=!F.value)},[O(L(Wl))],10,Ea)):I("v-if",!0),p("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:w,class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Se},null,544),z.value?(s(),m("label",{key:1,for:"wl-image-upload",class:"wl-action",title:d.value.uploadImage,"aria-label":d.value.uploadImage},[O(L(_l))],8,Ia)):I("v-if",!0),p("button",{type:"button",class:D(["wl-action",{active:q.value}]),title:d.value.preview,onClick:o[3]||(o[3]=b=>q.value=!q.value)},[O(L(Hl))],10,Aa)]),p("div",Ra,[o[9]||(o[9]=p("div",{class:"wl-captcha-container"},null,-1)),p("div",xa,[ie(M(_.value)+" ",1),L(n).wordLimit?(s(),m("span",Ma,[o[8]||(o[8]=ie(" / ")),p("span",{class:D({illegal:!le.value}),textContent:M(te.value)},null,10,Sa)])):I("v-if",!0),ie(" "+M(d.value.word),1)]),L(n).login!=="disable"&&!R.value?(s(),m("button",{key:0,type:"button",class:"wl-btn",onClick:Lt,textContent:M(d.value.login)},null,8,ja)):I("v-if",!0),L(n).login!=="force"||R.value?(s(),m("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:de},[Y.value?(s(),ne(L(me),{key:0,size:16})):(s(),m(W,{key:1},[ie(M(d.value.submit),1)],64))],8,Ua)):I("v-if",!0)]),p("div",{ref_key:"gifPopupRef",ref:j,class:D(["wl-gif-popup",{display:F.value}])},[p("input",{ref_key:"gifSearchInputRef",ref:$,type:"text",placeholder:d.value.gifSearchPlaceholder,onInput:o[4]||(o[4]=(...b)=>L(ze)&&L(ze)(...b))},null,40,za),H.list.length?(s(),ne(sa,{key:0,items:H.list,"column-width":200,gap:6,onInsert:o[5]||(o[5]=b=>G(b)),onScroll:Ue},null,8,["items"])):I("v-if",!0),H.loading?(s(),m("div",_a,[O(L(me),{size:30})])):I("v-if",!0)],2),p("div",{ref_key:"emojiPopupRef",ref:g,class:D(["wl-emoji-popup",{display:h.value}])},[(s(!0),m(W,null,J(y.value.tabs,(b,B)=>(s(),m(W,{key:b.name},[B===i.value?(s(),m("div",Va,[(s(!0),m(W,null,J(b.items,N=>(s(),m("button",{key:N,type:"button",title:N,onClick:ee=>G(`:${N}:`)},[h.value?(s(),m("img",{key:0,class:"wl-emoji",src:y.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Ta)):I("v-if",!0)],8,Ha))),128))])):I("v-if",!0)],64))),128)),y.value.tabs.length>1?(s(),m("div",Fa,[(s(!0),m(W,null,J(y.value.tabs,(b,B)=>(s(),m("button",{key:b.name,type:"button",class:D(["wl-tab",{active:i.value===B}]),onClick:N=>i.value=B},[p("img",{class:"wl-emoji",src:b.icon,alt:b.name,title:b.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Pa)],10,Na))),128))])):I("v-if",!0)],2)])]),v.replyId||(V=v.edit)!=null&&V.objectId?(s(),m("button",{key:1,type:"button",class:"wl-close",title:d.value.cancelReply,onClick:o[6]||(o[6]=b=>v.replyId?l("cancelReply"):l("cancelEdit"))},[O(L(pt),{size:24})],8,Wa)):I("v-if",!0)])}}});const Ba=["id"],Da={class:"wl-user","aria-hidden":"true"},Oa=["src"],qa={class:"wl-card"},Ga={class:"wl-head"},Ka=["href"],Za={key:1,class:"wl-nick"},Xa=["textContent"],Ja=["textContent"],Ya=["textContent"],Qa=["textContent"],en=["textContent"],tn={class:"wl-comment-actions"},ln=["title"],an=["title"],nn={class:"wl-meta","aria-hidden":"true"},on=["data-value","textContent"],rn={key:0,class:"wl-content"},sn={key:0},cn=["href"],un=["innerHTML"],mn={key:1,class:"wl-admin-actions"},vn={class:"wl-comment-status"},dn=["disabled","onClick","textContent"],pn={key:3,class:"wl-quote"};var gn=ue({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const t=e,l=a,n=["approved","waiting","spam"],r=$e("config"),f=ht(),c=Gt(),C=be(),u=P(()=>r.value.locale),w=P(()=>{const{link:i}=t.comment;return i?st(i)?i:`https://${i}`:""}),U=P(()=>f.value.includes(t.comment.objectId)),g=P(()=>fl(new Date(t.comment.time),c.value,u.value)),S=P(()=>C.value.type==="administrator"),j=P(()=>t.comment.user_id&&C.value.objectId===t.comment.user_id),$=P(()=>{var i;return t.comment.objectId===((i=t.reply)==null?void 0:i.objectId)}),y=P(()=>{var i;return t.comment.objectId===((i=t.edit)==null?void 0:i.objectId)});return(i,h)=>{var F;const q=Wt("CommentCard",!0);return s(),m("div",{id:i.comment.objectId,class:"wl-card-item"},[p("div",Da,[i.comment.avatar?(s(),m("img",{key:0,class:"wl-user-avatar",src:i.comment.avatar,alt:""},null,8,Oa)):I("v-if",!0),i.comment.type?(s(),ne(L(Pl),{key:1})):I("v-if",!0)]),p("div",qa,[p("div",Ga,[w.value?(s(),m("a",{key:0,class:"wl-nick",href:w.value,target:"_blank",rel:"nofollow noopener noreferrer"},M(i.comment.nick),9,Ka)):(s(),m("span",Za,M(i.comment.nick),1)),i.comment.type==="administrator"?(s(),m("span",{key:2,class:"wl-badge",textContent:M(u.value.admin)},null,8,Xa)):I("v-if",!0),i.comment.label?(s(),m("span",{key:3,class:"wl-badge",textContent:M(i.comment.label)},null,8,Ja)):I("v-if",!0),i.comment.sticky?(s(),m("span",{key:4,class:"wl-badge",textContent:M(u.value.sticky)},null,8,Ya)):I("v-if",!0),typeof i.comment.level=="number"?(s(),m("span",{key:5,class:D(`wl-badge level${i.comment.level}`),textContent:M(u.value[`level${i.comment.level}`]||`Level ${i.comment.level}`)},null,10,Qa)):I("v-if",!0),p("span",{class:"wl-time",textContent:M(g.value)},null,8,en),p("div",tn,[S.value||j.value?(s(),m(W,{key:0},[p("button",{type:"button",class:"wl-edit",onClick:h[0]||(h[0]=A=>l("edit",i.comment))},[O(L(Nl))]),p("button",{type:"button",class:"wl-delete",onClick:h[1]||(h[1]=A=>l("delete",i.comment))},[O(L(Ul))])],64)):I("v-if",!0),p("button",{type:"button",class:"wl-like",title:U.value?u.value.cancelLike:u.value.like,onClick:h[2]||(h[2]=A=>l("like",i.comment))},[O(L(Vl),{active:U.value},null,8,["active"]),ie(" "+M("like"in i.comment?i.comment.like:""),1)],8,ln),p("button",{type:"button",class:D(["wl-reply",{active:$.value}]),title:$.value?u.value.cancelReply:u.value.reply,onClick:h[3]||(h[3]=A=>l("reply",$.value?null:i.comment))},[O(L(Fl))],10,an)])]),p("div",nn,[(s(),m(W,null,J(["addr","browser","os"],A=>(s(),m(W,null,[i.comment[A]?(s(),m("span",{key:A,class:D(`wl-${A}`),"data-value":i.comment[A],textContent:M(i.comment[A])},null,10,on)):I("v-if",!0)],64))),64))]),y.value?I("v-if",!0):(s(),m("div",rn,[i.comment.reply_user?(s(),m("p",sn,[p("a",{href:"#"+i.comment.pid},"@"+M(i.comment.reply_user.nick),9,cn),h[17]||(h[17]=p("span",null,": ",-1))])):I("v-if",!0),p("div",{innerHTML:i.comment.comment},null,8,un)])),S.value&&!y.value?(s(),m("div",mn,[p("span",vn,[(s(),m(W,null,J(n,A=>p("button",{key:A,type:"submit",class:D(`wl-btn wl-${A}`),disabled:i.comment.status===A,onClick:_=>l("status",{status:A,comment:i.comment}),textContent:M(u.value[A])},null,10,dn)),64))]),S.value&&!("rid"in i.comment)?(s(),m("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:h[4]||(h[4]=A=>l("sticky",i.comment))},M(i.comment.sticky?u.value.unsticky:u.value.sticky),1)):I("v-if",!0)])):I("v-if",!0),$.value||y.value?(s(),m("div",{key:2,class:D({"wl-reply-wrapper":$.value,"wl-edit-wrapper":y.value})},[O(kt,{edit:i.edit,"reply-id":(F=i.reply)==null?void 0:F.objectId,"reply-user":i.comment.nick,"root-id":i.rootId,onLog:h[5]||(h[5]=A=>l("log")),onCancelReply:h[6]||(h[6]=A=>l("reply",null)),onCancelEdit:h[7]||(h[7]=A=>l("edit",null)),onSubmit:h[8]||(h[8]=A=>l("submit",A))},null,8,["edit","reply-id","reply-user","root-id"])],2)):I("v-if",!0),"children"in i.comment?(s(),m("div",pn,[(s(!0),m(W,null,J(i.comment.children,A=>(s(),ne(q,{key:A.objectId,comment:A,reply:i.reply,edit:i.edit,"root-id":i.rootId,onLog:h[9]||(h[9]=_=>l("log")),onDelete:h[10]||(h[10]=_=>l("delete",_)),onEdit:h[11]||(h[11]=_=>l("edit",_)),onLike:h[12]||(h[12]=_=>l("like",_)),onReply:h[13]||(h[13]=_=>l("reply",_)),onStatus:h[14]||(h[14]=_=>l("status",_)),onSticky:h[15]||(h[15]=_=>l("sticky",_)),onSubmit:h[16]||(h[16]=_=>l("submit",_))},null,8,["comment","reply","edit","root-id"]))),128))])):I("v-if",!0)])],8,Ba)}}});const bt="3.4.1",hn={"data-waline":""},fn={class:"wl-meta-head"},wn={class:"wl-count"},yn=["textContent"],kn={class:"wl-sort"},bn=["onClick"],Cn={class:"wl-cards"},$n={key:1,class:"wl-operation"},Ln=["textContent"],En={key:2,class:"wl-loading"},In=["textContent"],An={key:4,class:"wl-operation"},Rn=["textContent"],xn={key:5,class:"wl-power"};var Mn=ue({__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 a=e,t={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},l=Object.keys(t),n=be(),r=ht(),f=E("loading"),c=E(0),C=E(1),u=E(0),w=P(()=>pl(a)),U=E(w.value.commentSorting),g=E([]),S=E(null),j=E(null),$=P(()=>gl(w.value.dark)),y=P(()=>w.value.locale);Kt($,{id:"waline-darkmode"});let i;const h=d=>{var R;const{serverURL:z,path:G,pageSize:K}=w.value,Z=new AbortController;f.value="loading",i==null||i(),Ut({serverURL:z,lang:w.value.lang,path:G,pageSize:K,sortBy:t[U.value],page:d,signal:Z.signal,token:(R=n.value)==null?void 0:R.token}).then(X=>{f.value="success",c.value=X.count,g.value.push(...X.data),C.value=d,u.value=X.totalPages}).catch(X=>{X.name!=="AbortError"&&(console.error(X.message),f.value="error")}),i=Z.abort.bind(Z)},F=()=>h(C.value+1),q=()=>{c.value=0,g.value=[],h(1)},A=d=>{U.value!==d&&(U.value=d,q())},_=d=>{S.value=d},H=d=>{j.value=d},te=d=>{if(j.value)j.value.comment=d.comment,j.value.orig=d.orig;else if("rid"in d){const R=g.value.find(({objectId:z})=>z===d.rid);if(!R)return;Array.isArray(R.children)||(R.children=[]),R.children.push(d)}else g.value.unshift(d),c.value+=1},le=async({comment:d,status:R})=>{var z;if(d.status===R)return;const{serverURL:G,lang:K}=w.value;await he({serverURL:G,lang:K,token:(z=n.value)==null?void 0:z.token,objectId:d.objectId,comment:{status:R}}),d.status=R},ve=async d=>{var R;if("rid"in d)return;const{serverURL:z,lang:G}=w.value;await he({serverURL:z,lang:G,token:(R=n.value)==null?void 0:R.token,objectId:d.objectId,comment:{sticky:d.sticky?0:1}}),d.sticky=!d.sticky},Y=async({objectId:d})=>{var R;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:z,lang:G}=w.value;await jt({serverURL:z,lang:G,token:(R=n.value)==null?void 0:R.token,objectId:d}),g.value.some((K,Z)=>K.objectId===d?(g.value=g.value.filter((X,ce)=>ce!==Z),!0):K.children.some((X,ce)=>X.objectId===d?(g.value[Z].children=K.children.filter((Se,de)=>de!==ce),!0):!1))},se=async d=>{var R;const{serverURL:z,lang:G}=w.value,{objectId:K}=d,Z=r.value.includes(K);await he({serverURL:z,lang:G,objectId:K,token:(R=n.value)==null?void 0:R.token,comment:{like:!Z}}),Z?r.value=r.value.filter(X=>X!==K):(r.value=[...r.value,K],r.value.length>50&&(r.value=r.value.slice(-50))),d.like=(d.like||0)+(Z?-1:1)};return Bt("config",w),fe(()=>{ae(()=>[a.serverURL,a.path],()=>q(),{immediate:!0})}),Ne(()=>i==null?void 0:i()),(d,R)=>(s(),m("div",hn,[O(ia),!S.value&&!j.value?(s(),ne(kt,{key:0,onLog:q,onSubmit:te})):I("v-if",!0),p("div",fn,[p("div",wn,[c.value?(s(),m("span",{key:0,class:"wl-num",textContent:M(c.value)},null,8,yn)):I("v-if",!0),ie(" "+M(y.value.comment),1)]),p("ul",kn,[(s(!0),m(W,null,J(L(l),z=>(s(),m("li",{key:z,class:D([z===U.value?"active":""]),onClick:G=>A(z)},M(y.value[z]),11,bn))),128))])]),p("div",Cn,[(s(!0),m(W,null,J(g.value,z=>(s(),ne(gn,{key:z.objectId,"root-id":z.objectId,comment:z,reply:S.value,edit:j.value,onLog:q,onReply:_,onEdit:H,onSubmit:te,onStatus:le,onDelete:Y,onSticky:ve,onLike:se},null,8,["root-id","comment","reply","edit"]))),128))]),f.value==="error"?(s(),m("div",$n,[p("button",{type:"button",class:"wl-btn",onClick:q,textContent:M(y.value.refresh)},null,8,Ln)])):f.value==="loading"?(s(),m("div",En,[O(L(me),{size:30})])):g.value.length?C.value<u.value?(s(),m("div",An,[p("button",{type:"button",class:"wl-btn",onClick:F,textContent:M(y.value.more)},null,8,Rn)])):I("v-if",!0):(s(),m("div",{key:3,class:"wl-empty",textContent:M(y.value.sofa)},null,8,In)),w.value.copyright?(s(),m("div",xn,[R[0]||(R[0]=ie(" Powered by ")),R[1]||(R[1]=p("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),ie(" v"+M(L(bt)),1)])):I("v-if",!0)]))}});const Ct=(e,a)=>{a.forEach((t,l)=>{const n=e[l].time;typeof n=="number"&&(t.innerText=n.toString())})},$t=({serverURL:e,path:a=window.location.pathname,selector:t=".waline-pageview-count",update:l=!0,lang:n=navigator.language})=>{const r=new AbortController,f=Array.from(document.querySelectorAll(t)),c=u=>{const w=Me(u);return w!==null&&a!==w},C=u=>_t({serverURL:ke(e),paths:u.map(w=>Me(w)??a),lang:n,signal:r.signal}).then(w=>Ct(w,u)).catch(ut);if(l){const u=f.filter(U=>!c(U)),w=f.filter(c);zt({serverURL:ke(e),path:a,lang:n}).then(U=>Ct(U,u)),w.length&&C(w)}else C(f);return r.abort.bind(r)},Sn=({el:e="#waline",path:a=window.location.pathname,comment:t=!1,pageview:l=!1,...n})=>{const r=e?xe(e):null;if(e&&!r)throw new Error("Option 'el' do not match any domElement!");if(!n.serverURL)throw new Error("Option 'serverURL' is missing!");const f=Le({...n}),c=Le({comment:t,pageview:l,path:a}),C=()=>{c.comment&&dt({serverURL:f.serverURL,path:c.path,...re(c.comment)?{selector:c.comment}:{}})},u=()=>{c.pageview&&$t({serverURL:f.serverURL,path:c.path,...re(c.pageview)?{selector:c.pageview}:{}})},w=r?Dt(()=>x(Mn,{path:c.path,...f})):null;w&&w.mount(r);const U=De(C),g=De(u);return{el:r,update:({comment:S,pageview:j,path:$=window.location.pathname,...y}={})=>{Object.entries(y).forEach(([i,h])=>{f[i]=h}),c.path=$,S!==void 0&&(c.comment=S),j!==void 0&&(c.pageview=j)},destroy:()=>{w==null||w.unmount(),U(),g()}}},jn=({el:e,serverURL:a,count:t,lang:l=navigator.language})=>{var n;const r=be(),f=xe(e),c=new AbortController;return Vt({serverURL:a,count:t,lang:l,signal:c.signal,token:(n=r.value)==null?void 0:n.token}).then(C=>f&&C.length?(f.innerHTML=`<ul class="wl-recent-list">${C.map(u=>`<li class="wl-recent-item"><a href="${u.url}">${u.nick}</a>:${u.comment}</li>`).join("")}</ul>`,{comments:C,destroy:()=>{c.abort(),f.innerHTML=""}}):{comments:C,destroy:()=>c.abort()})},Un=({el:e,serverURL:a,count:t,locale:l,lang:n=navigator.language,mode:r="list"})=>{const f=xe(e),c=new AbortController;return Ht({serverURL:a,pageSize:t,lang:n,signal:c.signal}).then(C=>!f||!C.length?{users:C,destroy:()=>c.abort()}:(l={...nt(n),...typeof l=="object"?l:{}},f.innerHTML=`<ul class="wl-user-${r}">${C.map((u,w)=>[`<li class="wl-user-item" aria-label="${u.nick}">`,u.link&&`<a href="${u.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${u.avatar}" alt="${u.nick}">`,`<span class="wl-user-badge">${w+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',u.nick,u.level&&`<span class="wl-badge">${l?l[`level${u.level}`]:`Level ${u.level}`}</span>`,u.label&&`<span class="wl-badge">${u.label}</span>`,"</div>",u.link&&u.link,"</div>",u.link&&"</a>","</li>"].filter(U=>U).join("")).join("")}</ul>`,{users:C,destroy:()=>{c.abort(),f.innerHTML=""}}))};export{jn as RecentComments,Un as UserList,dt as commentCount,ye as defaultLocales,Sn as init,$t as pageviewCount,bt as version}; | ||
import{fetchCommentCount as Et,getArticleCounter as It,updateArticleCounter as ze,updateComment as de,addComment as At,login as xt,deleteComment as Mt,getComment as Rt,updatePageview as St,getPageview as jt,getRecentComment as Ut,getUserList as zt}from"@waline/api";export*from"@waline/api";import{h as x,defineComponent as se,inject as Ce,ref as z,computed as P,onMounted as pe,watch as ee,onUnmounted as Ve,openBlock as s,createElementBlock as u,createElementVNode as p,toDisplayString as M,Fragment as B,renderList as Z,normalizeClass as O,createBlock as te,unref as E,createCommentVNode as I,useTemplateRef as ae,onBeforeUnmount as Vt,normalizeStyle as He,nextTick as _e,reactive as $e,createVNode as K,withDirectives as ge,vModelDynamic as Ht,isRef as _t,vModelText as Tt,vShow as Te,createTextVNode as le,resolveComponent as Ft,provide as Nt,createApp as Wt,watchEffect as Fe}from"vue";import{useStorage as ie,useScriptTag as Pt,useDebounceFn as Bt,useEventListener as Ne,useNow as Dt,useStyleTag as Ot}from"@vueuse/core";import We from"autosize";import{Marked as qt}from"marked";import{markedHighlight as Gt}from"marked-highlight";import{load as Kt}from"recaptcha-v3";const Zt=["nick","mail","link"],Pe=e=>e.filter(l=>Zt.includes(l)),Be=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Xt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],Yt=e=>new Promise((l,t)=>{if(e.size>128e3)return t(new Error("File too large! File size limit 128KB"));const a=new FileReader;a.readAsDataURL(e),a.onload=()=>l(a.result),a.onerror=t}),Jt=e=>e?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',Qt=e=>{const l=async(t,a={})=>fetch(`https://api.giphy.com/v1/gifs/${t}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...a}).toString()}`).then(n=>n.json()).then(({data:n})=>n.map(r=>({title:r.title,src:r.images.downsized_medium.url})));return{search:t=>l("search",{q:t,offset:"0"}),default:()=>l("trending",{}),more:(t,a=0)=>l("search",{q:t,offset:a.toString()})}},ea=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,ta=/</,aa=/(?:^|\s)\/\/(.+?)$/gm,la=/\/\*([\S\s]*?)\*\//gm,na=new RegExp(`(${ea.source}|${ta.source})|((?:${aa.source})|(?:${la.source}))`,"gmi"),De=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Le={},ia=e=>{let l=0;return e.replace(na,(t,a,n)=>{if(n)return`<span style="color: slategray">${n}</span>`;if(a==="<")return"<";let r;Le[a]?r=Le[a]:(r=De[l],Le[a]=r);const g=`<span style="color: #${r}">${a}</span>`;return l=++l%De.length,g})},oa=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],J=e=>Object.fromEntries(e.map((l,t)=>[oa[t],l]));var ra=J(["Benutzername","Der Benutzername darf nicht weniger als 3 Bytes umfassen.","E-Mail","Bitte bestätigen Sie Ihre E-Mail-Adresse.","Webseite","Optional","Kommentieren Sie hier...","Noch keine Kommentare.","Senden","Gefällt mir","Gefällt mir nicht mehr","Antworten","Antwort abbrechen","Kommentare","Aktualisieren","Mehr laden...","Vorschau","Emoji","Ein Bild hochladen","Vor einigen Sekunden","Vor einigen Minuten","Vor einigen Stunden","Vor einigen Tagen","Gerade eben","Hochladen läuft","Anmelden","Abmelden","Admin","Angeheftet","Wörter","Bitte geben Sie Kommentare zwischen $0 und $1 Wörtern ein! Aktuelle Anzahl der Wörter: $2","Anonym","Zwerge","Hobbits","Ents","Magier","Elfen","Maïar","GIF","Nach einem GIF suchen","Profil","Genehmigt","Ausstehend","Spam","Lösen","Älteste","Neueste","Am beliebtesten","Was denken Sie?"]),Oe=J(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words! | ||
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),qe=J(["Nombre de usuario","El nombre de usuario no puede tener menos de 3 bytes.","Correo electrónico","Por favor confirma tu dirección de correo electrónico.","Sitio web","Opcional","Comenta aquí...","Sin comentarios todavía.","Enviar","Like","Anular like","Responder","Anular respuesta","Comentarios","Recargar","Cargar Más...","Previsualizar","Emoji","Subir Imagen","segundos atrás","minutos atrás","horas atrás","días atrás","justo ahora","Subiendo","Iniciar sesión","cerrar sesión","Admin","Fijado","Palabras",`Por favor escriba entre $0 y $1 palabras! | ||
El número actual de palabras: $2`,"Anónimo","Enanos","Hobbits","Ents","Magos","Elfos","Maiar","GIF","Buscar GIF","Perfil","Aprobado","Esperando","Spam","Desfijar","Más antiguos","Más recientes","Más vistos","¿Qué piensas?"]),Ge=J(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots ! | ||
Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),Ke=J(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません! | ||
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),sa=J(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras! | ||
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),Ze=J(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов! | ||
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]),Xe=J(["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?"]),Ye=J(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间! | ||
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),ca=J(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間! | ||
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const Je="en-US",he={zh:Ye,"zh-cn":Ye,"zh-tw":ca,en:Oe,"en-us":Oe,fr:Ge,"fr-fr":Ge,jp:Ke,"jp-jp":Ke,"pt-br":sa,ru:Ze,"ru-ru":Ze,vi:Xe,"vi-vn":Xe,de:ra,es:qe,"es-mx":qe},Qe=e=>he[e.toLowerCase()]||he[Je.toLowerCase()],et=e=>Object.keys(he).includes(e.toLowerCase())?e:Je,tt={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},ua=Object.keys(tt),we=Symbol("waline-config"),at=e=>{try{e=decodeURI(e)}catch{}return e},lt=(e="")=>e.replace(/\/$/u,""),nt=e=>/^(https?:)?\/\//.test(e),fe=e=>{const l=lt(e);return nt(l)?l:`https://${l}`},ma=e=>Array.isArray(e)?e:e?[0,e]:!1,Ee=(e,l)=>typeof e=="function"?e:e===!1?!1:l,va=({serverURL:e,path:l=location.pathname,lang:t=typeof navigator>"u"?"en-US":navigator.language,locale:a,emoji:n=Be,meta:r=["nick","mail","link"],requiredMeta:g=[],dark:c=!1,pageSize:w=10,wordLimit:m,imageUploader:f,highlighter:j,texRenderer:h,copyright:S=!0,login:R="enable",search:$,reaction:y,recaptchaV3Key:o="",turnstileKey:d="",commentSorting:W="latest",...X})=>({serverURL:fe(e),path:at(l),lang:et(t),locale:{...Qe(et(t)),...typeof a=="object"?a:{}},wordLimit:ma(m),meta:Pe(r),requiredMeta:Pe(g),imageUploader:Ee(f,Yt),highlighter:Ee(j,ia),texRenderer:Ee(h,Jt),dark:c,emoji:typeof n=="boolean"?n?Be:[]:n,pageSize:w,login:R,copyright:S,search:$===!1?!1:typeof $=="object"?$:Qt(t),recaptchaV3Key:o,turnstileKey:d,reaction:Array.isArray(y)?y:y===!0?Xt:[],commentSorting:W,...X}),oe=e=>typeof e=="string",Ie="{--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}",da=e=>oe(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ie}}`:`${e}${Ie}`:e===!0?`:root${Ie}`:"",Ae=(e,l)=>{let t=e.toString();for(;t.length<l;)t="0"+t;return t},pa=e=>{const l=Ae(e.getDate(),2),t=Ae(e.getMonth()+1,2);return`${Ae(e.getFullYear(),2)}-${t}-${l}`},ga=(e,l,t)=>{if(!e)return"";const a=oe(e)?new Date(e.includes(" ")?e.replace(/-/g,"/"):e):e,n=l.getTime()-a.getTime(),r=Math.floor(n/(24*3600*1e3));if(r===0){const g=n%864e5,c=Math.floor(g/(3600*1e3));if(c===0){const w=g%36e5,m=Math.floor(w/(60*1e3));if(m===0){const f=w%6e4;return`${Math.round(f/1e3)} ${t.seconds}`}return`${m} ${t.minutes}`}return`${c} ${t.hours}`}return r<0?t.now:r<8?`${r} ${t.days}`:pa(a)},ha=/^[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])?)*$/,wa=e=>ha.test(e),fa=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),ya=e=>{const l=ie("WALINE_EMOJI",{}),t=fa(e);if(t){const a=l.value[e];if(a)return Promise.resolve(a)}return fetch(`${e}/info.json`).then(a=>a.json()).then(a=>{const n={folder:e,...a};return t&&(l.value[e]=n),n})},it=(e,l="",t="",a="")=>`${l?`${l}/`:""}${t}${e}${a?`.${a}`:""}`,ba=e=>Promise.all(e.map(l=>oe(l)?ya(lt(l)):Promise.resolve(l))).then(l=>{const t={tabs:[],map:{}};return l.forEach(a=>{const{name:n,folder:r,icon:g,prefix:c="",type:w,items:m}=a;t.tabs.push({name:n,icon:it(g,r,c,w),items:m.map(f=>{const j=`${c}${f}`;return t.map[j]=it(f,r,c,w),j})})}),t}),ot=e=>{e.name!=="AbortError"&&console.error(e.message)},xe=e=>e instanceof HTMLElement?e:oe(e)?document.querySelector(e):null,ka=e=>e.type.includes("image"),rt=e=>{const l=Array.from(e).find(ka);return l?l.getAsFile():null},Ca=/\$.*?\$/,$a=/^\$(.*?)\$/,La=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Ea=e=>[{name:"blockMath",level:"block",tokenizer(l){const t=La.exec(l);if(t!==null)return{type:"html",raw:t[0],text:e(!0,t[1])}}},{name:"inlineMath",level:"inline",start(l){const t=l.search(Ca);return t!==-1?t:l.length},tokenizer(l){const t=$a.exec(l);if(t!==null)return{type:"html",raw:t[0],text:e(!1,t[1])}}}],st=(e="",l={})=>e.replace(/:(.+?):/g,(t,a)=>l[a]?`<img class="wl-emoji" src="${l[a]}" alt="${a}">`:t),Ia=(e,{emojiMap:l,highlighter:t,texRenderer:a})=>{const n=new qt;if(n.setOptions({breaks:!0}),t&&n.use(Gt({highlight:t})),a){const r=Ea(a);n.use({extensions:r})}return n.parse(st(e,l))},Me=e=>{const{path:l}=e.dataset;return l!=null&&l.length?l:null},Aa=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),xa=e=>e.match(/[\u4E00-\u9FD5]/gu),Ma=e=>{var l,t;return(((l=Aa(e))==null?void 0:l.reduce((a,n)=>a+(["",",","."].includes(n.trim())?0:n.trim().split(/\s+/u).length),0))??0)+(((t=xa(e))==null?void 0:t.length)??0)},Ra=async()=>{const{userAgentData:e}=navigator;let l=navigator.userAgent;if(!e||e.platform!=="Windows")return l;const{platformVersion:t}=await e.getHighEntropyValues(["platformVersion"]);return t&&parseInt(t.split(".")[0])>=13&&(l=l.replace("Windows NT 10.0","Windows NT 11.0")),l},ct=({serverURL:e,path:l=window.location.pathname,selector:t=".waline-comment-count",lang:a=navigator.language})=>{const n=new AbortController,r=document.querySelectorAll(t);return r.length&&Et({serverURL:fe(e),paths:Array.from(r).map(g=>at(Me(g)??l)),lang:a,signal:n.signal}).then(g=>{r.forEach((c,w)=>{c.innerText=g[w].toString()})}).catch(ot),n.abort.bind(n)},ut=({size:e})=>x("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[x("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"}),x("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"})]),Sa=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),ja=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),Ua=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"}),x("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"})]),za=({active:e=!1})=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"})]),Va=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[x("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"}),x("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"})]),Ha=()=>x("svg",{width:"16",height:"16",ariaHidden:"true"},x("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"})),_a=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),Ta=()=>x("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},x("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"})),Fa=()=>x("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},x("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"})),ce=({size:e=100})=>x("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},x("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},x("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Na=()=>x("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[x("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"}),x("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"})]),Wa=()=>ie("WALINE_USER_META",{nick:"",mail:"",link:""}),Pa=()=>ie("WALINE_COMMENT_BOX_EDITOR",""),Ba="WALINE_LIKE";let mt=null;const vt=()=>mt??(mt=ie(Ba,[])),Da="WALINE_REACTION";let dt=null;const Oa=()=>dt??(dt=ie(Da,{})),pt={},qa=e=>{const l=pt[e]??(pt[e]=Kt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:t=>l.then(a=>a.execute(t))}},Ga=e=>({execute:async l=>{const{load:t}=Pt("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await t();const a=window.turnstile;return new Promise(n=>{a==null||a.ready(()=>{a.render(".wl-captcha-container",{sitekey:e,action:l,size:"compact",callback:n})})})}}),Ka="WALINE_USER";let gt=null;const ye=()=>gt??(gt=ie(Ka,{})),Za={key:0,class:"wl-reaction"},Xa=["textContent"],Ya={class:"wl-reaction-list"},Ja=["onClick"],Qa={class:"wl-reaction-img"},el=["src","alt"],tl=["textContent"],al=["textContent"];var ll=se({__name:"ArticleReaction",setup(e,{expose:l}){l();const t=Oa(),a=Ce(we),n=z(-1),r=z([]),g=P(()=>a.value.locale),c=P(()=>a.value.reaction.length>0),w=P(()=>{const{reaction:h,path:S}=a.value;return h.map((R,$)=>({icon:R,desc:g.value[`reaction${$}`],active:t.value[S]===$}))});let m;const f=async()=>{if(!c.value)return;const{serverURL:h,lang:S,path:R,reaction:$}=a.value,y=new AbortController;m=y.abort.bind(y);const o=await It({serverURL:h,lang:S,paths:[R],type:$.map((d,W)=>`reaction${W}`),signal:y.signal});r.value=$.map((d,W)=>o[0][`reaction${W}`])},j=async h=>{if(n.value===-1){const{serverURL:S,lang:R,path:$}=a.value,y=t.value[$];n.value=h,y!==void 0&&(await ze({serverURL:S,lang:R,path:$,type:`reaction${y}`,action:"desc"}),r.value[y]=Math.max(r.value[y]-1,0)),y!==h&&(await ze({serverURL:S,lang:R,path:$,type:`reaction${h}`}),r.value[h]=(r.value[h]||0)+1),y===h?delete t.value[$]:t.value[$]=h,n.value=-1}};return pe(()=>{ee(()=>[a.value.serverURL,a.value.path],()=>{f()},{immediate:!0})}),Ve(()=>{m()}),(h,S)=>w.value.length?(s(),u("div",Za,[p("div",{class:"wl-reaction-title",textContent:M(g.value.reactionTitle)},null,8,Xa),p("ul",Ya,[(s(!0),u(B,null,Z(w.value,({active:R,icon:$,desc:y},o)=>(s(),u("li",{key:o,class:O(["wl-reaction-item",{active:R}]),onClick:d=>j(o)},[p("div",Qa,[p("img",{src:$,alt:y},null,8,el),n.value===o?(s(),te(E(ce),{key:0,class:"wl-reaction-loading"})):(s(),u("div",{key:1,class:"wl-reaction-votes",textContent:M(r.value[o]||0)},null,8,tl))]),p("div",{class:"wl-reaction-text",textContent:M(y)},null,8,al)],10,Ja))),128))])])):I("v-if",!0)}});const nl=["data-index"],il=["src","title","onClick"];var ol=se({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:l}){const t=e;l();let a=null;const n=ae("wall"),r=z({}),g=z([]),c=()=>{const h=Math.floor((n.value.getBoundingClientRect().width+t.gap)/(t.columnWidth+t.gap));return h>0?h:1},w=h=>new Array(h).fill(null).map(()=>[]),m=async h=>{var S;if(h>=t.items.length)return;await _e();const R=Array.from(((S=n.value)==null?void 0:S.children)??[]).reduce(($,y)=>y.getBoundingClientRect().height<$.getBoundingClientRect().height?y:$);g.value[Number(R.dataset.index)].push(h),await m(h+1)},f=async(h=!1)=>{if(g.value.length===c()&&!h)return;g.value=w(c());const S=window.scrollY;await m(0),window.scrollTo({top:S})},j=h=>{r.value[h.target.src]=!0};return pe(()=>{f(!0),a=new ResizeObserver(()=>{f()}),a.observe(n.value),ee(()=>[t.items],()=>{r.value={},f(!0)}),ee(()=>[t.columnWidth,t.gap],()=>{f()})}),Vt(()=>{a.unobserve(n.value)}),(h,S)=>(s(),u("div",{ref_key:"wall",ref:n,class:"wl-gallery",style:He({gap:`${h.gap}px`})},[(s(!0),u(B,null,Z(g.value,(R,$)=>(s(),u("div",{key:$,class:"wl-gallery-column","data-index":$,style:He({gap:`${h.gap}px`})},[(s(!0),u(B,null,Z(R,y=>(s(),u(B,{key:y},[r.value[h.items[y].src]?I("v-if",!0):(s(),te(E(ce),{key:0,size:36,style:{margin:"20px auto"}})),p("img",{class:"wl-gallery-item",src:h.items[y].src,title:h.items[y].title,loading:"lazy",onLoad:j,onClick:o=>h.$emit("insert",`![](${h.items[y].src})`)},null,40,il)],64))),128))],12,nl))),128))],4))}});const rl={key:0,class:"wl-login-info"},sl={class:"wl-avatar"},cl=["title"],ul=["title"],ml=["src"],vl=["title","textContent"],dl={class:"wl-panel"},pl=["for","textContent"],gl=["id","onUpdate:modelValue","name","type"],hl=["placeholder"],wl={class:"wl-preview"},fl=["innerHTML"],yl={class:"wl-footer"},bl={class:"wl-actions"},kl={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Cl=["title"],$l=["title"],Ll=["title","aria-label"],El=["title"],Il={class:"wl-info"},Al={class:"wl-text-number"},xl={key:0},Ml=["textContent"],Rl=["textContent"],Sl=["disabled"],jl=["placeholder"],Ul={key:1,class:"wl-loading"},zl={key:0,class:"wl-tab-wrapper"},Vl=["title","onClick"],Hl=["src","alt"],_l={key:0,class:"wl-tabs"},Tl=["onClick"],Fl=["src","alt","title"],Nl=["title"];var ht=se({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{emit:l}){const t=e,a=l,n=Ce(we),r=Pa(),g=Wa(),c=ye(),w=z({}),m=ae("textarea"),f=ae("image-uploader"),j=ae("emoji-button"),h=ae("emoji-popup"),S=ae("gif-button"),R=ae("gif-popup"),$=ae("gif-search"),y=z({tabs:[],map:{}}),o=z(0),d=z(!1),W=z(!1),X=z(!1),A=z(""),V=z(0),T=$e({loading:!0,list:[]}),ne=z(0),Q=z(!1),ue=z(""),b=z(!1),U=z(!1),k=P(()=>n.value.locale),F=P(()=>!!c.value.token),q=P(()=>n.value.imageUploader!==!1),G=v=>{const i=m.value,L=i.selectionStart,_=i.selectionEnd||0,C=i.scrollTop;r.value=i.value.substring(0,L)+v+i.value.substring(_,i.value.length),i.focus(),i.selectionStart=L+v.length,i.selectionEnd=L+v.length,i.scrollTop=C},re=v=>{if(b.value)return;const i=v.key;(v.ctrlKey||v.metaKey)&&i==="Enter"&&Re()},me=v=>{const i=`![${n.value.locale.uploading} ${v.name}]()`;return G(i),b.value=!0,Promise.resolve().then(()=>n.value.imageUploader(v)).then(L=>{r.value=r.value.replace(i,`\r | ||
![${v.name}](${L})`)}).catch(L=>{alert(L.message),r.value=r.value.replace(i,"")}).then(()=>{b.value=!1})},be=v=>{var i;if((i=v.dataTransfer)!=null&&i.items){const L=rt(v.dataTransfer.items);L&&q.value&&(me(L),v.preventDefault())}},bt=v=>{if(v.clipboardData){const i=rt(v.clipboardData.items);i&&q.value&&me(i)}},kt=()=>{const v=f.value;v.files&&q.value&&me(v.files[0]).then(()=>{v.value=""})},Re=async()=>{var v;const{serverURL:i,lang:L,login:_,wordLimit:C,requiredMeta:D,recaptchaV3Key:N,turnstileKey:Y}=n.value,H={comment:ue.value,nick:g.value.nick,mail:g.value.mail,link:g.value.link,url:n.value.path,ua:await Ra()};if(!t.edit)if(c.value.token)H.nick=c.value.display_name,H.mail=c.value.email,H.link=c.value.url;else{if(_==="force")return;if(D.includes("nick")&&!H.nick){w.value.nick.focus(),alert(k.value.nickError);return}if(D.includes("mail")&&!H.mail||H.mail&&!wa(H.mail)){w.value.mail.focus(),alert(k.value.mailError);return}H.nick||(H.nick=k.value.anonymous)}if(!H.comment){m.value.focus();return}if(!Q.value){alert(k.value.wordHint.replace("$0",C[0].toString()).replace("$1",C[1].toString()).replace("$2",V.value.toString()));return}H.comment=st(H.comment,y.value.map),t.replyId&&t.rootId&&(H.pid=t.replyId,H.rid=t.rootId,H.at=t.replyUser),b.value=!0;try{N&&(H.recaptchaV3=await qa(N).execute("social")),Y&&(H.turnstile=await Ga(Y).execute("social"));const ve={serverURL:i,lang:L,token:c.value.token,comment:H},ke=await(t.edit?de({objectId:t.edit.objectId,...ve}):At(ve));if(b.value=!1,ke.errmsg){alert(ke.errmsg);return}a("submit",ke.data),r.value="",A.value="",await _e(),t.replyId&&a("cancelReply"),(v=t.edit)!=null&&v.objectId&&a("cancelEdit")}catch(ve){b.value=!1,alert(ve.message)}},Ct=v=>{v.preventDefault();const{lang:i,serverURL:L}=n.value;xt({serverURL:L,lang:i}).then(_=>{c.value=_,(_.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(_)),a("log")})},$t=()=>{c.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),a("log")},Se=v=>{v.preventDefault();const{lang:i,serverURL:L}=n.value,_=800,C=800,D=(window.innerWidth-_)/2,N=(window.innerHeight-C)/2,Y=new URLSearchParams({lng:i,token:c.value.token}),H=window.open(`${L}/ui/profile?${Y.toString()}`,"_blank",`width=${_},height=${C},left=${D},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);H==null||H.postMessage({type:"TOKEN",data:c.value.token},"*")},Lt=v=>{var i,L,_,C;!((i=j.value)!=null&&i.contains(v.target))&&!((L=h.value)!=null&&L.contains(v.target))&&(d.value=!1),!((_=S.value)!=null&&_.contains(v.target))&&!((C=R.value)!=null&&C.contains(v.target))&&(W.value=!1)},je=async v=>{var i;const{scrollTop:L,clientHeight:_,scrollHeight:C}=v.target,D=(_+L)/C,N=n.value.search,Y=((i=$.value)==null?void 0:i.value)??"";D<.9||T.loading||U.value||(T.loading=!0,(N.more&&T.list.length?await N.more(Y,T.list.length):await N.search(Y)).length?T.list=[...T.list,...N.more&&T.list.length?await N.more(Y,T.list.length):await N.search(Y)]:U.value=!0,T.loading=!1,setTimeout(()=>{v.target.scrollTop=L},50))},Ue=Bt(v=>{T.list=[],U.value=!1,je(v)},300);return ee([n,V],([v,i])=>{const{wordLimit:L}=v;L?i<L[0]&&L[0]!==0?(ne.value=L[0],Q.value=!1):i>L[1]?(ne.value=L[1],Q.value=!1):(ne.value=L[1],Q.value=!0):(ne.value=0,Q.value=!0)},{immediate:!0}),Ne("click",Lt),Ne("message",({data:v})=>{!v||v.type!=="profile"||(c.value={...c.value,...v.data},[localStorage,sessionStorage].filter(i=>i.getItem("WALINE_USER")).forEach(i=>{i.setItem("WALINE_USER",JSON.stringify(c))}))}),ee(W,async v=>{var i;if(!v)return;const L=n.value.search;$.value&&($.value.value=""),T.loading=!0,T.list=await(((i=L.default)==null?void 0:i.call(L))??L.search("")),T.loading=!1}),pe(()=>{var v;(v=t.edit)!=null&&v.objectId&&(r.value=t.edit.orig),ee(()=>r.value,i=>{const{highlighter:L,texRenderer:_}=n.value;ue.value=i,A.value=Ia(i,{emojiMap:y.value.map,highlighter:L,texRenderer:_}),V.value=Ma(i),i?We(m.value):We.destroy(m.value)},{immediate:!0}),ee(()=>n.value.emoji,i=>ba(i).then(L=>{y.value=L}),{immediate:!0})}),(v,i)=>{var L,_;return s(),u("div",{key:E(c).token,class:"wl-comment"},[E(n).login!=="disable"&&F.value&&!((L=v.edit)!=null&&L.objectId)?(s(),u("div",rl,[p("div",sl,[p("button",{type:"submit",class:"wl-logout-btn",title:k.value.logout,onClick:$t},[K(E(ut),{size:14})],8,cl),p("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:Se},[p("img",{src:E(c).avatar,alt:"avatar"},null,8,ml)],8,ul)]),p("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:Se,textContent:M(E(c).display_name)},null,8,vl)])):I("v-if",!0),p("div",dl,[E(n).login!=="force"&&E(n).meta.length&&!F.value?(s(),u("div",{key:0,class:O(["wl-header",`item${E(n).meta.length}`])},[(s(!0),u(B,null,Z(E(n).meta,C=>(s(),u("div",{key:C,class:"wl-header-item"},[p("label",{for:`wl-${C}`,textContent:M(k.value[C]+(E(n).requiredMeta.includes(C)||!E(n).requiredMeta.length?"":`(${k.value.optional})`))},null,8,pl),ge(p("input",{id:`wl-${C}`,ref_for:!0,ref:D=>{D&&(w.value[C]=D)},"onUpdate:modelValue":D=>E(g)[C]=D,class:O(["wl-input",`wl-${C}`]),name:C,type:C==="mail"?"email":"text"},null,10,gl),[[Ht,E(g)[C]]])]))),128))],2)):I("v-if",!0),ge(p("textarea",{id:"wl-edit",ref:"textarea","onUpdate:modelValue":i[0]||(i[0]=C=>_t(r)?r.value=C:null),class:"wl-editor",placeholder:v.replyUser?`@${v.replyUser}`:k.value.placeholder,onKeydown:re,onDrop:be,onPaste:bt},null,40,hl),[[Tt,E(r)]]),ge(p("div",wl,[i[7]||(i[7]=p("hr",null,null,-1)),p("h4",null,M(k.value.preview)+":",1),p("div",{class:"wl-content",innerHTML:A.value},null,8,fl)],512),[[Te,X.value]]),p("div",yl,[p("div",bl,[p("a",kl,[K(E(Ha))]),ge(p("button",{ref:"emoji-button",type:"button",class:O(["wl-action",{active:d.value}]),title:k.value.emoji,onClick:i[1]||(i[1]=C=>d.value=!d.value)},[K(E(ja))],10,Cl),[[Te,y.value.tabs.length]]),E(n).search?(s(),u("button",{key:0,ref:"gif-button",type:"button",class:O(["wl-action",{active:W.value}]),title:k.value.gif,onClick:i[2]||(i[2]=C=>W.value=!W.value)},[K(E(Na))],10,$l)):I("v-if",!0),p("input",{id:"wl-image-upload",ref:"image-uploader",class:"upload","aria-hidden":"true",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:kt},null,544),q.value?(s(),u("label",{key:1,for:"wl-image-upload",class:"wl-action",title:k.value.uploadImage,"aria-label":k.value.uploadImage},[K(E(Ua))],8,Ll)):I("v-if",!0),p("button",{type:"button",class:O(["wl-action",{active:X.value}]),title:k.value.preview,onClick:i[3]||(i[3]=C=>X.value=!X.value)},[K(E(Va))],10,El)]),p("div",Il,[i[9]||(i[9]=p("div",{class:"wl-captcha-container"},null,-1)),p("div",Al,[le(M(V.value)+" ",1),E(n).wordLimit?(s(),u("span",xl,[i[8]||(i[8]=le(" / ")),p("span",{class:O({illegal:!Q.value}),textContent:M(ne.value)},null,10,Ml)])):I("v-if",!0),le(" "+M(k.value.word),1)]),E(n).login!=="disable"&&!F.value?(s(),u("button",{key:0,type:"button",class:"wl-btn",onClick:Ct,textContent:M(k.value.login)},null,8,Rl)):I("v-if",!0),E(n).login!=="force"||F.value?(s(),u("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:b.value,onClick:Re},[b.value?(s(),te(E(ce),{key:0,size:16})):(s(),u(B,{key:1},[le(M(k.value.submit),1)],64))],8,Sl)):I("v-if",!0)]),p("div",{ref:"gif-popup",class:O(["wl-gif-popup",{display:W.value}])},[p("input",{ref:"gif-search",type:"text",placeholder:k.value.gifSearchPlaceholder,onInput:i[4]||(i[4]=(...C)=>E(Ue)&&E(Ue)(...C))},null,40,jl),T.list.length?(s(),te(ol,{key:0,items:T.list,"column-width":200,gap:6,onInsert:i[5]||(i[5]=C=>G(C)),onScroll:je},null,8,["items"])):I("v-if",!0),T.loading?(s(),u("div",Ul,[K(E(ce),{size:30})])):I("v-if",!0)],2),p("div",{ref:"emoji-popup",class:O(["wl-emoji-popup",{display:d.value}])},[(s(!0),u(B,null,Z(y.value.tabs,(C,D)=>(s(),u(B,{key:C.name},[D===o.value?(s(),u("div",zl,[(s(!0),u(B,null,Z(C.items,N=>(s(),u("button",{key:N,type:"button",title:N,onClick:Y=>G(`:${N}:`)},[d.value?(s(),u("img",{key:0,class:"wl-emoji",src:y.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Hl)):I("v-if",!0)],8,Vl))),128))])):I("v-if",!0)],64))),128)),y.value.tabs.length>1?(s(),u("div",_l,[(s(!0),u(B,null,Z(y.value.tabs,(C,D)=>(s(),u("button",{key:C.name,type:"button",class:O(["wl-tab",{active:o.value===D}]),onClick:N=>o.value=D},[p("img",{class:"wl-emoji",src:C.icon,alt:C.name,title:C.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Fl)],10,Tl))),128))])):I("v-if",!0)],2)])]),v.replyId||(_=v.edit)!=null&&_.objectId?(s(),u("button",{key:1,type:"button",class:"wl-close",title:k.value.cancelReply,onClick:i[6]||(i[6]=C=>v.replyId?a("cancelReply"):a("cancelEdit"))},[K(E(ut),{size:24})],8,Nl)):I("v-if",!0)])}}});const Wl=["id"],Pl={class:"wl-user","aria-hidden":"true"},Bl=["src"],Dl={class:"wl-card"},Ol={class:"wl-head"},ql=["href"],Gl={key:1,class:"wl-nick"},Kl=["textContent"],Zl=["textContent"],Xl=["textContent"],Yl=["textContent"],Jl=["textContent"],Ql={class:"wl-comment-actions"},en=["title"],tn=["title"],an={class:"wl-meta","aria-hidden":"true"},ln=["data-value","textContent"],nn={key:0,class:"wl-content"},on={key:0},rn=["href"],sn=["innerHTML"],cn={key:1,class:"wl-admin-actions"},un={class:"wl-comment-status"},mn=["disabled","onClick","textContent"],vn={key:3,class:"wl-quote"};var dn=se({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","like","sticky","edit","reply","status"],setup(e,{emit:l}){const t=e,a=l,n=["approved","waiting","spam"],r=Ce(we),g=vt(),c=Dt(),w=ye(),m=P(()=>r.value.locale),f=P(()=>{const{link:o}=t.comment;return o?nt(o)?o:`https://${o}`:""}),j=P(()=>g.value.includes(t.comment.objectId)),h=P(()=>ga(new Date(t.comment.time),c.value,m.value)),S=P(()=>w.value.type==="administrator"),R=P(()=>t.comment.user_id&&w.value.objectId===t.comment.user_id),$=P(()=>{var o;return t.comment.objectId===((o=t.reply)==null?void 0:o.objectId)}),y=P(()=>{var o;return t.comment.objectId===((o=t.edit)==null?void 0:o.objectId)});return(o,d)=>{var W;const X=Ft("CommentCard",!0);return s(),u("div",{id:o.comment.objectId,class:"wl-card-item"},[p("div",Pl,[o.comment.avatar?(s(),u("img",{key:0,class:"wl-user-avatar",src:o.comment.avatar,alt:""},null,8,Bl)):I("v-if",!0),o.comment.type?(s(),te(E(Fa),{key:1})):I("v-if",!0)]),p("div",Dl,[p("div",Ol,[f.value?(s(),u("a",{key:0,class:"wl-nick",href:f.value,target:"_blank",rel:"nofollow noopener noreferrer"},M(o.comment.nick),9,ql)):(s(),u("span",Gl,M(o.comment.nick),1)),o.comment.type==="administrator"?(s(),u("span",{key:2,class:"wl-badge",textContent:M(m.value.admin)},null,8,Kl)):I("v-if",!0),o.comment.label?(s(),u("span",{key:3,class:"wl-badge",textContent:M(o.comment.label)},null,8,Zl)):I("v-if",!0),o.comment.sticky?(s(),u("span",{key:4,class:"wl-badge",textContent:M(m.value.sticky)},null,8,Xl)):I("v-if",!0),typeof o.comment.level=="number"?(s(),u("span",{key:5,class:O(`wl-badge level${o.comment.level}`),textContent:M(m.value[`level${o.comment.level}`]||`Level ${o.comment.level}`)},null,10,Yl)):I("v-if",!0),p("span",{class:"wl-time",textContent:M(h.value)},null,8,Jl),p("div",Ql,[S.value||R.value?(s(),u(B,{key:0},[p("button",{type:"button",class:"wl-edit",onClick:d[0]||(d[0]=A=>a("edit",o.comment))},[K(E(Ta))]),p("button",{type:"button",class:"wl-delete",onClick:d[1]||(d[1]=A=>a("delete",o.comment))},[K(E(Sa))])],64)):I("v-if",!0),p("button",{type:"button",class:"wl-like",title:j.value?m.value.cancelLike:m.value.like,onClick:d[2]||(d[2]=A=>a("like",o.comment))},[K(E(za),{active:j.value},null,8,["active"]),le(" "+M("like"in o.comment?o.comment.like:""),1)],8,en),p("button",{type:"button",class:O(["wl-reply",{active:$.value}]),title:$.value?m.value.cancelReply:m.value.reply,onClick:d[3]||(d[3]=A=>a("reply",$.value?null:o.comment))},[K(E(_a))],10,tn)])]),p("div",an,[(s(),u(B,null,Z(["addr","browser","os"],A=>(s(),u(B,null,[o.comment[A]?(s(),u("span",{key:A,class:O(`wl-${A}`),"data-value":o.comment[A],textContent:M(o.comment[A])},null,10,ln)):I("v-if",!0)],64))),64))]),y.value?I("v-if",!0):(s(),u("div",nn,["reply_user"in o.comment&&o.comment.reply_user?(s(),u("p",on,[p("a",{href:"#"+o.comment.pid},"@"+M(o.comment.reply_user.nick),9,rn),d[17]||(d[17]=p("span",null,": ",-1))])):I("v-if",!0),p("div",{innerHTML:o.comment.comment},null,8,sn)])),S.value&&!y.value?(s(),u("div",cn,[p("span",un,[(s(),u(B,null,Z(n,A=>p("button",{key:A,type:"submit",class:O(`wl-btn wl-${A}`),disabled:o.comment.status===A,onClick:V=>a("status",{status:A,comment:o.comment}),textContent:M(m.value[A])},null,10,mn)),64))]),S.value&&!("rid"in o.comment)?(s(),u("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:d[4]||(d[4]=A=>a("sticky",o.comment))},M(o.comment.sticky?m.value.unsticky:m.value.sticky),1)):I("v-if",!0)])):I("v-if",!0),$.value||y.value?(s(),u("div",{key:2,class:O({"wl-reply-wrapper":$.value,"wl-edit-wrapper":y.value})},[K(ht,{edit:o.edit,"reply-id":(W=o.reply)==null?void 0:W.objectId,"reply-user":o.comment.nick,"root-id":o.rootId,onLog:d[5]||(d[5]=A=>a("log")),onCancelReply:d[6]||(d[6]=A=>a("reply",null)),onCancelEdit:d[7]||(d[7]=A=>a("edit",null)),onSubmit:d[8]||(d[8]=A=>a("submit",A))},null,8,["edit","reply-id","reply-user","root-id"])],2)):I("v-if",!0),"children"in o.comment?(s(),u("div",vn,[(s(!0),u(B,null,Z(o.comment.children,A=>(s(),te(X,{key:A.objectId,comment:A,reply:o.reply,edit:o.edit,"root-id":o.rootId,onLog:d[9]||(d[9]=V=>a("log")),onDelete:d[10]||(d[10]=V=>a("delete",V)),onEdit:d[11]||(d[11]=V=>a("edit",V)),onLike:d[12]||(d[12]=V=>a("like",V)),onReply:d[13]||(d[13]=V=>a("reply",V)),onStatus:d[14]||(d[14]=V=>a("status",V)),onSticky:d[15]||(d[15]=V=>a("sticky",V)),onSubmit:d[16]||(d[16]=V=>a("submit",V))},null,8,["comment","reply","edit","root-id"]))),128))])):I("v-if",!0)])],8,Wl)}}});const wt="3.4.2",pn={"data-waline":""},gn={class:"wl-meta-head"},hn={class:"wl-count"},wn=["textContent"],fn={class:"wl-sort"},yn=["onClick"],bn={class:"wl-cards"},kn={key:1,class:"wl-operation"},Cn=["textContent"],$n={key:2,class:"wl-loading"},Ln=["textContent"],En={key:4,class:"wl-operation"},In=["textContent"],An={key:5,class:"wl-power"};var xn=se({__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 l=e,t=ye(),a=vt(),n=z("loading"),r=z(0),g=z(1),c=z(0),w=P(()=>va(l)),m=z(w.value.commentSorting),f=z([]),j=z(null),h=z(null),S=P(()=>da(w.value.dark)),R=P(()=>w.value.locale);Ot(S,{id:"waline-darkmode"});let $=null;const y=b=>{const{serverURL:U,path:k,pageSize:F}=w.value,q=new AbortController;n.value="loading",$==null||$(),Rt({serverURL:U,lang:w.value.lang,path:k,pageSize:F,sortBy:tt[m.value],page:b,signal:q.signal,token:t.value.token}).then(G=>{n.value="success",r.value=G.count,f.value.push(...G.data),g.value=b,c.value=G.totalPages}).catch(G=>{G.name!=="AbortError"&&(console.error(G.message),n.value="error")}),$=q.abort.bind(q)},o=()=>{y(g.value+1)},d=()=>{r.value=0,f.value=[],y(1)},W=b=>{m.value!==b&&(m.value=b,d())},X=b=>{j.value=b},A=b=>{h.value=b},V=b=>{if(h.value)h.value.comment=b.comment,h.value.orig=b.orig;else if("rid"in b){const U=f.value.find(({objectId:k})=>k===b.rid);if(!U)return;Array.isArray(U.children)||(U.children=[]),U.children.push(b)}else f.value.unshift(b),r.value+=1},T=async({comment:b,status:U})=>{if(b.status===U)return;const{serverURL:k,lang:F}=w.value;await de({serverURL:k,lang:F,token:t.value.token,objectId:b.objectId,comment:{status:U}}),b.status=U},ne=async b=>{if("rid"in b)return;const{serverURL:U,lang:k}=w.value;await de({serverURL:U,lang:k,token:t.value.token,objectId:b.objectId,comment:{sticky:b.sticky?0:1}}),b.sticky=!b.sticky},Q=async({objectId:b})=>{if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:U,lang:k}=w.value;await Mt({serverURL:U,lang:k,token:t.value.token,objectId:b}),f.value.some((F,q)=>F.objectId===b?(f.value=f.value.filter((G,re)=>re!==q),!0):F.children.some((G,re)=>G.objectId===b?(f.value[q].children=F.children.filter((me,be)=>be!==re),!0):!1))},ue=async b=>{const{serverURL:U,lang:k}=w.value,{objectId:F}=b,q=a.value.includes(F);await de({serverURL:U,lang:k,objectId:F,token:t.value.token,comment:{like:!q}}),q?a.value=a.value.filter(G=>G!==F):(a.value=[...a.value,F],a.value.length>50&&(a.value=a.value.slice(-50))),b.like=Math.max(0,(b.like||0)+(q?-1:1))};return Nt(we,w),pe(()=>{ee(()=>[l.serverURL,l.path],()=>{d()},{immediate:!0})}),Ve(()=>{$==null||$()}),(b,U)=>(s(),u("div",pn,[K(ll),!j.value&&!h.value?(s(),te(ht,{key:0,onLog:d,onSubmit:V})):I("v-if",!0),p("div",gn,[p("div",hn,[r.value?(s(),u("span",{key:0,class:"wl-num",textContent:M(r.value)},null,8,wn)):I("v-if",!0),le(" "+M(R.value.comment),1)]),p("ul",fn,[(s(!0),u(B,null,Z(E(ua),k=>(s(),u("li",{key:k,class:O([k===m.value?"active":""]),onClick:F=>W(k)},M(R.value[k]),11,yn))),128))])]),p("div",bn,[(s(!0),u(B,null,Z(f.value,k=>(s(),te(dn,{key:k.objectId,"root-id":k.objectId,comment:k,reply:j.value,edit:h.value,onLog:d,onReply:X,onEdit:A,onSubmit:V,onStatus:T,onDelete:Q,onSticky:ne,onLike:ue},null,8,["root-id","comment","reply","edit"]))),128))]),n.value==="error"?(s(),u("div",kn,[p("button",{type:"button",class:"wl-btn",onClick:d,textContent:M(R.value.refresh)},null,8,Cn)])):n.value==="loading"?(s(),u("div",$n,[K(E(ce),{size:30})])):f.value.length?g.value<c.value?(s(),u("div",En,[p("button",{type:"button",class:"wl-btn",onClick:o,textContent:M(R.value.more)},null,8,In)])):I("v-if",!0):(s(),u("div",{key:3,class:"wl-empty",textContent:M(R.value.sofa)},null,8,Ln)),w.value.copyright?(s(),u("div",An,[U[0]||(U[0]=le(" Powered by ")),U[1]||(U[1]=p("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1)),le(" v"+M(E(wt)),1)])):I("v-if",!0)]))}});const ft=(e,l)=>{l.forEach((t,a)=>{const n=e[a].time;typeof n=="number"&&(t.innerText=n.toString())})},yt=({serverURL:e,path:l=window.location.pathname,selector:t=".waline-pageview-count",update:a=!0,lang:n=navigator.language})=>{const r=new AbortController,g=Array.from(document.querySelectorAll(t)),c=m=>{const f=Me(m);return f!==null&&l!==f},w=m=>jt({serverURL:fe(e),paths:m.map(f=>Me(f)??l),lang:n,signal:r.signal}).then(f=>ft(f,m)).catch(ot);if(a){const m=g.filter(j=>!c(j)),f=g.filter(c);St({serverURL:fe(e),path:l,lang:n}).then(j=>ft(j,m)),f.length&&w(f)}else w(g);return r.abort.bind(r)},Mn=({el:e="#waline",path:l=window.location.pathname,comment:t=!1,pageview:a=!1,...n})=>{const r=e?xe(e):null;if(e&&!r)throw new Error("Option 'el' do not match any domElement!");if(!n.serverURL)throw new Error("Option 'serverURL' is missing!");const g=$e({...n}),c=$e({comment:t,pageview:a,path:l}),w=()=>{c.comment&&ct({serverURL:g.serverURL,path:c.path,...oe(c.comment)?{selector:c.comment}:{}})},m=()=>{c.pageview&&yt({serverURL:g.serverURL,path:c.path,...oe(c.pageview)?{selector:c.pageview}:{}})};let f=null;r&&(f=Wt(()=>x(xn,{path:c.path,...g})),f.mount(r));const j=Fe(w),h=Fe(m);return{el:r,update:({comment:S,pageview:R,path:$=window.location.pathname,...y}={})=>{Object.entries(y).forEach(([o,d])=>{g[o]=d}),c.path=$,S!==void 0&&(c.comment=S),R!==void 0&&(c.pageview=R)},destroy:()=>{f==null||f.unmount(),j(),h()}}},Rn=({el:e,serverURL:l,count:t,lang:a=navigator.language})=>{const n=ye(),r=xe(e),g=new AbortController;return Ut({serverURL:l,count:t,lang:a,signal:g.signal,token:n.value.token}).then(c=>r&&c.length?(r.innerHTML=`<ul class="wl-recent-list">${c.map(w=>`<li class="wl-recent-item"><a href="${w.url}">${w.nick}</a>:${w.comment}</li>`).join("")}</ul>`,{comments:c,destroy:()=>{g.abort(),r.innerHTML=""}}):{comments:c,destroy:()=>g.abort()})},Sn=({el:e,serverURL:l,count:t,locale:a,lang:n=navigator.language,mode:r="list"})=>{const g=xe(e),c=new AbortController;return zt({serverURL:l,pageSize:t,lang:n,signal:c.signal}).then(w=>!g||!w.length?{users:w,destroy:()=>c.abort()}:(a={...Qe(n),...typeof a=="object"?a:{}},g.innerHTML=`<ul class="wl-user-${r}">${w.map((m,f)=>[`<li class="wl-user-item" aria-label="${m.nick}">`,m.link&&`<a href="${m.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${m.avatar}" alt="${m.nick}">`,`<span class="wl-user-badge">${f+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',m.nick,m.level&&`<span class="wl-badge">${a?a[`level${m.level}`]:`Level ${m.level}`}</span>`,m.label&&`<span class="wl-badge">${m.label}</span>`,"</div>",m.link&&m.link,"</div>",m.link&&"</a>","</li>"].filter(j=>j).join("")).join("")}</ul>`,{users:w,destroy:()=>{c.abort(),g.innerHTML=""}}))};export{Rn as RecentComments,Sn as UserList,ct as commentCount,he as defaultLocales,Mn as init,yt as pageviewCount,wt as version}; | ||
//# sourceMappingURL=slim.js.map |
{ | ||
"name": "@waline/client", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "client for waline comment system", | ||
@@ -88,3 +88,3 @@ "keywords": [ | ||
"autosize": "^6.0.1", | ||
"marked": "^15.0.2", | ||
"marked": "^15.0.4", | ||
"marked-highlight": "^2.2.1", | ||
@@ -101,3 +101,3 @@ "recaptcha-v3": "^1.11.3", | ||
"user-agent-data-types": "0.4.2", | ||
"vite": "6.0.1" | ||
"vite": "6.0.3" | ||
}, | ||
@@ -104,0 +104,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3141041
3321
Updatedmarked@^15.0.4