Comments – wpDiscuz - Version 7.1.1

Version Description

Download this release

Release Info

Developer taron96
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.1.1
Comparing to
See all releases

Code changes from version 7.1.0 to 7.1.1

assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,14 +3,14 @@
3
  /* Autogrow */
4
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
5
  /* wpDiscuz */
6
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link",function(){var t=e("[data-comment-url]",this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.select(),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.submit()},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").removeAttr("checked"),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.submit(function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){let a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).removeAttr("required"),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).removeAttr("required"):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").focus()})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).scroll(pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e("#wpdiscuz-subscribe-form").submit(function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
7
  /* Colorbox */
8
- (function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),typeof t.fn.on === 'function'?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
9
  /* Media Uploader */
10
- jQuery(document).ready(function(e){if(e(document).delegate("#wpdcom .wmu-upload-wrap","click",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).delegate(".wmu-add-files","change",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,m="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,d)}),e(document).delegate(".wmu-attachment-delete","click",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).delegate(".wmu-preview","click",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[d.data.errorCode],"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
14
  jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
15
  /* Social */
16
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).delegate(".wpd-comment-share .fa-facebook-f","click",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).delegate("#wpdcom .wpd-social-login .wpdiscuz-login-button","click",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).delegate("#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button","click",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
3
  /* Autogrow */
4
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
5
  /* wpDiscuz */
6
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
7
  /* Colorbox */
8
+ !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
9
  /* Media Uploader */
10
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=a[0].files?a[0].files:[];o.length&&function(a,t,o){var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(o,function(e,a){i+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,o){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(o,function(o,d){var i=d.id,m="",s=d.fullname,u=d.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=d.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,o)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var o=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",o).length||e(".wmu-attached-images",o).remove(),e(".wmu-attached-videos *",o).length||e(".wmu-attached-videos",o).remove(),e(".wmu-attached-files *",o).length||e(".wmu-attached-files",o).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=(a.data("wmu-type"),a.data("wmu-attachment")),d=new FormData;d.append("action","wmuRemoveAttachmentPreview"),d.append("attachmentId",o),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(o){if(o.success){a.remove();var d=e(".wmu-tabs",t);e.each(d,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(o.data.attachmentsHtml),o.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",o.data.tooltip)}else o.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.errorCode],"error",3e3):o.data.error&&wpdiscuzAjaxObj.setCommentMessage(o.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
14
  jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
15
  /* Social */
16
+ function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,14 +7,14 @@
7
  /* Autogrow */
8
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link",function(){var t=e("[data-comment-url]",this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.select(),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.submit()},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").removeAttr("checked"),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.submit(function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){let a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).removeAttr("required"),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).removeAttr("required"):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").focus()})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).scroll(pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e("#wpdiscuz-subscribe-form").submit(function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
11
  /* Colorbox */
12
- (function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),typeof t.fn.on === 'function'?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
13
  /* Media Uploader */
14
- jQuery(document).ready(function(e){if(e(document).delegate("#wpdcom .wmu-upload-wrap","click",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).delegate(".wmu-add-files","change",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,m="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,d)}),e(document).delegate(".wmu-attachment-delete","click",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).delegate(".wmu-preview","click",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[d.data.errorCode],"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
18
  jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
19
  /* Social */
20
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).delegate(".wpd-comment-share .fa-facebook-f","click",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).delegate("#wpdcom .wpd-social-login .wpdiscuz-login-button","click",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).delegate("#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button","click",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
7
  /* Autogrow */
8
  jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
11
  /* Colorbox */
12
+ !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
13
  /* Media Uploader */
14
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=a[0].files?a[0].files:[];o.length&&function(a,t,o){var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(o,function(e,a){i+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,o){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(o,function(o,d){var i=d.id,m="",s=d.fullname,u=d.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=d.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,o)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var o=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",o).length||e(".wmu-attached-images",o).remove(),e(".wmu-attached-videos *",o).length||e(".wmu-attached-videos",o).remove(),e(".wmu-attached-files *",o).length||e(".wmu-attached-files",o).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=(a.data("wmu-type"),a.data("wmu-attachment")),d=new FormData;d.append("action","wmuRemoveAttachmentPreview"),d.append("attachmentId",o),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(o){if(o.success){a.remove();var d=e(".wmu-tabs",t);e.each(d,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(o.data.attachmentsHtml),o.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",o.data.tooltip)}else o.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.errorCode],"error",3e3):o.data.error&&wpdiscuzAjaxObj.setCommentMessage(o.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
18
  jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
19
  /* Social */
20
+ function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
assets/js/wpdiscuz-mu-backend.js CHANGED
@@ -24,6 +24,7 @@ jQuery(document).ready(function ($) {
24
  var clicked = $(this);
25
  var attachmentId = clicked.data('wmu-attachment');
26
  data.append('action', 'wmuDeleteAttachment');
 
27
  data.append('attachmentId', attachmentId);
28
  var ajax = wmuGetAjaxObj(data);
29
  ajax.done(function (r) {
@@ -69,7 +70,7 @@ jQuery(document).ready(function ($) {
69
  $(this).val(value.replace('-', ''));
70
  });
71
 
72
- $(".wmu-lightbox").colorbox({
73
  maxHeight: '95%',
74
  maxWidth: '95%',
75
  rel: 'wmu-lightbox',
24
  var clicked = $(this);
25
  var attachmentId = clicked.data('wmu-attachment');
26
  data.append('action', 'wmuDeleteAttachment');
27
+ data.append('wmu_nonce', wpdiscuzMUJsObj.wmuSecurity);
28
  data.append('attachmentId', attachmentId);
29
  var ajax = wmuGetAjaxObj(data);
30
  ajax.done(function (r) {
70
  $(this).val(value.replace('-', ''));
71
  });
72
 
73
+ $('.wmu-lightbox').colorbox({
74
  maxHeight: '95%',
75
  maxWidth: '95%',
76
  rel: 'wmu-lightbox',
assets/js/wpdiscuz-mu-frontend.js CHANGED
@@ -1,10 +1,10 @@
1
  jQuery(document).ready(function ($) {
2
 
3
- $(document).delegate('#wpdcom .wmu-upload-wrap', 'click', function () {
4
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0);
5
  });
6
 
7
- $(document).delegate('.wmu-add-files', 'change', function () {
8
  var btn = $(this);
9
  var form = btn.parents('.wpd_comm_form');
10
  var files = btn[0].files ? btn[0].files : [];
@@ -85,7 +85,7 @@ jQuery(document).ready(function ($) {
85
  });
86
  }
87
 
88
- $(document).delegate('.wmu-attachment-delete', 'click', function (e) {
89
  if (confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)) {
90
  var btn = $(this);
91
  var attachmentId = btn.data('wmu-attachment');
@@ -128,7 +128,7 @@ jQuery(document).ready(function ($) {
128
  * ajax request
129
  * remove preview from frontend (html) and backend (db data)
130
  */
131
- $(document).delegate('.wmu-preview', 'click', function () {
132
  var btn = $(this);
133
  var form = btn.parents('.wpd_comm_form');
134
  var type = btn.data('wmu-type');
1
  jQuery(document).ready(function ($) {
2
 
3
+ $(document).on('click', '#wpdcom .wmu-upload-wrap', function () {
4
  $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0);
5
  });
6
 
7
+ $(document).on('change', '.wmu-add-files', function () {
8
  var btn = $(this);
9
  var form = btn.parents('.wpd_comm_form');
10
  var files = btn[0].files ? btn[0].files : [];
85
  });
86
  }
87
 
88
+ $(document).on('click', '.wmu-attachment-delete', function (e) {
89
  if (confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)) {
90
  var btn = $(this);
91
  var attachmentId = btn.data('wmu-attachment');
128
  * ajax request
129
  * remove preview from frontend (html) and backend (db data)
130
  */
131
+ $(document).on('click', '.wmu-preview', function () {
132
  var btn = $(this);
133
  var form = btn.parents('.wpd_comm_form');
134
  var type = btn.data('wmu-type');
assets/js/wpdiscuz-mu-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){if(e(document).delegate("#wpdcom .wmu-upload-wrap","click",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).delegate(".wmu-add-files","change",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,m="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,d)}),e(document).delegate(".wmu-attachment-delete","click",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).delegate(".wmu-preview","click",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[d.data.errorCode],"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
1
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=a[0].files?a[0].files:[];o.length&&function(a,t,o){var d=new FormData;d.append("action","wmuUploadFiles"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val());var i=0;e.each(o,function(e,a){i+=a.size,d.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,o){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(o,function(o,d){var i=d.id,m="",s=d.fullname,u=d.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(m=d.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?m=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(m=wpdiscuzAjaxObj.wmuIconFile);var r='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';r=(r=(r=(r=(r=(r=r.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",m)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(r)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}(0,t,o)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),o=new FormData;o.append("action","wmuDeleteAttachment"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){if(a.success){var o=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",o).length||e(".wmu-attached-images",o).remove(),e(".wmu-attached-videos *",o).length||e(".wmu-attached-videos",o).remove(),e(".wmu-attached-files *",o).length||e(".wmu-attached-files",o).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data.errorCode],"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),o=(a.data("wmu-type"),a.data("wmu-attachment")),d=new FormData;d.append("action","wmuRemoveAttachmentPreview"),d.append("attachmentId",o),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(o){if(o.success){a.remove();var d=e(".wmu-tabs",t);e.each(d,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(o.data.attachmentsHtml),o.data.tooltip&&e(".wmu-upload-wrap").attr("wpd-tooltip",o.data.tooltip)}else o.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.errorCode],"error",3e3):o.data.error&&wpdiscuzAjaxObj.setCommentMessage(o.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
assets/js/wpdiscuz-options.js CHANGED
@@ -3,7 +3,7 @@ jQuery(document).ready(function ($) {
3
  /* global Chart */
4
  var doingAjax = false;
5
  if (location.href.indexOf('wpdiscuz_options_page') >= 0) {
6
- $('.wpdiscuz-color-picker').colorPicker();
7
  }
8
 
9
  $(document).on('click', '#wc_share_button_fb',function () {
@@ -133,7 +133,7 @@ jQuery(document).ready(function ($) {
133
  if (resp.progress < 100) {
134
  importSTCR(btn);
135
  } else {
136
- btn.removeAttr('disabled');
137
  $('.fas', btn).removeClass('fa-pulse fa-spinner').addClass('wc-hidden');
138
  }
139
 
@@ -180,7 +180,7 @@ jQuery(document).ready(function ($) {
180
  if (resp.progress < 100) {
181
  importLSTC(btn);
182
  } else {
183
- btn.removeAttr('disabled');
184
  $('.fas', btn).removeClass('fa-pulse fa-spinner').addClass('wc-hidden');
185
  }
186
 
@@ -632,8 +632,10 @@ jQuery(document).ready(function ($) {
632
  var sibling = $(this).siblings('.wpd-graph-tools');
633
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
634
  });
635
- $(document).on('click', 'body', function () {
636
- $('.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools, #wpd-opt-search-results').hide();
 
 
637
  });
638
  $(document).on('click', '.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools span.wpd_not_clicked', function () {
639
  var el = $(this);
3
  /* global Chart */
4
  var doingAjax = false;
5
  if (location.href.indexOf('wpdiscuz_options_page') >= 0) {
6
+ $('.wpdiscuz-color-picker').wpColorPicker();
7
  }
8
 
9
  $(document).on('click', '#wc_share_button_fb',function () {
133
  if (resp.progress < 100) {
134
  importSTCR(btn);
135
  } else {
136
+ btn.prop('disabled', false);
137
  $('.fas', btn).removeClass('fa-pulse fa-spinner').addClass('wc-hidden');
138
  }
139
 
180
  if (resp.progress < 100) {
181
  importLSTC(btn);
182
  } else {
183
+ btn.prop('disabled', false);
184
  $('.fas', btn).removeClass('fa-pulse fa-spinner').addClass('wc-hidden');
185
  }
186
 
632
  var sibling = $(this).siblings('.wpd-graph-tools');
633
  sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
634
  });
635
+ $(document).on('click', 'body', function (e) {
636
+ if (!$(e.target).hasClass('dashicons-admin-generic')) {
637
+ $('.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools, #wpd-opt-search-results').hide();
638
+ }
639
  });
640
  $(document).on('click', '.wpd-stat-graph .wpd-box-toggle .wpd-graph-tools span.wpd_not_clicked', function () {
641
  var el = $(this);
assets/js/wpdiscuz-social.js CHANGED
@@ -39,7 +39,7 @@ jQuery(document).ready(function ($) {
39
  scrollTop: $('#comments').offset().top - 32
40
  }, 1000);
41
  }
42
- $(document).delegate('.wpd-comment-share .fa-facebook-f', 'click', function () {
43
  if (wpdiscuzAjaxObj.enableFbShare != 1) {
44
  return;
45
  }
@@ -54,13 +54,13 @@ jQuery(document).ready(function ($) {
54
  });
55
 
56
  var socialLoginProvider = '';
57
- $(document).delegate('#wpdcom .wpd-social-login .wpdiscuz-login-button', 'click', function () {
58
  var socialLoginContainer = $(this).parents('.wpd-social-login');
59
  socialLoginProvider = wpdInitProvider($(this));
60
  wpdSocialLoginIsConfirmAgreement(socialLoginProvider, socialLoginContainer);
61
  });
62
 
63
- $(document).delegate('#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button', 'click', function () {
64
  var socialLoginContainer = $(this).parents('.wpd-form-wrap, .wpd-form').find('.wpd-social-login-agreement').slideUp(700);
65
  if ($(this).hasClass('wpd-agreement-button-agree')) {
66
  if (wpdiscuzAjaxObj.isCookiesEnabled) {
39
  scrollTop: $('#comments').offset().top - 32
40
  }, 1000);
41
  }
42
+ $(document).on('click', '.wpd-comment-share .fa-facebook-f', function () {
43
  if (wpdiscuzAjaxObj.enableFbShare != 1) {
44
  return;
45
  }
54
  });
55
 
56
  var socialLoginProvider = '';
57
+ $(document).on('click', '#wpdcom .wpd-social-login .wpdiscuz-login-button', function () {
58
  var socialLoginContainer = $(this).parents('.wpd-social-login');
59
  socialLoginProvider = wpdInitProvider($(this));
60
  wpdSocialLoginIsConfirmAgreement(socialLoginProvider, socialLoginContainer);
61
  });
62
 
63
+ $(document).on('click', '#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button', function () {
64
  var socialLoginContainer = $(this).parents('.wpd-form-wrap, .wpd-form').find('.wpd-social-login-agreement').slideUp(700);
65
  if ($(this).hasClass('wpd-agreement-button-agree')) {
66
  if (wpdiscuzAjaxObj.isCookiesEnabled) {
assets/js/wpdiscuz-social.min.js CHANGED
@@ -1 +1 @@
1
- function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).delegate(".wpd-comment-share .fa-facebook-f","click",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";t(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(t){"connected"===t.status?(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s)):FB.login(function(t){"connected"===t.status&&(n=t.authResponse.accessToken,o=t.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,i=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(i,"error")}catch(e){console.log(e)}t(n,0)}(s,a)}),""}function t(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).delegate("#wpdcom .wpd-social-login .wpdiscuz-login-button","click",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).delegate("#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button","click",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
1
+ function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
assets/js/wpdiscuz.js CHANGED
@@ -200,11 +200,11 @@ jQuery(document).ready(function($) {
200
  generateReCaptcha(uniqueID);
201
  });
202
 
203
- $(document).on('click', '#wpdcom .wpd-comment-link', function() {
204
- var val = $('[data-comment-url]',this).data('comment-url');
205
  var el = $('<input/>');
206
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
207
- el.select();
208
  document.execCommand('copy');
209
  el.remove();
210
  wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
@@ -284,7 +284,7 @@ jQuery(document).ready(function($) {
284
  .then(function(token) {
285
  console.log(5555);
286
  document.getElementById('wpdiscuz-recaptcha-field-subscribe-form').value = token;
287
- subscriptionForm.submit();
288
  }, function(reason) {
289
  wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
290
  console.log(reason);
@@ -506,7 +506,7 @@ jQuery(document).ready(function($) {
506
  }
507
 
508
  wpdValidateFieldRequired(wcForm, '#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val());
509
- wcForm.submit(function(e) {
510
  e.preventDefault();
511
  });
512
  if ($('.wc_comment', wcForm).val().trim() === '') {
@@ -605,7 +605,7 @@ jQuery(document).ready(function($) {
605
  if (isCookiesEnabled && wpdCookiesConsent) {
606
  addCookie(r.data);
607
  } else if (!wpdCookiesConsent) {
608
- $('.wpd-cookies-checkbox').removeAttr('checked');
609
  }
610
  if (wpdiscuzLoadRichEditor) {
611
  wpDiscuzEditor.createEditor('#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val()).setContents([{insert: '\n'}]);
@@ -728,7 +728,7 @@ jQuery(document).ready(function($) {
728
  if (r.success) {
729
  $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text').replaceWith(r.data.html);
730
  if (wpdiscuzLoadRichEditor) {
731
- let currentEditor = wpDiscuzEditor.createEditor('#wpd-editor-edit_' + uniqueID);
732
  currentEditor.clipboard.dangerouslyPasteHTML(0, r.data.content);
733
  currentEditor.update();
734
  $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
@@ -1308,7 +1308,7 @@ jQuery(document).ready(function($) {
1308
  }
1309
  wpdSanitizeCommentText(form);
1310
  $.each(fieldsGroup, function() {
1311
- $('input', this).removeAttr('required');
1312
  var checkedFields = $('input:checked', this);
1313
  if (checkedFields.length === 0) {
1314
  $('input', $(this)).prop('required', true);
@@ -1340,7 +1340,7 @@ jQuery(document).ready(function($) {
1340
 
1341
  $(document).on('change', '.wpd-required-group', function() {
1342
  if ($('input:checked', this).length !== 0) {
1343
- $('input', $(this)).removeAttr('required');
1344
  } else {
1345
  $('input', $(this)).prop('required', true);
1346
  }
@@ -1717,7 +1717,7 @@ jQuery(document).ready(function($) {
1717
  wpDiscuzEditor.createEditor('#wpd-editor-0_0').focus();
1718
  }
1719
  } else if ($('#wc-textarea-0_0').length) {
1720
- $('#wc-textarea-0_0').focus();
1721
  }
1722
  });
1723
  });
@@ -1899,7 +1899,7 @@ jQuery(document).ready(function($) {
1899
  } else if ($(e.target).parents('.wpd-inline-icon').length) {
1900
  currentEl = $(e.target).parents('.wpd-inline-icon');
1901
  }
1902
- if (currentEl.length) {
1903
  currentEl.parents('.wpd-inline-shortcode').addClass('wpd-active');
1904
  currentEl.siblings('.wpd-inline-form-wrapper').show();
1905
  currentEl.addClass('wpd-open');
@@ -2032,7 +2032,7 @@ jQuery(document).ready(function($) {
2032
  });
2033
  if (inlineFeedbackAttractionType === 'scroll_open' || inlineFeedbackAttractionType === 'blink') {
2034
  inlineAttraction();
2035
- $(window).scroll(inlineAttraction);
2036
  }
2037
 
2038
  function getInlineFormId(el) {
@@ -2054,7 +2054,7 @@ jQuery(document).ready(function($) {
2054
  $.each($('.wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon'), function() {
2055
  var el = $(this);
2056
  var diff = el.offset().top - window.pageYOffset;
2057
- if (diff > 0 && diff < 300) {
2058
  if (inlineFeedbackAttractionType === 'blink') {
2059
  el.addClass('wpd-blink');
2060
  setTimeout(function() {
@@ -2137,7 +2137,7 @@ jQuery(document).ready(function($) {
2137
  });
2138
  //========================= /POST RATING =====================//
2139
 
2140
- $('#wpdiscuz-subscribe-form').submit(function(e) {
2141
  e.preventDefault();
2142
  var wcForm = $(this);
2143
  if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm)) {
200
  generateReCaptcha(uniqueID);
201
  });
202
 
203
+ $(document).on('click', '#wpdcom .wpd-comment-link [data-comment-url]', function() {
204
+ var val = $(this).data('comment-url');
205
  var el = $('<input/>');
206
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
207
+ el.trigger('select');
208
  document.execCommand('copy');
209
  el.remove();
210
  wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
284
  .then(function(token) {
285
  console.log(5555);
286
  document.getElementById('wpdiscuz-recaptcha-field-subscribe-form').value = token;
287
+ subscriptionForm.trigger('submit');
288
  }, function(reason) {
289
  wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
290
  console.log(reason);
506
  }
507
 
508
  wpdValidateFieldRequired(wcForm, '#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val());
509
+ wcForm.on('submit', function(e) {
510
  e.preventDefault();
511
  });
512
  if ($('.wc_comment', wcForm).val().trim() === '') {
605
  if (isCookiesEnabled && wpdCookiesConsent) {
606
  addCookie(r.data);
607
  } else if (!wpdCookiesConsent) {
608
+ $('.wpd-cookies-checkbox').prop('checked', false);
609
  }
610
  if (wpdiscuzLoadRichEditor) {
611
  wpDiscuzEditor.createEditor('#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val()).setContents([{insert: '\n'}]);
728
  if (r.success) {
729
  $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text').replaceWith(r.data.html);
730
  if (wpdiscuzLoadRichEditor) {
731
+ var currentEditor = wpDiscuzEditor.createEditor('#wpd-editor-edit_' + uniqueID);
732
  currentEditor.clipboard.dangerouslyPasteHTML(0, r.data.content);
733
  currentEditor.update();
734
  $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
1308
  }
1309
  wpdSanitizeCommentText(form);
1310
  $.each(fieldsGroup, function() {
1311
+ $('input', this).prop('required', false);
1312
  var checkedFields = $('input:checked', this);
1313
  if (checkedFields.length === 0) {
1314
  $('input', $(this)).prop('required', true);
1340
 
1341
  $(document).on('change', '.wpd-required-group', function() {
1342
  if ($('input:checked', this).length !== 0) {
1343
+ $('input', $(this)).prop('required', false);
1344
  } else {
1345
  $('input', $(this)).prop('required', true);
1346
  }
1717
  wpDiscuzEditor.createEditor('#wpd-editor-0_0').focus();
1718
  }
1719
  } else if ($('#wc-textarea-0_0').length) {
1720
+ $('#wc-textarea-0_0').trigger('focus');
1721
  }
1722
  });
1723
  });
1899
  } else if ($(e.target).parents('.wpd-inline-icon').length) {
1900
  currentEl = $(e.target).parents('.wpd-inline-icon');
1901
  }
1902
+ if (currentEl.length && currentEl.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length) {
1903
  currentEl.parents('.wpd-inline-shortcode').addClass('wpd-active');
1904
  currentEl.siblings('.wpd-inline-form-wrapper').show();
1905
  currentEl.addClass('wpd-open');
2032
  });
2033
  if (inlineFeedbackAttractionType === 'scroll_open' || inlineFeedbackAttractionType === 'blink') {
2034
  inlineAttraction();
2035
+ $(window).on('scroll', inlineAttraction);
2036
  }
2037
 
2038
  function getInlineFormId(el) {
2054
  $.each($('.wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon'), function() {
2055
  var el = $(this);
2056
  var diff = el.offset().top - window.pageYOffset;
2057
+ if (el.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length && diff > 0 && diff < 300) {
2058
  if (inlineFeedbackAttractionType === 'blink') {
2059
  el.addClass('wpd-blink');
2060
  setTimeout(function() {
2137
  });
2138
  //========================= /POST RATING =====================//
2139
 
2140
+ $(document).on('submit', '#wpdiscuz-subscribe-form', function(e) {
2141
  e.preventDefault();
2142
  var wcForm = $(this);
2143
  if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm)) {
assets/js/wpdiscuz.min.js CHANGED
@@ -1 +1 @@
1
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link",function(){var t=e("[data-comment-url]",this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.select(),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.submit()},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").removeAttr("checked"),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.submit(function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){let a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).removeAttr("required"),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).removeAttr("required"):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").focus()})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).scroll(pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e("#wpdiscuz-subscribe-form").submit(function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
1
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(v)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),S>=940&&S<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),S>=810&&S<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),S>=730&&S<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),S>=610&&S<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),L>650&&(S>=510&&S<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S>=470&&S<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),S<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),me(z,!0,t)}}(o),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){I.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),H(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),me(z,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ae(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+a)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),k&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function le(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),me(z,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
assets/third-party/colorbox/jquery.colorbox.js CHANGED
@@ -228,7 +228,7 @@
228
 
229
  this.get = function(key) {
230
  var value = this.value(key);
231
- return $.isFunction(value) ? value.call(this.el, this) : value;
232
  };
233
  }
234
 
@@ -259,7 +259,7 @@
259
  function trapFocus(e) {
260
  if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
  e.stopPropagation();
262
- $box.focus();
263
  }
264
  }
265
 
@@ -318,12 +318,12 @@
318
  function start() {
319
  $slideshow
320
  .html(settings.get('slideshowStop'))
321
- .unbind(click)
322
  .one(click, stop);
323
 
324
  $events
325
- .bind(event_complete, set)
326
- .bind(event_load, clear);
327
 
328
  $box.removeClass(className + "off").addClass(className + "on");
329
  }
@@ -332,12 +332,12 @@
332
  clear();
333
 
334
  $events
335
- .unbind(event_complete, set)
336
- .unbind(event_load, clear);
337
 
338
  $slideshow
339
  .html(settings.get('slideshowStart'))
340
- .unbind(click)
341
  .one(click, function () {
342
  publicMethod.next();
343
  start();
@@ -351,15 +351,15 @@
351
  $slideshow.hide();
352
  clear();
353
  $events
354
- .unbind(event_complete, set)
355
- .unbind(event_load, clear);
356
  $box.removeClass(className + "off " + className + "on");
357
  }
358
 
359
  return function(){
360
  if (active) {
361
  if (!settings.get('slideshow')) {
362
- $events.unbind(event_cleanup, reset);
363
  reset();
364
  }
365
  } else {
@@ -424,7 +424,7 @@
424
 
425
  $groupControls.add($title).hide();
426
 
427
- $box.focus();
428
 
429
  if (settings.get('trapFocus')) {
430
  // Confine focus to the modal
@@ -442,7 +442,7 @@
442
  // Return focus on closing
443
  if (settings.get('returnFocus')) {
444
  $events.one(event_closed, function () {
445
- $(settings.el).focus();
446
  });
447
  }
448
  }
@@ -533,23 +533,23 @@
533
  init = true;
534
 
535
  // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
- $next.click(function () {
537
  publicMethod.next();
538
  });
539
- $prev.click(function () {
540
  publicMethod.prev();
541
  });
542
- $close.click(function () {
543
  publicMethod.close();
544
  });
545
- $overlay.click(function () {
546
  if (settings.get('overlayClose')) {
547
  publicMethod.close();
548
  }
549
  });
550
 
551
  // Key Bindings
552
- $(document).bind('keydown.' + prefix, function (e) {
553
  var key = e.keyCode;
554
  if (open && settings.get('escKey') && key === 27) {
555
  e.preventDefault();
@@ -558,10 +558,10 @@
558
  if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
  if (key === 37) {
560
  e.preventDefault();
561
- $prev.click();
562
  } else if (key === 39) {
563
  e.preventDefault();
564
- $next.click();
565
  }
566
  }
567
  });
@@ -602,7 +602,7 @@
602
 
603
  options = options || {};
604
 
605
- if ($.isFunction($obj)) { // assume a call to $.colorbox
606
  $obj = $('<a/>');
607
  options.open = true;
608
  }
@@ -643,7 +643,7 @@
643
  scrollTop,
644
  scrollLeft;
645
 
646
- $window.unbind('resize.' + prefix);
647
 
648
  // remove the modal so that it doesn't influence the document width/height
649
  $box.css({top: -9e4, left: -9e4});
@@ -723,11 +723,11 @@
723
 
724
  if (settings.get('reposition')) {
725
  setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
- $window.bind('resize.' + prefix, publicMethod.position);
727
  }, 1);
728
  }
729
 
730
- if ($.isFunction(loadedCallback)) {
731
  loadedCallback();
732
  }
733
  },
@@ -974,7 +974,7 @@
974
 
975
  $(photo)
976
  .addClass(prefix + 'Photo')
977
- .bind('error.'+prefix,function () {
978
  prep($tag(div, 'Error').html(settings.get('imgError')));
979
  })
980
  .one('load', function () {
@@ -1014,7 +1014,7 @@
1014
  if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
  photo.style.cursor = 'pointer';
1016
 
1017
- $(photo).bind('click.'+prefix, function () {
1018
  publicMethod.next();
1019
  });
1020
  }
@@ -1059,7 +1059,7 @@
1059
  open = false;
1060
  trigger(event_cleanup);
1061
  settings.get('onCleanup');
1062
- $window.unbind('.' + prefix);
1063
  $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1064
 
1065
  $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
@@ -1091,7 +1091,7 @@
1091
  .removeData(colorbox)
1092
  .removeClass(boxElement);
1093
 
1094
- $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
1095
  };
1096
 
1097
  // A method for fetching the current element Colorbox is referencing.
228
 
229
  this.get = function(key) {
230
  var value = this.value(key);
231
+ return typeof value === "function" ? value.call(this.el, this) : value;
232
  };
233
  }
234
 
259
  function trapFocus(e) {
260
  if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
  e.stopPropagation();
262
+ $box.trigger('focus');
263
  }
264
  }
265
 
318
  function start() {
319
  $slideshow
320
  .html(settings.get('slideshowStop'))
321
+ .off(click)
322
  .one(click, stop);
323
 
324
  $events
325
+ .on(event_complete, set)
326
+ .on(event_load, clear);
327
 
328
  $box.removeClass(className + "off").addClass(className + "on");
329
  }
332
  clear();
333
 
334
  $events
335
+ .off(event_complete, set)
336
+ .off(event_load, clear);
337
 
338
  $slideshow
339
  .html(settings.get('slideshowStart'))
340
+ .off(click)
341
  .one(click, function () {
342
  publicMethod.next();
343
  start();
351
  $slideshow.hide();
352
  clear();
353
  $events
354
+ .off(event_complete, set)
355
+ .off(event_load, clear);
356
  $box.removeClass(className + "off " + className + "on");
357
  }
358
 
359
  return function(){
360
  if (active) {
361
  if (!settings.get('slideshow')) {
362
+ $events.off(event_cleanup, reset);
363
  reset();
364
  }
365
  } else {
424
 
425
  $groupControls.add($title).hide();
426
 
427
+ $box.trigger('focus');
428
 
429
  if (settings.get('trapFocus')) {
430
  // Confine focus to the modal
442
  // Return focus on closing
443
  if (settings.get('returnFocus')) {
444
  $events.one(event_closed, function () {
445
+ $(settings.el).trigger('focus');
446
  });
447
  }
448
  }
533
  init = true;
534
 
535
  // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
+ $next.on('click', function () {
537
  publicMethod.next();
538
  });
539
+ $prev.on('click', function () {
540
  publicMethod.prev();
541
  });
542
+ $close.on('click', function () {
543
  publicMethod.close();
544
  });
545
+ $overlay.on('click', function () {
546
  if (settings.get('overlayClose')) {
547
  publicMethod.close();
548
  }
549
  });
550
 
551
  // Key Bindings
552
+ $(document).on('keydown.' + prefix, function (e) {
553
  var key = e.keyCode;
554
  if (open && settings.get('escKey') && key === 27) {
555
  e.preventDefault();
558
  if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
  if (key === 37) {
560
  e.preventDefault();
561
+ $prev.trigger('click');
562
  } else if (key === 39) {
563
  e.preventDefault();
564
+ $next.trigger('click');
565
  }
566
  }
567
  });
602
 
603
  options = options || {};
604
 
605
+ if (typeof $obj === "function") { // assume a call to $.colorbox
606
  $obj = $('<a/>');
607
  options.open = true;
608
  }
643
  scrollTop,
644
  scrollLeft;
645
 
646
+ $window.off('resize.' + prefix);
647
 
648
  // remove the modal so that it doesn't influence the document width/height
649
  $box.css({top: -9e4, left: -9e4});
723
 
724
  if (settings.get('reposition')) {
725
  setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
+ $window.on('resize.' + prefix, publicMethod.position);
727
  }, 1);
728
  }
729
 
730
+ if (typeof loadedCallback === "function") {
731
  loadedCallback();
732
  }
733
  },
974
 
975
  $(photo)
976
  .addClass(prefix + 'Photo')
977
+ .on('error.'+prefix,function () {
978
  prep($tag(div, 'Error').html(settings.get('imgError')));
979
  })
980
  .one('load', function () {
1014
  if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
  photo.style.cursor = 'pointer';
1016
 
1017
+ $(photo).on('click.'+prefix, function () {
1018
  publicMethod.next();
1019
  });
1020
  }
1059
  open = false;
1060
  trigger(event_cleanup);
1061
  settings.get('onCleanup');
1062
+ $window.off('.' + prefix);
1063
  $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1064
 
1065
  $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
1091
  .removeData(colorbox)
1092
  .removeClass(boxElement);
1093
 
1094
+ $(document).off('click.'+prefix).off('keydown.'+prefix);
1095
  };
1096
 
1097
  // A method for fetching the current element Colorbox is referencing.
assets/third-party/colorbox/jquery.colorbox.min.js CHANGED
@@ -3,4 +3,4 @@
3
  license: MIT
4
  http://www.jacklmoore.com/colorbox
5
  */
6
- (function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),typeof t.fn.on === 'function'?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
3
  license: MIT
4
  http://www.jacklmoore.com/colorbox
5
  */
6
+ !function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
assets/third-party/colorpicker/css/compatibility.css DELETED
@@ -1,45 +0,0 @@
1
- .cp-xy-slider {
2
- /* IE9 SVG, needs conditional override of 'filter' to 'none' */
3
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMCIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
4
- background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
5
- background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
6
- background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
7
- background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
8
- background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
9
- background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* W3C */
10
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-8 */
11
- }
12
-
13
- .cp-white {
14
- /* IE9 SVG, needs conditional override of 'filter' to 'none' */
15
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
16
- background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
17
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
18
- background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
19
- background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
20
- background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
21
- background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
22
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-8 */
23
- }
24
- .cp-z-slider {
25
- background: url(rainbow.png); /* Old browsers */
26
- /* IE9 SVG, needs conditional override of 'filter' to 'none' */
27
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE3JSIgc3RvcC1jb2xvcj0iI2ZmMDBmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjMzJSIgc3RvcC1jb2xvcj0iIzAwMDBmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzAwZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjY3JSIgc3RvcC1jb2xvcj0iIzAwZmYwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjgzJSIgc3RvcC1jb2xvcj0iI2ZmZmYwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZjAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
28
- background: -moz-linear-gradient(top, rgba(255,0,0,1) 0%, rgba(255,0,255,1) 17%, rgba(0,0,255,1) 33%, rgba(0,255,255,1) 50%, rgba(0,255,0,1) 67%, rgba(255,255,0,1) 83%, rgba(255,0,0,1) 100%); /* FF3.6+ */
29
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,0,0,1)), color-stop(17%,rgba(255,0,255,1)), color-stop(33%,rgba(0,0,255,1)), color-stop(50%,rgba(0,255,255,1)), color-stop(67%,rgba(0,255,0,1)), color-stop(83%,rgba(255,255,0,1)), color-stop(100%,rgba(255,0,0,1))); /* Chrome,Safari4+ */
30
- background: -webkit-linear-gradient(top, rgba(255,0,0,1) 0%,rgba(255,0,255,1) 17%,rgba(0,0,255,1) 33%,rgba(0,255,255,1) 50%,rgba(0,255,0,1) 67%,rgba(255,255,0,1) 83%,rgba(255,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
31
- background: -o-linear-gradient(top, rgba(255,0,0,1) 0%,rgba(255,0,255,1) 17%,rgba(0,0,255,1) 33%,rgba(0,255,255,1) 50%,rgba(0,255,0,1) 67%,rgba(255,255,0,1) 83%,rgba(255,0,0,1) 100%); /* Opera 11.10+ */
32
- background: -ms-linear-gradient(top, rgba(255,0,0,1) 0%,rgba(255,0,255,1) 17%,rgba(0,0,255,1) 33%,rgba(0,255,255,1) 50%,rgba(0,255,0,1) 67%,rgba(255,255,0,1) 83%,rgba(255,0,0,1) 100%); /* IE10+ */
33
- background: linear-gradient(to bottom, rgba(255,0,0,1) 0%,rgba(255,0,255,1) 17%,rgba(0,0,255,1) 33%,rgba(0,255,255,1) 50%,rgba(0,255,0,1) 67%,rgba(255,255,0,1) 83%,rgba(255,0,0,1) 100%); /* W3C */
34
- }
35
- .cp-alpha {
36
- /* IE9 SVG, needs conditional override of 'filter' to 'none' */
37
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMCIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
38
- background: -moz-linear-gradient(left, rgba(68,68,68,1) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */
39
- background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(68,68,68,1)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
40
- background: -webkit-linear-gradient(left, rgba(68,68,68,1) 0%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */
41
- background: -o-linear-gradient(left, rgba(68,68,68,1) 0%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */
42
- background: -ms-linear-gradient(left, rgba(68,68,68,1) 0%,rgba(0,0,0,0) 100%); /* IE10+ */
43
- background: linear-gradient(to right, rgba(68,68,68,1) 0%,rgba(0,0,0,0) 100%); /* W3C */
44
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#00000000',GradientType=1 ); /* IE6-8 */
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/third-party/colorpicker/css/index.css DELETED
@@ -1,10 +0,0 @@
1
- input:focus {
2
- outline: none;
3
- }
4
- .color {
5
- padding: .5em;
6
- margin-right: .4em;
7
- border: 1px solid #aaa;
8
- border-radius: 3px;
9
- width: 140px;
10
- }
 
 
 
 
 
 
 
 
 
 
assets/third-party/colorpicker/css/index.html DELETED
File without changes
assets/third-party/colorpicker/img/index.html DELETED
File without changes
assets/third-party/colorpicker/img/screen-shot-all.jpg DELETED
Binary file
assets/third-party/colorpicker/index.html DELETED
File without changes
assets/third-party/colorpicker/js/colors.js DELETED
@@ -1,418 +0,0 @@
1
- (function(window, undefined){
2
- "use strict"
3
-
4
- var _valueRanges = {
5
- rgb: {r: [0, 255], g: [0, 255], b: [0, 255]},
6
- hsv: {h: [0, 360], s: [0, 100], v: [0, 100]},
7
- hsl: {h: [0, 360], s: [0, 100], l: [0, 100]},
8
- alpha: {alpha: [0, 1]},
9
- HEX: {HEX: [0, 16777215]} // maybe we don't need this
10
- },
11
-
12
- _instance = {},
13
- _colors = {},
14
-
15
- grey = {r: 0.298954, g: 0.586434, b: 0.114612}, // CIE-XYZ 1931
16
- luminance = {r: 0.2126, g: 0.7152, b: 0.0722}, // W3C 2.0
17
-
18
- Colors = window.Colors = function(options) {
19
- this.colors = {RND: {}};
20
- this.options = {
21
- color: 'rgba(204, 82, 37, 0.8)', // init value(s)...
22
- grey: grey,
23
- luminance: luminance,
24
- valueRanges: _valueRanges
25
- // customBG: '#808080'
26
- // convertCallback: undefined,
27
- // allMixDetails: false
28
- };
29
- initInstance(this, options || {});
30
- },
31
- initInstance = function(THIS, options) {
32
- var importColor,
33
- _options = THIS.options,
34
- customBG;
35
-
36
- focusInstance(THIS);
37
- for (var option in options) {
38
- if (options[option] !== undefined) _options[option] = options[option];
39
- }
40
- customBG = _options.customBG;
41
- _options.customBG = (typeof customBG === 'string') ? ColorConverter.txt2color(customBG).rgb : customBG;
42
- _colors = setColor(THIS.colors, _options.color, undefined, true); // THIS.colors = _colors =
43
- },
44
- focusInstance = function(THIS) {
45
- if (_instance !== THIS) {
46
- _instance = THIS;
47
- _colors = THIS.colors;
48
- }
49
- };
50
-
51
- Colors.prototype.setColor = function(newCol, type, alpha) {
52
- focusInstance(this);
53
- if (newCol) {
54
- return setColor(this.colors, newCol, type, undefined, alpha);
55
- } else {
56
- if (alpha !== undefined) {
57
- this.colors.alpha = limitValue(alpha, 0, 1);
58
- }
59
- return convertColors(type);
60
- }
61
- };
62
-
63
- Colors.prototype.setCustomBackground = function(col) { // wild gues,... check again...
64
- focusInstance(this); // needed???
65
- this.options.customBG = (typeof col === 'string') ? ColorConverter.txt2color(col).rgb : col;
66
- // return setColor(this.colors, this.options.customBG, 'rgb', true); // !!!!RGB
67
- return setColor(this.colors, undefined, 'rgb'); // just recalculate existing
68
- };
69
-
70
- Colors.prototype.saveAsBackground = function() { // alpha
71
- focusInstance(this); // needed???
72
- // return setColor(this.colors, this.colors.RND.rgb, 'rgb', true);
73
- return setColor(this.colors, undefined, 'rgb', true);
74
- };
75
-
76
- // ------------------------------------------------------ //
77
- // ---------- Color calculation related stuff ---------- //
78
- // -------------------------------------------------------//
79
-
80
- function setColor(colors, color, type, save, alpha) { // color only full range
81
- if (typeof color === 'string') {
82
- var color = ColorConverter.txt2color(color); // new object
83
- type = color.type;
84
- _colors[type] = color[type];
85
- alpha = alpha !== undefined ? alpha : color.alpha;
86
- } else if (color) {
87
- for (var n in color) {
88
- colors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);
89
- }
90
- }
91
- if (alpha !== undefined) {
92
- colors.alpha = limitValue(+alpha, 0, 1);
93
- }
94
- return convertColors(type, save ? colors : undefined);
95
- }
96
-
97
- function saveAsBackground(RGB, rgb, alpha) {
98
- var grey = _instance.options.grey,
99
- color = {};
100
-
101
- color.RGB = {r: RGB.r, g: RGB.g, b: RGB.b};
102
- color.rgb = {r: rgb.r, g: rgb.g, b: rgb.b};
103
- color.alpha = alpha;
104
- // color.RGBLuminance = getLuminance(RGB);
105
- color.equivalentGrey = Math.round(grey.r * RGB.r + grey.g * RGB.g + grey.b * RGB.b);
106
-
107
- color.rgbaMixBlack = mixColors(rgb, {r: 0, g: 0, b: 0}, alpha, 1);
108
- color.rgbaMixWhite = mixColors(rgb, {r: 1, g: 1, b: 1}, alpha, 1);
109
- color.rgbaMixBlack.luminance = getLuminance(color.rgbaMixBlack, true);
110
- color.rgbaMixWhite.luminance = getLuminance(color.rgbaMixWhite, true);
111
-
112
- if (_instance.options.customBG) {
113
- color.rgbaMixCustom = mixColors(rgb, _instance.options.customBG, alpha, 1);
114
- color.rgbaMixCustom.luminance = getLuminance(color.rgbaMixCustom, true);
115
- _instance.options.customBG.luminance = getLuminance(_instance.options.customBG, true);
116
- }
117
-
118
- return color;
119
- }
120
-
121
- function convertColors(type, colorObj) {
122
- // console.time('convertColors');
123
- var colors = colorObj || _colors,
124
- convert = ColorConverter,
125
- options = _instance.options,
126
- ranges = _valueRanges,
127
- RND = colors.RND,
128
- // type = colorType, // || _mode.type,
129
- modes, mode = '', from = '', // value = '',
130
- exceptions = {hsl: 'hsv', rgb: type},
131
- RGB = RND.rgb, SAVE, SMART;
132
-
133
- if (type !== 'alpha') {
134
- for (var typ in ranges) {
135
- if (!ranges[typ][typ]) { // no alpha|HEX
136
- if (type !== typ) {
137
- from = exceptions[typ] || 'rgb';
138
- colors[typ] = convert[from + '2' + typ](colors[from]);
139
- }
140
-
141
- if (!RND[typ]) RND[typ] = {};
142
- modes = colors[typ];
143
- for(mode in modes) {
144
- RND[typ][mode] = Math.round(modes[mode] * ranges[typ][mode][1]);
145
- }
146
- }
147
- }
148
-
149
- RGB = RND.rgb;
150
- colors.HEX = convert.RGB2HEX(RGB);
151
- colors.equivalentGrey =
152
- options.grey.r * colors.rgb.r +
153
- options.grey.g * colors.rgb.g +
154
- options.grey.b * colors.rgb.b;
155
- colors.webSave = SAVE = getClosestWebColor(RGB, 51);
156
- // colors.webSave.HEX = convert.RGB2HEX(colors.webSave);
157
- colors.webSmart = SMART = getClosestWebColor(RGB, 17);
158
- // colors.webSmart.HEX = convert.RGB2HEX(colors.webSmart);
159
- colors.saveColor =
160
- RGB.r === SAVE.r && RGB.g === SAVE.g && RGB.b === SAVE.b ? 'web save' :
161
- RGB.r === SMART.r && RGB.g === SMART.g && RGB.b === SMART.b ? 'web smart' : '';
162
- colors.hueRGB = ColorConverter.hue2RGB(colors.hsv.h);
163
-
164
- if (colorObj) {
165
- colors.background = saveAsBackground(RGB, colors.rgb, colors.alpha);
166
- }
167
- } // else RGB = RND.rgb;
168
-
169
- var rgb = colors.rgb, // for better minification...
170
- alpha = colors.alpha,
171
- luminance = 'luminance',
172
- background = colors.background,
173
- rgbaMixBlack, rgbaMixWhite, rgbaMixCustom,
174
- rgbaMixBG, rgbaMixBGMixBlack, rgbaMixBGMixWhite, rgbaMixBGMixCustom;
175
-
176
- rgbaMixBlack = mixColors(rgb, {r: 0, g: 0, b: 0}, alpha, 1);
177
- rgbaMixBlack[luminance] = getLuminance(rgbaMixBlack, true);
178
- colors.rgbaMixBlack = rgbaMixBlack;
179
-
180
- rgbaMixWhite = mixColors(rgb, {r: 1, g: 1, b: 1}, alpha, 1);
181
- rgbaMixWhite[luminance] = getLuminance(rgbaMixWhite, true);
182
- colors.rgbaMixWhite = rgbaMixWhite;
183
-
184
- if (options.customBG) {
185
- rgbaMixBGMixCustom = mixColors(rgb, background.rgbaMixCustom, alpha, 1);
186
- rgbaMixBGMixCustom[luminance] = getLuminance(rgbaMixBGMixCustom, true);
187
- rgbaMixBGMixCustom.WCAG2Ratio = getWCAG2Ratio(rgbaMixBGMixCustom[luminance],
188
- background.rgbaMixCustom[luminance]);
189
- colors.rgbaMixBGMixCustom = rgbaMixBGMixCustom;
190
- /* ------ */
191
- rgbaMixBGMixCustom.luminanceDelta = Math.abs(
192
- rgbaMixBGMixCustom[luminance] - background.rgbaMixCustom[luminance]);
193
- rgbaMixBGMixCustom.hueDelta = getHueDelta(background.rgbaMixCustom, rgbaMixBGMixCustom, true);
194
- /* ------ */
195
- }
196
-
197
- colors.RGBLuminance = getLuminance(RGB);
198
- colors.HUELuminance = getLuminance(colors.hueRGB);
199
-
200
- // renderVars.readyToRender = true;
201
- if (options.convertCallback) {
202
- options.convertCallback(colors, type); //, convert); //, _mode);
203
- }
204
-
205
- // console.timeEnd('convertColors')
206
- // if (colorObj)
207
- return colors;
208
- }
209
-
210
-
211
- // ------------------------------------------------------ //
212
- // ------------------ color conversion ------------------ //
213
- // -------------------------------------------------------//
214
-
215
- var ColorConverter = {
216
- txt2color: function(txt) {
217
- var color = {},
218
- parts = txt.replace(/(?:#|\)|%)/g, '').split('('),
219
- values = (parts[1] || '').split(/,\s*/),
220
- type = parts[1] ? parts[0].substr(0, 3) : 'rgb',
221
- m = '';
222
-
223
- color.type = type;
224
- color[type] = {};
225
- if (parts[1]) {
226
- for (var n = 3; n--; ) {
227
- m = type[n] || type.charAt(n); // IE7
228
- color[type][m] = +values[n] / _valueRanges[type][m][1];
229
- }
230
- } else {
231
- color.rgb = ColorConverter.HEX2rgb(parts[0]);
232
- }
233
- // color.color = color[type];
234
- color.alpha = values[3] ? +values[3] : 1;
235
-
236
- return color;
237
- },
238
-
239
- RGB2HEX: function(RGB) {
240
- return (
241
- (RGB.r < 16 ? '0' : '') + RGB.r.toString(16) +
242
- (RGB.g < 16 ? '0' : '') + RGB.g.toString(16) +
243
- (RGB.b < 16 ? '0' : '') + RGB.b.toString(16)
244
- ).toUpperCase();
245
- },
246
-
247
- HEX2rgb: function(HEX) {
248
- HEX = HEX.split(''); // IE7
249
- return {
250
- r: parseInt(HEX[0] + HEX[HEX[3] ? 1 : 0], 16) / 255,
251
- g: parseInt(HEX[HEX[3] ? 2 : 1] + (HEX[3] || HEX[1]), 16) / 255,
252
- b: parseInt((HEX[4] || HEX[2]) + (HEX[5] || HEX[2]), 16) / 255
253
- };
254
- },
255
-
256
- hue2RGB: function(hue) {
257
- var h = hue * 6,
258
- mod = ~~h % 6, // Math.floor(h) -> faster in most browsers
259
- i = h === 6 ? 0 : (h - mod);
260
-
261
- return {
262
- r: Math.round([1, 1 - i, 0, 0, i, 1][mod] * 255),
263
- g: Math.round([i, 1, 1, 1 - i, 0, 0][mod] * 255),
264
- b: Math.round([0, 0, i, 1, 1, 1 - i][mod] * 255)
265
- };
266
- },
267
-
268
- // ------------------------ HSV ------------------------ //
269
-
270
- rgb2hsv: function(rgb) { // faster
271
- var r = rgb.r,
272
- g = rgb.g,
273
- b = rgb.b,
274
- k = 0, chroma, min, s;
275
-
276
- if (g < b) {
277
- g = b + (b = g, 0);
278
- k = -1;
279
- }
280
- min = b;
281
- if (r < g) {
282
- r = g + (g = r, 0);
283
- k = -2 / 6 - k;
284
- min = Math.min(g, b); // g < b ? g : b; ???
285
- }
286
- chroma = r - min;
287
- s = r ? (chroma / r) : 0;
288
- return {
289
- h: s < 1e-15 ? ((_colors && _colors.hsl && _colors.hsl.h) || 0) :
290
- chroma ? Math.abs(k + (g - b) / (6 * chroma)) : 0,
291
- s: r ? (chroma / r) : ((_colors && _colors.hsv && _colors.hsv.s) || 0), // ??_colors.hsv.s || 0
292
- v: r
293
- };
294
- },
295
-
296
- hsv2rgb: function(hsv) {
297
- var h = hsv.h * 6,
298
- s = hsv.s,
299
- v = hsv.v,
300
- i = ~~h, // Math.floor(h) -> faster in most browsers
301
- f = h - i,
302
- p = v * (1 - s),
303
- q = v * (1 - f * s),
304
- t = v * (1 - (1 - f) * s),
305
- mod = i % 6;
306
-
307
- return {
308
- r: [v, q, p, p, t, v][mod],
309
- g: [t, v, v, q, p, p][mod],
310
- b: [p, p, t, v, v, q][mod]
311
- };
312
- },
313
-
314
- // ------------------------ HSL ------------------------ //
315
-
316
- hsv2hsl: function(hsv) {
317
- var l = (2 - hsv.s) * hsv.v,
318
- s = hsv.s * hsv.v;
319
-
320
- s = !hsv.s ? 0 : l < 1 ? (l ? s / l : 0) : s / (2 - l);
321
-
322
- return {
323
- h: hsv.h,
324
- s: !hsv.v && !s ? ((_colors && _colors.hsl && _colors.hsl.s) || 0) : s, // ???
325
- l: l / 2
326
- };
327
- },
328
-
329
- rgb2hsl: function(rgb, dependent) { // not used in Color
330
- var hsv = ColorConverter.rgb2hsv(rgb);
331
-
332
- return ColorConverter.hsv2hsl(dependent ? hsv : (_colors.hsv = hsv));
333
- },
334
-
335
- hsl2rgb: function(hsl) {
336
- var h = hsl.h * 6,
337
- s = hsl.s,
338
- l = hsl.l,
339
- v = l < 0.5 ? l * (1 + s) : (l + s) - (s * l),
340
- m = l + l - v,
341
- sv = v ? ((v - m) / v) : 0,
342
- sextant = ~~h, // Math.floor(h) -> faster in most browsers
343
- fract = h - sextant,
344
- vsf = v * sv * fract,
345
- t = m + vsf,
346
- q = v - vsf,
347
- mod = sextant % 6;
348
-
349
- return {
350
- r: [v, q, m, m, t, v][mod],
351
- g: [t, v, v, q, m, m][mod],
352
- b: [m, m, t, v, v, q][mod]
353
- };
354
- }
355
- };
356
-
357
- // ------------------------------------------------------ //
358
- // ------------------ helper functions ------------------ //
359
- // -------------------------------------------------------//
360
-
361
- function getClosestWebColor(RGB, val) {
362
- var out = {},
363
- tmp = 0,
364
- half = val / 2;
365
-
366
- for (var n in RGB) {
367
- tmp = RGB[n] % val; // 51 = 'web save', 17 = 'web smart'
368
- out[n] = RGB[n] + (tmp > half ? val - tmp : -tmp);
369
- }
370
- return out;
371
- }
372
-
373
- function getHueDelta(rgb1, rgb2, nominal) {
374
- return (Math.max(rgb1.r - rgb2.r, rgb2.r - rgb1.r) +
375
- Math.max(rgb1.g - rgb2.g, rgb2.g - rgb1.g) +
376
- Math.max(rgb1.b - rgb2.b, rgb2.b - rgb1.b)) * (nominal ? 255 : 1) / 765;
377
- }
378
-
379
- function getLuminance(rgb, normalized) {
380
- var div = normalized ? 1 : 255,
381
- RGB = [rgb.r / div, rgb.g / div, rgb.b / div],
382
- luminance = _instance.options.luminance;
383
-
384
- for (var i = RGB.length; i--; ) {
385
- RGB[i] = RGB[i] <= 0.03928 ? RGB[i] / 12.92 : Math.pow(((RGB[i] + 0.055) / 1.055), 2.4);
386
- }
387
- return ((luminance.r * RGB[0]) + (luminance.g * RGB[1]) + (luminance.b * RGB[2]));
388
- }
389
-
390
- function mixColors(topColor, bottomColor, topAlpha, bottomAlpha) {
391
- var newColor = {},
392
- alphaTop = (topAlpha !== undefined ? topAlpha : 1),
393
- alphaBottom = (bottomAlpha !== undefined ? bottomAlpha : 1),
394
- alpha = alphaTop + alphaBottom * (1 - alphaTop); // 1 - (1 - alphaTop) * (1 - alphaBottom);
395
-
396
- for(var n in topColor) {
397
- newColor[n] = (topColor[n] * alphaTop + bottomColor[n] * alphaBottom * (1 - alphaTop)) / alpha;
398
- }
399
- newColor.a = alpha;
400
- return newColor;
401
- }
402
-
403
- function getWCAG2Ratio(lum1, lum2) {
404
- var ratio = 1;
405
-
406
- if (lum1 >= lum2) {
407
- ratio = (lum1 + 0.05) / (lum2 + 0.05);
408
- } else {
409
- ratio = (lum2 + 0.05) / (lum1 + 0.05);
410
- }
411
- return Math.round(ratio * 100) / 100;
412
- }
413
-
414
- function limitValue(value, min, max) {
415
- // return Math.max(min, Math.min(max, value)); // faster??
416
- return (value > max ? max : value < min ? min : value);
417
- }
418
- })(window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/third-party/colorpicker/js/index.html DELETED
File without changes
assets/third-party/colorpicker/js/index.js DELETED
@@ -1,498 +0,0 @@
1
- (function(window, $, undefined){
2
- 'use strict';
3
-
4
- var plugin = {},
5
- $pluginSelect = $('#pluginSelect'),
6
- getQueryVariable = function(variable) {
7
- var query = window.location.search.substring(1),
8
- vars = query.split('&'),
9
- pair, i;
10
-
11
- for (i = vars.length; i--; ) {
12
- pair = vars[i].split('=');
13
- if(pair[0] === variable){
14
- return pair[1].replace(/^\s*|\s*$/, '');
15
- }
16
- }
17
- return(false);
18
- },
19
- type = getQueryVariable('type');
20
-
21
- // plugin for mobile use (bigger and value/color display on top)
22
- plugin.mobile = {
23
- customBG: '#222',
24
- margin: '4px -2px 0',
25
- doRender: 'div div',
26
- preventFocus: true,
27
- animationSpeed: 0,
28
-
29
- // demo on how to make plugins... mobile support plugin
30
- buildCallback: function($elm) {
31
- $elm.prepend('<div class="cp-disp"></div>');
32
- $('.color').on('click', function(e) {
33
- e.preventDefault && e.preventDefault();
34
- });
35
- },
36
- cssAddon: // could also be in a css file instead
37
- '.cp-disp{padding:10px; margin-bottom:6px; font-size:19px; height:20px; line-height:20px}' +
38
- '.cp-xy-slider{width:200px; height:200px;}' +
39
- '.cp-xy-cursor{width:16px; height:16px; border-width:2px; margin:-8px}' +
40
- '.cp-z-slider{height:200px; width:40px;}' +
41
- '.cp-z-cursor{border-width:8px; margin-top:-8px;}' +
42
- '.cp-alpha{height:40px;}' +
43
- '.cp-alpha-cursor{border-width: 8px; margin-left:-8px;}',
44
-
45
- renderCallback: function($elm, toggled) {
46
- var colors = this.color.colors,
47
- rgb = colors.RND.rgb;
48
-
49
- $('.cp-disp').css({
50
- backgroundColor: '#' + colors.HEX,
51
- color: colors.RGBLuminance > 0.22 ? '#222' : '#ddd'
52
- }).text('rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b +
53
- ', ' + (Math.round(colors.alpha * 100) / 100) + ')');
54
- }
55
- };
56
-
57
- // shows input fields for rgb and hsv; changeable
58
- plugin.input = {
59
- customBG: '#222',
60
- margin: '4px -2px 0',
61
- doRender: 'div div',
62
-
63
- buildCallback: function($elm) {
64
- var colorInstance = this.color,
65
- colorPicker = this;
66
-
67
- $elm.prepend('<div class="cp-panel">' +
68
- 'R <input type="text" class="cp-r" /><br>' +
69
- 'G <input type="text" class="cp-g" /><br>' +
70
- 'B <input type="text" class="cp-b" /><hr>' +
71
- 'H <input type="text" class="cp-h" /><br>' +
72
- 'S <input type="text" class="cp-s" /><br>' +
73
- 'B <input type="text" class="cp-v" /><hr>' +
74
- '<input type="text" class="cp-HEX" />' +
75
- '</div>').on('change', 'input', function(e) {
76
- var value = this.value,
77
- className = this.className,
78
- type = className.split('-')[1],
79
- color = {};
80
-
81
- color[type] = value;
82
- colorInstance.setColor(type === 'HEX' ? value : color,
83
- type === 'HEX' ? 'HEX' : /(?:r|g|b)/.test(type) ? 'rgb' : 'hsv');
84
- colorPicker.render();
85
- this.blur();
86
- });
87
- },
88
-
89
- cssAddon: // could also be in a css file instead
90
- '.cp-color-picker{box-sizing:border-box; width:226px;}' +
91
- '.cp-color-picker .cp-panel {line-height: 21px; float:right;' +
92
- 'padding:0 1px 0 8px; margin-top:-1px; overflow:visible}' +
93
- '.cp-xy-slider:active {cursor:none;}' +
94
- '.cp-panel, .cp-panel input {color:#bbb; font-family:monospace,' +
95
- '"Courier New",Courier,mono; font-size:12px; font-weight:bold;}' +
96
- '.cp-panel input {width:28px; height:12px; padding:2px 3px 1px;' +
97
- 'text-align:right; line-height:12px; background:transparent;' +
98
- 'border:1px solid; border-color:#222 #666 #666 #222;}' +
99
- '.cp-panel hr {margin:0 -2px 2px; height:1px; border:0;' +
100
- 'background:#666; border-top:1px solid #222;}' +
101
- '.cp-panel .cp-HEX {width:44px; position:absolute; margin:1px -3px 0 -2px;}' +
102
- '.cp-alpha {width:155px;}',
103
-
104
- renderCallback: function($elm, toggled) {
105
- var colors = this.color.colors.RND,
106
- modes = {
107
- r: colors.rgb.r, g: colors.rgb.g, b: colors.rgb.b,
108
- h: colors.hsv.h, s: colors.hsv.s, v: colors.hsv.v,
109
- HEX: this.color.colors.HEX
110
- };
111
-
112
- $('input', '.cp-panel').each(function() {
113
- this.value = modes[this.className.substr(3)];
114
- });
115
- }
116
- };
117
-
118
- // shows memory fields
119
- plugin.memory = {
120
- customBG: '#222',
121
- margin: '4px -2px 0',
122
- doRender: 'div div',
123
- opacity: false,
124
-
125
- buildCallback: function($elm) {
126
- var colorInstance = this.color,
127
- colorPicker = this,
128
- random = function(n) {
129
- return Math.round(Math.random() * (n || 255));
130
- };
131
-
132
- $elm.append('<div class="cp-memory">' +
133
- '<div></div><div></div><div></div><div></div>' +
134
- '<div></div><div></div><div></div><div class="cp-store">S</div>').
135
- on('click', '.cp-memory div', function(e) {
136
- var $this = $(this);
137
-
138
- if (this.className) {
139
- $this.parent().prepend($this.prev()).children().eq(0).
140
- css('background-color', '#' + colorInstance.colors.HEX);
141
- } else {
142
- colorInstance.setColor($this.css('background-color'));
143
- colorPicker.render();
144
- }
145
- }).find('.cp-memory div').each(function() {
146
- !this.className && $(this).css({background:
147
- 'rgb(' + random() + ', ' + random() + ', ' + random() + ')'
148
- });
149
- });
150
- },
151
-
152
- cssAddon: // could also be in a css file instead
153
- '.cp-memory {margin-bottom:6px; clear:both;}' +
154
- '.cp-xy-slider:active {cursor:none;}' +
155
- '.cp-memory div {float:left; width:17px; height:17px; margin-right:2px;' +
156
- 'background:rgba(0,0,0,1); text-align:center; line-height:17px;}' +
157
- '.cp-memory .cp-store {width:21px; margin:0; background:none; font-weight:bold;' +
158
- 'box-sizing:border-box; border: 1px solid; border-color: #666 #222 #222 #666;}'
159
- };
160
-
161
- // the default; no extra stuff
162
- plugin.desktop = {
163
- customBG: '#222',
164
- margin: '4px -2px 0',
165
- doRender: 'div div',
166
- cssAddon:'.cp-xy-slider:active {cursor:none;}'
167
- };
168
-
169
- // the default without alpha chanel though
170
- plugin.noalpha = {
171
- customBG: '#222',
172
- margin: '4px -2px 0',
173
- doRender: 'div div',
174
- cssAddon:'.cp-xy-slider:active {cursor:none;}',
175
- opacity: false
176
- };
177
-
178
- // the default but smaller
179
- plugin.small = {
180
- customBG: '#222',
181
- margin: '4px -2px 0',
182
- doRender: 'div div',
183
- cssAddon: // could also be in a css file instead
184
- '.cp-color-picker{padding:5px 5px 0;}' +
185
- '.cp-xy-slider{width:100px; height:100px; margin-bottom:3px;}' +
186
- '.cp-z-slider{height:100px; margin-left:4px;}' +
187
- '.cp-alpha{margin:4px 0;}' +
188
- '.cp-xy-slider:active {cursor:none;}'
189
- };
190
-
191
- // better IE support
192
- plugin.IE8 = {
193
- customBG: '#222',
194
- margin: '4px -2px 0',
195
- doRender: 'div div',
196
- // this demo adds divs with gradiends,... you could simply load an image as well
197
- buildCallback: function($elm) {
198
- var that = this;
199
-
200
- $elm.find('.cp-z-slider').prepend(
201
- '<div class="cp-r-rb"></div>' +
202
- '<div class="cp-rb-b"></div>' +
203
- '<div class="cp-b-bg"></div>' +
204
- '<div class="cp-bg-g"></div>' +
205
- '<div class="cp-g-gr"></div>' +
206
- '<div class="cp-gr-r"></div>'
207
- );
208
- },
209
- cssAddon: // could also be in a css file instead
210
- '.cp-r-rb{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#ff0000\', endColorstr=\'#ff00ff\',GradientType=0 ); height:21px; width: 100%;}' +
211
- '.cp-rb-b{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#FF00FF\', endColorstr=\'#0000FF\',GradientType=0 ); height:21px; width: 100%;}' +
212
- '.cp-b-bg{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#0000FF\', endColorstr=\'#00FFFF\',GradientType=0 ); height:22px; width: 100%;}' +
213
- '.cp-bg-g{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#00FFFF\', endColorstr=\'#00FF00\',GradientType=0 ); height:21px; width: 100%;}' +
214
- '.cp-g-gr{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#00FF00\', endColorstr=\'#FFFF00\',GradientType=0 ); height:21px; width: 100%;}' +
215
- '.cp-gr-r{filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#FFFF00\', endColorstr=\'#FF0000\',GradientType=0 ); height:22px; width: 100%;}' +
216
- '.cp-z-cursor{top:0;height:0;}' +
217
- '.cp-xy-slider:active {cursor:none;}',
218
-
219
- renderCallback: function($elm, toggled) {
220
- // to avoid selection
221
- window.event && (window.event.returnValue = false);
222
- }
223
- };
224
-
225
-
226
- // the default skinned and white
227
- plugin.skinned = {
228
- customBG: '#222',
229
- margin: '5px -2px 0',
230
- doRender: 'div div',
231
- cssAddon: // could also be in a css file instead
232
- '.cp-color-picker{border:1px solid #999; padding:10px 10px 0;' +
233
- 'background:#eee; overflow:visible; border-radius:3px;}' +
234
- '.cp-color-picker:after{content:""; display:block; ' +
235
- 'position:absolute; top:-15px; left:12px; border:8px solid #eee;' +
236
- 'border-color: transparent transparent #eee}' +
237
- // simulate border...
238
- '.cp-color-picker:before{content:""; display:block; ' +
239
- 'position:absolute; top:-16px; left:12px; border:8px solid #eee;' +
240
- 'border-color: transparent transparent #999}' +
241
- '.cp-xy-slider:active {cursor:none;}' +
242
- '.cp-xy-slider{border:1px solid #999; margin-bottom:10px;}' +
243
- '.cp-xy-cursor{width:12px; height:12px; margin:-6px}' +
244
- '.cp-z-slider{margin-left:10px; border:1px solid #999;}' +
245
- '.cp-z-cursor{border-width:5px; margin-top:-5px;}' +
246
- '.cp-color-picker .cp-alpha{margin:10px 0 0; height:6px; border-radius:6px;' +
247
- 'overflow:visible; border:1px solid #999; box-sizing:border-box;' +
248
- 'background: linear-gradient(to right, rgba(238,238,238,1) 0%,rgba(238,238,238,0) 100%);}' +
249
- '.cp-color-picker .cp-alpha{margin:10px 0}' +
250
- '.cp-alpha-cursor{background: #eee; border-radius: 100%;' +
251
- 'width:14px; height:14px; margin:-5px -7px; border:1px solid #666!important;' +
252
- 'box-shadow:inset -2px -4px 3px #ccc}'
253
- };
254
-
255
- // the default skinned and white
256
- plugin.skinned_sa = $.extend({}, plugin.skinned, {
257
- renderCallback: function($elm, toggled) {
258
- if (typeof toggled === 'boolean') {
259
- $('.cp-alpha', this.$UI).css('display', $elm.hasClass('no-alpha') ? 'none' : '')
260
- }
261
- }});
262
-
263
- // skinned similar to dev tools color picker (but then way smaller and faster...)
264
- plugin.dev_skinned = {
265
- customBG: '#222',
266
- margin: '5px 0 0',
267
- doRender: 'div div',
268
- colorNames: {
269
- '191970': 'midnightblue',
270
- '696969': 'dimgrey',
271
- '708090': 'slategrey',
272
- '778899': 'lightslategrey',
273
- '800000': 'maroon',
274
- '800080': 'purple',
275
- '808000': 'olive',
276
- '808080': 'grey',
277
- 'F0F8FF': 'aliceblue',
278
- 'FAEBD7': 'antiquewhite',
279
- '00FFFF': 'cyan',
280
- '7FFFD4': 'aquamarine',
281
- 'F0FFFF': 'azure',
282
- 'F5F5DC': 'beige',
283
- 'FFE4C4': 'bisque',
284
- '000000': 'black',
285
- 'FFEBCD': 'blanchedalmond',
286
- '0000FF': 'blue',
287
- '8A2BE2': 'blueviolet',
288
- 'A52A2A': 'brown',
289
- 'DEB887': 'burlywood',
290
- '5F9EA0': 'cadetblue',
291
- '7FFF00': 'chartreuse',
292
- 'D2691E': 'chocolate',
293
- 'FF7F50': 'coral',
294
- '6495ED': 'cornflowerblue',
295
- 'FFF8DC': 'cornsilk',
296
- 'DC143C': 'crimson',
297
- '00008B': 'darkblue',
298
- '008B8B': 'darkcyan',
299
- 'B8860B': 'darkgoldenrod',
300
- 'A9A9A9': 'darkgrey',
301
- '006400': 'darkgreen',
302
- 'BDB76B': 'darkkhaki',
303
- '8B008B': 'darkmagenta',
304
- '556B2F': 'darkolivegreen',
305
- 'FF8C00': 'darkorange',
306
- '9932CC': 'darkorchid',
307
- '8B0000': 'darkred',
308
- 'E9967A': 'darksalmon',
309
- '8FBC8F': 'darkseagreen',
310
- '483D8B': 'darkslateblue',
311
- '2F4F4F': 'darkslategrey',
312
- '00CED1': 'darkturquoise',
313
- '9400D3': 'darkviolet',
314
- 'FF1493': 'deeppink',
315
- '00BFFF': 'deepskyblue',
316
- '1E90FF': 'dodgerblue',
317
- 'B22222': 'firebrick',
318
- 'FFFAF0': 'floralwhite',
319
- '228B22': 'forestgreen',
320
- 'FF00FF': 'magenta',
321
- 'DCDCDC': 'gainsboro',
322
- 'F8F8FF': 'ghostwhite',
323
- 'FFD700': 'gold',
324
- 'DAA520': 'goldenrod',
325
- '008000': 'green',
326
- 'ADFF2F': 'greenyellow',
327
- 'F0FFF0': 'honeydew',
328
- 'FF69B4': 'hotpink',
329
- 'CD5C5C': 'indianred',
330
- '4B0082': 'indigo',
331
- 'FFFFF0': 'ivory',
332
- 'F0E68C': 'khaki',
333
- 'E6E6FA': 'lavender',
334
- 'FFF0F5': 'lavenderblush',
335
- '7CFC00': 'lawngreen',
336
- 'FFFACD': 'lemonchiffon',
337
- 'ADD8E6': 'lightblue',
338
- 'F08080': 'lightcoral',
339
- 'E0FFFF': 'lightcyan',
340
- 'FAFAD2': 'lightgoldenrodyellow',
341
- 'D3D3D3': 'lightgrey',
342
- '90EE90': 'lightgreen',
343
- 'FFB6C1': 'lightpink',
344
- 'FFA07A': 'lightsalmon',
345
- '20B2AA': 'lightseagreen',
346
- '87CEFA': 'lightskyblue',
347
- 'B0C4DE': 'lightsteelblue',
348
- 'FFFFE0': 'lightyellow',
349
- '00FF00': 'lime',
350
- '32CD32': 'limegreen',
351
- 'FAF0E6': 'linen',
352
- '66CDAA': 'mediumaquamarine',
353
- '0000CD': 'mediumblue',
354
- 'BA55D3': 'mediumorchid',
355
- '9370DB': 'mediumpurple',
356
- '3CB371': 'mediumseagreen',
357
- '7B68EE': 'mediumslateblue',
358
- '00FA9A': 'mediumspringgreen',
359
- '48D1CC': 'mediumturquoise',
360
- 'C71585': 'mediumvioletred',
361
- 'F5FFFA': 'mintcream',
362
- 'FFE4E1': 'mistyrose',
363
- 'FFE4B5': 'moccasin',
364
- 'FFDEAD': 'navajowhite',
365
- '000080': 'navy',
366
- 'FDF5E6': 'oldlace',
367
- '6B8E23': 'olivedrab',
368
- 'FFA500': 'orange',
369
- 'FF4500': 'orangered',
370
- 'DA70D6': 'orchid',
371
- 'EEE8AA': 'palegoldenrod',
372
- '98FB98': 'palegreen',
373
- 'AFEEEE': 'paleturquoise',
374
- 'DB7093': 'palevioletred',
375
- 'FFEFD5': 'papayawhip',
376
- 'FFDAB9': 'peachpuff',
377
- 'CD853F': 'peru',
378
- 'FFC0CB': 'pink',
379
- 'DDA0DD': 'plum',
380
- 'B0E0E6': 'powderblue',
381
- 'FF0000': 'red',
382
- 'BC8F8F': 'rosybrown',
383
- '4169E1': 'royalblue',
384
- '8B4513': 'saddlebrown',
385
- 'FA8072': 'salmon',
386
- 'F4A460': 'sandybrown',
387
- '2E8B57': 'seagreen',
388
- 'FFF5EE': 'seashell',
389
- 'A0522D': 'sienna',
390
- 'C0C0C0': 'silver',
391
- '87CEEB': 'skyblue',
392
- '6A5ACD': 'slateblue',
393
- 'FFFAFA': 'snow',
394
- '00FF7F': 'springgreen',
395
- '4682B4': 'steelblue',
396
- 'D2B48C': 'tan',
397
- '008080': 'teal',
398
- 'D8BFD8': 'thistle',
399
- 'FF6347': 'tomato',
400
- '40E0D0': 'turquoise',
401
- 'EE82EE': 'violet',
402
- 'F5DEB3': 'wheat',
403
- 'FFFFFF': 'white',
404
- 'F5F5F5': 'whitesmoke',
405
- 'FFFF00': 'yellow',
406
- '9ACD32': 'yellowgreen'
407
- },
408
-
409
- buildCallback: function($elm) {
410
- var that = this;
411
-
412
- $elm.append('<div class="cp-patch"><div></div></div><div class="cp-disp"></div>');
413
- $('.trigger').parent().on('click', '.trigger', function(e) {
414
- if (e.target === this && $(this).hasClass('active')) {
415
- e.cancelBubble = true;
416
- e.stopPropagation && e.stopPropagation();
417
- that.toggle();
418
- }
419
- });
420
- // if input type="color"
421
- $('.color').on('click', function(e){
422
- e.preventDefault && e.preventDefault();
423
- });
424
- },
425
-
426
- cssAddon: // could also be in a css file instead
427
- '.cp-patch{float:left; margin:9px 0 0;' +
428
- 'height:24px; width: 24px; border:1px solid #aaa;}' +
429
- '.cp-patch{background-image: url(\'data:image/gif;base64,R0lGODlhDAAMAIABAMzMzP///yH5BAEAAAEALAAAAAAMAAwAAAIWhB+ph5ps3IMyQFBvzVRq3zmfGC5QAQA7\');}' +
430
- '.cp-patch div{height:24px; width: 24px;}' +
431
- '.cp-disp{padding:4px 0 4px 4px; margin-top:10px; font-size:12px;' +
432
- 'height:16px; line-height:16px; color:#333;}' +
433
- '.cp-color-picker{border:1px solid #999; padding:8px; box-shadow:5px 5px 16px rgba(0,0,0,0.4);' +
434
- 'background:#eee; overflow:visible; border-radius:3px;}' +
435
- '.cp-color-picker:after{content:""; display:block; ' +
436
- 'position:absolute; top:-8px; left:8px; border:8px solid #eee; border-width: 0px 8px 8px;' +
437
- 'border-color: transparent transparent #eee}' +
438
- // simulate border...
439
- '.cp-color-picker:before{content:""; display:block; ' +
440
- 'position:absolute; top:-9px; left:8px; border:8px solid #eee; border-width: 0px 8px 8px;' +
441
- 'border-color: transparent transparent #999}' +
442
- '.cp-xy-slider{border:1px solid #aaa; margin-bottom:10px; width:150px; height:150px;}' +
443
- '.cp-xy-slider:active {cursor:none;}' +
444
- '.cp-xy-cursor{width:12px; height:12px; margin:-6px}' +
445
- '.cp-z-slider{margin-left:8px; border:1px solid #aaa; height:150px; width:24px;}' +
446
- '.cp-z-cursor{border-width:5px; margin-top:-5px;}' +
447
- '.cp-color-picker .cp-alpha{width:152px; margin:10px 0 0; height:6px; border-radius:6px;' +
448
- 'overflow:visible; border:1px solid #aaa; box-sizing:border-box;' +
449
- 'background: linear-gradient(to right, rgba(238,238,238,1) 0%,rgba(238,238,238,0) 100%);}' +
450
- '.cp-alpha-cursor{background: #eee; border-radius: 100%;' +
451
- 'width:14px; height:14px; margin:-5px -7px; border:1px solid #999!important;' +
452
- 'box-shadow:inset -2px -4px 3px #ccc}' +
453
- '.cp-alpha:after{position:relative; content:"α"; color:#666; font-size:16px;' +
454
- 'font-family:monospace; position:absolute; right:-26px; top:-8px}',
455
-
456
- renderCallback: function($elm, toggled) {
457
- var colors = this.color.colors,
458
- rgb = colors.RND.rgb;
459
-
460
- $('.cp-patch div').css({'background-color': $elm[0].style.backgroundColor});
461
- $('.cp-disp').text(this.color.options.colorNames[colors.HEX] || $elm.val());
462
- if (toggled === true) {
463
- // here you can recalculate position after showing the color picker
464
- // in case it doesn't fit into view.
465
- $('.trigger').removeClass('active');
466
- $elm.closest('.trigger').addClass('active');
467
- } else if (toggled === false) {
468
- $elm.closest('.trigger').removeClass('active');
469
- }
470
- }
471
- };
472
-
473
- plugin.dev_skinned_hh = $.extend({}, plugin.dev_skinned,
474
- {cssAddon: plugin.dev_skinned.cssAddon +
475
- '.cp-xy-slider{height:100px}' +
476
- '.cp-z-slider{height:100px}' +
477
- '.cp-xy-slider, .cp-patch, .cp-z-slider{box-shadow: inset 1px 1px 8px rgba(0,0,0,.15),' +
478
- ' inset -1px -1px 6px rgba(0,0,0,.15);'});
479
-
480
-
481
- $pluginSelect.val(type || 'desktop').
482
- on('change', function(e) {
483
- window.location = './?type=' + this.value + '#demo'
484
- });
485
-
486
-
487
- var isMobile = /webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.
488
- test(window.navigator.userAgent);
489
-
490
- type === 'mobile' && !isMobile && $('#qr').show();
491
- isMobile && $('.div-toggles').hide();
492
-
493
- window.myColorPicker = $('.color').colorPicker(
494
- plugin[type] || plugin.desktop
495
- );
496
- $('.trigger').colorPicker();
497
- // $('pre').colorPicker({doRender: false});
498
- })(window, jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/third-party/colorpicker/js/jqColorPicker.js DELETED
@@ -1,332 +0,0 @@
1
- (function($, Colors, undefined){
2
- 'use strict';
3
-
4
- var $document = $(document),
5
- _instance,
6
- _colorPicker,
7
- _color,
8
- _options,
9
- _selector = '',
10
-
11
- _$trigger,
12
- _$UI, _$xy_slider, _$xy_cursor, _$z_cursor , _$alpha , _$alpha_cursor,
13
-
14
- _pointermove = 'touchmove.a mousemove.a pointermove.a',
15
- _pointerdown = 'touchstart.a mousedown.a pointerdown.a',
16
- _pointerup = 'touchend.a mouseup.a pointerup.a',
17
- _GPU = false,
18
- _animate = window.requestAnimationFrame ||
19
- window.webkitRequestAnimationFrame || function(cb){cb()},
20
- _html = '<div class="cp-color-picker"><div class="cp-z-slider"><div c' +
21
- 'lass="cp-z-cursor"></div></div><div class="cp-xy-slider"><div cl' +
22
- 'ass="cp-white"></div><div class="cp-xy-cursor"></div></div><div ' +
23
- 'class="cp-alpha"><div class="cp-alpha-cursor"></div></div></div>',
24
- // 'grunt-contrib-uglify' puts all this back to one single string...
25
- _css = '.cp-color-picker{position:absolute;overflow:hidden;padding:6p' +
26
- 'x 6px 0;background-color:#444;color:#bbb;font-family:Arial,Helve' +
27
- 'tica,sans-serif;font-size:12px;font-weight:400;cursor:default;bo' +
28
- 'rder-radius:5px}.cp-color-picker>div{position:relative;overflow:' +
29
- 'hidden}.cp-xy-slider{float:left;height:128px;width:128px;margin-' +
30
- 'bottom:6px;background:linear-gradient(to right,#FFF,rgba(255,255' +
31
- ',255,0))}.cp-white{height:100%;width:100%;background:linear-grad' +
32
- 'ient(rgba(0,0,0,0),#000)}.cp-xy-cursor{position:absolute;top:0;w' +
33
- 'idth:10px;height:10px;margin:-5px;border:1px solid #fff;border-r' +
34
- 'adius:100%;box-sizing:border-box}.cp-z-slider{float:right;margin' +
35
- '-left:6px;height:128px;width:20px;background:linear-gradient(red' +
36
- ' 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%)}.cp-z-' +
37
- 'cursor{position:absolute;margin-top:-4px;width:100%;border:4px s' +
38
- 'olid #fff;border-color:transparent #fff;box-sizing:border-box}.c' +
39
- 'p-alpha{clear:both;width:100%;height:16px;margin:6px 0;backgroun' +
40
- 'd:linear-gradient(to right,#444,rgba(0,0,0,0))}.cp-alpha-cursor{' +
41
- 'position:absolute;margin-left:-4px;height:100%;border:4px solid ' +
42
- '#fff;border-color:#fff transparent;box-sizing:border-box}',
43
-
44
- ColorPicker = function(options) {
45
- _color = this.color = new Colors(options);
46
- _options = _color.options;
47
- };
48
-
49
- ColorPicker.prototype = {
50
- render: preRender,
51
- toggle: toggle
52
- };
53
-
54
- function extractValue(elm) {
55
- return elm.value || elm.getAttribute('value') ||
56
- $(elm).css('background-color') || '#fff';
57
- }
58
-
59
- function resolveEventType(event) {
60
- event = event.originalEvent && event.originalEvent.touches ?
61
- event.originalEvent.touches[0] : event;
62
-
63
- return event.originalEvent ? event.originalEvent : event;
64
- }
65
-
66
- function findElement($elm) {
67
- return $($elm.find(_options.doRender)[0] || $elm[0]);
68
- }
69
-
70
- function toggle(event) {
71
- var $this = $(this),
72
- position = $this.offset(),
73
- $window = $(window),
74
- gap = _options.gap;
75
-
76
- if (event) {
77
- _$trigger = findElement($this);
78
- _colorPicker.$trigger = $this;
79
-
80
- (_$UI || build()).css({
81
- // 'width': _$UI[0]._width,
82
- 'left': (_$UI[0]._left = position.left) -
83
- ((_$UI[0]._left = _$UI[0]._left + _$UI[0]._width -
84
- ($window.scrollLeft() + $window.width())) + gap > 0 ?
85
- _$UI[0]._left + gap : 0),
86
- 'top': (_$UI[0]._top = position.top + $this.outerHeight()) -
87
- ((_$UI[0]._top = _$UI[0]._top + _$UI[0]._height -
88
- ($window.scrollTop() + $window.height())) + gap > 0 ?
89
- _$UI[0]._top + gap : 0)
90
- }).show(_options.animationSpeed, function() {
91
- if (event === true) {
92
- return;
93
- }
94
- _$alpha._width = _$alpha.width();
95
- _$xy_slider._width = _$xy_slider.width();
96
- _$xy_slider._height = _$xy_slider.height();
97
- _color.setColor(extractValue(_$trigger[0]));
98
-
99
- preRender(true);
100
- });
101
- } else {
102
- $(_$UI).hide(_options.animationSpeed, function() {
103
- _$trigger.blur();
104
- _colorPicker.$trigger = null;
105
- preRender(false);
106
- });
107
- }
108
- }
109
-
110
- function build() {
111
- $('head').append('<style type="text/css">' +
112
- (_options.css || _css) + (_options.cssAddon || '') + '</style>');
113
-
114
- return _colorPicker.$UI = _$UI =
115
- $(_html).css({'margin': _options.margin}).
116
- appendTo('body').
117
- show(0, function() {
118
- var $this = $(this);
119
-
120
- _GPU = _options.GPU && $this.css('perspective') !== undefined;
121
- _$xy_slider = $('.cp-xy-slider', this);
122
- _$xy_cursor = $('.cp-xy-cursor', this);
123
- _$z_cursor = $('.cp-z-cursor', this);
124
- _$alpha = $('.cp-alpha', this).toggle(!!_options.opacity);
125
- _$alpha_cursor = $('.cp-alpha-cursor', this);
126
- _options.buildCallback.call(_colorPicker, $this);
127
- $this.prepend('<div>').children().eq(0).css('width',
128
- $this.children().eq(0).width() // stabilizer
129
- );
130
- this._width = this.offsetWidth;
131
- this._height = this.offsetHeight;
132
- }).hide().
133
- on(_pointerdown,
134
- '.cp-xy-slider,.cp-z-slider,.cp-alpha', pointerdown);
135
- }
136
-
137
- function pointerdown(e) {
138
- var action = this.className.
139
- replace(/cp-(.*?)(?:\s*|$)/, '$1').replace('-', '_');
140
-
141
- e.preventDefault && e.preventDefault();
142
- e.returnValue = false;
143
-
144
- _$trigger._offset = $(this).offset();
145
-
146
- (action = action === 'xy_slider' ? xy_slider :
147
- action === 'z_slider' ? z_slider : alpha)(e);
148
- preRender();
149
-
150
- $document.on(_pointerup, function(e) {
151
- $document.off('.a');
152
- }).on(_pointermove, function(e) {
153
- action(e);
154
- preRender();
155
- });
156
- }
157
-
158
- function xy_slider(event) {
159
- var e = resolveEventType(event),
160
- x = e.pageX - _$trigger._offset.left,
161
- y = e.pageY - _$trigger._offset.top;
162
-
163
- _color.setColor({
164
- s: x / _$xy_slider._width * 100,
165
- v: 100 - (y / _$xy_slider._height * 100)
166
- }, 'hsv');
167
- }
168
-
169
- function z_slider(event) {
170
- var z = resolveEventType(event).pageY - _$trigger._offset.top;
171
-
172
- _color.setColor({h: 360 - (z / _$xy_slider._height * 360)}, 'hsv');
173
- }
174
-
175
- function alpha(event) {
176
- var x = resolveEventType(event).pageX - _$trigger._offset.left,
177
- alpha = x / _$alpha._width;
178
-
179
- _color.setColor({}, 'rgb', alpha);
180
- }
181
-
182
- function preRender(toggled) {
183
- var colors = _color.colors,
184
- hueRGB = colors.hueRGB,
185
- RGB = colors.RND.rgb,
186
- HSL = colors.RND.hsl,
187
- dark = '#222',
188
- light = '#ddd',
189
- colorMode = _$trigger.data('colorMode'),
190
- isAlpha = colors.alpha !== 1,
191
- alpha = Math.round(colors.alpha * 100) / 100,
192
- RGBInnerText = RGB.r + ', ' + RGB.g + ', ' + RGB.b,
193
- text = (colorMode === 'HEX' && !isAlpha ? '#' + colors.HEX :
194
- colorMode === 'rgb' || (colorMode === 'HEX' && isAlpha) ?
195
- (!isAlpha ? 'rgb(' + RGBInnerText + ')' :
196
- 'rgba(' + RGBInnerText + ', ' + alpha + ')') :
197
- ('hsl' + (isAlpha ? 'a(' : '(') + HSL.h + ', ' + HSL.s + '%, ' +
198
- HSL.l + '%' + (isAlpha ? ', ' + alpha : '') + ')')),
199
- HUEContrast = colors.HUELuminance > 0.22 ? dark : light,
200
- alphaContrast = colors.rgbaMixBlack.luminance > 0.22 ? dark : light,
201
- h = (1 - colors.hsv.h) * _$xy_slider._height,
202
- s = colors.hsv.s * _$xy_slider._width,
203
- v = (1 - colors.hsv.v) * _$xy_slider._height,
204
- a = alpha * _$alpha._width,
205
- translate3d = _GPU ? 'translate3d' : '',
206
- triggerValue = _$trigger.val(),
207
- hasNoValue = _$trigger[0].hasAttribute('value') &&
208
- triggerValue === '' && toggled !== undefined;
209
-
210
- _$xy_slider._css = {
211
- backgroundColor: 'rgb(' +
212
- hueRGB.r + ',' + hueRGB.g + ',' + hueRGB.b + ')'};
213
- _$xy_cursor._css = {
214
- transform: translate3d + '(' + s + 'px, ' + v + 'px, 0)',
215
- left: !_GPU ? s : '',
216
- top: !_GPU ? v : '',
217
- borderColor : colors.RGBLuminance > 0.22 ? dark : light
218
- };
219
- _$z_cursor._css = {
220
- transform: translate3d + '(0, ' + h + 'px, 0)',
221
- top: !_GPU ? h : '',
222
- borderColor : 'transparent ' + HUEContrast
223
- };
224
- _$alpha._css = {backgroundColor: 'rgb(' + RGBInnerText + ')'};
225
- _$alpha_cursor._css = {
226
- transform: translate3d + '(' + a + 'px, 0, 0)',
227
- left: !_GPU ? a : '',
228
- borderColor : alphaContrast + ' transparent'
229
- };
230
- _$trigger._css = {
231
- backgroundColor : hasNoValue ? '' : text,
232
- color: hasNoValue ? '' :
233
- colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light
234
- };
235
- _$trigger.text = hasNoValue ? '' : triggerValue !== text ? text : '';
236
-
237
- toggled !== undefined ? render(toggled) : _animate(render);
238
- }
239
-
240
- // As _animate() is actually requestAnimationFrame(), render() gets called
241
- // decoupled from any pointer action (whenever the browser decides to do
242
- // so) as an event. preRender() is coupled to toggle() and all pointermove
243
- // actions; that's where all the calculations happen. render() can now be
244
- // called without extra calculations which results in faster rendering.
245
- function render(toggled) {
246
- _$xy_slider.css(_$xy_slider._css);
247
- _$xy_cursor.css(_$xy_cursor._css);
248
- _$z_cursor.css(_$z_cursor._css);
249
- _$alpha.css(_$alpha._css);
250
- _$alpha_cursor.css(_$alpha_cursor._css);
251
-
252
- _options.doRender && _$trigger.css(_$trigger._css);
253
- _$trigger.text && _$trigger.val(_$trigger.text);
254
-
255
- _options.renderCallback.call(
256
- _colorPicker,
257
- _$trigger,
258
- typeof toggled === 'boolean' ? toggled : undefined
259
- );
260
- }
261
-
262
- $.fn.colorPicker = function(options) {
263
- var noop = function(){};
264
-
265
- options = $.extend({
266
- animationSpeed: 150,
267
- GPU: true,
268
- doRender: true,
269
- customBG: '#FFF',
270
- opacity: true,
271
- renderCallback: noop,
272
- buildCallback: noop,
273
- body: document.body,
274
- scrollResize: true,
275
- gap: 4
276
- // css: '',
277
- // cssAddon: '',
278
- // margin: '',
279
- // preventFocus: false
280
- }, options);
281
-
282
- !_colorPicker && options.scrollResize && $(window).
283
- on('resize.a scroll.a', function() {
284
- if (_colorPicker.$trigger) {
285
- _colorPicker.toggle.call(_colorPicker.$trigger[0], true);
286
- }
287
- });
288
- _instance = _instance ? _instance.add(this) : this;
289
- _instance.colorPicker = _colorPicker ||
290
- (_colorPicker = new ColorPicker(options));
291
- _selector += (_selector ? ', ' : '') + this.selector;
292
-
293
- $(options.body).off('.a').
294
- on(_pointerdown, function(e) {
295
- var $target = $(e.target);
296
-
297
- if ($.inArray($target.closest(_selector)[0], _instance) === -1 &&
298
- !$target.closest(_$UI).length) {
299
- toggle();
300
- }
301
- }).
302
- on('focus.a click.a', _selector, toggle).
303
- on('change.a', _selector, function() {
304
- _color.setColor(this.value || '#FFF');
305
- _instance.colorPicker.render(true);
306
- });
307
-
308
- return this.each(function() {
309
- var value = extractValue(this),
310
- mode = value.split('('),
311
- $elm = findElement($(this));
312
-
313
- $elm.data('colorMode', mode[1] ? mode[0].substr(0, 3) : 'HEX').
314
- attr('readonly', _options.preventFocus);
315
- options.doRender &&
316
- $elm.css({'background-color': value,
317
- 'color': function() {
318
- return _color.setColor(value).
319
- rgbaMixBGMixCustom.luminance > 0.22 ? '#222' : '#ddd'
320
- }
321
- });
322
- });
323
- };
324
-
325
- $.fn.colorPicker.destroy = function() {
326
- $(_colorPicker.color.options.body).off('.a');
327
- _colorPicker.toggle(false);
328
- _instance = null;
329
- _selector = '';
330
- };
331
-
332
- })(jQuery, Colors);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/third-party/colorpicker/js/jqColorPicker.min.js DELETED
@@ -1,2 +0,0 @@
1
-
2
- (function(h,C,k){var F=h(document),c,i,l,t,E="",j,o,z,n,y,f,D,b="touchmove.a mousemove.a pointermove.a",A="touchstart.a mousedown.a pointerdown.a",I="touchend.a mouseup.a pointerup.a",B=false,x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(J){J()},d='<div class="cp-color-picker"><div class="cp-z-slider"><div class="cp-z-cursor"></div></div><div class="cp-xy-slider"><div class="cp-white"></div><div class="cp-xy-cursor"></div></div><div class="cp-alpha"><div class="cp-alpha-cursor"></div></div></div>',r=".cp-color-picker{position:absolute;overflow:hidden;padding:6px 6px 0;background-color:#444;color:#bbb;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:400;cursor:default;border-radius:5px}.cp-color-picker>div{position:relative;overflow:hidden}.cp-xy-slider{float:left;height:128px;width:128px;margin-bottom:6px;background:linear-gradient(to right,#FFF,rgba(255,255,255,0))}.cp-white{height:100%;width:100%;background:linear-gradient(rgba(0,0,0,0),#000)}.cp-xy-cursor{position:absolute;top:0;width:10px;height:10px;margin:-5px;border:1px solid #fff;border-radius:100%;box-sizing:border-box}.cp-z-slider{float:right;margin-left:6px;height:128px;width:20px;background:linear-gradient(red 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%)}.cp-z-cursor{position:absolute;margin-top:-4px;width:100%;border:4px solid #fff;border-color:transparent #fff;box-sizing:border-box}.cp-alpha{clear:both;width:100%;height:16px;margin:6px 0;background:linear-gradient(to right,#444,rgba(0,0,0,0))}.cp-alpha-cursor{position:absolute;margin-left:-4px;height:100%;border:4px solid #fff;border-color:#fff transparent;box-sizing:border-box}",a=function(J){l=this.color=new C(J);t=l.options};a.prototype={render:e,toggle:v};function m(J){return J.value||J.getAttribute("value")||h(J).css("background-color")||"#fff"}function w(J){J=J.originalEvent&&J.originalEvent.touches?J.originalEvent.touches[0]:J;return J.originalEvent?J.originalEvent:J}function s(J){return h(J.find(t.doRender)[0]||J[0])}function v(K){var L=h(this),J=L.offset(),M=h(window),N=t.gap;if(K){j=s(L);i.$trigger=L;(o||q()).css({left:(o[0]._left=J.left)-((o[0]._left=o[0]._left+o[0]._width-(M.scrollLeft()+M.width()))+N>0?o[0]._left+N:0),top:(o[0]._top=J.top+L.outerHeight())-((o[0]._top=o[0]._top+o[0]._height-(M.scrollTop()+M.height()))+N>0?o[0]._top+N:0)}).show(t.animationSpeed,function(){if(K===true){return}f._width=f.width();z._width=z.width();z._height=z.height();l.setColor(m(j[0]));e(true)})}else{h(o).hide(t.animationSpeed,function(){j.blur();i.$trigger=null;e(false)})}}function q(){h("head").append('<style type="text/css">'+(t.css||r)+(t.cssAddon||"")+"</style>");return i.$UI=o=h(d).css({margin:t.margin}).appendTo("body").show(0,function(){var J=h(this);B=t.GPU&&J.css("perspective")!==k;z=h(".cp-xy-slider",this);n=h(".cp-xy-cursor",this);y=h(".cp-z-cursor",this);f=h(".cp-alpha",this).toggle(!!t.opacity);D=h(".cp-alpha-cursor",this);t.buildCallback.call(i,J);J.prepend("<div>").children().eq(0).css("width",J.children().eq(0).width());this._width=this.offsetWidth;this._height=this.offsetHeight}).hide().on(A,".cp-xy-slider,.cp-z-slider,.cp-alpha",H)}function H(K){var J=this.className.replace(/cp-(.*?)(?:\s*|$)/,"$1").replace("-","_");K.preventDefault&&K.preventDefault();K.returnValue=false;j._offset=h(this).offset();(J=J==="xy_slider"?u:J==="z_slider"?p:g)(K);e();F.on(I,function(L){F.off(".a")}).on(b,function(L){J(L);e()})}function u(K){var L=w(K),J=L.pageX-j._offset.left,M=L.pageY-j._offset.top;l.setColor({s:J/z._width*100,v:100-(M/z._height*100)},"hsv")}function p(J){var K=w(J).pageY-j._offset.top;l.setColor({h:360-(K/z._height*360)},"hsv")}function g(K){var J=w(K).pageX-j._offset.left,L=J/f._width;l.setColor({},"rgb",L)}function e(J){var U=l.colors,M=U.hueRGB,O=U.RND.rgb,V=U.RND.hsl,L="#222",Q="#ddd",S=j.data("colorMode"),T=U.alpha!==1,R=Math.round(U.alpha*100)/100,Z=O.r+", "+O.g+", "+O.b,X=(S==="HEX"&&!T?"#"+U.HEX:S==="rgb"||(S==="HEX"&&T)?(!T?"rgb("+Z+")":"rgba("+Z+", "+R+")"):("hsl"+(T?"a(":"(")+V.h+", "+V.s+"%, "+V.l+"%"+(T?", "+R:"")+")")),ab=U.HUELuminance>0.22?L:Q,N=U.rgbaMixBlack.luminance>0.22?L:Q,aa=(1-U.hsv.h)*z._height,Y=U.hsv.s*z._width,W=(1-U.hsv.v)*z._height,ac=R*f._width,ad=B?"translate3d":"",K=j.val(),P=j[0].hasAttribute("value")&&K===""&&J!==k;z._css={backgroundColor:"rgb("+M.r+","+M.g+","+M.b+")"};n._css={transform:ad+"("+Y+"px, "+W+"px, 0)",left:!B?Y:"",top:!B?W:"",borderColor:U.RGBLuminance>0.22?L:Q};y._css={transform:ad+"(0, "+aa+"px, 0)",top:!B?aa:"",borderColor:"transparent "+ab};f._css={backgroundColor:"rgb("+Z+")"};D._css={transform:ad+"("+ac+"px, 0, 0)",left:!B?ac:"",borderColor:N+" transparent"};j._css={backgroundColor:P?"":X,color:P?"":U.rgbaMixBGMixCustom.luminance>0.22?L:Q};j.text=P?"":K!==X?X:"";J!==k?G(J):x(G)}function G(J){z.css(z._css);n.css(n._css);y.css(y._css);f.css(f._css);D.css(D._css);t.doRender&&j.css(j._css);j.text&&j.val(j.text);t.renderCallback.call(i,j,typeof J==="boolean"?J:k)}h.fn.colorPicker=function(J){var K=function(){};J=h.extend({animationSpeed:150,GPU:true,doRender:true,customBG:"#FFF",opacity:true,renderCallback:K,buildCallback:K,body:document.body,scrollResize:true,gap:4},J);!i&&J.scrollResize&&h(window).on("resize.a scroll.a",function(){if(i.$trigger){i.toggle.call(i.$trigger[0],true)}});c=c?c.add(this):this;c.colorPicker=i||(i=new a(J));E+=(E?", ":"")+this.selector;h(J.body).off(".a").on(A,function(M){var L=h(M.target);if(h.inArray(L.closest(E)[0],c)===-1&&!L.closest(o).length){v()}}).on("focus.a click.a",E,v).on("change.a",E,function(){l.setColor(this.value||"#FFF");c.colorPicker.render(true)});return this.each(function(){var M=m(this),N=M.split("("),L=s(h(this));L.data("colorMode",N[1]?N[0].substr(0,3):"HEX").attr("readonly",t.preventFocus);J.doRender&&L.css({"background-color":M,color:function(){return l.setColor(M).rgbaMixBGMixCustom.luminance>0.22?"#222":"#ddd"}})})};h.fn.colorPicker.destroy=function(){h(i.color.options.body).off(".a");i.toggle(false);c=null;E=""}})(jQuery,Colors);
 
 
class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.1.0
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -83,9 +83,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
83
  register_activation_hook(__FILE__, [&$this, "pluginActivation"]);
84
 
85
  /* GRAVATARS CACHE */
86
- register_activation_hook(__FILE__, [&$this, "registerGravatarsJobs"]);
87
- register_deactivation_hook(__FILE__, [&$this, "deregisterGravatarsJobs"]);
88
- add_filter("cron_schedules", [&$this, "setGravatarsIntervals"]);
89
  /* GRAVATARS CACHE */
90
  add_action("wpmu_new_blog", [&$this, "addNewBlog"]);
91
  add_action("delete_blog", [&$this, "deleteBlog"]);
@@ -230,7 +230,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
230
  load_plugin_textdomain("wpdiscuz", false, dirname(plugin_basename(__FILE__)) . "/languages/");
231
  }
232
 
233
- public function registerGravatarsJobs() {
234
  if (!wp_next_scheduled(self::GRAVATARS_CACHE_ADD_ACTION)) {
235
  wp_schedule_event(current_time("timestamp"), self::GRAVATARS_CACHE_ADD_KEY_RECURRENCE, self::GRAVATARS_CACHE_ADD_ACTION);
236
  }
@@ -238,9 +238,13 @@ class WpdiscuzCore implements WpDiscuzConstants {
238
  if (!wp_next_scheduled(self::GRAVATARS_CACHE_DELETE_ACTION)) {
239
  wp_schedule_event(current_time("timestamp"), self::GRAVATARS_CACHE_DELETE_KEY_RECURRENCE, self::GRAVATARS_CACHE_DELETE_ACTION);
240
  }
 
 
 
 
241
  }
242
 
243
- public function deregisterGravatarsJobs() {
244
  if (wp_next_scheduled(self::GRAVATARS_CACHE_ADD_ACTION)) {
245
  wp_clear_scheduled_hook(self::GRAVATARS_CACHE_ADD_ACTION);
246
  }
@@ -248,20 +252,25 @@ class WpdiscuzCore implements WpDiscuzConstants {
248
  if (wp_next_scheduled(self::GRAVATARS_CACHE_DELETE_ACTION)) {
249
  wp_clear_scheduled_hook(self::GRAVATARS_CACHE_DELETE_ACTION);
250
  }
 
 
 
 
251
  }
252
 
253
- public function setGravatarsIntervals($schedules) {
254
- $cacheAddInterval = [
255
  "interval" => self::GRAVATARS_CACHE_ADD_RECURRENCE * HOUR_IN_SECONDS,
256
  "display" => esc_html__("Every 3 hours", "wpdiscuz")
257
  ];
258
- $cacheDeleteInterval = [
259
  "interval" => self::GRAVATARS_CACHE_DELETE_RECURRENCE * HOUR_IN_SECONDS,
260
  "display" => esc_html__("Every 48 hours", "wpdiscuz")
261
  ];
262
- $schedules[self::GRAVATARS_CACHE_ADD_KEY_RECURRENCE] = $cacheAddInterval;
263
- $schedules[self::GRAVATARS_CACHE_DELETE_KEY_RECURRENCE] = $cacheDeleteInterval;
264
-
 
265
  return $schedules;
266
  }
267
 
@@ -272,33 +281,38 @@ class WpdiscuzCore implements WpDiscuzConstants {
272
  $this->isWpdiscuzLoaded = true;
273
  $visibleCommentIds = isset($_POST["visibleCommentIds"]) ? rtrim($_POST["visibleCommentIds"], ",") : "";
274
  $cArgs = $this->getDefaultCommentsArgs($postId);
275
- $lastCommentId = $this->dbManager->getLastCommentId($cArgs);
276
- if ($lastCommentId > $loadLastCommentId) {
277
- $response = [];
278
- $response["loadLastCommentId"] = $lastCommentId;
279
- $commentListArgs = $this->getCommentListArgs($postId);
280
- $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
281
- $sentEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? trim($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
282
- $email = !empty($commentListArgs["current_user"]->ID) ? $commentListArgs["current_user"]->user_email : $sentEmail;
283
- $newCommentIds = $this->dbManager->getNewCommentIds($cArgs, $loadLastCommentId, $email, $visibleCommentIds);
284
- $newCommentIds = apply_filters("wpdiscuz_live_update_new_comment_ids", $newCommentIds, $postId, $commentListArgs["current_user"]);
285
- $response["message"] = [];
286
- foreach ($newCommentIds as $k => $newCommentId) {
287
- $comment = get_comment($newCommentId);
288
- if (($comment->comment_parent && (in_array($comment->comment_parent, explode(",", $visibleCommentIds)) || in_array($comment->comment_parent, $newCommentIds))) || !$comment->comment_parent) {
289
- $commentHtml = wp_list_comments($commentListArgs, [$comment]);
290
- $commentObject = ["comment_parent" => $comment->comment_parent, "comment_html" => $commentHtml];
291
- if ($comment->comment_parent) {
292
- array_push($response["message"], $commentObject);
293
- } else {
294
- array_unshift($response["message"], $commentObject);
 
 
 
 
 
295
  }
296
  }
 
 
 
 
297
  }
298
- $response["wc_all_comments_count_new"] = get_comments_number($postId);
299
- $response["wc_all_comments_count_before_threads_html"] = "<span class='wpdtc' title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span> " . esc_html(1 == $response["wc_all_comments_count_new"] ? $this->form->getHeaderTextSingle() : $this->form->getHeaderTextPlural());
300
- $response["wc_all_comments_count_bubble_html"] = "<span id='wpd-bubble-all-comments-count'" . ($response["wc_all_comments_count_new"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span>";
301
- wp_send_json_success($response);
302
  }
303
  }
304
  }
@@ -307,23 +321,24 @@ class WpdiscuzCore implements WpDiscuzConstants {
307
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
308
  $newCommentIds = isset($_POST["newCommentIds"]) ? trim($_POST["newCommentIds"]) : "";
309
  if ($postId && $newCommentIds) {
310
- $this->isWpdiscuzLoaded = true;
311
- $newCommentIds = explode(",", trim($newCommentIds, ","));
312
- $postId = intval($postId);
313
- $commentListArgs = $this->getCommentListArgs($postId);
314
- $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
315
- $response = ["message" => []];
316
- foreach ($newCommentIds as $k => $newCommentId) {
317
- $comment = get_comment($newCommentId);
318
- $commentHtml = wp_list_comments($commentListArgs, [$comment]);
319
- $response["message"][] = [
320
- "comment_id" => $comment->comment_ID,
321
- "comment_parent" => $comment->comment_parent,
322
- "comment_html" => $commentHtml
323
- ];
 
 
 
324
  }
325
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
326
- wp_send_json_success($response);
327
  }
328
  }
329
 
@@ -334,148 +349,154 @@ class WpdiscuzCore implements WpDiscuzConstants {
334
  $comment_content = isset($_POST["wc_comment"]) ? trim($_POST["wc_comment"]) : "";
335
 
336
  if ($uniqueId && $postId && $comment_content) {
337
- $form = $this->wpdiscuzForm->getForm($postId);
338
- $form->initFormFields();
339
-
340
- do_action("wpdiscuz_before_comment_post");
341
- if (!comments_open($postId)) {
342
- wp_die(esc_html($this->options->phrases["wc_commenting_is_closed"]));
343
- }
344
-
345
- if (function_exists("zerospam_get_key") && isset($_POST["wpdiscuz_zs"]) && ($wpdiscuzZS = $_POST["wpdiscuz_zs"])) {
346
- $_POST["zerospam_key"] = $wpdiscuzZS === md5(zerospam_get_key()) ? zerospam_get_key() : "";
347
- }
348
- $commentDepth = isset($_POST["wpd_comment_depth"]) && intval($_POST["wpd_comment_depth"]) ? intval($_POST["wpd_comment_depth"]) : 1;
349
- $isInSameContainer = "1";
350
- $currentUser = WpdiscuzHelper::getCurrentUser();
351
- $wooExists = class_exists("WooCommerce") && get_post_type($postId) === "product";
352
- $replyForWoo = apply_filters("wpdiscuz_product_review_replies", true, $postId);
353
- if ($wooExists && !$replyForWoo) {
354
- $isInSameContainer = "0";
355
- } else if ($commentDepth > $this->options->wp["threadCommentsDepth"]) {
356
- $commentDepth = $this->options->wp["threadCommentsDepth"];
357
- $isInSameContainer = "0";
358
- } else if (!$this->options->wp["threadComments"]) {
359
- $isInSameContainer = "0";
360
- }
361
- $notificationType = isset($_POST["wpdiscuz_notification_type"]) ? $_POST["wpdiscuz_notification_type"] : "";
362
-
363
- $form->validateFields($currentUser);
364
-
365
- $website_url = "";
366
- if ($currentUser && $currentUser->ID) {
367
- $user_id = $currentUser->ID;
368
- $name = $this->helper->getCurrentUserDisplayName($currentUser);
369
- $email = $currentUser->user_email;
370
- } else {
371
- $user_id = 0;
372
- $name = urldecode($form->validateDefaultName($currentUser));
373
- $email = urldecode($form->validateDefaultEmail($currentUser, $isAnonymous));
374
- $website_url = $form->validateDefaultWebsite($currentUser);
375
- }
376
 
377
- $comment_content = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($comment_content) : $comment_content;
378
- $comment_content = $this->helper->replaceCommentContentCode($comment_content);
379
- $comment_content = $this->helper->filterCommentText($comment_content);
380
- if (!$comment_content) {
381
- wp_send_json_error("wc_msg_required_fields");
382
- }
383
- $commentMinLength = intval($this->options->content["commentTextMinLength"]);
384
- $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
385
- $contentLength = function_exists("mb_strlen") ? mb_strlen(strip_tags($comment_content)) : strlen(strip_tags($comment_content));
386
- if ($commentMinLength > 0 && $contentLength < $commentMinLength) {
387
- wp_send_json_error("wc_msg_input_min_length");
388
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
- if ($commentMaxLength > 0 && $contentLength > $commentMaxLength) {
391
- wp_send_json_error("wc_msg_input_max_length");
392
- }
 
 
 
 
 
 
 
 
 
393
 
394
- if ($name && $email && $comment_content) {
395
- $this->isWpdiscuzLoaded = true;
396
- $website_url = $website_url ? urldecode($website_url) : "";
397
- $stickyComment = isset($_POST["wc_sticky_comment"]) && ($sticky = intval($_POST["wc_sticky_comment"])) ? $sticky : "";
398
- $closedComment = isset($_POST["wc_closed_comment"]) && ($closed = absint($_POST["wc_closed_comment"])) ? $closed : "";
399
- $uid_data = $this->helper->getUIDData($uniqueId);
400
- $comment_parent = intval($uid_data[0]);
401
- $parentComment = $comment_parent ? get_comment($comment_parent) : null;
402
- $comment_parent = isset($parentComment->comment_ID) ? $parentComment->comment_ID : 0;
403
- if ($parentComment && intval(get_comment_meta($comment_parent, self::META_KEY_CLOSED, true))) {
404
- wp_die(esc_html($this->options->phrases["wc_closed_comment_thread"]));
405
- }
406
- $this->helper->restrictCommentingPerUser($email, $comment_parent, $postId);
407
- $wc_user_agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
408
- $new_commentdata = [
409
- "user_id" => $user_id,
410
- "comment_post_ID" => $postId,
411
- "comment_parent" => $wooExists && !$replyForWoo ? 0 : $comment_parent,
412
- "comment_author" => $name,
413
- "comment_author_email" => $email,
414
- "comment_content" => $comment_content,
415
- "comment_author_url" => $website_url,
416
- "comment_agent" => $wc_user_agent,
417
- "comment_type" => $wooExists ? "review" : ($stickyComment ? self::WPDISCUZ_STICKY_COMMENT : self::$DEFAULT_COMMENT_TYPE),
418
- ];
419
 
420
- $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
421
- if ($closedComment) {
422
- add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
423
- }
424
- $form->saveCommentMeta($new_comment_id);
425
- $newComment = get_comment($new_comment_id);
426
- $held_moderate = 1;
427
- if ($newComment->comment_approved === "1") {
428
- $held_moderate = 0;
429
- if ($wooExists) {
430
- update_post_meta($postId, "_wc_review_count", get_comments(["count" => true, "post_id" => $postId]));
431
  }
432
- }
433
- if ($notificationType === WpdiscuzCore::SUBSCRIPTION_POST && class_exists("Prompt_Comment_Form_Handling") && $this->options->subscription["usePostmaticForCommentNotification"]) {
434
- $_POST[Prompt_Comment_Form_Handling::SUBSCRIBE_CHECKBOX_NAME] = 1;
435
- Prompt_Comment_Form_Handling::handle_form($new_comment_id, $newComment->comment_approved);
436
- } else if (!$isAnonymous && $notificationType) {
437
- $subscriptionData = $this->dbManager->hasSubscription($postId, $email);
438
- if (!$subscriptionData || ($subscriptionData && $subscriptionData["type"] === self::SUBSCRIPTION_COMMENT)) {
439
- $noNeedMemberConfirm = ($currentUser->ID && !$this->options->subscription["enableMemberConfirm"]);
440
- $noNeedGuestsConfirm = (!$currentUser->ID && !$this->options->subscription["enableGuestsConfirm"]);
441
- if ($noNeedMemberConfirm || $noNeedGuestsConfirm) {
442
- $this->dbManager->addEmailNotification($new_comment_id, $postId, $email, self::SUBSCRIPTION_COMMENT, 1);
443
- } else {
444
- $confirmData = $this->dbManager->addEmailNotification($new_comment_id, $postId, $email, self::SUBSCRIPTION_COMMENT);
445
- if ($confirmData) {
446
- $this->helperEmail->confirmEmailSender($confirmData["id"], $confirmData["activation_key"], $postId, $email);
447
- }
448
- }
449
- }
450
- }
451
- $response = [];
452
- $response["redirect"] = $this->options->general["redirectPage"];
453
- $response["new_comment_id"] = $new_comment_id;
454
- $response["comment_author"] = $name;
455
- $response["comment_author_email"] = $email;
456
- $response["comment_author_url"] = $website_url;
457
- $response["is_main"] = $wooExists && !$replyForWoo ? 1 : ($comment_parent ? 0 : 1);
458
- $response["held_moderate"] = $held_moderate;
459
- $response["is_in_same_container"] = $isInSameContainer;
460
- $response["wc_all_comments_count_new"] = get_comments_number($postId);
461
- $response["wc_all_comments_count_before_threads_html"] = "<span class='wpdtc' title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span> " . esc_html(1 == $response["wc_all_comments_count_new"] ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural());
462
- $response["wc_all_comments_count_bubble_html"] = "<span id='wpd-bubble-all-comments-count'" . ($response["wc_all_comments_count_new"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span>";
463
-
464
- $commentListArgs = $this->getCommentListArgs($postId);
465
- $commentListArgs["addComment"] = $commentDepth;
466
- $commentListArgs["comment_author_email"] = $email;
467
-
468
- $response["uniqueid"] = $uniqueId;
469
- $response["message"] = wp_list_comments($commentListArgs, [$newComment]);
470
- $response["message"] = wp_unslash($response["message"]);
471
- do_action("wpdiscuz_after_comment_post", $newComment, $currentUser);
472
- $response["callbackFunctions"] = [];
473
- $response = apply_filters("wpdiscuz_comment_post", $response);
474
- do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
475
- wp_send_json_success($response);
476
- } else {
477
- wp_send_json_error("wc_invalid_field");
478
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  } else {
480
  wp_send_json_error("wc_msg_required_fields");
481
  }
@@ -498,7 +519,10 @@ class WpdiscuzCore implements WpDiscuzConstants {
498
  $uniqueId = $comment->comment_ID . "_" . $comment->comment_parent;
499
  $highLevelUser = current_user_can("moderate_comments");
500
  $isCurrentUserCanEdit = $this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $currentUser);
501
- if (!intval(get_comment_meta($comment->comment_ID, self::META_KEY_CLOSED, true)) && ($highLevelUser || $isCurrentUserCanEdit)) {
 
 
 
502
  $isInRange = $this->helper->isContentInRange($trimmedContent);
503
 
504
  if (!$isInRange && !$highLevelUser) {
@@ -516,9 +540,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
516
 
517
  if ($isInRange || $highLevelUser) {
518
  $response = [];
519
- $form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
520
- $form->initFormFields();
521
- $form->validateFields($currentUser);
522
  if ($trimmedContent !== $comment->comment_content) {
523
  $trimmedContent = $this->helper->replaceCommentContentCode($trimmedContent);
524
  $commentContent = $this->helper->filterCommentText($trimmedContent);
@@ -545,7 +566,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
545
  do_action("wpdiscuz_clean_post_cache", $comment->comment_post_ID, "comment_edited");
546
  }
547
 
548
- $form->saveCommentMeta($comment->comment_ID);
549
  $commentContent = isset($commentContent) ? $commentContent : $trimmedContent;
550
  if ($this->options->content["enableImageConversion"]) {
551
  $commentContent = $this->helper->makeClickable($commentContent);
@@ -568,7 +589,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
568
  $response["whatsappShareLink"] = esc_url_raw((wp_is_mobile() ? "https://api.whatsapp.com" : "https://web.whatsapp.com") . "/send?text=" . $this->helper->getWhatsappShareContent($commentContent, $commentLink));
569
  }
570
 
571
- $components = $this->helper->getComponents($form->getTheme(), $form->getLayout());
572
  $inlineContent = "";
573
  if ($inlineFormID = intval(get_comment_meta($comment->comment_ID, self::META_KEY_FEEDBACK_FORM_ID, true))) {
574
  $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
@@ -600,62 +621,64 @@ class WpdiscuzCore implements WpDiscuzConstants {
600
  if ($commentId && $postId && $comment && $comment->comment_post_ID == $postId) {
601
  $commentListArgs = $this->getCommentListArgs($postId);
602
  $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
603
- $showUnapprovedComment = false;
604
- $includeUnapproved = null;
605
- if ($comment->comment_approved === "0") {
606
- if ($commentListArgs["high_level_user"]) {
607
- $showUnapprovedComment = true;
608
- } else if (!empty($this->commentsArgs["include_unapproved"])) {
609
- $includeUnapproved = $this->commentsArgs["include_unapproved"][0];
610
- if (is_numeric($this->commentsArgs["include_unapproved"][0])) {
611
- if ($comment->user_id == $this->commentsArgs["include_unapproved"][0]) {
612
- $showUnapprovedComment = true;
613
- }
614
- } else if ($comment->comment_author_email === $this->commentsArgs["include_unapproved"][0]) {
615
- $showUnapprovedComment = true;
616
- }
617
- }
618
- }
619
- if ($comment->comment_approved === "1" || $showUnapprovedComment) {
620
- $this->isWpdiscuzLoaded = true;
621
- $commentStatusIn = ["1"];
622
- if ($this->commentsArgs["status"] === "all") {
623
- $commentStatusIn[] = "0";
624
- }
625
- $parentComment = null;
626
- if (!$this->options->wp["threadComments"]) {
627
- $comments = [$comment];
628
- $parentComment = $comment;
629
- } else if ($parentComment = $this->helperOptimization->getCommentRoot($commentId, $commentStatusIn, $includeUnapproved)) {
630
- $args = [
631
- "format" => "flat",
632
- "status" => $this->commentsArgs["status"],
633
- "orderby" => $this->commentsArgs["orderby"],
634
- "post_id" => $this->commentsArgs["post_id"],
635
- ];
636
- if (!empty($this->commentsArgs["include_unapproved"])) {
637
- $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
638
- }
639
- $tree = $parentComment->get_children($args);
640
- $comments = array_merge([$parentComment], $tree);
641
- }
642
- if ($parentComment) {
643
- $commentListArgs["isSingle"] = true;
644
- $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
645
- if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
646
- if (!empty($commentListArgs['current_user']->ID)) {
647
- $commentListArgs['user_votes'] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
648
- } else {
649
- $commentListArgs['user_votes'] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
650
- }
651
- }
652
- $response = [];
653
- $response["message"] = wp_list_comments($commentListArgs, $comments);
654
- $response["parentCommentID"] = $parentComment->comment_ID;
655
- $response["callbackFunctions"] = [];
656
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
657
- wp_send_json_success($response);
658
- }
 
 
659
  }
660
  }
661
  }
@@ -664,37 +687,40 @@ class WpdiscuzCore implements WpDiscuzConstants {
664
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
665
  $lastParentId = isset($_POST["lastParentId"]) ? intval($_POST["lastParentId"]) : 0;
666
  if ($lastParentId >= 0 && $postId) {
667
- $this->isWpdiscuzLoaded = true;
668
- $isFirstLoad = isset($_POST["isFirstLoad"]) ? intval($_POST["isFirstLoad"]) : 0;
669
- // max value of php int for limit
670
- $limit = ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3) || (!$isFirstLoad && $this->options->thread_display["commentListLoadType"] == 1) ? PHP_INT_MAX - 1 : $this->options->wp["commentPerPage"];
671
- $args = ["number" => $limit];
672
- $args["wpdType"] = !empty($_POST["wpdType"]) ? trim($_POST["wpdType"]) : "";
673
- if ($isFirstLoad) {
674
- $args["first_load"] = true;
675
- }
676
- $sorting = isset($_POST["sorting"]) ? trim($_POST["sorting"]) : "";
677
- if ($sorting === "newest") {
678
- $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
679
- $args["order"] = "desc";
680
- } else if ($sorting === "oldest") {
681
- $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
682
- $args["order"] = "asc";
683
- } else if ($sorting === "by_vote") {
684
- $args["orderby"] = "by_vote";
685
- $args["order"] = $this->options->wp["commentOrder"];
686
- }
687
- if (isset($args["orderby"]) && $args["orderby"] === "by_vote" && !empty($_POST["offset"]) && ($offset = intval($_POST["offset"]))) {
688
- $args["offset"] = $offset * ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3 ? 0 : $this->options->wp["commentPerPage"]);
689
- }
690
- $args["last_parent_id"] = $lastParentId;
691
- $args["post_id"] = $postId;
692
- $args = apply_filters("wpdiscuz_filter_args", $args);
693
- $commentData = $this->getWPComments($args);
694
- $commentData["loadLastCommentId"] = $this->dbManager->getLastCommentId($this->commentsArgs);
695
- $commentData["callbackFunctions"] = [];
696
- $commentData = apply_filters("wpdiscuz_ajax_callbacks", $commentData);
697
- wp_send_json_success($commentData);
 
 
 
698
  }
699
  }
700
 
@@ -702,30 +728,33 @@ class WpdiscuzCore implements WpDiscuzConstants {
702
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
703
  $sorting = isset($_POST["sorting"]) ? trim($_POST["sorting"]) : "";
704
  if ($postId && $sorting) {
705
- $this->isWpdiscuzLoaded = true;
706
- $args = ["post_id" => $postId];
707
- if ($sorting === "newest") {
708
- $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
709
- $args["order"] = "desc";
710
- } else if ($sorting === "oldest") {
711
- $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
712
- $args["order"] = "asc";
713
- } else if ($sorting === "by_vote") {
714
- $args["orderby"] = "by_vote";
715
- $args["order"] = $this->options->wp["commentOrder"];
716
- }
717
- $args["first_load"] = 1;
718
- $args["wpdType"] = !empty($_POST["wpdType"]) ? trim($_POST["wpdType"]) : "";
719
- $args = apply_filters("wpdiscuz_filter_args", $args);
720
- $commentData = $this->getWPComments($args);
721
- $response = [
722
- "last_parent_id" => $commentData["last_parent_id"],
723
- "is_show_load_more" => $commentData["is_show_load_more"],
724
- "message" => $commentData["comment_list"],
725
- "callbackFunctions" => [],
726
- ];
727
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
728
- wp_send_json_success($response);
 
 
 
729
  }
730
  }
731
 
@@ -819,7 +848,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
819
  }
820
  }
821
 
822
- return $commentList;
823
  }
824
 
825
  private function getChildren($commentList, &$commentListArgs) {
@@ -994,6 +1023,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
994
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
995
 
996
  if ((isset($_GET["page"]) && in_array($_GET["page"], $wpdiscuzPages) && in_array($pagenow, $wpdiscuzWpPages)) || ($typenow === "wpdiscuz_form") || ($pagenow === self::PAGE_COMMENTS)) {
 
997
  $args = [
998
  "msgConfirmResetOptions" => esc_html__("Do you really want to reset all options?", "wpdiscuz"),
999
  "msgConfirmResetTabOptions" => esc_html__("Do you really want to reset tab options?", "wpdiscuz"),
@@ -1001,6 +1031,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1001
  "msgConfirmResetPhrases" => esc_html__("Do you really want to reset phrases?", "wpdiscuz"),
1002
  "wmuMsgConfirmAttachmentDelete" => esc_html__("Do you really want to delet this attachment?", "wpdiscuz"),
1003
  "msgConfirmPurgeGravatarsCache" => esc_html__("Do you really want to delete gravatars cache?", "wpdiscuz"),
 
1004
  ];
1005
  // Media Upload Lightbox
1006
  wp_register_style("wmu-colorbox-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorbox/colorbox.css"));
@@ -1015,16 +1046,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
1015
  wp_enqueue_script("wpdiscuz-mu-js");
1016
 
1017
  wp_enqueue_style("wpdiscuz-font-awesome");
1018
- wp_register_style("wpdiscuz-cp-index-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorpicker/css/index.css"), null, $this->version);
1019
- wp_enqueue_style("wpdiscuz-cp-index-css");
1020
- wp_register_style("wpdiscuz-cp-compatibility-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorpicker/css/compatibility.css"), null, $this->version);
1021
- wp_enqueue_style("wpdiscuz-cp-compatibility-css");
1022
- wp_register_script("wpdiscuz-cp-colors-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorpicker/js/colors.js"), ["jquery"], $this->version, false);
1023
- wp_enqueue_script("wpdiscuz-cp-colors-js");
1024
- wp_register_script("wpdiscuz-cp-colorpicker-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorpicker/js/jqColorPicker.min.js"), ["jquery"], $this->version, false);
1025
- wp_enqueue_script("wpdiscuz-cp-colorpicker-js");
1026
- wp_register_script("wpdiscuz-cp-index-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorpicker/js/index.js"), ["jquery"], $this->version, false);
1027
- wp_enqueue_script("wpdiscuz-cp-index-js");
1028
  wp_register_style("wpdiscuz-options-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-options.css"), null, $this->version);
1029
  wp_enqueue_style("wpdiscuz-options-css");
1030
  wp_register_script("wpdiscuz-options-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/js/wpdiscuz-options.js"), ["jquery"], $this->version);
@@ -1034,7 +1057,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1034
  wp_register_script("wpdiscuz-contenthover", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/contenthover/jquery.contenthover.min.js"), ["jquery"], $this->version, true);
1035
  wp_enqueue_script("wpdiscuz-contenthover");
1036
 
1037
- if (isset($_GET["page"])) {
1038
  wp_register_style("wpdiscuz-easy-responsive-tabs-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css"), null, $this->version);
1039
  wp_enqueue_style("wpdiscuz-easy-responsive-tabs-css");
1040
  wp_register_script("wpdiscuz-easy-responsive-tabs-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js"), ["jquery"], $this->version, true);
@@ -1162,8 +1185,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
1162
  $combo_js = "";
1163
  $combo_css = "";
1164
  if (!$loadQuill) {
1165
- $combo_js .= "-no_quill";
1166
- $combo_css .= "-no_quill";
1167
  }
1168
  wp_register_style("wpdiscuz-combo-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-combo$combo_css.min.css"));
1169
  wp_enqueue_style("wpdiscuz-combo-css");
@@ -1172,7 +1195,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1172
  wp_localize_script("wpdiscuz-combo-js", "wpdiscuzAjaxObj", $this->wpdiscuzOptionsJs);
1173
  wp_localize_script("wpdiscuz-combo-js", "wpdiscuzUCObj", $ucArgs);
1174
  if ($loadQuill) {
1175
- wp_add_inline_script("wpdiscuz-combo$combo_js-js", $this->options->editorOptions(), "before");
1176
  }
1177
  } else {
1178
  wp_register_script("wpdiscuz-cookie-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/wpdccjs/wpdcc.js"), ["jquery"], $this->version, true);
@@ -1631,35 +1654,37 @@ class WpdiscuzCore implements WpDiscuzConstants {
1631
  $this->isWpdiscuzLoaded = true;
1632
  $commentListArgs = $this->getCommentListArgs($postId);
1633
  $cArgs = $this->getDefaultCommentsArgs($postId);
1634
- $cArgs["parent"] = $commentId;
1635
- $cArgs["number"] = null;
1636
- $comment = get_comment($commentId);
1637
- $args = [
1638
- "format" => "flat",
1639
- "status" => $cArgs["status"],
1640
- "orderby" => $cArgs["orderby"],
1641
- "post_id" => $cArgs["post_id"],
1642
- ];
1643
- if (!empty($cArgs["include_unapproved"])) {
1644
- $args["include_unapproved"] = $cArgs["include_unapproved"];
1645
- }
1646
- $children = $comment->get_children($args);
1647
- $commentListArgs["wpdiscuz_child_count_" . $comment->comment_ID] = count($children);
1648
- $comments = array_merge([$comment], $children);
1649
- if ($comments) {
1650
- $response = [];
1651
- if ($this->options->thread_layouts["highlightVotingButtons"]) {
1652
- if (!empty($commentListArgs['current_user']->ID)) {
1653
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1654
- } else {
1655
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1656
- }
1657
- }
1658
- $response["comment_list"] = wp_list_comments($commentListArgs, $comments);
1659
- $response["callbackFunctions"] = [];
1660
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1661
- wp_send_json_success($response);
1662
- }
 
 
1663
  }
1664
  }
1665
 
@@ -1667,45 +1692,47 @@ class WpdiscuzCore implements WpDiscuzConstants {
1667
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1668
  if ($postId) {
1669
  $this->isWpdiscuzLoaded = true;
1670
- $commentId = $this->dbManager->getMostReactedCommentId($postId);
1671
- $comment = get_comment($commentId);
1672
- if ($comment && $comment->comment_post_ID == $postId) {
1673
- $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1674
- $commentStatusIn = ["1"];
1675
- if ($this->commentsArgs["status"] === "all") {
1676
- $commentStatusIn[] = "0";
1677
- }
1678
- $args = [
1679
- "format" => "flat",
1680
- "status" => $this->commentsArgs["status"],
1681
- "orderby" => $this->commentsArgs["orderby"],
1682
- "post_id" => $this->commentsArgs["post_id"],
1683
- ];
1684
- $includeUnapproved = null;
1685
- if (!empty($this->commentsArgs["include_unapproved"])) {
1686
- $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
1687
- $includeUnapproved = $this->commentsArgs["include_unapproved"];
1688
- }
1689
- $parentComment = $this->helperOptimization->getCommentRoot($commentId, $commentStatusIn, $includeUnapproved);
1690
- $tree = $parentComment->get_children($args);
1691
- $comments = array_merge([$parentComment], $tree);
1692
- $commentListArgs = $this->getCommentListArgs($postId);
1693
- $commentListArgs["isSingle"] = true;
1694
- $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
1695
- $response = [];
1696
- if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
1697
- if (!empty($commentListArgs['current_user']->ID)) {
1698
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1699
- } else {
1700
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1701
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1702
  }
1703
- $response["message"] = wp_list_comments($commentListArgs, $comments);
1704
- $response["commentId"] = $commentId;
1705
- $response["parentCommentID"] = $parentComment->comment_ID;
1706
- $response["callbackFunctions"] = [];
1707
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1708
- wp_send_json_success($response);
1709
  }
1710
  }
1711
  }
@@ -1714,57 +1741,59 @@ class WpdiscuzCore implements WpDiscuzConstants {
1714
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1715
  if ($postId) {
1716
  $this->isWpdiscuzLoaded = true;
1717
- $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1718
- $commentStatusIn = ["1"];
1719
- if ($this->commentsArgs["status"] === "all") {
1720
- $commentStatusIn[] = "0";
1721
- }
1722
- $parentCommentIds = $this->dbManager->getParentCommentsHavingReplies($postId, $commentStatusIn);
1723
- $childCount = 0;
1724
- $hottestCommentId = 0;
1725
- $hottestChildren = [];
1726
- foreach ($parentCommentIds as $k => $parentCommentId) {
1727
- $tree = [];
1728
- $children = $this->dbManager->getHottestTree($parentCommentId);
1729
- $tmpCount = count($children);
1730
- if ($childCount < $tmpCount) {
1731
- $childCount = $tmpCount;
1732
- $hottestCommentId = $parentCommentId;
1733
- $hottestChildren = $children;
1734
  }
1735
- }
1736
-
1737
- if ($hottestCommentId && $hottestChildren) {
1738
- $args = [
1739
- "format" => "flat",
1740
- "status" => $this->commentsArgs["status"],
1741
- "orderby" => $this->commentsArgs["orderby"],
1742
- "post_id" => $this->commentsArgs["post_id"],
1743
- ];
1744
- $includeUnapproved = null;
1745
- if (!empty($this->commentsArgs["include_unapproved"])) {
1746
- $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
1747
- $includeUnapproved = $this->commentsArgs["include_unapproved"];
1748
  }
1749
- $parentComment = $this->helperOptimization->getCommentRoot($hottestCommentId, $commentStatusIn, $includeUnapproved);
1750
- $tree = $parentComment->get_children($args);
1751
- $comments = array_merge([$parentComment], $tree);
1752
- $commentListArgs = $this->getCommentListArgs($postId);
1753
- $commentListArgs["isSingle"] = true;
1754
- $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
1755
- $response = [];
1756
- if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
1757
- if (!empty($commentListArgs['current_user']->ID)) {
1758
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1759
- } else {
1760
- $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1761
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1762
  }
1763
- $response["message"] = wp_list_comments($commentListArgs, $comments);
1764
- $response["commentId"] = $hottestCommentId;
1765
- $response["callbackFunctions"] = [];
1766
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1767
- wp_send_json_success($response);
1768
  }
1769
  }
1770
  }
@@ -1849,7 +1878,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1849
 
1850
  public function mceButton($buttons) {
1851
  global $post;
1852
- if (!empty($post->ID) && comments_open($post->ID) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1853
  array_push($buttons, "|", "wpDiscuz");
1854
  }
1855
 
@@ -1858,7 +1887,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1858
 
1859
  public function mceExternalPlugin($plugin_array) {
1860
  global $post;
1861
- if (!empty($post->ID) && comments_open($post->ID) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1862
  $plugin_array["wpDiscuz"] = esc_url_raw(plugins_url("assets/js/wpdiscuz-shortcode-tinymce.js", __FILE__));
1863
  }
1864
 
@@ -1867,7 +1896,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1867
 
1868
  public function gutenbergButton() {
1869
  global $post;
1870
- if (!empty($post->ID) && comments_open($post->ID) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1871
  wp_register_script(self::WPDISCUZ_FEEDBACK_SHORTCODE . "-shortcode-gutenberg-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/js/wpdiscuz-shortcode-gutenberg.js"), [
1872
  "wp-blocks",
1873
  "wp-editor",
@@ -1886,7 +1915,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1886
 
1887
  public function feedbackDialog() {
1888
  global $post;
1889
- if (!empty($post->ID) && comments_open($post->ID) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1890
  ?>
1891
  <style type="text/css">
1892
  #TB_title {
@@ -2023,14 +2052,14 @@ class WpdiscuzCore implements WpDiscuzConstants {
2023
 
2024
  public function feedbackShortcode($atts, $content = "") {
2025
  global $post;
2026
- if ($this->isWpdiscuzLoaded && comments_open($post->ID)) {
2027
  $atts = shortcode_atts([
2028
  "id" => "",
2029
  "question" => "",
2030
  "opened" => 0
2031
  ], $atts, self::WPDISCUZ_FEEDBACK_SHORTCODE);
2032
  if ($atts["id"] && $atts["question"] && ($inline_form = $this->dbManager->getFeedbackFormByUid($post->ID, $atts["id"]))) {
2033
- $content = "<div class='wpd-inline-shortcode wpd-inline-" . ($inline_form->opened ? "opened" : "closed") . "' id='wpd-inline-" . $inline_form->id . "'>" . html_entity_decode($content);
2034
  $content .= "<div class='wpd-inline-icon-wrapper'>";
2035
  $content .= "<svg class='wpd-inline-icon" . ($this->options->inline["inlineFeedbackAttractionType"] === "blink" ? " wpd-ignored" : "") . "' xmlns='https://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path class='wpd-inline-icon-first' d='M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z'/><path class='wpd-inline-icon-second' d='M0 0h24v24H0z' /></svg>";
2036
  $args = [
@@ -2060,111 +2089,113 @@ class WpdiscuzCore implements WpDiscuzConstants {
2060
 
2061
  public function addInlineComment() {
2062
  $inline_form_id = !empty($_POST["inline_form_id"]) ? intval($_POST["inline_form_id"]) : 0;
2063
- if ($inline_form_id && ($inline_form = $this->dbManager->getFeedbackForm($inline_form_id))) {
2064
  if (!empty($_POST["_wpd_inline_nonce"]) && wp_verify_nonce($_POST["_wpd_inline_nonce"], "wpd_inline_nonce_" . $inline_form->post_id)) {
2065
  if (!comments_open($inline_form->post_id)) {
2066
  wp_die(esc_html($this->options->phrases["wc_commenting_is_closed"]));
2067
  }
 
2068
  $currentUser = WpdiscuzHelper::getCurrentUser();
2069
- $isAnonymous = false;
2070
- if (!empty($currentUser->ID)) {
2071
- $user_id = $currentUser->ID;
2072
- $name = $this->helper->getCurrentUserDisplayName($currentUser);
2073
- $email = $currentUser->user_email;
2074
- } else {
2075
- $user_id = 0;
2076
- $name = !empty($_POST["wpd_inline_name"]) ? urldecode(trim($_POST["wpd_inline_name"])) : "";
2077
- if (!empty($_POST["wpd_inline_email"]) && ($email = trim($_POST["wpd_inline_email"]))) {
2078
- if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
2079
- wp_send_json_error("wc_error_email_text");
2080
- }
2081
- } else {
2082
- $email = uniqid() . "@example.com";
2083
- $isAnonymous = true;
2084
- }
2085
- $email = urldecode($email);
2086
- }
2087
- $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2088
- $comment_content = $this->helper->filterCommentText($comment_content);
2089
- if (!$comment_content) {
2090
- wp_send_json_error("wc_msg_required_fields");
2091
- }
2092
- $commentMinLength = intval($this->options->content["commentTextMinLength"]);
2093
- $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
2094
- $contentLength = function_exists("mb_strlen") ? mb_strlen($comment_content) : strlen($comment_content);
2095
- if ($commentMinLength > 0 && $contentLength < $commentMinLength) {
2096
- wp_send_json_error("wc_msg_input_min_length");
2097
- }
2098
- if ($commentMaxLength > 0 && $contentLength > $commentMaxLength) {
2099
- wp_send_json_error("wc_msg_input_max_length");
2100
- }
 
 
2101
 
2102
- if ($name && $email && $comment_content) {
2103
- $this->isWpdiscuzLoaded = true;
2104
- $wc_user_agent = !empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
2105
- $new_commentdata = [
2106
- "user_id" => $user_id,
2107
- "comment_post_ID" => $inline_form->post_id,
2108
- "comment_parent" => 0,
2109
- "comment_author" => $name,
2110
- "comment_author_email" => $email,
2111
- "comment_author_url" => "",
2112
- "comment_content" => $comment_content,
2113
- "comment_agent" => $wc_user_agent,
2114
- "comment_type" => self::$DEFAULT_COMMENT_TYPE,
2115
- ];
2116
- $this->helper->restrictCommentingPerUser($email, 0, $inline_form->post_id);
2117
- $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
2118
- add_comment_meta($new_comment_id, self::META_KEY_FEEDBACK_FORM_ID, $inline_form->id);
2119
- $args = [
2120
- "count" => true,
2121
- "meta_query" => [
2122
- [
2123
- "key" => self::META_KEY_FEEDBACK_FORM_ID,
2124
- "value" => $inline_form->id,
2125
- "compare" => "=",
2126
- ],
2127
- ],
2128
- ];
2129
- $newComment = get_comment($new_comment_id);
2130
- if ($newComment->comment_approved === "1" && class_exists("WooCommerce") && get_post_type($inline_form->post_id) === "product") {
2131
- update_post_meta($inline_form->post_id, "_wc_review_count", get_comments(["count" => true, "post_id" => $inline_form->post_id]));
2132
- }
2133
- if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($newComment->comment_content))) {
2134
- $this->helperEmail->sendMailToMentionedUsers($mentionedUsers, $newComment);
2135
- }
2136
- $notifiyMe = isset($_POST["wpd_inline_notify_me"]) ? absint($_POST["wpd_inline_notify_me"]) : 0;
2137
- if (!$isAnonymous && $notifiyMe) {
2138
- $noNeedMemberConfirm = ($currentUser->ID && !$this->options->subscription["enableMemberConfirm"]);
2139
- $noNeedGuestsConfirm = (!$currentUser->ID && !$this->options->subscription["enableGuestsConfirm"]);
2140
- if ($noNeedMemberConfirm || $noNeedGuestsConfirm) {
2141
- $this->dbManager->addEmailNotification($new_comment_id, $inline_form->post_id, $email, self::SUBSCRIPTION_COMMENT, 1);
2142
- } else {
2143
- $confirmData = $this->dbManager->addEmailNotification($new_comment_id, $inline_form->post_id, $email, self::SUBSCRIPTION_COMMENT);
2144
- if ($confirmData) {
2145
- $this->helperEmail->confirmEmailSender($confirmData["id"], $confirmData["activation_key"], $inline_form->post_id, $email);
2146
- }
2147
- }
2148
- }
2149
- if ($newComment->comment_approved === "spam" || $newComment->comment_approved === "trash") {
2150
- wp_send_json_error();
2151
- }
2152
- $form = $this->wpdiscuzForm->getForm($inline_form->post_id);
2153
- $response = [];
2154
- $commentListArgs = $this->getCommentListArgs($inline_form->post_id);
2155
- $response["message"] = wp_list_comments($commentListArgs, [$newComment]);
2156
- $response["newCount"] = esc_html(get_comments($args));
2157
- $response["new_comment_id"] = $new_comment_id;
2158
- $response["notification"] = esc_html($this->options->phrases["wc_feedback_comment_success"]);
2159
- $response["allCommentsCountNew"] = get_comments_number($inline_form->post_id);
2160
- $response["allCommentsCountBeforeThreadsHtml"] = "<span class='wpdtc' title='" . esc_attr($response["allCommentsCountNew"]) . "'>" . esc_html($this->helper->getNumber($response["allCommentsCountNew"])) . "</span> " . esc_html(1 == $response["allCommentsCountNew"] ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural());
2161
- $response["allCommentsCountBubbleHtml"] = "<span id='wpd-bubble-all-comments-count'" . ($response["allCommentsCountNew"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["allCommentsCountNew"]) . "'>" . esc_html($this->helper->getNumber($response["allCommentsCountNew"])) . "</span>";
2162
- do_action("wpdiscuz_clean_post_cache", $inline_form->post_id, "inline_comment_posted");
2163
- wp_send_json_success($response);
2164
- } else {
2165
- wp_send_json_error("wc_invalid_field");
2166
- }
2167
- }
2168
  }
2169
  wp_send_json_error("wc_msg_required_fields");
2170
  }
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.1.1
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
83
  register_activation_hook(__FILE__, [&$this, "pluginActivation"]);
84
 
85
  /* GRAVATARS CACHE */
86
+ register_activation_hook(__FILE__, [&$this, "registerJobs"]);
87
+ register_deactivation_hook(__FILE__, [&$this, "deregisterJobs"]);
88
+ add_filter("cron_schedules", [&$this, "setIntervals"]);
89
  /* GRAVATARS CACHE */
90
  add_action("wpmu_new_blog", [&$this, "addNewBlog"]);
91
  add_action("delete_blog", [&$this, "deleteBlog"]);
230
  load_plugin_textdomain("wpdiscuz", false, dirname(plugin_basename(__FILE__)) . "/languages/");
231
  }
232
 
233
+ public function registerJobs() {
234
  if (!wp_next_scheduled(self::GRAVATARS_CACHE_ADD_ACTION)) {
235
  wp_schedule_event(current_time("timestamp"), self::GRAVATARS_CACHE_ADD_KEY_RECURRENCE, self::GRAVATARS_CACHE_ADD_ACTION);
236
  }
238
  if (!wp_next_scheduled(self::GRAVATARS_CACHE_DELETE_ACTION)) {
239
  wp_schedule_event(current_time("timestamp"), self::GRAVATARS_CACHE_DELETE_KEY_RECURRENCE, self::GRAVATARS_CACHE_DELETE_ACTION);
240
  }
241
+
242
+ if (!wp_next_scheduled(self::DELETE_UNATTACHED_FILES_ACTION)) {
243
+ wp_schedule_event(current_time("timestamp"), self::DELETE_UNATTACHED_FILES_KEY_RECURRENCE, self::DELETE_UNATTACHED_FILES_ACTION);
244
+ }
245
  }
246
 
247
+ public function deregisterJobs() {
248
  if (wp_next_scheduled(self::GRAVATARS_CACHE_ADD_ACTION)) {
249
  wp_clear_scheduled_hook(self::GRAVATARS_CACHE_ADD_ACTION);
250
  }
252
  if (wp_next_scheduled(self::GRAVATARS_CACHE_DELETE_ACTION)) {
253
  wp_clear_scheduled_hook(self::GRAVATARS_CACHE_DELETE_ACTION);
254
  }
255
+
256
+ if (wp_next_scheduled(self::DELETE_UNATTACHED_FILES_ACTION)) {
257
+ wp_clear_scheduled_hook(self::DELETE_UNATTACHED_FILES_ACTION);
258
+ }
259
  }
260
 
261
+ public function setIntervals($schedules) {
262
+ $schedules[self::GRAVATARS_CACHE_ADD_KEY_RECURRENCE] = [
263
  "interval" => self::GRAVATARS_CACHE_ADD_RECURRENCE * HOUR_IN_SECONDS,
264
  "display" => esc_html__("Every 3 hours", "wpdiscuz")
265
  ];
266
+ $schedules[self::GRAVATARS_CACHE_DELETE_KEY_RECURRENCE] = [
267
  "interval" => self::GRAVATARS_CACHE_DELETE_RECURRENCE * HOUR_IN_SECONDS,
268
  "display" => esc_html__("Every 48 hours", "wpdiscuz")
269
  ];
270
+ $schedules[self::DELETE_UNATTACHED_FILES_KEY_RECURRENCE] = [
271
+ "interval" => self::DELETE_UNATTACHED_FILES_RECURRENCE * HOUR_IN_SECONDS,
272
+ "display" => esc_html__("Every 48 hours", "wpdiscuz")
273
+ ];
274
  return $schedules;
275
  }
276
 
281
  $this->isWpdiscuzLoaded = true;
282
  $visibleCommentIds = isset($_POST["visibleCommentIds"]) ? rtrim($_POST["visibleCommentIds"], ",") : "";
283
  $cArgs = $this->getDefaultCommentsArgs($postId);
284
+ $commentListArgs = $this->getCommentListArgs($postId);
285
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
286
+ $lastCommentId = $this->dbManager->getLastCommentId($cArgs);
287
+ if ($lastCommentId > $loadLastCommentId) {
288
+ $response = [];
289
+ $response["loadLastCommentId"] = $lastCommentId;
290
+ $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
291
+ $sentEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? trim($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
292
+ $email = !empty($commentListArgs["current_user"]->ID) ? $commentListArgs["current_user"]->user_email : $sentEmail;
293
+ $newCommentIds = $this->dbManager->getNewCommentIds($cArgs, $loadLastCommentId, $email, $visibleCommentIds);
294
+ $newCommentIds = apply_filters("wpdiscuz_live_update_new_comment_ids", $newCommentIds, $postId, $commentListArgs["current_user"]);
295
+ $response["message"] = [];
296
+ foreach ($newCommentIds as $k => $newCommentId) {
297
+ $comment = get_comment($newCommentId);
298
+ if (($comment->comment_parent && (in_array($comment->comment_parent, explode(",", $visibleCommentIds)) || in_array($comment->comment_parent, $newCommentIds))) || !$comment->comment_parent) {
299
+ $commentHtml = wp_list_comments($commentListArgs, [$comment]);
300
+ $commentObject = [
301
+ "comment_parent" => $comment->comment_parent,
302
+ "comment_html" => $commentHtml
303
+ ];
304
+ if ($comment->comment_parent) {
305
+ array_push($response["message"], $commentObject);
306
+ } else {
307
+ array_unshift($response["message"], $commentObject);
308
+ }
309
  }
310
  }
311
+ $response["wc_all_comments_count_new"] = get_comments_number($postId);
312
+ $response["wc_all_comments_count_before_threads_html"] = "<span class='wpdtc' title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span> " . esc_html(1 == $response["wc_all_comments_count_new"] ? $this->form->getHeaderTextSingle() : $this->form->getHeaderTextPlural());
313
+ $response["wc_all_comments_count_bubble_html"] = "<span id='wpd-bubble-all-comments-count'" . ($response["wc_all_comments_count_new"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span>";
314
+ wp_send_json_success($response);
315
  }
 
 
 
 
316
  }
317
  }
318
  }
321
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
322
  $newCommentIds = isset($_POST["newCommentIds"]) ? trim($_POST["newCommentIds"]) : "";
323
  if ($postId && $newCommentIds) {
324
+ $this->isWpdiscuzLoaded = true;
325
+ $commentListArgs = $this->getCommentListArgs($postId);
326
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
327
+ $newCommentIds = explode(",", trim($newCommentIds, ","));
328
+ $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
329
+ $response = ["message" => []];
330
+ foreach ($newCommentIds as $k => $newCommentId) {
331
+ $comment = get_comment($newCommentId);
332
+ $commentHtml = wp_list_comments($commentListArgs, [$comment]);
333
+ $response["message"][] = [
334
+ "comment_id" => $comment->comment_ID,
335
+ "comment_parent" => $comment->comment_parent,
336
+ "comment_html" => $commentHtml
337
+ ];
338
+ }
339
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
340
+ wp_send_json_success($response);
341
  }
 
 
342
  }
343
  }
344
 
349
  $comment_content = isset($_POST["wc_comment"]) ? trim($_POST["wc_comment"]) : "";
350
 
351
  if ($uniqueId && $postId && $comment_content) {
352
+ $this->isWpdiscuzLoaded = true;
353
+ $this->form = $this->wpdiscuzForm->getForm($postId);
354
+ $this->form->initFormFields();
355
+ $currentUser = WpdiscuzHelper::getCurrentUser();
356
+ if ($this->form->isUserCanSeeComments($currentUser, $postId)) {
357
+ do_action("wpdiscuz_before_comment_post");
358
+ if (!comments_open($postId)) {
359
+ wp_die(esc_html($this->options->phrases["wc_commenting_is_closed"]));
360
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
 
362
+ if (function_exists("zerospam_get_key") && isset($_POST["wpdiscuz_zs"]) && ($wpdiscuzZS = $_POST["wpdiscuz_zs"])) {
363
+ $_POST["zerospam_key"] = $wpdiscuzZS === md5(zerospam_get_key()) ? zerospam_get_key() : "";
364
+ }
365
+ $commentDepth = isset($_POST["wpd_comment_depth"]) && intval($_POST["wpd_comment_depth"]) ? intval($_POST["wpd_comment_depth"]) : 1;
366
+ $isInSameContainer = "1";
367
+ $wooExists = class_exists("WooCommerce") && get_post_type($postId) === "product";
368
+ $replyForWoo = apply_filters("wpdiscuz_product_review_replies", true, $postId);
369
+ if ($wooExists && !$replyForWoo) {
370
+ $isInSameContainer = "0";
371
+ } else if ($commentDepth > $this->options->wp["threadCommentsDepth"]) {
372
+ $commentDepth = $this->options->wp["threadCommentsDepth"];
373
+ $isInSameContainer = "0";
374
+ } else if (!$this->options->wp["threadComments"]) {
375
+ $isInSameContainer = "0";
376
+ }
377
+ $notificationType = isset($_POST["wpdiscuz_notification_type"]) ? $_POST["wpdiscuz_notification_type"] : "";
378
+
379
+ $this->form->validateFields($currentUser);
380
+
381
+ $website_url = "";
382
+ if ($currentUser && $currentUser->ID) {
383
+ $user_id = $currentUser->ID;
384
+ $name = $this->helper->getCurrentUserDisplayName($currentUser);
385
+ $email = $currentUser->user_email;
386
+ } else {
387
+ $user_id = 0;
388
+ $name = urldecode($this->form->validateDefaultName($currentUser));
389
+ $email = urldecode($this->form->validateDefaultEmail($currentUser, $isAnonymous));
390
+ $website_url = $this->form->validateDefaultWebsite($currentUser);
391
+ }
392
 
393
+ $comment_content = ($this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop")) && !$this->options->showEditorToolbar() ? html_entity_decode($comment_content) : $comment_content;
394
+ $comment_content = $this->helper->replaceCommentContentCode($comment_content);
395
+ $comment_content = $this->helper->filterCommentText($comment_content);
396
+ if (!$comment_content) {
397
+ wp_send_json_error("wc_msg_required_fields");
398
+ }
399
+ $commentMinLength = intval($this->options->content["commentTextMinLength"]);
400
+ $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
401
+ $contentLength = function_exists("mb_strlen") ? mb_strlen(strip_tags($comment_content)) : strlen(strip_tags($comment_content));
402
+ if ($commentMinLength > 0 && $contentLength < $commentMinLength) {
403
+ wp_send_json_error("wc_msg_input_min_length");
404
+ }
405
 
406
+ if ($commentMaxLength > 0 && $contentLength > $commentMaxLength) {
407
+ wp_send_json_error("wc_msg_input_max_length");
408
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
 
410
+ if ($name && $email && $comment_content) {
411
+ $website_url = $website_url ? urldecode($website_url) : "";
412
+ $stickyComment = isset($_POST["wc_sticky_comment"]) && ($sticky = intval($_POST["wc_sticky_comment"])) ? $sticky : "";
413
+ $closedComment = isset($_POST["wc_closed_comment"]) && ($closed = absint($_POST["wc_closed_comment"])) ? $closed : "";
414
+ $uid_data = $this->helper->getUIDData($uniqueId);
415
+ $comment_parent = intval($uid_data[0]);
416
+ $parentComment = $comment_parent ? get_comment($comment_parent) : null;
417
+ $comment_parent = isset($parentComment->comment_ID) ? $parentComment->comment_ID : 0;
418
+ if ($parentComment && intval(get_comment_meta($comment_parent, self::META_KEY_CLOSED, true))) {
419
+ wp_die(esc_html($this->options->phrases["wc_closed_comment_thread"]));
 
420
  }
421
+ $this->helper->restrictCommentingPerUser($email, $comment_parent, $postId);
422
+ $wc_user_agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
423
+ $new_commentdata = [
424
+ "user_id" => $user_id,
425
+ "comment_post_ID" => $postId,
426
+ "comment_parent" => $wooExists && !$replyForWoo ? 0 : $comment_parent,
427
+ "comment_author" => $name,
428
+ "comment_author_email" => $email,
429
+ "comment_content" => $comment_content,
430
+ "comment_author_url" => $website_url,
431
+ "comment_agent" => $wc_user_agent,
432
+ "comment_type" => $wooExists ? "review" : ($stickyComment ? self::WPDISCUZ_STICKY_COMMENT : self::$DEFAULT_COMMENT_TYPE),
433
+ ];
434
+
435
+ $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
436
+ if ($closedComment) {
437
+ add_comment_meta($new_comment_id, self::META_KEY_CLOSED, "1");
438
+ }
439
+ $this->form->saveCommentMeta($new_comment_id);
440
+ $newComment = get_comment($new_comment_id);
441
+ $held_moderate = 1;
442
+ if ($newComment->comment_approved === "1") {
443
+ $held_moderate = 0;
444
+ if ($wooExists) {
445
+ update_post_meta($postId, "_wc_review_count", get_comments([
446
+ "count" => true,
447
+ "post_id" => $postId
448
+ ]));
449
+ }
450
+ }
451
+ if ($notificationType === WpdiscuzCore::SUBSCRIPTION_POST && class_exists("Prompt_Comment_Form_Handling") && $this->options->subscription["usePostmaticForCommentNotification"]) {
452
+ $_POST[Prompt_Comment_Form_Handling::SUBSCRIBE_CHECKBOX_NAME] = 1;
453
+ Prompt_Comment_Form_Handling::handle_form($new_comment_id, $newComment->comment_approved);
454
+ } else if (!$isAnonymous && $notificationType) {
455
+ $subscriptionData = $this->dbManager->hasSubscription($postId, $email);
456
+ if (!$subscriptionData || ($subscriptionData && $subscriptionData["type"] === self::SUBSCRIPTION_COMMENT)) {
457
+ $noNeedMemberConfirm = ($currentUser->ID && !$this->options->subscription["enableMemberConfirm"]);
458
+ $noNeedGuestsConfirm = (!$currentUser->ID && !$this->options->subscription["enableGuestsConfirm"]);
459
+ if ($noNeedMemberConfirm || $noNeedGuestsConfirm) {
460
+ $this->dbManager->addEmailNotification($new_comment_id, $postId, $email, self::SUBSCRIPTION_COMMENT, 1);
461
+ } else {
462
+ $confirmData = $this->dbManager->addEmailNotification($new_comment_id, $postId, $email, self::SUBSCRIPTION_COMMENT);
463
+ if ($confirmData) {
464
+ $this->helperEmail->confirmEmailSender($confirmData["id"], $confirmData["activation_key"], $postId, $email);
465
+ }
466
+ }
467
+ }
468
+ }
469
+ $response = [];
470
+ $response["redirect"] = $this->options->general["redirectPage"];
471
+ $response["new_comment_id"] = $new_comment_id;
472
+ $response["comment_author"] = $name;
473
+ $response["comment_author_email"] = $email;
474
+ $response["comment_author_url"] = $website_url;
475
+ $response["is_main"] = $wooExists && !$replyForWoo ? 1 : ($comment_parent ? 0 : 1);
476
+ $response["held_moderate"] = $held_moderate;
477
+ $response["is_in_same_container"] = $isInSameContainer;
478
+ $response["wc_all_comments_count_new"] = get_comments_number($postId);
479
+ $response["wc_all_comments_count_before_threads_html"] = "<span class='wpdtc' title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span> " . esc_html(1 == $response["wc_all_comments_count_new"] ? $this->form->getHeaderTextSingle() : $this->form->getHeaderTextPlural());
480
+ $response["wc_all_comments_count_bubble_html"] = "<span id='wpd-bubble-all-comments-count'" . ($response["wc_all_comments_count_new"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["wc_all_comments_count_new"]) . "'>" . esc_html($this->helper->getNumber($response["wc_all_comments_count_new"])) . "</span>";
481
+
482
+ $commentListArgs = $this->getCommentListArgs($postId);
483
+ $commentListArgs["addComment"] = $commentDepth;
484
+ $commentListArgs["comment_author_email"] = $email;
485
+
486
+ $response["uniqueid"] = $uniqueId;
487
+ $response["message"] = wp_list_comments($commentListArgs, [$newComment]);
488
+ $response["message"] = wp_unslash($response["message"]);
489
+ do_action("wpdiscuz_after_comment_post", $newComment, $currentUser);
490
+ $response["callbackFunctions"] = [];
491
+ $response = apply_filters("wpdiscuz_comment_post", $response);
492
+ do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
493
+ wp_send_json_success($response);
494
+ } else {
495
+ wp_send_json_error("wc_invalid_field");
496
+ }
497
+ } else {
498
+ wp_send_json_error("wc_msg_required_fields");
499
+ }
500
  } else {
501
  wp_send_json_error("wc_msg_required_fields");
502
  }
519
  $uniqueId = $comment->comment_ID . "_" . $comment->comment_parent;
520
  $highLevelUser = current_user_can("moderate_comments");
521
  $isCurrentUserCanEdit = $this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $currentUser);
522
+ $this->form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
523
+ $this->form->initFormFields();
524
+ $this->form->validateFields($currentUser);
525
+ if (!intval(get_comment_meta($comment->comment_ID, self::META_KEY_CLOSED, true)) && ($highLevelUser || $isCurrentUserCanEdit) && $this->form->isUserCanSeeComments($currentUser, $comment->comment_post_ID)) {
526
  $isInRange = $this->helper->isContentInRange($trimmedContent);
527
 
528
  if (!$isInRange && !$highLevelUser) {
540
 
541
  if ($isInRange || $highLevelUser) {
542
  $response = [];
 
 
 
543
  if ($trimmedContent !== $comment->comment_content) {
544
  $trimmedContent = $this->helper->replaceCommentContentCode($trimmedContent);
545
  $commentContent = $this->helper->filterCommentText($trimmedContent);
566
  do_action("wpdiscuz_clean_post_cache", $comment->comment_post_ID, "comment_edited");
567
  }
568
 
569
+ $this->form->saveCommentMeta($comment->comment_ID);
570
  $commentContent = isset($commentContent) ? $commentContent : $trimmedContent;
571
  if ($this->options->content["enableImageConversion"]) {
572
  $commentContent = $this->helper->makeClickable($commentContent);
589
  $response["whatsappShareLink"] = esc_url_raw((wp_is_mobile() ? "https://api.whatsapp.com" : "https://web.whatsapp.com") . "/send?text=" . $this->helper->getWhatsappShareContent($commentContent, $commentLink));
590
  }
591
 
592
+ $components = $this->helper->getComponents($this->form->getTheme(), $this->form->getLayout());
593
  $inlineContent = "";
594
  if ($inlineFormID = intval(get_comment_meta($comment->comment_ID, self::META_KEY_FEEDBACK_FORM_ID, true))) {
595
  $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
621
  if ($commentId && $postId && $comment && $comment->comment_post_ID == $postId) {
622
  $commentListArgs = $this->getCommentListArgs($postId);
623
  $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
624
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
625
+ $showUnapprovedComment = false;
626
+ $includeUnapproved = null;
627
+ if ($comment->comment_approved === "0") {
628
+ if ($commentListArgs["high_level_user"]) {
629
+ $showUnapprovedComment = true;
630
+ } else if (!empty($this->commentsArgs["include_unapproved"])) {
631
+ $includeUnapproved = $this->commentsArgs["include_unapproved"][0];
632
+ if (is_numeric($this->commentsArgs["include_unapproved"][0])) {
633
+ if ($comment->user_id == $this->commentsArgs["include_unapproved"][0]) {
634
+ $showUnapprovedComment = true;
635
+ }
636
+ } else if ($comment->comment_author_email === $this->commentsArgs["include_unapproved"][0]) {
637
+ $showUnapprovedComment = true;
638
+ }
639
+ }
640
+ }
641
+ if ($comment->comment_approved === "1" || $showUnapprovedComment) {
642
+ $this->isWpdiscuzLoaded = true;
643
+ $commentStatusIn = ["1"];
644
+ if ($this->commentsArgs["status"] === "all") {
645
+ $commentStatusIn[] = "0";
646
+ }
647
+ $parentComment = null;
648
+ if (!$this->options->wp["threadComments"]) {
649
+ $comments = [$comment];
650
+ $parentComment = $comment;
651
+ } else if ($parentComment = $this->helperOptimization->getCommentRoot($commentId, $commentStatusIn, $includeUnapproved)) {
652
+ $args = [
653
+ "format" => "flat",
654
+ "status" => $this->commentsArgs["status"],
655
+ "orderby" => $this->commentsArgs["orderby"],
656
+ "post_id" => $this->commentsArgs["post_id"],
657
+ ];
658
+ if (!empty($this->commentsArgs["include_unapproved"])) {
659
+ $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
660
+ }
661
+ $tree = $parentComment->get_children($args);
662
+ $comments = array_merge([$parentComment], $tree);
663
+ }
664
+ if ($parentComment) {
665
+ $commentListArgs["isSingle"] = true;
666
+ $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
667
+ if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
668
+ if (!empty($commentListArgs['current_user']->ID)) {
669
+ $commentListArgs['user_votes'] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
670
+ } else {
671
+ $commentListArgs['user_votes'] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
672
+ }
673
+ }
674
+ $response = [];
675
+ $response["message"] = wp_list_comments($commentListArgs, $comments);
676
+ $response["parentCommentID"] = $parentComment->comment_ID;
677
+ $response["callbackFunctions"] = [];
678
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
679
+ wp_send_json_success($response);
680
+ }
681
+ }
682
  }
683
  }
684
  }
687
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
688
  $lastParentId = isset($_POST["lastParentId"]) ? intval($_POST["lastParentId"]) : 0;
689
  if ($lastParentId >= 0 && $postId) {
690
+ $this->form = $this->wpdiscuzForm->getForm($postId);
691
+ if ($this->form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $postId)) {
692
+ $this->isWpdiscuzLoaded = true;
693
+ $isFirstLoad = isset($_POST["isFirstLoad"]) ? intval($_POST["isFirstLoad"]) : 0;
694
+ // max value of php int for limit
695
+ $limit = ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3) || (!$isFirstLoad && $this->options->thread_display["commentListLoadType"] == 1) ? PHP_INT_MAX - 1 : $this->options->wp["commentPerPage"];
696
+ $args = ["number" => $limit];
697
+ $args["wpdType"] = !empty($_POST["wpdType"]) ? trim($_POST["wpdType"]) : "";
698
+ if ($isFirstLoad) {
699
+ $args["first_load"] = true;
700
+ }
701
+ $sorting = isset($_POST["sorting"]) ? trim($_POST["sorting"]) : "";
702
+ if ($sorting === "newest") {
703
+ $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
704
+ $args["order"] = "desc";
705
+ } else if ($sorting === "oldest") {
706
+ $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
707
+ $args["order"] = "asc";
708
+ } else if ($sorting === "by_vote") {
709
+ $args["orderby"] = "by_vote";
710
+ $args["order"] = $this->options->wp["commentOrder"];
711
+ }
712
+ if (isset($args["orderby"]) && $args["orderby"] === "by_vote" && !empty($_POST["offset"]) && ($offset = intval($_POST["offset"]))) {
713
+ $args["offset"] = $offset * ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3 ? 0 : $this->options->wp["commentPerPage"]);
714
+ }
715
+ $args["last_parent_id"] = $lastParentId;
716
+ $args["post_id"] = $postId;
717
+ $args = apply_filters("wpdiscuz_filter_args", $args);
718
+ $commentData = $this->getWPComments($args);
719
+ $commentData["loadLastCommentId"] = $this->dbManager->getLastCommentId($this->commentsArgs);
720
+ $commentData["callbackFunctions"] = [];
721
+ $commentData = apply_filters("wpdiscuz_ajax_callbacks", $commentData);
722
+ wp_send_json_success($commentData);
723
+ }
724
  }
725
  }
726
 
728
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
729
  $sorting = isset($_POST["sorting"]) ? trim($_POST["sorting"]) : "";
730
  if ($postId && $sorting) {
731
+ $this->form = $this->wpdiscuzForm->getForm($postId);
732
+ if ($this->form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $postId)) {
733
+ $this->isWpdiscuzLoaded = true;
734
+ $args = ["post_id" => $postId];
735
+ if ($sorting === "newest") {
736
+ $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
737
+ $args["order"] = "desc";
738
+ } else if ($sorting === "oldest") {
739
+ $args["orderby"] = $this->options->thread_display["orderCommentsBy"];
740
+ $args["order"] = "asc";
741
+ } else if ($sorting === "by_vote") {
742
+ $args["orderby"] = "by_vote";
743
+ $args["order"] = $this->options->wp["commentOrder"];
744
+ }
745
+ $args["first_load"] = 1;
746
+ $args["wpdType"] = !empty($_POST["wpdType"]) ? trim($_POST["wpdType"]) : "";
747
+ $args = apply_filters("wpdiscuz_filter_args", $args);
748
+ $commentData = $this->getWPComments($args);
749
+ $response = [
750
+ "last_parent_id" => $commentData["last_parent_id"],
751
+ "is_show_load_more" => $commentData["is_show_load_more"],
752
+ "message" => $commentData["comment_list"],
753
+ "callbackFunctions" => [],
754
+ ];
755
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
756
+ wp_send_json_success($response);
757
+ }
758
  }
759
  }
760
 
848
  }
849
  }
850
 
851
+ return apply_filters("comments_array", $commentList, $this->commentsArgs["post_id"]);
852
  }
853
 
854
  private function getChildren($commentList, &$commentListArgs) {
1023
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
1024
 
1025
  if ((isset($_GET["page"]) && in_array($_GET["page"], $wpdiscuzPages) && in_array($pagenow, $wpdiscuzWpPages)) || ($typenow === "wpdiscuz_form") || ($pagenow === self::PAGE_COMMENTS)) {
1026
+ $nonceKey = ($key = get_home_url()) ? md5($key) : "wpdiscuz-media-uploader-nonce";
1027
  $args = [
1028
  "msgConfirmResetOptions" => esc_html__("Do you really want to reset all options?", "wpdiscuz"),
1029
  "msgConfirmResetTabOptions" => esc_html__("Do you really want to reset tab options?", "wpdiscuz"),
1031
  "msgConfirmResetPhrases" => esc_html__("Do you really want to reset phrases?", "wpdiscuz"),
1032
  "wmuMsgConfirmAttachmentDelete" => esc_html__("Do you really want to delet this attachment?", "wpdiscuz"),
1033
  "msgConfirmPurgeGravatarsCache" => esc_html__("Do you really want to delete gravatars cache?", "wpdiscuz"),
1034
+ "wmuSecurity" => wp_create_nonce($nonceKey),
1035
  ];
1036
  // Media Upload Lightbox
1037
  wp_register_style("wmu-colorbox-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorbox/colorbox.css"));
1046
  wp_enqueue_script("wpdiscuz-mu-js");
1047
 
1048
  wp_enqueue_style("wpdiscuz-font-awesome");
1049
+ wp_enqueue_style("wp-color-picker");
1050
+ wp_enqueue_script("wp-color-picker");
 
 
 
 
 
 
 
 
1051
  wp_register_style("wpdiscuz-options-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-options.css"), null, $this->version);
1052
  wp_enqueue_style("wpdiscuz-options-css");
1053
  wp_register_script("wpdiscuz-options-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/js/wpdiscuz-options.js"), ["jquery"], $this->version);
1057
  wp_register_script("wpdiscuz-contenthover", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/contenthover/jquery.contenthover.min.js"), ["jquery"], $this->version, true);
1058
  wp_enqueue_script("wpdiscuz-contenthover");
1059
 
1060
+ if (isset($_GET["page"]) && $_GET["page"] === self::PAGE_WPDISCUZ) {
1061
  wp_register_style("wpdiscuz-easy-responsive-tabs-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css"), null, $this->version);
1062
  wp_enqueue_style("wpdiscuz-easy-responsive-tabs-css");
1063
  wp_register_script("wpdiscuz-easy-responsive-tabs-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js"), ["jquery"], $this->version, true);
1185
  $combo_js = "";
1186
  $combo_css = "";
1187
  if (!$loadQuill) {
1188
+ $combo_js = "-no_quill";
1189
+ $combo_css = "-no_quill";
1190
  }
1191
  wp_register_style("wpdiscuz-combo-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-combo$combo_css.min.css"));
1192
  wp_enqueue_style("wpdiscuz-combo-css");
1195
  wp_localize_script("wpdiscuz-combo-js", "wpdiscuzAjaxObj", $this->wpdiscuzOptionsJs);
1196
  wp_localize_script("wpdiscuz-combo-js", "wpdiscuzUCObj", $ucArgs);
1197
  if ($loadQuill) {
1198
+ wp_add_inline_script("wpdiscuz-combo-js", $this->options->editorOptions(), "before");
1199
  }
1200
  } else {
1201
  wp_register_script("wpdiscuz-cookie-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/wpdccjs/wpdcc.js"), ["jquery"], $this->version, true);
1654
  $this->isWpdiscuzLoaded = true;
1655
  $commentListArgs = $this->getCommentListArgs($postId);
1656
  $cArgs = $this->getDefaultCommentsArgs($postId);
1657
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
1658
+ $cArgs["parent"] = $commentId;
1659
+ $cArgs["number"] = null;
1660
+ $comment = get_comment($commentId);
1661
+ $args = [
1662
+ "format" => "flat",
1663
+ "status" => $cArgs["status"],
1664
+ "orderby" => $cArgs["orderby"],
1665
+ "post_id" => $cArgs["post_id"],
1666
+ ];
1667
+ if (!empty($cArgs["include_unapproved"])) {
1668
+ $args["include_unapproved"] = $cArgs["include_unapproved"];
1669
+ }
1670
+ $children = $comment->get_children($args);
1671
+ $commentListArgs["wpdiscuz_child_count_" . $comment->comment_ID] = count($children);
1672
+ $comments = array_merge([$comment], $children);
1673
+ if ($comments) {
1674
+ $response = [];
1675
+ if ($this->options->thread_layouts["highlightVotingButtons"]) {
1676
+ if (!empty($commentListArgs['current_user']->ID)) {
1677
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1678
+ } else {
1679
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1680
+ }
1681
+ }
1682
+ $response["comment_list"] = wp_list_comments($commentListArgs, $comments);
1683
+ $response["callbackFunctions"] = [];
1684
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1685
+ wp_send_json_success($response);
1686
+ }
1687
+ }
1688
  }
1689
  }
1690
 
1692
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1693
  if ($postId) {
1694
  $this->isWpdiscuzLoaded = true;
1695
+ $commentListArgs = $this->getCommentListArgs($postId);
1696
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
1697
+ $commentId = $this->dbManager->getMostReactedCommentId($postId);
1698
+ $comment = get_comment($commentId);
1699
+ if ($comment && $comment->comment_post_ID == $postId) {
1700
+ $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1701
+ $commentStatusIn = ["1"];
1702
+ if ($this->commentsArgs["status"] === "all") {
1703
+ $commentStatusIn[] = "0";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1704
  }
1705
+ $args = [
1706
+ "format" => "flat",
1707
+ "status" => $this->commentsArgs["status"],
1708
+ "orderby" => $this->commentsArgs["orderby"],
1709
+ "post_id" => $this->commentsArgs["post_id"],
1710
+ ];
1711
+ $includeUnapproved = null;
1712
+ if (!empty($this->commentsArgs["include_unapproved"])) {
1713
+ $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
1714
+ $includeUnapproved = $this->commentsArgs["include_unapproved"];
1715
+ }
1716
+ $parentComment = $this->helperOptimization->getCommentRoot($commentId, $commentStatusIn, $includeUnapproved);
1717
+ $tree = $parentComment->get_children($args);
1718
+ $comments = array_merge([$parentComment], $tree);
1719
+ $commentListArgs["isSingle"] = true;
1720
+ $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
1721
+ $response = [];
1722
+ if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
1723
+ if (!empty($commentListArgs['current_user']->ID)) {
1724
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1725
+ } else {
1726
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1727
+ }
1728
+ }
1729
+ $response["message"] = wp_list_comments($commentListArgs, $comments);
1730
+ $response["commentId"] = $commentId;
1731
+ $response["parentCommentID"] = $parentComment->comment_ID;
1732
+ $response["callbackFunctions"] = [];
1733
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1734
+ wp_send_json_success($response);
1735
  }
 
 
 
 
 
 
1736
  }
1737
  }
1738
  }
1741
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1742
  if ($postId) {
1743
  $this->isWpdiscuzLoaded = true;
1744
+ $commentListArgs = $this->getCommentListArgs($postId);
1745
+ if ($this->form->isUserCanSeeComments($commentListArgs["current_user"], $postId)) {
1746
+ $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1747
+ $commentStatusIn = ["1"];
1748
+ if ($this->commentsArgs["status"] === "all") {
1749
+ $commentStatusIn[] = "0";
 
 
 
 
 
 
 
 
 
 
 
1750
  }
1751
+ $parentCommentIds = $this->dbManager->getParentCommentsHavingReplies($postId, $commentStatusIn);
1752
+ $childCount = 0;
1753
+ $hottestCommentId = 0;
1754
+ $hottestChildren = [];
1755
+ foreach ($parentCommentIds as $k => $parentCommentId) {
1756
+ $tree = [];
1757
+ $children = $this->dbManager->getHottestTree($parentCommentId);
1758
+ $tmpCount = count($children);
1759
+ if ($childCount < $tmpCount) {
1760
+ $childCount = $tmpCount;
1761
+ $hottestCommentId = $parentCommentId;
1762
+ $hottestChildren = $children;
1763
+ }
1764
  }
1765
+
1766
+ if ($hottestCommentId && $hottestChildren) {
1767
+ $args = [
1768
+ "format" => "flat",
1769
+ "status" => $this->commentsArgs["status"],
1770
+ "orderby" => $this->commentsArgs["orderby"],
1771
+ "post_id" => $this->commentsArgs["post_id"],
1772
+ ];
1773
+ $includeUnapproved = null;
1774
+ if (!empty($this->commentsArgs["include_unapproved"])) {
1775
+ $args["include_unapproved"] = $this->commentsArgs["include_unapproved"];
1776
+ $includeUnapproved = $this->commentsArgs["include_unapproved"];
1777
  }
1778
+ $parentComment = $this->helperOptimization->getCommentRoot($hottestCommentId, $commentStatusIn, $includeUnapproved);
1779
+ $tree = $parentComment->get_children($args);
1780
+ $comments = array_merge([$parentComment], $tree);
1781
+ $commentListArgs["isSingle"] = true;
1782
+ $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
1783
+ $response = [];
1784
+ if ($comments && $this->options->thread_layouts["highlightVotingButtons"]) {
1785
+ if (!empty($commentListArgs['current_user']->ID)) {
1786
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, $commentListArgs['current_user']->ID);
1787
+ } else {
1788
+ $commentListArgs["user_votes"] = $this->dbManager->getUserVotes($comments, md5($this->helper->getRealIPAddr()));
1789
+ }
1790
+ }
1791
+ $response["message"] = wp_list_comments($commentListArgs, $comments);
1792
+ $response["commentId"] = $hottestCommentId;
1793
+ $response["callbackFunctions"] = [];
1794
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
1795
+ wp_send_json_success($response);
1796
  }
 
 
 
 
 
1797
  }
1798
  }
1799
  }
1878
 
1879
  public function mceButton($buttons) {
1880
  global $post;
1881
+ if (!empty($post->ID) && comments_open($post->ID) && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1882
  array_push($buttons, "|", "wpDiscuz");
1883
  }
1884
 
1887
 
1888
  public function mceExternalPlugin($plugin_array) {
1889
  global $post;
1890
+ if (!empty($post->ID) && comments_open($post->ID) && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1891
  $plugin_array["wpDiscuz"] = esc_url_raw(plugins_url("assets/js/wpdiscuz-shortcode-tinymce.js", __FILE__));
1892
  }
1893
 
1896
 
1897
  public function gutenbergButton() {
1898
  global $post;
1899
+ if (!empty($post->ID) && comments_open($post->ID) && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1900
  wp_register_script(self::WPDISCUZ_FEEDBACK_SHORTCODE . "-shortcode-gutenberg-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/js/wpdiscuz-shortcode-gutenberg.js"), [
1901
  "wp-blocks",
1902
  "wp-editor",
1915
 
1916
  public function feedbackDialog() {
1917
  global $post;
1918
+ if (!empty($post->ID) && comments_open($post->ID) && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($form = $this->wpdiscuzForm->getForm($post->ID)) && $form->getFormID()) {
1919
  ?>
1920
  <style type="text/css">
1921
  #TB_title {
2052
 
2053
  public function feedbackShortcode($atts, $content = "") {
2054
  global $post;
2055
+ if ($this->isWpdiscuzLoaded && comments_open($post->ID) && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && $this->form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $post->ID)) {
2056
  $atts = shortcode_atts([
2057
  "id" => "",
2058
  "question" => "",
2059
  "opened" => 0
2060
  ], $atts, self::WPDISCUZ_FEEDBACK_SHORTCODE);
2061
  if ($atts["id"] && $atts["question"] && ($inline_form = $this->dbManager->getFeedbackFormByUid($post->ID, $atts["id"]))) {
2062
+ $content = "<div class='wpd-inline-shortcode wpd-inline-" . ($inline_form->opened && $this->form->isUserCanComment(WpdiscuzHelper::getCurrentUser(), $post->ID) ? "opened" : "closed") . "' id='wpd-inline-" . $inline_form->id . "'>" . html_entity_decode($content);
2063
  $content .= "<div class='wpd-inline-icon-wrapper'>";
2064
  $content .= "<svg class='wpd-inline-icon" . ($this->options->inline["inlineFeedbackAttractionType"] === "blink" ? " wpd-ignored" : "") . "' xmlns='https://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path class='wpd-inline-icon-first' d='M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z'/><path class='wpd-inline-icon-second' d='M0 0h24v24H0z' /></svg>";
2065
  $args = [
2089
 
2090
  public function addInlineComment() {
2091
  $inline_form_id = !empty($_POST["inline_form_id"]) ? intval($_POST["inline_form_id"]) : 0;
2092
+ if ($inline_form_id && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($inline_form = $this->dbManager->getFeedbackForm($inline_form_id))) {
2093
  if (!empty($_POST["_wpd_inline_nonce"]) && wp_verify_nonce($_POST["_wpd_inline_nonce"], "wpd_inline_nonce_" . $inline_form->post_id)) {
2094
  if (!comments_open($inline_form->post_id)) {
2095
  wp_die(esc_html($this->options->phrases["wc_commenting_is_closed"]));
2096
  }
2097
+ $this->isWpdiscuzLoaded = true;
2098
  $currentUser = WpdiscuzHelper::getCurrentUser();
2099
+ $this->form = $this->wpdiscuzForm->getForm($inline_form->post_id);
2100
+ if ($this->form->isUserCanSeeComments($currentUser, $inline_form->post_id)) {
2101
+ $isAnonymous = false;
2102
+ if (!empty($currentUser->ID)) {
2103
+ $user_id = $currentUser->ID;
2104
+ $name = $this->helper->getCurrentUserDisplayName($currentUser);
2105
+ $email = $currentUser->user_email;
2106
+ } else {
2107
+ $user_id = 0;
2108
+ $name = !empty($_POST["wpd_inline_name"]) ? urldecode(trim($_POST["wpd_inline_name"])) : "";
2109
+ if (!empty($_POST["wpd_inline_email"]) && ($email = trim($_POST["wpd_inline_email"]))) {
2110
+ if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
2111
+ wp_send_json_error("wc_error_email_text");
2112
+ }
2113
+ } else {
2114
+ $email = uniqid() . "@example.com";
2115
+ $isAnonymous = true;
2116
+ }
2117
+ $email = urldecode($email);
2118
+ }
2119
+ $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2120
+ $comment_content = $this->helper->filterCommentText($comment_content);
2121
+ if (!$comment_content) {
2122
+ wp_send_json_error("wc_msg_required_fields");
2123
+ }
2124
+ $commentMinLength = intval($this->options->content["commentTextMinLength"]);
2125
+ $commentMaxLength = intval($this->options->content["commentTextMaxLength"]);
2126
+ $contentLength = function_exists("mb_strlen") ? mb_strlen($comment_content) : strlen($comment_content);
2127
+ if ($commentMinLength > 0 && $contentLength < $commentMinLength) {
2128
+ wp_send_json_error("wc_msg_input_min_length");
2129
+ }
2130
+ if ($commentMaxLength > 0 && $contentLength > $commentMaxLength) {
2131
+ wp_send_json_error("wc_msg_input_max_length");
2132
+ }
2133
 
2134
+ if ($name && $email && $comment_content) {
2135
+ $wc_user_agent = !empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
2136
+ $new_commentdata = [
2137
+ "user_id" => $user_id,
2138
+ "comment_post_ID" => $inline_form->post_id,
2139
+ "comment_parent" => 0,
2140
+ "comment_author" => $name,
2141
+ "comment_author_email" => $email,
2142
+ "comment_author_url" => "",
2143
+ "comment_content" => $comment_content,
2144
+ "comment_agent" => $wc_user_agent,
2145
+ "comment_type" => self::$DEFAULT_COMMENT_TYPE,
2146
+ ];
2147
+ $this->helper->restrictCommentingPerUser($email, 0, $inline_form->post_id);
2148
+ $new_comment_id = wp_new_comment(wp_slash($new_commentdata));
2149
+ add_comment_meta($new_comment_id, self::META_KEY_FEEDBACK_FORM_ID, $inline_form->id);
2150
+ $args = [
2151
+ "count" => true,
2152
+ "meta_query" => [
2153
+ [
2154
+ "key" => self::META_KEY_FEEDBACK_FORM_ID,
2155
+ "value" => $inline_form->id,
2156
+ "compare" => "=",
2157
+ ],
2158
+ ],
2159
+ ];
2160
+ $newComment = get_comment($new_comment_id);
2161
+ if ($newComment->comment_approved === "1" && class_exists("WooCommerce") && get_post_type($inline_form->post_id) === "product") {
2162
+ update_post_meta($inline_form->post_id, "_wc_review_count", get_comments(["count" => true, "post_id" => $inline_form->post_id]));
2163
+ }
2164
+ if (apply_filters("wpdiscuz_enable_user_mentioning", $this->options->subscription["enableUserMentioning"]) && $this->options->subscription["sendMailToMentionedUsers"] && ($mentionedUsers = $this->helper->getMentionedUsers($newComment->comment_content))) {
2165
+ $this->helperEmail->sendMailToMentionedUsers($mentionedUsers, $newComment);
2166
+ }
2167
+ $notifiyMe = isset($_POST["wpd_inline_notify_me"]) ? absint($_POST["wpd_inline_notify_me"]) : 0;
2168
+ if (!$isAnonymous && $notifiyMe) {
2169
+ $noNeedMemberConfirm = ($currentUser->ID && !$this->options->subscription["enableMemberConfirm"]);
2170
+ $noNeedGuestsConfirm = (!$currentUser->ID && !$this->options->subscription["enableGuestsConfirm"]);
2171
+ if ($noNeedMemberConfirm || $noNeedGuestsConfirm) {
2172
+ $this->dbManager->addEmailNotification($new_comment_id, $inline_form->post_id, $email, self::SUBSCRIPTION_COMMENT, 1);
2173
+ } else {
2174
+ $confirmData = $this->dbManager->addEmailNotification($new_comment_id, $inline_form->post_id, $email, self::SUBSCRIPTION_COMMENT);
2175
+ if ($confirmData) {
2176
+ $this->helperEmail->confirmEmailSender($confirmData["id"], $confirmData["activation_key"], $inline_form->post_id, $email);
2177
+ }
2178
+ }
2179
+ }
2180
+ if ($newComment->comment_approved === "spam" || $newComment->comment_approved === "trash") {
2181
+ wp_send_json_error();
2182
+ }
2183
+ $response = [];
2184
+ $commentListArgs = $this->getCommentListArgs($inline_form->post_id);
2185
+ $response["message"] = wp_list_comments($commentListArgs, [$newComment]);
2186
+ $response["newCount"] = esc_html(get_comments($args));
2187
+ $response["new_comment_id"] = $new_comment_id;
2188
+ $response["notification"] = esc_html($this->options->phrases["wc_feedback_comment_success"]);
2189
+ $response["allCommentsCountNew"] = get_comments_number($inline_form->post_id);
2190
+ $response["allCommentsCountBeforeThreadsHtml"] = "<span class='wpdtc' title='" . esc_attr($response["allCommentsCountNew"]) . "'>" . esc_html($this->helper->getNumber($response["allCommentsCountNew"])) . "</span> " . esc_html(1 == $response["allCommentsCountNew"] ? $this->form->getHeaderTextSingle() : $this->form->getHeaderTextPlural());
2191
+ $response["allCommentsCountBubbleHtml"] = "<span id='wpd-bubble-all-comments-count'" . ($response["allCommentsCountNew"] ? "" : " style='display:none;'") . " title='" . esc_attr($response["allCommentsCountNew"]) . "'>" . esc_html($this->helper->getNumber($response["allCommentsCountNew"])) . "</span>";
2192
+ do_action("wpdiscuz_clean_post_cache", $inline_form->post_id, "inline_comment_posted");
2193
+ wp_send_json_success($response);
2194
+ } else {
2195
+ wp_send_json_error("wc_invalid_field");
2196
+ }
2197
+ }
2198
+ }
 
2199
  }
2200
  wp_send_json_error("wc_msg_required_fields");
2201
  }
forms/wpDiscuzForm.php CHANGED
@@ -400,6 +400,8 @@ class wpDiscuzForm implements wpdFormConst {
400
  private function getDefaultFormGeneralOptions($version, $lang, $wpdGeneralOptions, $phrases, &$postTypes) {
401
  $generalOptions = [
402
  "lang" => $lang,
 
 
403
  "roles_cannot_comment" => [],
404
  "guest_can_comment" => get_option("comment_registration") ? 0 : 1,
405
  "show_subscription_bar" => 1,
400
  private function getDefaultFormGeneralOptions($version, $lang, $wpdGeneralOptions, $phrases, &$postTypes) {
401
  $generalOptions = [
402
  "lang" => $lang,
403
+ "roles_cannot_see_comments" => [],
404
+ "guest_can_see_comments" => 1,
405
  "roles_cannot_comment" => [],
406
  "guest_can_comment" => get_option("comment_registration") ? 0 : 1,
407
  "show_subscription_bar" => 1,
forms/wpdFormAttr/Form.php CHANGED
@@ -21,6 +21,7 @@ class Form {
21
  private $ratings;
22
  private $ratingsExists = false;
23
  private $ratingsFieldsKey = [];
 
24
  public $isUserCanComment = true;
25
  public $hasIcon = false;
26
 
@@ -605,6 +606,8 @@ class Form {
605
  private function validateGeneralOptions($options) {
606
  $validData = [
607
  "lang" => get_locale(),
 
 
608
  "roles_cannot_comment" => [],
609
  "guest_can_comment" => 1,
610
  "show_subscription_bar" => 1,
@@ -621,6 +624,12 @@ class Form {
621
  "post_rating_title" => esc_html__("Article Rating", "wpdiscuz"),
622
  "allow_guests_rate_on_post" => 1,
623
  ];
 
 
 
 
 
 
624
  if (isset($options["roles_cannot_comment"])) {
625
  $validData["roles_cannot_comment"] = array_map("trim", $options["roles_cannot_comment"]);
626
  }
@@ -979,6 +988,7 @@ class Form {
979
 
980
  public function renderFormStructure() {
981
  $this->initFormMeta();
 
982
  ?>
983
  <style>.wpd-form-table td{ position: relative;} .wpd-form-table td i.fa-question-circle{ font-size: 16px; right: 15px; top: 15px; position: absolute;} .wpdiscuz-form-builder-help{text-align: right; padding: 5px; font-size: 16px; margin-top: -15px;}</style>
984
  <style>[dir=rtl] .wpd-form-table td{ position: relative; padding-left: 25px;} [dir=rtl] .wpd-form-table td i.fa-question-circle{ font-size: 16px; right:auto; left: 0px; top: 15px; position: absolute;} [dir=rtl] .wpdiscuz-form-builder-help{text-align: left; padding: 5px; font-size: 16px; margin-top: -15px;}</style>
@@ -988,21 +998,20 @@ class Form {
988
  <tbody>
989
  <tr>
990
  <th>
991
- <?php esc_html_e("Language", "wpdiscuz"); ?>
992
  </th>
993
  <td>
994
- <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_locale(); ?>
995
  <input required="" type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]" value="<?php echo htmlentities($lang, ENT_QUOTES); ?>" >
996
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#language" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
997
  </td>
998
- </tr>
999
  <tr>
1000
  <th>
1001
- <?php esc_html_e("Disable commenting for roles", "wpdiscuz"); ?>
1002
  </th>
1003
  <td>
1004
  <?php
1005
- $blogRoles = get_editable_roles();
1006
  $rolesCannotComment = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
1007
  foreach ($blogRoles as $role => $info) {
1008
  if ($role !== "administrator") {
@@ -1020,22 +1029,55 @@ class Form {
1020
  </tr>
1021
  <tr>
1022
  <th>
1023
- <?php esc_html_e("Allow guests to comment", "wpdiscuz"); ?>
1024
  </th>
1025
  <td>
1026
- <?php $guestCanComment = isset($this->generalOptions["guest_can_comment"]) ? $this->generalOptions["guest_can_comment"] : 1; ?>
1027
  <input <?php checked($guestCanComment, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="1" id="wpd_cf_guest_yes" > <label for="wpd_cf_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1028
- &nbsp;
1029
  <input <?php checked($guestCanComment, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="0" id="wpd_cf_guest_no"> <label for="wpd_cf_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1030
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#only-loggedin" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1031
  </td>
1032
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
  <tr>
1034
  <th>
1035
- <?php esc_html_e("Enable subscription bar", "wpdiscuz"); ?>
1036
  </th>
1037
  <td>
1038
- <?php $showSubscriptionBar = isset($this->generalOptions["show_subscription_bar"]) ? $this->generalOptions["show_subscription_bar"] : 1; ?>
1039
  <input <?php checked($showSubscriptionBar, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="1" id="wpd_cf_sbbar_yes" > <label for="wpd_cf_sbbar_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1040
  &nbsp;
1041
  <input <?php checked($showSubscriptionBar, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="0" id="wpd_cf_sbbar_no"> <label for="wpd_cf_sbbar_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
@@ -1044,10 +1086,10 @@ class Form {
1044
  </tr>
1045
  <tr>
1046
  <th>
1047
- <?php esc_html_e("Display agreement checkbox in Comment Subscription bar", "wpdiscuz"); ?>
1048
  </th>
1049
  <td>
1050
- <?php $showSubscriptionAgreement = isset($this->generalOptions["show_subscription_agreement"]) ? $this->generalOptions["show_subscription_agreement"] : 0; ?>
1051
  <input <?php checked($showSubscriptionAgreement, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="1" id="wpd_cf_sbbar_agreement_yes" > <label for="wpd_cf_sbbar_agreement_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1052
  &nbsp;
1053
  <input <?php checked($showSubscriptionAgreement, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="0" id="wpd_cf_sbbar_agreement_no"> <label for="wpd_cf_sbbar_agreement_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
@@ -1056,16 +1098,16 @@ class Form {
1056
  </tr>
1057
  <tr>
1058
  <th>
1059
- <?php esc_html_e("Comment Subscription bar agreement checkbox label", "wpdiscuz"); ?>
1060
  </th>
1061
  <td>
1062
- <?php $subscriptionAgreementLabel = isset($this->generalOptions["subscription_agreement_label"]) && $this->generalOptions["subscription_agreement_label"] ? $this->generalOptions["subscription_agreement_label"] : esc_html__("I allow to use my email address and send notification about new comments and replies (you can unsubscribe at any time).", "wpdiscuz"); ?>
1063
  <textarea name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[subscription_agreement_label]" style="width:80%;"><?php echo $subscriptionAgreementLabel; ?></textarea>
1064
  </td>
1065
  </tr>
1066
  <tr>
1067
  <th>
1068
- <?php esc_html_e("Comment form header text (singular)", "wpdiscuz"); ?>
1069
  </th>
1070
  <td >
1071
  <div>
@@ -1076,7 +1118,7 @@ class Form {
1076
  </tr>
1077
  <tr>
1078
  <th>
1079
- <?php esc_html_e("Comment form header text (plural)", "wpdiscuz"); ?>
1080
  </th>
1081
  <td >
1082
  <div>
@@ -1110,13 +1152,13 @@ class Form {
1110
  <span><?php echo esc_html($typeValue); ?></span>
1111
  </label>
1112
  <?php } ?>
1113
- <?php if ($hasForm) echo $formRelExistsInfo; ?>
1114
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1115
  </td>
1116
  </tr>
1117
  <tr>
1118
  <th>
1119
- <?php esc_html_e("Display comment form for post IDs", "wpdiscuz"); ?>
1120
  <p class="wpd-info"> <?php esc_html_e("You can use this form for certain posts/pages specified by comma separated IDs.", "wpdiscuz"); ?></p>
1121
  </th>
1122
  <td>
@@ -1131,7 +1173,7 @@ class Form {
1131
  ?>
1132
  <tr>
1133
  <th>
1134
- <?php esc_html_e("Theme", "wpdiscuz"); ?>
1135
  </th>
1136
  <td>
1137
  <?php
@@ -1150,7 +1192,7 @@ class Form {
1150
  ?>
1151
  <tr>
1152
  <th>
1153
- <?php esc_html_e("Comment List Layout", "wpdiscuz"); ?>
1154
  </th>
1155
  <td>
1156
  <div id="wpd_comment_layouts" style="width: 290px; margin: 15px 0 0 0">
@@ -1176,10 +1218,10 @@ class Form {
1176
  ?>
1177
  <tr>
1178
  <th>
1179
- <?php esc_html_e("Enable Post Rating", "wpdiscuz"); ?>
1180
  </th>
1181
  <td>
1182
- <?php $enablePostRating = isset($this->generalOptions["enable_post_rating"]) ? $this->generalOptions["enable_post_rating"] : 1; ?>
1183
  <input <?php checked($enablePostRating, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="1" id="wpd_enable_post_rating_yes" > <label for="wpd_enable_post_rating_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1184
  &nbsp;
1185
  <input <?php checked($enablePostRating, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="0" id="wpd_enable_post_rating_no"> <label for="wpd_enable_post_rating_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
@@ -1188,7 +1230,7 @@ class Form {
1188
  </tr>
1189
  <tr>
1190
  <th>
1191
- <?php esc_html_e("Post Rating Title", "wpdiscuz"); ?>
1192
  </th>
1193
  <td >
1194
  <div>
@@ -1198,10 +1240,10 @@ class Form {
1198
  </tr>
1199
  <tr>
1200
  <th>
1201
- <?php esc_html_e("Allow Guests to Rate", "wpdiscuz"); ?>
1202
  </th>
1203
  <td>
1204
- <?php $allowGuestsRateOnPost = isset($this->generalOptions["allow_guests_rate_on_post"]) ? $this->generalOptions["allow_guests_rate_on_post"] : 1; ?>
1205
  <input <?php checked($allowGuestsRateOnPost, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="1" id="wpd_allow_guests_rate_on_post_yes" > <label for="wpd_allow_guests_rate_on_post_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1206
  &nbsp;
1207
  <input <?php checked($allowGuestsRateOnPost, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="0" id="wpd_allow_guests_rate_on_post_no"> <label for="wpd_allow_guests_rate_on_post_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
@@ -1240,6 +1282,30 @@ class Form {
1240
  <?php
1241
  }
1242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1243
  public function isUserCanComment($currentUser, $postId = 0, &$message = "") {
1244
  global $post;
1245
  if (!$post) {
@@ -1251,8 +1317,9 @@ class Form {
1251
  if ($post->post_author && $post->post_author != $currentUser->ID && $currentUser->roles && is_array($currentUser->roles)) {
1252
  $postId = $post && isset($post->ID) ? $post->ID : $postId;
1253
  $this->generalOptions["roles_cannot_comment"] = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
 
1254
  foreach ($currentUser->roles as $k => $role) {
1255
- if (in_array($role, $this->generalOptions["roles_cannot_comment"])) {
1256
  //Filter hook to add extra conditions in user role dependent restriction.
1257
  $user_can_comment = apply_filters("wpdiscuz_user_role_can_comment", false, $role);
1258
  $message = $this->wpdOptions->phrases["wc_roles_cannot_comment_message"];
@@ -1261,7 +1328,8 @@ class Form {
1261
  }
1262
  }
1263
  } else {
1264
- $user_can_comment = $this->generalOptions["guest_can_comment"];
 
1265
  }
1266
  if ($user_can_comment && class_exists("WooCommerce") && get_post_type($postId) === "product") {
1267
  if (get_option("woocommerce_review_rating_verification_required") === "no" || wc_customer_bought_product("", get_current_user_id(), $postId)) {
21
  private $ratings;
22
  private $ratingsExists = false;
23
  private $ratingsFieldsKey = [];
24
+ public $isUserCanSeeComments = true;
25
  public $isUserCanComment = true;
26
  public $hasIcon = false;
27
 
606
  private function validateGeneralOptions($options) {
607
  $validData = [
608
  "lang" => get_locale(),
609
+ "roles_cannot_see_comments" => [],
610
+ "guest_can_see_comments" => 1,
611
  "roles_cannot_comment" => [],
612
  "guest_can_comment" => 1,
613
  "show_subscription_bar" => 1,
624
  "post_rating_title" => esc_html__("Article Rating", "wpdiscuz"),
625
  "allow_guests_rate_on_post" => 1,
626
  ];
627
+ if (isset($options["roles_cannot_see_comments"])) {
628
+ $validData["roles_cannot_see_comments"] = array_map("trim", $options["roles_cannot_see_comments"]);
629
+ }
630
+ if (isset($options["guest_can_see_comments"])) {
631
+ $validData["guest_can_see_comments"] = intval($options["guest_can_see_comments"]);
632
+ }
633
  if (isset($options["roles_cannot_comment"])) {
634
  $validData["roles_cannot_comment"] = array_map("trim", $options["roles_cannot_comment"]);
635
  }
988
 
989
  public function renderFormStructure() {
990
  $this->initFormMeta();
991
+ $blogRoles = get_editable_roles();
992
  ?>
993
  <style>.wpd-form-table td{ position: relative;} .wpd-form-table td i.fa-question-circle{ font-size: 16px; right: 15px; top: 15px; position: absolute;} .wpdiscuz-form-builder-help{text-align: right; padding: 5px; font-size: 16px; margin-top: -15px;}</style>
994
  <style>[dir=rtl] .wpd-form-table td{ position: relative; padding-left: 25px;} [dir=rtl] .wpd-form-table td i.fa-question-circle{ font-size: 16px; right:auto; left: 0px; top: 15px; position: absolute;} [dir=rtl] .wpdiscuz-form-builder-help{text-align: left; padding: 5px; font-size: 16px; margin-top: -15px;}</style>
998
  <tbody>
999
  <tr>
1000
  <th>
1001
+ <?php esc_html_e("Language", "wpdiscuz"); ?>
1002
  </th>
1003
  <td>
1004
+ <?php $lang = isset($this->generalOptions["lang"]) ? $this->generalOptions["lang"] : get_locale(); ?>
1005
  <input required="" type="text" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[lang]" value="<?php echo htmlentities($lang, ENT_QUOTES); ?>" >
1006
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#language" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1007
  </td>
1008
+ </tr>
1009
  <tr>
1010
  <th>
1011
+ <?php esc_html_e("Disable commenting for roles", "wpdiscuz"); ?>
1012
  </th>
1013
  <td>
1014
  <?php
 
1015
  $rolesCannotComment = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
1016
  foreach ($blogRoles as $role => $info) {
1017
  if ($role !== "administrator") {
1029
  </tr>
1030
  <tr>
1031
  <th>
1032
+ <?php esc_html_e("Allow guests to comment", "wpdiscuz"); ?>
1033
  </th>
1034
  <td>
1035
+ <?php $guestCanComment = isset($this->generalOptions["guest_can_comment"]) ? $this->generalOptions["guest_can_comment"] : 1; ?>
1036
  <input <?php checked($guestCanComment, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="1" id="wpd_cf_guest_yes" > <label for="wpd_cf_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1037
+ &nbsp;
1038
  <input <?php checked($guestCanComment, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_comment]" value="0" id="wpd_cf_guest_no"> <label for="wpd_cf_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1039
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#only-loggedin" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1040
  </td>
1041
  </tr>
1042
+ <tr>
1043
+ <th style="max-width: 350px;">
1044
+ <?php esc_html_e("Hide comment section for roles", "wpdiscuz"); ?>
1045
+ <p class="wpd-info"><?php esc_html_e("This option hides the entire section of comments. Neither the comment form nor the comment list will be visible for selected user roles.", "wpdiscuz"); ?></p>
1046
+ </th>
1047
+ <td>
1048
+ <?php
1049
+ $rolesCannotSeeComments = isset($this->generalOptions["roles_cannot_see_comments"]) ? $this->generalOptions["roles_cannot_see_comments"] : [];
1050
+ foreach ($blogRoles as $role => $info) {
1051
+ if ($role !== "administrator") {
1052
+ ?>
1053
+ <div style="float:<?php echo (is_rtl()) ? 'right' : 'left'; ?>; display:inline-block; padding:3px 5px 3px 7px; min-width:25%;">
1054
+ <input type="checkbox" <?php checked(in_array($role, $rolesCannotSeeComments)); ?> value="<?php echo esc_attr($role); ?>" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[roles_cannot_see_comments][]" id="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>" style="margin:0px; vertical-align: middle;" />
1055
+ <label for="wpd-cannot-see-comments-<?php echo esc_attr($role); ?>" style="white-space:nowrap; font-size:13px;"><?php echo esc_html($info["name"]); ?></label>
1056
+ </div>
1057
+ <?php
1058
+ }
1059
+ }
1060
+ ?>
1061
+ </td>
1062
+ </tr>
1063
+ <tr>
1064
+ <th style="max-width: 350px;">
1065
+ <?php esc_html_e("Allow guests to view comments", "wpdiscuz"); ?>
1066
+ <p class="wpd-info"><?php esc_html_e("If you disable this option, it'll hide the entire section of comments. Neither the comment form nor the comment list will be visible for guests.", "wpdiscuz"); ?></p>
1067
+ </th>
1068
+ <td>
1069
+ <?php $guestCanComment = isset($this->generalOptions["guest_can_see_comments"]) ? $this->generalOptions["guest_can_see_comments"] : 1; ?>
1070
+ <input <?php checked($guestCanComment, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]" value="1" id="wpd_csc_guest_yes" > <label for="wpd_csc_guest_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1071
+ &nbsp;
1072
+ <input <?php checked($guestCanComment, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[guest_can_see_comments]" value="0" id="wpd_csc_guest_no"> <label for="wpd_csc_guest_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1073
+ </td>
1074
+ </tr>
1075
  <tr>
1076
  <th>
1077
+ <?php esc_html_e("Enable subscription bar", "wpdiscuz"); ?>
1078
  </th>
1079
  <td>
1080
+ <?php $showSubscriptionBar = isset($this->generalOptions["show_subscription_bar"]) ? $this->generalOptions["show_subscription_bar"] : 1; ?>
1081
  <input <?php checked($showSubscriptionBar, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="1" id="wpd_cf_sbbar_yes" > <label for="wpd_cf_sbbar_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1082
  &nbsp;
1083
  <input <?php checked($showSubscriptionBar, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_bar]" value="0" id="wpd_cf_sbbar_no"> <label for="wpd_cf_sbbar_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1086
  </tr>
1087
  <tr>
1088
  <th>
1089
+ <?php esc_html_e("Display agreement checkbox in comment Subscription Bar", "wpdiscuz"); ?>
1090
  </th>
1091
  <td>
1092
+ <?php $showSubscriptionAgreement = isset($this->generalOptions["show_subscription_agreement"]) ? $this->generalOptions["show_subscription_agreement"] : 0; ?>
1093
  <input <?php checked($showSubscriptionAgreement, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="1" id="wpd_cf_sbbar_agreement_yes" > <label for="wpd_cf_sbbar_agreement_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1094
  &nbsp;
1095
  <input <?php checked($showSubscriptionAgreement, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[show_subscription_agreement]" value="0" id="wpd_cf_sbbar_agreement_no"> <label for="wpd_cf_sbbar_agreement_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1098
  </tr>
1099
  <tr>
1100
  <th>
1101
+ <?php esc_html_e("Comment Subscription Bar agreement checkbox label", "wpdiscuz"); ?>
1102
  </th>
1103
  <td>
1104
+ <?php $subscriptionAgreementLabel = isset($this->generalOptions["subscription_agreement_label"]) && $this->generalOptions["subscription_agreement_label"] ? $this->generalOptions["subscription_agreement_label"] : esc_html__("I allow to use my email address and send notification about new comments and replies (you can unsubscribe at any time).", "wpdiscuz"); ?>
1105
  <textarea name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[subscription_agreement_label]" style="width:80%;"><?php echo $subscriptionAgreementLabel; ?></textarea>
1106
  </td>
1107
  </tr>
1108
  <tr>
1109
  <th>
1110
+ <?php esc_html_e("Comment form header text (singular)", "wpdiscuz"); ?>
1111
  </th>
1112
  <td >
1113
  <div>
1118
  </tr>
1119
  <tr>
1120
  <th>
1121
+ <?php esc_html_e("Comment form header text (plural)", "wpdiscuz"); ?>
1122
  </th>
1123
  <td >
1124
  <div>
1152
  <span><?php echo esc_html($typeValue); ?></span>
1153
  </label>
1154
  <?php } ?>
1155
+ <?php if ($hasForm) echo $formRelExistsInfo; ?>
1156
  <a href="https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types" title="<?php esc_attr_e("Read the documentation", "wpdiscuz") ?>" target="_blank"><i class="far fa-question-circle"></i></a>
1157
  </td>
1158
  </tr>
1159
  <tr>
1160
  <th>
1161
+ <?php esc_html_e("Display comment form for post IDs", "wpdiscuz"); ?>
1162
  <p class="wpd-info"> <?php esc_html_e("You can use this form for certain posts/pages specified by comma separated IDs.", "wpdiscuz"); ?></p>
1163
  </th>
1164
  <td>
1173
  ?>
1174
  <tr>
1175
  <th>
1176
+ <?php esc_html_e("Theme", "wpdiscuz"); ?>
1177
  </th>
1178
  <td>
1179
  <?php
1192
  ?>
1193
  <tr>
1194
  <th>
1195
+ <?php esc_html_e("Comment List Layout", "wpdiscuz"); ?>
1196
  </th>
1197
  <td>
1198
  <div id="wpd_comment_layouts" style="width: 290px; margin: 15px 0 0 0">
1218
  ?>
1219
  <tr>
1220
  <th>
1221
+ <?php esc_html_e("Enable Post Rating", "wpdiscuz"); ?>
1222
  </th>
1223
  <td>
1224
+ <?php $enablePostRating = isset($this->generalOptions["enable_post_rating"]) ? $this->generalOptions["enable_post_rating"] : 1; ?>
1225
  <input <?php checked($enablePostRating, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="1" id="wpd_enable_post_rating_yes" > <label for="wpd_enable_post_rating_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1226
  &nbsp;
1227
  <input <?php checked($enablePostRating, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[enable_post_rating]" value="0" id="wpd_enable_post_rating_no"> <label for="wpd_enable_post_rating_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1230
  </tr>
1231
  <tr>
1232
  <th>
1233
+ <?php esc_html_e("Post Rating Title", "wpdiscuz"); ?>
1234
  </th>
1235
  <td >
1236
  <div>
1240
  </tr>
1241
  <tr>
1242
  <th>
1243
+ <?php esc_html_e("Allow Guests to Rate", "wpdiscuz"); ?>
1244
  </th>
1245
  <td>
1246
+ <?php $allowGuestsRateOnPost = isset($this->generalOptions["allow_guests_rate_on_post"]) ? $this->generalOptions["allow_guests_rate_on_post"] : 1; ?>
1247
  <input <?php checked($allowGuestsRateOnPost, 1, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="1" id="wpd_allow_guests_rate_on_post_yes" > <label for="wpd_allow_guests_rate_on_post_yes"><?php esc_html_e("Yes", "wpdiscuz"); ?></label>
1248
  &nbsp;
1249
  <input <?php checked($allowGuestsRateOnPost, 0, true); ?> type="radio" name="<?php echo esc_attr(wpdFormConst::WPDISCUZ_META_FORMS_GENERAL_OPTIONS); ?>[allow_guests_rate_on_post]" value="0" id="wpd_allow_guests_rate_on_post_no"> <label for="wpd_allow_guests_rate_on_post_no"><?php esc_html_e("No", "wpdiscuz"); ?></label>
1282
  <?php
1283
  }
1284
 
1285
+ public function isUserCanSeeComments($currentUser, $postId = 0) {
1286
+ global $post;
1287
+ if (!$post) {
1288
+ $post = get_post($postId);
1289
+ }
1290
+ $this->initFormMeta();
1291
+ $this->isUserCanSeeComments = true;
1292
+ if ($currentUser && $currentUser->ID) {
1293
+ if ($post->post_author && $post->post_author != $currentUser->ID && $currentUser->roles && is_array($currentUser->roles)) {
1294
+ $this->generalOptions["roles_cannot_see_comments"] = isset($this->generalOptions["roles_cannot_see_comments"]) ? $this->generalOptions["roles_cannot_see_comments"] : [];
1295
+ foreach ($currentUser->roles as $k => $role) {
1296
+ if (in_array($role, $this->generalOptions["roles_cannot_see_comments"])) {
1297
+ //Filter hook to add extra conditions in user role dependent restriction.
1298
+ $this->isUserCanSeeComments = apply_filters("wpdiscuz_user_role_can_see_comments", false, $role);
1299
+ break;
1300
+ }
1301
+ }
1302
+ }
1303
+ } else {
1304
+ $this->isUserCanSeeComments = $this->generalOptions["guest_can_see_comments"];
1305
+ }
1306
+ return $this->isUserCanSeeComments;
1307
+ }
1308
+
1309
  public function isUserCanComment($currentUser, $postId = 0, &$message = "") {
1310
  global $post;
1311
  if (!$post) {
1317
  if ($post->post_author && $post->post_author != $currentUser->ID && $currentUser->roles && is_array($currentUser->roles)) {
1318
  $postId = $post && isset($post->ID) ? $post->ID : $postId;
1319
  $this->generalOptions["roles_cannot_comment"] = isset($this->generalOptions["roles_cannot_comment"]) ? $this->generalOptions["roles_cannot_comment"] : [];
1320
+ $this->generalOptions["roles_cannot_see_comments"] = isset($this->generalOptions["roles_cannot_see_comments"]) ? $this->generalOptions["roles_cannot_see_comments"] : [];
1321
  foreach ($currentUser->roles as $k => $role) {
1322
+ if (in_array($role, $this->generalOptions["roles_cannot_see_comments"]) || in_array($role, $this->generalOptions["roles_cannot_comment"])) {
1323
  //Filter hook to add extra conditions in user role dependent restriction.
1324
  $user_can_comment = apply_filters("wpdiscuz_user_role_can_comment", false, $role);
1325
  $message = $this->wpdOptions->phrases["wc_roles_cannot_comment_message"];
1328
  }
1329
  }
1330
  } else {
1331
+ $this->generalOptions["guest_can_see_comments"] = isset($this->generalOptions["guest_can_see_comments"]) ? $this->generalOptions["guest_can_see_comments"] : 1;
1332
+ $user_can_comment = $this->generalOptions["guest_can_see_comments"] && $this->generalOptions["guest_can_comment"];
1333
  }
1334
  if ($user_can_comment && class_exists("WooCommerce") && get_post_type($postId) === "product") {
1335
  if (get_option("woocommerce_review_rating_verification_required") === "no" || wc_customer_bought_product("", get_current_user_id(), $postId)) {
includes/interface.WpDiscuzConstants.php CHANGED
@@ -91,6 +91,9 @@ interface WpDiscuzConstants {
91
  const METAKEY_ATTACHMENTS = "wmu_attachments";
92
  const KEY_IMAGES = "images";
93
  const INPUT_NAME = "wmu_files";
 
 
 
94
  /* === POST RATING */
95
  const POSTMETA_POST_RATING = "wpdiscuz_post_rating";
96
  const POSTMETA_POST_RATING_COUNT = "wpdiscuz_post_rating_count";
91
  const METAKEY_ATTACHMENTS = "wmu_attachments";
92
  const KEY_IMAGES = "images";
93
  const INPUT_NAME = "wmu_files";
94
+ const DELETE_UNATTACHED_FILES_ACTION = "wpdiscuz_delete_unattached_images";
95
+ const DELETE_UNATTACHED_FILES_KEY_RECURRENCE = "wpdiscuz_delete_unattached_images_every_48h";
96
+ const DELETE_UNATTACHED_FILES_RECURRENCE = 48;
97
  /* === POST RATING */
98
  const POSTMETA_POST_RATING = "wpdiscuz_post_rating";
99
  const POSTMETA_POST_RATING_COUNT = "wpdiscuz_post_rating_count";
options/class.WpdiscuzOptions.php CHANGED
@@ -3047,7 +3047,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
3047
  $deactivatePlugins = [];
3048
  $adminNotices = [];
3049
  foreach ($plugins as $key => $value) {
3050
- $redpoint = (int) get_option("gvt_product_" . $key . "_redpoint", "1");
3051
  if (!$redpoint) {
3052
  $checkedData[$key] = [
3053
  "last_checked" => $this->getLastCheckedDate(),
@@ -3073,9 +3073,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
3073
  "checked_count" => $checkedData[$key]["checked_count"] + 1,
3074
  "valid" => 0,
3075
  ];
3076
- if (is_null($value["instance"]) || $redpoint) {
3077
- $adminNotices[$key . "_redpoint"] = sprintf(__("Something is wrong with %s addon license and files. Please activate it using its license key. If this addon has not been purchased and downloaded from the official gVectors.com website, it's probably hacked and may lead to lots of security issues.", "wpdiscuz"), $value["name"]);
3078
- }
3079
  $adminNotices[$key] = sprintf(__("%s addon was deactivated, because your license isn't valid.", "wpdiscuz"), $value["name"]);
3080
  }
3081
  } else {
3047
  $deactivatePlugins = [];
3048
  $adminNotices = [];
3049
  foreach ($plugins as $key => $value) {
3050
+ $redpoint = (int) get_option("gvt_product_" . $key . "_redpoint", "0");
3051
  if (!$redpoint) {
3052
  $checkedData[$key] = [
3053
  "last_checked" => $this->getLastCheckedDate(),
3073
  "checked_count" => $checkedData[$key]["checked_count"] + 1,
3074
  "valid" => 0,
3075
  ];
3076
+ $adminNotices[$key . "_redpoint"] = sprintf(__("Something is wrong with %s addon license and files. Please activate it using its license key. If this addon has not been purchased and downloaded from the official gVectors.com website, it's probably hacked and may lead to lots of security issues.", "wpdiscuz"), $value["name"]);
 
 
3077
  $adminNotices[$key] = sprintf(__("%s addon was deactivated, because your license isn't valid.", "wpdiscuz"), $value["name"]);
3078
  }
3079
  } else {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.6
6
- Stable tag: 7.1.0
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -179,6 +179,21 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
179
 
180
  == Changelog ==
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  = Comments - wpDiscuz v7.1.0 =
183
 
184
  * Added: Live removing of moderated comments when the live update is enabled
@@ -192,11 +207,6 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
192
  * Fixed bug: Many small bugs has been fixed
193
 
194
 
195
- **IMPORTANT!**
196
- 1. Please don't forget delete all caches and purge CDN after the update.
197
- 2. If you're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
198
-
199
-
200
  = Comments - wpDiscuz v7.0.10 =
201
 
202
  * Fixed bug: Phrases and translations issues
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.6
6
+ Stable tag: 7.1.1
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
179
 
180
  == Changelog ==
181
 
182
+ = Comments - wpDiscuz v7.1.1 =
183
+
184
+ * Added: Auto-cleanup of orphaned comment attachments
185
+ * Added: Option to hide comments for user roles in comment form settings
186
+ * Added: Option to hide comments for guests in comment form settings
187
+ * Added: All options with color picker are changed to WordPress color picker
188
+ * Added: Filter hook `comments_array` for WPML compatibility.
189
+ * Added: Action hook `wpdiscuz_add_rating` on submitting a new rating
190
+ * Added: Filter hook `wpdiscuz_enable_feedback_shortcode_button` to disable inline comment button from the editor toolbar
191
+
192
+ **IMPORTANT!**
193
+ 1. Please don't forget delete all caches and purge CDN after the update.
194
+ 2. If you're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
195
+
196
+
197
  = Comments - wpDiscuz v7.1.0 =
198
 
199
  * Added: Live removing of moderated comments when the live update is enabled
207
  * Fixed bug: Many small bugs has been fixed
208
 
209
 
 
 
 
 
 
210
  = Comments - wpDiscuz v7.0.10 =
211
 
212
  * Fixed bug: Phrases and translations issues
themes/default/comment-form.php CHANGED
@@ -323,170 +323,171 @@ if (!post_password_required($post->ID)) {
323
 
324
  }
325
  do_action("wpdiscuz_before_comments", $post, $currentUser, $commentsCount);
326
- $wooExists = class_exists("WooCommerce") && get_post_type($post->ID) === "product";
327
- ?>
328
- <div id="wpd-threads" class="wpd-thread-wrapper">
329
- <div class="wpd-thread-head">
330
- <div class="wpd-thread-info <?php echo $wooExists ? "wpd-reviews-tab" : ""; ?>">
331
- <?php
332
- if (!$wooExists) {
333
- echo "<span class='wpdtc' title='" . esc_attr($commentsCount) . "'>" . esc_html($wpdiscuz->helper->getNumber($commentsCount)) . "</span> " . esc_html(1 == $commentsCount ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural());
334
- } else {
335
- echo "<svg id='Capa_1' enable-background='new 0 0 512 512' height='24' viewBox='0 0 512 512' width='24' xmlns='https://www.w3.org/2000/svg'><path d='m144.789 277.138-8.789-17.593-8.789 17.593c-2.183 4.365-6.357 7.397-11.177 8.13l-19.468 2.93 14.019 13.799c3.472 3.413 5.068 8.32 4.263 13.14l-3.223 19.409 17.461-9.067c2.168-1.128 4.541-1.685 6.914-1.685s4.746.557 6.914 1.685l17.461 9.067-3.223-19.409c-.806-4.819.791-9.727 4.263-13.14l14.019-13.799-19.468-2.93c-4.82-.733-8.994-3.765-11.177-8.13z'/><path d='m384.789 277.138-8.789-17.593-8.789 17.593c-2.183 4.365-6.357 7.397-11.177 8.13l-19.468 2.93 14.019 13.799c3.472 3.413 5.068 8.32 4.263 13.14l-3.223 19.409 17.461-9.067c2.168-1.128 4.541-1.685 6.914-1.685s4.746.557 6.914 1.685l17.461 9.067-3.223-19.409c-.806-4.819.791-9.727 4.263-13.14l14.019-13.799-19.468-2.93c-4.82-.733-8.994-3.765-11.177-8.13z'/><path d='m466 121h-125.387l3.864 23.291c2.827 16.904-4.043 33.691-17.944 43.784-14.046 10.247-32.347 11.21-47.139 3.56l-23.394-12.144-23.364 12.129c-14.788 7.63-33.115 6.727-47.227-3.589-13.843-10.049-20.713-26.836-17.886-43.77l3.864-23.261h-125.387c-24.814 0-46 20.186-46 45v240c0 24.814 21.186 45 46 45h164.18l33.105 53.954c2.739 4.38 7.544 7.046 12.715 7.046s9.976-2.666 12.715-7.046l33.105-53.954h164.18c24.814 0 46-20.186 46-45v-240c0-24.814-21.186-45-46-45zm-248.145 167.52-29.839 29.37 6.87 41.323c.938 5.61-1.377 11.25-5.977 14.59-4.492 3.281-10.576 3.851-15.732 1.187l-37.177-19.293-37.178 19.292c-5.054 2.607-11.177 2.153-15.732-1.187-4.6-3.34-6.914-8.979-5.977-14.59l6.87-41.323-29.839-29.37c-4.043-3.999-5.493-9.932-3.735-15.322 1.758-5.405 6.416-9.36 12.026-10.21l41.426-6.226 18.721-37.471c5.068-10.166 21.768-10.166 26.836 0l18.721 37.471 41.426 6.226c5.61.85 10.269 4.805 12.026 10.21 1.758 5.391.307 11.324-3.736 15.323zm240 0-29.839 29.37 6.87 41.323c.938 5.61-1.377 11.25-5.977 14.59-4.492 3.281-10.576 3.851-15.732 1.187l-37.177-19.293-37.178 19.292c-5.054 2.607-11.177 2.153-15.732-1.187-4.6-3.34-6.914-8.979-5.977-14.59l6.87-41.323-29.839-29.37c-4.043-3.999-5.493-9.932-3.735-15.322 1.758-5.405 6.416-9.36 12.026-10.21l41.426-6.226 18.721-37.471c5.068-10.166 21.768-10.166 26.836 0l18.721 37.471 41.426 6.226c5.61.85 10.269 4.805 12.026 10.21 1.758 5.391.307 11.324-3.736 15.323z'/><path d='m341.576 63.183c-1.758-5.391-6.416-9.346-12.026-10.195l-41.411-6.226-18.721-39.137c-5.098-10.166-21.738-10.166-26.836 0l-18.721 39.137-41.411 6.226c-5.61.85-10.269 4.805-12.026 10.195-1.758 5.405-.308 11.338 3.735 15.322l29.824 29.385-6.87 41.323c-.938 5.61 1.377 11.25 5.977 14.59 4.556 3.325 10.679 3.794 15.732 1.187l37.178-19.293 37.178 19.292c5.156 2.664 11.241 2.095 15.732-1.187 4.6-3.34 6.914-8.979 5.977-14.59l-6.87-41.323 29.824-29.385c4.043-3.983 5.493-9.916 3.735-15.321z'/></svg>";
336
- }
337
- ?>
338
- </div>
339
- <?php
340
- if (($wpdiscuz->options->login["showActivityTab"] || $wpdiscuz->options->login["showSubscriptionsTab"] || $wpdiscuz->options->login["showFollowsTab"] || apply_filters("wpdiscuz_enable_content_modal", false)) && $currentUserEmail) {
341
- ?>
342
- <div class="wpdiscuz-user-settings wpd-info wpd-not-clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_content_and_settings"]); ?>" wpd-tooltip-position="right">
343
- <i class="fas fa-user-cog"></i>
344
  </div>
345
  <?php
346
- }
347
- ?>
348
- <div class="wpd-space"></div>
349
- <div class="wpd-thread-filter">
350
- <?php
351
- do_action("wpdiscuz_filtering_buttons", $currentUser, $wpdiscuz->options);
352
- if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->inline["showInlineFilterButton"] && $wpdiscuz->dbManager->postHasFeedbackForms($post->ID)) {
353
- ?>
354
- <div class="wpd-filter wpdf-inline wpd_not_clicked" data-filter-type="inline" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_inline_comments"]); ?>"><i class="fas fa-quote-left"></i></div>
355
- <?php
356
- }
357
- if ($wpdiscuz->options->thread_display["showReactedFilterButton"]) {
358
  ?>
359
- <div class="wpd-filter wpdf-reacted wpd_not_clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_most_reacted_comment"]); ?>"><i class="fas fa-bolt"></i></div>
 
 
360
  <?php
361
  }
362
- if ($wpdiscuz->options->thread_display["showHottestFilterButton"]) {
363
- ?>
364
- <div class="wpd-filter wpdf-hottest wpd_not_clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_hottest_comment_thread"]); ?>"><i class="fas fa-fire"></i></div>
365
  <?php
366
- }
367
- $wpdiscuzCommentsOrder = $wpdiscuz->options->wp["commentOrder"];
368
- if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->thread_display["showSortingButtons"] && $wpdiscuz->options->thread_display["mostVotedByDefault"]) {
369
- $wpdiscuzCommentsOrderBy = "by_vote";
370
- } else {
371
- $wpdiscuzCommentsOrderBy = $wpdiscuz->options->thread_display["orderCommentsBy"];
372
- }
373
- $wpdiscuzCommentsOrderBy = apply_filters("wpdiscuz_comments_order_by", $wpdiscuzCommentsOrderBy);
374
- $wpdiscuzCommentsOrder = apply_filters("wpdiscuz_comments_order", $wpdiscuzCommentsOrder);
375
- if ($commentsCount && $wpdiscuz->options->thread_display["showSortingButtons"] && !$wpdiscuz->options->wp["isPaginate"]) {
376
- $sortingButtons = [
377
- [
378
- "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"],
379
- "order" => "desc",
380
- "class" => "wpdiscuz-date-sort-desc",
381
- "text" => $wpdiscuz->options->phrases["wc_newest"],
382
- "type" => "newest",
383
- ],
384
- [
385
- "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"],
386
- "order" => "asc",
387
- "class" => "wpdiscuz-date-sort-asc",
388
- "text" => $wpdiscuz->options->phrases["wc_oldest"],
389
- "type" => "oldest",
390
- ],
391
- ];
392
- if ($wpdiscuz->options->thread_layouts["showVotingButtons"]) {
393
- $sortingButtons[] = [
394
- "orderBy" => "by_vote",
395
- "order" => $wpdiscuz->options->wp["commentOrder"],
396
- "class" => "wpdiscuz-vote-sort-up",
397
- "text" => $wpdiscuz->options->phrases["wc_most_voted"],
398
- "type" => "by_vote",
399
- ];
400
  }
401
- $sortingButtons = apply_filters("wpdiscuz_sorting_buttons_array", $sortingButtons);
402
- ?>
403
- <div class="wpd-filter wpdf-sorting">
404
  <?php
405
- foreach ($sortingButtons as $key => $value) {
406
- if ($wpdiscuzCommentsOrderBy === $value["orderBy"] && $wpdiscuzCommentsOrder === $value["order"]) {
407
- ?>
408
- <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?> wpdiscuz-sort-button-active" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php echo esc_html($value["text"]); ?></span>
409
- <?php
410
- unset($sortingButtons[$key]);
411
- break;
412
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  }
 
414
  ?>
415
- <i class="fas fa-sort-down"></i>
416
- <div class="wpdiscuz-sort-buttons">
417
  <?php
418
  foreach ($sortingButtons as $key => $value) {
419
- ?>
420
- <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?>" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php echo esc_html($value["text"]); ?></span>
421
- <?php
 
 
 
 
422
  }
423
  ?>
 
 
 
 
 
 
 
 
 
 
424
  </div>
425
- </div>
426
- <?php
427
- }
428
- ?>
429
- </div>
430
- </div>
431
- <div class="wpd-comment-info-bar">
432
- <div class="wpd-current-view"><i class="fas fa-quote-left"></i> <?php echo esc_html($wpdiscuz->options->phrases["wc_inline_feedbacks"]); ?></div>
433
- <div class="wpd-filter-view-all"><?php echo esc_html($wpdiscuz->options->phrases["wc_inline_comments_view_all"]); ?></div>
434
- </div>
435
- <?php do_action("wpdiscuz_before_thread_list", $post, $currentUser, $commentsCount); ?>
436
- <div class="wpd-thread-list">
437
- <?php
438
- if ($wpdiscuz->options->wp["isPaginate"] || !$wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
439
- $args = ["first_load" => 1, "orderby" => $wpdiscuzCommentsOrderBy, "order" => $wpdiscuzCommentsOrder];
440
- $commentData = $wpdiscuz->getWPComments($args);
441
- echo $commentData["comment_list"];
442
- } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"] == 2 && $commentsCount) {
443
- ?>
444
- <div class="wpd-load-more-submit-wrap">
445
- <button name="submit" class="wpd-load-comments wpd-prim-button">
446
- <?php echo esc_html($wpdiscuz->options->phrases["wc_view_comments"]); ?>
447
- </button>
448
  </div>
 
 
 
 
 
 
 
449
  <?php
450
- }
451
- ?>
452
- <div class="wpdiscuz-comment-pagination"<?php echo!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->thread_display["firstLoadWithAjax"] ? " style='display:none;'" : ""; ?>>
453
- <?php
454
- if ($wpdiscuz->options->wp["isPaginate"]) {
455
- paginate_comments_links();
456
- } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
457
- $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->phrases["wc_load_rest_comments_submit_text"] : $wpdiscuz->options->phrases["wc_load_more_submit_text"];
458
- ?>
459
- <div class="wpd-load-more-submit-wrap">
460
- <button name="submit" data-lastparentid="0" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
461
- <?php echo esc_html($loadMoreButtonText); ?>
462
- </button>
463
- </div>
464
- <input id="wpdiscuzHasMoreComments" type="hidden" value="0" />
465
- <?php
466
- } else if ($commentData["is_show_load_more"]) {
467
- $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->phrases["wc_load_rest_comments_submit_text"] : $wpdiscuz->options->phrases["wc_load_more_submit_text"];
468
  ?>
469
  <div class="wpd-load-more-submit-wrap">
470
- <button name="submit" data-lastparentid="<?php echo esc_attr($commentData["last_parent_id"]); ?>" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
471
- <?php echo esc_html($loadMoreButtonText); ?>
472
  </button>
473
  </div>
474
- <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo esc_attr($commentData["is_show_load_more"]); ?>" />
475
  <?php
476
  }
477
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  </div>
479
  </div>
480
- </div>
481
- <?php
482
  do_action("wpdiscuz_after_comments", $post, $currentUser, $commentsCount);
483
  if ($commentsCount) {
484
  if ($wpdiscuz->options->general["showPluginPoweredByLink"]) {
485
  ?>
486
  <div class="by-wpdiscuz">
487
- <span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
488
- document.getElementById("awpdiscuz").style.display = "none";'>
489
- <img alt="wpdiscuz" src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/plugin-icon/icon_info.png")); ?>" align="absmiddle" class="wpdimg"/>
490
  </span>&nbsp;
491
  <a href="https://wpdiscuz.com/" target="_blank" rel='noreferrer' id="bywpdiscuz" title="wpDiscuz v<?php echo esc_attr(get_option(WpdiscuzCore::OPTION_SLUG_VERSION)); ?> - Supercharged native comments">wpDiscuz</a>
492
  </div>
323
 
324
  }
325
  do_action("wpdiscuz_before_comments", $post, $currentUser, $commentsCount);
326
+ if ($form->isUserCanSeeComments($currentUser, $post->ID)) {
327
+ $wooExists = class_exists("WooCommerce") && get_post_type($post->ID) === "product";
328
+ ?>
329
+ <div id="wpd-threads" class="wpd-thread-wrapper">
330
+ <div class="wpd-thread-head">
331
+ <div class="wpd-thread-info <?php echo $wooExists ? "wpd-reviews-tab" : ""; ?>">
332
+ <?php
333
+ if (!$wooExists) {
334
+ echo "<span class='wpdtc' title='" . esc_attr($commentsCount) . "'>" . esc_html($wpdiscuz->helper->getNumber($commentsCount)) . "</span> " . esc_html(1 == $commentsCount ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural());
335
+ } else {
336
+ echo "<svg id='Capa_1' enable-background='new 0 0 512 512' height='24' viewBox='0 0 512 512' width='24' xmlns='https://www.w3.org/2000/svg'><path d='m144.789 277.138-8.789-17.593-8.789 17.593c-2.183 4.365-6.357 7.397-11.177 8.13l-19.468 2.93 14.019 13.799c3.472 3.413 5.068 8.32 4.263 13.14l-3.223 19.409 17.461-9.067c2.168-1.128 4.541-1.685 6.914-1.685s4.746.557 6.914 1.685l17.461 9.067-3.223-19.409c-.806-4.819.791-9.727 4.263-13.14l14.019-13.799-19.468-2.93c-4.82-.733-8.994-3.765-11.177-8.13z'/><path d='m384.789 277.138-8.789-17.593-8.789 17.593c-2.183 4.365-6.357 7.397-11.177 8.13l-19.468 2.93 14.019 13.799c3.472 3.413 5.068 8.32 4.263 13.14l-3.223 19.409 17.461-9.067c2.168-1.128 4.541-1.685 6.914-1.685s4.746.557 6.914 1.685l17.461 9.067-3.223-19.409c-.806-4.819.791-9.727 4.263-13.14l14.019-13.799-19.468-2.93c-4.82-.733-8.994-3.765-11.177-8.13z'/><path d='m466 121h-125.387l3.864 23.291c2.827 16.904-4.043 33.691-17.944 43.784-14.046 10.247-32.347 11.21-47.139 3.56l-23.394-12.144-23.364 12.129c-14.788 7.63-33.115 6.727-47.227-3.589-13.843-10.049-20.713-26.836-17.886-43.77l3.864-23.261h-125.387c-24.814 0-46 20.186-46 45v240c0 24.814 21.186 45 46 45h164.18l33.105 53.954c2.739 4.38 7.544 7.046 12.715 7.046s9.976-2.666 12.715-7.046l33.105-53.954h164.18c24.814 0 46-20.186 46-45v-240c0-24.814-21.186-45-46-45zm-248.145 167.52-29.839 29.37 6.87 41.323c.938 5.61-1.377 11.25-5.977 14.59-4.492 3.281-10.576 3.851-15.732 1.187l-37.177-19.293-37.178 19.292c-5.054 2.607-11.177 2.153-15.732-1.187-4.6-3.34-6.914-8.979-5.977-14.59l6.87-41.323-29.839-29.37c-4.043-3.999-5.493-9.932-3.735-15.322 1.758-5.405 6.416-9.36 12.026-10.21l41.426-6.226 18.721-37.471c5.068-10.166 21.768-10.166 26.836 0l18.721 37.471 41.426 6.226c5.61.85 10.269 4.805 12.026 10.21 1.758 5.391.307 11.324-3.736 15.323zm240 0-29.839 29.37 6.87 41.323c.938 5.61-1.377 11.25-5.977 14.59-4.492 3.281-10.576 3.851-15.732 1.187l-37.177-19.293-37.178 19.292c-5.054 2.607-11.177 2.153-15.732-1.187-4.6-3.34-6.914-8.979-5.977-14.59l6.87-41.323-29.839-29.37c-4.043-3.999-5.493-9.932-3.735-15.322 1.758-5.405 6.416-9.36 12.026-10.21l41.426-6.226 18.721-37.471c5.068-10.166 21.768-10.166 26.836 0l18.721 37.471 41.426 6.226c5.61.85 10.269 4.805 12.026 10.21 1.758 5.391.307 11.324-3.736 15.323z'/><path d='m341.576 63.183c-1.758-5.391-6.416-9.346-12.026-10.195l-41.411-6.226-18.721-39.137c-5.098-10.166-21.738-10.166-26.836 0l-18.721 39.137-41.411 6.226c-5.61.85-10.269 4.805-12.026 10.195-1.758 5.405-.308 11.338 3.735 15.322l29.824 29.385-6.87 41.323c-.938 5.61 1.377 11.25 5.977 14.59 4.556 3.325 10.679 3.794 15.732 1.187l37.178-19.293 37.178 19.292c5.156 2.664 11.241 2.095 15.732-1.187 4.6-3.34 6.914-8.979 5.977-14.59l-6.87-41.323 29.824-29.385c4.043-3.983 5.493-9.916 3.735-15.321z'/></svg>";
337
+ }
338
+ ?>
 
 
 
 
 
339
  </div>
340
  <?php
341
+ if (($wpdiscuz->options->login["showActivityTab"] || $wpdiscuz->options->login["showSubscriptionsTab"] || $wpdiscuz->options->login["showFollowsTab"] || apply_filters("wpdiscuz_enable_content_modal", false)) && $currentUserEmail) {
 
 
 
 
 
 
 
 
 
 
 
342
  ?>
343
+ <div class="wpdiscuz-user-settings wpd-info wpd-not-clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_content_and_settings"]); ?>" wpd-tooltip-position="right">
344
+ <i class="fas fa-user-cog"></i>
345
+ </div>
346
  <?php
347
  }
348
+ ?>
349
+ <div class="wpd-space"></div>
350
+ <div class="wpd-thread-filter">
351
  <?php
352
+ do_action("wpdiscuz_filtering_buttons", $currentUser, $wpdiscuz->options);
353
+ if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->inline["showInlineFilterButton"] && $wpdiscuz->dbManager->postHasFeedbackForms($post->ID)) {
354
+ ?>
355
+ <div class="wpd-filter wpdf-inline wpd_not_clicked" data-filter-type="inline" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_inline_comments"]); ?>"><i class="fas fa-quote-left"></i></div>
356
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  }
358
+ if ($wpdiscuz->options->thread_display["showReactedFilterButton"]) {
359
+ ?>
360
+ <div class="wpd-filter wpdf-reacted wpd_not_clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_most_reacted_comment"]); ?>"><i class="fas fa-bolt"></i></div>
361
  <?php
362
+ }
363
+ if ($wpdiscuz->options->thread_display["showHottestFilterButton"]) {
364
+ ?>
365
+ <div class="wpd-filter wpdf-hottest wpd_not_clicked" wpd-tooltip="<?php echo esc_attr($wpdiscuz->options->phrases["wc_hottest_comment_thread"]); ?>"><i class="fas fa-fire"></i></div>
366
+ <?php
367
+ }
368
+ $wpdiscuzCommentsOrder = $wpdiscuz->options->wp["commentOrder"];
369
+ if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->thread_display["showSortingButtons"] && $wpdiscuz->options->thread_display["mostVotedByDefault"]) {
370
+ $wpdiscuzCommentsOrderBy = "by_vote";
371
+ } else {
372
+ $wpdiscuzCommentsOrderBy = $wpdiscuz->options->thread_display["orderCommentsBy"];
373
+ }
374
+ $wpdiscuzCommentsOrderBy = apply_filters("wpdiscuz_comments_order_by", $wpdiscuzCommentsOrderBy);
375
+ $wpdiscuzCommentsOrder = apply_filters("wpdiscuz_comments_order", $wpdiscuzCommentsOrder);
376
+ if ($commentsCount && $wpdiscuz->options->thread_display["showSortingButtons"] && !$wpdiscuz->options->wp["isPaginate"]) {
377
+ $sortingButtons = [
378
+ [
379
+ "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"],
380
+ "order" => "desc",
381
+ "class" => "wpdiscuz-date-sort-desc",
382
+ "text" => $wpdiscuz->options->phrases["wc_newest"],
383
+ "type" => "newest",
384
+ ],
385
+ [
386
+ "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"],
387
+ "order" => "asc",
388
+ "class" => "wpdiscuz-date-sort-asc",
389
+ "text" => $wpdiscuz->options->phrases["wc_oldest"],
390
+ "type" => "oldest",
391
+ ],
392
+ ];
393
+ if ($wpdiscuz->options->thread_layouts["showVotingButtons"]) {
394
+ $sortingButtons[] = [
395
+ "orderBy" => "by_vote",
396
+ "order" => $wpdiscuz->options->wp["commentOrder"],
397
+ "class" => "wpdiscuz-vote-sort-up",
398
+ "text" => $wpdiscuz->options->phrases["wc_most_voted"],
399
+ "type" => "by_vote",
400
+ ];
401
  }
402
+ $sortingButtons = apply_filters("wpdiscuz_sorting_buttons_array", $sortingButtons);
403
  ?>
404
+ <div class="wpd-filter wpdf-sorting">
 
405
  <?php
406
  foreach ($sortingButtons as $key => $value) {
407
+ if ($wpdiscuzCommentsOrderBy === $value["orderBy"] && $wpdiscuzCommentsOrder === $value["order"]) {
408
+ ?>
409
+ <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?> wpdiscuz-sort-button-active" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php echo esc_html($value["text"]); ?></span>
410
+ <?php
411
+ unset($sortingButtons[$key]);
412
+ break;
413
+ }
414
  }
415
  ?>
416
+ <i class="fas fa-sort-down"></i>
417
+ <div class="wpdiscuz-sort-buttons">
418
+ <?php
419
+ foreach ($sortingButtons as $key => $value) {
420
+ ?>
421
+ <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?>" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php echo esc_html($value["text"]); ?></span>
422
+ <?php
423
+ }
424
+ ?>
425
+ </div>
426
  </div>
427
+ <?php
428
+ }
429
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  </div>
431
+ </div>
432
+ <div class="wpd-comment-info-bar">
433
+ <div class="wpd-current-view"><i class="fas fa-quote-left"></i> <?php echo esc_html($wpdiscuz->options->phrases["wc_inline_feedbacks"]); ?></div>
434
+ <div class="wpd-filter-view-all"><?php echo esc_html($wpdiscuz->options->phrases["wc_inline_comments_view_all"]); ?></div>
435
+ </div>
436
+ <?php do_action("wpdiscuz_before_thread_list", $post, $currentUser, $commentsCount); ?>
437
+ <div class="wpd-thread-list">
438
  <?php
439
+ if ($wpdiscuz->options->wp["isPaginate"] || !$wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
440
+ $args = ["first_load" => 1, "orderby" => $wpdiscuzCommentsOrderBy, "order" => $wpdiscuzCommentsOrder];
441
+ $commentData = $wpdiscuz->getWPComments($args);
442
+ echo $commentData["comment_list"];
443
+ } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"] == 2 && $commentsCount) {
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  ?>
445
  <div class="wpd-load-more-submit-wrap">
446
+ <button name="submit" class="wpd-load-comments wpd-prim-button">
447
+ <?php echo esc_html($wpdiscuz->options->phrases["wc_view_comments"]); ?>
448
  </button>
449
  </div>
 
450
  <?php
451
  }
452
  ?>
453
+ <div class="wpdiscuz-comment-pagination"<?php echo!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->thread_display["firstLoadWithAjax"] ? " style='display:none;'" : ""; ?>>
454
+ <?php
455
+ if ($wpdiscuz->options->wp["isPaginate"]) {
456
+ paginate_comments_links();
457
+ } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
458
+ $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->phrases["wc_load_rest_comments_submit_text"] : $wpdiscuz->options->phrases["wc_load_more_submit_text"];
459
+ ?>
460
+ <div class="wpd-load-more-submit-wrap">
461
+ <button name="submit" data-lastparentid="0" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
462
+ <?php echo esc_html($loadMoreButtonText); ?>
463
+ </button>
464
+ </div>
465
+ <input id="wpdiscuzHasMoreComments" type="hidden" value="0" />
466
+ <?php
467
+ } else if ($commentData["is_show_load_more"]) {
468
+ $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->phrases["wc_load_rest_comments_submit_text"] : $wpdiscuz->options->phrases["wc_load_more_submit_text"];
469
+ ?>
470
+ <div class="wpd-load-more-submit-wrap">
471
+ <button name="submit" data-lastparentid="<?php echo esc_attr($commentData["last_parent_id"]); ?>" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
472
+ <?php echo esc_html($loadMoreButtonText); ?>
473
+ </button>
474
+ </div>
475
+ <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo esc_attr($commentData["is_show_load_more"]); ?>" />
476
+ <?php
477
+ }
478
+ ?>
479
+ </div>
480
  </div>
481
  </div>
482
+ <?php
483
+ }
484
  do_action("wpdiscuz_after_comments", $post, $currentUser, $commentsCount);
485
  if ($commentsCount) {
486
  if ($wpdiscuz->options->general["showPluginPoweredByLink"]) {
487
  ?>
488
  <div class="by-wpdiscuz">
489
+ <span id="awpdiscuz" onclick='document.getElementById("bywpdiscuz").style.display = "inline"; document.getElementById("awpdiscuz").style.display = "none";'>
490
+ <img alt="wpdiscuz" src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/plugin-icon/icon_info.png")); ?>" align="absmiddle" class="wpdimg"/>
 
491
  </span>&nbsp;
492
  <a href="https://wpdiscuz.com/" target="_blank" rel='noreferrer' id="bywpdiscuz" title="wpDiscuz v<?php echo esc_attr(get_option(WpdiscuzCore::OPTION_SLUG_VERSION)); ?> - Supercharged native comments">wpDiscuz</a>
493
  </div>
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -599,24 +599,31 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
599
  if ($commentId) {
600
  $comment = get_comment($commentId);
601
  $form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
602
- $commentContent = $this->helper->filterCommentText($comment->comment_content);
603
- if ($this->options->content["enableImageConversion"]) {
604
- $commentContent = $this->helper->makeClickable($commentContent);
605
- }
606
- $commentContent = apply_filters("comment_text", $commentContent, $comment, ["is_wpdiscuz_comment" => true]);
607
- $commentContent = apply_filters("wpdiscuz_after_read_more", $commentContent, $comment, ["is_wpdiscuz_comment" => true]);
608
- $inlineContent = "";
609
- if ($inlineFormID = intval(get_comment_meta($comment->comment_ID, self::META_KEY_FEEDBACK_FORM_ID, true))) {
610
- $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
611
- $inlineContent = "<div class='wpd-inline-feedback-wrapper'><span class='wpd-inline-feedback-info'>" . esc_html($this->options->phrases["wc_feedback_content_text"]) . "</span> <i class=\"fas fa-quote-left\"></i>" . wp_trim_words($feedbackForm->content, apply_filters("wpdiscuz_feedback_content_words_count", 20)) . "&quot; <a class='wpd-feedback-content-link' data-feedback-content-id='{$feedbackForm->id}' href='#wpd-inline-{$feedbackForm->id}'>" . esc_html($this->options->phrases["wc_read_more"]) . "</a></div>";
612
- }
613
- $components = $this->helper->getComponents($form->getTheme(), $form->getLayout());
614
- $response = [
615
- "message" => str_replace(["{TEXT_WRAPPER_CLASSES}", "{TEXT}"], ["wpd-comment-text", $inlineContent . $commentContent], $components["text.html"]),
616
- "callbackFunctions" => [],
617
- ];
618
- $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
619
- wp_send_json_success($response);
 
 
 
 
 
 
 
620
  } else {
621
  wp_send_json_error("error");
622
  }
@@ -742,31 +749,33 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
742
 
743
  public function getInlineCommentForm() {
744
  $post_id = !empty($_POST["postId"]) ? intval($_POST["postId"]) : 0;
745
- if ($post_id && $this->dbManager->postHasFeedbackForms($post_id)) {
746
- $response = "<div class='wpd-inline-form'>";
747
- $response .= "<form method='post' class='wpd_inline_comm_form' autocomplete='off'>";
748
- $response .= "<textarea name='wpd_inline_comment' class='wpd-inline-comment-content' placeholder='" . esc_attr($this->options->phrases["wc_inline_form_comment"]) . "' required='required'></textarea>";
749
- $response .= "<label class='wpd-inline-notification'><input name='wpd_inline_notify_me' class='wpd-inline-notify-me' type='checkbox' value='1' />&nbsp;" . esc_html($this->options->phrases["wc_inline_form_notify"]) . '</label>';
750
- $response .= "<div class='wpd-inline-form-second-row'>";
751
  $currentUser = WpdiscuzHelper::getCurrentUser();
752
- if (empty($currentUser->ID)) {
753
- $response .= "<input name='wpd_inline_name' class='wpd-inline-name-input' placeholder='" . esc_html($this->options->phrases["wc_inline_form_name"]) . "' required='required' />";
754
- $response .= "<input name='wpd_inline_email' class='wpd-inline-name-input' placeholder='" . esc_html($this->options->phrases["wc_inline_form_email"]) . "' />";
755
- }
756
- $response .= "<button class='wpd-inline-submit wpd_not_clicked' type='submit' name='wpd_inline_submit'><span>" . esc_html($this->options->phrases["wc_inline_form_comment_button"]) . "</span><svg xmlns='https://www.w3.org/2000/svg' class='wpd-inline-submit-icon' width='24' height='24' viewBox='0 0 24 24'><path class='wpd-inline-submit-icon-first' d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/><path class='wpd-inline-submit-icon-second' d='M0 0h24v24H0z'/></svg></button>";
757
- $response .= "</div>";
758
- $response .= apply_filters("wpdiscuz_after_feedback_form_fields", "", $post_id);
759
- $response .= wp_nonce_field("wpd_inline_nonce_" . $post_id, "_wpd_inline_nonce", false, false);
760
- $response .= "</form>";
761
- $response .= "</div>";
762
- wp_send_json_success($response);
 
 
 
 
 
 
 
 
763
  }
764
- wp_send_json_error("wc_msg_required_fields");
765
  }
766
 
767
  public function getLastInlineComments() {
768
  $inline_form_id = !empty($_POST["inline_form_id"]) ? intval($_POST["inline_form_id"]) : 0;
769
- if ($inline_form_id && ($inline_form = $this->dbManager->getFeedbackForm($inline_form_id))) {
770
  $args = [
771
  "orderby" => $this->options->thread_display["orderCommentsBy"],
772
  "order" => "DESC",
@@ -849,6 +858,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
849
  $count = count($data);
850
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
851
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
 
852
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
853
  wp_send_json_success();
854
  } else {
@@ -866,6 +876,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
866
  $count = count($data);
867
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
868
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
 
869
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
870
  wp_send_json_success();
871
  } else {
599
  if ($commentId) {
600
  $comment = get_comment($commentId);
601
  $form = $this->wpdiscuzForm->getForm($comment->comment_post_ID);
602
+ if ($form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $comment->comment_post_ID)) {
603
+ $commentContent = $this->helper->filterCommentText($comment->comment_content);
604
+ if ($this->options->content["enableImageConversion"]) {
605
+ $commentContent = $this->helper->makeClickable($commentContent);
606
+ }
607
+ $commentContent = apply_filters("comment_text", $commentContent, $comment, ["is_wpdiscuz_comment" => true]);
608
+ $commentContent = apply_filters("wpdiscuz_after_read_more", $commentContent, $comment, ["is_wpdiscuz_comment" => true]);
609
+ $inlineContent = "";
610
+ if ($inlineFormID = intval(get_comment_meta($comment->comment_ID, self::META_KEY_FEEDBACK_FORM_ID, true))) {
611
+ $feedbackForm = $this->dbManager->getFeedbackForm($inlineFormID);
612
+ $inlineContent = "<div class='wpd-inline-feedback-wrapper'><span class='wpd-inline-feedback-info'>" . esc_html($this->options->phrases["wc_feedback_content_text"]) . "</span> <i class=\"fas fa-quote-left\"></i>" . wp_trim_words($feedbackForm->content, apply_filters("wpdiscuz_feedback_content_words_count", 20)) . "&quot; <a class='wpd-feedback-content-link' data-feedback-content-id='{$feedbackForm->id}' href='#wpd-inline-{$feedbackForm->id}'>" . esc_html($this->options->phrases["wc_read_more"]) . "</a></div>";
613
+ }
614
+ $components = $this->helper->getComponents($form->getTheme(), $form->getLayout());
615
+ $response = [
616
+ "message" => str_replace(["{TEXT_WRAPPER_CLASSES}", "{TEXT}"], [
617
+ "wpd-comment-text",
618
+ $inlineContent . $commentContent
619
+ ], $components["text.html"]),
620
+ "callbackFunctions" => [],
621
+ ];
622
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
623
+ wp_send_json_success($response);
624
+ } else {
625
+ wp_send_json_error("error");
626
+ }
627
  } else {
628
  wp_send_json_error("error");
629
  }
749
 
750
  public function getInlineCommentForm() {
751
  $post_id = !empty($_POST["postId"]) ? intval($_POST["postId"]) : 0;
752
+ if ($post_id && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && $this->dbManager->postHasFeedbackForms($post_id)) {
 
 
 
 
 
753
  $currentUser = WpdiscuzHelper::getCurrentUser();
754
+ $form = $this->wpdiscuzForm->getForm($post_id);
755
+ if ($form->isUserCanComment($currentUser, $post_id)) {
756
+ $response = "<div class='wpd-inline-form'>";
757
+ $response .= "<form method='post' class='wpd_inline_comm_form' autocomplete='off'>";
758
+ $response .= "<textarea name='wpd_inline_comment' class='wpd-inline-comment-content' placeholder='" . esc_attr($this->options->phrases["wc_inline_form_comment"]) . "' required='required'></textarea>";
759
+ $response .= "<label class='wpd-inline-notification'><input name='wpd_inline_notify_me' class='wpd-inline-notify-me' type='checkbox' value='1' />&nbsp;" . esc_html($this->options->phrases["wc_inline_form_notify"]) . '</label>';
760
+ $response .= "<div class='wpd-inline-form-second-row'>";
761
+ if (empty($currentUser->ID)) {
762
+ $response .= "<input name='wpd_inline_name' class='wpd-inline-name-input' placeholder='" . esc_html($this->options->phrases["wc_inline_form_name"]) . "' required='required' />";
763
+ $response .= "<input name='wpd_inline_email' class='wpd-inline-name-input' placeholder='" . esc_html($this->options->phrases["wc_inline_form_email"]) . "' />";
764
+ }
765
+ $response .= "<button class='wpd-inline-submit wpd_not_clicked' type='submit' name='wpd_inline_submit'><span>" . esc_html($this->options->phrases["wc_inline_form_comment_button"]) . "</span><svg xmlns='https://www.w3.org/2000/svg' class='wpd-inline-submit-icon' width='24' height='24' viewBox='0 0 24 24'><path class='wpd-inline-submit-icon-first' d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/><path class='wpd-inline-submit-icon-second' d='M0 0h24v24H0z'/></svg></button>";
766
+ $response .= "</div>";
767
+ $response .= apply_filters("wpdiscuz_after_feedback_form_fields", "", $post_id);
768
+ $response .= wp_nonce_field("wpd_inline_nonce_" . $post_id, "_wpd_inline_nonce", false, false);
769
+ $response .= "</form>";
770
+ $response .= "</div>";
771
+ wp_send_json_success($response);
772
+ }
773
  }
 
774
  }
775
 
776
  public function getLastInlineComments() {
777
  $inline_form_id = !empty($_POST["inline_form_id"]) ? intval($_POST["inline_form_id"]) : 0;
778
+ if ($inline_form_id && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && ($inline_form = $this->dbManager->getFeedbackForm($inline_form_id))) {
779
  $args = [
780
  "orderby" => $this->options->thread_display["orderCommentsBy"],
781
  "order" => "DESC",
858
  $count = count($data);
859
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
860
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
861
+ do_action("wpdiscuz_add_rating", $rating, $post_id);
862
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
863
  wp_send_json_success();
864
  } else {
876
  $count = count($data);
877
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
878
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
879
+ do_action("wpdiscuz_add_rating", $rating, $post_id);
880
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
881
  wp_send_json_success();
882
  } else {
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -51,6 +51,8 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
51
 
52
  add_filter("wpdiscuz_privacy_personal_data_export", [&$this, "exportPersonalData"], 10, 2);
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
 
 
54
  }
55
  }
56
 
@@ -787,4 +789,29 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
787
  return $data;
788
  }
789
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
790
  }
51
 
52
  add_filter("wpdiscuz_privacy_personal_data_export", [&$this, "exportPersonalData"], 10, 2);
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
54
+
55
+ add_action(self::DELETE_UNATTACHED_FILES_ACTION, [&$this, "deleteUnattachedFiles"]);
56
  }
57
  }
58
 
789
  return $data;
790
  }
791
 
792
+
793
+ public function deleteUnattachedFiles() {
794
+ $attachments = get_posts([
795
+ "post_type" => "attachment",
796
+ "posts_per_page" => apply_filters("wpdiscuz_delete_unattached_files_limit", 20),
797
+ "date_query" => [
798
+ [
799
+ "column" => "post_date_gmt",
800
+ "before" => "30 minutes ago",
801
+ ],
802
+ ],
803
+ "meta_query" => [
804
+ [
805
+ "key" => self::METAKEY_ATTCHMENT_COMMENT_ID,
806
+ "value" => "0",
807
+ "compare" => "=",
808
+ ],
809
+ ],
810
+ "fields" => "ids",
811
+ ]);
812
+ foreach ($attachments as $key => $attachment) {
813
+ wp_delete_attachment($attachment, true);
814
+ }
815
+ }
816
+
817
  }