"use strict";function wp_social_clear_cache(e,t){const a=document.querySelector("#"+e+"_cache_msg");jQuery.ajax({method:"POST",dataType:"json",data:{provider:e,username:t},url:wsluAdminObj.resturl+"wslu/v1/settings/clear_counter_cache",success:function(e){a.innerHTML=e.msg}})}!function(e){e.fn.tab=function(t){var a=e.extend({},e.fn.tab.defaults,t);return this.each((function(){var t=e(this);e(t).find(".tabHeader > .tab__list > .tab__list__item").on(a.trigger_event_type,(function(){e(t).find(".tabHeader > .tab__list > .tab__list__item").removeClass("active"),e(this).addClass("active"),e(t).find(".tabContent > .tabItem").eq(e(this).index()).addClass("active"),e(t).find(".tabContent > .tabItem").hide(),e(t).find(".tabContent > .tabItem").eq(e(this).index()).show()}))}))},e.fn.tab.defaults={trigger_event_type:"click"}}(jQuery),jQuery,jQuery(document).ready((function(e){var t,a,s;e(".post__tab").tab(),e('[data-type="modal-trigger"]').on("click",(function(t){t.preventDefault();var a=e(this).attr("data-target");(a=e("#"+a)).length>0&&(a.addClass("is-open"),e(".xs-backdrop").addClass("is-open"))})),e('[data-modal-dismiss="modal"]').on("click",(function(t){t.preventDefault(),e(this).removeClass("is-open"),e(".xs-modal-dialog").removeClass("is-open"),e(".xs-backdrop").removeClass("is-open")})),e(".wlsu-hover-effect-select").on("change",(function(){var t=e(this).val();e(".wslu-single-social-style-item.wslu-style-free .social_radio_button:checked").trigger("change",["effectChanged",t])})),e(".wslu-single-social-style-item.wslu-style-free").on("change",".social_radio_button",(function(t,a,s){var i=e(this).val(),l=e(".wslu-display-type-container li a.active"),n=e(".wslu-main-content-input").val(),o=null;"fixed_display"==l.data("id")&&(n=e(".wslu-fixed-display-input").val());var c=e(".wlsu-hover-effect-select").val();if("navClicked"==a){e(".wslu-single-social-style-item.wslu-style-free .wslu-global-radio-input").prop("checked",!1),e(".wlsu-hover-effect-select option").first().prop("selected",!0);var r=n.split(":"),d=r[0]!=undefined?r[0]:"",u=r[1]!=undefined?r[1]:"";c=u,i=d,""!=d&&e('.wslu-single-social-style-item.wslu-style-free .wslu-global-radio-input[value="'+d+'"]').prop("checked",!0),""!=u&&e('.wlsu-hover-effect-select option[value="'+u+'"]').prop("selected",!0)}else"effectChanged"===a?c=s!=undefined&&""!=s?s:c:"layoutChanged"===a&&(o=s,i=n!=undefined?n.split(":")[0]:i);o=null==o&&n&&n.split(":")[2]?n.split(":")[2]:o,e(".wslu-share-layout .social_radio_button").prop("checked",!1),e('.wslu-share-layout .social_radio_button[value="'+o+'"]').prop("checked",!0),"vertical"===o?e(".wslu-style-img-v").fadeIn().siblings().hide():e(".wslu-style-img-h").fadeIn().siblings().hide(),e(".wlsu-hover-effect-select option").each((function(){var t=e(this).data("exclude");e(this).show(),t!=undefined&&-1!=t.indexOf(i)&&e(this).hide().prop("selected",!1)})),i=c?i+":"+c:i+":none-none",i=o?i+":"+o:i,"fixed_display"===l.data("id")?e(".wslu-fixed-display-input").val(i):e(".wslu-main-content-input").val(i)})),t=".wslu-layout-btn",a=".wlsu-style-data",s={behavior:"smooth",block:"start"},document.querySelectorAll(t).forEach((e=>{e.addEventListener("click",(()=>{document.querySelector(a).scrollIntoView(s)}))})),(()=>{let t=e(".admin-page-framework-admin-notice-animation-container");t.length&&e(t).find(".notice-dismiss").on("click",(()=>t.remove()))})(),(t=>{e(t).select2({placeholder:"Search..."})})(".wp-social-select-2-dropdown"),(t=>{const a=e(t);a&&a.on("click",(e=>(e.preventDefault(),!1)))})(".wslu--pro"),(e=>{const t=document.querySelector(e);t&&new Sortable(t,{animation:150,ghostClass:"sortable-blue-background",onUpdate:function(){const e=t.children;let a=[];for(let t=0;t<e.length;t++)a.push(e[t].dataset.provider);jQuery.ajax({type:"post",data:{action:t.dataset.action,providers:a,wslu_provider_nonce:wsluAdminObj.rest_nonce},url:t.dataset.sort_url})}})})(".xs-social-block"),e(".wslu-display-type-container").on("click","a",(function(){var t=e(this).data("id");e(this).addClass("active").parent("li").siblings().find("a").removeClass("active"),e("#wslu-"+t).fadeIn().siblings().hide(),e(".wslu-single-social-style-item.wslu-style-free .social_radio_button").first().trigger("change",["navClicked"]),e(".wslu-share-styles-form#xs_style_form").attr("action",e(".wslu-share-styles-form#xs_style_form").data("action")+"#"+t)}));var i="primary_content";"#fixed_display"===window.location.hash&&(i="fixed_display"),e('.wslu-display-type-container li a[data-id="'+i+'"]').trigger("click"),e(".wslu-share-layout").on("change",".social_radio_button",(function(){var t=e(this).val();e(".wslu-single-social-style-item.wslu-style-free .social_radio_button").first().trigger("change",["layoutChanged",t])}))})),jQuery(document).ready((function(e){}));