(function ($, window){
"use strict";
var WooLentorBlocks={
init: function (){
this.TabsMenu($(".ht-tab-menus"), ".ht-tab-pane");
this.TabsMenu($(".woolentor-product-video-tabs"), ".video-cus-tab-pane");
if($("[class*='woolentorblock-'] .ht-product-image-slider").length > 0){
this.productImageThumbnailsSlider($(".ht-product-image-slider"));
}
this.thumbnailsimagescontroller();
this.ThumbNailsTabs(".woolentor-thumbanis-image",
".woolentor-advance-product-image-area"
);
},
TabsMenu: function ($tabmenus, $tabpane){
$tabmenus.on("click", "a", function (e){
e.preventDefault();
var $this=$(this),
$target=$this.attr("href");
$this
.addClass("htactive")
.parent()
.siblings()
.children("a")
.removeClass("htactive");
$($tabpane + $target)
.addClass("htactive")
.siblings()
.removeClass("htactive");
if($(".slick-slider").length > 0){
var $id=$this.attr("href");
$($id).find(".slick-slider").slick("refresh");
}});
},
ThumbNailsTabs: function ($tabmenu, $area){
$($tabmenu).on("click", "li", function (e){
e.preventDefault();
var $image=$(this).data("wlimage");
if($image){
$($area)
.find(".woocommerce-product-gallery__image .wp-post-image")
.attr("src", $image);
$($area)
.find(".woocommerce-product-gallery__image .wp-post-image")
.attr("srcset", $image);
}});
},
initSlickSlider: function ($block){
$($block).css("display", "block");
var settings=WooLentorBlocks.sanitizeObject($($block).data("settings"));
if(settings){
var arrows=settings["arrows"];
var dots=settings["dots"];
var autoplay=settings["autoplay"];
var rtl=settings["rtl"];
var autoplay_speed=parseInt(settings["autoplay_speed"])||3000;
var animation_speed=parseInt(settings["animation_speed"])||300;
var fade=false;
var pause_on_hover=settings["pause_on_hover"];
var display_columns=parseInt(settings["product_items"])||4;
var scroll_columns=parseInt(settings["scroll_columns"])||4;
var tablet_width=parseInt(settings["tablet_width"])||800;
var tablet_display_columns =
parseInt(settings["tablet_display_columns"])||2;
var tablet_scroll_columns =
parseInt(settings["tablet_scroll_columns"])||2;
var mobile_width=parseInt(settings["mobile_width"])||480;
var mobile_display_columns =
parseInt(settings["mobile_display_columns"])||1;
var mobile_scroll_columns =
parseInt(settings["mobile_scroll_columns"])||1;
$($block)
.not(".slick-initialized")
.slick({
arrows: arrows,
prevArrow:
'<button type="button" class="slick-prev" aria-label="Previous slide"><i class="fa fa-angle-left" aria-hidden="true"></i></button>',
nextArrow:
'<button type="button" class="slick-next" aria-label="Next slide"><i class="fa fa-angle-right" aria-hidden="true"></i></button>',
dots: dots,
infinite: true,
autoplay: autoplay,
autoplaySpeed: autoplay_speed,
speed: animation_speed,
fade: fade,
pauseOnHover: pause_on_hover,
slidesToShow: display_columns,
slidesToScroll: scroll_columns,
rtl: rtl,
responsive: [
{
breakpoint: tablet_width,
settings: {
slidesToShow: tablet_display_columns,
slidesToScroll: tablet_scroll_columns,
},
},
{
breakpoint: mobile_width,
settings: {
slidesToShow: mobile_display_columns,
slidesToScroll: mobile_scroll_columns,
},
},
],
});
$($block).find(".slick-track").removeAttr("role");
}},
initSlickNavForAsSlider: function ($sliderwrap){
$($sliderwrap).find(".woolentor-learg-img").css("display", "block");
$($sliderwrap).find(".woolentor-thumbnails").css("display", "block");
var settings=WooLentorBlocks.sanitizeObject($($sliderwrap).data("settings"));
if(settings){
$($sliderwrap)
.find(".woolentor-learg-img")
.not(".slick-initialized")
.slick({
slidesToShow: 1,
slidesToScroll: 1,
dots: settings["mainslider"].dots,
arrows: settings["mainslider"].arrows,
fade: false,
asNavFor: ".woolentor-thumbnails",
prevArrow:
'<button type="button" class="woolentor-slick-large-prev" aria-label="Previous image"><i class="sli sli-arrow-left" aria-hidden="true"></i></button>',
nextArrow:
'<button type="button" class="woolentor-slick-large-next" aria-label="Next image"><i class="sli sli-arrow-right" aria-hidden="true"></i></button>',
});
$($sliderwrap)
.find(".woolentor-thumbnails")
.not(".slick-initialized")
.slick({
slidesToShow: settings["thumbnailslider"].slider_items,
slidesToScroll: 1,
asNavFor: ".woolentor-learg-img",
centerMode: false,
dots: false,
arrows: settings["thumbnailslider"].arrows,
vertical: settings["thumbnailslider"].slidertype,
focusOnSelect: true,
prevArrow:
'<button type="button" class="woolentor-slick-prev" aria-label="Previous thumbnail"><i class="sli sli-arrow-left" aria-hidden="true"></i></button>',
nextArrow:
'<button type="button" class="woolentor-slick-next" aria-label="Next thumbnail"><i class="sli sli-arrow-right" aria-hidden="true"></i></button>',
});
$($sliderwrap).find(".slick-track").removeAttr("role");
}},
initAccordion: function ($block){
var settings=$($block).data("settings");
if($block.length > 0){
var $id=$block.attr("id");
new Accordion("#" + $id, {
duration: 500,
showItem: settings.showitem,
elementClass: "htwoolentor-faq-card",
questionClass: "htwoolentor-faq-head",
answerClass: "htwoolentor-faq-body",
});
}},
sanitizeHTML: function (str){
if(str){
return str.replace(/[&<>"']/g, function (c){
switch (c){
case '&': return '&amp;';
case '<': return '&lt;';
case '>': return '&gt;';
case '"': return '&quot;';
case "'": return '&#39;';
default: return c;
}});
}else{
return '';
}},
sanitizeObject: function (inputObj){
const sanitizedObj={};
for (let key in inputObj){
if(inputObj.hasOwnProperty(key)){
let value=inputObj[key];
if(typeof value==='string'){
sanitizedObj[key]=WooLentorBlocks.sanitizeHTML(value);
}else if(typeof value==='number'){
sanitizedObj[key]=Number.isFinite(value) ? value:0;
}else if(typeof value==='boolean'){
sanitizedObj[key]=value;
}else{
sanitizedObj[key]=value;
}}
}
return sanitizedObj;
},
woolentorToolTips: function (element, content){
if(content=="html"){
var tipText=element.text();
}else{
var tipText=element.attr("title");
}
element.on("mouseover", function (){
if($(".woolentor-tip").length==0){
element.before('<span class="woolentor-tip">' + WooLentorBlocks.sanitizeHTML(tipText) + "</span>");
$(".woolentor-tip").css("transition", "all 0.5s ease 0s");
$(".woolentor-tip").css("margin-left", 0);
}});
element.on("mouseleave", function (){
$(".woolentor-tip").remove();
});
},
woolentorToolTipHandler: function (){
$("a.woolentor-compare").each(function (){
WooLentorBlocks.woolentorToolTips($(this), "title");
});
$(
".woolentor-cart a.add_to_cart_button,.woolentor-cart a.added_to_cart,.woolentor-cart a.button"
).each(function (){
WooLentorBlocks.woolentorToolTips($(this), "html");
});
},
productImageThumbnailsSlider: function ($slider){
$slider.slick({
dots: true,
arrows: true,
prevArrow:
'<button type="button" class="slick-prev" aria-label="Previous image"><i class="sli sli-arrow-left" aria-hidden="true"></i></button>',
nextArrow:
'<button type="button" class="slick-next" aria-label="Next image"><i class="sli sli-arrow-right" aria-hidden="true"></i></button>',
});
$slider.find(".slick-track").removeAttr("role");
},
thumbnailsimagescontroller: function (){
this.TabsMenu($(".ht-product-cus-tab-links"), ".ht-product-cus-tab-pane");
this.TabsMenu($(".ht-tab-menus"), ".ht-tab-pane");
$(".ht-product-countdown").each(function (){
var $this=$(this),
finalDate=$(this).data("countdown");
var customlavel=$(this).data("customlavel");
$this.countdown(finalDate, function (event){
$this.html(event.strftime('<div class="cd-single"><div class="cd-single-inner"><h3>%D</h3><p>' +
WooLentorBlocks.sanitizeHTML(customlavel.daytxt) +
'</p></div></div><div class="cd-single"><div class="cd-single-inner"><h3>%H</h3><p>' +
WooLentorBlocks.sanitizeHTML(customlavel.hourtxt) +
'</p></div></div><div class="cd-single"><div class="cd-single-inner"><h3>%M</h3><p>' +
WooLentorBlocks.sanitizeHTML(customlavel.minutestxt) +
'</p></div></div><div class="cd-single"><div class="cd-single-inner"><h3>%S</h3><p>' +
WooLentorBlocks.sanitizeHTML(customlavel.secondstxt) +
"</p></div></div>"
)
);
});
});
},
quantityIncreaseDescrease: function ($area){
$area
.find("form.cart")
.on("click",
"span.wl-quantity-plus, span.wl-quantity-minus",
function (){
const poductType=$area.data("producttype");
if("grouped"!=poductType){
var qty=$(this).closest("form.cart").find(".qty:visible");
var val=parseFloat(qty.val());
var min_val=1;
}else{
var qty=$(this)
.closest(".wl-quantity-grouped-cal")
.find(".qty:visible");
var val = !qty.val() ? 0:parseFloat(qty.val());
var min_val=0;
}
var max=parseFloat(qty.attr("max"));
var min=parseFloat(qty.attr("min"));
var step=parseFloat(qty.attr("step"));
if($(this).is(".wl-quantity-plus")){
if(max&&max <=val){
qty.val(max);
}else{
qty.val(val + step);
}}else{
if(min&&min >=val){
qty.val(min);
}else if(val > min_val){
qty.val(val - step);
}}
}
);
},
CartTableHandler: function (){
$('body').on("click", '[class*="woolentorblock-"] .woolentor-cart-product-details-toggle', function (e){
e.preventDefault();
const $target=$(this).data('target');
if($(`[data-id="${$target}"]`).is(':hidden')){
$(`[data-id="${$target}"]`).slideDown();
}else{
$(`[data-id="${$target}"]`).slideUp();
}});
},
viewSwitcher: function($grid, $selector, $style='modern'){
const $viewButtons=$grid.find('.woolentor-layout-btn');
if($viewButtons.length===0){
return;
}
$viewButtons.on('click', function(e){
e.preventDefault();
const $this=$(this);
const layout=$this.data('layout');
const $gridContainer=$this.closest('.woolentor-product-grid, .woolentor-filters-enabled').find($selector);
$this.siblings().removeClass('woolentor-active');
$this.addClass('woolentor-active');
if($gridContainer.length > 0){
$gridContainer.removeClass('woolentor-layout-grid woolentor-layout-list');
$gridContainer.addClass('woolentor-layout-' + layout);
$gridContainer.attr('data-show-layout', layout);
const $productCards=$gridContainer.find('.woolentor-product-card');
$productCards.removeClass('woolentor-grid-card woolentor-list-card');
if(layout==='grid'){
if($style==='editorial'){
$productCards.removeClass('woolentor-editorial-list-card');
$productCards.addClass('woolentor-editorial-grid-card');
}else if($style==='magazine'){
$productCards.removeClass('woolentor-magazine-list-card');
$productCards.addClass('woolentor-magazine-grid-card');
}else{
$productCards.addClass('woolentor-grid-card');
}}else if(layout==='list'){
if($style==='editorial'){
$productCards.removeClass('woolentor-editorial-grid-card');
$productCards.addClass('woolentor-editorial-list-card');
}else if($style==='magazine'){
$productCards.removeClass('woolentor-magazine-grid-card');
$productCards.addClass('woolentor-magazine-list-card');
}else{
$productCards.addClass('woolentor-list-card');
}}
}
$grid.trigger('woolentor:viewChanged', [ layout ]);
});
},
quantitySelectors: function($grid){
$grid.on('click', '.woolentor-qty-plus', function(e){
e.preventDefault();
const $button=$(this);
const $input=$button.siblings('.woolentor-qty-input');
const currentValue=parseInt($input.val())||1;
const max=parseInt($input.attr('max'))||999;
if(currentValue < max){
$input.val(currentValue + 1).trigger('change');
}});
$grid.on('click', '.woolentor-qty-minus', function(e){
e.preventDefault();
const $button=$(this);
const $input=$button.siblings('.woolentor-qty-input');
const currentValue=parseInt($input.val())||1;
const min=parseInt($input.attr('min'))||1;
if(currentValue > min){
$input.val(currentValue - 1).trigger('change');
}});
$grid.on('change', '.woolentor-qty-input', function(){
const $input=$(this);
const quantity=$input.val();
const $cartButton=$input.closest('.woolentor-product-actions').find('.woolentor-cart-btn');
if($cartButton.length){
$cartButton.attr('data-quantity', quantity);
}});
},
loadMore: function($gridArea){
let loadMoreButton=$gridArea.find('.woolentor-load-more-btn');
if(loadMoreButton.length > 0){
loadMoreButton.on('click', function(e){
e.preventDefault();
const $button=loadMoreButton;
const uniqIdentifire=$button.data('grid-id');
const $loader=$button.siblings('.woolentor-ajax-loader');
const $grid=$('#' + uniqIdentifire);
const currentPage=parseInt($button.data('page'));
const maxPages=parseInt($button.data('max-pages'));
const dataLayout=$grid.attr('data-show-layout');
const loadMoreWrapper=$('.' + uniqIdentifire).find('.woolentor-ajax-enabled');
if(currentPage > maxPages){
return;
}
$button.hide();
$loader.show();
let settings=loadMoreWrapper.attr('data-wl-widget-settings');
const ajaxData={
action: 'woolentor_load_more_products',
nonce: typeof window?.woolentorLocalizeData!=='undefined' ? window?.woolentorLocalizeData.security:'',
page: currentPage,
settings: settings,
viewlayout: typeof dataLayout==='undefined' ? '':dataLayout
};
$.ajax({
url: typeof window?.woolentorLocalizeData!=='undefined' ? window?.woolentorLocalizeData.ajaxUrl:'',
type: 'POST',
data: ajaxData,
success: function(response){
if(response.success&&response.data.html){
const $newProducts=$(response.data.html);
$grid.append($newProducts);
$button.data('page', currentPage+1);
if(currentPage < maxPages){
$button.show();
}else{
$button.text($button.data('complete-loadtxt')).prop('disabled', true).show();
}}
$loader.hide();
},
error: function(xhr, status, error){
$loader.hide();
$button.show();
console.log("Status:", status, "Error:", error);
}});
});
}},
infiniteScroll: function($gridArea){
let selectorBtn=$gridArea.find('.woolentor-infinite-scroll');
let isLoading=false;
const uniqIdentifire=selectorBtn.data('grid-id');
const productLoadWrapper=$('.' + uniqIdentifire).find('.woolentor-ajax-enabled');
const $loader=selectorBtn.find('.woolentor-ajax-loader');
const $grid=$('#' + uniqIdentifire);
const paginationArea=productLoadWrapper.find('.woolentor-pagination-infinite');
function loadMoreOnScroll(){
if(isLoading) return;
const gridOffset=$grid?.offset()?.top;
const gridHeight=$grid.outerHeight();
const gridBottom=gridOffset + gridHeight;
const scrollTop=$(window).scrollTop();
const windowHeight=$(window).height();
const triggerPoint=gridBottom - windowHeight - 100;
if(scrollTop >=triggerPoint){
const currentPage=parseInt(selectorBtn.data('page'));
const maxPages=parseInt(selectorBtn.data('max-pages'));
if(currentPage > maxPages){
$(window).off('scroll', loadMoreOnScroll);
return;
}
paginationArea.css('margin-top', '30px');
isLoading=true;
$loader.show();
let settings=productLoadWrapper.attr('data-wl-widget-settings');
const dataLayout=$grid.attr('data-show-layout');
$.ajax({
url: typeof woolentor_addons!=='undefined' ? woolentor_addons.woolentorajaxurl:'',
type: 'POST',
data: {
action: 'woolentor_load_more_products',
nonce: typeof woolentor_addons!=='undefined' ? woolentor_addons.ajax_nonce:'',
page: currentPage,
settings: settings,
viewlayout: typeof dataLayout==='undefined' ? '':dataLayout
},
success: function(response){
if(response.success&&response.data.html){
const $newProducts=$(response.data.html);
$grid.append($newProducts);
selectorBtn.data('page', currentPage + 1);
if(currentPage > maxPages){
$(window).off('scroll', loadMoreOnScroll);
selectorBtn.remove();
}}
},
complete: function(){
$loader.hide();
isLoading=false;
paginationArea.css('margin-top', '0');
},
error: function(){
$loader.hide();
isLoading=false;
}});
}}
$(window).on('scroll', loadMoreOnScroll);
},
initProductGridModern: function(){
$("[class*='woolentorblock-'] .woolentor-product-grid").each(function(){
const $grid=$(this);
if($grid.hasClass('woolentor-style-editorial')){
WooLentorBlocks.viewSwitcher($grid, '.woolentor-product-grid-editorial', 'editorial');
}else if($grid.hasClass('woolentor-style-magazine')){
WooLentorBlocks.viewSwitcher($grid, '.woolentor-product-grid-magazine', 'magazine');
}else{
WooLentorBlocks.viewSwitcher($grid, '.woolentor-product-grid-modern');
}
WooLentorBlocks.quantitySelectors($grid);
WooLentorBlocks.loadMore($grid);
WooLentorBlocks.infiniteScroll($grid);
});
}};
$(document).ready(function (){
WooLentorBlocks.init();
WooLentorBlocks.CartTableHandler();
WooLentorBlocks.initProductGridModern();
$("[class*='woolentorblock-'] .product-slider").each(function (){
WooLentorBlocks.initSlickSlider($(this));
});
$("[class*='woolentorblock-'].woolentor-block-slider-navforas").each(function (){
WooLentorBlocks.initSlickNavForAsSlider($(this));
}
);
$("[class*='woolentorblock-'] .htwoolentor-faq").each(function (){
WooLentorBlocks.initAccordion($(this));
});
$("[class*='woolentorblock-'].woolentor-product-addtocart").each(function (){
WooLentorBlocks.quantityIncreaseDescrease($(this));
}
);
WooLentorBlocks.woolentorToolTipHandler();
});
document.addEventListener("WoolentorEditorModeSlick",
function (event){
let editorMainArea=$(".block-editor__container"),
editorIframe=$("iframe.edit-site-visual-editor__editor-canvas"),
productSliderDiv =
editorIframe.length > 0
? editorIframe
.contents()
.find("body.block-editor-iframe__body")
.find(`.woolentorblock-editor-${event.detail.uniqid} .product-slider`
)
: editorMainArea.find(`.woolentorblock-editor-${event.detail.uniqid} .product-slider`
);
window.setTimeout(WooLentorBlocks.initSlickSlider(productSliderDiv),
1000
);
},
false
);
document.addEventListener("WoolentorEditorModeNavForSlick",
function (event){
let editorMainArea=$(".block-editor__container"),
editorIframe=$("iframe.edit-site-visual-editor__editor-canvas"),
navForAsSliderDiv =
editorIframe.length > 0
? editorIframe
.contents()
.find("body.block-editor-iframe__body")
.find(`.woolentorblock-editor-${event.detail.uniqid} .woolentor-block-slider-navforas`
)
: editorMainArea.find(`.woolentorblock-editor-${event.detail.uniqid} .woolentor-block-slider-navforas`
);
window.setTimeout(WooLentorBlocks.initSlickNavForAsSlider(navForAsSliderDiv),
1000
);
},
false
);
document.addEventListener("wooLentorProductGridModern", function (event){ WooLentorBlocks.initProductGridModern() }, false);
document.addEventListener("wooLentorProductGridEditorial", function (event){ WooLentorBlocks.initProductGridModern() }, false);
document.addEventListener("wooLentorProductGridMagazine", function (event){ WooLentorBlocks.initProductGridModern() }, false);
})(jQuery, window);
(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{actions:()=>P,addAction:()=>A,addFilter:()=>m,applyFilters:()=>w,applyFiltersAsync:()=>I,createHooks:()=>h,currentAction:()=>x,currentFilter:()=>T,defaultHooks:()=>f,didAction:()=>j,didFilter:()=>z,doAction:()=>g,doActionAsync:()=>k,doingAction:()=>O,doingFilter:()=>S,filters:()=>Z,hasAction:()=>_,hasFilter:()=>v,removeAction:()=>p,removeAllActions:()=>F,removeAllFilters:()=>b,removeFilter:()=>y});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const r=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const o=function(t,e){return function(o,i,s,c=10){const l=t[e];if(!r(o))return;if(!n(i))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:i};if(l[o]){const t=l[o].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex++}))}else l[o]={handlers:[a],runs:0};"hookAdded"!==o&&t.doAction("hookAdded",o,i,s,c)}};const i=function(t,e,o=!1){return function(i,s){const c=t[e];if(!r(i))return;if(!o&&!n(s))return;if(!c[i])return 0;let l=0;if(o)l=c[i].handlers.length,c[i]={runs:c[i].runs,handlers:[]};else{const t=c[i].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==i&&t.doAction("hookRemoved",i,s),l}};const s=function(t,e){return function(n,r){const o=t[e];return void 0!==r?n in o&&o[n].handlers.some((t=>t.namespace===r)):n in o}};const c=function(t,e,n,r){return function(o,...i){const s=t[e];s[o]||(s[o]={handlers:[],runs:0}),s[o].runs++;const c=s[o].handlers;if(!c||!c.length)return n?i[0]:void 0;const l={name:o,currentIndex:0};return(r?async function(){try{s.__current.add(l);let t=n?i[0]:void 0;for(;l.currentIndex<c.length;){const e=c[l.currentIndex];t=await e.callback.apply(null,i),n&&(i[0]=t),l.currentIndex++}return n?t:void 0}finally{s.__current.delete(l)}}:function(){try{s.__current.add(l);let t=n?i[0]:void 0;for(;l.currentIndex<c.length;){t=c[l.currentIndex].callback.apply(null,i),n&&(i[0]=t),l.currentIndex++}return n?t:void 0}finally{s.__current.delete(l)}})()}};const l=function(t,e){return function(){var n;const r=t[e],o=Array.from(r.__current);return null!==(n=o.at(-1)?.name)&&void 0!==n?n:null}};const a=function(t,e){return function(n){const r=t[e];return void 0===n?r.__current.size>0:Array.from(r.__current).some((t=>t.name===n))}};const u=function(t,e){return function(n){const o=t[e];if(r(n))return o[n]&&o[n].runs?o[n].runs:0}};class d{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=i(this,"actions"),this.removeFilter=i(this,"filters"),this.hasAction=s(this,"actions"),this.hasFilter=s(this,"filters"),this.removeAllActions=i(this,"actions",!0),this.removeAllFilters=i(this,"filters",!0),this.doAction=c(this,"actions",!1,!1),this.doActionAsync=c(this,"actions",!1,!0),this.applyFilters=c(this,"filters",!0,!1),this.applyFiltersAsync=c(this,"filters",!0,!0),this.currentAction=l(this,"actions"),this.currentFilter=l(this,"filters"),this.doingAction=a(this,"actions"),this.doingFilter=a(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}const h=function(){return new d},f=h(),{addAction:A,addFilter:m,removeAction:p,removeFilter:y,hasAction:_,hasFilter:v,removeAllActions:F,removeAllFilters:b,doAction:g,doActionAsync:k,applyFilters:w,applyFiltersAsync:I,currentAction:x,currentFilter:T,doingAction:O,doingFilter:S,didAction:j,didFilter:z,actions:P,filters:Z}=f;(window.wp=window.wp||{}).hooks=e})();
(()=>{var t={2058:(t,e,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,p,c,f,d=1,h=t.length,g="";for(n=0;n<h;n++)if("string"==typeof t[n])g+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[d],o=0;o<s.keys.length;o++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?e[s.param_no]:e[d++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(c=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?g+=r:(!i.number.test(s.type)||c&&!s.sign?f="":(f=c?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(f+r).length,l=s.width&&p>0?u.repeat(p):"",g+=s.align?f+r+l:"0"===u?f+l+r:l+f+r)}return g}(function(t){if(s[t])return s[t];var e,r=t,n=[],a=0;for(;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__:()=>F,_n:()=>j,_nx:()=>L,_x:()=>S,createI18n:()=>x,defaultI18n:()=>_,getLocaleData:()=>v,hasTranslation:()=>D,isRTL:()=>T,resetLocaleData:()=>w,setLocaleData:()=>m,sprintf:()=>a,subscribe:()=>k});var t=r(2058),e=r.n(t);const i=function(t,e){var r,n,i=0;function a(){var a,o,s=r,l=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(o=0;o<l;o++)if(s.args[o]!==arguments[o]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(a=new Array(l),o=0;o<l;o++)a[o]=arguments[o];return s={args:a,val:t.apply(null,a)},r?(r.prev=s,s.next=r):n=s,i===e.maxSize?(n=n.prev).next=null:i++,r=s,s.val}return e=e||{},a.clear=function(){r=null,n=null,i=0},a}(console.error);function a(t,...r){try{return e().sprintf(t,...r)}catch(e){return e instanceof Error&&i("sprintf error: \n\n"+e.toString()),t}}var o,s,l,u;o={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},s=["(","?"],l={")":["("],":":["?","?:"]},u=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function c(t){var e=function(t){for(var e,r,n,i,a=[],p=[];e=t.match(u);){for(r=e[0],(n=t.substr(0,e.index).trim())&&a.push(n);i=p.pop();){if(l[r]){if(l[r][0]===i){r=l[r][1]||r;break}}else if(s.indexOf(i)>=0||o[i]<o[r]){p.push(i);break}a.push(i)}l[r]||p.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&a.push(t),a.concat(p.reverse())}(t);return function(t){return function(t,e){var r,n,i,a,o,s,l=[];for(r=0;r<t.length;r++){if(o=t[r],a=p[o]){for(n=a.length,i=Array(n);n--;)i[n]=l.pop();try{s=a.apply(null,i)}catch(t){return t}}else s=e.hasOwnProperty(o)?e[o]:+o;l.push(s)}return l[0]}(e,t)}}var f={contextDelimiter:"",onMissingKey:null};function d(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},f)this.options[r]=void 0!==e&&r in e?e[r]:f[r]}d.prototype.getPluralForm=function(t,e){var r,n,i,a=this.pluralForms[t];return a||("function"!=typeof(i=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),i=function(t){var e=c(t);return function(t){return+e({n:t})}}(n)),a=this.pluralForms[t]=i),a(e)},d.prototype.dcnpgettext=function(t,e,r,n,i){var a,o,s;return a=void 0===i?0:this.getPluralForm(t,i),o=r,e&&(o=e+this.options.contextDelimiter+r),(s=this.data[t][o])&&s[a]?s[a]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===a?r:n)};const h={plural_forms:t=>1===t?0:1},g=/^i18n\.(n?gettext|has_translation)(_|$)/,x=(t,e,r)=>{const n=new d({}),i=new Set,a=()=>{i.forEach((t=>t()))},o=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},s=(t,e)=>{o(t,e),a()},l=(t="default",e,r,i,a)=>(n.data[t]||o(void 0,t),n.dcnpgettext(t,e,r,i,a)),u=(t="default")=>t,p=(t,e,n)=>{let i=l(n,e,t);return r?(i=r.applyFilters("i18n.gettext_with_context",i,t,e,n),r.applyFilters("i18n.gettext_with_context_"+u(n),i,t,e,n)):i};if(t&&s(t,e),r){const t=t=>{g.test(t)&&a()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:s,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],a()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},s(t,e)},subscribe:t=>(i.add(t),()=>i.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:p,_n:(t,e,n,i)=>{let a=l(i,void 0,t,e,n);return r?(a=r.applyFilters("i18n.ngettext",a,t,e,n,i),r.applyFilters("i18n.ngettext_"+u(i),a,t,e,n,i)):a},_nx:(t,e,n,i,a)=>{let o=l(a,i,t,e,n);return r?(o=r.applyFilters("i18n.ngettext_with_context",o,t,e,n,i,a),r.applyFilters("i18n.ngettext_with_context_"+u(a),o,t,e,n,i,a)):o},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(t,e,i)=>{const a=e?e+""+t:t;let o=!!n.data?.[null!=i?i:"default"]?.[a];return r&&(o=r.applyFilters("i18n.has_translation",o,t,e,i),o=r.applyFilters("i18n.has_translation_"+u(i),o,t,e,i)),o}}},y=window.wp.hooks,b=x(void 0,void 0,y.defaultHooks),_=b,v=b.getLocaleData.bind(b),m=b.setLocaleData.bind(b),w=b.resetLocaleData.bind(b),k=b.subscribe.bind(b),F=b.__.bind(b),S=b._x.bind(b),j=b._n.bind(b),L=b._nx.bind(b),T=b.isRTL.bind(b),D=b.hasTranslation.bind(b)})(),(window.wp=window.wp||{}).i18n=n})();