Plugin Directory

Changeset 3733158


Ignore:
Timestamp:
10/07/2026 06:04:21 PM (2 weeks ago)
Author:
AdvancedCoding
Message:

Comments - wpDiscuz v7.6.72 - 07.10.2026

  • Fixed: A comment whose image was refused for its width or height was saved anyway, and the error message was empty. The wpdiscuz_mu_preupload action now fires before the comment is saved, so a file it refuses stops the comment.
  • Fixed: The on/off switches on the settings page showed their state by color alone and could not be used from the keyboard. They now show a cross when off and a check mark when on, and can be reached with Tab and toggled with Space. Switches in addon settings tabs get the same fix.
Location:
wpdiscuz
Files:
847 added
9 edited

Legend:

Unmodified
Added
Removed
  • wpdiscuz/assets/blueprints/blueprint.json

    r3698558 r3733158  
    1616      "pluginZipFile": {
    1717        "resource": "url",
    18         "url": "https://downloads.wordpress.org/plugin/wpdiscuz.7.6.71.zip"
     18        "url": "https://downloads.wordpress.org/plugin/wpdiscuz.7.6.72.zip"
    1919      },
    2020      "options": {
  • wpdiscuz/trunk/assets/css/wpdiscuz-options.css

    r3665744 r3733158  
    314314/* Single Settings #########################################*/
    315315/************************************************************/
    316 #wpd-setbox .wpd-switcher  input[type=checkbox]{ height: 0; width: 0; visibility: hidden; position: absolute;}
    317 #wpd-setbox .wpd-switcher  label { cursor: pointer; text-indent: -9999px; width: 50px; height: 18px; background: grey; display: block; border-radius: 30px; position: relative;border: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1); -webkit-transition: all 0.1s ease-in-out; -moz-transition:    all 0.1s ease-in-out; -ms-transition: all 0.1s ease-in-out;  -o-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out;}
    318 #wpd-setbox .wpd-switcher  label:after {content: ''; position: absolute; top: 4px; left: 5px; width: 10px; height: 10px; background: #fff; border-radius: 90px; transition: 0.3s;}
     316/* opacity, not visibility or display, keeps the checkbox in the tab order and in the accessibility tree */
     317#wpd-setbox .wpd-switcher  input[type=checkbox]{ height: 1px; width: 1px; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; position: absolute;}
     318#wpd-setbox .wpd-switcher  input[type=checkbox]:focus-visible + label{outline: 2px solid #2271b1; outline-offset: 2px;}
     319#wpd-setbox .wpd-switcher  label { cursor: pointer; text-indent: -9999px; width: 52px; height: 20px; background: grey; display: block; border-radius: 30px; position: relative;border: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1); -webkit-transition: all 0.1s ease-in-out; -moz-transition:    all 0.1s ease-in-out; -ms-transition: all 0.1s ease-in-out;  -o-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out;}
     320/* the circle shows a cross when off and a check mark when on, so the state doesn't rely on color; the empty alt text hides the glyph from screen readers */
     321#wpd-setbox .wpd-switcher  label:after {content: "\f335"; content: "\f335" / ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 90px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: 0.3s; font: normal 14px/16px dashicons; text-indent: 0; text-align: center; color: grey; -webkit-text-stroke: 0.75px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
    319322#wpd-setbox .wpd-switcher  input:checked + label {background: #07B290;}
    320 #wpd-setbox .wpd-switcher  input:checked + label:after {left: calc(100% - 5px);transform: translateX(-100%);}
    321 #wpd-setbox .wpd-switcher  label:active:after {width: 12px;}
     323#wpd-setbox .wpd-switcher  input:checked + label:after {content: "\f147"; content: "\f147" / ""; color: #07B290; left: calc(100% - 2px);transform: translateX(-100%);}
     324#wpd-setbox .wpd-switcher  label:active:after {width: 18px;}
    322325#wpd-setbox .wpd-radio input[type=radio]{display: none;}
    323326#wpd-setbox .wpd-radio .wpd-radio-circle {cursor: pointer; width: 16px; height: 16px; background: grey; display: inline-block; border-radius: 30px; position: relative;border: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.1);}
  • wpdiscuz/trunk/assets/js/wpdiscuz-combo-no_quill.min.js

    r3698558 r3733158  
    44jQuery.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)})};
    55/* wpDiscuz */
    6 let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t);wpdiscuzAjaxObj.setCommentMessage(d,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
     6let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.errorCode?n.data.errorCode:n.data,s="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d],d,t);wpdiscuzAjaxObj.setCommentMessage(s,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
    77/* Colorbox */
    88!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);
  • wpdiscuz/trunk/assets/js/wpdiscuz-combo.min.js

    r3698558 r3733158  
    88jQuery.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)})};
    99/* wpDiscuz */
    10 let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t);wpdiscuzAjaxObj.setCommentMessage(d,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
     10let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.errorCode?n.data.errorCode:n.data,s="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d],d,t);wpdiscuzAjaxObj.setCommentMessage(s,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
    1111/* Colorbox */
    1212!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);
  • wpdiscuz/trunk/assets/js/wpdiscuz.js

    r3698558 r3733158  
    742742                        $(document.body).trigger('wpdiscuz_comment_post_success', [wcForm, data, currentSubmitBtn, r.data]);
    743743                    } else if (r.data) {
     744                        var errCode = typeof r.data === 'object' && r.data.errorCode ? r.data.errorCode : r.data;
    744745                        var errMsg = typeof r.data === 'object' && r.data.error
    745746                            ? r.data.error
    746                             : wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, wcForm);
     747                            : wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[errCode], errCode, wcForm);
    747748                        wpdiscuzAjaxObj.setCommentMessage(errMsg, 'error');
    748749                        runCallbacks(r, wcForm);
  • wpdiscuz/trunk/assets/js/wpdiscuz.min.js

    r3698558 r3733158  
    1 let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t);wpdiscuzAjaxObj.setCommentMessage(d,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
     1let wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor,10);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout((function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)}),3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}));else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,(function(){jQuery(this).remove()}))},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,o){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,(function(a){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[a]](e,t,o))})),e},jQuery(document).ready((function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType,10),d=parseInt(wpdiscuzAjaxObj.wc_post_id,10),s=parseInt(wpdiscuzAjaxObj.commentListUpdateType,10),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer,10),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests,10),p=wpdiscuzAjaxObj.loadLastCommentId,l=p,w=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax,10),m=parseInt(wpdiscuzAjaxObj.is_rate_editable,10);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 u=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate,10),f=wpdiscuzAjaxObj.storeCommenterData,h=(parseInt(wpdiscuzAjaxObj.wmuEnabled,10),wpdiscuzAjaxObj.isCookiesEnabled),b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments,10),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation,10)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10),j=parseInt(wpdiscuzAjaxObj.userInteractionCheck,10),x=parseInt(wpdiscuzAjaxObj.enableBubble,10),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate,10),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout,10),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout,10):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage,10),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=parseInt(wpdiscuzAjaxObj.scrollSize,10);E=E||32;var D=[],T=[],F=[],M=!1,L=1,R=0,S=null,P=null;var q,H=e("html").css("scroll-behavior"),U=e("body").css("scroll-behavior");function B(e){R=Math.ceil(Date.now()/1e3)}(j&&(document.addEventListener("mousedown",B),document.addEventListener("mousemove",B),document.addEventListener("touchstart",B),document.addEventListener("scroll",B),document.addEventListener("keydown",B)),e("#wp-admin-bar-wpdiscuz > .ab-item").prepend("<img src='"+wpdiscuzAjaxObj.menu_icon+"' style='width:22px;height:22px;vertical-align:middle;'>"),e(document).on("mouseover","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon_hover)})),e(document).on("mouseleave","#wp-admin-bar-wpdiscuz",(function(){e(this).find("> .ab-item img").attr("src",wpdiscuzAjaxObj.menu_icon)})),e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper >  .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",(function(t){var o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor&&document.querySelector(".wpdiscuz-textarea-wrap")){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")})),wpdiscuzLoadRichEditor||(e(document).on("input","textarea.wc_comment",(function(){Fe(e(this))})),e.each(e("textarea.wc_comment"),(function(){Fe(e(this))}))),e("body").on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)})),e("body").on("focus","#wpdcom textarea",(function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()})),t)||K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e("body").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("body").on("click","#wpd-insert-source-code",(function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")})),e("body").on("click",".wpd-reply-button",(function(){var i=fe(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()}),z):setTimeout((function(){e("#wc-textarea-"+i).trigger("focus")}),z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(o){var a=fe(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){var o=e("#wpdiscuz_hidden_secondary_form");return e("input",o).not(":checkbox, :radio, :file").each((function(){this.setAttribute("value",this.value)})),o.html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);if(!t){K({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)})}wpdiscuzLoadRichEditor?setTimeout((function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus(),ce(a)}),z):setTimeout((function(){e("#wc-textarea-"+a).trigger("focus"),ce(a)}),z);n.slideToggle(z,(function(){o.addClass("wpdiscuz-clonned")}))}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=he(t);setTimeout((function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}}),1e3)}}(i)})),e("body").on("click","#wpdcom [data-wpd-clipboard]",(function(){var t=e(this).data("wpd-clipboard");e(this).data("wpd-ismention")&&(t="@"+t);var o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)})),e("body").on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",(function(e){e.preventDefault()})),e("body").on("click",".wpd-toggle.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked");var o=fe(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=he(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),Le(v,!0,n).done((function(a){if(o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success){var n=e("#wpd-comm-"+t);re(n),n.replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .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),Me(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,(function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")}))})),e("body").on("mouseenter",".wpd-new-loaded-comment",(function(){e(this).removeClass("wpd-new-loaded-comment")})),e("body").on("click",".wpd-sbs-toggle",(function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)})),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm,10)&&!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("body").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"),ze(e(this),""),t.preventDefault())}))):"3.0"===n&&e("body").on("click","#wpdiscuz_subscription_button",(function(t){var o=e(this).parents("#wpdiscuz-subscribe-form");ze(o,""),t.preventDefault();try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then((function(e){document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,o.trigger("submit")}),(function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)}))}))}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}}))),(o||a)&&"2.0"===n){var N=e(window).width(),W=e("#wpdcom").width();W>=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%"})),W>=940&&W<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%"})),W>=810&&W<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%"})),W>=730&&W<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%"})),W>=610&&W<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%"})),N>650&&(W>=510&&W<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"})),W>=470&&W<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"})),W<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 V(t,o,a){e(document.body).trigger("wpdiscuz_before_send_comment",[t,o,a]),Le(v,!1,o).done((function(n){if(e(a).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),n.data.wc_all_comments_count_new=parseInt(n.data.wc_all_comments_count_new,10),e(".wpd-thread-info").html(n.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",n.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(n.data.wc_all_comments_count_bubble_html);var i=z;n.data.is_main?xe(n.data.message):(i=z+700,e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).slideToggle(700),1==n.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+n.data.uniqueid).after(n.data.message):e("#wpd-comm-"+n.data.uniqueid).after(n.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),Le(v,!0,t)}}(n),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),Le(v,!0,t).done((function(e){"object"==typeof e&&e.success&&setTimeout((function(){location.href=e.data}),2e3)})).fail((function(e,t,o){console.log(o)}))}}(n),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(f=parseInt(f,10),Cookies.set("comment_author_email_"+_,o,{expires:f,path:"/"}),Cookies.set("comment_author_"+_,a,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(n.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),e("input, textarea",t).not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&(this.defaultValue=this.value)})),t.get(0).reset(),function(e){if(!te||!e)return;se(e),ie(e,"")}(e(".wpdiscuz_unique_id",t).val()),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):Fe(t.find(".wc_comment")),K(n.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach((function(e){e.parents(".wpd-field-checkbox").remove()})),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment,10)&&setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+n.data.new_comment_id).offset().top-E},1e3,je)}),i),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_success",[t,o,a,n.data])}else if(n.data){var d="object"==typeof n.data&&n.data.errorCode?n.data.errorCode:n.data,s="object"==typeof n.data&&n.data.error?n.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d],d,t);wpdiscuzAjaxObj.setCommentMessage(s,"error"),Me(n,t),e(document.body).trigger("wpdiscuz_comment_post_error",[t,o,a,n.data])}}else wpdiscuzAjaxObj.setCommentMessage(n,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1,e(document.body).trigger("wpdiscuz_comment_post_complete",[t,o,a])})).fail((function(n,i,d){console.log(d),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250),e(document.body).trigger("wpdiscuz_comment_post_failed",[t,o,a])}))}function K(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 Q(t,o){var a=e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap");e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),re(a),a.replaceWith(o),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e("body").on("click",".wc_comm_submit.wpd_not_clicked",(function(){var i=e(this),d=1,s=e(this).parents("form");if("true"!==s.attr("data-uploading")){if(s.hasClass("wpd_main_comm_form")||(d=function(t){var o=t.attr("class").split(" "),a="";return e.each(o,(function(e,t){"wpd_comment_level"===be(t,!1)&&(a=be(t,!0))})),parseInt(a,10)+1}(e(this).parents(".wpd-comment"))),e(document.body).trigger("wpdiscuz_new_comment",[i,s,d]),ze(s,"#wpd-editor-"+e(".wpdiscuz_unique_id",s).val()),s.on("submit",(function(e){e.preventDefault()})),s[0].checkValidity()&&(c=s,r=!0,"2.0"===n&&e("input[name=wc_captcha]",c).length&&!e("input[name=wc_captcha]",c).val().length?(r=!1,e(".wpdiscuz-recaptcha",c).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",c).length&&e(".wpdiscuz-recaptcha",c).css("border","none"),r)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each((function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each((function(){D.push(e(this))})))}))}(s),e(i).removeClass("wpd_not_clicked");const o=new FormData;o.append("action","wpdAddComment");const a=e(":input",s);let c=0;if(a.each((function(){let t=this;if(""!==t.name)if("file"==t.type){const a=t.files;e.each(a,(function(e,a){o.append(t.name+"["+e+"]",a),c+=a.size}))}else"checkbox"!=t.type&&"radio"!=t.type?o.append(t.name+"",e(t).val().trim()):"checkbox"!=t.type&&"radio"!=t.type||e(t).is(":checked")&&o.append(t.name+"",e(t).val())})),c>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(c>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize,10))return wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",s),"error",3e3),e(i).addClass("wpd_not_clicked"),!1;if(o.append("wpd_comment_depth",d),wpdiscuzAjaxObj.wpdiscuz_zs&&o.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",s).length?e(".wpd-cookies-checkbox",s).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready((function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then((function(e){o.append("g-recaptcha-response",e),V(s,o,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 V(s,o,i)}var c,r;!function(e){if((o||a)&&"2.0"===n){var t=he(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",s).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseDoingUpload,"wmuPhraseDoingUpload",s),"warning")})),e(document.body).on("wpdiscuz_comment_post_success",(function(t,o,a,n,i){const d=e(".wpd-thread-filter");void 0===i||isNaN(i.wc_all_comments_count_new)||void 0===i.wc_all_comments_count_new||!i.wc_all_comments_count_new?d.find(".wpd-filter").addClass("wpdiscuz-hidden"):d.find(".wpd-filter").removeClass("wpdiscuz-hidden")})),e("body").on("click",".wpd_editable_comment",(function(){q&&e(".wpdiscuz-edit-form-wrap").length&&Q(fe(e(".wpdiscuz-edit-form-wrap"),0),q);var t=e(this),o=fe(t,0),a=he(o),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",a),q=e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-text").get(0),Le(v,!0,n).done((function(a){if("object"==typeof a)if(a.success){if(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(a.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+o);n.clipboard.dangerouslyPasteHTML(0,a.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+o).val(a.data.content),Fe(e("#wc-textarea-edit_"+o));e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error");else console.log(a);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wc_save_edited_comment",(function(){var t=e(this),o=fe(t),a=he(o),n=e("#wpd-comm-"+o+" #wpdiscuz-edit-form");if(ze(n,"#wpd-editor-edit_"+o),n.on("submit",(function(e){e.preventDefault()})),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",a),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())})),Le(v,!0,i).done((function(n){"object"==typeof n?(n.success?(Q(o,n.data.message),n.data.comment_approved_html&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-subheader").append(n.data.comment_approved_html),n.data.lastEdited&&(e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),Me(n,a)):wpdiscuzAjaxObj.setCommentMessage(n,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("click",".wc_cancel_edit",(function(){var t=fe(e(this));Q(t,q),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)})),!u&&w&&(L=0,1==w?setTimeout((function(){Y(!0)}),500):e("body").on("click",".wpd-load-comments",(function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Y(!0)}))),e("body").on("click",".wpd-load-more-submit",(function(){var t=e(this),o="wpd-loaded";t.hasClass(o)&&Y(!1,t,o,"wpd-loading")}));var G=!1;function $(){var t=document.getElementById("wpdiscuzHasMoreComments"),o=0;t&&(o=t.dataset.is_show_load_more);var a=document.getElementById("wpdcom")?document.getElementById("wpdcom").clientHeight:0,n=e(window).height()+e(window).scrollTop();a&&n&&(100*n/a>=80&&!1===G&&1==o&&(G=!0,Y(!1,e(".wpd-load-more-submit"))))}function Y(t,o,a,n){o&&(o.toggleClass(a),o.toggleClass(n));var d=new FormData;d.append("action","wpdLoadMoreComments");var s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s),d.append("offset",L),d.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),d.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");d.append("wpdType",c||""),Le(v,!t||1!=w,d).done((function(d){"object"==typeof d&&d.success&&(L++,t&&pe(e(".wpd-comment")),function(t){var o=e(".wpd-thread-list").children(".wpdiscuz_single").get();e(".wpdiscuz-comment-pagination").before(t);for(var a=0;a<o.length;a++)we(o[a])}(d.data.comment_list),X(d,t&&2!==i),G=!1,d.data.loadLastCommentId&&(p=d.data.loadLastCommentId),Me(d),t&&J(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})).fail((function(t,i,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}))}function X(t,o){var a,n=document.getElementById("wpdiscuzHasMoreComments");if(0==t.data.is_show_load_more)n&&(n.dataset.is_show_load_more=0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();else if(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),n&&(n.dataset.is_show_load_more=1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show(),t.data.comments_left>0){if(!e(".wpd-load-more-submit .wpd-comments-left").length){const t=e("<span>");t.addClass("wpd-comments-left"),e(".wpd-load-more-submit").append(t)}e(".wpd-load-more-submit .wpd-comments-left").text(t.data.comments_left_text)}Me(t)}function J(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout((function(){ve(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,je),t&&Z(a)}),500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),Le(v,!0,n).done((function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;if(e("#comment-"+o.data.parentCommentID).length){var i=e("#comment-"+o.data.parentCommentID).parents('[id^="wpd-comm-'+o.data.parentCommentID+'_"]');re(i),i.replaceWith(o.data.message)}else e(".wpd-thread-list").prepend(o.data.message);Me(o),ve(),e("html, body").animate({scrollTop:e(n).offset().top-E},1e3,je),t&&Z(a)}e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}}}function Z(t){setTimeout((function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")}),1100)}function ee(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)_e((t=o[a]).comment_parent,t.comment_html)}2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),$(),e(window).scroll((function(){$()}))),wpdiscuzAjaxObj.setLoadMoreVisibility=X,e("body").on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",(function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var o,a=he(fe(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),Le(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("#comment-"+a+" .wpd-comment-footer .wpd-vote-result"),d=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",d),i.removeClass("wpd-up wpd-down"),d>0&&i.addClass("wpd-up"),d<0&&i.addClass("wpd-down")}else{var s=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-like"),c=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-result-dislike");s.text(n.data.likeCountHumanReadable),s.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount,10)>0?s.addClass("wpd-up"):s.removeClass("wpd-up"),parseInt(n.data.dislikeCount,10)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var r=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-up"),p=e("#comment-"+a+" .wpd-comment-footer .wpd-vote-down");r.removeClass("wpd-up"),p.removeClass("wpd-down"),n.data.curUserReaction>0?r.addClass("wpd-up"):n.data.curUserReaction<0&&p.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");Me(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click","body",(function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()})),e("body").on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",(function(){var t=e(this),o=e(this).attr("data-sorting");if(o){e(".wpd-load-comments").parents(".wpd-load-more-submit-wrap").remove(),e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),Le(v,!0,a).done((function(t){"object"==typeof t&&t.success&&(pe(e("#wpdcom .wpd-comment")),e("#wpdcom .wpd-thread-list").prepend(t.data.message),X(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),window.onhashchange=function(){J(!1)},1!=w&&J(!1),e("body").on("click",".wpdiscuz-readmore",(function(){var t=fe(e(this)),o=he(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),Le(v,!0,a).done((function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),Me(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}));var te=function(){if(void 0!==wpdiscuzAjaxObj.storeCommentDrafts&&!parseInt(wpdiscuzAjaxObj.storeCommentDrafts,10))return!1;try{return window.sessionStorage.setItem("wpd-draft-probe","1"),window.sessionStorage.removeItem("wpd-draft-probe"),!0}catch(e){return!1}}(),oe={};function ae(e){return"wpd-draft-"+(parseInt(wpdiscuzAjaxObj.wc_blog_id,10)||1)+"-"+d+"-"+e}function ne(t){if(wpdiscuzLoadRichEditor){var o=wpDiscuzEditor.getEditor("#wpd-editor-"+t);if(!o||!document.body.contains(o.root))return null;var a=e(o.root);return e.trim(a.text()).length||e("img",a).length?o.root.innerHTML:""}var n=e("#wc-textarea-"+t);return n.length?e.trim(n.val()||""):null}function ie(e,t){if(te&&e)try{t?window.sessionStorage.setItem(ae(e),t):window.sessionStorage.removeItem(ae(e))}catch(e){}}function de(e){var t=oe[e];t&&(clearTimeout(t.timer),delete oe[e],ie(e,t.text))}function se(e){oe[e]&&(clearTimeout(oe[e].timer),delete oe[e])}function ce(t){if(te&&t&&!ne(t)){var o;try{o=window.sessionStorage.getItem(ae(t))}catch(e){return}if(o){var a=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor("#wpd-editor-"+t):null;if(a)a.clipboard.dangerouslyPasteHTML(0,o),a.update(),a.setSelection(a.getLength(),0);else{var n=e("#wc-textarea-"+t);if(!n.length)return;n.val(o),Fe(n)}e(document.body).trigger("wpdiscuz_draft_restored",[t,o])}}}function re(e){wpdiscuzLoadRichEditor&&e&&e.length&&e.each((function(){wpDiscuzEditor.removeEditorsIn(this)}))}function pe(e){re(e),e.remove()}function le(e,t){return e.filter(t).add(e.find(t))}function we(t){var o=e('[id="'+t.id+'"]').not(t);if(o.length){var a=function(t,o){var a=[];return e('[id^="wpd-secondary-form-wrapper-"], .wpdiscuz-edit-form-wrap',t).each((function(){var t=e(this),n=t.hasClass("wpdiscuz-edit-form-wrap"),i=fe(t,0),d=le(o,'[id="wpd-comm-'+i+'"]'),s=d.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd-comment-text").first(),c=d.children('[id="wpdiscuz_form_anchor-'+i+'"]');a.push({uniqueId:i,form:t,host:d,isEdit:n,target:n?s:c,hasContent:me(t)})})),a}(t,o);if(function(e){for(var t=0;t<e.length;t++)if(e[t].hasContent&&!e[t].target.length)return!0;return!1}(a))pe(o);else{var n,i=a.length?a[0].form.get(0):null,d={top:(n=(i||t).getBoundingClientRect()).top,visible:n.top<e(window).height()&&n.bottom>0},s=function(t){for(var o=0;o<t.length;o++){var a,n,i=t[o].form.get(0),d=document.activeElement;if(d&&(d===i||e.contains(i,d)))return a=t[o].isEdit?"#wpd-editor-edit_"+t[o].uniqueId:"#wpd-editor-"+t[o].uniqueId,(n=wpdiscuzLoadRichEditor?wpDiscuzEditor.getEditor(a):null)?{editor:n,range:n.getSelection()}:{element:d,start:"number"==typeof d.selectionStart?d.selectionStart:null,end:d.selectionEnd}}return null}(a);!function(t,o){e(t).find(".wpd-new-loaded-comment").addBack(".wpd-new-loaded-comment").each((function(){le(o,'[id="'+this.id+'"]').addClass("wpd-new-loaded-comment")}))}(t,o);for(var c=0;c<a.length;c++)ue(a[c]);pe(e(t)),function(e,t){if(!e||!t.visible)return;var o=e.getBoundingClientRect().top-t.top;if(!o)return;ve(),window.scrollBy(0,o),je()}(i||o.get(0),d),function(e){if(!e)return;e.editor?(e.editor.focus(),e.range&&e.editor.setSelection(e.range.index,e.range.length)):e.element&&(e.element.focus(),null!==e.start&&e.element.setSelectionRange(e.start,e.end))}(s)}}}function me(t){var o,a=e(".ql-editor",t),n=!1,i={};return o=a.length?e.trim(a.text()).length>0||e("img",a).length>0:e.trim(e(".wc_comment",t).val()||"").length>0,Object.defineProperty(i,"hasContent",{enumerable:!0,get:function(){return n},set:function(e){n=n||!0===e}}),e(document.body).trigger("wpdiscuz_form_has_content",[t,i,o]),o||n}function ue(e){e.target.length&&(e.isEdit?(e.target.replaceWith(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-comment-right .wpd_editable_comment").hide(),e.host.children(".wpd-comment-wrap").find(".wpd-comment-last-edited").hide()):(e.target.before(e.form),e.host.children(".wpd-comment-wrap").find(".wpd-reply-button").addClass("wpdiscuz-clonned")))}function fe(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function he(e){return e.substring(0,e.indexOf("_"))}function be(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function _e(t,o){if(0==t)xe(o);else{var a=fe(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function ge(){var t=[];return e(".wpd-comment-right").each((function(){t.push(he(fe(e(this),0)))})),t.join(",")}function ze(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){if("wpdiscuz-subscribe-form"==e.attr("id"))return;var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(o)}(t),e.each(a,(function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()}))}function ve(){e("html, body").css("scroll-behavior","unset")}function je(){e("html").css("scroll-behavior",H),e("body").css("scroll-behavior",U)}function xe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ye(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),(function(t,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))}))}if(te&&(e("body").on("input","#wpdcom .ql-editor, #wpdcom textarea.wc_comment",(function(){var t,o=function(t){var o=t.closest(".wpd-form"),a=e(".wpdiscuz_unique_id",o).val();return a&&0!==a.indexOf("edit_")?a:""}(e(this));o&&null!==(t=ne(o))&&(se(o),oe[o]={text:t,timer:setTimeout((function(){de(o)}),400)})})),window.addEventListener("beforeunload",(function(){for(var e in oe)oe.hasOwnProperty(e)&&de(e)})),e("#wpd-editor-0_0, #wc-textarea-0_0").length&&ce("0_0")),e("body").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("body").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("body").on("click",".wpd-tools",(function(){var t=e(".wpd-tools-actions",e(this));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("body").on("mouseleave",".wpd-comment-right",(function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})})),e("body").on("click",".wpd_stick_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd_close_btn",(function(){var t=he(fe(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),Le(v,!0,o).done((function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",(function(){const t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(t),t.toggleClass("wpdf-active wpd_not_clicked");const a=t.find("i"),n=a.hasClass("fas"),i=a.attr("class").match(/fa-[\w-]+/g)||[];i.forEach((e=>{a.removeClass(e)})),e(a).addClass("fa-pulse fa-spinner"),n||e(a).addClass("fas"),L=1;const d=new FormData;d.append("action","wpdLoadMoreComments"),d.append("lastParentId",0),d.append("offset",0),d.append("wpdType",t.hasClass("wpdf-active")?o:""),d.append("isFirstLoad",1);const s=e(".wpdiscuz-sort-button-active").attr("data-sorting");s&&d.append("sorting",s);const c=t.hasClass("wpdf-active");Le(v,!1,d).done((function(a){"object"==typeof a&&a.success?(e(".wpd-load-comments").remove(),pe(e(".wpd-comment")),e(".wpd-thread-list").prepend(a.data.comment_list),X(a),p=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),Me(a),e(document.body).trigger("wpdiscuz_filtering_success",[t,o,c])):e(document.body).trigger("wpdiscuz_filtering_fail",[t,o,c])})).fail((function(e,t,o){console.log(o)})).always((function(){e("#wpdiscuz-loading-bar").fadeOut(250),t.addClass("wpd_not_clicked"),a.removeClass("fa-pulse fa-spinner"),a.addClass(i.join(" ")),n||a.removeClass("fas"),e(document.body).trigger("wpdiscuz_filtering_done",[t,o,c])}))})),e("body").on("wpdiscuz_filtering_success",(function(t,o,a,n){"inline"===a?n?function(t){const o=new FormData;o.append("action","wpdGetInlineFilterCta"),Le(v,!1,o).done((function(t){"object"==typeof t&&t.success&&t.data.html&&e(".wpd-filter-container").empty().append(e(t.data.html)).removeClass("wpdiscuz-hidden")}))}():e(".wpd-inline-filter-cta").remove():n&&e(".wpd-inline-filter-cta").remove()})),e("body").on("wpdiscuz_filtering_done",(function(t,o,a,n){0===e(".wpd-filter.wpdf-active").length?e(".wpd-filter-container").addClass("wpdiscuz-hidden").empty():e(".wpd-filter-container").children().length&&e(".wpd-filter-container").removeClass("wpdiscuz-hidden")})),wpdiscuzAjaxObj.resetActiveFilters=function(t){var o=e(".wpd-filter.wpdf-active");t&&(o=o.not(t)),o.removeClass("wpdf-active")},e("body").on("click",".wpd-filter-view-all",(function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")})),e("body").on("click",".wpd-follow-link.wpd_not_clicked",(function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=he(fe(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),Le(v,!0,a).done((function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data.code],o.data.code,t),"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass),Me(o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),ye(),e("body").on("keyup",".wc_email",(function(){ye(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")})),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout((function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover");const t=wpdiscuzAjaxObj.bubbleHintShowOnce?"/":location.href;wpdiscuzAjaxObj.bubbleHintCookieExpires&&parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10);Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:parseInt(wpdiscuzAjaxObj.bubbleHintCookieExpires,10),path:t}),setTimeout((function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),1e3*k)}),1e3*C),"content_left"===A)if(e(".entry-content").length){var Ce=(ke=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){Ce=(ke=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ke;Ce=(ke=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ke:25;e("#wpd-bubble-wrapper").css({left:Ce+"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("body").on("click","#wpd-bubble-add-message-close",(function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")})),e("body").on("click","#wpd-bubble",(function(){ve(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(E+28)},1e3,(function(){je(),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("body").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("body").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"),J(!0);var o=t.match(/#comment\-(\d+)/);F=F.filter((function(e){return e!=o[1]})),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")}),100)})),e("body").on("click","#wpd-bubble-count",(function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),Le(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})),ee(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(ve(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,je)),Me(t)),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(e,t,o){console.log(o)}))}}))}if((x&&y||s)&&(t||!t&&r)&&setTimeout((function t(){if(j&&Math.ceil(Date.now()/1e3)-R>Math.floor(c/1e3/2))return setTimeout(t,c),console.log("You are not interacted with the website, the request has been blocked!"),!1;e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:l,visibleCommentIds:ge()}}).done((function(o){if(!M)if("object"==typeof o){if(o.commentIDsToRemove.forEach((function(t){pe(e('[id^="wpd-comm-'+t+'_"]'))})),o.ids.length){s&&function(){var t=new FormData;t.append("action","wpdUpdateAutomatically"),t.append("loadLastCommentId",p),t.append("visibleCommentIds",ge()),Le(v,!1,t).done((function(t){M||"object"==typeof t&&t.success&&(ee(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new,10),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),p=t.data.loadLastCommentId)})).fail((function(e,t,o){console.log(o)}))}(),o.ids=o.ids.filter((function(t){if(!e("#comment-"+t).length)return t}));var a=5e3;l=parseInt(o.ids[o.ids.length-1],10),F=F.concat(o.ids),O&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text(),10);n+=o.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout((function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count,10),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),e(".wpd-reviews-tab").length||(e(".wpd-thread-info").html(o.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",o.all_comments_count))}else console.log(o);setTimeout(t,c)})).fail((function(e,o,a){console.log(a),setTimeout(t,c)}))}),c),e(".wpd-inline-form-wrapper").length){var Oe=new FormData;Oe.append("action","wpdGetInlineCommentForm"),Le(v,!1,Oe).done((function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),(function(){var t=e(this).attr("id"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.lastIndexOf("-")+1))})),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),Te()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)})).fail((function(e,t,o){console.log(o)}))}function Ae(e){var t=wpdiscuzAjaxObj.antispamFieldPrefixes;if(!e||!Array.isArray(t))return!1;for(var o=0;o<t.length;o++)if(0===e.indexOf(t[o]))return!0;return!1}function Ie(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function Ee(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function De(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),(function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<300&&("blink"===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"),Te(t.siblings(".wpd-inline-form-wrapper"))))}))}function Te(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"),10)-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"),10)+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),(function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"),10)-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"),10)+(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 Fe(t){var o,a=0;if(t.parents(".wpd_main_comm_form").length)a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength,10),o=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10),o=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=fe(t);a=parseInt(n.substring(n.lastIndexOf("_")+1),10)?parseInt(wpdiscuzAjaxObj.replyTextMaxLength,10):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=t.parents("#wpdiscuz-edit-form")}if(a&&o){var i=t.val().length,d=e(".wpd-editor-char-counter",o),s=a-i;d.html(s),s<=10?d.addClass("error"):d.removeClass("error")}}function Me(t,o,a,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,(function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")}))}function Le(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.has("postId")||a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],(function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))}));var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;function s(){return e.ajax({type:"POST",url:i,data:a,contentType:!1,processData:!1})}if("wpdGetNonce"!==n&&wpdiscuzAjaxObj.nonceName){if(!S){var c=e.Deferred();return function(t){if(S)return e.Deferred().resolve(S).promise();if(P)return P;var o=new FormData;return o.append("action","wpdGetNonce"),P=Le(t,!1,o).always((function(e){e&&e.data&&(S=e.data[wpdiscuzAjaxObj.nonceName]),P=null}))}(t).always((function(){S&&a.append(wpdiscuzAjaxObj.nonceName,S),s().done((function(){c.resolve.apply(c,arguments)})).fail((function(){c.reject.apply(c,arguments)}))})),c.promise()}a.append(wpdiscuzAjaxObj.nonceName,S)}return s()}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){Ee();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),Te(o.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()})),e("body").on("click",".wpd-inline-submit.wpd_not_clicked",(function(t){t.preventDefault();var o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",Ie(a)),e.each(e("input, textarea",a),(function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())})),function(t,o){e("input, textarea","#wpdiscuz_hidden_secondary_form").not(":checkbox, :radio, :file, :submit, :button").each((function(){Ae(this.name)&&!t[0].elements.namedItem(this.name)&&o.append(this.name,this.value)}))}(a,n),Le(v,!0,n).done((function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t){if(t.success){a[0].reset(),Ee();var n=parseInt(t.data.newCount,10),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew,10),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&&xe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else if(t.data){var d="object"==typeof t.data&&t.data.error?t.data.error:wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,o);wpdiscuzAjaxObj.setCommentMessage(d,"error")}}else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}})),e("body").on("keydown",".wpd-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")})),e("body").on("keydown","#wpdiscuz-edit-form",(function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")})),e("body").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("body").on("click",".wpd-inline-icon-count.wpd-has-comments",(function(){var t=e(this),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",Ie(t)),Le(v,!0,o).done((function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e("body").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"),ve(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-E},1e3,je)})),e("body").on("click",".wpd-feedback-content-link",(function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ve(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-(E+6)},1e3,(function(){je(),e("#wpd-inline-"+o).addClass("wpd-active")}))})),"scroll_open"!==I&&"blink"!==I||(De(),e(window).on("scroll",De)),e("body").on("click",".wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",(function(){var t=e(this).closest(".wpd-post-rating"),o=t.data("post-id"),a=t.data("rate-editable");if(void 0===a&&(a=m),parseInt(a,10)&&!confirm(wpdiscuzAjaxObj.wc_confirm_rate_edit))return!1;var n=new FormData,i=e(this).index();i>=0&&i<5&&(n.append("action","wpdUserRate"),n.append("rating",i+1),n.append("postId",o||d),Le(v,!0,n).done((function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),Me(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})))})),e("body").on("submit","#wpdiscuz-subscribe-form",(function(t){t.preventDefault();var o=e(this);const a=e("#wpdiscuz_subscription_button",o);if(o[0].checkValidity()&&(d=o,s=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).val().length?(s=!1,e(".wpdiscuz-recaptcha",d).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",d).length&&e(".wpdiscuz-recaptcha",d).css("border","none"),s)&&a.hasClass("wpd_not_clicked")){a.removeClass("wpd_not_clicked");var i=new FormData;i.append("action","wpdAddSubscription"),e("*",o).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())})),Le(v,!0,i).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,a.addClass("wpd_not_clicked")})).fail((function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)}))}var d,s})),e("body").on("click",".wpd-unsubscribe",(function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),Le(v,!0,o).done((function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout((function(){location.reload(!0)}),3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1})).fail((function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))})),e(document).on("click keydown",".wpd-by-toggle",(function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||"Spacebar"===t.key){t.preventDefault();var o=e(this),a=o.closest(".by-wpdiscuz").find(".wpd-by-link"),n=o.is(document.activeElement);a.css("display","inline"),o.css("display","none"),n&&a.length&&a[0].focus()}})),wpdiscuzAjaxObj.getAjaxObj=Le}));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")}};
  • wpdiscuz/trunk/class.WpdiscuzCore.php

    r3698558 r3733158  
    44 * Plugin URI: https://wpdiscuz.com/
    55 * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
    6  * Version: 7.6.71
     6 * Version: 7.6.72
    77 * Author: gVectors Team
    88 * Author URI: https://gvectors.com/
    … …  
    560560     *
    561561     * when WordPress refuses the comment as a duplicate of one it stored as spam or
    562      * trash, a commenter sending a rejected comment again for instance, the request ends
    563      * with the rejected comment response instead of the duplicate error
     562     * trash, a commenter sending a spam comment again for instance, the request ends
     563     * with the rejected comment response instead of the duplicate error. WordPress's own
     564     * duplicate check skips trashed comments, so a trash match can only come from another
     565     * duplicate_comment_id callback
    564566     *
    565567     * @param array $commentData comment data passed to WordPress
    … …  
    633635         *
    634636         * WordPress refuses a comment identical to one it already stored, spam included, so a
    635          * commenter who sends a rejected comment again reaches this filter again with
     637         * commenter who sends a spam comment again reaches this filter again with
    636638         * $isDuplicateRetry set to true. Nothing is stored for that attempt and $comment is the
    637639         * earlier comment, so a reason recorded only while that comment was being rejected is
    638          * not available to the retry.
     640         * not available to the retry. WordPress's own duplicate check skips trashed comments, so
     641         * a trashed comment sent again is stored again as a new comment, and reaches this filter
     642         * as one when it is caught again.
    639643         *
    640644         * The message is escaped here, so a filter passes plain text and not markup. A
  • wpdiscuz/trunk/readme.txt

    r3698558 r3733158  
    44Requires at least: 6.0
    55Tested up to: 7.1
    6 Stable tag: 7.6.71
     6Stable tag: 7.6.72
    77Requires PHP: 7.4
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 WordPress comments plugin with AJAX live comments, comment voting, inline feedback, social login and custom comment forms.
     11WordPress comments plugin with AJAX live comments, comment voting, inline feedback, social login, custom comment forms and WooCommerce reviews.
    1212
    1313== Description ==
    … …  
    203203Please remember to delete all caches and purge CDN after the update.
    204204
    205 = Comments - wpDiscuz v7.6.71 - 16.09.2026 =
    206 
    207 * Fixed: The comment bubble and the live comment update never showed comments posted without an email address to visitors who have no email address themselves, visitors who have not commented yet and guests who comment anonymously. A visitor's own new comments are left out of these updates by their email address, and an empty address matched every comment posted without one, so anonymous commenters were hidden from each other and from everyone who has not commented. The email address is now only used when the visitor has one, a guest commenting anonymously keeps their own comments out of the update through the ones already on their screen.
    208 * Fixed: The new comment message of the comment bubble described the newest comment of the post, even when the bubble was not notifying about that comment, the visitor's own comment or one already on their screen. It now describes the newest comment the visitor is being notified about, and is left out of the response when that comment cannot be read, a private comment an addon keeps from the visitor for instance, where it used to be built from nothing.
    209 * Fixed: The Cookies Consent and Agreement checkbox labels were printed on the comment form, and on the comment edit form, without being escaped. The labels are cleaned when the form is saved, but that only applies to what is saved from then on, so a label stored before v7.6.13 kept whatever markup it was given and was still printed as markup to every visitor. The labels are now filtered where they are printed, the agreement label by the same rules its own save path allows and the cookies consent label by a narrow set that keeps links and inline formatting, so a label that still holds script no longer runs it. The field name is escaped in the wrapper class of the cookies consent and text area fields as well, as it already was in the other field types.
    210 * Fixed: The info icon of the "powered by wpDiscuz" line below the comments carried its behaviour in an inline onclick attribute, which a Content Security Policy that forbids inline script blocks outright, leaving the icon unresponsive with nothing to explain why. It also reached the link through fixed element ids, so a page showing more than one comment form always toggled the first one, and it could not be reached from the keyboard at all. The icon is now handled from wpdiscuz.js, is operable by keyboard, toggles the block it belongs to, and moves focus to the link it reveals.
    211 * Fixed: The minimal theme carried none of the styles for the "powered by wpDiscuz" line. That stylesheet loads instead of the default theme one rather than alongside it, so the wpDiscuz link was shown permanently and unstyled, and the info icon beside it toggled nothing a reader would notice.
    212 * Fixed: The HTML field printed its markup on the comment form without being filtered. The markup is cleaned when the form is saved, but that only applies to what is saved from then on, so an HTML field stored before v7.6.13 kept whatever markup it was given and was still printed as markup to every visitor, and cloning a form or importing one copies such a value across untouched. It is now filtered where it is printed, by the same rules its own save path allows, so a field that still holds script no longer runs it. Its code is shown as plain text until the field is cleared. The number field description is escaped where it is printed as well, as it already was in the other field types.
    213 * Fixed: The titles of the comment editor toolbar buttons were passed through the translation function a second time where they are printed, against wpDiscuz's own text domain. The titles are already translated by that point, so the title of a button added by an addon was looked up in a text domain it does not belong to, and a title the addon had already escaped was escaped a second time, which shows the escape sequence itself to the reader in any title holding an apostrophe or an ampersand. The titles are now only escaped where they are printed.
    214 * Fixed: The icon height and the tab title of each card on the settings dashboard, and the icon class of the file attachment button on the comment form, were printed without being escaped. All three are supplied through settings arrays and filters an addon can extend, so a value holding a quote or a tag was printed as markup rather than as the value it was meant to be. They are now escaped where they are printed, as the values beside them already were.
    215 * Fixed: Replies from guests were rejected as spam on sites where an anti-spam plugin fills in its own hidden fields with JavaScript once the page loads, La Sentinelle for instance, while the first comment posted through the main form went through. A reply form is built by copying the markup of a hidden form on the page, and markup carries the values the page was served with rather than the ones those scripts set, so every reply went out with an untouched honeypot and timer. A second comment from the main form was rejected the same way, because the form is cleared after a comment is posted and clearing it put those fields back to the values the page was served with. The values the scripts set are now carried into every reply form, and kept when the form is cleared.
    216 * Fixed: Every comment a guest posted was rejected while "Detect spambots posting comments" is enabled in All In One Security, stored as spam or discarded depending on its settings. That option rejects a guest comment that arrives without its hidden antibot keys, and it adds those keys only to the comment form WordPress prints itself. wpDiscuz now prints them in its comment, reply and inline feedback forms whenever the option is on. As with the WordPress comment form, a page served from a full-page cache can still carry keys that have expired since, and does not set the cookies its optional cookie check needs.
    217 * Fixed: Inline feedback comments were sent without the fields anti-spam plugins add to comment forms. The feedback form is loaded after the page, and those plugins only add their fields to the comment form, so a plugin that treats a missing field as spam, La Sentinelle for instance, rejected every feedback comment from a guest. A feedback comment is now sent with the Akismet and La Sentinelle fields of the comment form on the same page. The new `wpdiscuz_antispam_field_prefixes` filter adds the input and textarea fields of other plugins by the start of their names, and the same list decides which fields keep their values when a comment form is cleared.
    218 * Fixed: Sending a comment again after it was stored as spam showed WordPress's "Duplicate comment detected" error instead of wpDiscuz's message for a rejected comment. WordPress refuses a comment identical to one it has already stored, spam included, and that refusal was passed on to the commenter as it was. The retry now gets the rejected comment message, "Your comment was not published." by default, and nothing new is stored. The `wpdiscuz_comment_rejected_response` filter runs for the retry as well, with the earlier comment and a new fourth argument set to true, so a plugin that explained the first rejection can tell the retry apart. A comment that repeats a published one, or one awaiting approval, still shows the duplicate error.
     205= Comments - wpDiscuz v7.6.72 - 07.10.2026 =
     206
     207* Fixed: A comment whose image was refused for its width or height was saved anyway, and the error message was empty. The `wpdiscuz_mu_preupload` action now fires before the comment is saved, so a file it refuses stops the comment.
     208* Fixed: The on/off switches on the settings page showed their state by color alone and could not be used from the keyboard. They now show a cross when off and a check mark when on, and can be reached with Tab and toggled with Space. Switches in addon settings tabs get the same fix.
     209
     210[See the changelog for all versions](https://plugins.svn.wordpress.org/wpdiscuz/trunk/changelog.txt)
  • wpdiscuz/trunk/utils/class.WpdiscuzHelperUpload.php

    r3698558 r3733158  
    358358        foreach ($files as $file) {
    359359            $extension = strtolower(pathinfo($file["name"], PATHINFO_EXTENSION));
    360             if (!$this->isAllowedFileType($this->getMimeType($file, $extension), $extension)) {
     360            $mimeType  = $this->getMimeType($file, $extension);
     361            if (!$this->isAllowedFileType($mimeType, $extension)) {
    361362                wp_send_json_error(["error" => sprintf(__(".%s files are not allowed", "wpdiscuz"), $extension)]);
    362363            }
     364            // Fired before the comment is inserted, so a listener that refuses a file with a JSON error
     365            // refuses the comment too, instead of leaving it saved behind the error.
     366            $file["type"] = $this->isImage($file) ?: $mimeType;
     367            do_action("wpdiscuz_mu_preupload", $file);
    363368        }
    364369    }
    … …  
    409414                $error = true;
    410415            }
    411 
    412             do_action("wpdiscuz_mu_preupload", $file);
    413416
    414417            if (!$error) {
Note: See TracChangeset for help on using the changeset viewer.