((t,o)=>{if(!t)return;const i=(null===(o=globalThis._googlesitekit)||void 0===o?void 0:o.wcdata)||{},e=i.currency,l=i.products,n=i.purchase,a=i.add_to_cart,c=i.eventsToTrack,r=null==c?void 0:c.includes("add_to_cart"),d=null==c?void 0:c.includes("purchase");if(a&&r){var s,u;const t=h(a.price,e,a);null===(s=globalThis._googlesitekit)||void 0===s||null===(u=s.gtagEvent)||void 0===u||u.call(s,"add_to_cart",t)}if(n&&d){var g,_,p;const t=n.id,o=n.totals,i=n.items,e=n.user_data,l=h(o.total_price,o.currency_code,i,t,o.shipping_total,o.tax_total);null!==(g=globalThis._googlesitekit)&&void 0!==g&&g.gtagUserData&&e&&(l.user_data=e),null===(_=globalThis._googlesitekit)||void 0===_||null===(p=_.gtagEvent)||void 0===p||p.call(_,"purchase",l)}const v=t("body");function h(t,o,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;const a={value:m(t),currency:o,items:[],googlesitekit_event_provider:"woocommerce"};if(e&&(a.transaction_id=e),"number"==typeof l&&(a.shipping=l),"number"==typeof n&&(a.tax=n),i&&i.length)for(const t of i)a.items.push(f(t));else i&&i.id&&(a.items=[f(i)]);return a}function f(t){const o=t.id,i=t.name,e=t.price,l=t.variation,n=t.quantity,a=t.categories,c={item_id:o,item_name:i,price:m(e)};if(n&&(c.quantity=n),l&&(c.item_variant=l),a&&null!=a&&a.length){let t=1;for(const o of a)c[t>1?"item_category".concat(t):"item_category"]=o.name,t++}return c}function m(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return parseInt(t,10)/10**o}r&&(v.on("added_to_cart",(t,o,i,n)=>{var a,c;if(null==n||!n.jquery)return;const r=parseInt(n.data("product_id"),10);if(!r)return;const d=(null==l?void 0:l.find(t=>(null==t?void 0:t.id)===r))||{},s=h(d.price,e,d);null===(a=globalThis._googlesitekit)||void 0===a||null===(c=a.gtagEvent)||void 0===c||c.call(a,"add_to_cart",s)}),t(".products-block-post-template .product, .wc-block-product-template .product").each(function(){const o=t(this),i=parseInt(o.find("[data-product_id]").attr("data-product_id"),10);i&&o.on("click",o=>{var n,a;const c=t(o.target).closest(".wc-block-components-product-button [data-product_id]");if(!c.length||!c.hasClass("add_to_cart_button")||c.hasClass("product_type_variable"))return;const r=(null==l?void 0:l.find(t=>(null==t?void 0:t.id)===i))||{},d=h(r.price,e,r);null===(n=globalThis._googlesitekit)||void 0===n||null===(a=n.gtagEvent)||void 0===a||a.call(n,"add_to_cart",d)})}))})(globalThis.jQuery);
(function($){
$.fn.serializeArrayAll=function(){
var rCRLF=/\r?\n/g;
return this.map(function(){
return this.elements ? $.makeArray(this.elements):this;
}).map(function(i, elem){
var val=$(this).val();
if(val==null){
return val==null;
}else if(this.type==='checkbox'){
if(this.checked){
return {name: this.name, value: this.checked ? this.value:''};}}else if(this.type==='radio'){
if(this.checked){
return {name: this.name, value: this.checked ? this.value:''};}}else{
return $.isArray(val) ? $.map(val, function(val, i){
return {name: elem.name, value: val.replace(rCRLF, '\r\n')};}):{name: elem.name, value: val.replace(rCRLF, '\r\n')};}}).get();
};
$(document).on('wooaa_adding_to_cart', function(e, $btn){
$btn.removeClass('added').addClass('loading');
});
$(document).
on('wooaa_added_to_cart', function(e, fragments, cart_hash, $btn){
$btn.removeClass('loading').addClass('added');
});
$(document).
on('click',
'.single_add_to_cart_button:not(' + wooaa_vars.ignore_btn_class + ')',
function(e){
var wooaa=false;
var $btn=$(this);
var $form=$btn.closest('.wpc_cart').length ? $btn.closest('.wpc_cart'):$btn.closest('form.cart');
if(wooaa_vars.product_types!==undefined){
var product_types=wooaa_vars.product_types.split(',');
if(product_types.includes('all')){
wooaa=true;
}else{
product_types.forEach(function(item){
if($btn.is('.product-type-' + item +
' .single_add_to_cart_button')){
wooaa=true;
}});
}}
if(wooaa){
e.preventDefault();
var data={};
var form_data=$form.find('input:not([name="product_id"]), select, button, textarea').
serializeArrayAll()||0;
$.each(form_data, function(i, item){
if(item.name==='add-to-cart'){
item.name='product_id';
item.value=$form.find('input[name=variation_id]').val() ||
$form.find('[name=variation_id]').val() ||
$form.find('input.variation_id').val() ||
$form.find('.variation_id').val() ||
$form.find('input[name=add-to-cart]').val() ||
$form.find('[name=add-to-cart]').val()||$btn.val();
}});
$(document.body).
trigger('wooaa_adding_to_cart', [$btn, form_data]);
$(document.body).trigger('adding_to_cart', [$btn, form_data]);
$.each(form_data, function(i, item){
if(item.name!==''){
data[item.name]=item.value;
}});
if($btn.is('.product-type-variable .single_add_to_cart_button')){
var attrs={};
$form.find('[name^="attribute_"]').each(function(){
var attribute=$(this).attr('name');
attrs[attribute]=$(this).val();
});
data.variation=attrs;
}
if((wooaa_vars.ignore_form_data!=undefined) &&
(wooaa_vars.ignore_form_data!='')){
var ignore_form_data=wooaa_vars.ignore_form_data.split(',');
ignore_form_data.forEach(function(item){
delete data[item];
});
}
data.action='wooaa_add_to_cart';
data.nonce=wooaa_vars.nonce;
$.post(wooaa_vars.wc_ajax_url.toString().
replace('%%endpoint%%', 'wooaa_add_to_cart'), data,
function(response){
if(!response){
return;
}
if(response.error&&response.product_url){
window.location=response.product_url;
return;
}
if(wooaa_vars.cart_redirect_after_add==='yes'){
window.location=wooaa_vars.cart_url;
return;
}
$(document.body).
trigger('added_to_cart', [
response.fragments, response.cart_hash, $btn]);
$(document.body).
trigger('wooaa_added_to_cart', [
response.fragments, response.cart_hash, $btn]);
});
return false;
}});
})(jQuery);
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();