forked from szcf-weiya/ESL-CN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iDisqus.min.js
8 lines (8 loc) · 43.3 KB
/
iDisqus.min.js
1
2
3
4
5
6
7
8
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iDisqus=t():e.iDisqus=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var a=o[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){o(1),o(2),e.exports=o(3)},function(e,t,o){e.exports=o.p+"eac.min.json"},function(e,t){},function(e,t,o){(function(e){var n;/*!
* v 0.1.23
* https://github.com/fooleap/disqus-php-api
*
* Copyright 2017 fooleap
* Released under the MIT license
*/
!function(a){"use strict";function i(e){var t=c.createElement("a");return t.href=e,t}function r(e,t,o){var n=new XMLHttpRequest;return n.open("GET",encodeURI(e)),n.onreadystatechange=function(){4==n.readyState&&200==n.status&&t(n.responseText)},n.onerror=o,n.send(),n}function s(e,t,o,n){var a="string"==typeof t?t:Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&"),i=new XMLHttpRequest;return i.open("POST",e),i.onreadystatechange=function(){4==i.readyState&&200==i.status&&o(i.responseText)},i.onerror=n,i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(a),i}function m(e,t,o){[].forEach.call(e,function(e){e.addEventListener(t,o,!1)})}function l(e,t,o){[].forEach.call(e,function(e){e.removeEventListener(t,o,!1)})}var c=document,d=localStorage,u=c.scripts,p=u[u.length-1].src,f=p.substring(0,p.lastIndexOf("/")),g=navigator.userAgent.indexOf("Edge")>-1,v=!!window.ActiveXObject||"ActiveXObject"in window;!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,o=(t.document||t.ownerDocument).querySelectorAll(e),n=0;o[n]&&o[n]!==t;)++n;return Boolean(o[n])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var h=function(){this.dom=arguments[0],this.init()};h.prototype={init:function(){var e=this;e.name=d.getItem("name"),e.email=d.getItem("email"),e.url=d.getItem("url"),e.avatar=d.getItem("avatar"),e.logged_in=d.getItem("logged_in");var t=e.dom.getElementsByClassName("comment-box");"true"==e.logged_in?[].forEach.call(t,function(t){t.querySelector(".comment-form-wrapper").classList.add("logged-in"),t.querySelector(".comment-form-name").value=e.name,t.querySelector(".comment-form-email").value=e.email,t.querySelector(".comment-form-url").value=e.url,t.querySelector(".comment-avatar-image").src=e.avatar}):([].forEach.call(t,function(t){t.querySelector(".comment-form-wrapper").classList.remove("logged-in"),t.querySelector(".comment-form-name").value=e.name,t.querySelector(".comment-form-email").value=e.email,t.querySelector(".comment-form-url").value=e.url,t.querySelector(".comment-avatar-image").src=e.avatar?e.avatar:t.querySelector(".comment-avatar-image").src}),d.setItem("logged_in","false"))},reset:function(){d.setItem("logged_in","false"),this.init()},submit:function(e){"false"==this.logged_in&&(d.setItem("name",e.name),d.setItem("email",e.email),d.setItem("url",e.url),d.setItem("avatar",e.avatar),d.setItem("logged_in","true"),this.init())}};var y=function(){var e=this;if(e.opts="object"==typeof arguments[1]?arguments[1]:arguments[0],e.dom=c.getElementById("string"==typeof arguments[0]?arguments[0]:"comment"),e.opts.api="/"==e.opts.api.slice(-1)?e.opts.api.slice(0,-1):e.opts.api,e.opts.site=e.opts.site?e.opts.site:location.origin,e.opts.url){var t=e.opts.url.replace(e.opts.site,"");e.opts.url="/"!=t.slice(0,1)?"/"+t:t}else e.opts.url=g||v?encodeURI(location.pathname)+encodeURI(location.search):location.pathname+location.search;e.opts.identifier=e.opts.identifier?e.opts.identifier:e.opts.url,e.opts.link=e.opts.site+e.opts.url,e.opts.title=e.opts.title?e.opts.title:c.title,e.opts.slug=e.opts.slug?e.opts.slug.replace(/[^A-Za-z0-9_-]+/g,""):"",e.opts.desc=e.opts.desc?e.opts.desc:c.querySelector('[name="description"]')?c.querySelector('[name="description"]').content:"",e.opts.mode=e.opts.mode?e.opts.mode:1,e.opts.timeout=e.opts.timeout?e.opts.timeout:3e3,e.opts.toggle=e.opts.toggle?c.getElementById(e.opts.toggle):null,e.opts.badge=e.opts.badge?e.opts.badge:"管理员",e.opts.emoji_path=e.opts.emoji_path?e.opts.emoji_path:"https://assets-cdn.github.com/images/icons/emoji/unicode/",e.emoji_list=e.opts.emoji_list?e.opts.emoji_list:[{code:"smile",title:"笑脸",unicode:"1f604"},{code:"mask",title:"生病",unicode:"1f637"},{code:"joy",title:"破涕为笑",unicode:"1f602"},{code:"stuck_out_tongue_closed_eyes",title:"吐舌",unicode:"1f61d"},{code:"flushed",title:"脸红",unicode:"1f633"},{code:"scream",title:"恐惧",unicode:"1f631"},{code:"pensive",title:"失望",unicode:"1f614"},{code:"unamused",title:"无语",unicode:"1f612"},{code:"grin",title:"露齿笑",unicode:"1f601"},{code:"heart_eyes",title:"色",unicode:"1f60d"},{code:"sweat",title:"汗",unicode:"1f613"},{code:"smirk",title:"得意",unicode:"1f60f"},{code:"relieved",title:"满意",unicode:"1f60c"},{code:"rolling_eyes",title:"翻白眼",unicode:"1f644"},{code:"ok_hand",title:"OK",unicode:"1f44c"},{code:"v",title:"胜利",unicode:"270c"}],e.opts.emoji_preview&&r(f+"/eac.min.json",function(t){e.eac=JSON.parse(t)},function(){}),e.stat={current:"idisqus",loaded:!1,loading:!1,editing:!1,offsetTop:0,thread:null,next:null,message:null,mediaHtml:null,root:[],count:0,users:[],imageSize:[],disqusLoaded:!1},window.disqus_config=function(){this.page.identifier=e.opts.identifier,this.page.title=e.opts.title,this.page.url=e.opts.link,this.callbacks.onReady.push(function(){e.stat.current="disqus",e.stat.disqusLoaded=!0,e.dom.querySelector("#idisqus").style.display="none",e.dom.querySelector("#disqus_thread").style.display="block",3==e.opts.mode&&e.opts.toggle&&(e.opts.toggle.disabled="",e.opts.toggle.checked=!0,e.opts.toggle.addEventListener("change",e.handle.toggle,!1))})},e.opts.init&&e.init()};y.prototype.timeAgo=function(){var e=this,t={prefix:"",suffix:"前",seconds:"几秒",minute:"1分钟",minutes:"%d分钟",hour:"1小时",hours:"%d小时",day:"1天",days:"%d天",month:"1个月",months:"%d个月",year:"1年",years:"%d年"},o=function(e,o){return t[e]&&t[e].replace(/%d/i,Math.abs(Math.round(o)))},n=e.dom.querySelectorAll(".comment-item-time");for(var a in n){var i=n[a];"object"==typeof i&&(i.title=new Date(i.getAttribute("datetime")),i.innerHTML=function(e){if(e){e=e.replace(/\.\d+/,""),e=e.replace(/-/,"/").replace(/-/,"/"),e=e.replace(/T/," ").replace(/Z/," UTC"),e=e.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),e=new Date(1e3*e||e);var n=new Date,a=.001*(n.getTime()-e)>>0,i=a/60,r=i/60,s=r/24,m=s/365;return t.prefix+(a<45&&o("seconds",a)||a<90&&o("minute",1)||i<45&&o("minutes",i)||i<90&&o("hour",1)||r<24&&o("hours",r)||r<42&&o("day",1)||s<30&&o("days",s)||s<45&&o("month",1)||s<365&&o("months",s/30)||m<1.5&&o("year",1)||o("years",m))+t.suffix}}(i.getAttribute("datetime")))}setTimeout(e.timeAgo.bind(e),6e4)},y.prototype.init=function(){var e=this;if(e.dom){var t="";switch(e.emoji_list.forEach(function(o){t+='<li class="emojione-item" title="'+o.title+'" data-code=":'+o.code+':"><img class="emojione-item-image" src="'+e.opts.emoji_path+o.unicode+'.png" /></li>'}),e.dom.innerHTML='<div class="comment loading" id="idisqus">\n <div class="loading-container" data-tip="正在加载评论……"><svg class="loading-bg" width="72" height="72" viewBox="0 0 720 720" version="1.1" xmlns="http://www.w3.org/2000/svg"><path class="ring" fill="none" stroke="#9d9ea1" d="M 0 -260 A 260 260 0 1 1 -80 -260" transform="translate(400,400)" stroke-width="50" /><polygon transform="translate(305,20)" points="50,0 0,100 18,145 50,82 92,145 100,100" style="fill:#9d9ea1"/></svg></div>\n <div class="comment-header"><span class="comment-header-item" id="comment-count">评论</span><a target="_blank" class="comment-header-item" id="comment-link">Disqus 讨论区</a></div>\n <div class="comment-box">\n <div class="comment-avatar avatar"><img class="comment-avatar-image" src="https://a.disquscdn.com/images/noavatar92.png"></div>\n <div class="comment-form">\n <div class="comment-form-wrapper">\n <textarea class="comment-form-textarea" placeholder="加入讨论……"></textarea>\n <div class="comment-form-alert"></div>\n <div class="comment-image">\n <ul class="comment-image-list"></ul>\n <div class="comment-image-progress">\n <div class="comment-image-loaded"></div>\n </div>\n </div>\n <div class="comment-actions">\n <div class="comment-actions-group">\n <input id="emoji-input" class="comment-actions-input" type="checkbox"> \n <label class="comment-actions-label emojione" for="emoji-input" title="选择表情">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z"></path>\n <path d="M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z"></path>\n <path d="M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n <path d="M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n </svg>\n <ul class="emojione-list">'+t+'</ul>\n </label>\n <input id="upload-input" class="comment-actions-input comment-image-input" type="file" accept="image/*" name="file"> \n <label class="comment-actions-label" for="upload-input" title="上传图片">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z"></path>\n <path d="M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z"></path>\n </svg>\n </label>\n </div>\n <div class="comment-actions-form">\n <label class="comment-actions-label exit" title="重置访客信息">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48">\n <path d="M348.870666 210.685443l378.570081 0c32.8205 0 58.683541 26.561959 58.683541 58.683541 0 162.043606 0 324.804551 0 486.848157 0 32.81129-26.561959 58.674331-58.683541 58.674331L348.870666 814.891472c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276c0-10.477632 8.372691-18.841114 18.850323-18.841114l343.645664 0c10.477632 0 18.850323-8.372691 18.850323-18.850323L711.366653 304.983109c0-10.477632-8.372691-18.841114-18.850323-18.841114L348.870666 286.141996c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276C329.98248 219.095997 338.393034 210.685443 348.870666 210.685443z"></path>\n <path d="M128.152728 526.436804l112.450095 112.450095c6.985088 6.985088 19.567661 6.985088 26.552749 0l26.561959-26.561959c6.985088-6.985088 6.985088-19.567661 0-26.552749l-34.925441-34.925441L494.168889 550.84675c10.477632 0 18.850323-8.372691 18.850323-18.850323l0-37.719066c0-10.477632-8.372691-18.850323-18.850323-18.850323L258.754229 475.427036l34.925441-34.925441c6.985088-6.985088 6.985088-19.567661 0-26.552749l-26.561959-26.524097c-6.985088-6.985088-19.567661-6.985088-26.552749 0L128.152728 499.875868C120.431883 506.859933 120.431883 519.451716 128.152728 526.436804z"></path>\n </svg>\n </label>\n <button class="comment-form-submit">\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z" fill="#ffffff"></path>\n </svg>\n </button>\n </div>\n </div>\n </div>\n <div class="comment-login"><input class="comment-form-input comment-form-name" type="text" placeholder="名字(必填)" autocomplete="name"><input class="comment-form-input comment-form-email" type="email" placeholder="邮箱(必填)" autocomplete="email"><input class="comment-form-input comment-form-url" type="url" placeholder="网址(可选)" autocomplete="url"></div>\n </div>\n </div>\n <ul id="comments" class="comment-list"></ul>\n <a href="javascript:;" class="comment-loadmore">加载更多</a>\n</div>\n<div class="comment" id="disqus_thread"></div>',e.guest=new h(e.dom),e.box=e.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/加入讨论……/,""),e.handle={guestReset:e.guest.reset.bind(e.guest),loadMore:e.loadMore.bind(e),post:e.post.bind(e),postThread:e.postThread.bind(e),remove:e.remove.bind(e),show:e.show.bind(e),toggle:e.toggle.bind(e),upload:e.upload.bind(e),verify:e.verify.bind(e),jump:e.jump.bind(e),mention:e.mention.bind(e),keySelect:e.keySelect.bind(e),field:e.field,focus:e.focus,input:e.input},e.opts.mode){case 1:e.disqus();break;case 2:e.getlist();break;case 3:e.getlist(),e.disqus();break;default:e.disqus()}}},y.prototype.toggle=function(){var e=this;"disqus"==e.stat.current?(e.stat.current="idisqus",e.dom.querySelector("#idisqus").style.display="block",e.dom.querySelector("#disqus_thread").style.display="none"):e.disqus()},y.prototype.disqus=function(){var e=this,t=e.dom.querySelector(".loading-container").dataset.tip;if(e.opts.site!=location.origin)return void(1==e.opts.mode&&e.getlist());if(e.stat.disqusLoaded)e.stat.current="disqus",e.dom.querySelector("#idisqus").style.display="none",e.dom.querySelector("#disqus_thread").style.display="block";else{t="尝试连接 Disqus……";var o=c.createElement("script");o.src="//"+e.opts.forum+".disqus.com/embed.js",o.dataset.timestamp=Date.now(),o.onload=function(){e.stat.disqusLoaded=!0,t="连接成功,加载 Disqus 评论框……"},o.onerror=function(){1==e.opts.mode&&(t="连接失败,加载简易评论框……",e.getlist())};var n=new XMLHttpRequest;n.open("GET","//disqus.com/next/config.json?"+Date.now(),!0),n.timeout=e.opts.timeout,n.onreadystatechange=function(){4==n.readyState&&200==n.status&&(c.head||c.body).appendChild(o)},n.ontimeout=function(){n.abort(),1==e.opts.mode&&(t="连接超时,加载简易评论框……",e.getlist())},n.onerror=function(){1==e.opts.mode&&(t="连接失败,加载简易评论框……",e.getlist())},n.send()}},y.prototype.count=function(){var e=this,t=c.querySelectorAll("[data-disqus-url]"),o=t.length;if(o>0){for(var n=[],a=0;a<o;a++)n[a]=t[a].dataset.disqusUrl.replace(e.opts.site,"");r(e.opts.api+"/count.php?links="+n.join(","),function(t){JSON.parse(t).response.forEach(function(t){var o=t.link.replace(e.opts.site,""),n="/"!=o.slice(0,1)?"/"+o:o,a=c.querySelector('[data-disqus-url$="'+n+'"]');a&&(a.innerHTML=t.posts,a.dataset.disqusCount=t.posts)})},function(){console.log("获取数据失败!")})}},y.prototype.popular=function(){var e=this;e.opts.popular&&r(e.opts.api+"/popular.php",function(t){var o=JSON.parse(t);if(0==o.code){var n=o.response,a="";n.forEach(function(t){a+='<li><a href="'+t.link.replace(e.opts.site,"")+'" title="'+t.title+'">'+t.title+"</a></li>"}),e.opts.popular.innerHTML=a}},function(){console.log("获取数据失败!")})},y.prototype.getlist=function(){var e=this;e.stat.loading=!0,e.dom.querySelector("#idisqus").style.display="block",e.dom.querySelector("#disqus_thread").style.display="none",r(e.opts.api+"/getcomments.php?link="+e.opts.url+(e.stat.next?"&cursor="+e.stat.next:""),function(t){var o=JSON.parse(t);if(o.auth||alert("认证出错,请查看后端配置中,Disqus 帐号密码是否填写有误。"),0===o.code){e.stat.offsetTop=c.documentElement.scrollTop||c.body.scrollTop,e.stat.thread=o.thread,e.stat.count=o.posts,e.dom.querySelector("#idisqus").classList.remove("loading"),e.dom.querySelector("#comment-link").href=o.link,e.dom.querySelector("#comment-count").innerHTML=e.stat.count+" 条评论";var n=e.dom.querySelector(".comment-loadmore"),a=o.response?o.response:[];if(e.stat.root=[],a.forEach(function(t){e.load(t),t.parent||e.stat.root.unshift(t.id)}),o.cursor.hasPrev?e.stat.root.forEach(function(t){e.dom.querySelector(".comment-list").appendChild(e.dom.querySelector("#comment-"+t))}):(n.addEventListener("click",e.handle.loadMore,!1),e.dom.querySelector(".exit").addEventListener("click",e.handle.guestReset,!1),e.dom.querySelector(".comment-form-textarea").addEventListener("blur",e.handle.focus,!1),e.dom.querySelector(".comment-form-textarea").addEventListener("focus",e.handle.focus,!1),e.dom.querySelector(".comment-form-textarea").addEventListener("input",e.handle.input,!1),e.dom.querySelector(".comment-form-textarea").addEventListener("keyup",e.handle.mention,!1),e.dom.querySelector(".comment-form-email").addEventListener("blur",e.handle.verify,!1),e.dom.querySelector(".comment-form-submit").addEventListener("click",e.handle.post,!1),e.dom.querySelector(".comment-image-input").addEventListener("change",e.handle.upload,!1),m(e.dom.getElementsByClassName("emojione-item"),"click",e.handle.field)),o.cursor.hasNext?(e.stat.next=o.cursor.next,n.classList.remove("loading")):(e.stat.next=null,n.classList.add("hide")),0==a.length)return;if(window.scrollTo(0,e.stat.offsetTop),e.timeAgo(),/^#disqus|^#comment/.test(location.hash)&&!o.cursor.hasPrev&&!e.stat.disqusLoaded){var i=e.dom.querySelector("#idisqus "+location.hash);window.scrollBy(0,i.getBoundingClientRect().top)}e.stat.loading=!1,e.stat.loaded=!0}else 2===o.code&&e.create()},function(){alert("获取数据失败,请检查服务器设置。")})},y.prototype.load=function(e){var t=this,o=t.dom.querySelector('.comment-item[data-id="'+e.parent+'"]'),n={username:e.username,name:e.name,avatar:e.avatar};e.username&&-1==t.stat.users.map(function(e){return e.username}).indexOf(e.username)&&t.stat.users.push(n);var a=e.parent?{name:'<a class="comment-item-pname" href="#'+o.id+'"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28"></path></svg>'+o.dataset.name+"</a>",dom:o.querySelector(".comment-item-children"),insert:"afterbegin"}:{name:"",dom:t.dom.querySelector(".comment-list"),insert:"preview"==e.id||e.isPost?"afterbegin":"beforeend"},i="";e.media.length>0&&(e.media.forEach(function(e){i+='<a class="comment-item-imagelink" target="_blank" href="'+e+'" ><img class="comment-item-image" src="'+e+'"></a>'}),i='<div class="comment-item-images">'+i+"</div>");var r='<li class="comment-item" data-id="'+e.id+'" data-name="'+e.name+'" id="comment-'+e.id+'"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+e.id+'"><img src="'+e.avatar+'"></a><div class="comment-item-main"><div class="comment-item-header"><a class="comment-item-name" title="'+e.name+'" rel="nofollow" target="_blank" href="'+(e.url?e.url:"javascript:;")+'">'+e.name+"</a>"+(e.isMod?'<span class="comment-item-badge">'+t.opts.badge+"</span>":"")+a.name+'<span class="comment-item-bullet"> • </span><time class="comment-item-time" datetime="'+e.createdAt+'"></time></div><div class="comment-item-content">'+e.message+i+'</div><div class="comment-item-footer">'+(e.isPost?'<span class="comment-item-manage"><a class="comment-item-edit" href="javascript:;">编辑</a><span class="comment-item-bullet"> • </span><a class="comment-item-delete" href="javascript:;">删除</a><span class="comment-item-bullet"> • </span></span>':"")+'<a class="comment-item-reply" href="javascript:;">回复</a> </div></div></div><ul class="comment-item-children"></ul></li>';if(e.isDeleted&&(r='<li class="comment-item" data-id="'+e.id+'" id="comment-'+e.id+'" data-name="已删除"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+e.id+'"><img src="'+e.avatar+'"></a><div class="comment-item-main" data-message="此评论已被删除。"></div></div><ul class="comment-item-children"></ul></li>'),t.dom.querySelector('.comment-item[data-id="'+e.id+'"]')?t.dom.querySelector('.comment-item[data-id="'+e.id+'"]').outerHTML=r:a.dom.insertAdjacentHTML(a.insert,r),e.isDeleted||(t.dom.querySelector('.comment-item[data-id="'+e.id+'"] .comment-item-reply').addEventListener("click",t.handle.show,!1),t.dom.querySelector('.comment-item[data-id="'+e.id+'"] .comment-item-avatar').addEventListener("click",t.handle.jump,!1),e.parent&&t.dom.querySelector('.comment-item[data-id="'+e.id+'"] .comment-item-pname').addEventListener("click",t.handle.jump,!1)),e.isPost&&!t.stat.editing){var m=t.dom.querySelector('.comment-item[data-id="'+e.id+'"]');m.querySelector(".comment-item-footer").insertAdjacentHTML("beforeend",'<span class="comment-item-tips">页面刷新前,十分钟内可编辑或删除</span>'),setTimeout(function(){m.querySelector(".comment-item-tips")&&(m.querySelector(".comment-item-tips").outerHTML="")},5e3);var l=setTimeout(function(){m.querySelector(".comment-item-manage")&&(m.querySelector(".comment-item-manage").outerHTML="")},6e5);m.querySelector(".comment-item-delete").addEventListener("click",function(o){var n={id:e.id};o.currentTarget.innerHTML="删除中",s(t.opts.api+"/removecomment.php",n,function(e){var t=JSON.parse(e);0===t.code?1==t.response.isDeleted?m.outerHTML="":(alert(t.response.message),m.querySelector(".comment-item-manage").outerHTML=""):2===t.code&&(alert(t.response),m.querySelector(".comment-item-manage").outerHTML="")},function(){alert("删除出错,请稍后重试")}),clearTimeout(l)},!1),m.querySelector(".comment-item-edit").addEventListener("click",function(){t.stat.editing=e,t.edit(e)},!1)}},y.prototype.loadMore=function(e){var t=this;t.stat.loading||(e.currentTarget.classList.add("loading"),t.getlist())},y.prototype.focus=function(e){var t=e.currentTarget.closest(".comment-form-wrapper");t.classList.add("editing"),t.classList.contains("focus")?t.classList.remove("focus"):t.classList.add("focus")},y.prototype.input=function(e){e.currentTarget.closest(".comment-form").querySelector(".comment-form-alert").innerHTML=""},y.prototype.mention=function(e){var t=this,o=e.currentTarget,n=o.selectionStart,a=o.value.slice(0,n).lastIndexOf("@"),i=o.value.slice(a,n),r=t.dom.querySelector(".mention-user");if(0==i.search(/^@\w+$|^@$/)){if(38==e.keyCode||40==e.keyCode)return;var s=t.stat.users.filter(function(e){var t=new RegExp(i.slice(1),"i");return e.username.search(t)>-1}),l=t.getCaretCoord(o),c="",d="";s.length>0?(s.forEach(function(e,t){c+='<li class="mention-user-item'+(0==t?" active":"")+'" data-username="'+e.username+'"><img class="mention-user-avatar" src="'+e.avatar+'"><div class="mention-user-username">'+e.username+'</div><div class="mention-user-name">'+e.name+"</div></li>"}),r?(r.innerHTML='<ul class="mention-user-list">'+c+"</ul>",r.style.left=l.left+"px",r.style.top=l.top+"px"):(d='<div class="mention-user" style="left:'+l.left+"px;top:"+l.top+'px"><ul class="mention-user-list">'+c+"</ul></div>",t.dom.querySelector("#idisqus").insertAdjacentHTML("beforeend",d)),m(t.dom.getElementsByClassName("mention-user-item"),"mouseover",function(){t.dom.querySelector(".mention-user-item.active").classList.remove("active"),this.classList.add("active")}),m(t.dom.getElementsByClassName("mention-user-item"),"click",function(){var e="@"+this.dataset.username+" ";o.value=o.value.slice(0,a)+e+o.value.slice(n),t.dom.querySelector(".mention-user").outerHTML="",o.focus(),o.setSelectionRange(a+e.length,a+e.length),o.removeEventListener("keydown",t.handle.keySelect,!1)}),o.addEventListener("keydown",t.handle.keySelect,!1)):r&&(r.outerHTML="",o.removeEventListener("keydown",t.handle.keySelect,!1))}else r&&(r.outerHTML="",o.removeEventListener("keydown",t.handle.keySelect,!1))},y.prototype.getCaretCoord=function(e){var t=this,o=e.selectionEnd,n=c.createElement("div"),a=c.createElement("span"),i=getComputedStyle(e);[].forEach.call(i,function(e){n.style[e]=i[e]}),n.style.position="absolute",t.dom.appendChild(n),n.textContent=e.value.substr(0,o),a.textContent=e.value.substr(o)||".",n.appendChild(a);var r={top:e.offsetTop-e.scrollTop+a.offsetTop+parseFloat(i.lineHeight),left:e.offsetLeft-e.scrollLeft+a.offsetLeft};return t.dom.removeChild(n),r},y.prototype.keySelect=function(e){var t=this,o=e.currentTarget,n=o.selectionStart,a=o.value.slice(0,n).lastIndexOf("@"),i=(o.value.slice(a,n),t.dom.querySelector(".mention-user"),t.dom.querySelector(".mention-user-item.active"));switch(e.keyCode){case 13:var r="@"+i.dataset.username+" ";o.value=o.value.slice(0,a)+r+o.value.slice(n),o.setSelectionRange(a+r.length,a+r.length),t.dom.querySelector(".mention-user").outerHTML="",o.removeEventListener("keydown",t.handle.keySelect,!1),e.preventDefault();break;case 38:i.previousSibling&&(i.previousSibling.classList.add("active"),i.classList.remove("active")),e.preventDefault();break;case 40:i.nextSibling&&(i.nextSibling.classList.add("active"),i.classList.remove("active")),e.preventDefault()}},y.prototype.jump=function(e){var t=this,o=e.currentTarget,n=i(o.href).hash,a=t.dom.querySelector("#idisqus "+n);history.replaceState(void 0,void 0,n),window.scrollBy(0,a.getBoundingClientRect().top),e.preventDefault()},y.prototype.field=function(e){var t=e.currentTarget,o=t.closest(".comment-form"),n=o.querySelector(".comment-form-textarea"),a=n.selectionStart,i=0==a?t.dataset.code+" ":" "+t.dataset.code+" ";n.value=n.value.slice(0,a)+i+n.value.slice(a),n.focus(),n.setSelectionRange(a+i.length,a+i.length)},y.prototype.show=function(e){var t=this,o=e.currentTarget,n=o.closest(".comment-item"),a=t.dom.querySelector(".comment-item .comment-box:not([data-current-id])");if(a){var i=a.closest(".comment-item"),r=i.querySelector(".comment-item-cancel");r.outerHTML=r.outerHTML.replace("cancel","reply"),a.outerHTML=""}if("comment-item-reply"==o.className){o.outerHTML=o.outerHTML.replace("reply","cancel");var s=t.box.replace(/emoji-input/g,"emoji-input-"+n.dataset.id).replace(/upload-input/g,"upload-input-"+n.dataset.id);n.querySelector(".comment-item-children").insertAdjacentHTML("beforebegin",s),t.guest.init(),n.querySelector(".comment-form-textarea").addEventListener("blur",t.handle.focus,!1),n.querySelector(".comment-form-textarea").addEventListener("focus",t.handle.focus,!1),n.querySelector(".comment-form-textarea").addEventListener("keyup",t.handle.mention,!1),n.querySelector(".comment-form-textarea").addEventListener("input",t.handle.input,!1),n.querySelector(".comment-form-email").addEventListener("blur",t.handle.verify,!1),n.querySelector(".comment-form-submit").addEventListener("click",t.handle.post,!1),n.querySelector(".comment-image-input").addEventListener("change",t.handle.upload,!1),m(n.getElementsByClassName("emojione-item"),"click",t.handle.field),n.querySelector(".comment-form-textarea").focus()}m(t.dom.getElementsByClassName("comment-item-reply"),"click",t.handle.show),m(t.dom.getElementsByClassName("comment-item-cancel"),"click",t.handle.show)},y.prototype.verify=function(e){var t=this,o=e.currentTarget.closest(".comment-box"),n=o.querySelector(".comment-avatar-image"),a=o.querySelector(".comment-form-email");o.querySelector(".comment-form-alert"),/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(a.value)&&r(t.opts.api+"/getgravatar.php?email="+a.value,function(e){"false"==e?t.errorTips("您所填写的邮箱地址有误。",a):n.src=e},function(){})},y.prototype.upload=function(e){var t=this,o=e.currentTarget,n=o.closest(".comment-form"),a=n.querySelector(".comment-image-progress"),i=n.querySelector(".comment-image-loaded"),r=n.querySelector(".comment-form-wrapper"),s=n.querySelector(".comment-form-alert");if(s.innerHTML="",0!==o.files.length){var m=o.files[0].size;if(m>5e6)return s.innerHTML="请选择 5M 以下图片。",void setTimeout(function(){s.innerHTML=""},3e3);if(-1!=t.stat.imageSize.indexOf(m))return s.innerHTML="请勿选择已存在的图片。",void setTimeout(function(){s.innerHTML=""},3e3);a.style.width="80px",r.classList.add("expanded");var l=new FormData;l.append("file",o.files[0]);var c,d=o.files[0].name,u=new XMLHttpRequest;u.onreadystatechange=function(){if(4==u.readyState&&200==u.status){var e=JSON.parse(u.responseText);if(0==e.code){t.stat.imageSize.push(m);var o=e.response[d].url,a=new Image;a.src=o,a.onload=function(){c.innerHTML='<img class="comment-image-object" src="'+o+'">',c.dataset.imageUrl=o,c.classList.remove("loading"),c.addEventListener("click",t.handle.remove,!1)}}else s.innerHTML="图片上传出错。",c.innerHTML="",n.getElementsByClassName("comment-image-item").length&&r.classList.remove("expanded"),setTimeout(function(){s.innerHTML=""},3e3)}},u.upload.addEventListener("progress",function(e){i.style.width=Math.ceil(e.loaded/e.total*100)+"%"},!1),u.upload.addEventListener("load",function(e){i.style.width=0,a.style.width=0;var t='<li class="comment-image-item loading" data-image-size="'+m+'">\n <svg version="1.1" class="comment-image-object" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="24px" height="30px" viewBox="0 0 24 30" style="enable-background: new 0 0 50 50;" xml:space="preserve">\n <rect x="0" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="8" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="16" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n </svg>\n</li>\n';n.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",t),c=n.querySelector('[data-image-size="'+m+'"]')},!1),u.open("POST",t.opts.api+"/upload.php",!0),u.send(l)}},y.prototype.remove=function(e){var t=this,o=e.currentTarget.closest(".comment-image-item"),n=e.currentTarget.closest(".comment-form-wrapper");o.outerHTML="",t.stat.imageSize=[];var a=n.getElementsByClassName("comment-image-item");[].forEach.call(a,function(e,o){t.stat.imageSize[o]=e.dataset.imageSize}),0==t.stat.imageSize.length&&n.classList.remove("expanded"),n.querySelector(".comment-image-input").value=""},y.prototype.errorTips=function(e,t){var o=this;"true"==o.guest.logged_in&&o.handle.guestReset();var n=o.dom.querySelector("#idisqus"),a=o.dom.querySelector(".comment-form-error");a&&(a.outerHTML="");var i=t.offsetTop,r=t.offsetLeft,s='<div class="comment-form-error" style="top:'+i+"px;left:"+r+'px;">'+e+"</div>";n.insertAdjacentHTML("beforeend",s),setTimeout(function(){var e=o.dom.querySelector(".comment-form-error");e&&(e.outerHTML="")},3e3)},y.prototype.post=function(e){function t(){setTimeout(function(){f.innerHTML=""},3e3)}var o=this,n=e.currentTarget.closest(".comment-box[data-current-id]")||e.currentTarget.closest(".comment-item")||e.currentTarget.closest(".comment-box"),a=n.querySelector(".comment-form-textarea").value,i=n.dataset.id?n.dataset.id:"",r=n.getElementsByClassName("comment-image-item"),m=[],l="";if([].forEach.call(r,function(e,t){m[t]=e.dataset.imageUrl,l+=" "+e.dataset.imageUrl}),!n.dataset.currentId){var c=n.querySelector(".comment-form-name"),d=n.querySelector(".comment-form-email"),u=n.querySelector(".comment-form-url"),p={name:c.value,email:d.value,url:u.value.replace(/\s/g,""),avatar:n.querySelector(".comment-avatar-image").src},f=n.querySelector(".comment-form-alert");if(/^\s*$/i.test(p.name))return void o.errorTips("名字不能为空。",c);if(/^\s*$/i.test(p.email))return void o.errorTips("邮箱不能为空。",d);if(!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(p.email))return void o.errorTips("请正确填写邮箱。",d);if(!/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$|^\s*$/i.test(p.url))return void o.errorTips("请正确填写网址。",u);if(o.guest.submit(p),o.stat.message||o.stat.mediaHtml||(o.box=o.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/加入讨论……/,"")),!o.guest.name&&!o.guest.email)return;if(0==m.length&&/^\s*$/i.test(a))return f.innerHTML="评论不能为空或空格。",void n.querySelector(".comment-form-textarea").focus();var g=a;o.opts.emoji_preview?g=g.replace(/:([-+\w]+):/g,function(e){var t=e.replace(/:/g,"");return o.eac[t]?'<img class="emojione" width="24" height="24" alt="'+t+'" title=":'+t+':" src="'+o.opts.emoji_path+o.eac[t]+'.png">':e}):o.emoji_list.forEach(function(e){g=g.replace(":"+e.code+":",'<img class="emojione" width="24" height="24" src="'+o.opts.emoji_path+e.unicode+'.png" />')});var v={url:o.guest.url?o.guest.url:"",isMod:!1,username:null,name:o.guest.name,avatar:o.guest.avatar,id:"preview",parent:i,createdAt:(new Date).toJSON(),message:"<p>"+g+"</p>",media:m};o.load(v),o.timeAgo(),o.stat.message=a,o.stat.mediaHtml=n.querySelector(".comment-image-list").innerHTML,i?n.querySelector(".comment-item-cancel").click():(n.querySelector(".comment-form-textarea").value="",n.querySelector(".comment-image-list").innerHTML="",n.querySelector(".comment-form-wrapper").classList.remove("expanded","editing"))}var h=a.match(/@\w+/g);if(h&&(h=h.filter(function(e){return o.stat.users.map(function(e){return e.username}).indexOf(e.slice(1))>-1}),h.length>0)){var y=new RegExp("("+h.join("|")+")","g");a=a.replace(y,"$1:disqus")}if(a+=l,n.dataset.currentId){var q={id:n.dataset.currentId,message:a};s(o.opts.api+"/updatecomment.php",q,function(e){var t=JSON.parse(e);if(0===t.code){o.stat.message=null,o.stat.mediaHtml=null;var n=t.response;o.load(n),o.timeAgo(),o.stat.editing=!1}else o.load(o.stat.editing),o.timeAgo(),o.stat.editing=!1},function(){o.load(o.stat.editing),o.timeAgo(),o.stat.editing=!1})}else{var q={thread:o.stat.thread,parent:i,message:a,name:o.guest.name,email:o.guest.email,url:o.guest.url,link:o.opts.url,title:o.opts.title};s(o.opts.api+"/postcomment.php",q,function(e){var t=JSON.parse(e);if(0===t.code){o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.stat.count+=1,o.dom.querySelector("#comment-count").innerHTML=o.stat.count+" 条评论";var a=t.response;a.isPost=!0,o.load(a),o.timeAgo()}else 2===t.code&&(f.innerHTML=t.response,o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.reEdit(n),t.response.indexOf("author")>-1&&o.handle.guestReset())},function(){f.innerHTML="提交出错,请稍后重试。",t(),o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.reEdit(n)})}},y.prototype.reEdit=function(e){var t=this;e.dataset.id?e.querySelector(".comment-item-reply").click():e.querySelector(".comment-form-wrapper").classList.add("editing"),t.stat.message&&(e.querySelector(".comment-form-textarea").value=t.stat.message),t.stat.mediaHtml&&(e.querySelector(".comment-form-wrapper").classList.add("expanded"),e.querySelector(".comment-image-list").innerHTML=t.stat.mediaHtml,m(e.getElementsByClassName("comment-image-item"),"click",t.handle.remove))},y.prototype.edit=function(e){var t=this,o=t.box.replace("comment-box","comment-box comment-box-"+e.id).replace(/emoji-input/g,"emoji-input-"+e.id).replace(/upload-input/g,"upload-input-"+e.id);t.dom.querySelector('.comment-item[data-id="'+e.id+'"] .comment-item-body').outerHTML=o,t.guest.init();var n=t.dom.querySelector(".comment-box-"+e.id);n.dataset.currentId=e.id,n.querySelector(".comment-form-textarea").addEventListener("blur",t.handle.focus,!1),n.querySelector(".comment-form-textarea").addEventListener("focus",t.handle.focus,!1),n.querySelector(".comment-form-textarea").addEventListener("input",t.handle.input,!1),n.querySelector(".comment-form-textarea").addEventListener("keyup",t.handle.mention,!1),n.querySelector(".comment-form-email").addEventListener("blur",t.handle.verify,!1),n.querySelector(".comment-form-submit").addEventListener("click",t.handle.post,!1),n.querySelector(".comment-image-input").addEventListener("change",t.handle.upload,!1),m(n.getElementsByClassName("emojione-item"),"click",t.handle.field),n.querySelector(".comment-form-textarea").focus(),n.querySelector(".comment-actions-form").insertAdjacentHTML("afterbegin",'<a class="comment-form-cancel" href="javascript:;">取消</a>'),n.querySelector(".comment-form-cancel").addEventListener("click",function(){t.stat.editing=!1,t.load(e),t.timeAgo()},!1),t.stat.message&&(n.querySelector(".comment-form-textarea").value=t.stat.message),t.stat.mediaHtml&&(n.querySelector(".comment-form-wrapper").classList.add("expanded"),n.querySelector(".comment-image-list").innerHTML=t.stat.mediaHtml,m(n.getElementsByClassName("comment-image-item"),"click",t.handle.remove))},y.prototype.create=function(){var e=this;if(e.opts.auto){e.dom.querySelector(".loading-container").dataset.tip="正在创建 Thread……";var t={url:e.opts.link,identifier:e.opts.identifier,title:e.opts.title,slug:e.opts.slug,message:e.opts.desc};return void e.postThread(t)}e.dom.querySelector("#idisqus").classList.remove("loading"),e.dom.querySelector("#idisqus").innerHTML='<div class="comment-header"><span class="comment-header-item">创建 Thread</span></div><div class="comment-thread-form"><p>由于 Disqus 没有本页面的相关 Thread,故需先创建 Thread</p><div class="comment-form-item"><label class="comment-form-label">url:</label><input class="comment-form-input" id="thread-url" name="url" value="'+e.opts.link+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">identifier:</label><input class="comment-form-input" id="thread-identifier" name="identifier" value="'+e.opts.identifier+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">title:</label><input class="comment-form-input" id="thread-title" name="title" value="'+e.opts.title+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">slug:</label><input class="comment-form-input" id="thread-slug" name="slug" value="'+e.opts.slug+'" /></div><div class="comment-form-item"><label class="comment-form-label">message:</label><textarea class="comment-form-textarea" id="thread-message" name="message">'+e.opts.desc+'</textarea></div><button id="thread-submit" class="comment-form-submit">提交</button></div>',e.dom.querySelector("#thread-submit").addEventListener("click",e.handle.postThread,!1)},y.prototype.postThread=function(){var e=this;if(arguments[0].target)var t={url:e.dom.querySelector("#thread-url").value,identifier:e.dom.querySelector("#thread-identifier").value,title:e.dom.querySelector("#thread-title").value,slug:e.dom.querySelector("#thread-slug").value.replace(/[^A-Za-z0-9_-]+/g,""),message:e.dom.querySelector("#thread-message").value};else var t=arguments[0];s(e.opts.api+"/createthread.php",t,function(e){var t=JSON.parse(e);if(0!==t.code)return 2===t.code?t.response.indexOf("A thread already exists with link")>-1?void alert(t.response.replace("A thread already exists with link,","已存在此链接的相关 Thread,")):t.response.indexOf("Invalid URL")>-1?void alert("参数错误,无效的'URL'"):t.response.indexOf("Invalid slug")>-1?void alert("参数错误,无效的'slug'"):void alert(t.response):void alert(t.response);alert("创建 Thread 成功,刷新后便可愉快地评论了!"),setTimeout(function(){location.reload()},2e3)},function(){alert("创建 Thread 出错,请稍后重试!")})},y.prototype.destroy=function(){var e=this;e.dom.querySelector(".exit").removeEventListener("click",e.handle.guestReset,!1),l(e.dom.getElementsByClassName("comment-form-textarea"),"blur",e.handle.focus),l(e.dom.getElementsByClassName("comment-form-textarea"),"focus",e.handle.focus),l(e.dom.getElementsByClassName("comment-form-textarea"),"keyup",e.handle.mention),l(e.dom.getElementsByClassName("comment-form-email"),"blur",e.handle.verify),l(e.dom.getElementsByClassName("comment-form-submit"),"click",e.handle.post),l(e.dom.getElementsByClassName("comment-image-input"),"change",e.handle.upload),l(e.dom.getElementsByClassName("comment-item-reply"),"click",e.handle.show),l(e.dom.getElementsByClassName("comment-loadmore"),"click",e.handle.loadMore),l(e.dom.getElementsByClassName("emojione-item"),"click",e.handle.field),e.dom.innerHTML="",delete e.box,delete e.dom,delete e.emoji_list,delete e.guest,delete e.handle,delete e.opts,delete e.stat},"object"==typeof e&&e&&"object"==typeof t&&t?e.exports=y:void 0!==(n=function(){return y}.call(t,o,t,e))&&(e.exports=n)}(window)}).call(t,o(4)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}])});