Comments – wpDiscuz - Version 7.3.8

Version Description

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.3.8
Comparing to
See all releases

Code changes from version 7.3.7 to 7.3.8

assets/addons/notifications/header-off.png ADDED
Binary file
assets/addons/notifications/header.png ADDED
Binary file
assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,7 +3,7 @@
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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
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&&document.querySelector(".wpdiscuz-textarea-wrap"))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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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 [data-wpd-clipboard]",function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),P=e("#wpdcom").width();P>=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%"})),P>=940&&P<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%"})),P>=810&&P<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%"})),P>=730&&P<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%"})),P>=610&&P<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%"})),q>650&&(P>=510&&P<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"})),P>=470&&P<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"})),P<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,7 +7,7 @@
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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
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&&document.querySelector(".wpdiscuz-textarea-wrap"))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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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 [data-wpd-clipboard]",function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),P=e("#wpdcom").width();P>=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%"})),P>=940&&P<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%"})),P>=810&&P<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%"})),P>=730&&P<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%"})),P>=610&&P<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%"})),q>650&&(P>=510&&P<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"})),P>=470&&P<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"})),P<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
assets/js/wpdiscuz.js CHANGED
@@ -1,6 +1,6 @@
1
  ;
2
  var wpdiscuzLoadRichEditor = parseInt(wpdiscuzAjaxObj.loadRichEditor);
3
- if (wpdiscuzLoadRichEditor) {
4
  var wpDiscuzEditor = new WpdEditor();
5
  }
6
 
@@ -132,7 +132,7 @@ jQuery(document).ready(function ($) {
132
  window.addEventListener('beforeunload', function (e) {
133
  var forms = $('.wpd-form').not(':hidden');
134
  if (forms.length) {
135
- if (wpdiscuzLoadRichEditor) {
136
  for (var i = 0; i < forms.length; i++) {
137
  if (wpDiscuzEditor.createEditor($(forms[i]).find('.ql-container').attr('id')).getText() !== '\n') {
138
  e.preventDefault();
@@ -225,8 +225,8 @@ jQuery(document).ready(function ($) {
225
  generateReCaptcha(uniqueID);
226
  });
227
 
228
- $(document).on('click', '#wpdcom .wpd-comment-link [data-comment-url]', function () {
229
- var val = $(this).data('comment-url');
230
  var el = $('<input/>');
231
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
232
  el.trigger('select');
@@ -234,6 +234,7 @@ jQuery(document).ready(function ($) {
234
  el.remove();
235
  wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
236
  });
 
237
 
238
  $(document).on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function (e) {
239
  e.preventDefault();
@@ -1863,8 +1864,10 @@ jQuery(document).ready(function ($) {
1863
  }
1864
  r.all_comments_count = parseInt(r.all_comments_count);
1865
  $('#wpd-bubble-all-comments-count').replaceWith(r.all_comments_count_bubble_html);
1866
- $('.wpd-thread-info').html(r.all_comments_count_before_threads_html);
1867
- $('.wpd-thread-info').attr('data-comments-count', r.all_comments_count);
 
 
1868
  } else {
1869
  console.log(r);
1870
  }
@@ -2258,7 +2261,7 @@ jQuery(document).ready(function ($) {
2258
  };
2259
 
2260
  function runCallbacks(r, commentID, voteType, wcForm) {
2261
- if (r.data.callbackFunctions) {
2262
  $.each(r.data.callbackFunctions, function (i) {
2263
  if (typeof wpdiscuzAjaxObj[r.data.callbackFunctions[i]] === "function") {
2264
  wpdiscuzAjaxObj[r.data.callbackFunctions[i]](r, commentID, voteType, wcForm);
@@ -2303,25 +2306,27 @@ jQuery(document).ready(function ($) {
2303
 
2304
  wpdiscuzAjaxObj.getAjaxObj = getAjaxObj;
2305
  wpdiscuzAjaxObj.initNonce = initNonce;
2306
-
2307
  initNonce();
2308
-
2309
- function initNonce(){
2310
- var data = new FormData();
2311
- data.append('action', 'wpdGetNonce');
2312
- getAjaxObj(isNativeAjaxEnabled, false, data).done(function (r) {
2313
- if (typeof r === 'object') {
2314
- if (r.success) {
2315
- wpdiscuzAjaxObj.wpdiscuz_nonce = r.data;
 
 
 
 
2316
  } else {
2317
- wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2318
  }
2319
- } else {
2320
- console.log(r);
2321
- }
2322
- }).fail(function (jqXHR, textStatus, errorThrown) {
2323
- console.log(errorThrown);
2324
- });
2325
  }
2326
 
2327
  });
1
  ;
2
  var wpdiscuzLoadRichEditor = parseInt(wpdiscuzAjaxObj.loadRichEditor);
3
+ if (wpdiscuzLoadRichEditor && document.querySelector('.wpdiscuz-textarea-wrap')) {
4
  var wpDiscuzEditor = new WpdEditor();
5
  }
6
 
132
  window.addEventListener('beforeunload', function (e) {
133
  var forms = $('.wpd-form').not(':hidden');
134
  if (forms.length) {
135
+ if (wpdiscuzLoadRichEditor && document.querySelector('.wpdiscuz-textarea-wrap')) {
136
  for (var i = 0; i < forms.length; i++) {
137
  if (wpDiscuzEditor.createEditor($(forms[i]).find('.ql-container').attr('id')).getText() !== '\n') {
138
  e.preventDefault();
225
  generateReCaptcha(uniqueID);
226
  });
227
 
228
+ $(document).on('click', '#wpdcom [data-wpd-clipboard]', function () {
229
+ var val = $(this).data('wpd-clipboard');
230
  var el = $('<input/>');
231
  el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
232
  el.trigger('select');
234
  el.remove();
235
  wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
236
  });
237
+
238
 
239
  $(document).on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function (e) {
240
  e.preventDefault();
1864
  }
1865
  r.all_comments_count = parseInt(r.all_comments_count);
1866
  $('#wpd-bubble-all-comments-count').replaceWith(r.all_comments_count_bubble_html);
1867
+ if (!$('.wpd-reviews-tab').length) {
1868
+ $('.wpd-thread-info').html(r.all_comments_count_before_threads_html);
1869
+ $('.wpd-thread-info').attr('data-comments-count', r.all_comments_count);
1870
+ }
1871
  } else {
1872
  console.log(r);
1873
  }
2261
  };
2262
 
2263
  function runCallbacks(r, commentID, voteType, wcForm) {
2264
+ if (r.data.callbackFunctions) {
2265
  $.each(r.data.callbackFunctions, function (i) {
2266
  if (typeof wpdiscuzAjaxObj[r.data.callbackFunctions[i]] === "function") {
2267
  wpdiscuzAjaxObj[r.data.callbackFunctions[i]](r, commentID, voteType, wcForm);
2306
 
2307
  wpdiscuzAjaxObj.getAjaxObj = getAjaxObj;
2308
  wpdiscuzAjaxObj.initNonce = initNonce;
2309
+
2310
  initNonce();
2311
+
2312
+ function initNonce() {
2313
+ if (isUserLoggedIn || wpdiscuzAjaxObj.validateNonceForGuests) {
2314
+ var data = new FormData();
2315
+ data.append('action', 'wpdGetNonce');
2316
+ getAjaxObj(isNativeAjaxEnabled, false, data).done(function (r) {
2317
+ if (typeof r === 'object') {
2318
+ if (r.success) {
2319
+ wpdiscuzAjaxObj.wpdiscuz_nonce = r.data;
2320
+ } else {
2321
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2322
+ }
2323
  } else {
2324
+ console.log(r);
2325
  }
2326
+ }).fail(function (jqXHR, textStatus, errorThrown) {
2327
+ console.log(errorThrown);
2328
+ });
2329
+ }
 
 
2330
  }
2331
 
2332
  });
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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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&&document.querySelector(".wpdiscuz-textarea-wrap"))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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=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 a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});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 a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,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=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){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 [data-wpd-clipboard]",function(){var t=e(this).data("wpd-clipboard"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.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 a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.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(j)}),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 a=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,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),P=e("#wpdcom").width();P>=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%"})),P>=940&&P<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%"})),P>=810&&P<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%"})),P>=730&&P<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%"})),P>=610&&P<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%"})),q>650&&(P>=510&&P<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"})),P>=470&&P<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"})),P<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.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),fe(v,!0,t)}}(a),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),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),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 a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.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",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.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(a)}(t),e.each(o,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 ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(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,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,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 a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!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-"+o)),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-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));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-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));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.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){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 o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.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(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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 a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,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 a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),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"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!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}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.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")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count))}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).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"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.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"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"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 we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){if(t||wpdiscuzAjaxObj.validateNonceForGuests){var e=new FormData;e.append("action","wpdGetNonce"),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.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 a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),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"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){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())}),fe(v,!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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).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),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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")}};
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.3.7
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -317,6 +317,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
317
  $isAnonymous = false;
318
  $uniqueId = trim(WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuz_unique_id", FILTER_SANITIZE_STRING, ""));
319
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
 
320
  $comment_content = isset($_POST["wc_comment"]) ? $_POST["wc_comment"] : "";
321
 
322
  if ($uniqueId && $postId && $comment_content) {
@@ -468,6 +469,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
468
  $response["message"] = wp_unslash($response["message"]);
469
  do_action("wpdiscuz_after_comment_post", $newComment, $currentUser);
470
  $response["callbackFunctions"] = [];
 
471
  $response = apply_filters("wpdiscuz_comment_post", $response);
472
  do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
473
  wp_send_json_success($response);
@@ -1164,6 +1166,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1164
  $this->wpdiscuzOptionsJs["customAjaxUrl"] = plugins_url(WPDISCUZ_DIR_NAME . "/utils/ajax/wpdiscuz-ajax.php");
1165
  $this->wpdiscuzOptionsJs["bubbleUpdateUrl"] = rest_url("wpdiscuz/v1/update");
1166
  $this->wpdiscuzOptionsJs["restNonce"] = wp_create_nonce("wp_rest");
 
1167
  $loadQuill = $this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop");
1168
  $customCSSSlug = "wpdiscuz-frontend-custom-css";
1169
  $customFileName = "style-custom";
@@ -2211,6 +2214,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
2211
  }
2212
  $email = apply_filters("wpdiscuz_feedback_commenter_email", $email);
2213
 
 
2214
  $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2215
  $comment_content = $this->helper->filterCommentText($comment_content);
2216
  if (!$comment_content) {
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.3.8
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
317
  $isAnonymous = false;
318
  $uniqueId = trim(WpdiscuzHelper::sanitize(INPUT_POST, "wpdiscuz_unique_id", FILTER_SANITIZE_STRING, ""));
319
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
320
+ // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
321
  $comment_content = isset($_POST["wc_comment"]) ? $_POST["wc_comment"] : "";
322
 
323
  if ($uniqueId && $postId && $comment_content) {
469
  $response["message"] = wp_unslash($response["message"]);
470
  do_action("wpdiscuz_after_comment_post", $newComment, $currentUser);
471
  $response["callbackFunctions"] = [];
472
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
473
  $response = apply_filters("wpdiscuz_comment_post", $response);
474
  do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
475
  wp_send_json_success($response);
1166
  $this->wpdiscuzOptionsJs["customAjaxUrl"] = plugins_url(WPDISCUZ_DIR_NAME . "/utils/ajax/wpdiscuz-ajax.php");
1167
  $this->wpdiscuzOptionsJs["bubbleUpdateUrl"] = rest_url("wpdiscuz/v1/update");
1168
  $this->wpdiscuzOptionsJs["restNonce"] = wp_create_nonce("wp_rest");
1169
+ $this->wpdiscuzOptionsJs["validateNonceForGuests"] = apply_filters('wpdiscuz_validate_nonce_for_guests', false);
1170
  $loadQuill = $this->options->form["richEditor"] === "both" || (!wp_is_mobile() && $this->options->form["richEditor"] === "desktop");
1171
  $customCSSSlug = "wpdiscuz-frontend-custom-css";
1172
  $customFileName = "style-custom";
2214
  }
2215
  $email = apply_filters("wpdiscuz_feedback_commenter_email", $email);
2216
 
2217
+ // $comment_content is filtered in function "$this->helper->filterCommentText" by WP's native function wp_kses
2218
  $comment_content = !empty($_POST["wpd_inline_comment"]) ? stripslashes(trim($_POST["wpd_inline_comment"])) : "";
2219
  $comment_content = $this->helper->filterCommentText($comment_content);
2220
  if (!$comment_content) {
forms/wpdFormAttr/Field/DefaultField/Submit.php CHANGED
@@ -34,24 +34,28 @@ class Submit extends Field {
34
  do_action("wpdiscuz_before_submit_button_in_wrapper", $currentUser, $uniqueId, $isMainForm);
35
  if ($isMainForm && (current_user_can("moderate_comments") || ($post && isset($post->post_author) && $post->post_author == $currentUser->ID))) {
36
  ?>
37
- <label class="wpd_label" wpd-tooltip="<?php echo esc_attr($options->getPhrase("wc_stick_comment_btn_title")); ?>">
38
- <input id="wc_sticky_comment" class="wpd_label__checkbox" value="1" type="checkbox" name="wc_sticky_comment"/>
39
- <span class="wpd_label__text">
40
- <span class="wpd_label__check">
41
- <i class="fas fa-thumbtack wpdicon wpdicon-on"></i>
42
- <i class="fas fa-thumbtack wpdicon wpdicon-off"></i>
 
 
43
  </span>
44
- </span>
45
- </label>
46
- <label class="wpd_label" wpd-tooltip="<?php echo esc_attr($options->getPhrase("wc_close_comment_btn_title")); ?>">
47
- <input id="wc_closed_comment" class="wpd_label__checkbox" value="1" type="checkbox" name="wc_closed_comment"/>
48
- <span class="wpd_label__text">
49
- <span class="wpd_label__check">
50
- <i class="fas fa-lock wpdicon wpdicon-on"></i>
51
- <i class="fas fa-unlock-alt wpdicon wpdicon-off"></i>
 
 
52
  </span>
53
- </span>
54
- </label>
55
  <?php
56
  }
57
  ?>
34
  do_action("wpdiscuz_before_submit_button_in_wrapper", $currentUser, $uniqueId, $isMainForm);
35
  if ($isMainForm && (current_user_can("moderate_comments") || ($post && isset($post->post_author) && $post->post_author == $currentUser->ID))) {
36
  ?>
37
+ <?php if ($options->moderation['enableStickButton']) { ?>
38
+ <label class="wpd_label" wpd-tooltip="<?php echo esc_attr($options->getPhrase("wc_stick_comment_btn_title")); ?>">
39
+ <input id="wc_sticky_comment" class="wpd_label__checkbox" value="1" type="checkbox" name="wc_sticky_comment"/>
40
+ <span class="wpd_label__text">
41
+ <span class="wpd_label__check">
42
+ <i class="fas fa-thumbtack wpdicon wpdicon-on"></i>
43
+ <i class="fas fa-thumbtack wpdicon wpdicon-off"></i>
44
+ </span>
45
  </span>
46
+ </label>
47
+ <?php } ?>
48
+ <?php if ($options->moderation['enableCloseButton']) { ?>
49
+ <label class="wpd_label" wpd-tooltip="<?php echo esc_attr($options->getPhrase("wc_close_comment_btn_title")); ?>">
50
+ <input id="wc_closed_comment" class="wpd_label__checkbox" value="1" type="checkbox" name="wc_closed_comment"/>
51
+ <span class="wpd_label__text">
52
+ <span class="wpd_label__check">
53
+ <i class="fas fa-lock wpdicon wpdicon-on"></i>
54
+ <i class="fas fa-unlock-alt wpdicon wpdicon-off"></i>
55
+ </span>
56
  </span>
57
+ </label>
58
+ <?php } ?>
59
  <?php
60
  }
61
  ?>
forms/wpdFormAttr/Login/twitter/HmacSha1.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
 
2
  /**
3
  * The MIT License
4
  * Copyright (c) 2007 Andy Smith
5
  */
 
6
  namespace wpdFormAttr\Login\twitter;
7
 
8
  /**
@@ -12,23 +14,20 @@ namespace wpdFormAttr\Login\twitter;
12
  * character (ASCII code 38) even if empty.
13
  * - Chapter 9.2 ("HMAC-SHA1")
14
  */
15
- class HmacSha1 extends SignatureMethod
16
- {
17
  /**
18
  * {@inheritDoc}
19
  */
20
- public function getName()
21
- {
22
  return "HMAC-SHA1";
23
  }
24
 
25
  /**
26
  * {@inheritDoc}
27
  */
28
- public function buildSignature(Request $request, Consumer $consumer, Token $token = null)
29
- {
30
  $signatureBase = $request->getSignatureBaseString();
31
-
32
  $parts = [$consumer->secret, null !== $token ? $token->secret : ""];
33
 
34
  $parts = Util::urlencodeRfc3986($parts);
1
  <?php
2
+
3
  /**
4
  * The MIT License
5
  * Copyright (c) 2007 Andy Smith
6
  */
7
+
8
  namespace wpdFormAttr\Login\twitter;
9
 
10
  /**
14
  * character (ASCII code 38) even if empty.
15
  * - Chapter 9.2 ("HMAC-SHA1")
16
  */
17
+ class HmacSha1 extends SignatureMethod {
18
+
19
  /**
20
  * {@inheritDoc}
21
  */
22
+ public function getName() {
 
23
  return "HMAC-SHA1";
24
  }
25
 
26
  /**
27
  * {@inheritDoc}
28
  */
29
+ public function buildSignature(Request $request, Consumer $consumer, Token $token = null) {
 
30
  $signatureBase = $request->getSignatureBaseString();
 
31
  $parts = [$consumer->secret, null !== $token ? $token->secret : ""];
32
 
33
  $parts = Util::urlencodeRfc3986($parts);
forms/wpdFormAttr/Login/twitter/SignatureMethod.php CHANGED
@@ -58,7 +58,7 @@ abstract class SignatureMethod
58
  // Avoid a timing leak with a (hopefully) time insensitive compare
59
  $result = 0;
60
  for ($i = 0; $i < strlen($signature); $i++) {
61
- $result |= ord($built{$i}) ^ ord($signature{$i});
62
  }
63
 
64
  return $result == 0;
58
  // Avoid a timing leak with a (hopefully) time insensitive compare
59
  $result = 0;
60
  for ($i = 0; $i < strlen($signature); $i++) {
61
+ $result |= ord($built[$i]) ^ ord($signature[$i]);
62
  }
63
 
64
  return $result == 0;
includes/class.WpdiscuzDBManager.php CHANGED
@@ -171,28 +171,28 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
171
  return $this->db->get_col($sqlCommentIds);
172
  }
173
 
174
- /**
175
- * check comment availability
176
- */
177
- public function commentIDsToRemove($args, $visibleCommentIds) {
178
- if ($args["status"] === "all") {
179
- $approved = " AND `comment_approved` IN('1','0')";
180
- } else {
181
- $approved = " AND `comment_approved` = '1'";
182
- }
183
- $sqlCommentIds = "SELECT `comment_ID` FROM `{$this->db->comments}` WHERE `comment_ID` IN(" . $visibleCommentIds . ")" . $approved . ";";
184
- $notRemovedCommentIDs = $this->db->get_col($sqlCommentIds);
185
- return array_values(array_diff(explode(",", $visibleCommentIds), $notRemovedCommentIDs));
186
- }
187
-
188
- public function getUserByNicename($nickname) {
189
- $caps = "";
190
- if (is_multisite()) {
191
- $caps = " INNER JOIN `{$this->db->usermeta}` AS `um2` ON `u`.`ID` = `um2`.`user_id` AND `um2`.`meta_key` = '{$this->db->prefix}capabilities'";
192
- }
193
- $sql = $this->db->prepare("SELECT `u`.`ID`, `u`.`user_email`, `u`.`display_name` FROM `{$this->db->users}` AS `u` INNER JOIN `{$this->db->usermeta}` AS `um` ON `u`.`ID` = `um`.`user_id` AND `um`.`meta_key` = 'nickname'$caps WHERE `um`.`meta_value` = %s OR `u`.`user_nicename` = %s LIMIT 1", $nickname, $nickname);
194
- return $this->db->get_row($sql);
195
- }
196
 
197
  /**
198
  * @param type $visibleCommentIds comment ids which is visible at the moment on front end
@@ -395,10 +395,10 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
395
  }
396
  }
397
 
398
- public function deleteSubscriptionsByEmail($email) {
399
- $sql = $this->db->prepare("DELETE FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($email));
400
- $this->db->query($sql);
401
- }
402
 
403
  public function deleteVotes($commnetId) {
404
  if ($cId = intval($commnetId)) {
@@ -415,7 +415,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
415
  /* === GRAVATARS CACHE === */
416
 
417
  public function deleteGravatarsTable() {
418
- $this->db->query("DROP TABLE IF EXISTS `" . $this->db->prefix . "wc_avatars_cache`");
419
  }
420
 
421
  /* === GRAVATARS CACHE === */
@@ -683,6 +683,69 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
683
 
684
  /* === MODAL === */
685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
  public function getSubscriptionsCount($userEmail) {
687
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($userEmail));
688
  return $this->db->get_var($sql);
@@ -961,8 +1024,8 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
961
 
962
  public function showRatingRebuildMsg() {
963
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` = %s", self::POSTMETA_RATING_COUNT);
964
- $ratingCount = intval($this->db->get_var($sql));
965
- $separateCount = intval($this->db->get_var("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_SEPARATE_AVG . "%'"));
966
  return $ratingCount > 0 && $separateCount === 0;
967
  }
968
 
@@ -991,8 +1054,8 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
991
  $avg += $newData["meta_value"] * $newData["count"];
992
  $c += $newData["count"];
993
  }
994
- update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_AVG . $k, round($avg / $c, 1));
995
- update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_COUNT . $k, $c);
996
  }
997
  update_post_meta($value["post_id"], self::POSTMETA_RATING_COUNT, $newValues, $val);
998
  }
@@ -1040,10 +1103,10 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
1040
  return $this->db->get_col($sql);
1041
  }
1042
 
1043
- public function deleteFeedbackFormsForPost($post_id) {
1044
- $sql = $this->db->prepare("DELETE FROM `{$this->feedbackForms}` WHERE `post_id` = %d", $post_id);
1045
- $this->db->query($sql);
1046
- }
1047
 
1048
  /* === /Feedback Comments === */
1049
  /* === User Votes === */
@@ -1106,25 +1169,26 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
1106
 
1107
  /* === /Remove Comment Meta === */
1108
 
1109
- public function deletePostMeta($metaKey) {
1110
- $sql = $this->db->prepare("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` = %s;", $metaKey);
1111
- $this->db->query($sql);
1112
- }
1113
-
1114
- public function deleteUserMeta($metaKey) {
1115
- $sql = $this->db->prepare("DELETE FROM `{$this->db->usermeta}` WHERE `meta_key` = %s;", $metaKey);
1116
- $this->db->query($sql);
1117
- }
1118
-
1119
- public function deleteFieldsRatingsPostMeta() {
1120
- $this->db->get_var("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_COUNT . "%'");
1121
- $this->db->get_var("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_SEPARATE_AVG . "%'");
1122
- }
1123
-
1124
- public function makeStickyCommentsRegular() {
1125
- $sql = $this->db->prepare("UPDATE {$this->db->comments} SET `comment_type` = 'comment' WHERE `comment_type` = %s", self::WPDISCUZ_STICKY_COMMENT);
1126
- $this->db->query($sql);
1127
- }
 
1128
  /* === Fix Tables === */
1129
 
1130
  public function fixTables() {
171
  return $this->db->get_col($sqlCommentIds);
172
  }
173
 
174
+ /**
175
+ * check comment availability
176
+ */
177
+ public function commentIDsToRemove($args, $visibleCommentIds) {
178
+ if ($args["status"] === "all") {
179
+ $approved = " AND `comment_approved` IN('1','0')";
180
+ } else {
181
+ $approved = " AND `comment_approved` = '1'";
182
+ }
183
+ $sqlCommentIds = "SELECT `comment_ID` FROM `{$this->db->comments}` WHERE `comment_ID` IN(" . $visibleCommentIds . ")" . $approved . ";";
184
+ $notRemovedCommentIDs = $this->db->get_col($sqlCommentIds);
185
+ return array_values(array_diff(explode(",", $visibleCommentIds), $notRemovedCommentIDs));
186
+ }
187
+
188
+ public function getUserByNicename($nicename) {
189
+ $caps = "";
190
+ if (is_multisite()) {
191
+ $caps = " INNER JOIN `{$this->db->usermeta}` AS `um` ON `u`.`ID` = `um`.`user_id` AND `um`.`meta_key` = '{$this->db->prefix}capabilities'";
192
+ }
193
+ $sql = $this->db->prepare("SELECT `u`.`ID`, `u`.`user_email`, `u`.`display_name` FROM `{$this->db->users}` AS `u` $caps WHERE `u`.`user_nicename` = %s LIMIT 1", $nicename);
194
+ return $this->db->get_row($sql);
195
+ }
196
 
197
  /**
198
  * @param type $visibleCommentIds comment ids which is visible at the moment on front end
395
  }
396
  }
397
 
398
+ public function deleteSubscriptionsByEmail($email) {
399
+ $sql = $this->db->prepare("DELETE FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($email));
400
+ $this->db->query($sql);
401
+ }
402
 
403
  public function deleteVotes($commnetId) {
404
  if ($cId = intval($commnetId)) {
415
  /* === GRAVATARS CACHE === */
416
 
417
  public function deleteGravatarsTable() {
418
+ $this->db->query("DROP TABLE IF EXISTS `" . $this->db->prefix . "wc_avatars_cache`");
419
  }
420
 
421
  /* === GRAVATARS CACHE === */
683
 
684
  /* === MODAL === */
685
 
686
+ public function getAllSubscriptions($args) {
687
+
688
+ $defaults = ["confirm" => 1, "orderby" => "id", "order" => "desc"];
689
+
690
+ $args = wp_parse_args($args, $defaults);
691
+
692
+ $sql = "SELECT * FROM `{$this->emailNotification}` WHERE 1";
693
+
694
+ if (!empty($args["id"])) {
695
+ $sql .= " AND `id` = " . (int) $args["id"];
696
+ }
697
+
698
+ if (!empty($args["email"])) {
699
+ $sql .= " AND `email` = " . esc_sql($args["email"]);
700
+ }
701
+
702
+ if (!empty($args["subscribtion_id"])) {
703
+ $sql .= " AND `subscribtion_id` = " . (int) $args["subscribtion_id"];
704
+ }
705
+
706
+ if (!empty($args["post_id"])) {
707
+ $sql .= " AND `post_id` = " . (int) $args["post_id"];
708
+ }
709
+
710
+ if (!empty($args["subscribtion_type"])) {
711
+ $sql .= " AND `subscribtion_type` = '" . esc_sql($args["subscribtion_type"]) . "'";
712
+ }
713
+
714
+ if (!empty($args["activation_key"])) {
715
+ $sql .= " AND `activation_key` = " . esc_sql($args["activation_key"]);
716
+ }
717
+
718
+ if (!empty($args["confirm"])) {
719
+ $sql .= " AND `confirm` = " . (int) $args["confirm"];
720
+ }
721
+
722
+ if (!empty($args["subscription_date"])) {
723
+ $sql .= " AND `subscription_date` = " . esc_sql($args["subscription_date"]);
724
+ }
725
+
726
+ if (!empty($args["imported_from"])) {
727
+ $sql .= " AND `imported_from` = " . esc_sql($args["imported_from"]);
728
+ }
729
+
730
+ if (!empty($args["orderby"])) {
731
+ $sql .= " ORDER BY " . esc_sql($args["orderby"]);
732
+ }
733
+
734
+ if (!empty($args["order"])) {
735
+ $sql .= " " . esc_sql($args["order"]);
736
+ }
737
+
738
+ if (!empty($args["limit"])) {
739
+ $sql .= " LIMIT " . (int) $args["limit"];
740
+ }
741
+
742
+ if (!empty($args["offset"])) {
743
+ $sql .= " OFFSET " . (int) $args["offset"];
744
+ }
745
+
746
+ return $this->db->get_results($sql, ARRAY_A);
747
+ }
748
+
749
  public function getSubscriptionsCount($userEmail) {
750
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($userEmail));
751
  return $this->db->get_var($sql);
1024
 
1025
  public function showRatingRebuildMsg() {
1026
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` = %s", self::POSTMETA_RATING_COUNT);
1027
+ $ratingCount = intval($this->db->get_var($sql));
1028
+ $separateCount = intval($this->db->get_var("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_SEPARATE_AVG . "%'"));
1029
  return $ratingCount > 0 && $separateCount === 0;
1030
  }
1031
 
1054
  $avg += $newData["meta_value"] * $newData["count"];
1055
  $c += $newData["count"];
1056
  }
1057
+ update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_AVG . $k, round($avg / $c, 1));
1058
+ update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_COUNT . $k, $c);
1059
  }
1060
  update_post_meta($value["post_id"], self::POSTMETA_RATING_COUNT, $newValues, $val);
1061
  }
1103
  return $this->db->get_col($sql);
1104
  }
1105
 
1106
+ public function deleteFeedbackFormsForPost($post_id) {
1107
+ $sql = $this->db->prepare("DELETE FROM `{$this->feedbackForms}` WHERE `post_id` = %d", $post_id);
1108
+ $this->db->query($sql);
1109
+ }
1110
 
1111
  /* === /Feedback Comments === */
1112
  /* === User Votes === */
1169
 
1170
  /* === /Remove Comment Meta === */
1171
 
1172
+ public function deletePostMeta($metaKey) {
1173
+ $sql = $this->db->prepare("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` = %s;", $metaKey);
1174
+ $this->db->query($sql);
1175
+ }
1176
+
1177
+ public function deleteUserMeta($metaKey) {
1178
+ $sql = $this->db->prepare("DELETE FROM `{$this->db->usermeta}` WHERE `meta_key` = %s;", $metaKey);
1179
+ $this->db->query($sql);
1180
+ }
1181
+
1182
+ public function deleteFieldsRatingsPostMeta() {
1183
+ $this->db->get_var("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_COUNT . "%'");
1184
+ $this->db->get_var("DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_SEPARATE_AVG . "%'");
1185
+ }
1186
+
1187
+ public function makeStickyCommentsRegular() {
1188
+ $sql = $this->db->prepare("UPDATE {$this->db->comments} SET `comment_type` = 'comment' WHERE `comment_type` = %s", self::WPDISCUZ_STICKY_COMMENT);
1189
+ $this->db->query($sql);
1190
+ }
1191
+
1192
  /* === Fix Tables === */
1193
 
1194
  public function fixTables() {
options/class.WpdiscuzOptions.php CHANGED
@@ -1885,6 +1885,15 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1885
  "desc" => esc_html__("All 16 addons in one bundle. Save 90% and get Unlimited Site License with one year premium support.", "wpdiscuz"),
1886
  "url" => "https://gvectors.com/product/wpdiscuz-addons-bundle/",
1887
  ],
 
 
 
 
 
 
 
 
 
1888
  "buddypress" => [
1889
  "version" => "1.0.2",
1890
  "requires" => "7.2.0",
@@ -2164,12 +2173,13 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2164
  ])) || strpos($_SERVER["REQUEST_URI"], "edit.php?post_type=wpdiscuz_form") !== false) {
2165
  $lastHash = get_option("wpdiscuz-addon-note-dismissed");
2166
  $lastHashArray = explode(",", $lastHash);
2167
- $currentHash = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration";
2168
  if ($lastHash !== $currentHash
2169
  && ( !in_array("BuddyPress Integration", $lastHashArray)
2170
  || !in_array("Tenor GIFs Integration", $lastHashArray)
2171
  || !in_array("Voice Commenting", $lastHashArray)
2172
- || !in_array("GIPHY Integration", $lastHashArray))
 
2173
  ) {
2174
  ?>
2175
  <div class="updated notice wpdiscuz_addon_note is-dismissible" style="margin-top:10px;">
@@ -2183,10 +2193,10 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2183
  <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2184
  <!-- </div>-->
2185
  <!-- --><?php //endif; ?>
2186
- <?php if(!in_array("Voice Commenting", $lastHashArray)): ?>
2187
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2188
- <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/voice/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2189
- <a href="https://gvectors.com/product/wpdiscuz-voice-commenting/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - Voice Commenting <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Allows to discuss with your voice in the comment section. Adds a microphone button to the comment form.</span></a>
2190
  </div>
2191
  <?php endif; ?>
2192
  <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
@@ -2228,7 +2238,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2228
  }
2229
 
2230
  public function addonHash() {
2231
- $viewed = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration";
2232
  // foreach ($this->addons as $key => $addon) {
2233
  // $viewed .= $addon["title"] . ",";
2234
  // }
@@ -2237,7 +2247,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2237
  }
2238
 
2239
  public function tipHash() {
2240
- $viewed = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration";
2241
  // foreach ($this->tips as $key => $tip) {
2242
  // $viewed .= $tip["title"] . ",";
2243
  // }
1885
  "desc" => esc_html__("All 16 addons in one bundle. Save 90% and get Unlimited Site License with one year premium support.", "wpdiscuz"),
1886
  "url" => "https://gvectors.com/product/wpdiscuz-addons-bundle/",
1887
  ],
1888
+ "notifications" => [
1889
+ "version" => "1.0.0",
1890
+ "requires" => "7.3.7",
1891
+ "class" => "WunDBManager",
1892
+ "title" => "User Notifications",
1893
+ "thumb" => plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"),
1894
+ "desc" => esc_html__("Ads a real-time user notification system and web push notifications in your website.", "wpdiscuz"),
1895
+ "url" => "https://gvectors.com/product/wpdiscuz-user-notifications/",
1896
+ ],
1897
  "buddypress" => [
1898
  "version" => "1.0.2",
1899
  "requires" => "7.2.0",
2173
  ])) || strpos($_SERVER["REQUEST_URI"], "edit.php?post_type=wpdiscuz_form") !== false) {
2174
  $lastHash = get_option("wpdiscuz-addon-note-dismissed");
2175
  $lastHashArray = explode(",", $lastHash);
2176
+ $currentHash = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration, User Notifications";
2177
  if ($lastHash !== $currentHash
2178
  && ( !in_array("BuddyPress Integration", $lastHashArray)
2179
  || !in_array("Tenor GIFs Integration", $lastHashArray)
2180
  || !in_array("Voice Commenting", $lastHashArray)
2181
+ || !in_array("GIPHY Integration", $lastHashArray)
2182
+ || !in_array("User Notifications", $lastHashArray))
2183
  ) {
2184
  ?>
2185
  <div class="updated notice wpdiscuz_addon_note is-dismissible" style="margin-top:10px;">
2193
  <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2194
  <!-- </div>-->
2195
  <!-- --><?php //endif; ?>
2196
+ <?php if(!in_array("User Notifications", $lastHashArray)): ?>
2197
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2198
+ <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2199
+ <a href="https://gvectors.com/product/wpdiscuz-user-notifications/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - User Notifications <br><span style="width: 60%; margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Adds a real-time user notification system to your site, so users can receive updates and notifications directly on your website as they happen (when someone likes your comment, rates your post, mentions you, replies to your comment).</span></a>
2200
  </div>
2201
  <?php endif; ?>
2202
  <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
2238
  }
2239
 
2240
  public function addonHash() {
2241
+ $viewed = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration, User Notifications";
2242
  // foreach ($this->addons as $key => $addon) {
2243
  // $viewed .= $addon["title"] . ",";
2244
  // }
2247
  }
2248
 
2249
  public function tipHash() {
2250
+ $viewed = "BuddyPress Integration, Tenor GIFs Integration, Voice Commenting, GIPHY Integration, wpDiscuz - User Notifications";
2251
  // foreach ($this->tips as $key => $tip) {
2252
  // $viewed .= $tip["title"] . ",";
2253
  // }
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.8
6
- Stable tag: 7.3.7
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -80,6 +80,7 @@ wpDiscuz version 7 is a revolutionary perspective on the commenting world! This
80
 
81
  * | [wpDiscuz - Bundle](https://gvectors.com/product/wpdiscuz-addons-bundle/)
82
  * | [wpDiscuz - Emoticons](https://gvectors.com/product/wpdiscuz-emoticons/)
 
83
  * | [wpDiscuz - Media Uploader](https://gvectors.com/product/wpdiscuz-media-uploader/)
84
  * | [wpDiscuz - Embeds](https://gvectors.com/product/wpdiscuz-embeds/)
85
  * | [wpDiscuz - Comment Author Info](https://gvectors.com/product/wpdiscuz-comment-author-info/)
@@ -182,18 +183,30 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
182
  12. wpDiscuz Single Settings Page | Screenshot #12
183
 
184
 
185
-
186
  == Changelog ==
187
 
188
- = Comments - wpDiscuz v7.3.6 / v7.3.7 =
189
 
190
- Fixed bug: Nonce is invalid with the wpDiscuz AJAX function.
 
 
 
 
 
 
 
 
191
 
192
  **IMPORTANT!**
193
 
194
  * Please don't forget delete all caches and purge CDN after the update.
195
 
196
 
 
 
 
 
 
197
  = Comments - wpDiscuz v7.3.5 =
198
 
199
  * Fixed bug: Proper escaping && sanitization of variables
@@ -201,6 +214,7 @@ Fixed bug: Nonce is invalid with the wpDiscuz AJAX function.
201
  * Fixed bug: Problem with Comment Fields Background option
202
  * Fixed bug: Problem with Edit Button (Allow comment editing for "Unlimited" time) option
203
 
 
204
  = Comments - wpDiscuz v7.3.4 =
205
 
206
 
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
+ Stable tag: 7.3.8
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
80
 
81
  * | [wpDiscuz - Bundle](https://gvectors.com/product/wpdiscuz-addons-bundle/)
82
  * | [wpDiscuz - Emoticons](https://gvectors.com/product/wpdiscuz-emoticons/)
83
+ * | [wpDiscuz - User Notifications](https://gvectors.com/product/wpdiscuz-user-notifications/)
84
  * | [wpDiscuz - Media Uploader](https://gvectors.com/product/wpdiscuz-media-uploader/)
85
  * | [wpDiscuz - Embeds](https://gvectors.com/product/wpdiscuz-embeds/)
86
  * | [wpDiscuz - Comment Author Info](https://gvectors.com/product/wpdiscuz-comment-author-info/)
183
  12. wpDiscuz Single Settings Page | Screenshot #12
184
 
185
 
 
186
  == Changelog ==
187
 
188
+ = Comments - wpDiscuz v7.3.8 =
189
 
190
+ * Added: New option in the media library drop-down to filter the media files uploaded in comments
191
+ * Added: A new hook 'wpdiscuz_validate_nonce_for_guests' for enabling/disabling nonce validation for guests (disabled by default)
192
+ * Fixed bug: Media file URL issue when SSL is enabled
193
+ * Fixed bug: Issues with user mentioning by user nicename
194
+ * Fixed bug: Prevent caching of comments when the native pagination is enabled
195
+ * Fixed bug: Issue with Custom CSS
196
+ * Fixed bug: Wrong names in email content when a new comment has been posted by the following user
197
+ * Fixed bug: 'Stick' and 'Close' comments' buttons were visible on the main comment form even when they were disabled from the settings
198
+ * New Addon: [wpDiscuz - User Notifications](https://gvectors.com/product/wpdiscuz-user-notifications/)
199
 
200
  **IMPORTANT!**
201
 
202
  * Please don't forget delete all caches and purge CDN after the update.
203
 
204
 
205
+ = Comments - wpDiscuz v7.3.6 / v7.3.7 =
206
+
207
+ * Fixed bug: Nonce is invalid with the wpDiscuz AJAX function.
208
+
209
+
210
  = Comments - wpDiscuz v7.3.5 =
211
 
212
  * Fixed bug: Proper escaping && sanitization of variables
214
  * Fixed bug: Problem with Comment Fields Background option
215
  * Fixed bug: Problem with Edit Button (Allow comment editing for "Unlimited" time) option
216
 
217
+
218
  = Comments - wpDiscuz v7.3.4 =
219
 
220
 
themes/default/class.WpdiscuzWalker.php CHANGED
@@ -284,7 +284,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
284
  $commentLinkIcon = $beforeCommentLink;
285
  }
286
  if ($this->options->thread_layouts["showCommentLink"]) {
287
- $commentLinkIcon .= apply_filters("wpdiscuz_comment_link_img", "<span wpd-tooltip='" . esc_attr($this->options->getPhrase("wc_comment_link", ["comment" => $comment])) . "' wpd-tooltip-position='left'><i class='fas fa-link' aria-hidden='true' data-comment-url='" . esc_url_raw($commentLink) . "'></i></span>", $comment);
288
  }
289
  if ($afterCommentLink) {
290
  $commentLinkIcon .= $afterCommentLink;
284
  $commentLinkIcon = $beforeCommentLink;
285
  }
286
  if ($this->options->thread_layouts["showCommentLink"]) {
287
+ $commentLinkIcon .= apply_filters("wpdiscuz_comment_link_img", "<span wpd-tooltip='" . esc_attr($this->options->getPhrase("wc_comment_link", ["comment" => $comment])) . "' wpd-tooltip-position='left'><i class='fas fa-link' aria-hidden='true' data-wpd-clipboard='" . esc_url_raw($commentLink) . "'></i></span>", $comment);
288
  }
289
  if ($afterCommentLink) {
290
  $commentLinkIcon .= $afterCommentLink;
themes/default/comment-form.php CHANGED
@@ -59,7 +59,7 @@ if (!post_password_required($post->ID)) {
59
  ?>
60
  <script>
61
  jQuery(document).ready(function ($) {
62
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_comments_are_deleted")); ?>', 'success');
63
  });
64
  </script>
65
  <?php
@@ -72,7 +72,7 @@ if (!post_password_required($post->ID)) {
72
  ?>
73
  <script>
74
  jQuery(document).ready(function ($) {
75
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_cancel_subs_success")); ?>', 'success');
76
  });
77
  </script>
78
  <?php
@@ -84,7 +84,7 @@ if (!post_password_required($post->ID)) {
84
  ?>
85
  <script>
86
  jQuery(document).ready(function ($) {
87
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_cancel_follows_success")); ?>', 'success');
88
  });
89
  </script>
90
  <?php
@@ -95,7 +95,7 @@ if (!post_password_required($post->ID)) {
95
  ?>
96
  <script>
97
  jQuery(document).ready(function ($) {
98
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_follow_confirm_success")); ?>', 'success');
99
  });
100
  </script>
101
  <?php
@@ -105,7 +105,7 @@ if (!post_password_required($post->ID)) {
105
  ?>
106
  <script>
107
  jQuery(document).ready(function ($) {
108
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_follow_cancel_success")); ?>', 'success');
109
  });
110
  </script>
111
  <?php
@@ -118,7 +118,7 @@ if (!post_password_required($post->ID)) {
118
  ?>
119
  <script>
120
  jQuery(document).ready(function ($) {
121
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_unsubscribe_message")); ?>', 'success');
122
  });
123
  </script>
124
  <?php
@@ -129,7 +129,7 @@ if (!post_password_required($post->ID)) {
129
  ?>
130
  <script>
131
  jQuery(document).ready(function ($) {
132
- wpdMessagesOnInit('<?php echo esc_html($wpdiscuz->options->getPhrase("wc_comfirm_success_message")); ?>', 'success');
133
  });
134
  </script>
135
  <?php
@@ -143,7 +143,7 @@ if (!post_password_required($post->ID)) {
143
  $commentsOpen = comments_open($post);
144
  $wpCommClasses[] = $commentsOpen ? "wpd-comments-open" : "wpd-comments-closed";
145
  $wpCommClasses = apply_filters("wpdiscuz_container_classes", $wpCommClasses);
146
-
147
  $wpCommClasses = implode(" ", $wpCommClasses);
148
 
149
  $currentUserId = 0;
@@ -188,7 +188,7 @@ if (!post_password_required($post->ID)) {
188
  if ($isShowSubscribeBar && $isPostmaticActive) {
189
  ?>
190
  <div class="wpd-sbs-toggle">
191
- <i class="far fa-envelope"></i> <span class="wpd-sbs-title"><?php echo esc_html($wpdiscuz->options->getPhrase("wc_subscribe_anchor")); ?></span> <i class="fas fa-caret-down"></i>
192
  </div>
193
  <?php
194
  }
@@ -244,20 +244,20 @@ if (!post_password_required($post->ID)) {
244
  if ($subscriptionType !== WpdiscuzCore::SUBSCRIPTION_POST) {
245
  ?>
246
  <form action="<?php echo esc_url_raw(admin_url("admin-ajax.php") . "?action=wpdAddSubscription"); ?>" method="post" id="wpdiscuz-subscribe-form">
247
- <div class="wpdiscuz-subscribe-form-intro"><?php echo esc_html($wpdiscuz->options->getPhrase("wc_notify_of")); ?> </div>
248
  <div class="wpdiscuz-subscribe-form-option" style="width:<?php echo!$currentUser->ID ? "40%" : "65%"; ?>;">
249
  <select class="wpdiscuz_select" name="wpdiscuzSubscriptionType" >
250
  <?php
251
  if ($wpdiscuz->options->subscription["subscriptionType"] != 3) {
252
  ?>
253
- <option value="<?php echo esc_attr(WpdiscuzCore::SUBSCRIPTION_POST); ?>"><?php echo esc_html($wpdiscuz->options->getPhrase("wc_notify_on_new_comment")); ?></option>
254
  <?php
255
  }
256
  ?>
257
  <?php
258
  if ($wpdiscuz->options->subscription["subscriptionType"] != 2) {
259
  ?>
260
- <option value="<?php echo esc_attr(WpdiscuzCore::SUBSCRIPTION_ALL_COMMENT); ?>" <?php echo isset($unsubscribeLinkParams) || !$wpdiscuz->options->wp["threadComments"] ? "disabled" : ""; ?>><?php echo esc_html($wpdiscuz->options->getPhrase("wc_notify_on_all_new_reply")); ?></option>
261
  <?php
262
  }
263
  ?>
@@ -311,7 +311,7 @@ if (!post_password_required($post->ID)) {
311
  echo apply_filters("wpdiscuz_form_render", $output, $commentsCount, $currentUser);
312
  if (empty($currentUser->ID) && !$form->isUserCanComment($currentUser, $post->ID)) {
313
  ?>
314
- <div class="wpd-login-to-comment"><?php echo esc_html($wpdiscuz->options->getPhrase("wc_login_to_comment")); ?></div>
315
  <?php
316
  }
317
  ?>
@@ -400,7 +400,7 @@ if (!post_password_required($post->ID)) {
400
  foreach ($sortingButtons as $key => $value) {
401
  if ($wpdiscuzCommentsOrderBy === $value["orderBy"] && $wpdiscuzCommentsOrder === $value["order"]) {
402
  ?>
403
- <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>
404
  <?php
405
  unset($sortingButtons[$key]);
406
  break;
@@ -412,7 +412,7 @@ if (!post_password_required($post->ID)) {
412
  <?php
413
  foreach ($sortingButtons as $key => $value) {
414
  ?>
415
- <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>
416
  <?php
417
  }
418
  ?>
@@ -424,8 +424,8 @@ if (!post_password_required($post->ID)) {
424
  </div>
425
  </div>
426
  <div class="wpd-comment-info-bar">
427
- <div class="wpd-current-view"><i class="fas fa-quote-left"></i> <?php echo esc_html($wpdiscuz->options->getPhrase("wc_inline_feedbacks")); ?></div>
428
- <div class="wpd-filter-view-all"><?php echo esc_html($wpdiscuz->options->getPhrase("wc_inline_comments_view_all")); ?></div>
429
  </div>
430
  <?php do_action("wpdiscuz_before_thread_list", $post, $currentUser, $commentsCount); ?>
431
  <div class="wpd-thread-list">
@@ -433,12 +433,13 @@ if (!post_password_required($post->ID)) {
433
  if ($wpdiscuz->options->wp["isPaginate"] || !$wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
434
  $args = ["first_load" => 1, "orderby" => $wpdiscuzCommentsOrderBy, "order" => $wpdiscuzCommentsOrder];
435
  $commentData = $wpdiscuz->getWPComments($args);
 
436
  echo $commentData["comment_list"];
437
  } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"] == 2 && $commentsCount) {
438
  ?>
439
  <div class="wpd-load-more-submit-wrap">
440
  <button name="submit" class="wpd-load-comments wpd-prim-button">
441
- <?php echo esc_html($wpdiscuz->options->getPhrase("wc_view_comments")); ?>
442
  </button>
443
  </div>
444
  <?php
@@ -453,7 +454,7 @@ if (!post_password_required($post->ID)) {
453
  ?>
454
  <div class="wpd-load-more-submit-wrap">
455
  <button name="submit" data-lastparentid="0" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
456
- <?php echo esc_html($loadMoreButtonText); ?>
457
  </button>
458
  </div>
459
  <input id="wpdiscuzHasMoreComments" type="hidden" value="0" />
@@ -463,7 +464,7 @@ if (!post_password_required($post->ID)) {
463
  ?>
464
  <div class="wpd-load-more-submit-wrap">
465
  <button name="submit" data-lastparentid="<?php echo esc_attr($commentData["last_parent_id"]); ?>" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
466
- <?php echo esc_html($loadMoreButtonText); ?>
467
  </button>
468
  </div>
469
  <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo esc_attr($commentData["is_show_load_more"]); ?>" />
@@ -494,12 +495,12 @@ if (!post_password_required($post->ID)) {
494
  $loadEndTime = WpdiscuzHelper::getMicrotime();
495
  if (isset($_GET["wpdLoadTime"])) {
496
  ?>
497
- <div><?php echo esc_html($loadEndTime - $loadStartTime); ?></div>
498
  <?php
499
  }
500
  ?>
501
  </div>
502
- <div id="wpdiscuz-loading-bar" class="<?php echo esc_html(!empty($currentUser->ID) ? "wpdiscuz-loading-bar-auth" : "wpdiscuz-loading-bar-unauth"); ?>"></div>
503
- <div id="wpdiscuz-comment-message" class="<?php echo esc_html(!empty($currentUser->ID) ? "wpdiscuz-comment-message-auth" : "wpdiscuz-comment-message-unauth"); ?>"></div>
504
  <?php
505
  }
59
  ?>
60
  <script>
61
  jQuery(document).ready(function ($) {
62
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_comments_are_deleted")); ?>', 'success');
63
  });
64
  </script>
65
  <?php
72
  ?>
73
  <script>
74
  jQuery(document).ready(function ($) {
75
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_cancel_subs_success")); ?>', 'success');
76
  });
77
  </script>
78
  <?php
84
  ?>
85
  <script>
86
  jQuery(document).ready(function ($) {
87
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_cancel_follows_success")); ?>', 'success');
88
  });
89
  </script>
90
  <?php
95
  ?>
96
  <script>
97
  jQuery(document).ready(function ($) {
98
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_follow_confirm_success")); ?>', 'success');
99
  });
100
  </script>
101
  <?php
105
  ?>
106
  <script>
107
  jQuery(document).ready(function ($) {
108
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_follow_cancel_success")); ?>', 'success');
109
  });
110
  </script>
111
  <?php
118
  ?>
119
  <script>
120
  jQuery(document).ready(function ($) {
121
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_unsubscribe_message")); ?>', 'success');
122
  });
123
  </script>
124
  <?php
129
  ?>
130
  <script>
131
  jQuery(document).ready(function ($) {
132
+ wpdMessagesOnInit('<?php esc_html_e($wpdiscuz->options->getPhrase("wc_comfirm_success_message")); ?>', 'success');
133
  });
134
  </script>
135
  <?php
143
  $commentsOpen = comments_open($post);
144
  $wpCommClasses[] = $commentsOpen ? "wpd-comments-open" : "wpd-comments-closed";
145
  $wpCommClasses = apply_filters("wpdiscuz_container_classes", $wpCommClasses);
146
+
147
  $wpCommClasses = implode(" ", $wpCommClasses);
148
 
149
  $currentUserId = 0;
188
  if ($isShowSubscribeBar && $isPostmaticActive) {
189
  ?>
190
  <div class="wpd-sbs-toggle">
191
+ <i class="far fa-envelope"></i> <span class="wpd-sbs-title"><?php esc_html_e($wpdiscuz->options->getPhrase("wc_subscribe_anchor")); ?></span> <i class="fas fa-caret-down"></i>
192
  </div>
193
  <?php
194
  }
244
  if ($subscriptionType !== WpdiscuzCore::SUBSCRIPTION_POST) {
245
  ?>
246
  <form action="<?php echo esc_url_raw(admin_url("admin-ajax.php") . "?action=wpdAddSubscription"); ?>" method="post" id="wpdiscuz-subscribe-form">
247
+ <div class="wpdiscuz-subscribe-form-intro"><?php esc_html_e($wpdiscuz->options->getPhrase("wc_notify_of")); ?> </div>
248
  <div class="wpdiscuz-subscribe-form-option" style="width:<?php echo!$currentUser->ID ? "40%" : "65%"; ?>;">
249
  <select class="wpdiscuz_select" name="wpdiscuzSubscriptionType" >
250
  <?php
251
  if ($wpdiscuz->options->subscription["subscriptionType"] != 3) {
252
  ?>
253
+ <option value="<?php echo esc_attr(WpdiscuzCore::SUBSCRIPTION_POST); ?>"><?php esc_html_e($wpdiscuz->options->getPhrase("wc_notify_on_new_comment")); ?></option>
254
  <?php
255
  }
256
  ?>
257
  <?php
258
  if ($wpdiscuz->options->subscription["subscriptionType"] != 2) {
259
  ?>
260
+ <option value="<?php echo esc_attr(WpdiscuzCore::SUBSCRIPTION_ALL_COMMENT); ?>" <?php echo isset($unsubscribeLinkParams) || !$wpdiscuz->options->wp["threadComments"] ? "disabled" : ""; ?>><?php esc_html_e($wpdiscuz->options->getPhrase("wc_notify_on_all_new_reply")); ?></option>
261
  <?php
262
  }
263
  ?>
311
  echo apply_filters("wpdiscuz_form_render", $output, $commentsCount, $currentUser);
312
  if (empty($currentUser->ID) && !$form->isUserCanComment($currentUser, $post->ID)) {
313
  ?>
314
+ <div class="wpd-login-to-comment"><?php esc_html_e($wpdiscuz->options->getPhrase("wc_login_to_comment")); ?></div>
315
  <?php
316
  }
317
  ?>
400
  foreach ($sortingButtons as $key => $value) {
401
  if ($wpdiscuzCommentsOrderBy === $value["orderBy"] && $wpdiscuzCommentsOrder === $value["order"]) {
402
  ?>
403
+ <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?> wpdiscuz-sort-button-active" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php esc_html_e($value["text"]); ?></span>
404
  <?php
405
  unset($sortingButtons[$key]);
406
  break;
412
  <?php
413
  foreach ($sortingButtons as $key => $value) {
414
  ?>
415
+ <span class="wpdiscuz-sort-button <?php echo esc_attr($value["class"]); ?>" data-sorting="<?php echo esc_attr($value["type"]); ?>"><?php esc_html_e($value["text"]); ?></span>
416
  <?php
417
  }
418
  ?>
424
  </div>
425
  </div>
426
  <div class="wpd-comment-info-bar">
427
+ <div class="wpd-current-view"><i class="fas fa-quote-left"></i> <?php esc_html_e($wpdiscuz->options->getPhrase("wc_inline_feedbacks")); ?></div>
428
+ <div class="wpd-filter-view-all"><?php esc_html_e($wpdiscuz->options->getPhrase("wc_inline_comments_view_all")); ?></div>
429
  </div>
430
  <?php do_action("wpdiscuz_before_thread_list", $post, $currentUser, $commentsCount); ?>
431
  <div class="wpd-thread-list">
433
  if ($wpdiscuz->options->wp["isPaginate"] || !$wpdiscuz->options->thread_display["firstLoadWithAjax"]) {
434
  $args = ["first_load" => 1, "orderby" => $wpdiscuzCommentsOrderBy, "order" => $wpdiscuzCommentsOrder];
435
  $commentData = $wpdiscuz->getWPComments($args);
436
+ // $commentData["comment_list"] can not be escaped because this is returned by WP's wp_list_comments function
437
  echo $commentData["comment_list"];
438
  } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"] == 2 && $commentsCount) {
439
  ?>
440
  <div class="wpd-load-more-submit-wrap">
441
  <button name="submit" class="wpd-load-comments wpd-prim-button">
442
+ <?php esc_html_e($wpdiscuz->options->getPhrase("wc_view_comments")); ?>
443
  </button>
444
  </div>
445
  <?php
454
  ?>
455
  <div class="wpd-load-more-submit-wrap">
456
  <button name="submit" data-lastparentid="0" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
457
+ <?php esc_html_e($loadMoreButtonText); ?>
458
  </button>
459
  </div>
460
  <input id="wpdiscuzHasMoreComments" type="hidden" value="0" />
464
  ?>
465
  <div class="wpd-load-more-submit-wrap">
466
  <button name="submit" data-lastparentid="<?php echo esc_attr($commentData["last_parent_id"]); ?>" class="wpd-load-more-submit wpd-loaded wpd-prim-button">
467
+ <?php esc_html_e($loadMoreButtonText); ?>
468
  </button>
469
  </div>
470
  <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo esc_attr($commentData["is_show_load_more"]); ?>" />
495
  $loadEndTime = WpdiscuzHelper::getMicrotime();
496
  if (isset($_GET["wpdLoadTime"])) {
497
  ?>
498
+ <div><?php esc_html_e($loadEndTime - $loadStartTime); ?></div>
499
  <?php
500
  }
501
  ?>
502
  </div>
503
+ <div id="wpdiscuz-loading-bar" class="<?php esc_html_e(!empty($currentUser->ID) ? "wpdiscuz-loading-bar-auth" : "wpdiscuz-loading-bar-unauth"); ?>"></div>
504
+ <div id="wpdiscuz-comment-message" class="<?php esc_html_e(!empty($currentUser->ID) ? "wpdiscuz-comment-message-auth" : "wpdiscuz-comment-message-unauth"); ?>"></div>
505
  <?php
506
  }
themes/default/style-rtl.css CHANGED
@@ -450,6 +450,7 @@ _:-ms-lang(x), .wpd-social-login [wpd-tooltip]::before{top: -24px;}
450
  #wpdcom .wpd-thread-filter .wpdf-sorting{font-size:14px; color:#777777; line-height: 18px; text-transform: capitalize; min-width: 100px; font-family: "Arial Hebrew", Arial, sans-serif;}
451
  #wpdcom .wpd-thread-filter .wpdf-sorting i{font-size: 15px; margin-right: 6px; vertical-align: top; line-height: 14px;}
452
  #wpdcom .wpd-thread-list .wpd-load-more-submit-wrap{display: flex; flex-direction: row; justify-content: center; padding: 10px;}
 
453
 
454
  /* Comment - Default Layout (#1) */
455
  #wpdcom .wpd-thread-list{ padding: 30px 0;}
450
  #wpdcom .wpd-thread-filter .wpdf-sorting{font-size:14px; color:#777777; line-height: 18px; text-transform: capitalize; min-width: 100px; font-family: "Arial Hebrew", Arial, sans-serif;}
451
  #wpdcom .wpd-thread-filter .wpdf-sorting i{font-size: 15px; margin-right: 6px; vertical-align: top; line-height: 14px;}
452
  #wpdcom .wpd-thread-list .wpd-load-more-submit-wrap{display: flex; flex-direction: row; justify-content: center; padding: 10px;}
453
+ #wpdcom .wpd-comment .wpd-comment-wrap .wpd-comment-author span.wpd-user-nicename{color:#aaaaaa;font-size:13px;font-family: "Courier New", Courier, monospace;}
454
 
455
  /* Comment - Default Layout (#1) */
456
  #wpdcom .wpd-thread-list{ padding: 30px 0;}
themes/default/style.css CHANGED
@@ -452,6 +452,7 @@ _:-ms-lang(x), .wpd-social-login [wpd-tooltip]::before{top: -24px;}
452
  #wpdcom .wpd-thread-filter .wpdf-sorting{font-size:14px; color:#777777; line-height: 18px; text-transform: capitalize; min-width: 100px; font-family: "Arial Hebrew", Arial, sans-serif;}
453
  #wpdcom .wpd-thread-filter .wpdf-sorting i{font-size: 15px; margin-left: 6px; vertical-align: top; line-height: 14px;}
454
  #wpdcom .wpd-thread-list .wpd-load-more-submit-wrap{display: flex; flex-direction: row; justify-content: center; padding: 10px;}
 
455
 
456
  /* Comment - Default Layout (#1) */
457
  #wpdcom .wpd-thread-list{ padding: 30px 0;}
452
  #wpdcom .wpd-thread-filter .wpdf-sorting{font-size:14px; color:#777777; line-height: 18px; text-transform: capitalize; min-width: 100px; font-family: "Arial Hebrew", Arial, sans-serif;}
453
  #wpdcom .wpd-thread-filter .wpdf-sorting i{font-size: 15px; margin-left: 6px; vertical-align: top; line-height: 14px;}
454
  #wpdcom .wpd-thread-list .wpd-load-more-submit-wrap{display: flex; flex-direction: row; justify-content: center; padding: 10px;}
455
+ #wpdcom .wpd-comment .wpd-comment-wrap .wpd-comment-author span.wpd-user-nicename{color:#aaaaaa;font-size:13px;font-family: "Courier New", Courier, monospace;}
456
 
457
  /* Comment - Default Layout (#1) */
458
  #wpdcom .wpd-thread-list{ padding: 30px 0;}
utils/class.WpdiscuzCache.php CHANGED
@@ -111,6 +111,10 @@ class WpdiscuzCache implements WpDiscuzConstants {
111
  }
112
 
113
  private function getCache($fileInfo) {
 
 
 
 
114
  if ($this->options->general["isCacheEnabled"] && file_exists($fileInfo["path"])) {
115
  $fileCreateTime = filemtime($fileInfo["path"]);
116
 
@@ -131,6 +135,10 @@ class WpdiscuzCache implements WpDiscuzConstants {
131
  }
132
 
133
  private function setCache($fileInfo, $data) {
 
 
 
 
134
  if ($this->options->general["isCacheEnabled"]) {
135
  if (!is_dir($fileInfo["dir"])) {
136
  wp_mkdir_p($fileInfo["dir"]);
111
  }
112
 
113
  private function getCache($fileInfo) {
114
+ if ($this->options->wp["isPaginate"]) {
115
+ return [];
116
+ }
117
+
118
  if ($this->options->general["isCacheEnabled"] && file_exists($fileInfo["path"])) {
119
  $fileCreateTime = filemtime($fileInfo["path"]);
120
 
135
  }
136
 
137
  private function setCache($fileInfo, $data) {
138
+ if ($this->options->wp["isPaginate"]) {
139
+ return false;
140
+ }
141
+
142
  if ($this->options->general["isCacheEnabled"]) {
143
  if (!is_dir($fileInfo["dir"])) {
144
  wp_mkdir_p($fileInfo["dir"]);
utils/class.WpdiscuzHelper.php CHANGED
@@ -38,6 +38,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
38
  add_action("post_updated", [&$this, "checkFeedbackShortcodes"], 10, 3);
39
  add_filter("comment_row_actions", [&$this, "commentRowStickAction"], 10, 2);
40
  add_filter("admin_comment_types_dropdown", [&$this, "addCommentTypes"]);
 
41
 
42
  add_action("wp_ajax_wpdGetInfo", [&$this, "wpdGetInfo"]);
43
  add_action("wp_ajax_nopriv_wpdGetInfo", [&$this, "wpdGetInfo"]);
@@ -147,14 +148,16 @@ class WpdiscuzHelper implements WpDiscuzConstants {
147
  }
148
 
149
  public function validateNonce() {
150
- $nonce = !empty($_REQUEST[self::GLOBAL_NONCE_NAME]) ? sanitize_text_field($_REQUEST[self::GLOBAL_NONCE_NAME]) : "";
151
- if (!wp_verify_nonce($nonce, $this->generateNonceKey())) {
152
- wp_die(__("Nonce is invalid.", "wpdiscuz"));
 
 
153
  }
154
  }
155
-
156
- public function getNonce(){
157
- wp_send_json_success($this->generateNonce());
158
  }
159
 
160
  //==========================================================================
@@ -402,6 +405,13 @@ class WpdiscuzHelper implements WpDiscuzConstants {
402
  return $user;
403
  }
404
 
 
 
 
 
 
 
 
405
  public function canUserEditComment($comment, $currentUser, $commentListArgs = []) {
406
  if (isset($commentListArgs["comment_author_email"])) {
407
  $storedCookieEmail = $commentListArgs["comment_author_email"];
@@ -702,6 +712,13 @@ class WpdiscuzHelper implements WpDiscuzConstants {
702
  return $ip;
703
  }
704
 
 
 
 
 
 
 
 
705
  public function commentDataArr($data, $comment, $commentarr) {
706
  if (!empty($data["wpdiscuz_comment_update"])) {
707
  $data["comment_date"] = $comment["comment_date"];
@@ -859,13 +876,12 @@ class WpdiscuzHelper implements WpDiscuzConstants {
859
 
860
  public function getMentionedUsers($content) {
861
  $users = [];
862
- if (preg_match_all("/(@[^\s\,\@\.\!\?\#\$\%\:\;\'\"\`\~\)\(\}\{\|\\\[\]]*)/is", $content, $nicknames)) {
863
- $nicknames = array_map("strip_tags", $nicknames[0]);
864
- $nicknames = array_unique($nicknames);
865
- foreach ($nicknames as $k => $nickname) {
866
- $user = $this->dbManager->getUserByNicename(ltrim($nickname, "@"));
867
  if ($user) {
868
- $users[] = ["replace" => $nickname, "u_id" => $user->ID, "name" => $user->display_name, "email" => $user->user_email];
869
  }
870
  }
871
  }
@@ -1421,12 +1437,12 @@ class WpdiscuzHelper implements WpDiscuzConstants {
1421
  <?php
1422
  }
1423
  ?>
1424
- #wpdcom .ql-snow .ql-tooltip[data-mode="link"]::before{content:"<?php esc_html_e("Enter link:", "wpdiscuz"); ?>";}
1425
  #wpdcom .ql-snow .ql-tooltip.ql-editing a.ql-action::after{content:"<?php esc_html_e("Save", "wpdiscuz"); ?>";}
1426
  <?php
1427
  do_action("wpdiscuz_dynamic_css", $this->options);
1428
  if ($this->options->thread_styles["theme"] !== "wpd-minimal") {
1429
- echo esc_html(stripslashes($this->options->thread_styles["customCss"]));
1430
  }
1431
  $css = ob_get_clean();
1432
  /* xMinfy Star ********************************************************* */
38
  add_action("post_updated", [&$this, "checkFeedbackShortcodes"], 10, 3);
39
  add_filter("comment_row_actions", [&$this, "commentRowStickAction"], 10, 2);
40
  add_filter("admin_comment_types_dropdown", [&$this, "addCommentTypes"]);
41
+ add_filter("wpdiscuz_after_comment_author", [&$this, "userNicename"], 1, 3);
42
 
43
  add_action("wp_ajax_wpdGetInfo", [&$this, "wpdGetInfo"]);
44
  add_action("wp_ajax_nopriv_wpdGetInfo", [&$this, "wpdGetInfo"]);
148
  }
149
 
150
  public function validateNonce() {
151
+ if (is_user_logged_in() || apply_filters('wpdiscuz_validate_nonce_for_guests', false)) {
152
+ $nonce = !empty($_REQUEST[self::GLOBAL_NONCE_NAME]) ? sanitize_text_field($_REQUEST[self::GLOBAL_NONCE_NAME]) : "";
153
+ if (!wp_verify_nonce($nonce, $this->generateNonceKey())) {
154
+ wp_die(__("Nonce is invalid.", "wpdiscuz"));
155
+ }
156
  }
157
  }
158
+
159
+ public function getNonce() {
160
+ wp_send_json_success($this->generateNonce());
161
  }
162
 
163
  //==========================================================================
405
  return $user;
406
  }
407
 
408
+ public function userNicename($html, $comment, $user) {
409
+ if (apply_filters("wpdiscuz_show_nicename",$this->options->subscription["enableUserMentioning"]) && isset($user->user_nicename)) {
410
+ $html .= "<span class='wpd-user-nicename' data-wpd-clipboard='@". esc_attr($user->user_nicename)."'>&nbsp;(@" . esc_html($user->user_nicename) . ")</span>";
411
+ }
412
+ return $html;
413
+ }
414
+
415
  public function canUserEditComment($comment, $currentUser, $commentListArgs = []) {
416
  if (isset($commentListArgs["comment_author_email"])) {
417
  $storedCookieEmail = $commentListArgs["comment_author_email"];
712
  return $ip;
713
  }
714
 
715
+ public function fixURLScheme($url) {
716
+ if (is_ssl() && strpos($url, "http://") !== false) {
717
+ $url = str_replace("http://", "https://", $url);
718
+ }
719
+ return $url;
720
+ }
721
+
722
  public function commentDataArr($data, $comment, $commentarr) {
723
  if (!empty($data["wpdiscuz_comment_update"])) {
724
  $data["comment_date"] = $comment["comment_date"];
876
 
877
  public function getMentionedUsers($content) {
878
  $users = [];
879
+ if (preg_match_all("/(@[^\s\,\@\.\!\?\#\$\%\:\;\'\"\`\~\)\(\}\{\|\\\[\]]*)/is", $content, $nicenames)) {
880
+ $nicenames = array_unique(array_map("strip_tags", $nicenames[0]));
881
+ foreach ($nicenames as $k => $nicename) {
882
+ $user = $this->dbManager->getUserByNicename(ltrim($nicename, "@"));
 
883
  if ($user) {
884
+ $users[] = ["replace" => $nicename, "u_id" => $user->ID, "name" => $user->display_name, "email" => $user->user_email];
885
  }
886
  }
887
  }
1437
  <?php
1438
  }
1439
  ?>
1440
+ #wpdcom .ql-snow .ql-tooltip[data-mode="link"]::before{content:"<?php esc_html_e("Enter link:", "wpdiscuz"); ?>";}
1441
  #wpdcom .ql-snow .ql-tooltip.ql-editing a.ql-action::after{content:"<?php esc_html_e("Save", "wpdiscuz"); ?>";}
1442
  <?php
1443
  do_action("wpdiscuz_dynamic_css", $this->options);
1444
  if ($this->options->thread_styles["theme"] !== "wpd-minimal") {
1445
+ echo stripslashes($this->options->thread_styles["customCss"]);
1446
  }
1447
  $css = ob_get_clean();
1448
  /* xMinfy Star ********************************************************* */
utils/class.WpdiscuzHelperEmail.php CHANGED
@@ -415,8 +415,8 @@ class WpdiscuzHelperEmail implements WpDiscuzConstants {
415
  return;
416
  }
417
  $subject = str_replace(["[COMMENT_AUTHOR]"], [$followerData["user_name"]], $this->options->getPhrase("wc_follow_email_subject"));
418
- $message = str_replace(["[COMMENT_AUTHOR]", "[FOLLOWER_NAME]"], [$followerData["user_name"], $followerData["follower_name"]], $message);
419
- $this->emailToFollower($followerData, $comment, $subject, $message, $cancelLink, $data);
420
  do_action("wpdiscuz_notify_followers", $comment, $followerData);
421
  }
422
  }
415
  return;
416
  }
417
  $subject = str_replace(["[COMMENT_AUTHOR]"], [$followerData["user_name"]], $this->options->getPhrase("wc_follow_email_subject"));
418
+ $body = str_replace(["[COMMENT_AUTHOR]", "[FOLLOWER_NAME]"], [$followerData["user_name"], $followerData["follower_name"]], $message);
419
+ $this->emailToFollower($followerData, $comment, $subject, $body, $cancelLink, $data);
420
  do_action("wpdiscuz_notify_followers", $comment, $followerData);
421
  }
422
  }
utils/class.WpdiscuzHelperOptimization.php CHANGED
@@ -58,7 +58,8 @@ class WpdiscuzHelperOptimization implements WpDiscuzConstants {
58
  */
59
  public function statusEventHandler($newStatus, $oldStatus, $comment) {
60
  if ($newStatus === "approved") {
61
- if ($this->options->subscription["isNotifyOnCommentApprove"]) {
 
62
  $this->helperEmail->notifyOnApproving($comment);
63
  }
64
  $this->notifyOnApprove($comment);
58
  */
59
  public function statusEventHandler($newStatus, $oldStatus, $comment) {
60
  if ($newStatus === "approved") {
61
+ $currentUser = wp_get_current_user();
62
+ if ((!empty($currentUser->user_email) && $currentUser->user_email !== $comment->comment_author_email) && $this->options->subscription["isNotifyOnCommentApprove"]) {
63
  $this->helperEmail->notifyOnApproving($comment);
64
  }
65
  $this->notifyOnApprove($comment);
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -23,7 +23,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
23
  $this->helper = $helper;
24
  $wpUploadsDir = wp_upload_dir();
25
  $this->wpUploadsPath = $wpUploadsDir["path"];
26
- $this->wpUploadsUrl = $wpUploadsDir["url"];
27
  $this->requestUri = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "";
28
  if ($this->options->content["wmuIsEnabled"]) {
29
  add_filter("wpdiscuz_editor_buttons_html", [&$this, "uploadButtons"], 1, 2);
@@ -53,6 +53,9 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
54
 
55
  add_action(self::DELETE_UNATTACHED_FILES_ACTION, [&$this, "deleteUnattachedFiles"]);
 
 
 
56
  }
57
  }
58
 
@@ -177,9 +180,10 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
177
 
178
  foreach ($attachments as $attachment) {
179
  $deleteHtml = $this->getDeleteHtml($currentUser, $attachment, "image");
180
- $url = wp_get_attachment_image_url($attachment->ID, "full");
181
  $srcData = wp_get_attachment_image_src($attachment->ID, $size);
182
- $src = $srcData[0];
 
183
  if ($wmuLazyLoadImages && $lazyLoad) {
184
  $srcValue = "data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
185
  $dataSrcValue = $src;
@@ -194,7 +198,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
194
  $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
195
  $images .= "</a>";
196
  } else {
197
- $images .= apply_filters("wpdiscuz_mu_attached_image_before", "<a href='" . wp_get_attachment_image_url($attachment->ID) . "' class='wmu-attached-image-link' target='_blank' rel='noreferrer ugc'>", $attachment->ID);
198
  $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
199
  $images .= apply_filters("wpdiscuz_mu_attached_image_after", "</a>", $attachment->ID);
200
  }
@@ -815,4 +819,32 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
815
  }
816
  }
817
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  }
23
  $this->helper = $helper;
24
  $wpUploadsDir = wp_upload_dir();
25
  $this->wpUploadsPath = $wpUploadsDir["path"];
26
+ $this->wpUploadsUrl = $this->helper->fixURLScheme($wpUploadsDir["url"]);
27
  $this->requestUri = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "";
28
  if ($this->options->content["wmuIsEnabled"]) {
29
  add_filter("wpdiscuz_editor_buttons_html", [&$this, "uploadButtons"], 1, 2);
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
54
 
55
  add_action(self::DELETE_UNATTACHED_FILES_ACTION, [&$this, "deleteUnattachedFiles"]);
56
+
57
+ add_action("restrict_manage_posts", [$this, "wpdiscuzMediaFiler"]);
58
+ add_filter("parse_query", [$this, "getWpdiscuzMedia"]);
59
  }
60
  }
61
 
180
 
181
  foreach ($attachments as $attachment) {
182
  $deleteHtml = $this->getDeleteHtml($currentUser, $attachment, "image");
183
+ $url = $this->helper->fixURLScheme(wp_get_attachment_image_url($attachment->ID, "full"));
184
  $srcData = wp_get_attachment_image_src($attachment->ID, $size);
185
+ $src = $this->helper->fixURLScheme($srcData[0]);
186
+
187
  if ($wmuLazyLoadImages && $lazyLoad) {
188
  $srcValue = "data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
189
  $dataSrcValue = $src;
198
  $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
199
  $images .= "</a>";
200
  } else {
201
+ $images .= apply_filters("wpdiscuz_mu_attached_image_before", "<a href='$url' class='wmu-attached-image-link' target='_blank' rel='noreferrer ugc'>", $attachment->ID);
202
  $images .= "<img style='$style' alt='" . get_post_meta($attachment->ID, "_wp_attachment_image_alt", true) . "' title='" . esc_attr($attachment->post_excerpt) . "' id='wmu-attachemnt-$attachment->ID' class='attachment-$size size-$size wmu-attached-image' src='$srcValue' wmu-data-src='$dataSrcValue' $secondarySizeKey='$secondarySize' />";
203
  $images .= apply_filters("wpdiscuz_mu_attached_image_after", "</a>", $attachment->ID);
204
  }
819
  }
820
  }
821
 
822
+ public function wpdiscuzMediaFiler() {
823
+ $scr = get_current_screen();
824
+ if ($scr->base !== "upload") {
825
+ return;
826
+ }
827
+
828
+ $source = filter_input(INPUT_GET, "media_source", FILTER_SANITIZE_STRING);
829
+ $selected = $source === "wpdiscuz" ? " selected='selected'" : "";
830
+
831
+ $dropdown = "<select name='media_source' id='wpdiscuz_media' class='postform'>";
832
+ $dropdown .= "<option value=''>" . __("All Media Items", "wpdiscuz") . "</option>";
833
+ $dropdown .= "<option value='wpdiscuz' {$selected}>" . __("wpDiscuz Media Items", "wpdiscuz") . "</option>";
834
+ $dropdown .= "</select>";
835
+ echo $dropdown;
836
+ }
837
+
838
+ function getWpdiscuzMedia($query) {
839
+ global $pagenow;
840
+ $mode = filter_input(INPUT_GET, "mode", FILTER_SANITIZE_STRING);
841
+ $source = filter_input(INPUT_GET, "media_source", FILTER_SANITIZE_STRING);
842
+
843
+ if (is_admin() && "upload.php" === $pagenow && $mode === "list" && $source === "wpdiscuz") {
844
+ $query->query_vars["meta_key"] = "_wmu_comment_id";
845
+ $query->query_vars["meta_value"] = "";
846
+ $query->query_vars["meta_compare"] = "!=";
847
+ }
848
+ }
849
+
850
  }