xvaline
Version:
comment system with spam checking and review, based on Valine.
12 lines • 224 kB
JavaScript
/*!
* XValine v0.0.5
* (c) 2017-2020 xCss & Tony.Xu
* Released under the GPL-2.0 License.
* Last Update: 7/5/2020, 4:22:40 PM
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Valine=t():e.Valine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){var r,i,o;/*!
autosize 4.0.2
license: MIT
http://www.jacklmoore.com/autosize
*/
!function(n,s){i=[e,t],r=s,void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e){function t(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function n(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function r(){if(0!==e.scrollHeight){var t=n(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+a+"px",u=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}}function i(){r();var n=Math.round(parseFloat(e.style.height)),i=window.getComputedStyle(e,null),o="content-box"===i.boxSizing?Math.round(parseFloat(i.height)):e.offsetHeight;if(o<n?"hidden"===i.overflowY&&(t("scroll"),r(),o="content-box"===i.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==i.overflowY&&(t("hidden"),r(),o="content-box"===i.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),c!==o){c=o;var a=s("autosize:resized");try{e.dispatchEvent(a)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var a=null,u=null,c=null,l=function(){e.clientWidth!==u&&i()},h=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",h,!1),e.removeEventListener("autosize:update",i,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",h,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:h,update:i}),function(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),a="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(a)&&(a=0),i()}()}}function r(e){var t=o.get(e);t&&t.destroy()}function i(e){var t=o.get(e);t&&t.update()}var o="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,r){-1===e.indexOf(n)&&(e.push(n),t.push(r))},delete:function(n){var r=e.indexOf(n);r>-1&&(e.splice(r,1),t.splice(r,1))}}}(),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),t.default=a,e.exports=t.default})},function(e,t,n){"use strict";function r(e){var t=this;return t.init(e),t}function i(e){return new r(e)}var o=n(10).version,s=n(6),a=n(9),u=n(0),c=n(5),l=n(3),h=n(4),f=n(2),d=n(7),p=n(8),v={comment:"",nick:"Anonymous",mail:"",link:"",ua:navigator.userAgent,url:""},_={"zh-cn":{head:{nick:"昵称",mail:"邮箱(必填)",link:"网址(http://)"},tips:{comments:"评论",sofa:"快来做第一个评论的人吧~",busy:"还在提交中,请稍候...",again:"这么简单也能错,也是没谁了."},ctrl:{reply:"回复",ok:"好的",sure:"确认",cancel:"取消",confirm:"确认",continue:"继续",more:"查看更多...",try:"再试试?",preview:"预览",emoji:"表情"},error:{99:"初始化失败,请检查init中的`el`元素.",100:"初始化失败,请检查你的AppId和AppKey.",401:"未经授权的操作,请检查你的AppId和AppKey.",403:"访问被api域名白名单拒绝,请检查你的安全域名设置."},timeago:{seconds:"秒前",minutes:"分钟前",hours:"小时前",days:"天前",now:"刚刚"}},en:{head:{nick:"NickName",mail:"E-Mail",link:"Website(http://)"},tips:{comments:"Comments",sofa:"No comments yet.",busy:"Submit is busy, please wait...",again:"Sorry, this is a wrong calculation."},ctrl:{reply:"Reply",ok:"Ok",sure:"Sure",cancel:"Cancel",confirm:"Confirm",continue:"Continue",more:"Load More...",try:"Once More?",preview:"Preview",emoji:"Emoji"},error:{99:"Initialization failed, Please check the `el` element in the init method.",100:"Initialization failed, Please check your appId and appKey.",401:"Unauthorized operation, Please check your appId and appKey.",403:"Access denied by api domain white list, Please check your security domain."},timeago:{seconds:"seconds ago",minutes:"minutes ago",hours:"hours ago",days:"days ago",now:"just now"}}},g={cdn:"https://gravatar.loli.net/avatar/",ds:["mp","identicon","monsterid","wavatar","robohash","retro",""],params:"",hide:!1},m=["nick","mail","link"],y=Storage&&localStorage&&localStorage instanceof Storage&&localStorage;r.prototype.init=function(e){var t=this;return t.config=e,"undefined"==typeof document?void console:(!!e&&t._init(),t)},r.prototype._init=function(){var e=this;try{var t=e.config,n=t.lang,r=t.langMode,i=t.avatar,s=t.avatarForce,u=(t.avatar_cdn,t.notify),c=t.verify,l=t.visitor,f=t.path,y=void 0===f?location.pathname:f,b=t.pageSize,O=t.recordIP,x=t.clazzName,S=void 0===x?"Comment":x,A=t.requireReview,E=void 0===A||A,k=t.banKeywords,C=void 0===k?"default":k;e.config.path=y.replace(/index\.html?$/,""),e.config.clazzName=S,e.config.requireReview=E,e.config.banKeywords=C;var T=g.ds,N=s?"&q="+Math.random().toString(32).substring(2):"";n&&r&&e.installLocale(n,r),e.locale=e.locale||_[n||"zh-cn"],e.notify=u||!1,e.verify=c||!1,g.params="?d="+(T.indexOf(i)>-1?i:"mp")+"&v="+o+N,g.hide="hide"===i;var j=Number(b||10);if(e.config.pageSize=isNaN(j)?10:j<1?10:j,a.setOptions({renderer:new a.Renderer,highlight:!1===e.config.highlight?null:d,gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!0}),O){var U=h.create("script","src","//api.ip.sb/jsonip?callback=getIP"),I=document.getElementsByTagName("script")[0];I.parentNode.insertBefore(U,I),window.getIP=function(e){v.ip=e.ip}}var R=e.config.app_id||e.config.appId,P=e.config.app_key||e.config.appKey;if(!R||!P)throw 99;var L="https://",D="";if(!e.config.serverURLs)switch(R.slice(-9)){case"-9Nh9j0Va":L+="tab.";break;case"-MdYXbMMI":L+="us."}D=e.config.serverURLs||L+"avoscloud.com";try{p.init({appId:R,appKey:P,serverURLs:D})}catch(e){}var F="";switch(C){case void 0:break;case"default":F="https://cdn.jsdelivr.net/gh/xunge0613/cdn@latest/blog/json/ban-keywords.json";break;case(C.match(/^https?:\/\/.+/)||{}).input:F=C}if(F){var M=new XMLHttpRequest;M.open("GET",F,!0),M.send(),M.onreadystatechange=function(t){if(4==M.readyState&&200==M.status)try{if(M.response){var n=JSON.parse(M.response);e.bannedKeywords=n.data}}catch(e){}}}var q=h.findAll(document,".valine-comment-count");h.each(q,function(t,n){if(n){var r=h.attr(n,"data-xid");r&&e.Q(r).count().then(function(e){n.innerText=e}).catch(function(e){n.innerText=0})}}),l&&w.add(p.Object.extend("Counter"),e.config.path);var $=e.config.el||null,B=h.findAll(document,$);if(!($=$ instanceof HTMLElement?$:B[B.length-1]||null))return;e.el=$;try{e.el.classList.add("v")}catch(t){e.el.setAttribute("class",e.el.getAttribute("class")+" v")}g.hide&&e.el.classList.add("hide-avatar"),e.config.meta=(e.config.guest_info||e.config.meta||m).filter(function(e){return m.indexOf(e)>-1});var W=(0==e.config.meta.length?m:e.config.meta).map(function(t){var n="mail"==t?"email":"text";return m.indexOf(t)>-1?'<input name="'+t+'" placeholder="'+e.locale.head[t]+'" class="v'+t+' vinput" type="'+n+'">':""});e.placeholder=e.config.placeholder||"Just Go Go",e.el.innerHTML='<div class="vwrap"><div class="vheader item'+W.length+'">'+W.join("")+'</div><div class="vedit"><textarea id="veditor" class="veditor vinput" placeholder="'+e.placeholder+'"></textarea><div class="vctrl"><span class="vemoji-btn">'+e.locale.ctrl.emoji+'</span> | <span class="vpreview-btn">'+e.locale.ctrl.preview+'</span></div><div class="vemojis" style="display:none;"></div><div class="vinput vpreview" style="display:none;"></div></div><div class="vcontrol"><div class="col col-20" title="Markdown is supported"><a href="https://segmentfault.com/markdown" target="_blank"><svg class="markdown" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" 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"></path></svg></a></div><div class="col col-80 text-right"><button type="button" title="Cmd|Ctrl+Enter" class="vsubmit vbtn">'+e.locale.ctrl.reply+'</button></div></div><div style="display:none;" class="vmark"></div></div><div class="vinfo" style="display:none;"><div class="vcount col"></div></div><div class="vlist"></div><div class="vempty" style="display:none;"></div><div class="vpage txt-center"></div><div class="info"><div class="power txt-right">Powered By <a href="https://github.com/xunge0613/XValine" target="_blank">XValine</a><br>v'+o+"</div></div>";var z=h.find(e.el,".vempty");e.nodata={show:function(t){return z.innerHTML=t||e.locale.tips.sofa,h.attr(z,"style","display:block;"),e},hide:function(){return h.attr(z,"style","display:none;"),e}};var Q=h.create("div","class","vloading"),J=h.find(e.el,".vlist");e.loading={show:function(t){var n=h.findAll(J,".vcard");return t?J.insertBefore(Q,n[0]):J.appendChild(Q),e.nodata.hide(),e},hide:function(){var t=h.find(J,".vloading");return t&&h.remove(t),0===h.findAll(J,".vcard").length&&e.nodata.show(),e}};var V=h.find(e.el,".vmark");e.alert={show:function(t){V.innerHTML='<div class="valert txt-center"><div class="vtext">'+(t&&t.text||1)+'</div><div class="vbtns"></div></div>';var n=h.find(V,".vbtns"),r='<button class="vcancel vbtn">'+(t&&t.ctxt||e.locale.ctrl.cancel)+"</button>",i='<button class="vsure vbtn">'+(t&&t.otxt||e.locale.ctrl.sure)+"</button>";if(n.innerHTML=""+r+(t&&t.type&&i),h.on("click",h.find(V,".vcancel"),function(t){e.alert.hide()}),h.attr(V,"style","display:block;"),t&&t.type){var o=h.find(V,".vsure");h.on("click",o,function(n){e.alert.hide(),t.cb&&t.cb()})}return e},hide:function(){return h.attr(V,"style","display:none;"),e}},e.bind()}catch(t){e.ErrorHandler(t,"init")}};var b=function(e,t){var n=new e,r=new p.ACL;r.setPublicReadAccess(!0),r.setPublicWriteAccess(!0),n.setACL(r),n.set("url",t.url),n.set("xid",t.xid),n.set("title",t.title),n.set("time",1),n.save().then(function(e){h.find(t.el,".leancloud-visitors-count").innerText=1}).catch(function(e){})},w={add:function(e,t){var n=h.findAll(document,".leancloud_visitors,.leancloud-visitors");if(n.length){var r=n[0],i=h.attr(r,"id"),o=h.attr(r,"data-flag-title"),s=encodeURI(i),a={el:r,url:i,xid:s,title:o};if(decodeURI(i)===decodeURI(t)){var u=new p.Query(e);u.equalTo("url",i),u.find().then(function(t){if(t.length>0){var n=t[0];n.increment("time"),n.save().then(function(e){h.find(r,".leancloud-visitors-count").innerText=e.get("time")}).catch(function(e){})}else b(e,a)}).catch(function(t){101==t.code&&b(e,a)})}else w.show(e,n)}},show:function(e,t){h.each(t,function(e,t){var n=h.find(t,".leancloud-visitors-count");n&&(n.innerText=0)});var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push(h.attr(t[r],"id"));if(n.length){var i=new p.Query(e);i.containedIn("url",n),i.find().then(function(e){e.length>0&&h.each(e,function(e,t){var n=t.get("url"),r=t.get("time"),i=h.findAll(document,'.leancloud_visitors[id="'+n+'"],.leancloud-visitors[id="'+n+'"]');h.each(i,function(e,t){var n=h.find(t,".leancloud-visitors-count");n&&(n.innerText=r)})})}).catch(function(e){})}}};r.prototype.Q=function(e){var t=this;if(1==arguments.length){var n=new p.Query(t.config.clazzName);n.doesNotExist("rid");var r=new p.Query(t.config.clazzName);r.equalTo("rid","");var i=p.Query.or(n,r);return"*"===e?i.exists("url"):i.equalTo("url",decodeURI(e)),i.addDescending("createdAt"),i.addDescending("insertedAt"),i}var o=JSON.stringify(arguments[1]).replace(/(\[|\])/g,""),s="select * from "+t.config.clazzName+" where rid in ("+o+") order by -createdAt,-createdAt";return p.Query.doCloudQuery(s)},r.prototype.ErrorHandler=function(e,t){var n=this;if(n.el&&n.loading.hide().nodata.hide(),"[object Error]"==={}.toString.call(e)){var r=e.code||"",i=n.locale.error[r],o=i||e.message||e.error||"";101==r?n.nodata.show():n.el&&n.nodata.show('<pre style="text-align:left;">Code '+r+": "+o+"</pre>")||console}else n.el&&n.nodata.show('<pre style="text-align:left;">'+JSON.stringify(e)+"</pre>")||console},r.prototype.installLocale=function(e,t){var n=this;return t=t||{},e&&(_[e]=t,n.locale=_[e]||_["zh-cn"]),n},r.prototype.setPath=function(e){return this.config.path=e,this},r.prototype.bind=function(e){var t=this,n=h.find(t.el,".vemojis"),r=h.find(t.el,".vpreview"),i=h.find(t.el,".vemoji-btn"),o=h.find(t.el,".vpreview-btn"),d=h.find(t.el,".veditor"),_=f.data;for(var m in _)_.hasOwnProperty(m)&&function(e,t){var r=h.create("i",{name:e,title:e});r.innerHTML=t,n.appendChild(r),h.on("click",r,function(e){C(d,t),w(d)})}(m,_[m]);t.emoji={show:function(){return t.preview.hide(),h.attr(i,"v",1),h.removeAttr(o,"v"),h.attr(n,"style","display:block"),t.emoji},hide:function(){return h.removeAttr(i,"v"),h.attr(n,"style","display:hide"),t.emoji}},t.preview={show:function(){return v.comment&&(t.emoji.hide(),h.attr(o,"v",1),h.removeAttr(i,"v"),r.innerHTML=v.comment,h.attr(r,"style","display:block"),U()),t.preview},hide:function(){return h.removeAttr(o,"v"),h.attr(r,"style","display:none"),t.preview},empty:function(){return r.innerHtml="",t.preview}};var b=function(e){var t=h.create("div");t.insertAdjacentHTML("afterbegin",e);var n=h.findAll(t,"*"),r=["INPUT","STYLE","SCRIPT","IFRAME","FRAME","AUDIO","VIDEO","EMBED","META","TITLE","LINK"],i=function(e,t){var n=h.attr(e,t);n&&h.attr(e,t,n.replace(/(javascript|eval)/gi,""))};return h.each(n,function(e,t){1===t.nodeType&&(r.indexOf(t.nodeName)>-1&&("INPUT"===t.nodeName&&"checkbox"===h.attr(t,"type")?h.attr(t,"disabled","disabled"):h.remove(t)),"A"===t.nodeName&&i(t,"href"),h.clearAttr(t))}),t.innerHTML},w=function(e){var t=e.value||"";t=f.parse(t),e.value=t;var n=b(a(t));v.comment=n,r.innerHTML=n,t?u(e):u.destroy(e)};h.on("click",i,function(e){h.attr(i,"v")?t.emoji.hide():t.emoji.show()}),h.on("click",o,function(e){h.attr(o,"v")?t.preview.hide():t.preview.show()});for(var O=t.config.meta,x={},S={veditor:"comment"},A=0,E=O.length;A<E;A++)S["v"+O[A]]=O[A];for(var k in S)S.hasOwnProperty(k)&&function(){var e=S[k],n=h.find(t.el,"."+k);x[e]=n,n&&h.on("input change blur",n,function(t){"comment"===e?w(n):v[e]=h.escape(n.value.replace(/(^\s*)|(\s*$)/g,"")).substring(0,20)})}();var C=function(e,t){if(document.selection){e.focus();document.selection.createRange().text=t,e.focus()}else if(e.selectionStart||"0"==e.selectionStart){var n=e.selectionStart,r=e.selectionEnd,i=e.scrollTop;e.value=e.value.substring(0,n)+t+e.value.substring(r,e.value.length),e.focus(),e.selectionStart=n+t.length,e.selectionEnd=n+t.length,e.scrollTop=i}else e.focus(),e.value+=t},T=function(e){var n=h.find(t.el,".vh[rootid='"+e+"']"),r=h.find(n,".vquote");return r||(r=h.create("div","class","vquote"),n.appendChild(r)),r},N=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=t.config.pageSize,i=Number(h.find(t.el,".vnum").innerText);t.loading.show();var o=t.Q(t.config.path);o.limit(r),o.skip((n-1)*r),o.find().then(function(o){for(var s=o.length,a=[],u=0;u<s;u++){var c=o[u];a.push(c.id),j(c,h.find(t.el,".vlist"),!0)}t.Q(t.config.path,a).then(function(e){for(var t=e&&e.results||[],n=0;n<t.length;n++){var r=t[n];j(r,T(r.get("rid")))}});var l=h.find(t.el,".vpage");l.innerHTML=r*n<i?'<button type="button" class="vmore vbtn">'+t.locale.ctrl.more+"</button>":"";var f=h.find(l,".vmore");f&&h.on("click",f,function(t){l.innerHTML="",e(++n)}),t.loading.hide()}).catch(function(e){t.loading.hide().ErrorHandler(e,"query")})};t.Q(t.config.path).count().then(function(e){e>0?(h.attr(h.find(t.el,".vinfo"),"style","display:block;"),h.find(t.el,".vcount").innerHTML='<span class="vnum">'+e+"</span> "+t.locale.tips.comments,N()):t.loading.hide()}).catch(function(e){t.ErrorHandler(e,"count")});var j=function(e,n,r){var i=h.create("div",{class:"vcard",id:e.id}),o=g.hide?"":'<img class="vimg" src="'+(g.cdn+s(e.get("mail"))+g.params)+'">',a=e.get("ua")||"",u="";if(a){a=l(a);u='<span class="vsys">'+a.browser+" "+a.version+"</span>"+" "+('<span class="vsys">'+a.os+" "+a.osVersion+"</span>")}"*"===t.config.path&&(u='<a href="'+e.get("url")+'" class="vsys">'+e.get("url")+"</a>");var f="",d=e.get("link")?/^https?\:\/\//.test(e.get("link"))?e.get("link"):"http://"+e.get("link"):"";f=d?'<a class="vnick" rel="nofollow" href="'+d+'" target="_blank" >'+e.get("nick")+"</a>":'<span class="vnick">'+e.get("nick")+"</span>";var p="";p=t.config.requireReview&&e.get("isSpam")?'该评论需要审核后才可以显示哦~ ヾ(๑╹◡╹)ノ"':b(e.get("comment")),i.innerHTML=o+'\n <div class="vh" rootid='+(e.get("rid")||e.id)+'>\n <div class="vhead">'+f+" "+u+'</div>\n <div class="vmeta">\n <span class="vtime">'+c(e.get("insertedAt")||e.createdAt,t.locale)+'</span>\n <span class="vat">'+t.locale.ctrl.reply+'</span>\n </div>\n <div class="vcontent">\n '+p+"\n </div>\n </div>";for(var v=h.find(i,".vat"),_=h.findAll(i,"a"),m=0,y=_.length;m<y;m++){var w=_[m];w&&-1==(h.attr(w,"class")||"").indexOf("at")&&h.attr(w,{target:"_blank",rel:"nofollow"})}var O=h.findAll(n,".vcard");r?n.appendChild(i):n.insertBefore(i,O[0]);var x=h.find(i,".vcontent");x&&I(x),v&&P(v,e),U()},U=function(){setTimeout(function(){try{"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),"undefined"!=typeof hljs&&(h.each(h.findAll("pre code"),function(e,t){hljs.highlightBlock(t)}),h.each(h.findAll("code.hljs"),function(e,t){hljs.lineNumbersBlock(t)}))}catch(e){}},200)},I=function(e){setTimeout(function(){e.offsetHeight>180&&(e.classList.add("expand"),h.on("click",e,function(t){h.attr(e,"class","vcontent")}))})},R={},P=function(e,t){h.on("click",e,function(e){var n="@"+h.escape(t.get("nick"));R={at:h.escape(n)+" ",rid:t.get("rid")||t.id,pid:t.id,rmail:t.get("mail")},h.attr(x.comment,"placeholder",n),x.comment.focus()})};!function(){var e=y&&y.ValineCache;if(e){e=JSON.parse(e);var n=O;for(var r in n){var i=n[r];h.find(t.el,".v"+i).value=h.unescape(e[i]),v[i]=e[i]}}}();var L=function(){v.comment="",x.comment.value="",w(x.comment),h.attr(x.comment,"placeholder",t.placeholder),R={},t.preview.empty().hide()},D=function(e){if(!t.bannedKeywords||0===t.bannedKeywords.length)return"";if(t.bannedKeywords&&t.bannedKeywords.length>0){return t.bannedKeywords.find(function(t){return e.includes(t)})}},F=h.find(t.el,".vsubmit"),M=function(e){if(h.attr(F,"disabled"))return void t.alert.show({type:0,text:t.locale.tips.busy+'ヾ(๑╹◡╹)ノ"',ctxt:t.locale.ctrl.ok});if(v.nick.length<3)return void x.nick.focus();if(v.mail.length<6||v.mail.indexOf("@")<1||v.mail.indexOf(".")<3)return void x.mail.focus();if(""===v.comment)return void x.comment.focus();var n=D(v.nick)||D(v.comment);if(n)return void t.alert.show({type:0,text:'评论中不可以包含"'+n+'"哦ヾ(๑╹◡╹)ノ"',ctxt:t.locale.ctrl.ok});v.nick=v.nick||"Anonymous",t.config.requireReview&&(v.isSpam=!0),t.notify||t.verify?B($):$()},q=function(){var e=new p.ACL;return e.setPublicReadAccess(!0),e.setPublicWriteAccess(!1),e},$=function(){h.attr(F,"disabled",!0),t.loading.show(!0);var e=p.Object.extend(t.config.clazzName||"Comment"),n=new e;if(v.url=decodeURI(t.config.path),v.insertedAt=new Date,R.rid){var r=R.pid||R.rid;n.set("rid",R.rid),n.set("pid",r),v.comment=v.comment.replace("<p>",'<p><a class="at" href="#'+r+'">'+R.at+"</a> , ")}for(var i in v)if(v.hasOwnProperty(i)){var o=v[i];n.set(i,o)}n.setACL(q()),n.save().then(function(e){"Anonymous"!=v.nick&&y&&y.setItem("ValineCache",JSON.stringify({nick:v.nick,link:v.link,mail:v.mail}));var n=h.find(t.el,".vnum"),r=1;try{if(R.rid){var i=h.find(t.el,'.vquote[rid="'+R.rid+'"]')||T(R.rid);t.config.requireReview&&t.alert.show({type:0,text:'评论已成功提交,请耐心等待审核通过哦ヾ(๑╹◡╹)ノ"',ctxt:t.locale.ctrl.ok}),j(e,i,!0)}else n?(r=Number(n.innerText)+1,n.innerText=r):h.find(t.el,".vcount").innerHTML='<span class="num">1</span> '+t.locale.tips.comments,t.config.requireReview&&t.alert.show({type:0,text:'评论已成功提交,请耐心等待审核通过哦ヾ(๑╹◡╹)ノ"',ctxt:t.locale.ctrl.ok}),j(e,h.find(t.el,".vlist")),t.config.pageSize++;v.mail&&W({username:v.nick,mail:v.mail}),R.at&&R.rmail&&t.notify&&z({username:R.at.replace("@",""),mail:R.rmail}),h.removeAttr(F,"disabled"),t.loading.hide(),L()}catch(e){t.ErrorHandler(e,"save")}}).catch(function(e){t.ErrorHandler(e,"commitEvt")})},B=function e(n){var r=Math.floor(10*Math.random()+1),i=Math.floor(10*Math.random()+1),o=Math.floor(10*Math.random()+1),s=["+","-","x"],a=s[Math.floor(3*Math.random())],u=s[Math.floor(3*Math.random())],c=""+r+a+i+u+o,l=c+" = <input class='vcode vinput' >";t.alert.show({type:1,text:l,ctxt:t.locale.ctrl.cancel,otxt:t.locale.ctrl.ok,cb:function(){var r=+h.find(t.el,".vcode").value;new Function("return "+c.replace(/x/g,"*"))()===r?n&&n():t.alert.show({type:1,text:"(T_T)"+t.locale.tips.again,ctxt:t.locale.ctrl.cancel,otxt:t.locale.ctrl.try,cb:function(){e(n)}})}})},W=function(e){var t=new p.User;return t.setUsername(e.username),t.setPassword(e.mail),t.setEmail(e.mail),t.setACL(q()),t.signUp()},z=function e(n){p.User.requestPasswordReset(n.mail).then(function(e){}).catch(function(r){1==r.code?t.alert.show({type:0,text:"ヾ(o・ω・)ノ At太频繁啦,提醒功能暂时宕机。<br>"+r.error,ctxt:t.locale.ctrl.ok}):W(n).then(function(t){e(n)}).catch(function(e){})})};h.on("click",F,M),h.on("keydown",document,function(e){e=event||e;var t=e.keyCode||e.which||e.charCode;((e.ctrlKey||e.metaKey)&&13===t&&M(),9===t)&&("veditor"==(document.activeElement.id||"")&&(e.preventDefault(),C(d," ")))}),h.on("paste",document,function(e){var t="clipboardData"in e?e.clipboardData:e.originalEvent&&e.originalEvent.clipboardData||window.clipboardData,n=t&&t.items,r=[];if(n&&n.length>0){for(var i=0;i<n.length;i++)if(-1!==n[i].type.indexOf("image")){r.push(n[i].getAsFile());break}if(r.length){for(var o in r)!function(e){var t=r[e],n="![Uploading "+t.name+"]()";C(d,n),t&&Q(t,function(e,r){!e&&r&&(d.value=d.value.replace(n,"\r\n"))})}(o)}}});var Q=function(e,t){var n=new FormData;n.append("file",e);var r=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");r.onreadystatechange=function(){if(4==r.readyState&&200==r.status)try{var e=JSON.parse(r.responseText);t&&t(null,e)}catch(e){t&&t(e)}else t&&t(r.status)},r.onerror=function(e){},r.open("POST","https://imgkr.com/api/files/upload",!0),r.send(n)}},e.exports=i,e.exports.default=i},function(e,t,n){"use strict";var r={data:n(13),parse:function(e){return String(e).replace(/:(.+?):/g,function(e,t){return r.data[t]||e})}};e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n={Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,360:e.indexOf("360EE")>-1||e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Pad")>-1||e.indexOf("Nexus 7")>-1};n.Mobile&&(n.Mobile=!(e.indexOf("iPad")>-1));var r={engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Kindle","360","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet"]};t.device="PC";for(var i in r)for(var o=0;o<r[i].length;o++){var s=r[i][o];n[s]&&(t[i]=s)}var a={Windows:function(){var t=e.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[t]||t},Android:function(){return e.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return e.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return e.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return e.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return e.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return e.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};t.osVersion="",a[t.os]&&(t.osVersion=a[t.os](),t.osVersion==e&&(t.osVersion=""));var u={Safari:function(){return e.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return e.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return e.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return e.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return e.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return e.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return e.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return e.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return e.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return e.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Kindle:function(){return e.replace(/^.*Version\/([\d.]+).*$/,"$1")},Maxthon:function(){return e.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return e.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return e.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return e.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return e.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return e.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},"2345Explorer":function(){return e.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return e.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return e.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return e.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return e.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return e.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return e.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return e.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return e.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return e.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return e.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return e.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};t.version="",u[t.browser]&&(t.version=u[t.browser](),t.version==e&&(t.version="")),"Edge"==t.browser?t.engine="EdgeHTML":"Chrome"==t.browser&&parseInt(t.version)>27?t.engine="Blink":"Opera"==t.browser&&parseInt(t.version)>12?t.engine="Blink":"Yandex"==t.browser?t.engine="Blink":void 0==t.browser&&(t.browser="Unknow App")}function i(e){return new r(e)}e.exports=i},function(e,t,n){"use strict";var r=(window,document,{}),i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\\":"\"};for(var o in i)r[i[o]]=o;var s=/[&<>"'`\\]/g,a=RegExp(s.source),u=/&(?:amp|lt|gt|quot|#39|#x60|#x5c);/g,c=RegExp(u.source),l={on:function(e,t,n,r){e=e.split(" ");for(var i=0,o=e.length;i<o;i++)l.off(e[i],t,n,r),t.addEventListener?t.addEventListener(e[i],n,r||!1):t.attachEvent?t.attachEvent("on"+e[i],n):t["on"+e[i]]=n},off:function(e,t,n,r){e=e.split(" ");for(var i=0,o=e.length;i<o;i++)t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null},escape:function(e){return e&&a.test(e)?e.replace(s,function(e){return i[e]}):e},unescape:function(e){return e&&c.test(e)?e.replace(u,function(e){return r[e]}):e},create:function(e,t,n){var r=document.createElement(e);return l.attr(r,t,n),r},find:function(e,t){return e.querySelector(t)},findAll:function(e,t){return e.querySelectorAll(t)},attr:function(e,t,n){if(void 0===e.getAttribute)return l.prop(e,t,n);if(void 0!==n)null===n?l.removeAttr(e,t):e.setAttribute(t,n);else{if("[object Object]"!=={}.toString.call(t))return e.getAttribute(t);l.each(t,function(t,n){e.setAttribute(t,n)})}},prop:function(e,t,n){return void 0!==n?e[t]=n:"[object Object]"!=={}.toString.call(t)?e[t]:void l.each(t,function(t,n){e[t]=n})},removeAttr:function(e,t){var n=void 0,r=0,i=t&&t.match(/[^\x20\t\r\n\f\*\/\\]+/g);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n);return e},clearAttr:function(e){var t=e.attributes,n=["align","alt","checked","class","disabled","href","id","target","title","type","src","style"];return l.each(t,function(t,r){var i=r.name;switch(i.toLowerCase()){case"style":var o=r.value;l.each(o.split(";"),function(t,n){n.indexOf("color")>-1?l.attr(e,"style",n):l.removeAttr(e,"style")});break;case"class":if("CODE"==e.nodeName)return!1;var s=r.value;s.indexOf("at")>-1?l.attr(e,"class","at"):s.indexOf("vemoji")>-1?l.attr(e,"class","vemoji"):l.removeAttr(e,"class");break;default:if(n.indexOf(i)>-1)return!0;l.removeAttr(e,i)}}),e},remove:function(e){try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}},each:function(e,t){var n=0,r=e.length,i=["[object Array]","[object NodeList]"],o={}.toString.call(e);if(i.indexOf(o)>-1)for(;n<r&&(!t||!1!==t.call(e[n],n,e[n]));n++);else for(n in e)if(e.hasOwnProperty(n)&&t&&!1===t.call(e[n],n,e[n]))break;return e}};e.exports=l},function(e,t,n){"use strict";var r=function(e,t){if(e)try{var n=e.getTime(),r=(new Date).getTime(),o=r-n,s=Math.floor(o/864e5);if(0===s){var a=o%864e5,u=Math.floor(a/36e5);if(0===u){var c=a%36e5,l=Math.floor(c/6e4);if(0===l){var h=c%6e4;return Math.round(h/1e3)+" "+t.timeago.seconds}return l+" "+t.timeago.minutes}return u+" "+t.timeago.hours}return s<0?t.timeago.now:s<8?s+" "+t.timeago.days:i(e)}catch(e){}},i=function(e){var t=o(e.getDate(),2),n=o(e.getMonth()+1,2);return o(e.getFullYear(),2)+"-"+n+"-"+t},o=function(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n};e.exports=r},function(e,t,n){var r;!function(i){"use strict";function o(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function s(e,t){return e<<t|e>>>32-t}function a(e,t,n,r,i,a){return o(s(o(o(t,e),o(r,a)),i),n)}function u(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function c(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function h(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}function f(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var n,r,i,s,a,f=1732584193,d=-271733879,p=-1732584194,v=271733878;for(n=0;n<e.length;n+=16)r=f,i=d,s=p,a=v,f=u(f,d,p,v,e[n],7,-680876936),v=u(v,f,d,p,e[n+1],12,-389564586),p=u(p,v,f,d,e[n+2],17,606105819),d=u(d,p,v,f,e[n+3],22,-1044525330),f=u(f,d,p,v,e[n+4],7,-176418897),v=u(v,f,d,p,e[n+5],12,1200080426),p=u(p,v,f,d,e[n+6],17,-1473231341),d=u(d,p,v,f,e[n+7],22,-45705983),f=u(f,d,p,v,e[n+8],7,1770035416),v=u(v,f,d,p,e[n+9],12,-1958414417),p=u(p,v,f,d,e[n+10],17,-42063),d=u(d,p,v,f,e[n+11],22,-1990404162),f=u(f,d,p,v,e[n+12],7,1804603682),v=u(v,f,d,p,e[n+13],12,-40341101),p=u(p,v,f,d,e[n+14],17,-1502002290),d=u(d,p,v,f,e[n+15],22,1236535329),f=c(f,d,p,v,e[n+1],5,-165796510),v=c(v,f,d,p,e[n+6],9,-1069501632),p=c(p,v,f,d,e[n+11],14,643717713),d=c(d,p,v,f,e[n],20,-373897302),f=c(f,d,p,v,e[n+5],5,-701558691),v=c(v,f,d,p,e[n+10],9,38016083),p=c(p,v,f,d,e[n+15],14,-660478335),d=c(d,p,v,f,e[n+4],20,-405537848),f=c(f,d,p,v,e[n+9],5,568446438),v=c(v,f,d,p,e[n+14],9,-1019803690),p=c(p,v,f,d,e[n+3],14,-187363961),d=c(d,p,v,f,e[n+8],20,1163531501),f=c(f,d,p,v,e[n+13],5,-1444681467),v=c(v,f,d,p,e[n+2],9,-51403784),p=c(p,v,f,d,e[n+7],14,1735328473),d=c(d,p,v,f,e[n+12],20,-1926607734),f=l(f,d,p,v,e[n+5],4,-378558),v=l(v,f,d,p,e[n+8],11,-2022574463),p=l(p,v,f,d,e[n+11],16,1839030562),d=l(d,p,v,f,e[n+14],23,-35309556),f=l(f,d,p,v,e[n+1],4,-1530992060),v=l(v,f,d,p,e[n+4],11,1272893353),p=l(p,v,f,d,e[n+7],16,-155497632),d=l(d,p,v,f,e[n+10],23,-1094730640),f=l(f,d,p,v,e[n+13],4,681279174),v=l(v,f,d,p,e[n],11,-358537222),p=l(p,v,f,d,e[n+3],16,-722521979),d=l(d,p,v,f,e[n+6],23,76029189),f=l(f,d,p,v,e[n+9],4,-640364487),v=l(v,f,d,p,e[n+12],11,-421815835),p=l(p,v,f,d,e[n+15],16,530742520),d=l(d,p,v,f,e[n+2],23,-995338651),f=h(f,d,p,v,e[n],6,-198630844),v=h(v,f,d,p,e[n+7],10,1126891415),p=h(p,v,f,d,e[n+14],15,-1416354905),d=h(d,p,v,f,e[n+5],21,-57434055),f=h(f,d,p,v,e[n+12],6,1700485571),v=h(v,f,d,p,e[n+3],10,-1894986606),p=h(p,v,f,d,e[n+10],15,-1051523),d=h(d,p,v,f,e[n+1],21,-2054922799),f=h(f,d,p,v,e[n+8],6,1873313359),v=h(v,f,d,p,e[n+15],10,-30611744),p=h(p,v,f,d,e[n+6],15,-1560198380),d=h(d,p,v,f,e[n+13],21,1309151649),f=h(f,d,p,v,e[n+4],6,-145523070),v=h(v,f,d,p,e[n+11],10,-1120210379),p=h(p,v,f,d,e[n+2],15,718787259),d=h(d,p,v,f,e[n+9],21,-343485551),f=o(f,r),d=o(d,i),p=o(p,s),v=o(v,a);return[f,d,p,v]}function d(e){var t,n="",r=32*e.length;for(t=0;t<r;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var r=8*e.length;for(t=0;t<r;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function v(e){return d(f(p(e),8*e.length))}function _(e,t){var n,r,i=p(e),o=[],s=[];for(o[15]=s[15]=void 0,i.length>16&&(i=f(i,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^i[n],s[n]=1549556828^i[n];return r=f(o.concat(p(t)),512+8*t.length),d(f(s.concat(r),640))}function g(e){var t,n,r="0123456789abcdef",i="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),i+=r.charAt(t>>>4&15)+r.charAt(15&t);return i}function m(e){return unescape(encodeURIComponent(e))}function y(e){return v(m(e))}function b(e){return g(y(e))}function w(e,t){return _(m(e),m(t))}function O(e,t){return g(w(e,t))}function x(e,t,n){return t?n?w(t,e):O(t,e):n?y(e):b(e)}void 0!==(r=function(){return x}.call(t,n,t,e))&&(e.exports=r)}()},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e){return'<span style="color: slategray">'+e+"</span>"}var t=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){var t=e.exports=function(){return new RegExp("(?:"+t.line().source+")|(?:"+t.block().source+")","gm")};t.line=function(){return/(?:^|\s)\/\/(.+?)$/gm},t.block=function(){return/\/\*([\S\s]*?)\*\//gm}}),n=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"];return function(r,i){void 0===i&&(i={});var o=i.colors;void 0===o&&(o=n);var s=0,a={},u=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,c=/</,l=new RegExp("("+u.source+"|"+c.source+")|("+t().source+")","gmi");return r.replace(l,function(t,n,r){if(r)return e(r);if("<"===n)return"<";var i;a[n]?i=a[n]:(i=o[s],a[n]=i);var u='<span style="color: #'+i+'">'+n+"</span>";return s=++s%o.length,u})}})},function(e,t,n){(function(t){!function(t,n){e.exports=n()}("undefined"!=typeof self&&self,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,n){(function(e,n){var r,i;!function(){var o="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},s=o._,a=Array.prototype,u=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,l=a.push,h=a.slice,f=u.toString,d=u.hasOwnProperty,p=Array.isArray,v=Object.keys,_=Object.create,g=function(){},m=function(e){return e instanceof m?e:this instanceof m?void(this._wrapped=e):new m(e)};void 0===t||t.nodeType?o._=m:(void 0!==n&&!n.nodeType&&n.exports&&(t=n.exports=m),t._=m),m.VERSION="1.9.1";var y,b=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},w=function(e,t,n){return m.iteratee!==y?m.iteratee(e,t):null==e?m.identity:m.isFunction(e)?b(e,t,n):m.isObject(e)&&!m.isArray(e)?m.matcher(e):m.property(e)};m.iteratee=y=function(e,t){return w(e,t,1/0)};var O=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}},x=function(e){if(!m.isObject(e))return{};if(_)return _(e);g.prototype=e;var t=new g;return g.prototype=null,t},S=function(e){return function(t){return null==t?void 0:t[e]}},A=function(e,t){return null!=e&&d.call(e,t)},E=function(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0},k=Math.pow(2,53)-1,C=S("length"),T=function(e){var t=C(e);return"number"==typeof t&&t>=0&&t<=k};m.each=m.forEach=function(e,t,n){t=b(t,n);var r,i;if(T(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var o=m.keys(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e)}return e},m.map=m.collect=function(e,t,n){t=w(t,n);for(var r=!T(e)&&m.keys(e),i=(r||e).length,o=Array(i),s=0;s<i;s++){var a=r?r[s]:s;o[s]=t(e[a],a,e)}return o};var N=function(e){var t=function(t,n,r,i){var o=!T(t)&&m.keys(t),s=(o||t).length,a=e>0?0:s-1;for(i||(r=t[o?o[a]:a],a+=e);a>=0&&a<s;a+=e){var u=o?o[a]:a;r=n(r,t[u],u,t)}return r};return function(e,n,r,i){var o=arguments.length>=3;return t(e,b(n,i,4),r,o)}};m.reduce=m.foldl=m.inject=N(1),m.reduceRight=m.foldr=N(-1),m.find=m.detect=function(e,t,n){var r=T(e)?m.findIndex:m.findKey,i=r(e,t,n);if(void 0!==i&&-1!==i)return e[i]},m.filter=m.select=function(e,t,n){var r=[];return t=w(t,n),m.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},m.reject=function(e,t,n){return m.filter(e,m.negate(w(t)),n)},m.every=m.all=function(e,t,n){t=w(t,n);for(var r=!T(e)&&m.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(!t(e[s],s,e))return!1}return!0},m.some=m.any=function(e,t,n){t=w(t,n);for(var r=!T(e)&&m.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(t(e[s],s,e))return!0}return!1},m.contains=m.includes=m.include=function(e,t,n,r){return T(e)||(e=m.values(e)),("number"!=typeof n||r)&&(n=0),m.indexOf(e,t,n)>=0},m.invoke=O(function(e,t,n){var r,i;return m.isFunction(t)?i=t:m.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),m.map(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=E(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})}),m.pluck=function(e,t){return m.map(e,m.property(t))},m.where=function(e,t){return m.filter(e,m.matcher(t))},m.findWhere=function(e,t){return m.find(e,m.matcher(t))},m.max=function(e,t,n){var r,i,o=-1/0,s=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=T(e)?e:m.values(e);for(var a=0,u=e.length;a<u;a++)null!=(r=e[a])&&r>o&&(o=r)}else t=w(t,n),m.each(e,function(e,n,r){((i=t(e,n,r))>s||i===-1/0&&o===-1/0)&&(o=e,s=i)});return o},m.min=function(e,t,n){var r,i,o=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=T(e)?e:m.values(e);for(var a=0,u=e.length;a<u;a++)null!=(r=e[a])&&r<o&&(o=r)}else t=w(t,n),m.each(e,function(e,n,r){((i=t(e,n,r))<s||i===1/0&&o===1/0)&&(o=e,s=i)});return o},m.shuffle=function(e){return m.sample(e,1/0)},m.sample=function(e,t,n){if(null==t||n)return T(e)||(e=m.values(e)),e[m.random(e.length-1)];var r=T(e)?m.clone(e):m.values(e),i=C(r);t=Math.max(Math.min(t,i),0);for(var o=i-1,s=0;s<t;s++){var a=m.random(s,o),u=r[s];r[s]=r[a],r[a]=u}return r.slice(0,t)},m.sortBy=function(e,t,n){var r=0;return t=w(t,n),m.pluck(m.map(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")};var j=function(e,t){return function(n,r,i){var o=t?[[],[]]:{};return r=w(r,i),m.each(n,function(t,i){var s=r(t,i,n);e(o,t,s)}),o}};m.groupBy=j(function(e,t,n){A(e,n)?e[n].push(t):e[n]=[t]}),m.indexBy=j(function(e,t,n){e[n]=t}),m.countBy=j(function(e,t,n){A(e,n)?e[n]++:e[n]=1});var U=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;m.toArray=function(e){return e?m.isArray(e)?h.call(e):m.isString(e)?e.match(U):T(e)?m.map(e,m.identity):m.values(e):[]},m.size=function(e){return null==e?0:T(e)?e.length:m.keys(e).length},m.partition=j(function(e,t,n){e[n?0:1].push(t)},!0),m.first=m.head=m.take=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[0]:m.initial(e,e.length-t)},m.initial=function(e,t,n){return h.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},m.last=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[e.length-1]:m.rest(e,Math.max(0,e.length-t))},m.rest=m.tail=m.drop=function(e,t,n){return h.call(e,null==t||n?1:t)},m.compact=function(e){return m.filter(e,Boolean)};var I=function(e,t,n,r){r=r||[];for(var i=r.length,o=0,s=C(e);o<s;o++){var a=e[o];if(T(a)&&(m.isArray(a)||m.isArguments(a)))if(t)for(var u=0,c=a.length;u<c;)r[i++]=a[u++];else I(a,t,n,r),i=r.length;else n||(r[i++]=a)}return r};m.flatten=function(e,t){return I(e,t,!1)},m.without=O(function(e,t){return m.difference(e,t)}),m.uniq=m.unique=function(e,t,n,r){m.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=w(n,r));for(var i=[],o=[],s=0,a=C(e);s<a;s++){var u=e[s],c=n?n(u,s,e):u;t&&!n?(s&&o===c||i.push(u),o=c):n?m.contains(o,c)||(o.push(c),i.push(u)):m.contains(i,u)||i.push(u)}return i},m.union=O(function(e){return m.uniq(I(e,!0,!0))}),m.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=C(e);r<i;r++){var o=e[r];if(!m.contains(t,o)){var s;for(s=1;s<n&&m.contains(arguments[s],o);s++);s===n&&t.push(o)}}return t},m.difference=O(function(e,t){return t=I(t,!0,!0),m.filter(e,function(e){return!m.contains(t,e)})}),m.unzip=function(e){for(var t=e&&m.max(e,C).length||0,n=Array(t),r=0;r<t;r++)n[r]=m.pluck(e,r);return n},m.zip=O(m.unzip),m.object=function(e,t){for(var n={},r=0,i=C(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n};var R=function(e){return function(t,n,r){n=w(n,r);for(var i=C(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return-1}};m.findIndex=R(1),m.findLastIndex=R(-1),m.sortedIndex=function(e,t,n,r){n=w(n,r,1);for(var i=n(t),o=0,s=C(e);o<s;){var a=Math.floor((o+s)/2);n(e[a])<i?o=a+1:s=a}return o};var P=function(e,t,n){return function(r,i,o){var s=0,a=C(r);if("number"==typeof o)e>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=t(h.call(r,s,a),m.isNaN),o>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&o<a;o+=e)if(r[o]===i)return o;return-1}};m.indexOf=P(1,m.findIndex,m.sortedIndex),m.lastIndexOf=P(-1,m.findLastIndex),m.range=function(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i},m.chunk=function(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(h.call(e,r,r+=t));return n};var L=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=x(e.prototype),s=e.apply(o,i);return m.isObject(s)?s:o};m.bind=O(function(e,t,n){if(!m.isFunction(e))throw new TypeError("Bind must be called on a function");var r=O(function(i){return L(e,r,t,this,n.concat(i))});return r}),m.partial=O(function(e,t){var n=m.partial.placeholder,r=function(){for(var i=0,o=t.length,s=Array(o),a=0;a<o;a++)s[a]=t[a]===n?arguments[i++]:t[a];for(;i<arguments.length;)s.push(arguments[i++]);return L(e,r,this,this,s)};return r}),m.partial.placeholder=m,m.bindAll=O(function(e,t){t=I(t,!1,!1);var n=t.length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=m.bind(e[r],e)}}),m.memoize=function(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return A(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n},m.delay=O(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),m.defer=m.partial(m.delay,m,1),m.throttle=function(e,t,n){var r,i,o,s,a=0;n||(n={});var u=function(){a=!1===n.leading?0:m.now(),r=null,s=e.apply(i,o),r||(i=o=null)},c=function(){var c=m.now();a||!1!==n.leading||(a=c);var l=t-(c-a);return i=this,o=arguments,l<=0||l>t?(r&&(clearTimeout(r),r=null),a=c,s=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),s};return c.cancel=function(){clearTimeout(r),a=0,r=i=o=null},c},m.debounce=function(e,t,n){var r,i,o=function(t,n){r=null,n&&(i=e.apply(t,n))},s=O(function(s){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,t),a&&(i=e.apply(this,s))}else r=m.delay(o,t,this,s);return i});return s.cancel=function(){clearTimeout(r),r=null},s},m.wrap=function(e,t){return m.partial(t,e)},m.negate=function(e){return function(){return!e.apply(this,arguments)}},m.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},m.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},m.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},m.once=m.partial(m.before,2),m.restArguments=O;var D=!{toString:null}.propertyIsEnumerable("toString"),F=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],M=function(e,t){var n=F.length,r=e.constructor,i=m.isFunction(r)&&r.prototype||u,o="constructor";for(A(e,o)&&!m.contains(t,o)&&t.push(o);n--;)(o=F[n])in e&&e[o]!==i[o]&&!m.contains(t,o)&&t.push(o)};m.keys=function(e){if(!m.isObject(e))return[];if(v)return v(e);var t=[];for(var n in e)A(e,n)&&t.push(n);return D&&M(e,t),t},m.allKeys=function(e){if(!m.isObject(e))return[];var t=[];for(var n in e)t.push(n);return D&&M(e,t),t},m.values=function(e){for(var t=m.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r},m.mapObject=function(e,t,n){t=w(t,n);for(var r=m.keys(e),i=r.length,o={},s=0;s<i;s++){var a=r[s];o[a]=t(e[a],a,e)}return o},m.pairs=function(e){for(var t=m.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},m.invert=function(e){for(var t={},n=m.keys(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},m.functions=m.methods=function(e){var t=[];for(var n in e)m.isFunction(e[n])&&t.push(n);return t.sort()};var q=function(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],s=e(o),a=s.length,u=0;u<a;u++){var c=s[u];t&&void 0!==n[c]||(n[c]=o[c])}return n}};m.extend=q(m.allKeys),m.extendOwn=m.assign=q(m.keys),m.findKey=function(e,t,n){t=w(t,n);f