1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=213)}({1:function(e,t){e.exports=jQuery},11:function(e,t,n){var o=n(3).default;e.exports=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},14:function(e,t,n){"use strict";(function(e,o){n.d(t,"a",(function(){return i}));var i=function(t){t.tooltip({content:function(){return e(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}})};o(document).ready((function(e){i(e(".edd-help-tip"))}))}).call(this,n(1),n(1))},2:function(e,t,n){var o=n(7);e.exports=function(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},213:function(e,t,n){"use strict";n.r(t),n(214),n(215),n(216),n(14),n(217),n(218),n(219),n(220),n(221),n(222),n(223),n(224),n(225)},214:function(e,t,n){(function(e){e(document).ready((function(e){var t=e("input.edd_datepicker");t.length>0&&t.attr("autocomplete","off").datepicker({dateFormat:edd_vars.date_picker_format,beforeShow:function(){e("#ui-datepicker-div").removeClass("ui-datepicker").addClass("edd-datepicker")}})}))}).call(this,n(1))},215:function(e,t,n){(function(e){e(document).ready((function(e){e(".edd-dialog").dialog({autoOpen:!1,modal:!0,draggable:!1,closeOnEscape:!0})}))}).call(this,n(1))},216:function(e,t,n){"use strict";(function(e){var t=n(6);e(document).ready((function(e){e(".edd-select-chosen").each((function(){var n=e(this);n.chosen(Object(t.a)(n))})),e(".edd-select-chosen .chosen-search input").each((function(){if(!e(this).attr("placeholder")){var t=e(this).parent().parent().parent().prev("select.edd-select-chosen").data("search-placeholder");t&&e(this).attr("placeholder",t)}})),e(".chosen-choices").on("click",(function(){var t=e(this).parent().prev().data("search-placeholder");void 0===t&&(t=edd_vars.type_to_search),e(this).children("li").children("input").attr("placeholder",t)})),e("#post").on("click",".edd-thickbox",(function(){e(".edd-select-chosen","#choose-download").css("width","100%")})),e(document.body).on("keyup",".edd-select-chosen .chosen-search input, .edd-select-chosen .search-field input",_.debounce((function(t){var n=e(this),o=n.val(),i=n.closest(".edd-select-chosen"),a=i.prev(),s=a.data("search-type"),c=i.hasClass("no-bundles"),r=i.hasClass("variations"),d=i.hasClass("variations-only"),l=t.which,u="edd_download_search";i.attr("id").replace("_chosen",""),void 0!==s&&"no_ajax"!==s&&(u="edd_"+s+"_search",o.length<=3&&"edd_download_search"===u||16===l||13===l||91===l||17===l||37===l||38===l||39===l||40===l?i.children(".spinner").remove():(i.children(".spinner").length||i.append('<span class="spinner is-active"></span>'),e.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{s:o,action:u,no_bundles:c,variations:r,variations_only:d},beforeSend:function(){a.closest("ul.chosen-results").empty()},success:function(t){e("option:not(:selected)",a).remove(),e.each(t,(function(t,n){e('option[value="'+n.id+'"]',a).length||a.append('<option value="'+n.id+'">'+n.name+"</option>")}));var o=n.val();a.trigger("chosen:updated"),n.val(o)}}).fail((function(e){window.console&&window.console.log&&console.log(e)})).done((function(e){i.children(".spinner").remove()}))))}),342))}))}).call(this,n(1))},217:function(e,t,n){(function(e){e(document).ready((function(e){var t=".edd-vertical-sections.use-js";if(0!==e(t).length){e("".concat(t," .section-content")).hide();var n=window.location.hash;n&&n.includes("edd_")?(e(t).find(n).show(),e("".concat(t," .section-title")).attr("aria-selected","false").removeClass("section-title--is-active"),e(t).find('.section-title a[href="'+n+'"]').parents(".section-title").attr("aria-selected","true").addClass("section-title--is-active")):(e("".concat(t," .section-content:first-child")).show(),e("".concat(t," .section-nav li:first-child")).attr("aria-selected","true").addClass("section-title--is-active")),e("".concat(t," .section-nav li a")).on("click",(function(t){t.preventDefault();var n=e(this),o=n.attr("href"),i=n.parents(".edd-vertical-sections");i.find(".section-content").hide(),i.find(o).show(),i.find(".section-title").attr("aria-selected","false").removeClass("section-title--is-active"),n.parent().attr("aria-selected","true").addClass("section-title--is-active"),i.find("div.chosen-container").css("width","100%"),window.history.pushState("object or string","",o)}))}}))}).call(this,n(1))},218:function(e,t,n){(function(e){e(document).ready((function(e){var t=e("ul.edd-sortable-list");t.length>0&&t.sortable({axis:"y",items:"li",cursor:"move",tolerance:"pointer",containment:"parent",distance:2,opacity:.7,scroll:!0,stop:function(){var t=e.map(e(this).children("li"),(function(t){return e(t).data("key")}));e(this).prev("input.edd-order").val(t)}})}))}).call(this,n(1))},219:function(e,t,n){(function(e){e(document).ready((function(e){e(".edd-ajax-user-search").keyup((function(){var t=e(this).val(),n="";e(this).data("exclude")&&(n=e(this).data("exclude")),e(".edd_user_search_wrap").addClass("loading");var o={action:"edd_search_users",user_name:t,exclude:n};e.ajax({type:"POST",data:o,dataType:"json",url:ajaxurl,success:function(t){e(".edd_user_search_wrap").removeClass("loading"),e(".edd_user_search_results").removeClass("hidden"),e(".edd_user_search_results span").html(""),t.results&&e(t.results).appendTo(".edd_user_search_results span")}})})).blur((function(){t?t=!1:(e(this).removeClass("loading"),e(".edd_user_search_results").addClass("hidden"))})).focus((function(){e(this).keyup()})),e(document.body).on("click.eddSelectUser",".edd_user_search_results span a",(function(t){t.preventDefault();var n=e(this).data("login");e(".edd-ajax-user-search").val(n),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")})),e(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",(function(t){t.preventDefault(),e(".edd-ajax-user-search").val(""),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")}));var t=!1;e(".edd_user_search_results").mousedown((function(){t=!0}))}))}).call(this,n(1))},220:function(e,t,n){(function(e,t){function n(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t("#edd-advanced-filters");if(!n.hasClass("open"))return!1;!1!==e&&(n.is(e)||n.has(e).length)||o()}function o(){t("#edd-advanced-filters").toggleClass("open")}e(document).ready((function(e){e(".edd-advanced-filters-button").on("click",(function(e){e.preventDefault(),o()})),e(document).on("click",(function(e){n(e.target)})),e(document).on("keydown",(function(e){"Escape"===e.key&&n()}))}))}).call(this,n(1),n(1))},221:function(e,t,n){(function(e){e(document).ready((function(e){(e("body").hasClass("taxonomy-download_category")||e("body").hasClass("taxonomy-download_tag"))&&e(".nav-tab-wrapper, .nav-tab-wrapper + br").detach().insertAfter(".wp-header-end")}))}).call(this,n(1))},222:function(e,t,n){(function(e){e(document).ready((function(e){e(".edd_countries_filter").on("change",(function(){var t=e(this),n={action:"edd_get_shop_states",country:t.val(),nonce:t.data("nonce"),field_name:"edd_regions_filter"};return e.post(ajaxurl,n,(function(t){e("select.edd_regions_filter").find("option:gt(0)").remove(),"nostates"!==t&&e(t).find("option:gt(0)").appendTo("select.edd_regions_filter"),e("select.edd_regions_filter").trigger("chosen:updated")})),!1}))}))}).call(this,n(1))},223:function(e,t,n){(function(e){e(document).ready((function(e){var t=e(".edd-admin-notice-overlay"),n="edd-promo-notice__overlay";t&&(t.wrap('<div class="'+n+'"></div>'),e(".edd-promo-notice__trigger").on("click",(function(){e("."+n).css("display","flex").hide().fadeIn()}))),e(".edd-promo-notice").each((function(){var t=e(this);t.on("click",".edd-promo-notice-dismiss",(function(o){e(this).attr("href")||o.preventDefault(),e.ajax({type:"POST",data:{action:"edd_dismiss_promo_notice",notice_id:t.data("id"),nonce:t.data("nonce"),lifespan:t.data("lifespan")},url:ajaxurl,success:function(o){e("."+n).length?(e("."+n).fadeOut(),e(".edd-extension-manager__key-notice").hide()):t.slideUp()}})})),e(document).on("keydown",(function(t){e("."+n).length&&27===t.keyCode&&(e("."+n).fadeOut(),e(".edd-extension-manager__key-notice").hide())}))}))}))}).call(this,n(1))},224:function(e,t){document.addEventListener("alpine:init",(function(){Alpine.store("eddNotifications",{isPanelOpen:!1,notificationsLoaded:!1,numberActiveNotifications:0,activeNotifications:[],inactiveNotifications:[],init:function(){var e=this,t=document.querySelector("#edd-notification-button .edd-number");t&&t.classList.remove("edd-hidden"),document.addEventListener("keydown",(function(t){"Escape"===t.key&&e.closePanel()}));var n=new URLSearchParams(window.location.search);n.has("notifications")&&"true"===n.get("notifications")&&e.openPanel()},openPanel:function(){var e=this,t=document.getElementById("edd-notifications-header");if(this.notificationsLoaded)return this.isPanelOpen=!0,void(t&&setTimeout((function(){t.focus()})));this.isPanelOpen=!0,this.apiRequest("/notifications","GET").then((function(n){e.activeNotifications=n.active,e.inactiveNotifications=n.dismissed,e.notificationsLoaded=!0,t&&t.focus()})).catch((function(e){console.log("Notification error",e)}))},closePanel:function(){if(this.isPanelOpen){this.isPanelOpen=!1;var e=document.getElementById("edd-notification-button");e&&e.focus()}},apiRequest:function(e,t){return fetch(edd_vars.restBase+e,{method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":edd_vars.restNonce}}).then((function(e){return e.ok?e.text():Promise.reject(e)})).then((function(e){return e?JSON.parse(e):null}))},dismiss:function(e,t){var n=this;if(void 0!==this.activeNotifications[t]){e.target.disabled=!0;var o=this.activeNotifications[t];this.apiRequest("/notifications/"+o.id,"DELETE").then((function(e){n.activeNotifications.splice(t,1),n.numberActiveNotifications=n.activeNotifications.length})).catch((function(e){console.log("Dismiss error",e)}))}}})}))},225:function(e,t,n){"use strict";(function(e){var t=n(4);Object(t.a)((function(){e(".download_page_edd-payment-history .row-actions .delete a").on("click",(function(t){t.preventDefault();var n=e(this).attr("href");e("#edd-single-delete-dialog").dialog({buttons:[{text:edd_vars.cancel_dialog_text,class:"button-secondary",click:function(){e(this).dialog("close")}},{text:edd_vars.confirm_dialog_text,class:"button-primary",click:function(){e(this).dialog("close"),window.location.href=n}}]}),e("#edd-single-delete-dialog").dialog("open")})),e(".download_page_edd-payment-history").on("click","#doaction",(function(t){var n=e("#bulk-action-selector-top").val(),o=e(this).closest("form");"delete"===n&&(t.preventDefault(),e("#edd-bulk-delete-dialog").dialog({buttons:[{text:edd_vars.cancel_dialog_text,class:"button-secondary",click:function(){e(this).dialog("close")}},{text:edd_vars.confirm_dialog_text,class:"button-primary",click:function(){e(this).dialog("close"),o.submit()}}]}),e("#edd-bulk-delete-dialog").dialog("open"))}))}))}).call(this,n(1))},3:function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},4:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var o=function(t){e(t)}}).call(this,n(1))},6:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return r}));var o=n(2),i=n.n(o);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c={disable_search_threshold:13,search_contains:!0,inherit_select_classes:!0,single_backstroke_delete:!1,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option,no_results_text:edd_vars.no_results_text},r=function(t){!t instanceof e&&(t=e(t));var n=c;return t.data("search-type")&&delete n.disable_search_threshold,s(s({},n),{},{width:t.css("width")})}}).call(this,n(1))},7:function(e,t,n){var o=n(3).default,i=n(11);e.exports=function(e){var t=i(e,"string");return"symbol"===o(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports}}); |