!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MiniValine",[],t):"object"==typeof exports?exports.MiniValine=t():e.MiniValine=t()}(window,(function(){return function(e){function t(t){for(var n,o,i=t[0],a=t[1],c=0,s=[];c'))}t.TEXT=e.C.comment,(0,r.default)(e,t,n)}},function(e,t,n){"use strict";var r=function(e){var t=o(e.getDate(),2),n=o(e.getMonth()+1,2),r=o(e.getFullYear(),2);return"".concat(r,"-").concat(n,"-").concat(t)},o=function(e,t){for(var n=e.toString();n.length/g,">").replace(/"/g,""").replace(/'/g,"'"));var n=t.get("mailMd5"),i="".concat(r.GBUrl+n,"?size=80&d=robohash");if(void 0!==e.config.barrager&&!e.config.barrager||e.Vbarrager(e,t,i),"DesertsP"===e.mode)return e.Vcard(e,t,i);if("xCss"===e.mode){var a=t.get("ua")||"",c="",l=r.MVUrl+"/imgs/svg/";if(a&&!e.config.closeUA){a=uaparser(a);try{if(a.browser&&a.browser.name){c+=''+a.browser.name+" "+(a.browser.version?a.browser.version:"")+" "}else c+='Magical APP';if(a.os&&a.os.name){c+=''+a.os.name+" "+(a.os.version?a.os.version:"")+""}else c+='Magical OS'}catch(e){}}if(e.config.region)try{var d=t.get("log").region.data.location;d&&(c+=''+d+"")}catch(e){}var f="";if(!e.config.closeFlag&&!e.config.cloudflag)try{e.master=e.master.map((function(e){return e.toLowerCase()})),e.friends=e.friends.map((function(e){return e.toLowerCase()}));var v=e.master.includes(t.get("mailMd5").toLowerCase()),m=e.friends.includes(t.get("mailMd5").toLowerCase());f=v?''+e.tagMeta[0]+"":m?''+e.tagMeta[1]+"":''+e.tagMeta[2]+""}catch(e){}if(!e.config.closeFlag&&e.config.cloudflag)try{var p=e.cloudFlag.Roles,g=t.get("mailMd5").toLowerCase(),y=e.cloudFlag.Users[g];f=y?''+"".concat(e.cloudFlag.Roles[y]&&e.cloudFlag.Roles[y].nick?e.cloudFlag.Roles[y].nick:"visitor")+"":''+"".concat(p.visitor&&p.visitor.nick?p.visitor.nick:"visitor")+""}catch(e){}return'
'+'')+"').concat(e.i18n.reply,"")+'
'.concat(t.get("link")?' ').concat(t.get("nick"),"").concat(f,'').concat(c,""):''.concat(t.get("nick")," ").concat(f," ").concat(c))+'
'.concat((0,o.default)(t.get("createdAt"),e.i18n),"")+"
"+'
')+'
'.concat(t.get("comment"),"
")+'
'+'
    ')+"
    "}}},function(e,t,n){"use strict";e.exports=function(e){var t=e.el.querySelector(".vempty");e.nodata={show:function(n){t.innerHTML=n||e.i18n.noCommentYet,t.setAttribute("style","display:block;")},hide:function(){t.setAttribute("style","display:none;")}};var n='
    ',r=e.el.querySelector(".vloading");r.innerHTML=n,e.loading={show:function(){r.setAttribute("style","display:block;"),e.nodata.hide()},hide:function(t){r.setAttribute("style","display:none;"),0===t&&e.nodata.show()}};var o=e.el.querySelector(".vsubmitting");o.innerHTML=n,e.submitting={show:function(){o.setAttribute("style","display:block;")},hide:function(){o.setAttribute("style","display:none;"),e.nodata.hide()}}}},function(e,t,n){"use strict";e.exports=function(e){var t=setInterval((function(){if(void 0!==e.emoticonList&&0!=e.emoticonList.length){clearInterval(t);for(var n=e.el.querySelector(".vsmile-icons ul"),r=e.el.querySelector(".vsmile-bar ul"),o=e.emoticonList||[],i=0;i ul > li:nth-child(1)").style.display="block";for(var u=document.querySelectorAll(".vsmile-bar > ul > li"),d=document.querySelectorAll(".vsmile-icons > ul > li"),f=0;f
    '.concat(n.text,'
    ');var o=t.querySelector(".vbtns"),i='"),a='");if(o.innerHTML="".concat(i).concat(n.type&&a),t.querySelector(".vcancel").addEventListener("click",(function(t){e.alert.hide()})),t.setAttribute("style","display:block;"),n.type){var c=t.querySelector(".vsure");r.default.on("click",c,(function(t){e.alert.hide(),n.cb&&n.cb()}))}},hide:function(){t.setAttribute("style","display:none;")}}}},function(e,t,n){"use strict";e.exports=function(e){var t=new e.v.Query("Comment");t.equalTo("url",e.C.url);var n=new e.v.Query("Comment");n.equalTo("url","".concat(e.C.url,"/"));var r=AV.Query.or(t,n);r.notEqualTo("isSpam",!0),r.count().then((function(t){e.el.querySelector(".count").innerHTML=t})).catch((function(t){console.log(t),e.el.querySelector(".count").innerHTML=0}))}},function(e,t,n){"use strict";var r=i(n(0)),o=i(n(4));function i(e){return e&&e.__esModule?e:{default:e}}e.exports=function(e){var t=e.el.querySelector(".vsmile-icons");r.default.on("click",t,(function(t){var n=e.el.querySelector(".veditor"),r=t.target.src;if(void 0!==r){var i="!(:".concat(decodeURI(r).replace(/^.*\/(.*)$/,"$1"),":)");(0,o.default)(n,i),e.C.comment=n.value;var a=e.el.querySelector(".vsubmit");a.getAttribute("disabled")&&a.removeAttribute("disabled")}}))}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){var t=e.el.querySelector(".commentTrigger");r.default.on("click",t,(function(n){t.setAttribute("style","display:none"),e.el.querySelector(".auth-section").removeAttribute("style"),e.el.querySelector(".veditor").focus()}))}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(5));e.exports=function(e){var t=e.el.querySelector(".vsmile-icons"),n=e.el.querySelector(".vpreview-text");e.reset=function(){for(var o in e.mapping)if(e.mapping.hasOwnProperty(o)){var i=e.mapping[o];e.el.querySelector(".".concat(o)).value="",e.C[i]=""}e.C.rid="",e.C.nick="",e.C.at="",(e.el.querySelector(".vinputs-area textarea").placeholder="",r.default)(e),e.previewEvt(e),t.getAttribute("triggered")&&(t.setAttribute("style","display:none;"),t.removeAttribute("triggered")),n.getAttribute("triggered")&&(n.setAttribute("style","display:none;"),n.removeAttribute("triggered")),e.el.querySelector(".vcancel-comment-reply").setAttribute("style","display:none");try{e.el.querySelector("#vinputs-placeholder").appendChild(e.el.querySelector(".vinputs-wrap"))}catch(e){}}}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){r.default.on("click",e.el.querySelector(".cancel-reply-btn"),(function(t){e.reset()}))}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){var t=e.el.querySelector(".vemoji-btn"),n=e.el.querySelector(".vpreview-btn"),o=e.el.querySelector(".vpreview-text"),i=e.el.querySelector(".vsmile-body");r.default.on("click",t,(function(e){o.getAttribute("triggered")&&(o.setAttribute("style","display:none;"),o.removeAttribute("triggered"),n.classList.remove("actived")),i.getAttribute("triggered")?(i.setAttribute("style","display:none;"),i.removeAttribute("triggered"),t.classList.remove("actived")):(i.removeAttribute("style"),i.setAttribute("triggered",1),t.classList.add("actived"))}))}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){var t=e.el.querySelector(".vpreview-btn"),n=e.el.querySelector(".vemoji-btn"),o=e.el.querySelector(".vpreview-text"),i=e.el.querySelector(".vsmile-icons");r.default.on("click",t,(function(r){if(i.getAttribute("triggered")&&(i.setAttribute("style","display:none;"),i.removeAttribute("triggered"),n.classList.remove("actived")),o.getAttribute("triggered"))o.setAttribute("style","display:none;"),o.removeAttribute("triggered"),t.classList.remove("actived");else{if(t.classList.add("actived"),""===e.C.comment)return void e.inputs.comment.focus();e.previewEvt(e)}}))}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){for(var t in e.inputs={},e.mapping={veditor:"comment",vnick:"nick",vlink:"link",vmail:"mail"},e.mapping)e.mapping.hasOwnProperty(t)&&function(){var n=e.mapping[t],o=e.el.querySelector(".".concat(t));e.inputs[n]=o,r.default.on("input",o,(function(t){e.C[n]=o.value,e.previewEvt(e)}))}()}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));e.exports=function(e){e.AtEvt=function(t){var n=t.getAttribute("id"),o=t.querySelector("#at-".concat(n));r.default.on("click",o,(function(r){var i=o.getAttribute("at"),a=o.getAttribute("rid");e.C.rid=a,e.C.at=i,e.el.querySelector(".vinputs-area textarea").placeholder=i,e.inputs.comment.value="".concat(e.inputs.comment.value);var c=t.querySelector("#comment-".concat(n));try{c.appendChild(e.el.querySelector(".vinputs-wrap"))}catch(r){}e.el.querySelector(".vcancel-comment-reply").removeAttribute("style"),"DesertsP"===e.mode&&(e.el.querySelector(".commentTrigger").setAttribute("style","display:none"),e.el.querySelector(".auth-section").removeAttribute("style"),e.el.querySelector(".veditor").focus()),e.inputs.comment.focus()}))}}},function(e,t,n){"use strict";var r=a(n(0)),o=a(n(6)),i=a(n(38));function a(e){return e&&e.__esModule?e:{default:e}}e.exports=function(e){var t=e.el.querySelector(".vsubmit");e.submitEvt=function(r){if(t.getAttribute("disabled"))e.alert.show({type:0,text:e.i18n.wait+'ヾ(๑╹◡╹)ノ"',ctxt:e.i18n.ok});else if(""!==e.C.comment)if(""!==e.C.nick){(0,o.default)(e,e,(function(e){if(e.C.comment=e.TEXT,""!==e.C.at){var t='").concat(e.C.at,"");e.C.comment=t+" , "+e.C.comment}var r=i.default.mail(e.C.mail),o=i.default.link(e.C.link);e.C.mail=r.k?r.v:"",e.C.link=o.k?o.v:"",e.C.mailMd5=md5(e.C.mail),r.k&&o.k?n():e.alert.show({type:0,text:e.i18n.inputTips,ctxt:e.i18n.confirm})}))}else e.inputs.nick.focus();else e.inputs.comment.focus()};var n=function(){t.setAttribute("disabled",!0),e.submitting.show();var n=new(e.v.Object.extend("Comment"));for(var r in e.C)if(e.C.hasOwnProperty(r)){if("at"===r)continue;var o=e.C[r];n.set(r,o)}try{var i=e.C.ip;i&&(/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/.test(i)||/^([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}$/.test(i))&&"127.0.0.1"!=i||(window.MV.fuck=0,kill())}catch(e){}try{window.MV.MC&&window.MV.MC.util&&window.MV.MC.util.Visitor()}catch(e){}n.setACL(function(){var t=new e.v.ACL;return t.setWriteAccess("role:"+e.role,!0),t.setPublicReadAccess(!0),t.setPublicWriteAccess(!1),t}()),n.save({log:window.MV}).then((function(n){localStorage&&localStorage.setItem("MiniValineCache",JSON.stringify({nick:e.C.nick,link:e.C.link,mail:e.C.mail}));var r=e.el.querySelector(".count");if(r.innerText=Number(r.innerText)+1,""===e.C.rid)e.insertComment(n,null,!0);else{var o=e.el.querySelector("#children-list-".concat(e.C.rid));e.insertComment(n,o,!0)}t.removeAttribute("disabled"),e.submitting.hide(),e.nodata.hide(),e.reset()})).catch((function(t){e.submitting.hide()}))};r.default.on("click",t,e.submitEvt)}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=function(e,t,o){e.md||void 0===e.config.md?Promise.all([n.e(1),n.e(11),n.e(8)]).then(n.t.bind(null,57,7)).then((function(e){var n=e.markdown;t.TEXT=n(t.TEXT),(0,r.default)(t,o)})):(0,r.default)(t,o)}},function(e,t,n){"use strict";e.exports={mail:function(e){return{k:/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(e),v:e}},link:function(e){return 0=e.maxNestLevel?e.v.Query.doCloudQuery("select count(*) from Comment where rid='".concat(c,"' and (url='").concat(e.C.url,"' or url='","".concat(e.C.url,"/"),"') order by -createdAt")).then((function(n){if(0').concat(e.i18n.more,"");var a=o.querySelector(".vshow-children");r.default.on("click",a,(function(n){o.setAttribute("style","display: none !important;"),e.nestQuery(t,-1e3)}))}}),(function(e){console.log(e)})):setTimeout((function(){e.v.Query.doCloudQuery("select nick, comment, link, rid, isSpam, mailMd5, ua ".concat(e.config.region?",log":""," from Comment where rid='").concat(c,"' and (url='").concat(e.C.url,"' or url='","".concat(e.C.url,"/"),"') order by -createdAt")).then((function(t){var r=(t=t&&t.results||[]).length;if(r)for(var i=function(r){if(!t[r].get("isSpam")){t[r].TEXT=t[r].get("comment"),(0,o.default)(t[r],(function(o){t[r].set("comment",o.TEXT);var i=e.insertComment(t[r],a,!0);e.nestQuery(i,n+1)}))}},c=0;c'.concat(e.i18n.more,""):"";var u=s.querySelector("#vmore");u&&r.default.on("click",u,(function(n){s.innerHTML="",e.parentQuery(++t)}))}try{void 0===window.MV.barrager.bottom||void 0!==e.config.barrager&&1!=e.config.barrager||(window.MV.barrager.enable=0)}catch(e){}e.loading.hide(e.parentCount)})).catch((function(t){e.loading.hide(e.parentCount)}))},e.v.Query.doCloudQuery("select count(*) from Comment where (rid='' or rid is not exists) and (url='".concat(e.C.url,"' or url='","".concat(e.C.url,"/"),"') order by -createdAt")).then((function(t){e.parentCount=t.count,e.parentQuery(1)})).catch((function(e){console.log(e)}))}},function(e,t,n){"use strict";e.exports=function(e){e.ActivateCode=function(e){setTimeout((function(){document.getElementsByTagName("pre").length&&Promise.all([n.e(0),n.e(1),n.e(9)]).then(n.bind(null,59))}),500),0!=e.math&&n.e(7).then(n.t.bind(null,60,7)).then((function(t){(0,t.MathJaxSupport)(e)}))}}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(6));e.exports=function(e){e.previewEvt=function(e){var t=1