(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ADMIN_URL:()=>R,COUNTRIES:()=>v,CURRENCY:()=>D,CURRENT_USER_IS_ADMIN:()=>T,HOME_URL:()=>x,LOCALE:()=>O,ORDER_STATUSES:()=>L,PLACEHOLDER_IMG_SRC:()=>P,SITE_CURRENCY:()=>j,SITE_TITLE:()=>C,STORE_PAGES:()=>A,WC_ASSET_URL:()=>M,WC_VERSION:()=>N,WP_LOGIN_URL:()=>V,WP_VERSION:()=>W,allSettings:()=>n,defaultFields:()=>k,getAdminLink:()=>U,getCurrencyPrefix:()=>E,getCurrencySuffix:()=>I,getPaymentMethodData:()=>b,getSetting:()=>f,getSettingWithCoercion:()=>g,isWcVersion:()=>h,isWpVersion:()=>w}),(0,window.wp.hooks.addFilter)("woocommerce_admin_analytics_settings","woocommerce-blocks/exclude-draft-status-from-analytics",(e=>{const t=e=>"customStatuses"===e.key?{...e,options:e.options.filter((e=>"checkout-draft"!==e.value))}:e,r=e.woocommerce_actionable_order_statuses.options.map(t),o=e.woocommerce_excluded_report_order_statuses.options.map(t);return{...e,woocommerce_actionable_order_statuses:{...e.woocommerce_actionable_order_statuses,options:r},woocommerce_excluded_report_order_statuses:{...e.woocommerce_excluded_report_order_statuses,options:o}}}));const r={adminUrl:"",countries:[],currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserId:0,currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},o="object"==typeof window.wcSettings?window.wcSettings:{},n={...r,...o};function s(e,t){const r=c(e),o=c(t),n=r.pop(),s=o.pop(),i=p(r,o);return 0!==i?i:n&&s?p(n.split("."),s.split(".")):n||s?n?-1:1:0}n.currency={...r.currency,...n.currency},n.locale={...r.locale,...n.locale};const i=(e,t,r)=>{S(r);const o=s(e,t);return m[r].includes(o)};s.validate=e=>"string"==typeof e&&/^[v\d]/.test(e)&&a.test(e),s.compare=i,s.sastisfies=(e,t)=>{const r=t.match(/^([<>=~^]+)/),o=r?r[1]:"=";if("^"!==o&&"~"!==o)return i(e,t,o);const[n,s,a]=c(e),[l,d,m]=c(t);return 0===u(n,l)&&("^"===o?p([s,a],[d,m])>=0:0===u(s,d)&&u(a,m)>=0)};const a=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,c=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(a);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},l=e=>"*"===e||"x"===e||"X"===e,d=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},u=(e,t)=>{if(l(e)||l(t))return 0;const[r,o]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(d(e),d(t));return r>o?1:r<o?-1:0},p=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const o=u(e[r]||0,t[r]||0);if(0!==o)return o}return 0},m={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},_=Object.keys(m),S=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===_.indexOf(e))throw new Error(`Invalid operator, expected one of ${_.join("|")}`)},f=(e,t=!1,r=((e,t)=>void 0!==e?e:t))=>{let o=t;if(e in n)o=n[e];else if(e.includes("_data")){const r=e.replace("_data",""),n=f("paymentMethodData",{});o=r in n?n[r]:t}return r(o,t)},g=(e,t,r)=>{const o=e in n?n[e]:t;return r(o,t)?o:t},y=(e,t,r)=>{let o=f(e,"").replace(/-[a-zA-Z0-9]*[\-]*/,".0-rc.");return o=o.endsWith(".")?o.substring(0,o.length-1):o,s.compare(o,t,r)},w=(e,t="=")=>y("wpVersion",e,t),h=(e,t="=")=>y("wcVersion",e,t),U=e=>f("adminUrl")+e,b=(e,t=null)=>{var r;return null!==(r=f("paymentMethodData",{})[e])&&void 0!==r?r:t},E=(e,t)=>({left:e,left_space:e+" ",right:"",right_space:""}[t]||""),I=(e,t)=>({left:"",left_space:"",right:e,right_space:" "+e}[t]||""),R=n.adminUrl,v=n.countries,T=n.currentUserIsAdmin,x=n.homeUrl,O=n.locale,L=n.orderStatuses,P=n.placeholderImgSrc,C=n.siteTitle,A=n.storePages,M=n.wcAssetUrl,N=n.wcVersion,V=n.wpLoginUrl,W=n.wpVersion,D=n.currency,j={code:D.code,symbol:D.symbol,thousandSeparator:D.thousandSeparator,decimalSeparator:D.decimalSeparator,minorUnit:D.precision,prefix:E(D.symbol,D.symbolPosition),suffix:I(D.symbol,D.symbolPosition)},k=f("defaultFields");(this.wc=this.wc||{}).wcSettings=t})();
jQuery(document).ready(function ($){
onBillingNumberChange();
$(document).on("keyup", '#billing_company_number', function (e){
onBillingNumberChange();
});
if($('#ttol_dsa_attachments').length > 0){
document.getElementById("ttol_dsa_attachments").addEventListener("change", function (event){
var files=event.target.files;
var maxSize=5 * 1024 * 1024;
var errorElement=document.getElementById("file-size-error");
for (var i=0; i < files.length; i++){
if(files[i].size > maxSize){
errorElement.style.display="block";
event.target.value="";
return;
}}
errorElement.style.display="none";
});
}
function onBillingNumberChange(){
let country=$('#billing_country').val();
if(country!=='CZ'&&country!=='SK') return;
if(wcp_ttol_public_localize.ttol_ico_search==='ok'||wcp_ttol_public_localize.ttol_ico_ruz_search==='ok'){
let companyNumber=$('#billing_company_number');
if(companyNumber.length){
if(companyNumber.val().length > 0){
$('#ttol-ares').show();
$('#ttol-ruz').show();
$('.ttol-ico-found').remove();
$('.ttol-ico-notfound').remove();
if(wcp_ttol_public_localize.ttol_ico_search==='ok'){
let buttonTitle='<span class="button__text-ares">' + wcp_ttol_public_localize.downloadfromares + '</span>';
let button='<button id="ttol-ares" class="button ttol-fidd-ico" data-api="ares" title="' + wcp_ttol_public_localize.downloadfromares + '">' + buttonTitle + '</button>';
let findAres=$('#ttol-ares');
if(!findAres.length) companyNumber.after(button);
findAres=$('#ttol-ares');
findAres.html(buttonTitle);
findAres.css({
'font-size': '11px !important',
'letter-spacing': '1px',
'font-weight': '500',
'padding': '5px 16px',
'border': '1px',
'border-radius': '4px',
'vertical-align': 'center',
'background-color': '#001543',
'border-color': '#001543',
'color': 'white',
'margin-left': '5px',
});
companyNumber.parent().css({
'display': 'flex',
'flex-direction': 'row',
'flex-align-items': 'stretch',
});
findAres.hover(function (){
$(this).css("background-color", "#edf3ff");
$(this).css("color", "#666");
}, function (){
$(this).css('background-color', '#001543');
$(this).css("color", "white");
});
findAres.prop("onclick", null).off("click");
findAres.click(function (e){
e.preventDefault();
let btn=this;
$(".button__text-ares").html("");
btn.classList.add('button--loading');
let data={
action: 'ttol_call_ares',
ic: companyNumber.val(),
api: 'ares',
};
$.post(wcp_ttol_public_localize.ajaxurl, data, function (response){
var obj=$.parseJSON(response);
btn.classList.remove('button--loading');
findAres.hide();
if(obj.is_ok===1){
companyNumber.parent().css({'display': 'block'});
companyNumber.after('<span class="ttol-ico-found">' + wcp_ttol_public_localize.icofound + '</span>');
$('#billing_vat_number').attr("value", obj.dic).val(obj.dic);
$('#billing_city').attr("value", obj.mesto).val(obj.mesto);
$('#billing_postcode').attr("value", obj.psc).val(obj.psc);
$('#billing_company').attr("value", obj.spolecnost).val(obj.spolecnost);
$('#billing_address_1').val(obj.adresa).attr("value", obj.adresa).trigger('change');
$('#ttol-ruz').hide();
}else{
companyNumber.parent().css({'display': 'block'});
companyNumber.after('<span class="ttol-ico-notfound">' + wcp_ttol_public_localize.iconotfound + '</span>');
}});
});
}
if(wcp_ttol_public_localize.ttol_ico_ruz_search==='ok'){
let buttonTitle='<span class="button__text-ruz">' + wcp_ttol_public_localize.downloadfromruz + '</span>';
let button2='<button id="ttol-ruz" class="button ttol-find-ico" data-api="ruz" title="' + wcp_ttol_public_localize.downloadfromruz + '">' + wcp_ttol_public_localize.downloadfromruz + '</button>';
let findRuz=$('#ttol-ruz');
if(!findRuz.length) companyNumber.after(button2);
findRuz=$('#ttol-ruz');
findRuz.html(buttonTitle);
findRuz.css({
'font-size': '11px !important',
'letter-spacing': '1px',
'font-weight': '500',
'padding': '5px 16px',
'border': '1px',
'margin-left': '5px',
'border-radius': '4px',
'vertical-align': 'center',
'background-color': '#001543',
'border-color': '#001543',
'color': 'white',
});
companyNumber.parent().css({
'display': 'flex',
'flex-direction': 'row',
'flex-align-items': 'stretch',
});
findRuz.hover(function (){
$(this).css("background-color", "#edf3ff");
$(this).css("color", "#666");
}, function (){
$(this).css('background-color', '#001543');
$(this).css("color", "white");
});
findRuz.prop("onclick", null).off("click");
findRuz.click(function (e){
e.preventDefault();
let btn=this;
$(".button__text-ruz").html("");
btn.classList.add('button--loading');
let data={
action: 'ttol_call_ares',
ic: companyNumber.val(),
api: 'ruz',
};
$.post(wcp_ttol_public_localize.ajaxurl, data, function (response){
var obj=$.parseJSON(response);
btn.classList.remove('button--loading');
findRuz.hide();
if(obj.is_ok===1){
companyNumber.parent().css({'display': 'block'});
companyNumber.after('<span class="ttol-ico-found">' + wcp_ttol_public_localize.icofound + '</span>');
$('#billing_vat_number').attr("value", obj.dic).val(obj.dic);
$('#billing_city').attr("value", obj.mesto).val(obj.mesto);
$('#billing_postcode').attr("value", obj.psc).val(obj.psc);
$('#billing_company').attr("value", obj.spolecnost).val(obj.spolecnost);
$('#billing_address_1').val(obj.adresa).attr("value", obj.adresa).trigger('change');
$('#ttol-ares').hide();
}else{
companyNumber.parent().css({'display': 'block'});
companyNumber.after('<span class="ttol-ico-notfound">' + wcp_ttol_public_localize.iconotfound + '</span>');
}});
});
}else{
$('.ttol-ico-found').remove();
$('#ttol-ares-wrap').remove();
}}
}}
}
$('body').on('updated_checkout', function (){
if(wcp_ttol_public_localize.ttol_ico_show=='ok'){
if($('#billing_country').length) initVatFields($('#billing_country').val());
}});
$('#billing_country').on('change', function (){
if(wcp_ttol_public_localize.ttol_ico_show=='ok') initVatFields($('#billing_country').val());
});
function initVatFields(country){
let company_number_box=$('body').find('#billing_company_number_field').closest('p');
let vat_number_box=$('body').find('#billing_vat_number_field').closest('p');
let vat_number_2_box=$('body').find('#billing_vat_number_2_field').closest('p');
if(vat_number_2_box.length > 0){
if(country==='SK'){
if($('#billing_nafirmu').is(':checked')) vat_number_2_box.show();
else if($('#billing_nafirmu').length){
vat_number_2_box.hide();
vat_number_2_box.val('');
}}else{
vat_number_2_box.hide();
vat_number_2_box.val('');
}}
if(wcp_ttol_public_localize.ttol_ico_move_company=='ok'){
if($('#billing_nafirmu').is(':checked')) $('.ttol-hidden-company').show();
else $('.ttol-hidden-company').hide();
}
if(vat_number_box.length > 0){
if(wcp_ttol_public_localize.eu_vat_countries.includes(country)){
if(wcp_ttol_public_localize.show_ico_checkbox=='ok'){
if($('#billing_nafirmu').is(':checked')) vat_number_box.show();
else if($('#billing_nafirmu').length){
vat_number_box.hide();
vat_number_2_box.val('');
}} else vat_number_box.show();
}else{
vat_number_box.hide();
vat_number_2_box.val('');
}}
if(company_number_box.length > 0){
if(wcp_ttol_public_localize.eu_vat_countries.includes(country)){
if(wcp_ttol_public_localize.show_ico_checkbox=='ok'){
if($('#billing_nafirmu').is(':checked')) company_number_box.show();
else if($('#billing_nafirmu').length){
company_number_box.hide();
vat_number_2_box.val('');
}} else company_number_box.show();
}else{
company_number_box.hide();
vat_number_2_box.val('');
}}
if(country!=='CZ'&&country!=='SK'){
$('#ttol-ares').hide();
$('#ttol-ruz').hide();
$('.ttol-ico-found').remove();
$('.ttol-ico-notfound').remove();
}}
$('#billing_nafirmu').change(function (){
initVatFields($('#billing_country').val());
});
$(document).on("click", ".ttol-product-pes-notify", function (e){
e.preventDefault();
let clicked=$(this);
let email=$(this).prev().prev().val();
let productid=$(this).data('productid');
if(email==='') alert(wcp_ttol_public_localize.email);
else {
const btn=document.querySelector(".ttol-product-pes-notify");
btn.classList.add("loading");
$('.spinner-button__text').css({'visibility': 'hidden', 'opacity': '0'});
let turnstileToken=clicked.closest('.ttol-product-pes-wrap').find('[name="cf-turnstile-response"]').val()||'';
let data={action: 'ttol_pes_notify', email: email, productid: productid, 'cf-turnstile-response': turnstileToken};
$.post(wcp_ttol_public_localize.ajaxurl, data, function (response){
btn.classList.remove("loading");
$('.spinner-button__text').css({'visibility': 'visible', 'opacity': '1'});
if(response==='1'){
$('#ttol-product-pes-email').val('');
$('#ttol-product-pes-wrap-' + productid).empty().append('<div class="ttol-pes-notify-sent-wrap"><span class="dashicons dashicons-saved"></span><span class="ttol-pes-verification-sent">' + wcp_ttol_public_localize.emailsent + '</span></div>');
}else if(response==='2'){
$('#ttol-product-pes-email').val('');
$('#ttol-product-pes-wrap-' + productid).empty().append('<div class="ttol-pes-notify-saved-wrap"><span class="dashicons dashicons-saved"></span><span class="ttol-pes-subscribed">' + wcp_ttol_public_localize.subscribed + '</span></div>');
}else{
$('#ttol-product-pes-email').val('');
$('#ttol-product-pes-wrap-' + productid).empty().append('<div class="ttol-pes-notify-exists-wrap"><span class="dashicons dashicons-info-outline"></span><span class="ttol-pes-verification-exists">' + wcp_ttol_public_localize.emailexists + '</span></div>');
}});
}});
$(document).on("click", ".ttol-enuqiry-submit", function (e){
e.preventDefault();
let clicked=$(this);
let isdialog=clicked.data('isdialog');
let productid=clicked.data('id');
let isVar=clicked.data('isvar');
let message=$('#ttol-enuqiry-message' + isdialog + productid).val();
let tel=$('#ttol-enuqiry-tel' + isdialog + productid).val();
let email=$('#ttol-enuqiry-email' + isdialog + productid).val();
let emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if(!emailRegex.test(email)) alert(wcp_ttol_public_localize.email);
else if(email==='') alert(wcp_ttol_public_localize.email);
else if(message==='') alert(wcp_ttol_public_localize.message);
else {
const btn=document.querySelector("#ttol-enuqiry-submit" + isdialog + productid);
btn.classList.add("loading");
$('.spinner-button__text').css({'visibility': 'hidden', 'opacity': '0'});
let turnstileToken=clicked.closest('.ttolEnquiryDialogBoot, .ttol-enuqiry-tab-wrap' + productid).find('[name="cf-turnstile-response"]').val()||'';
let data={action: 'ttol_enquiry_notify', email: email, productid: productid, message: message, tel: tel, 'cf-turnstile-response': turnstileToken};
$.post(wcp_ttol_public_localize.ajaxurl, data, function (response){
btn.classList.remove("loading");
$('.spinner-button__text').css({'visibility': 'visible', 'opacity': '1'});
$('.ttol-enuqiry-tab-wrap' + productid).hide();
$('#ttol-enuqiry-email').val('');
$('#ttol-enuqiry-message').val('');
if(isVar==='yes'||isVar==='varpage') $('#ttol-enuqiry-submit' + isdialog + productid).remove();
else $('.ttol-enuqiry-submit').remove();
if(response==='1'){
$('#ttol-enquiry-response-placeholderyes' + productid).html(wcp_ttol_public_localize.enquiry_ok_sent).addClass('ttol-enquiry-ok');
$('#ttol-enquiry-response-placeholderno' + productid).html(wcp_ttol_public_localize.enquiry_ok_sent).addClass('ttol-enquiry-ok');
}else{
$('#ttol-enquiry-response-placeholderyes' + productid).html(wcp_ttol_public_localize.enquiry_error_sent).addClass('ttol-enquiry-error');
$('#ttol-enquiry-response-placeholderno' + productid).html(wcp_ttol_public_localize.enquiry_error_sent).addClass('ttol-enquiry-error');
}});
}});
const syncCountryClass=()=> {
if(!window.wp?.data) return;
const store=window.wp.data.select('wc/store/cart');
if(!store) return;
const customerData=store.getCustomerData();
const country=customerData?.billingAddress?.country;
if(country==='SK') document.body.classList.add('is-sk');
else document.body.classList.remove('is-sk');
};
const updateUI=()=> {
if(!window.wp?.data) return;
const store=window.wp.data.select('wc/store/cart');
if(!store) return;
const customerData=store.getCustomerData();
const country=customerData?.billingAddress?.country;
const wrapper=document.querySelector('.wp-block-woocommerce-checkout');
if(wrapper) wrapper.classList.toggle('is-sk', country==='SK');
syncCountryClass();
};
if(window.wp&&window.wp.data){
window.wp.data.subscribe(updateUI);
syncCountryClass();
}
document.addEventListener('change', async (event)=> {
if(wcp_ttol_public_localize.ttol_ico_search||wcp_ttol_public_localize.ttol_ico_ruz_search){
if(event.target.id==='billing-toret-toolkit-toret-ic'){
const ico=event.target.value.replace(/\s/g, '').trim();
if(ico.length < 4) return;
const store=window.wp?.data?.select('wc/store/cart');
if(!store) return;
const customerData=store.getCustomerData();
const country=customerData?.billingAddress?.country||'CZ';
if(!wcp_ttol_public_localize.ttol_ico_search&&country==='CZ') return;
if(!wcp_ttol_public_localize.ttol_ico_ruz_search&&country==='SK') return;
try {
const response=await fetch(`/wp-json/toret/v1/get-company-data/?ico=${ico}&country=${country}`);
if(!response.ok) return;
const data=await response.json();
const {dispatch}=window.wp.data;
dispatch('wc/store/cart').setBillingAddress({
company: data.company,
address_1: data.address_1,
city: data.city,
postcode: data.postcode
});
const dicInput=document.getElementById('billing-toret-toolkit-toret-dic');
if(dicInput&&data.dic){
dicInput.value=data.dic;
dicInput.dispatchEvent(new Event('input', {bubbles: true}));
}
const icDphInput=document.getElementById('billing-toret-toolkit-toret-ic-dph');
if(icDphInput&&data.ic_dph){
icDphInput.value=data.ic_dph;
icDphInput.dispatchEvent(new Event('input', {bubbles: true}));
}} catch (e){
console.error('Toret API Error:', e);
}}
}});
});
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(p){return function(n,t,r,e){var u=3<=arguments.length,o=n,i=x(t,e,4),a=r,f=!E(o)&&b(o),c=(f||o).length,l=0<p?0:c-1;for(u||(a=o[f?f[l]:l],l+=p);0<=l&&l<c;l+=p){var s=f?f[l]:l;a=i(a,o[s],s,o)}return a}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});
window.wp=window.wp||{},function(s){var t="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(e){var n,a={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(t){if(document.getElementById("tmpl-"+e))return(n=n||_.template(s("#tmpl-"+e).html(),a))(t);throw new Error("Template not found: #tmpl-"+e)}}),wp.ajax={settings:t.ajax||{},post:function(t,e){return wp.ajax.send({data:_.isObject(t)?t:_.extend(e||{},{action:t})})},send:function(a,t){var e,n;return _.isObject(a)?t=a:(t=t||{}).data=_.extend(t.data||{},{action:a}),t=_.defaults(t||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(e=(n=s.Deferred(function(n){t.success&&n.done(t.success),t.error&&n.fail(t.error),delete t.success,delete t.error,n.jqXHR=s.ajax(t).done(function(t){var e;"1"!==t&&1!==t||(t={success:!0}),_.isObject(t)&&!_.isUndefined(t.success)?(e=this,n.done(function(){a&&a.data&&"query-attachments"===a.data.action&&n.jqXHR.hasOwnProperty("getResponseHeader")&&n.jqXHR.getResponseHeader("X-WP-Total")?e.totalAttachments=parseInt(n.jqXHR.getResponseHeader("X-WP-Total"),10):e.totalAttachments=0}),n[t.success?"resolveWith":"rejectWith"](this,[t.data])):n.rejectWith(this,[t])}).fail(function(){n.rejectWith(this,arguments)})})).promise()).abort=function(){return n.jqXHR.abort(),this},e}}}(jQuery);
!function(c){var w=window.wpApiSettings;function t(e){return e=t.buildAjaxOptions(e),t.transport(e)}t.buildAjaxOptions=function(e){var t,n,a,p,o,r,i=e.url,d=e.path,s=e.method;for(r in"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(t=e.namespace.replace(/^\/|\/$/g,""),d=(n=e.endpoint.replace(/^\//,""))?t+"/"+n:t),"string"==typeof d&&(n=w.root,d=d.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(d=d.replace("?","&")),i=n+d),p=!(e.data&&e.data._wpnonce),o=!0,a=e.headers||{})if(a.hasOwnProperty(r))switch(r.toLowerCase()){case"x-wp-nonce":p=!1;break;case"accept":o=!1}return p&&(a=c.extend({"X-WP-Nonce":w.nonce},a)),o&&(a=c.extend({Accept:"application/json, */*;q=0.1"},a)),"string"!=typeof s||"PUT"!==(s=s.toUpperCase())&&"DELETE"!==s||(a=c.extend({"X-HTTP-Method-Override":s},a),s="POST"),delete(e=c.extend({},e,{headers:a,url:i,method:s})).path,delete e.namespace,delete e.endpoint,e},t.transport=c.ajax,window.wp=window.wp||{},window.wp.apiRequest=t}(jQuery);
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=o(t))||e&&t&&"number"==typeof t.length){a&&(t=a);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,l=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==a.return||a.return()}finally{if(l)throw r}}}}function a(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,n,o=[],r=!0,s=!1;try{for(a=a.call(t);!(r=(i=a.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){s=!0,n=t}finally{try{r||null==a.return||a.return()}finally{if(s)throw n}}return o}}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}!function(o){"use strict";var r=function(t){return!!t.path&&-1!==t.path.indexOf("woo-variation-swatches")||!!t.url&&-1!==t.url.indexOf("woo-variation-swatches")};o.createMiddlewareForExtraQueryParams=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,a){if(r(e)&&Object.keys(t).length>0)for(var o=0,s=Object.entries(t);o<s.length;o++){var l=n(s[o],2),c=l[0],u=l[1];"string"!=typeof e.url||wp.url.hasQueryArg(e.url,c)||(e.url=wp.url.addQueryArgs(e.url,i({},c,u))),"string"!=typeof e.path||wp.url.hasQueryArg(e.path,c)||(e.path=wp.url.addQueryArgs(e.path,i({},c,u)))}return a(e)}};var s,l=(s=jQuery,function(){function t(e,a,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"defaults",{}),this.name=n,this.element=e,this.$element=s(e),this.settings=s.extend(!0,{},this.defaults,a),this.product_variations=this.$element.data("product_variations")||[],this.is_ajax_variation=this.product_variations.length<1,this.product_id=this.$element.data("product_id"),this.reset_variations=this.$element.find(".reset_variations"),this.attributeFields=this.$element.find(".variations select"),this.selected_item_template='<span class="woo-selected-variation-item-name" data-default=""></span>',this.$element.addClass("wvs-loaded"),this.init(),this.update(),s(document).trigger("woo_variation_swatches_loaded",this)}var r,l,c;return r=t,(l=[{key:"isAjaxVariation",value:function(){return this.is_ajax_variation}},{key:"init",value:function(){this.prepareLabel(),this.prepareItems(),this.setupItems(),this.setupEvents(),this.setUpStockInfo()}},{key:"prepareLabel",value:function(){var t=this;woo_variation_swatches_options.show_variation_label&&this.$element.find(".variations .label").each((function(e,a){s(a).append(t.selected_item_template)}))}},{key:"prepareItems",value:function(){this.$element.find("ul.variable-items-wrapper").each((function(t,e){s(e).parent().addClass("woo-variation-items-wrapper")}))}},{key:"setupItems",value:function(){var t=this;this.$element.find("ul.variable-items-wrapper").each((function(e,a){var i="",n=s(a).parent().prev().find(".woo-selected-variation-item-name"),o=s(a).parent().find("select.woo-variation-raw-select"),r=o.find("option"),l=o.find("option:disabled"),c=o.find("option.enabled.out-of-stock"),u=o.find("option:selected"),d=o.find("option").eq(1),v=[],f=[],h=[];r.each((function(){""!==s(this).val()&&(v.push(s(this).val()),i=0===u.length?d.val():u.val())})),l.each((function(){""!==s(this).val()&&f.push(s(this).val())})),c.each((function(){""!==s(this).val()&&h.push(s(this).val())}));var p=_.difference(v,f);t.setupItem(a,i,p,h,n)}))}},{key:"setupItem",value:function(t,e,a,i,n){var o=this;s(t).find("li.variable-item").each((function(t,r){var l=s(r).attr("data-value"),c=s(r).attr("data-title");s(r).removeClass("selected disabled no-stock").addClass("disabled"),s(r).attr("aria-checked","false"),s(r).attr("tabindex","-1"),s(r).attr("data-wvstooltip-out-of-stock",""),s(r).find("input.variable-item-radio-input:radio").prop("disabled",!0).prop("checked",!1),e.length<1&&woo_variation_swatches_options.show_variation_label&&n.text(""),o.isAjaxVariation()?(s(r).find("input.variable-item-radio-input:radio").prop("disabled",!1),s(r).removeClass("selected disabled no-stock"),l===e&&(s(r).addClass("selected"),s(r).attr("aria-checked","true"),s(r).attr("tabindex","0"),s(r).find("input.variable-item-radio-input:radio").prop("disabled",!1).prop("checked",!0),woo_variation_swatches_options.show_variation_label&&n.text("".concat(woo_variation_swatches_options.variation_label_separator," ").concat(c)),s(r).trigger("wvs-item-updated",[e,l]))):(_.includes(a,l)&&(s(r).removeClass("selected disabled"),s(r).removeAttr("aria-hidden"),s(r).attr("tabindex","0"),s(r).find("input.variable-item-radio-input:radio").prop("disabled",!1),l===e&&(s(r).addClass("selected"),s(r).attr("aria-checked","true"),s(r).find("input.variable-item-radio-input:radio").prop("checked",!0),woo_variation_swatches_options.show_variation_label&&n.text("".concat(woo_variation_swatches_options.variation_label_separator," ").concat(c)),s(r).trigger("wvs-item-updated",[e,l]))),_.includes(i,l)&&woo_variation_swatches_options.clickable_out_of_stock&&(s(r).removeClass("disabled").addClass("no-stock"),s(r).attr("data-wvstooltip-out-of-stock",woo_variation_swatches_options.out_of_stock_tooltip_text)))}))}},{key:"setupEvents",value:function(){var t=this;this.$element.find("ul.variable-items-wrapper").each((function(e,a){var i=s(a).parent().find("select.woo-variation-raw-select");woo_variation_swatches_options.clear_on_reselect?(s(a).on("click.wvs","li.variable-item:not(.selected):not(.radio-variable-item)",(function(e){e.preventDefault(),e.stopPropagation();var a=s(this).data("value");i.val(a).trigger("change"),i.trigger("click"),woo_variation_swatches_options.is_mobile,s(this).trigger("wvs-selected-item",[a,i,t.$element])})),s(a).on("click.wvs","li.variable-item.selected:not(.radio-variable-item)",(function(e){e.preventDefault(),e.stopPropagation();var a=s(this).val();i.val("").trigger("change"),i.trigger("click"),woo_variation_swatches_options.is_mobile,s(this).trigger("wvs-unselected-item",[a,i,t.$element])})),s(a).on("click.wvs","input.variable-item-radio-input:radio",(function(t){t.stopPropagation(),s(this).trigger("change.wvs",{radioChange:!0})})),s(a).on("change.wvs","input.variable-item-radio-input:radio",(function(e,a){if(e.preventDefault(),e.stopPropagation(),a&&a.radioChange){var n=s(this).val();s(this).parent("li.radio-variable-item").hasClass("selected")?(i.val("").trigger("change"),s(this).parent("li.radio-variable-item").trigger("wvs-unselected-item",[n,i,t.$element])):(i.val(n).trigger("change"),s(this).parent("li.radio-variable-item").trigger("wvs-selected-item",[n,i,t.$element])),i.trigger("click"),woo_variation_swatches_options.is_mobile}}))):(s(a).on("click.wvs","li.variable-item:not(.radio-variable-item)",(function(e){e.preventDefault(),e.stopPropagation();var a=s(this).data("value");i.val(a).trigger("change"),i.trigger("click"),woo_variation_swatches_options.is_mobile,s(this).trigger("wvs-selected-item",[a,i,t.$element])})),s(a).on("change.wvs","input.variable-item-radio-input:radio",(function(e){e.preventDefault(),e.stopPropagation();var a=s(this).val();i.val(a).trigger("change"),i.trigger("click"),woo_variation_swatches_options.is_mobile,s(this).parent("li.radio-variable-item").removeClass("selected disabled no-stock").addClass("selected"),s(this).parent("li.radio-variable-item").trigger("wvs-selected-item",[a,i,t.$element])}))),s(a).on("keydown.wvs","li.variable-item:not(.disabled)",(function(t){(t.keyCode&&32===t.keyCode||t.key&&" "===t.key||t.keyCode&&13===t.keyCode||t.key&&"enter"===t.key.toLowerCase())&&(t.preventDefault(),s(this).trigger("click"))}))})),this.$element.on("click.wvs",".woo-variation-swatches-variable-item-more",(function(t){t.preventDefault(),s(this).parent().removeClass("enabled-display-limit-mode enabled-catalog-display-limit-mode"),s(this).remove()})),this.$element.find("[data-wvstooltip]").each((function(t,e){s(e).on("mouseenter",(function(t){var a=e.getBoundingClientRect(),i=o.getComputedStyle(e,":before"),n=o.getComputedStyle(e,":after"),r=parseInt(n.getPropertyValue("border-top-width"),10),s=parseInt(i.getPropertyValue("height"),10),l=parseInt(i.getPropertyValue("width"),10),c=s+r+2;e.classList.toggle("wvs-tooltip-position-bottom",a.top<c);var u=l/2,d=a.left+a.width/2,v=u-d,f=u>d,h=u+d,p=document.body.clientWidth<h,m=document.body.clientWidth-h;e.style.setProperty("--horizontal-position","0px"),f&&e.style.setProperty("--horizontal-position","".concat(v+2,"px")),p&&e.style.setProperty("--horizontal-position","".concat(m-2,"px"))}))}))}},{key:"update",value:function(){var t=this;this.$element.on("woocommerce_variation_has_changed.wvs",(function(e){t.setupItems()}))}},{key:"setUpStockInfo",value:function(){var t=this;if(woo_variation_swatches_options.show_variation_stock){var e=parseInt(woo_variation_swatches_options.stock_label_threshold,10);this.$element.on("wvs-selected-item.wvs",(function(a){var i=t.getChosenAttributes(),n=t.findStockVariations(t.product_variations,i);i.count>1&&i.count===i.chosenCount&&t.resetStockInfo(),i.count>1&&i.count===i.mayChosenCount&&n.forEach((function(a){var i='[data-attribute_name="'.concat(a.attribute_name,'"] > [data-value="').concat(a.attribute_value,'"]');a.variation.is_in_stock&&a.variation.max_qty&&a.variation.variation_stock_left&&a.variation.max_qty<=e?(t.$element.find("".concat(i," .wvs-stock-left-info")).attr("data-wvs-stock-info",a.variation.variation_stock_left),t.$element.find(i).addClass("wvs-show-stock-left-info")):(t.$element.find(i).removeClass("wvs-show-stock-left-info"),t.$element.find("".concat(i," .wvs-stock-left-info")).attr("data-wvs-stock-info",""))}))})),this.$element.on("hide_variation.wvs",(function(){t.resetStockInfo()}))}}},{key:"resetStockInfo",value:function(){this.$element.find(".variable-item").removeClass("wvs-show-stock-left-info"),this.$element.find(".wvs-stock-left-info").attr("data-wvs-stock-info","")}},{key:"getChosenAttributes",value:function(){var t={},e=0,a=0;return this.attributeFields.each((function(){var i=s(this).data("attribute_name")||s(this).attr("name"),n=s(this).val()||"";n.length>0&&a++,e++,t[i]=n})),{count:e,chosenCount:a,mayChosenCount:a+1,data:t}}},{key:"findStockVariations",value:function(t,a){for(var o=[],r=0,s=Object.entries(a.data);r<s.length;r++){var l=n(s[r],2),c=l[0];if(0===l[1].length){var u,d=e(this.$element.find("ul[data-attribute_name='".concat(c,"']")).data("attribute_values")||[]);try{for(d.s();!(u=d.n()).done;){var v=u.value,f=_.extend(a.data,i({},c,v)),h=this.findMatchingVariations(t,f);if(h.length>0){var p=h.shift(),m={};m.attribute_name=c,m.attribute_value=v,m.variation=p,o.push(m)}}}catch(t){d.e(t)}finally{d.f()}}}return o}},{key:"findMatchingVariations",value:function(t,e){for(var a=[],i=0;i<t.length;i++){var n=t[i];this.isMatch(n.attributes,e)&&a.push(n)}return a}},{key:"isMatch",value:function(t,e){var a=!0;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i],o=e[i];void 0!==n&&void 0!==o&&0!==n.length&&0!==o.length&&n!==o&&(a=!1)}return a}},{key:"destroy",value:function(){this.$element.removeClass("wvs-loaded"),this.$element.removeData(this.name)}}])&&a(r.prototype,l),c&&a(r,c),Object.defineProperty(r,"prototype",{writable:!1}),t}()),c=function(e){return function(a,i){e.fn[a]=function(n){for(var o=this,r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return this.each((function(r,l){var c=e(l),u=c.data(a);if(u||(u=new i(c,e.extend({},n),a),c.data(a,u)),"string"==typeof n){if("object"===t(u[n]))return u[n];var d;if("function"==typeof u[n])return(d=u)[n].apply(d,s)}return o}))},e.fn[a].Constructor=i,e[a]=function(t){for(var i,n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return(i=e({}))[a].apply(i,[t].concat(o))},e.fn[a].noConflict=function(){return e.fn[a]}}}(jQuery);c("WooVariationSwatches",l)}(window)}(),jQuery((function(t){try{t(document).on("woo_variation_swatches_init",(function(){t(".variations_form:not(.wvs-loaded)").WooVariationSwatches(),t(".woo_variation_swatches_variations_form:not(.wvs-loaded)").WooVariationSwatches(),t(".ywcp_inner_selected_container:not(.wvs-loaded)").WooVariationSwatches()}))}catch(t){window.console.log("Variation Swatches:",t)}t(document).on("wc_variation_form.wvs",(function(e){t(document).trigger("woo_variation_swatches_init")})),t(document).ajaxComplete((function(e,a,i){_.delay((function(){t(".variations_form:not(.wvs-loaded)").each((function(){t(this).wc_variation_form()}))}),1e3)})),t(document.body).on("wc-composite-initializing",".composite_data",(function(e,a){a.actions.add_action("component_options_state_changed",(function(e){t(e.$component_content).find(".variations_form").WooVariationSwatches("destroy")}))}))}));