PageSourceSearch

https://treesforever.org/_static/??-eJylUu1OwzAMfCFCGBKC/UA8i5tknb…lxaj1onsq30IoRdmQTNVG/hdfO8fXh5fNpuN588CGUj

js treesforever.org collected 2026-10-02 05:15:23 UTC 120,813 bytes, 1,394 lines download raw bytes

1(()=>{function e(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n){if(n){var r=e.getElementsByClassName(t)[0];r&&(r.textContent=n)}}function r(t,r){for(var l=0,a=Object.entries(r);l<a.length;l++){var o=(i=a[l],u=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,a,o,i=[],u=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){s=!0,l=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw l}}return i}}(i,u)||e(i,u)||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.")}());n(t,o[0],o[1])}var i,u}!function(){var t,n=function(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=e(t))){r&&(t=r);var l=0,a=function(){};return{s:a,n:function(){return l>=t.length?{done:!0}:{done:!1,value:t[l++]}},e:function(e){throw e},f:a}}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 o,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}(document.getElementsByClassName("cm-contact-form"));try{for(n.s();!(t=n.n()).done;)t.value.onsubmit=function(e){var t,n,l,a,o,i,u,s;e.preventDefault();var m=e.target,c=null===(t=m.getElementsByClassName("firstName")[0])||void 0===t?void 0:t.value,f=null===(n=m.getElementsByClassName("lastName")[0])||void 0===n?void 0:n.value,v=null===(l=m.getElementsByClassName("email")[0])||void 0===l?void 0:l.value,d=null===(a=m.getElementsByClassName("telephone")[0])||void 0===a?void 0:a.value,y=null===(o=m.getElementsByClassName("consent_check")[0])||void 0===o?void 0:o.checked,b=(null===(i=m.getElementsByClassName("list_id")[0])||void 0===i?void 0:i.value)||null;jQuery.post(null===(u=ce4wp_form_submit_data)||void 0===u?void 0:u.url,{action:"ce4wp_form_submission",
1nonce:null===(s=ce4wp_form_submit_data)||void 0===s?void 0:s.nonce,first_name:c,last_name:f,email:v,telephone:d,consent:y,list_id:b}).done((function(){var e,t=m.parentElement,n=null===(e=t.getElementsByClassName("onSubmissionSetting")[0])||void 0===e?void 0:e.value;if("redirect"===n){var l,a=new RegExp("^(https?)://"),o=null===(l=t.getElementsByClassName("redirect")[0])||void 0===l?void 0:l.value;a.test(o)||(o="https://"+o),window.location.href=o}else m.style.visibility="hidden","summary"===n&&r(t,{firstNameSummary:c?c+" ":null,lastNameSummary:f,telephoneSummary:d,emailSummary:v}),t.getElementsByClassName("onSubmission")[0].style.display="block"}))}}catch(e){n.e(e)}finally{n.f()}}()})();;
2!function(){const o=window.navigator.userAgent;Object.entries({android:/android/i,iphone:/iPhone/i,ipad:/iPad/i}).forEach((([n,i])=>{o.match(i)&&document.body.classList.add(`tec-is-${n}`)}))}(),window.tec=window.tec||{},window.tec.common=window.tec.common||{},window.tec.common.userAgent={};;
3(()=>{const e=document.querySelectorAll(".coblocks-animate");if("IntersectionObserver"in window){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.classList.add(e.target.dataset.coblocksAnimation),t.unobserve(e.target))}))}),{threshold:[.15]});e.forEach((e=>{t.observe(e)}))}else e.forEach((e=>{e.classList.remove("coblocks-animate"),delete e.dataset.coblocksAnimation}))})();;
4(()=>{var e={2590:function(e){e.exports=function(){"use strict";function e(){return e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.apply(this,arguments)}function t(e,t){void 0===t&&(t=[]),Array.isArray(t)||(t=[t]),t.forEach((function(t){return!e.classList.contains(t)&&e.classList.add(t)}))}function n(e,t,n,i){e.addEventListener(t,n,i)}function i(e,t,n){e.removeEventListener(t,n)}function r(e,t,n){return void 0===n&&(n=""),e.setAttribute(t,n),e}function o(e,t,n){return Object.keys(t).forEach((function(n){e.style[n]=t[n]})),n&&getComputedStyle(e),e}var a={direction:"horizontal",touchRatio:1,touchAngle:45,longSwipesRatio:.5,initialSlide:0,loop:!1,freeMode:!1,passiveListeners:!0,resistance:!0,resistanceRatio:.85,speed:300,longSwipesMs:300,spaceBetween:0,slidesPerView:1,centeredSlides:!1,slidePrevClass:"swiper-slide-prev",slideNextClass:"swiper-slide-next",slideActiveClass:"swiper-slide-active",slideClass:"swiper-slide",wrapperClass:"swiper-wrapper",touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchMoveStopPropagation:!1,excludeElements:[],injections:{translate:function(e,t,n,i){o(t.element.$wrapper,{transition:e.isStart?"none":"transform ease "+i+"ms",transform:n.isHorizontal?"translate3d("+e.transforms+"px, 0, 0)":"translate3d(0, "+e.transforms+"px, 0)"})}}};var s="before-init",c="after-init",u="before-slide",l="scroll",f="after-slide",p="before-destroy",d="after-destroy";var m=180/Math.PI;function v(){var t=[];return{getDuration:function(){var e=t[0],n=t[t.length-1];return e?n.time-e.time:0},getOffset:function(){var e=t[0],n=t[t.length-1];return e?{x:n.x-e.x,y:n.y-e.y}:{x:0,y:0}},getLogs:function(){return t},vector:function(){return function(t,n){var i=t[n],r=t[n-1]||i,o={x:i.x-r.x,y:i.y-r.y},a=i.time-r.time,s=o.x/a||0,c=o.y/a||0;return e({},o,{angle:Math.atan2(Math.abs(o.y),Math.abs(o.x))*m,velocityX:s,velocityY:c})}(t,t.length-1)},clear:function(){t=[]},push:function(n){t.push(e({time:Date.now()},n))}}}function h(){return performance?performance.now():Date.now()}var x=requestAnimationFrame||webkitRequestAnimationFrame||setTimeout,g=cancelAnimationFrame||webkitCancelAnimationFrame||clearTimeout;function S(){var e,t,n={run:function(n){e=void 0===e?h():e,t=x((function(){var t=h(),i=t-e;e=t,n(i)}))},stop:function(){e=void 0,g(t)}};return{run:function e(t){n.run((function(n){e(t),t(n)}))},stop:function(){n.stop()}}}function w(e,t){var n=e.tracker,i=t.initStatus;n.clear(),i()}function y(e,t,r,o){var a=e.touchable,s=["INPUT","SELECT","OPTION","TEXTAREA","BUTTON","VIDEO"],c=function(e,t,n,i){var r=i.initLayout,o=i.initStatus,a=i.render,s=i.scrollPixel,c=i.slideTo,u=i.getOffsetSteps,l=S();return{preheat:function(e,t){var i=n.tracker;l.stop(),i.clear(),i.push(e),r(t),o(t),n.isStart=!0,a()},move:function(t){var i=n.tracker,r=e.touchRatio,o=e.touchAngle,c=e.isHorizontal;if(n.isStart&&!n.isScrolling){i.push(t);var u=i.vector(),l=i.getOffset();if(l.x||l.y)if(c&&u.angle<o||!c&&90-u.angle<o||n.isTouching){var f=u[c?"x":"y"]*r;n.isTouching=!0,s(f),a()}else n.isScrolling=!0,i.clear()}},stop:function(){var r=n.index,o=n.tracker,f=t.measure;if(n.isStart)if(n.isStart=!1,e.freeMode){var p=o.vector()[e.isHorizontal?"velocityX":"velocityY"];l.run((function(e){var t=p*e;p*=.98,Math.abs(t)<.01?(l.stop(),w(n,i)):(s(t),a(0))}))}else{var d=o.getDuration(),m=o.getOffset()[e.isHorizontal?"x":"y"],v=
4Math.ceil(Math.abs(m)/f.boxSize),h=u(m);d>e.longSwipesMs?c(r+h*(m>0?-1:1)):c(m>0?r-v:r+v),w(n,i)}}}}(r,e,t,o),u=c.preheat,l=c.move,f=c.stop;function p(e){var t=a?e.changedTouches[0]:e;return{x:t.pageX,y:t.pageY}}function d(t){for(var n=0;n<r.excludeElements.length;n++)if(r.excludeElements[n].contains(t.target))return;var i,o,c,l,f=e.element.$wrapper,d=r.touchStartPreventDefault&&-1===s.indexOf(t.target.nodeName)||r.touchStartForcePreventDefault;!a&&d&&t.preventDefault(),u(p(t),(i=f,o=r.isHorizontal,c=getComputedStyle(i).transform.replace(/[a-z]|\(|\)|\s/g,"").split(",").map(parseFloat),l=[],16===c.length?l=c.slice(12,14):6===c.length&&(l=c.slice(4,6)),l[o?0:1]||0))}function m(e){r.touchMoveStopPropagation&&e.stopPropagation(),l(p(e)),t.isTouching&&!1!==e.cancelable&&e.preventDefault()}function v(){f()}return{attach:function(){var t=e.element.$el;a?(n(t,"touchstart",d,{passive:r.passiveListeners,capture:!1}),n(t,"touchmove",m),n(t,"touchend",v),n(t,"touchcancel",v)):(n(t,"mousedown",d),n(document,"mousemove",m),n(document,"mouseup",v))},detach:function(){var t=e.element.$el;i(t,"touchstart",d),i(t,"touchmove",m),i(t,"touchend",v),i(t,"touchcancel",v),i(t,"mousedown",d),i(document,"mousemove",m),i(document,"mouseup",v)}}}function b(e,t,n){var i=e.$list,r=t.viewSize,o=t.slideSize,a=t.boxSize,s=function(e){return e.loop?Math.ceil(e.slidesPerView):0}(n),c=s*a,u=-c+(n.centeredSlides?(r-o)/2:0);return{max:u,min:n.spaceBetween+(n.loop?o:r)+u-a*i.length,base:u,expand:s,buffer:c,minIndex:0,maxIndex:i.length-(n.centeredSlides||n.loop?1:Math.ceil(n.slidesPerView))}}function z(e,t){var n={};function i(e){var i=function(e,t){var n=t.$el,i=e.isHorizontal?n.offsetWidth:n.offsetHeight,r=(i-Math.ceil(e.slidesPerView-1)*e.spaceBetween)/e.slidesPerView;return{boxSize:r+e.spaceBetween,viewSize:i,slideSize:r}}(t,e),r=b(e,i,t),o=Boolean("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0||window.DocumentTouch&&document instanceof DocumentTouch);Object.assign(n,{touchable:o,element:e,measure:i,limitation:r})}return n.update=i,i(e),n}var T="data-shallow-slider",P="data-slider";function E(e,n){function i(i){var r=e.element.$wrapper,o=i.index;r.querySelectorAll("["+P+"]").forEach((function(e){var i,r,a=~~e.getAttribute(P);i=e,void 0===(r=[n.slidePrevClass,n.slideNextClass,n.slideActiveClass])&&(r=[]),Array.isArray(r)||(r=[r]),r.forEach((function(e){return i.classList.contains(e)&&i.classList.remove(e)})),a===o&&t(e,n.slideActiveClass),a===o-1&&t(e,n.slidePrevClass),a===o+1&&t(e,n.slideNextClass)}))}function a(){e.element.$wrapper.querySelectorAll("["+T+"]").forEach((function(t){return e.element.$wrapper.removeChild(t)}))}function s(){e.element.$list.forEach((function(e,t){return r(e,P,t)})),a(),function(){if(n.loop){var t=e.element,i=e.limitation,o=t.$list,a=t.$wrapper,s=i.expand,c=o.slice(-s).map((function(e){return e.cloneNode(!0)})),u=o.slice(0,s).map((function(e){return e.cloneNode(!0)}));c.forEach((function(e,t){a.appendChild(r(u[t],T)),a.insertBefore(r(c[t],T),o[0])}))}}()}function c(){var t,i=e.element,r=e.measure,a=i.$wrapper,s={display:"flex",willChange:"transform",flexDirection:n.isHorizontal?"row":"column"},c=((t={})[n.isHorizontal?"width":"height"]=r.slideSize+"px",t[n.isHorizontal?"margin-right":"margin-bottom"]=n.spaceBetween+"px",t);o(a,s),a.querySelectorAll("["+P+"]").forEach((function(e){return o(e,c)}))}return{init:function(){s(),c()},render:function(t,r,o,a){var s=e.element.$wrapper,c=void 0===r?n.speed:r;n.injections.translate(t,e,n,c),t.isStart||i(t),a&&getComputedStyle(s).transform,o&&setTimeout(o,c)},destroy:function(){var t=e.element,i=t.$list,r=t.$wrapper,o=n.isHorizontal?"margin-right":"margin-bottom";["display","will-change","flex-direction"].forEach((function(e){r.style.removeProperty(e)})),i.forEach((function(e){return e.style.removeProperty(o)})),a()},updateSize:c}}function M(e,t){var n=e-t.max,i=e-t.min;return n>0?n:i<0?i:0}function A(t,n,i,r,o){function a(e){var n=t.measure;return Math.ceil(Math.abs(e)/n.boxSize-i.longSwipesRatio)}function s(e,t,i){r.render(n,e,t,i)}function c(r){var a,s=t.limitation,c=s.min,u=s.max,f=u-c+(i.loop?t.measure.boxSize:0),p=f+1;n.transforms=r,i.loop?(a=(u-r)%p/f,n.progress=a<0?1+a:a>1?a-1:a):(a=(u-r)/f,n.progress=a<0?0:a>1?1:a),o.emit(l,e({},n))}function p(e,r){var l=t.measure,p=t.limitation,d=p.maxIndex-p.minIndex+1,m=i.loop?(e%d+d)%d:e>p.maxIndex?p.maxIndex:e<p.minIndex?p.minIndex:e,v=-m*l.boxSize+p.base;if(0!==a(v-n.transforms)&&i.loop){var h=M(n.transforms,p),x=m-n.index,g=function(e,t,n,i){var r=n.maxIndex,o=(i>0?1:-1)*(n.minIndex-r-1)+t-e;return Math.abs(i)>Math.abs(o)?o:i}(n.index,m,p,x);g===x||h?n.index===m&&c(h>0?p.min-l.boxSize+h:p.max+l.boxSize+h):c(g<0?p.min-l.boxSize:p.max+l.boxSize),s(0,void 0,!0)}
4o.emit(u,n.index,n,m),n.index=m,c(v),s(r,(function(){o.emit(f,m,n)}))}return{update:function(){p(n.index,0),r.updateSize()},render:s,transform:c,slideTo:p,scrollPixel:function(e){var r=n.transforms,o=t.measure,a=t.limitation,s=Number(e.toExponential().split("e")[1]),u=s<=0?Math.pow(10,-(s-1)):1,l=r;if(i.resistance&&!i.loop&&(e>0&&r>=a.max?e-=Math.pow(e*u,i.resistanceRatio)/u:e<0&&r<=a.min&&(e+=Math.pow(-e*u,i.resistanceRatio)/u)),l+=e,i.loop){var f=n.tracker.vector(),p=i.isHorizontal?f.velocityX:f.velocityY,d=M(r,a);d&&function(e,t,n){return e>0&&t>n.max||e<0&&t<n.min}(p,r,a)&&(l=d>0?a.min-o.boxSize+d:a.max+o.boxSize+d)}c(l)},initStatus:function(e){void 0===e&&(e=0),n.startTransform=e,n.isStart=!1,n.isScrolling=!1,n.isTouching=!1},initLayout:function(e){c(e)},getOffsetSteps:a}}function C(e,t){var n="string"==typeof e?document.body.querySelector(e):e,i=n.querySelector("."+t.wrapperClass),r=[].slice.call(n.getElementsByClassName(t.slideClass));return{$el:n,$wrapper:i,$list:r=r.filter((function(e){return null===e.getAttribute("data-shallow-slider")}))}}var $=function t(n,i){var r,o=function(t){var n=e({},a,t);return e({},n,{isHorizontal:"horizontal"===n.direction})}(i),u=(r={},{on:function(e,t){r[e]?r[e].push(t):r[e]=[t]},off:function(e,t){if(r[e]){var n=r[e].indexOf(t);n>-1&&r[e].splice(n,1)}},emit:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r[e]&&r[e].forEach((function(e){return e.apply(void 0,n)}))},clear:function(){r={}}}),l=z(C(n,o),o),f={tracker:v(),index:0,startTransform:0,isStart:!1,isScrolling:!1,isTouching:!1,transforms:0,progress:0},m=u.on,h=u.off,x=u.emit,g={on:m,off:h,env:l,state:f,options:o};(o.plugins||t.plugins||[]).forEach((function(e){return e(g,o)})),x(s,g);var S=E(l,o),w=A(l,f,o,S,u),b=y(l,f,o,w);var T=w.slideTo;return Object.assign(g,{update:function(){S.destroy(),l.update(C(n,o)),S.init(),w.update()},destroy:function(){x(p,g),b.detach(),S.destroy(),x(d,g),u.clear()},slideTo:T,updateSize:function(){l.update(C(n,o)),w.update()}}),S.init(),b.attach(),T(o.initialSlide,0),x(c,g),g};return $.use=function(e){$.plugins=e},$}()}},t={};!function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(2590)})();;
5(()=>{var e={7152:function(e){e.exports=function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function t(e,t){void 0===t&&(t=[]),Array.isArray(t)||(t=[t]),t.forEach((function(t){return!e.classList.contains(t)&&e.classList.add(t)}))}function n(e,t,n,i){e.addEventListener(t,n,i)}function i(e,t,n){e.removeEventListener(t,n)}function o(e,t,n){return void 0===n&&(n=""),e.setAttribute(t,n),e}function r(e,t,n){return Object.keys(t).forEach((function(n){e.style[n]=t[n]})),n&&getComputedStyle(e),e}var a={direction:"horizontal",touchRatio:1,touchAngle:45,longSwipesRatio:.5,initialSlide:0,loop:!1,freeMode:!1,passiveListeners:!0,resistance:!0,resistanceRatio:.85,speed:300,longSwipesMs:300,spaceBetween:0,slidesPerView:1,centeredSlides:!1,slidePrevClass:"swiper-slide-prev",slideNextClass:"swiper-slide-next",slideActiveClass:"swiper-slide-active",slideClass:"swiper-slide",wrapperClass:"swiper-wrapper",touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchMoveStopPropagation:!1,excludeElements:[],injections:{translate:function(e,t,n,i){r(t.element.$wrapper,{transition:e.isStart?"none":"transform ease "+i+"ms",transform:n.isHorizontal?"translate3d("+e.transforms+"px, 0, 0)":"translate3d(0, "+e.transforms+"px, 0)"})}}},s="before-slide",l="scroll",c="after-slide";var u=180/Math.PI;function d(){var t=[];return{getDuration:function(){var e=t[0],n=t[t.length-1];return e?n.time-e.time:0},getOffset:function(){var e=t[0],n=t[t.length-1];return e?{x:n.x-e.x,y:n.y-e.y}:{x:0,y:0}},getLogs:function(){return t},vector:function(){return i=(n=t).length-1,o=n[i],n=n[i-1]||o,i={x:o.x-n.x,y:o.y-n.y},o=o.time-n.time,n=i.x/o||0,o=i.y/o||0,e({},i,{angle:Math.atan2(Math.abs(i.y),Math.abs(i.x))*u,velocityX:n,velocityY:o});var n,i,o},clear:function(){t=[]},push:function(n){t.push(e({time:Date.now()},n))}}}function p(){return(performance||Date).now()}var f=requestAnimationFrame||webkitRequestAnimationFrame||setTimeout,m=cancelAnimationFrame||webkitCancelAnimationFrame||clearTimeout;function v(){var e=function(){var e,t;return{run:function(n){e=void 0===e?p():e,t=f((function(){var t=p(),i=t-e;e=t,n(i)}))},stop:function(){e=void 0,m(t)}}}();return{run:function t(n){e.run((function(e){t(n),n(e)}))},stop:function(){e.stop()}}}function x(e,t){e=e.tracker,t=t.initStatus,e.clear(),t()}function h(e,t,n,i){var o=i.initLayout,r=i.initStatus,a=i.render,s=i.scrollPixel,l=i.slideTo,c=i.getOffsetSteps,u=v();return{preheat:function(e,t){var i=n.tracker;u.stop(),i.clear(),i.push(e),o(t),r(t),n.isStart=!0,a()},move:function(t){var i,o=n.tracker,r=e.touchRatio,l=e.touchAngle,c=e.isHorizontal;n.isStart&&!n.isScrolling&&(o.push(t),i=o.vector(),((t=o.getOffset()).x||t.y)&&(c&&i.angle<l||!c&&90-i.angle<l||n.isTouching?(r=i[c?"x":"y"]*r,n.isTouching=!0,s(r),a()):(n.isScrolling=!0,o.clear())))},stop:function(){var o,r,d,p=n.index,f=n.tracker,m=t.measure;n.isStart&&(n.isStart=!1,e.freeMode?(o=f.vector()[e.isHorizontal?"velocityX":"velocityY"],u.run((function(e){e*=o,o*=.98,Math.abs(e)<.01?(u.stop(),x(n,i)):(s(e),a(0))}))):(r=f.getDuration(),d=f.getOffset()[e.isHorizontal?"x":"y"],f=Math.ceil(Math.abs(d)/m.boxSize),m=c(d),r>e.longSwipesMs?l(p+m*(0<d?-1:1)):l(0<d?p-f:p+f),x(n,i)))}}}function g(e,t){var n={};return(n.update=function(e){var i,o=function(e,t,n){var i=e.$list,o=t.viewSize,r=t.slideSize,a=t.boxSize,s=-(t=(e=(s=n).loop?Math.
5ceil(s.slidesPerView):0)*a)+(n.centeredSlides?(o-r)/2:0);return{max:s,min:n.spaceBetween+(n.loop?r:o)+s-a*i.length,base:s,expand:e,buffer:t,minIndex:0,maxIndex:i.length-(n.centeredSlides||n.loop?1:Math.ceil(n.slidesPerView))}}(e,(i=t,r=(o=e).$el,i={boxSize:(r=((o=i.isHorizontal?r.offsetWidth:r.offsetHeight)-Math.ceil(i.slidesPerView-1)*i.spaceBetween)/i.slidesPerView)+i.spaceBetween,viewSize:o,slideSize:r}),t),r=Boolean("ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||window.DocumentTouch&&document instanceof DocumentTouch);Object.assign(n,{touchable:r,element:e,measure:i,limitation:o})})(e),n}var b="data-shallow-slider",y="data-slider";function S(e,n){function i(){e.element.$wrapper.querySelectorAll("["+b+"]").forEach((function(t){return e.element.$wrapper.removeChild(t)}))}function a(){var t=e.element,i=e.measure,o=t.$wrapper,a={display:"flex",willChange:"transform",flexDirection:n.isHorizontal?"row":"column"},s=((t={})[n.isHorizontal?"width":"height"]=i.slideSize+"px",t[n.isHorizontal?"margin-right":"margin-bottom"]=n.spaceBetween+"px",t);r(o,a),o.querySelectorAll("["+y+"]").forEach((function(e){return r(e,s)}))}return{init:function(){(function(){var t,r,a,s,l,c;e.element.$list.forEach((function(e,t){return o(e,y,t)})),i(),n.loop&&(t=e.element,s=e.limitation,r=t.$list,a=t.$wrapper,s=s.expand,l=r.slice(-s).map((function(e){return e.cloneNode(!0)})),c=r.slice(0,s).map((function(e){return e.cloneNode(!0)})),l.forEach((function(e,t){a.appendChild(o(c[t],b)),a.insertBefore(o(l[t],b),r[0])})))})(),a()},render:function(i,o,r,a){var s=e.element.$wrapper;o=void 0===o?n.speed:o,n.injections.translate(i,e,n,o),i.isStart||function(i){var o=e.element.$wrapper,r=i.index;o.querySelectorAll("["+y+"]").forEach((function(e){var i,o,a=~~e.getAttribute(y);i=e,void 0===(o=[n.slidePrevClass,n.slideNextClass,n.slideActiveClass])&&(o=[]),Array.isArray(o)||(o=[o]),o.forEach((function(e){return i.classList.contains(e)&&i.classList.remove(e)})),a===r&&t(e,n.slideActiveClass),a==r-1&&t(e,n.slidePrevClass),a===r+1&&t(e,n.slideNextClass)}))}(i),a&&getComputedStyle(s).transform,r&&setTimeout(r,o)},destroy:function(){var t=e.element,o=t.$list,r=t.$wrapper,a=n.isHorizontal?"margin-right":"margin-bottom";["display","will-change","flex-direction"].forEach((function(e){r.style.removeProperty(e)})),o.forEach((function(e){return e.style.removeProperty(a)})),i()},updateSize:a}}function w(e,t){var n=e-t.max;return t=e-t.min,0<n?n:t<0?t:0}function E(t,n,i,o,r){function a(e){var n=t.measure;return Math.ceil(Math.abs(e)/n.boxSize-i.longSwipesRatio)}function u(e,t,i){o.render(n,e,t,i)}function d(o){var a,s,c=(s=t.limitation).min,u=s.max;c=(s=u-c+(i.loop?t.measure.boxSize:0))+1,n.transforms=o,i.loop?(a=(u-o)%c/s,n.progress=a<0?1+a:1<a?a-1:a):(a=(u-o)/s,n.progress=a<0?0:1<a?1:a),r.emit(l,e({},n))}function p(e,o){var l,p,f,m,v,x=t.measure,h=t.limitation,g=h.maxIndex-h.minIndex+1,b=i.loop?(e%g+g)%g:e>h.maxIndex?h.maxIndex:e<h.minIndex?h.minIndex:e,y=-b*x.boxSize+h.base;0!==a(y-n.transforms)&&i.loop&&(l=w(n.transforms,h),p=b-n.index,f=n.index,m=b,v=p,e=(g=h).maxIndex,f=(0<v?1:-1)*(g.minIndex-e-1)+m-f,(v=Math.abs(v)>Math.abs(f)?f:v)===p||l?n.index===b&&d(0<l?h.min-x.boxSize+l:h.max+x.boxSize+l):d(v<0?h.min-x.boxSize:h.max+x.boxSize),u(0,void 0,!0)),r.emit(s,n.index,n,b),n.index=b,d(y),u(o,(function(){r.emit(c,b,n)}))}return{update:function(){p(n.index,0),o.updateSize()},render:u,transform:d,slideTo:p,scrollPixel:function(e){var o,r=n.transforms,a=t.measure,s=t.limitation,l=(o=Number(e.toExponential().split("e")[1]))<=0?Math.pow(10,-(o-1)):1,c=r;i.resistance&&!i.loop&&(0<e&&r>=s.max?e-=Math.pow(e*l,i.resistanceRatio)/l:e<0&&r<=s.min&&(e+=Math.pow(-e*l,i.resistanceRatio)/l)),c+=e,i.loop&&(o=n.tracker.vector(),l=i.isHorizontal?o.velocityX:o.velocityY,(e=w(r,s))&&(o=r,r=s,0<l&&o>r.max||l<0&&o<r.min)&&(c=0<e?s.min-a.boxSize+e:s.max+a.boxSize+e)),d(c)},initStatus:function(e){void 0===e&&(e=0),n.startTransform=e,n.isStart=!1,n.isScrolling=!1,n.isTouching=!1},initLayout:function(e){d(e)},getOffsetSteps:a}}function z(e,t){var n="string"==typeof e?document.body.querySelector(e):e;return e=n.querySelector("."+t.wrapperClass),t=[].slice.call(n.getElementsByClassName(t.slideClass)),{$el:n,$wrapper:e,$list:t=t.filter((function(e){return null===e.getAttribute("data-shallow-slider")}))}}function L(t,o){var r=(u=e({},a,u=o),e({},u,{isHorizontal:"horizontal"===u.direction})),s=function(){var e={};return{on:function(t,n){e[t]?e[t].push(n):e[t]=[n]},off:function(t,n){!e[t]||-1<(n=e[t].indexOf(n))&&e[t].splice(n,1)},emit:function(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];e[t]&&e[t].forEach((function(e){return e.apply(void 0,i)}))},clear:function(){e={}}}}(),l=g(z(t,r),r),c={tracker:d(),index:0,startTransform:0,isStart:!1,isScrolling:!1,isTouching:!1,transforms:0,progress:0},u=(o=s.on,s.off),p=s.emit,f={on:o,off:u,env:l,state:c,options:r};
5(r.plugins||L.plugins||[]).forEach((function(e){return e(f,r)})),p("before-init",f);var m=S(l,r),v=E(l,c,r,m,s),x=function(e,t,o,r){var a=e.touchable,s=["INPUT","SELECT","OPTION","TEXTAREA","BUTTON","VIDEO"],l=(r=h(o,e,t,r)).preheat,c=r.move,u=r.stop;function d(e){return{x:(e=a?e.changedTouches[0]:e).pageX,y:e.pageY}}function p(t){for(var n=0;n<o.excludeElements.length;n++)if(o.excludeElements[n].contains(t.target))return;var i,r=e.element.$wrapper,c=o.touchStartPreventDefault&&-1===s.indexOf(t.target.nodeName)||o.touchStartForcePreventDefault;!a&&c&&t.preventDefault(),l(d(t),(i=r,c=o.isHorizontal,r=getComputedStyle(i).transform.replace(/[a-z]|\(|\)|\s/g,"").split(",").map(parseFloat),i=[],16===r.length?i=r.slice(12,14):6===r.length&&(i=r.slice(4,6)),i[c?0:1]||0))}function f(e){o.touchMoveStopPropagation&&e.stopPropagation(),c(d(e)),t.isTouching&&!1!==e.cancelable&&e.preventDefault()}function m(){u()}return{attach:function(){var t=e.element.$el;a?(n(t,"touchstart",p,{passive:o.passiveListeners,capture:!1}),n(t,"touchmove",f),n(t,"touchend",m),n(t,"touchcancel",m)):(n(t,"mousedown",p),n(document,"mousemove",f),n(document,"mouseup",m))},detach:function(){var t=e.element.$el;i(t,"touchstart",p),i(t,"touchmove",f),i(t,"touchend",m),i(t,"touchcancel",m),i(t,"mousedown",p),i(document,"mousemove",f),i(document,"mouseup",m)}}}(l,c,r,v);return c=v.slideTo,Object.assign(f,{update:function(){m.destroy(),l.update(z(t,r)),m.init(),v.update()},destroy:function(){p("before-destroy",f),x.detach(),m.destroy(),p("after-destroy",f),s.clear()},slideTo:c,updateSize:function(){l.update(z(t,r)),v.update()}}),m.init(),x.attach(),c(r.initialSlide,0),p("after-init",f),f}return L.use=function(e){L.plugins=e},L}()},3266:function(e){e.exports=function(){"use strict";function e(e,t,n,i){e.addEventListener(t,n,i)}function t(e,t,n){e.removeEventListener(t,n)}return function(n,i){function o(e){c(e.target,"next")}function r(e){c(e.target,"prev")}var a=Boolean(i.navigation),s={nextEl:null,prevEl:null},l=Object.assign({disabledClass:"swiper-button-disabled"},i.navigation),c=function(e,t){u(e)&&!n.options.loop||(e=n.state.index,"next"===t&&n.slideTo(e+1),"prev"===t&&n.slideTo(e-1))},u=function(e){return e.classList.contains(l.disabledClass)};n.on("before-slide",(function(e,t,i){var o,r;n.options.loop||(o=i,i=(r=n.env.limitation).minIndex,r=r.maxIndex,s&&s.prevEl&&s.nextEl&&(s.nextEl.classList.contains(l.disabledClass)&&i<=o&&s.nextEl.classList.remove(l.disabledClass),s.prevEl.classList.contains(l.disabledClass)&&o<=r&&s.prevEl.classList.remove(l.disabledClass),o===i&&s.prevEl.classList.add(l.disabledClass),o===r&&s.nextEl.classList.add(l.disabledClass)))})),n.on("after-init",(function(){var t,i,c;a&&(s.nextEl="string"==typeof l.nextEl?document.body.querySelector(l.nextEl):l.nextEl,s.prevEl="string"==typeof l.prevEl?document.body.querySelector(l.prevEl):l.prevEl,n.options.loop||(t=n.state.index,i=n.env.element.$list,t===(c=n.env.limitation.minIndex)&&s.prevEl&&s.prevEl.classList.add(l.disabledClass),i.length===c&&s.nextEl&&s.nextEl.classList.add(l.disabledClass)),e(s.nextEl,"click",o),e(s.prevEl,"click",r))})),n.on("after-destroy",(function(){s&&s.prevEl&&s.nextEl&&(t(s.nextEl,"click",o),t(s.prevEl,"click",r),delete s.nextEl,delete s.prevEl)}))}}()}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(7152),t=n.n(e),i=n(3266),o=n.n(i);!function(){const e=document.querySelectorAll(".wp-block-coblocks-gallery-carousel");for(let n=0;n<e.length;n++){let i=null,r=0,a=!1;const s=e[n],l=e=>{const t=s.querySelector(`.wp-block-coblocks-gallery-carousel-thumbnail-${r}`);if(t){t.classList.remove("is-active");const n=s.querySelector(`.wp-block-coblocks-gallery-carousel-thumbnail-${e}`);n&&n.classList.add("is-active")}},c=e=>{i?.slideTo(e),l(e),r=e},u=e=>{e!==r&&(l(e),r=e)},d=s.querySelector(".swiper-container");if(d){const e=d.getAttribute("data-swiper");if(e){const n=JSON.parse(e),r=s.querySelector(".nav-button__prev"),l=s.querySelector(".nav-button__next");r&&r.setAttribute("aria-label",coblocksTinyswiper.carouselPrevButtonAriaLabel),l&&l.setAttribute("aria-label",coblocksTinyswiper.carouselNextButtonAriaLabel);const p=s.querySelectorAll("img");for(let e=0;e<p.length;++e)p[e].alt||(p[e].alt=coblocksTinyswiper.sliderImageAriaLabel);const f={centeredSlides:!1,freeMode:!1,longSwipesRatio:.8,loop:!1,passiveListeners:!0,plugins:[],slidesPerView:1};if(!0===n.loop&&(f.loop=n.loop),n.slidesPerView&&(f.slidesPerView=n.slidesPerView),n.navigation&&(f.plugins=[...f.plugins,o()],f.navigation={nextEl:l,prevEl:r}),i=new(t())(d,f),new ResizeObserver((()=>{i.update()})).observe(d),n.thumbnails){const e=s.querySelectorAll(".wp-block-coblocks-gallery-carousel-thumbnail");for(const[t,n]of Object.entries(e))n.addEventListener("click",(()=>c(t)));const t=s.querySelector(".wp-block-coblocks-gallery-carousel-thumbnail-0");t&&t.classList.add("is-active")}if(!n.thumbnails&&n.pageDots){const e=s.querySelectorAll(".wp-block-coblocks-gallery-carousel-page-dot-pagination");for(const[t,n]of Object.entries(e))n.addEventListener("click",(()=>c(t)));const t=s.querySelector(".wp-block-coblocks-gallery-carousel-page-dot--0");t&&t.classList.add("is-active")}if(!0!==n.draggable){const e=s.querySelector(".swiper-wrapper");e?.addEventListener("mousedown",(e=>{e.stopPropagation()}))}!0===n.autoPlay&&n.autoPlaySpeed&&(!0===n.pauseHover&&(d.addEventListener("mouseenter",(()=>{a=!0})),d.addEventListener("mouseleave",(()=>{a=!1}))),setInterval((()=>{!0===n.pauseHover&&!0===a||i?.slideTo(i.state.index+1)}),n.autoPlaySpeed)),i.on("after-slide",u)}}}}()})()})();;
6$ = jQuery;
7
8let flag = true;
9
10if ( jQuery("form.woocommerce-checkout").length > 0 && !( jQuery("form.woocommerce-checkout").hasClass('wc-roundoff')  )  ) {
11	jQuery("form.woocommerce-checkout").addClass('wc-roundoff');
12}
13
14jQuery(window).on('load', function(){
15	if ( wcOrderScript.donationToOrder.is_checkout && wcOrderScript.donationToOrder.is_roundOff == 'yes' ) {
16		jQuery( '.wc-block-components-checkout-place-order-button' ).on('click', function (e) {
17			if ( flag ) {
18				e.stopPropagation();
19				add_popup_before_order();
20			}			
21		});
22	}
23});
24
25//WC Donation Tabs Frontend
26jQuery(document).on('click', '.wc-donation-tabs-wrap ul.tab-nav > li', function(event) {
27	event.preventDefault();
28	jQuery(this).siblings().removeClass('active');
29	jQuery(this).addClass('active');
30	var content = jQuery(this).data('tab');
31	jQuery('.wc-donation-tab-content').removeClass('active');
32	jQuery(`.wc-donation-tab-content.${content}`).addClass('active');
33});
34
35function add_popup_before_order () {
36	jQuery.ajax({
37		url: wcOrderScript.donationToOrder.ajaxUrl,
38		type: "POST",
39		dataType: "json",
40		data: {
41			action: 'add_popup_before_order',
42			nonce: wcOrderScript.donationToOrder.nonce
43		},
44		beforeSend: function () {
45			//if loader needs to add put here
46		},
47		success: function (response) {
48			if (response['status']=='success') {
49				jQuery(".wc-donation-popup").find("#wc-donation-price-" + response['campaign_id']).val(response['donation']);
50				var text = jQuery(".wc-donation-popup").find(".donation_text").text();
51				var res = text.replace("%amount%", response['donation']);
52				jQuery(".wc-donation-popup").find(".donation_text").text(res);
53				jQuery(".wc-donation-popup").addClass('wc-popup-show');
54			} else {
55				flag = false;
56				jQuery( '.wc-block-components-checkout-place-order-button' ).trigger('click');
57				jQuery("form.woocommerce-checkout").submit();
58			}
59		}
60	});
61}
62
63if ( wcOrderScript.donationToOrder.is_checkout && ! wcOrderScript.donationToOrder.is_order_pay ) {
64	/* when click on place order*/
65	jQuery( document ).on(
66		"click",
67		"#place_order",
68		function (e) {		
69			//console.log( wcOrderScript.donationToOrder.is_checkout );
70			if ( wcOrderScript.donationToOrder.is_checkout && wcOrderScript.donationToOrder.is_roundOff == 'yes' ) {
71				e.preventDefault();
72				//debugger;
73				add_popup_before_order();
74			}
75		}
76	);
77}
78
79function NumbersOnly(myfield, e, dec) {
80	/*if ( isNaN(removeCommas(myfield.value)) && myfield.value != "-") {
81        return false;
82	}*/
83	// console.log(min);
84	// console.log(max);
85	
86	// var priceEl = document.getElementById('wc-donation-price-' + id);
87    var allowNegativeNumber = false;
88    var key;
89    var keychar;
90
91    if (window.event)
92        key = window.event.keyCode;
93    else if (e)
94        key = e.which;
95    else
96        return true;
97    keychar = String.fromCharCode(key);
98	var srcEl = e.srcElement ? e.srcElement : e.target;    
99	
100	// if (typeof(priceEl) != 'undefined' && priceEl != null) {
101		
102	// 	priceEl.value = isFinite(parseFloat(myfield.value)) ? parseFloat(myfield.value) : '';
103	// }
104    // control keys
105    if ((key == null) || (key == 0) || (key == 9) || (key == 13) || (key == 27) ) {
106		return true;
107	} 
108	
109	// if ( min != '' && max != '' ) {
110	// 	if ( ( parseFloat(myfield.value) >= min) && ( parseFloat(myfield.value) <= max) ) {
111	// 		if (typeof(priceEl) != 'undefined' && priceEl != null) {
112	// 			priceEl.value = isFinite(parseFloat(myfield.value)) ? parseFloat(myfield.value) : '';
113	// 		}
114	// 		return true;
115	// 	} else {
116	// 		myfield.value = '';
117	// 		if (typeof(priceEl) != 'undefined' && priceEl != null) {
118	// 			priceEl.value = isFinite(parseFloat(myfield.value)) ? parseFloat(myfield.value) : '';
119	// 		}
120	// 		return false;
121	// 	}
122	// }
123
124    // numbers
125    if ((("0123456789").indexOf(keychar) > -1) )
126        return true;
127
128    // decimal point jump
129    else if (dec && (keychar == ".")) {
130        //myfield.form.elements[dec].focus();
131        return srcEl.value.indexOf(".") == -1;        
132	}
133	
134	else if (dec && (keychar == ",")) {
135		return srcEl.value.indexOf(",") == -1;
136	}
137
138    //allow negative numbers
139    else if (allowNegativeNumber && (keychar == "-")) {    
140        return (srcEl.value.length == 0 || srcEl.value == "0.00")
141    }
142    else
143    return false;
144}
145
146jQuery(document).on('focusout', '.grab-donation', function() {	
147	var This = jQuery(this);
148	var min = This.data('min');
149	var max = This.data('max');
150	var id = This.data('campaign_id');
151	var rand_id = This.data('rand_id');
152	var priceEl = document.getElementById('wc-donation-price-' + id + '_' + rand_id);
153	var val = This.val();
154
155	if ( max <= 0 && max != 'any' ) {
156		max = val;
157	}
158
159	if ( (min == 'any' && max == 'any') || (val >= min && val <= max) ) {
160		var procFees = jQuery('#processing-fees-' + id + '_' + rand_id).val();
161		if ( wcOrderScript.donationToOrder.fees_type == 'percentage' ) {
162			var donation_card_fee = val*(procFees/100);
163		} else {
164			var donation_card_fee = procFees;
165		}
166
167		var donation_summary_total = parseFloat(val) + parseFloat(donation_card_fee);
168		
169		if ( donation_summary_total > 0 && donation_summary_total != '' ) {
170			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-currency-symbol').attr('style', 'display: inline-block !important');
171			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-charge .wc-donation-amt').text(parseFloat(val).toFixed(2));
172			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-fee-summary .wc-donation-amt').text(parseFloat(donation_card_fee).toFixed(2));
173			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-summary-total .wc-donation-amt').text(parseFloat(donation_summary_total).toFixed(2));
174		} else {
175			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-currency-symbol').attr('style', 'display: inline-block !important');
176			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-charge .wc-donation-amt').text(parseFloat(0).toFixed(2));
177			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-fee-summary .wc-donation-amt').text(parseFloat(0).toFixed(2));
178			jQuery('#wc-donation-summary-' + id + '_' + rand_id + ' .wc-donation-summary-total .wc-donation-amt').text(parseFloat(0).toFixed(2));
179		}
180		priceEl.value = val;
181	} else {
182		priceEl.value = '';
183		This.val('');
184	}
185});
186
187jQuery(document).on("click", ".wc-close", function(){
188	jQuery(this).parents(".wc-donation-popup").removeClass("wc-popup-show");
189	if ( jQuery('body').hasClass('stopScroll') ) {
190		jQuery('body').removeClass('stopScroll');
191	}
192});
193
194
195function addDonationToOrder(type, amount, min_amount, max_amount, campaign_id, is_recurring, new_period, new_length, new_interval, tracker, donation_type, cause, fees, gift_aid='', tribute='', tribute_message='' ) {
196	
197	let skip = false;
198
199	if ( type === 'roundoff-skip' ) {
200		flag = false;
201		jQuery( '.wc-block-components-checkout-place-order-button' ).trigger('click');
202		jQuery("form.woocommerce-checkout").submit();
203		return true;	
204	} 
205
206	var isblock = jQuery('.entry-content').find('.wp-block-woocommerce-cart');
207
208	if ( (amount != 0 && amount != null && amount > 0) ) {
209		jQuery.ajax(
210			{
211				url: wcOrderScript.donationToOrder.ajaxUrl,
212				type: "POST",
213				dataType: "json",
214				data: {
215					action: wcOrderScript.donationToOrder.action,
216					nonce: wcOrderScript.donationToOrder.nonce,
217					campaign_id: campaign_id,
218					amount: amount,
219					cause: cause,
220					fees: fees,
221					type: type,
222					tribute: tribute,
223					tribute_message: tribute_message,
224					gift_aid: gift_aid,
225					is_recurring: is_recurring,
226					new_period: new_period,
227					new_length: new_length,
228					new_interval: new_interval
229				},
230				beforeSend: function() {
231
232				},
233				success: function (response) {
234					if (response['response'] == 'success') {
235						jQuery( "[name='update_cart']" ).prop( "disabled", false );
236						jQuery( "[name='update_cart']" ).trigger( "click" );
237
238						if (type==='roundoff') {
239							jQuery(".wc-donation-popup").removeClass("wc-popup-show");
240						}
241						
242						if ( typeof wc == 'undefined') {
243							jQuery('body').trigger('update_checkout');	
244						} else {
245							flag = false;
246							const { extensionCartUpdate } = wc.blocksCheckout;
247							extensionCartUpdate({
248							    namespace: 'dfw',
249							    data: {},
250							});
251						}
252						
253
254						if( jQuery("#wc-donation-woocommerce-notices-wrapper").length ) {
255							jQuery("#wc-donation-woocommerce-notices-wrapper").show();
256							document
257							.getElementById("wc-donation-woocommerce-notices-wrapper")
258							.scrollIntoView({ behavior: "smooth" });
259						}
260						
261						if( response['cart_url'] != '' ) {
262							window.location.href = response['cart_url'];
263						}
264
265						if ( response['checkoutUrl'] != '' ) {
266							window.location.href = response['checkoutUrl'];
267						}
268
269					}
270				}
271			}
272		);
273	} else {
274		var text = wcOrderScript.donationToOrder.other_amount_placeholder;
275		text = text.replace("%min%", min_amount);
276		text = text.replace("%max%", max_amount);
277		if ( donation_type == 'both' || donation_type == 'predefined' ) {
278			if ( tracker == 1 ) {				
279				alert(`${text}`);
280			} else {
281				alert(`Please select amount`);
282			}
283		} else {
284			alert(`${text}`);
285		}
286		return true;
287	}
288
289}
290
291jQuery( document ).on("click", ".wc-donation-f-submit-donation, #wc-donation-round-f-submit-donation, #wc-donation-round-f-submit-skip-donation", function (e) {
292		e.preventDefault();		
293		var parents = jQuery(this).parents('.wc-donation-in-action');
294		var type = jQuery(this).data('type');
295		var campaign_id = jQuery(this).siblings('.wc_donation_camp').val();
296		var rand_id = jQuery(this).siblings('.wp_rand').val();
297		var is_recurring = false;
298		var new_period = 'day';
299		var new_length = '1';
300		var new_interval = '1';
301		var min_amount = 0;
302		var max_amount = 0;
303		var donation_type = jQuery(parents).data('donation-type');
304		var tracker = jQuery(parents).find('.wc-opened').length;
305
306		var tracker2 = jQuery(parents).find('.wc-donation-f-donation-other-value').length;
307
308		if ( jQuery(this).data('min-value') ) {
309			min_amount = jQuery(this).data('min-value');
310		}
311
312		if ( jQuery(this).data('max-value') ) {
313			max_amount = jQuery(this).data('max-value');
314		}
315
316		if ( jQuery(parents).find('.donation-is-recurring').length > 0 && jQuery(parents).find('.donation-is-recurring').is(':checked') ) {
317			is_recurring = jQuery(parents).find('.donation-is-recurring').val();
318			new_period = jQuery(parents).find('._subscription_period').val();
319			new_length = jQuery(parents).find('#_subscription_length').val();
320			new_interval = jQuery(parents).find('#_subscription_period_interval').val();
321		} else {
322			is_recurring = 'no';
323		}
324
325		//alert(campaign_id);		
326		if ( type == 'roundoff' || type ==  'roundoff-skip' ) {
327			jQuery(".wc-donation-popup").removeClass("wc-popup-show");
328			var amount = jQuery('.roundoff-donation-price').val();
329		} else {
330			var id = '.donate_' + campaign_id + '_' + rand_id;
331			//alert(id);
332			var amount = jQuery(id).val();
333		}
334		var causeID = '.donate_cause_' + campaign_id + '_' + rand_id;
335		var cause = jQuery(causeID).val();
336		var feeCheck = '.donate_fees_' + campaign_id + '_' + rand_id;
337
338		var fees = jQuery(feeCheck).val();
339		
340		var gift_aid = '';
341
342		if ( jQuery( `#wc_donation_gift_aid_checkbox_${campaign_id}_${rand_id}` ).length > 0 && jQuery( `#wc_donation_gift_aid_checkbox_${campaign_id}_${rand_id}` ).is(':checked') ) {
343			gift_aid = 'yes';
344		}		
345
346		var tribute 		= '';	
347		var tribute_message = '';	
348
349		if ( jQuery( `#_hidden_tribute_${campaign_id}_${rand_id}` ).length > 0 && jQuery("input[name='wc_donation_tribute_checkbox']:checked").length && jQuery( `#_hidden_tribute_${campaign_id}_${rand_id}` ).val() != '' ) {
350			tribute = jQuery( `#_hidden_tribute_${campaign_id}_${rand_id}` ).val();
351		}
352
353		if( jQuery( `#wc_donation_trubte_message_${campaign_id}_${rand_id}` ).length > 0 && jQuery("input[name='wc_donation_tribute_checkbox']:checked").length && jQuery( `#wc_donation_trubte_message_${campaign_id}_${rand_id}` ).val() != '' ) {
354			tribute_message = jQuery( `#wc_donation_trubte_message_${campaign_id}_${rand_id}` ).val();
355		}
356		
357
358
359		addDonationToOrder(type, amount, min_amount, max_amount, campaign_id, is_recurring, new_period, new_length, new_interval, tracker, donation_type, cause, fees, gift_aid, tribute, tribute_message );
360	}
361);
362
363jQuery(document).on('click', 'label.wc-label-button input[type="radio"][name="wc_label_price"], label.wc-label-button input[type="radio"][name="wc_label_cause"]', function() {
364	
365	if ( jQuery(this).is(':checked') ) {
366		//alert('I clicked');
367		jQuery(this).parent('.wc-label-button').siblings().removeClass('wc-active');
368		jQuery(this).parent('.wc-label-button').addClass('wc-active');
369	}
370});
371
372jQuery(document).on('click', 'label.wc-label-radio input[type="radio"][name="wc_donation_tribute_checkbox"]', function() {
373	//debugger;
374	if ( jQuery(this).is(':checked') ) {
375		jQuery(this).parent().siblings('.wc_donation_trubte_name').prop('type', 'text');		
376		jQuery(this).parent().siblings('.wc_donation_trubte_message').prop('type', 'text');		
377	}
378});
379
380jQuery(document).on('copy paste keyup click', '.wc_donation_trubte_name', function() {	
381	var tribute_name = jQuery(this).val();
382	var tribute_check_value = jQuery(this).siblings('label.wc-label-radio').find('input[name="wc_donation_tribute_checkbox"]:checked').val();	
383	if ( jQuery.trim( tribute_name ) != '' && jQuery.trim( tribute_check_value ) != '' ) {
384		jQuery(this).siblings('input[name="tribute"]').val( `${tribute_check_value} ${tribute_name}` );
385	} else {
386		jQuery(this).siblings('input[name="tribute"]').val('');
387	}
388});
389
390jQuery(document).on('change', '.wc-label-radio input.donation-processing-fees', function(){
391	var id = jQuery(this).data('id');
392	var campid = jQuery(this).data('camp');
393	var procFees = jQuery(this).val();
394	var wcdonationprice = jQuery('#wc-donation-price-'+campid).val();
395	if ( wcOrderScript.donationToOrder.fees_type == 'percentage' ) {
396		var donation_card_fee = wcdonationprice*(procFees/100);
397	} else {
398		var donation_card_fee = procFees;
399	}	
400	var donation_summary_total = parseFloat(wcdonationprice) + parseFloat(donation_card_fee);
401	
402	if ( donation_summary_total > 0 && donation_summary_total != '' ) {
403		jQuery('#wc-donation-summary-' + campid + ' .wc-donation-currency-symbol').attr('style', 'display: inline-block !important');
404		jQuery('#wc-donation-summary-' + campid + ' .wc-donation-charge .wc-donation-amt').text(parseFloat(wcdonationprice).toFixed(2));
405		jQuery('#wc-donation-summary-' + campid + ' .wc-donation-fee-summary .wc-donation-amt').text(parseFloat(donation_card_fee).toFixed(2));
406		jQuery('#wc-donation-summary-' + campid + ' .wc-donation-summary-total .wc-donation-amt').text(parseFloat(donation_summary_total).toFixed(2));
407	}
408	if ( jQuery(this).is(':checked') ) {
409		jQuery('#wc-donation-summary-'+campid).show();
410		jQuery('#wc-donation-' + id).val(procFees);
411	}
412	else {
413		jQuery('#wc-donation-summary-'+campid).hide();
414		jQuery('#wc-donation-' + id).val(undefined);
415	}
416});
417jQuery(document).on("click", "ul.causes-dropdown .init", function() {
418    jQuery(this).parent().children('li:not(.init)').toggle();
419    jQuery(this).parent().toggleClass('active');
420});
421
422jQuery(document).on("click", "ul.causes-dropdown li:not(.init)", function() {
423	var allOptions = jQuery(this).parent().children('li:not(.init)');
424	var id = jQuery(this).data('id');
425	var causeName = jQuery(this).data('name');
426	jQuery('#wc-donation-' + id).val(causeName);
427    allOptions.removeClass('selected');
428    jQuery(this).addClass('selected');
429    jQuery(this).parent().removeClass('active');
430    jQuery(this).parent().children('.init').html(jQuery(this).html());
431    allOptions.toggle();
432});
433
434$(document.body).mousedown(function(event) {
435    var target = $(event.target);
436    if ( $('ul.causes-dropdown').hasClass('active') && !target.parents().andSelf().is('ul.causes-dropdown')) { // Clicked outside
437        $('ul.causes-dropdown').removeClass( 'active' );
438        $('ul.causes-dropdown').children('li:not(.init)').toggle();
439    }
440});
441
442// jQuery(document).on('change', '.wc-label-radio input.donation-processing-fees', function(){
443// 	if(jQuery(this).is('checked')){
444// 		var id = jQuery(this).data('id');
445// 		jQuery('#wc-donation-' + id).val(jQuery(this).val());
446// 	}
447// 	else{
448// 		jQuery('#wc-donation-' + id).val('');
449// 	}
450// });
451
452jQuery(document).on('change copy paste click', '.wc-label-button input, .wc-label-radio input, .wc-label-select', function(){
453
454	var id = jQuery(this).data('id');
455
456	jQuery('#wc-donation-price-' + id).val(jQuery(this).val());
457	if ( jQuery(this).val() == 'wc-donation-other-amount' ) {
458		jQuery("#wc-donation-f-donation-other-value-" + id).show();
459		jQuery("#wc-donation-f-donation-other-value-" + id).addClass('wc-opened');
460		jQuery("#wc-donation-f-donation-other-value-" + id).siblings('.wc-donation-tooltip').show();
461	} else {
462		jQuery("#wc-donation-f-donation-other-value-" + id).hide();
463		jQuery("#wc-donation-f-donation-other-value-" + id).removeClass('wc-opened');
464		jQuery("#wc-donation-f-donation-other-value-" + id).siblings('.wc-donation-tooltip').hide();
465	}
466	var procFees = jQuery('#processing-fees-'+id).val();
467	var wcdonationprice = jQuery('#wc-donation-price-' + id).val();
468	if ( wcOrderScript.donationToOrder.fees_type == 'percentage' ) {
469		var donation_card_fee = wcdonationprice*(procFees/100);
470	} else {
471		var donation_card_fee = procFees;
472	}	
473	var donation_summary_total = parseFloat(wcdonationprice) + parseFloat(donation_card_fee);	
474	if ( donation_summary_total > 0 && donation_summary_total != '' ) {
475		jQuery('#wc-donation-summary-' + id + ' .wc-donation-currency-symbol').attr('style', 'display: inline-block !important');
476		jQuery('#wc-donation-summary-' + id + ' .wc-donation-charge .wc-donation-amt').text(parseFloat(wcdonationprice).toFixed(2));
477		jQuery('#wc-donation-summary-' + id + ' .wc-donation-fee-summary .wc-donation-amt').text(parseFloat(donation_card_fee).toFixed(2));
478		jQuery('#wc-donation-summary-' + id + ' .wc-donation-summary-total .wc-donation-amt').text(parseFloat(donation_summary_total).toFixed(2));
479	}
480});
481
482jQuery(document).on('change', '._subscription_period', function(){
483
484    var $this = jQuery(this);
485    var subscription_field = $this.parents('.wc-donation-in-action').find('select[name="_subscription_length"]');
486    var period = $this.val();
487
488    jQuery.ajax({
489        url: wcOrderScript.donationToOrder.ajaxUrl,
490        type: "POST",
491        dataType: "json",
492        data: {
493            action: 'wc_donation_get_sub_length_by_sub_period',
494            period: period,
495            nonce: wcOrderScript.donationToOrder.nonce
496        },
497        beforeSend: function () {
498            jQuery(subscription_field).css({'pointer-events': 'none', 'opacity': '0.5'});
499        },
500        success: function (response) {
501            
502            if ( response.range != '' ) {
503                jQuery(subscription_field).html('');
504                jQuery.each(response.range, function(index, val) {
505                    jQuery(subscription_field).append('<option value="'+ index +'">'+ val +'</option>');
506                } );
507
508                jQuery(subscription_field).removeAttr('style');
509            }
510        }
511    });
512
513});
514
515jQuery(function(jQuery){
516
517	jQuery(".donor-lists .give-grid__item").slice(0, 12).css('display', 'flex');
518	jQuery(".anonymous-donor-lists .give-grid__item").slice(0, 12).css('display', 'flex');
519	jQuery(".global-donor-lists .give-grid__item").slice(0, 12).css('display', 'flex');
520	jQuery(".leaderboard-donor-lists .give-grid__item").slice(0, 12).css('display', 'flex');
521	jQuery(".give-donor__load_more").on('click', function (e) {
522        e.preventDefault();
523        jQuery(this).siblings('.give-grid').find(".give-grid__item:hidden").slice(0, 4).css('display', 'flex');
524        if (jQuery(this).siblings('.give-grid').find(".give-grid__item:hidden").length == 0) {
525            jQuery(this).fadeOut(700);
526        }
527    });
528
529    jQuery('input[name="wc_donation_tribute_checkbox"]').click(function(){
530        var $radio = $(this);
531        if ($radio.data('waschecked') == true) {
532            $radio.prop('checked', false);
533			jQuery(".wc_donation_trubte_name").prop('type', 'hidden');
534			jQuery(".wc_donation_trubte_message").prop('type', 'hidden');
535            $radio.data('waschecked', false);
536        } else {
537            $radio.data('waschecked', true);
538		}
539        $radio.siblings('input[name="wc_donation_tribute_checkbox"]').data('waschecked', false);
540    });
541});;
542(()=>{var e={};(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var s=globalThis.document;if(!t&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(t=s.currentScript.src),!t)){var o=s.getElementsByTagName("script");if(o.length)for(var a=o.length-1;a>-1&&(!t||!/^http(s?):/.test(t));)t=o[a--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";window.wp.domReady;const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},s=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,o=(e,t,s="wcpay_")=>e.toString().replace("%%endpoint%%",s+t);function a(e,t="",s){for(const o in e){const n=e[o],i=t?t+"["+o+"]":o;"string"==typeof n||"number"==typeof n?s.append(i,n):"object"==typeof n&&a(n,i,s)}return s}async function n(e,t,s){const o=a(t,"",new FormData),n=await fetch(e,{method:"POST",body:o,...s});return await n.json()}const i=window.React,r=window.wp.i18n;function c(e){window.WooPayConnect||(window.WooPayConnect={}),window.WooPayConnect.iframeInjectedState=e}function l(){return window?.WooPayConnect?.postMessageTimeout||5e3}const d=window.ReactJSXRuntime,u=()=>{const t=(0,i.useRef)(),[o,a]=(0,i.useState)("");return(0,i.useEffect)(()=>{(async()=>{const t=e("testMode"),o=e("woopayHost"),n=e("woopayMerchantId"),i=new URLSearchParams({testMode:t,source_url:window.location.href,blogId:n}),r=await(async()=>{let t=(()=>{const e=document.cookie.split(";");for(let t=0;t<e.length;t++){let s=e[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf("tk_ai="))return s.substring(6,s.length)}})();if(t){const e={_ut:"anon",_ui:t};return JSON.stringify(e)}const o=e("platformTrackerNonce")??s("nonce")?.platform_tracker,a=e("ajaxUrl")??s("ajax_url"),n=new FormData;n.append("tracksNonce",o),n.append("action","get_identity");try{const e=await fetch(a,{method:"post",body:n});if(!e.ok)return;const t=await e.json();return t.success&&t.data&&t.data._ui&&t.data._ut?JSON.stringify(t.data):void 0}catch(e){return}})();r&&i.append("tracksUserIdentity",r),a(`${o}/connect/?${i.toString()}`)})()},[]),(0,i.useEffect)(()=>
542{if(!o||!t.current)return;const s=t.current,a=()=>{c(2),window.dispatchEvent(new MessageEvent("message",{source:window,origin:e("woopayHost"),data:{action:"get_iframe_post_message_success",value:t=>s.contentWindow.postMessage(t,e("woopayHost"))}}))};return s.addEventListener("load",a),()=>{s.removeEventListener("load",a)}},[o]),o?(0,d.jsx)("iframe",{ref:t,id:"woopay-connect-iframe",src:o,style:{height:0,width:0,border:"none",margin:0,padding:0,overflow:"hidden",display:"block",visibility:"hidden",position:"fixed",pointerEvents:"none",userSelect:"none"},title:(0,r.__)("WooPay Connect Direct Checkout","woocommerce-payments")}):null},h=window.ReactDOM,y=class{iframePostMessage=null;listeners={};constructor(){this.listeners={getIframePostMessageCallback:()=>{},getPostMessageTimeoutCallback:()=>{}},this.removeMessageListener=this.attachMessageListener(),this.injectWooPayConnectIframe()}attachMessageListener(){const t=t=>{const s=new URL(e("woopayHost")).origin;t.origin===s&&this.callbackFn(t.data)};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}detachMessageListener(){"function"==typeof this.removeMessageListener&&this.removeMessageListener()}injectWooPayConnectIframe(){const t=window?.WooPayConnect?.iframeInjectedState||0;if(2===t){const t=document.querySelector("#woopay-connect-iframe");return void(t&&(this.iframePostMessage=Promise.resolve(s=>{t.contentWindow.postMessage(s,e("woopayHost"))})))}if(1===t)return void(this.iframePostMessage=new Promise(e=>{this.listeners.getIframePostMessageCallback=e}));c(1);const s=document.createElement("div");s.style.visibility="hidden",s.style.position="fixed",s.style.height="0",s.style.width="0",s.style.bottom="0",s.style.right="0",s.id="woopay-connect-iframe-container",document.body.appendChild(s);const o=this;this.iframePostMessage=new Promise(e=>{o.listeners.getIframePostMessageCallback=e}),(0,h.createRoot)(s).render((0,d.jsx)(u,{}))}injectTemporaryWooPayConnectIframe(){let t;const s=new Promise(e=>{t=e}),o=document.createElement("iframe");return o.id="temp-woopay-connect-iframe",o.src=e("woopayHost")+"/connect/",o.height=0,o.width=0,o.border="none",o.margin=0,o.padding=0,o.overflow="hidden",o.display="block",o.visibility="hidden",o.position="fixed",o.pointerEvents="none",o.userSelect="none",o.addEventListener("load",()=>{t(t=>o.contentWindow.postMessage(t,e("woopayHost")))}),document.body.appendChild(o),{resolvePostMessagePromise:s,removeTemporaryIframe:()=>{document.body.removeChild(o)}}}async sendMessageAndListenWith(e,t){const s=new Promise((e,s)=>{let o=!1;const a=setTimeout(()=>{o=!0,s(new Error("WooPayConnectIframe did not respond within the allotted time."))},l());this.listeners[t]=t=>{o||(a&&clearTimeout(a),e(t))}});if("function"!=typeof this.iframePostMessage?.then)throw new Error("iframePostMessage is not set");return(await this.iframePostMessage)(e),await s}async getPostMessageTimeout(){try{return await this.sendMessageAndListenWith({action:"getPostMessageTimeout"},"getPostMessageTimeoutCallback")}catch(e){return null}}callbackFn(e){switch(e.action){case"get_iframe_post_message_success":this.listeners.getIframePostMessageCallback(e.value);break;case"get_post_message_timeout_success":this.listeners.getPostMessageTimeoutCallback(e.value)}}},p=class extends y{constructor(){super(),this.listeners={...this.listeners,getIsUserLoggedInCallback:()=>{},getEncryptedDataCallback:()=>{},getPreferredPaymentMethodCallback:()=>{}}}async isUserLoggedIn(){try{return await this.sendMessageAndListenWith({action:"getIsUserLoggedIn"},"getIsUserLoggedInCallback")}catch(e){return!1}}async getEncryptedData(){try{return await this.sendMessageAndListenWith({action:"getEncryptedData"},"getEncryptedDataCallback")}catch(e){return null}}async getPreferredPaymentMethod(){try{return await this.sendMessageAndListenWith({action:"getPreferredPaymentMethod"},"getPreferredPaymentMethodCallback")}catch(e){return null}}callbackFn(e){switch(super.callbackFn(e),e.action){case"get_is_user_logged_in_success":this.listeners.getIsUserLoggedInCallback(e.value);break;case"get_encrypted_data_success":this.listeners.getEncryptedDataCallback(e.value);break;case"get_preferred_payment_method_success":this.listeners.getPreferredPaymentMethodCallback(e.value)}}},m=class extends y{constructor(){super(),this.listeners={...this.listeners,setRedirectSessionDataCallback:()=>{},setTempThirdPartyCookieCallback:()=>{},getIsWooPayReachableCallback:()=>{},getIsThirdPartyCookiesEnabledCallback:()=>{},setPreemptiveSessionDataCallback:()=>{}}}async isWooPayThirdPartyCookiesEnabled(){const{resolvePostMessagePromise:e,removeTemporaryIframe:t}=this.injectTemporaryWooPayConnectIframe(),s=new Promise((e,t)=>
542{let s=!1;const o=setTimeout(()=>{s=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},l());this.listeners.setTempThirdPartyCookieCallback=t=>{s||(o&&clearTimeout(o),e(t))}});if("function"!=typeof e?.then)return!1;const o=await e;o({action:"setTempThirdPartyCookie"});try{if(!await s)return t(),!1}catch(e){return t(),!1}const a=new Promise((e,t)=>{let s=!1;const o=setTimeout(()=>{s=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},l());this.listeners.getIsThirdPartyCookiesEnabledCallback=t=>{s||(o&&clearTimeout(o),e(t))}});o({action:"getIsThirdPartyCookiesEnabled"});try{return await a}catch(e){return!1}finally{t()}}async sendRedirectSessionDataToWooPay(e){try{return await super.sendMessageAndListenWith({action:"setRedirectSessionData",value:e},"setRedirectSessionDataCallback")}catch(e){return null}}async setPreemptiveSessionData(e){try{return await super.sendMessageAndListenWith({action:"setPreemptiveSessionData",value:e},"setPreemptiveSessionDataCallback")}catch(e){return null}}async isWooPayReachable(){try{return await this.sendMessageAndListenWith({action:"isWooPayReachable"},"getIsWooPayReachableCallback")}catch(e){return!1}}callbackFn(e){switch(super.callbackFn(e),e.action){case"set_redirect_session_data_success":this.listeners.setRedirectSessionDataCallback(e.value);break;case"set_redirect_session_data_error":this.listeners.setRedirectSessionDataCallback({is_error:!0});break;case"set_temp_third_party_cookie_success":this.listeners.setTempThirdPartyCookieCallback(e.value);break;case"get_is_third_party_cookies_enabled_success":this.listeners.getIsThirdPartyCookiesEnabledCallback(e.value);break;case"get_is_woopay_reachable_success":this.listeners.getIsWooPayReachableCallback(e.value);break;case"set_preemptive_session_data_success":this.listeners.setPreemptiveSessionDataCallback(e.value);break;case"set_preemptive_session_data_error":this.listeners.setPreemptiveSessionDataCallback({is_error:!0})}}},w=class{static userConnect;static sessionConnect;static encryptedSessionDataPromise;static redirectElements={CLASSIC_CART_PROCEED_BUTTON:".wc-proceed-to-checkout .checkout-button",BLOCKS_CART_PROCEED_BUTTON:".wp-block-woocommerce-proceed-to-checkout-block",BLOCKS_MINI_CART_PROCEED_BUTTON:"a.wp-block-woocommerce-mini-cart-checkout-button-block",BLOCKS_FOOTER_MINI_CART_PROCEED_BUTTON:"a.wc-block-mini-cart__footer-checkout",CLASSIC_MINI_CART_PROCEED_BUTTON:".widget_shopping_cart a.button.checkout"};static init(){this.getSessionConnect()}static getUserConnect(){return this.userConnect||(this.userConnect=new p),this.userConnect}static getSessionConnect(){return this.sessionConnect||(this.sessionConnect=new m),this.sessionConnect}static teardown(){this.sessionConnect?.detachMessageListener(),this.userConnect?.detachMessageListener(),this.sessionConnect=null,this.userConnect=null}static isWooPayDirectCheckoutEnabled(){return e("isWooPayDirectCheckoutEnabled")}static async isWooPayReachable(){return this.getSessionConnect().isWooPayReachable()}static async isUserLoggedIn(){return this.getUserConnect().isUserLoggedIn()}static async getEncryptedData(){return this.getUserConnect().getEncryptedData()}static async isWooPayThirdPartyCookiesEnabled(){return this.getSessionConnect().isWooPayThirdPartyCookiesEnabled()}
542static async initPostMessageTimeout(){const e=await this.getSessionConnect().getPostMessageTimeout();var t;e&&(t=e,window.WooPayConnect||(window.WooPayConnect={}),window.WooPayConnect.postMessageTimeout=t)}static async getWooPayCheckoutUrl(){try{let e;if(e=this.isEncryptedSessionDataPrefetched()?await this.encryptedSessionDataPromise:await this.getEncryptedSessionData(),!this.isValidEncryptedSessionData(e))throw new Error("Could not retrieve encrypted session data from store.");const t=await this.getSessionConnect().sendRedirectSessionDataToWooPay(e);if(!t?.redirect_url)throw new Error("Could not retrieve WooPay checkout URL.");const{redirect_url:s}=t;if(!this.validateRedirectUrl(s,"platform_checkout_key"))throw new Error("Invalid WooPay session URL: "+s);return t.redirect_url}catch(e){throw new Error(e.message)}}static isValidEncryptedSessionData(e){return e&&e?.blog_id&&e?.data?.session&&e?.data?.iv&&e?.data?.hash}static async getWooPayMinimumSessionUrl(){const t=await this.getWooPayMinimumSesssionDataFromMerchant();if(!1===t?.success)throw new Error("Could not retrieve redirect data from merchant.");if(!this.isValidEncryptedSessionData(t))throw new Error("Invalid encrypted session data.");const{blog_id:s,data:{session:o,iv:a,hash:n}}=t,i=new URLSearchParams({checkout_redirect:1,blog_id:s,session:o,iv:a,hash:n});return e("woopayHost")+"/woopay/?"+i.toString()}static getCheckoutButtonElements(){const e=[],t=t=>{const s=document.querySelector(t);s&&e.push(s)};return t(this.redirectElements.CLASSIC_CART_PROCEED_BUTTON),t(this.redirectElements.BLOCKS_CART_PROCEED_BUTTON),t(this.redirectElements.CLASSIC_MINI_CART_PROCEED_BUTTON),e}static getClassicProceedToCheckoutButton(){return document.querySelector(this.redirectElements.CLASSIC_CART_PROCEED_BUTTON)}static getMiniCartProceedToCheckoutButton(){return document.querySelector(this.redirectElements.BLOCKS_MINI_CART_PROCEED_BUTTON)}static getFooterMiniCartProceedToCheckoutButton(){return document.querySelector(this.redirectElements.BLOCKS_FOOTER_MINI_CART_PROCEED_BUTTON)}static addRedirectToWooPayEventListener(e,t=!1){e.forEach(e=>{const s={is_loading:!1};e.addEventListener("click",async o=>{if(s.is_loading)return void o.preventDefault();let a;if(s.is_loading=!0,(e=>{if(e.classList.contains("wp-block-woocommerce-mini-cart-checkout-button-block")||e.classList.contains("wc-block-mini-cart__footer-checkout"))return!0;const t=e.classList.contains("checkout-button"),s=e.parentElement?.classList?.contains("wc-proceed-to-checkout");return t&&s})(e)&&(e=>{const t=window.getComputedStyle(e,null).getPropertyValue("color"),s=document.createElement("span");s.classList.add("wc-block-components-spinner"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.color=t,s.style.fontSize="unset",s.style.display="inline",s.style.lineHeight="0",s.style.margin="0",s.style.border="0",s.style.padding="0",e.style.color="rgba( 0, 0, 0, 0 )",e.style.position="relative",e.appendChild(s)})(e),a="a"===e.tagName.toLowerCase()?e.href:e.querySelector("a")?.href,a){o.preventDefault();try{let e="";if(t)e=await this.getWooPayCheckoutUrl();else{if(!await this.isWooPayReachable())throw new Error("WooPay is currently not available.");e=await this.getWooPayMinimumSessionUrl()}this.teardown(),window.location.href=e}catch(e){console.warn(e),this.teardown(),window.location.href=a}}else this.teardown()})})}static async getEncryptedSessionData(){const t=await this.getEncryptedData();return n(o(e("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:e("woopaySessionNonce"),...t&&{encrypted_data:t}})}static async getWooPayMinimumSesssionDataFromMerchant(){return e("woopayMinimumSessionData")?e("woopayMinimumSessionData"):n(o(e("wcAjaxUrl"),"get_woopay_minimum_session_data"),{_ajax_nonce:e("woopaySessionNonce")})}static validateRedirectUrl(t,s){try{const o=new URL(t);return!(o.origin!==e("woopayHost")||!o.searchParams.has(s))}catch(e){return!1}}static maybePrefetchEncryptedSessionData(){const e=window?.wcpayWooPayDirectCheckout?.params?.is_product_page;void 0===e||e||(this.encryptedSessionDataPromise=new Promise(e=>{e(this.getEncryptedSessionData())}))}static setEncryptedSessionDataAsNotPrefetched(){this.encryptedSessionDataPromise=null}static isEncryptedSessionDataPrefetched(){return"function"==typeof this.encryptedSessionDataPromise?.then}},g=()=>{const e=document.cookie.split(";").find(e=>e.includes("skip_woopay"));if(!e)return!1;const t=e?.split("=");return"skip_woopay"===t[0].trim()&&"1"===t[1].trim()},_=()=>{((t,o={})=>
542{if(!1===(e("isShopperTrackingEnabled")??s("is_shopper_tracking_enabled")))return;const a=e("platformTrackerNonce")??s("nonce")?.platform_tracker,n=e("ajaxUrl")??s("ajax_url"),i=new FormData;i.append("tracksNonce",a),i.append("action","platform_tracks"),i.append("tracksEventName",t),i.append("tracksEventProp",JSON.stringify(o)),fetch(n,{method:"post",body:i}).then(e=>e.json())})("wcpay_proceed_to_checkout_button_click",{woopay_direct_checkout:Boolean(e("isWooPayDirectCheckoutEnabled"))&&!g()})};window.addEventListener("load",()=>{Object.values(w.redirectElements).forEach(e=>{const t=document.querySelector(e);t&&t.addEventListener("click",_)}),(()=>{const e=document.querySelector(".cart-collaterals");e&&new MutationObserver(()=>{const e=document.querySelector(w.redirectElements.CLASSIC_CART_PROCEED_BUTTON);e&&e.addEventListener("click",_)}).observe(e,{childList:!0,subtree:!0})})()})})()})();;
543var mailchimp,mailchimp_cart,mailchimp_billing_email,mailchimp_username_email,mailchimp_registration_email,mailchimp_submitted_email=false,mailchimpReady=function(a){/in/.test(document.readyState)?setTimeout(()=>{mailchimpReady(a)},9):a()};function mailchimpHandleBillingEmail(selector){try{if(!mailchimp_public_data.allowed_to_set_cookies)return;if(mailchimp_public_data.disable_carts)return;var subscribed=document.querySelector("#mailchimp_woocommerce_newsletter");if(!subscribed)subscribed=document.querySelector("#subscribe-to-newsletter");if(!selector)selector="#billing_email";var a=document.querySelector(selector);var b=void 0!==a?a.value:"";if(!mailchimp_cart.valueEmail(b)||mailchimp_submitted_email===b){return false}mailchimp_cart.setEmail(b);var c=mailchimp_public_data.ajax_url+"?action=mailchimp_set_user_by_email";var d=new XMLHttpRequest;d.open("POST",c,!0);d.onload=function(){var successful=d.status>=200&&d.status<400;var msg=successful?"mailchimp.handle_billing_email.request.success":"mailchimp.handle_billing_email.request.error";if(successful){mailchimp_submitted_email=b}console.log(msg,d.responseText)};d.onerror=function(){console.log("mailchimp.handle_billing_email.request.error",d.responseText)};d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.setRequestHeader("Accept","application/json");d.send("email="+b+"&mc_language="+mailchimp_public_data.language+"&subscribed="+(subscribed&&subscribed.checked?"1":"0"));return true}catch(a){console.log("mailchimp.handle_billing_email.error",a);mailchimp_submitted_email=!1}}!function(){"use strict";function mailchimpCart(){this.email_types="input[type=email]";this.regex_email=/^([A-Za-z0-9_+\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;this.current_email=null;this.previous_email=null;this.expireUser=function(){this.current_email=null;if(!mailchimp_public_data.allowed_to_set_cookies)return;mailchimp.storage.expire("mailchimp.cart.current_email")};this.expireSaved=function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;mailchimp.storage.expire("mailchimp.cart.items")};this.setEmail=function(a){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(!this.valueEmail(a))return false;this.setPreviousEmail(this.getEmail());mailchimp.storage.set("mailchimp.cart.current_email",this.current_email=a)};this.getEmail=function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(this.current_email)return this.current_email;var a=mailchimp.storage.get("mailchimp.cart.current_email",!1);if(!a||!this.valueEmail(a))return false;return this.current_email=a};this.setPreviousEmail=function(a){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(!this.valueEmail(a))return false;mailchimp.storage.set("mailchimp.cart.previous_email",this.previous_email=a)};this.valueEmail=function(a){return this.regex_email.test(a)};return this}var g={extend:function(a,b){for(var c in b||{})b.hasOwnProperty(c)&&(a[c]=b[c]);return a},getQueryStringVars:function(){var a=window.location.search||"",b=[],c={};if(a=a.substr(1),a.length){b=a.split("&");for(var d in b){var e=b[d];if("string"==typeof e){var f=e.split("="),g=f[0],h=f[1];g.length&&("undefined"==typeof c[g]&&(c[g]=[]),c[g].push(h))}}}return c},unEscape:function(a){return decodeURIComponent(a)},escape:function(a){return encodeURIComponent(a)},createDate:function(a,b){a||(a=0);var c=new Date,d=b?c.getDate()-a:c.getDate()+a;return c.setDate(d),c},arrayUnique:function(a){for(var b=a.concat(),c=0;c<b.length;++c)for(var d=c+1;d<b.length;++d)b[c]===b[d]&&b.splice(d,1);return b},objectCombineUnique:function(a){for(var b=a[0],c=1;c<a.length;c++){var d=a[c];for(var e in d)b[e]=d[e]}return b}},h=function(a,b){var c=function(a,b,d){return 1===arguments.length?c.get(a):c.set(a,b,d)};return c.get=function(b,d){return a.cookie!==c._cacheString&&c._populateCache(),void 0==c._cache[b]?d:c._cache[b]},c.defaults={path:"/",secure:true,samesite:"strict"}
543,c.set=function(d,e,f){switch(f={path:f&&f.path||c.defaults.path,domain:f&&f.domain||c.defaults.domain,expires:f&&f.expires||c.defaults.expires,secure:f&&f.secure!==b?f.secure:c.defaults.secure,samesite:f&&f.samesite||c.defaults.samesite},e===b&&(f.expires=-1),typeof f.expires){case"number":f.expires=new Date((new Date).getTime()+1e3*f.expires);break;case"string":f.expires=new Date(f.expires)}return d=encodeURIComponent(d)+"="+(e+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent),d+=f.path?";path="+f.path:"",d+=f.domain?";domain="+f.domain:"",d+=f.expires?";expires="+f.expires.toGMTString():"",d+=f.secure?";secure":"",d+=f.samesite?";samesite="+f.samesite:"",a.cookie=d,c},c.expire=function(a,d){return c.set(a,b,d)},c._populateCache=function(){c._cache={};try{c._cacheString=a.cookie;for(var d=c._cacheString.split("; "),e=0;e<d.length;e++){var f=d[e].indexOf("="),g=decodeURIComponent(d[e].substr(0,f)),f=decodeURIComponent(d[e].substr(f+1));c._cache[g]===b&&(c._cache[g]=f)}}catch(a){console.log(a)}},c.enabled=function(){var a="1"===c.set("cookies.js","1").get("cookies.js");return c.expire("cookies.js"),a}(),c}(document);mailchimp={storage:h,utils:g};mailchimp_cart=new mailchimpCart}();mailchimpReady(function(){if(!mailchimp_public_data.allowed_to_set_cookies)return;if(mailchimp_public_data.disable_carts)return;if(void 0===a){var a={site_url:document.location.origin,defaulted:!0,ajax_url:document.location.origin+"/wp-admin?admin-ajax.php"}}try{var b=mailchimp.utils.getQueryStringVars();var subscribed=document.querySelector("#mailchimp_woocommerce_newsletter");var blockSubscribed=document.querySelector("#subscribe-to-newsletter");if(subscribed){subscribed.onchange=function(){mailchimp_submitted_email=null;mailchimpHandleBillingEmail("#billing_email")}}else if(blockSubscribed){blockSubscribed.onchange=function(){mailchimp_submitted_email=null;mailchimpHandleBillingEmail('#contact-fields input[type="email"]')}}mailchimp_username_email=document.querySelector("#username");mailchimp_billing_email=document.querySelector("#billing_email");mailchimp_registration_email=document.querySelector("#reg_email");var mailchimp_username_email_block=document.querySelector('#contact-fields input[type="email"]');if(mailchimp_billing_email){mailchimp_billing_email.onblur=function(){mailchimpHandleBillingEmail("#billing_email")};mailchimp_billing_email.onfocus=function(){mailchimpHandleBillingEmail("#billing_email")}}if(mailchimp_username_email){mailchimp_username_email.onblur=function(){mailchimpHandleBillingEmail("#username")};mailchimp_username_email.onfocus=function(){mailchimpHandleBillingEmail("#username")}}if(mailchimp_registration_email){mailchimp_registration_email.onblur=function(){mailchimpHandleBillingEmail("#reg_email")};mailchimp_registration_email.onfocus=function(){mailchimpHandleBillingEmail("#reg_email")}}if(mailchimp_username_email_block){mailchimp_username_email_block.onblur=function(){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')};mailchimp_username_email_block.onfocus=function(){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')};var typingTimer;mailchimp_username_email_block.addEventListener("keyup",function(){typingTimer&&clearTimeout(typingTimer);typingTimer=setTimeout(function(){if(mailchimp_cart.valueEmail(mailchimp_username_email_block.value)){mailchimpHandleBillingEmail('#contact-fields input[type="email"]')}},2e3)});mailchimp_username_email_block.addEventListener("keydown",function(){typingTimer&&clearTimeout(typingTimer)})}}catch(e){console.log("mailchimp ready error",e)}});;
544/**
545 * Mailchimp Pixel Tracking for WooCommerce
546 *
547 * Listens for WooCommerce events and sends them to the Mailchimp Pixel SDK.
548 * Only tracks if window.$mcSite.pixel.api is available (MC.js loaded).
549 *
550 * @package MailChimp_WooCommerce
551 * @since 1.0.0
552 */
553
554(function ($) {
555	'use strict';
556
557	/**
558	 * Default config for waitForPixelSDK exponential backoff
559	 */
560	const PIXEL_SDK_WAIT_CONFIG = {
561		initialDelayMs: 100,
562		maxDelayMs: 5000,
563		maxAttempts: 20
564	};
565
566	/**
567	 * How long PRODUCT_VIEWED waits on a variable product for WooCommerce to resolve a
568	 * default or deep-linked variation before settling for the parent.
569	 */
570	const VARIATION_RESOLVE_WAIT_MS = 1200;
571
572	/**
573	 * Settle time after a form interaction before re-reading the variation id input.
574	 * The blocks form writes it through the Interactivity API on the next render.
575	 */
576	const VARIATION_INPUT_SETTLE_MS = 150;
577
578	/**
579	 * Mailchimp Pixel Tracking Handler
580	 */
581	const MailchimpPixelTracking = {
582		// Debounce timers for cart fetch calls
583		_atcTimer: null,
584		_rfcTimer: null,
585		_atcFetching: false,
586		_rfcFetching: false,
587		// PRODUCT_VIEWED state for a variable product being resolved to a variation
588		_viewTimer: null,
589		_viewedParent: null,
590		_viewedKeys: null,
591		_inputTimer: null,
592
593		/**
594		 * Initialize tracking.
595		 * Waits for Pixel SDK with exponential backoff, then sends page events and attaches handlers.
596		 */
597		init: function () {
598			const self = this;
599
600			// Registered before the SDK wait on purpose: that wait runs for seconds, and an
601			// integration that resolves its variation early must not race us.
602			window.mcPixel = window.mcPixel || {};
603			window.mcPixel.setVariation = function (variationId, product) {
604				self.setVariation(variationId, product);
605			};
606			document.addEventListener('mailchimp_woocommerce_set_variation', function (event) {
607				const detail = event.detail || {};
608				self.setVariation(detail.variationId, detail.product);
609			});
610
611			this.waitForPixelSDK(PIXEL_SDK_WAIT_CONFIG)
612				.then(function () {
613					self.sendPageEvents();
614					self.attachCartEventListeners();
615					self.interceptStoreApiRequests();
616					console.log('Mailchimp Pixel SDK loaded.');
617				})
618				.catch(function (e) {
619					console.log('Mailchimp Pixel SDK not loaded within timeout. Tracking disabled.', e);
620				});
621		},
622
623		/**
624		 * Wait for Pixel SDK to become available using exponential backoff.
625		 *
626		 * @param {Object} options Optional config
627		 * @param {number} options.initialDelayMs First delay in ms (default 100)
628		 * @param {number} options.maxDelayMs Cap on delay in ms (default 5000)
629		 * @param {number} options.maxAttempts Max number of attempts (default 20)
630		 * @return {Promise<void>}
630 Resolves when SDK is available, rejects after maxAttempts
631		 */
632		waitForPixelSDK: function (options) {
633			const config = options || {};
634			const initialDelayMs = config.initialDelayMs !== undefined ? config.initialDelayMs : PIXEL_SDK_WAIT_CONFIG.initialDelayMs;
635			const maxDelayMs = config.maxDelayMs !== undefined ? config.maxDelayMs : PIXEL_SDK_WAIT_CONFIG.maxDelayMs;
636			const maxAttempts = config.maxAttempts !== undefined ? config.maxAttempts : PIXEL_SDK_WAIT_CONFIG.maxAttempts;
637
638			function isSDKReady() {
639				return typeof window.$mcSite !== 'undefined' &&
640					window.$mcSite.pixel &&
641					typeof window.$mcSite.pixel.api !== 'undefined' &&
642					typeof window.$mcSite.pixel.api.track === 'function' &&
643					window.$mcSite.pixel.installed === true;
644			}
645
646			return new Promise(function (resolve, reject) {
647				let attempt = 0;
648
649				function scheduleCheck() {
650					if (isSDKReady()) {
651						// FIXME: temporary wait to accommodate for not being able to detect ready state
652						console.warn('Pixel SDK - remediation for pixel ready issue')
653						setTimeout(function () {
654							resolve();
655						}, 1000);
656						return;
657					}
658					if (attempt >= maxAttempts) {
659						reject(new Error('Pixel SDK not available'));
660						return;
661					}
662
663					const delay = Math.min(
664						initialDelayMs * Math.pow(2, attempt),
665						maxDelayMs
666					);
667					attempt += 1;
668
669					setTimeout(scheduleCheck, delay);
670				}
671
672				scheduleCheck();
673			});
674		},
675
676		/**
677		 * Synchronous check if Pixel SDK is available (e.g. before each track call).
678		 *
679		 * @return {boolean} True if SDK is available
680		 */
681		isPixelSDKReady: function () {
682			return typeof window.$mcSite !== 'undefined' &&
683				window.$mcSite.pixel &&
684				typeof window.$mcSite.pixel.api !== 'undefined' &&
685				typeof window.$mcSite.pixel.api.track === 'function';
686		},
687
688		/**
689		 * Get cart ID from window.mcPixel
690		 *
691		 * @return {string} Cart ID
692		 */
693		getCartId: function () {
694			return window.mcPixel && window.mcPixel.cartId ? window.mcPixel.cartId : '';
695		},
696
697		/**
698		 * Get the REST API base URL from the localized config.
699		 *
700		 * @return {string} REST base URL
701		 */
702		getRestBase: function () {
703			return (window.mcPixelConfig && window.mcPixelConfig.restBase) || '/wp-json/mailchimp-for-woocommerce/v1/';
704		},
705
706		/**
707		 * Send page-level events based on pre-populated data
708		 */
709		sendPageEvents: function () {
710			if (!window.mcPixel || !window.mcPixel.data) {
711				return;
712			}
713
714			const data = window.mcPixel.data;
715			const events = data.events || [];
716
717			// Send events based on what was set by PHP
718			events.forEach((eventType) => {
719				//console.log('Mailchimp Pixel: Sending event', eventType, data);
720				switch (eventType) {
721					case 'PRODUCT_ADDED_TO_CART':
722						if (data.added_to_cart) {
723							var atcItems = Array.isArray(data.added_to_cart) ? data.added_to_cart : [data.added_to_cart];
724							for (var ai = 0; ai < atcItems.length; ai++) {
725								this.sendProductAddedToCart(atcItems[ai]);
726							}
727						}
728						break;
729					case 'PRODUCT_REMOVED_FROM_CART':
730						if (data.removed_from_cart) {
731							var rfcItems = Array.isArray(data.removed_from_cart) ? data.removed_from_cart : [data.removed_from_cart];
732							for (var ri = 0; ri < rfcItems.length; ri++) {
733								this.sendProductRemovedFromCart(rfcItems[ri]);
734							}
735						}
736						break;
737					case 'IDENTITY':
738						if (data.identity && data.identity.email) {
739							this.sendIdentityEvent(data.identity.email);
740						}
741						break;
742					case 'PRODUCT_VIEWED':
743						// Skip if an add-to-cart or remove-from-cart already fired for the same product.
744						// The cart action implies the view, so firing both is redundant.
745						if (data.product) {
746							const viewedId = String(data.product.productId || data.product.id);
747							const atcArr = Array.isArray(data.added_to_cart) ? data.added_to_cart : (data.added_to_cart ? [data.added_to_cart] : []);
748							const rfcArr = Array.isArray(data.removed_from_cart) ? data.removed_from_cart : (data.removed_from_cart ? [data.removed_from_cart] : []);
749							const atcMatch = atcArr.some(function (p) { return String(p.productId || p.id
749) === viewedId; });
750							const rfcMatch = rfcArr.some(function (p) { return String(p.productId || p.id) === viewedId; });
751
752							if (
753								(events.includes('PRODUCT_ADDED_TO_CART') && atcMatch) ||
754								(events.includes('PRODUCT_REMOVED_FROM_CART') && rfcMatch)
755							) {
756								//console.log('Mailchimp Pixel: Skipping PRODUCT_VIEWED (superseded by cart event for same product)');
757								break;
758							}
759							this.trackProductViewed(data.product);
760						}
761						break;
762					case 'CART_VIEWED':
763						if (data.cart) {
764							this.sendCartViewed(data.cart);
765						}
766						break;
767					case 'CHECKOUT_STARTED':
768						if (data.checkout) {
769							this.sendCheckoutStarted(data.checkout);
770							window.mcPixel._handled.checkout = true;
771						}
772						break;
773					case 'PURCHASED':
774						if (data.order) {
775							this.sendPurchased(data.order);
776						}
777						break;
778					case 'PRODUCT_CATEGORY_VIEWED':
779						if (data.category) {
780							this.sendCategoryViewed(data.category);
781							window.mcPixel._handled.category = true;
782						}
783						break;
784					case 'SEARCH_SUBMITTED':
785						if (data.search) {
786							this.sendSearchSubmitted(data.search);
787							window.mcPixel._handled.search = true;
788						}
789						break;
790				}
791			});
792		},
793
794		/**
795		 * PRODUCT_VIEWED for the single product page.
796		 *
797		 * A variable product renders before the customer has picked anything, so the
798		 * server-side payload only knows the parent. WooCommerce announces the chosen
799		 * variation on the .variations_form with found_variation, so we hold the event
800		 * until that fires - or until it's clear nothing is going to resolve.
801		 *
802		 * @param {Object} product Parent product data from PHP
803		 */
804		trackProductViewed: function (product) {
805			const self = this;
806			this._viewedKeys = this._viewedKeys || {};
807
808			// not a variable product - the server already knew everything there is to know
809			if (!window.mcPixel.data.product_variations) {
810				this.sendProductViewedOnce(product, product.id);
811				return;
812			}
813
814			this._viewedParent = product;
815			this.attachVariationListeners();
816
817			const resolved = this.currentVariationId();
818			if (resolved) {
819				this.sendProductViewedOnce(this.resolveVariationPayload({ variation_id: resolved }), resolved);
820				return;
821			}
822
823			// nothing picked yet, but a default variation or ?attribute_* deep link still
824			// resolves a tick after the form initialises - give WooCommerce that tick
825			// before settling for the parent
826			this._viewTimer = setTimeout(function () {
827				self.sendProductViewedOnce(product, product.id);
828			}, VARIATION_RESOLVE_WAIT_MS);
829		},
830
831		/**
832		 * One PRODUCT_VIEWED per thing actually viewed: the parent, then each variation
833		 * the customer lands on. Switching back to an earlier pick sends nothing, so
834		 * clicking through a dropdown doesn't turn into a burst of events.
835		 *
836		 * @param {Object} product Product data to send
837		 * @param {string} key Dedup key - the variation id, or the parent id
838		 */
839		sendProductViewedOnce: function (product, key) {
840			clearTimeout(this._viewTimer);
841			if (this._viewedKeys[key]) {
842				return;
843			}
844			// only claim the key once it actually went out - an integration can call
845			// setVariation() before the SDK is up, and that must not count as sent
846			if (this.sendProductViewed(product)) {
847				this._viewedKeys[key] = true;
848			}
849		},
850
851		/**
852		 * Public API for themes, swatch plugins and custom templates.
853		 *
854		 * Detection covers what WooCommerce itself ships: the classic variations form,
855		 * and the hidden variation_id input the block form maintains. Anything else - a
856		 * custom swatch UI, a page builder widget, a headless front end - can announce
857		 * the selection itself, either directly:
858		 *
859		 *     window.mcPixel.setVariation( 123 );
860		 *
861		 * or, when it cannot reach our global, by dispatching an event:
862		 *
863		 *     document.dispatchEvent( new CustomEvent(
864		 *         'mailchimp_woocommerce_set_variation',
865		 *         { detail: { variationId: 123 } }
866		 *     ) );
867		 *
868		 * Pass a second argument to supply the whole product payload instead of letting
869		 * us resolve it. Sending the same variation twice is a no-op either way.
870		 *
871		 * @param {number|string} variationId Variation being viewed
872		 * @param {Object} [product] Optional product payload, sent as-is
873		 */
874		setVariation: function (variationId, product) {
875			const id = String(variationId || '');
876
877			if (!id || id === '0') {
878				return;
879			}
880			// an integration may beat PRODUCT_VIEWED to it - nothing to dedup against yet
881			this._viewedKeys = this._viewedKeys || {};
882			this.sendProductViewedOnce(
883				product || this.resolveVariationPayload({ variation_id: id }),
884				id
885			);
886		},
887
888		/**
889		 * found_variation is WooCommerce's own signal that every attribute is chosen and
890		 * a variation matched. Bound delegated off body so a form rendered late - blocks,
891		 * lazy themes, quick-view modals - is still covered.
892		 */
893		attachVariationListeners: function () {
894			const self = this;
895
896			$(document.body).on('found_variation', '.variations_form', function (event, variation) {
897				if (!variation || !variation.variation_id) {
898					return;
899				}
900				self.sendProductViewedOnce(
901					self.resolveVariationPayload(variation),
902					String(variation.variation_id)
903				);
904			});
905
906			// covers the block form, which fires no event at all
907			this.watchVariationInput();
908		},
909
910		/**
911		 * WooCommerce often resolves a variation before we boot - the SDK wait runs over a
912		 * second, and the form fires found_variation during its own init. The form parks
913		 * the answer in its variation_id input, so read that rather than assuming we were
914		 * listening at the right moment.
915		 *
916		 * @return {string} Resolved variation id, or '' when nothing is selected
917		 */
918		currentVariationId: function () {
919			// Classic puts this in .variations_form, blocks puts it in .single_variation_wrap
920			// inside its own form element - so key off the input, not either wrapper.
921			const inputs = document.querySelectorAll('form input[name="variation_id"], form input.variation_id');
922
923			for (let i = 0; i < inputs.length; i++) {
924				const id = parseInt(inputs[i].value, 10);
925				if (id > 0) {
926					return String(id);
927				}
928			}
929
930			return '';
931		},
932
933		/**
934		 * Catch variation changes on templates that announce nothing.
935		 *
936		 * The blocks "Add to Cart with Options" form runs on the Interactivity API and
937		 * fires no jQuery event and no CustomEvent, so found_variation never arrives.
938		 * What it does keep is the hidden variation_id input - WooCommerce renders it
939		 * specifically so "extensions or Express Payment methods" can read the form
940		 * state - so re-read that whenever the customer touches the form. Its value is
941		 * set as a property by the Interactivity API, which a MutationObserver would
942		 * never see, hence driving off the interaction instead.
943		 */
944		watchVariationInput: function () {
945			const self = this;
946
947			const recheck = function (event) {
948				// blocks renders its attribute options as buttons, so change alone misses them
949				if (!event.target || !event.target.closest || !event.target.closest('form')) {
950					return;
951				}
952				clearTimeout(self._inputTimer);
953				self._inputTimer = setTimeout(function () {
954					const id = self.currentVariationId();
955					if (id) {
956						self.sendProductViewedOnce(self.resolveVariationPayload({ variation_id: id }), id);
957					}
958				}, VARIATION_INPUT_SETTLE_MS);
959			};
960
961			document.addEventListener('change', recheck, true);
962			document.addEventListener('click', recheck, true);
963		},
964
965		/**
966		 * Turn a resolved variation into the product shape the pixel expects.
967		 *
968		 * Prefer the server-rendered variation: it carries the sku, categories and
969		 * parent-derived permalink that the event payload has no idea about, and it
970		 * matches what add-to-cart sends for the same variation. Past the pre-render cap
971		 * there is nothing to look up, so patch the parent with what the event does give
972		 * us - the id being right matters more than the rest.
973		 *
974		 * @param {Object} variation found_variation payload (or just {variation_id})
975		 * @return {Object} Product data for the pixel
976		 */
977		resolveVariationPayload: function (variation) {
978			const parent = this._viewedParent || {};
979			const id = String(variation.variation_id);
980			const rendered = window.mcPixel.data.product_variations[id];
981
982			if (rendered) {
983				return rendered;
984			}
985
986			const patched = $.extend({}, parent, {
987				id: id,
988				productId: parent.productId || parent.id || id
989			});
990			if (variation.sku) {
991				patched.sku = variation.sku;
992			}
993			if (variation.display_price !== undefined && variation.display_price !== null) {
994				patched.price = parseFloat(variation.display_price);
995			}
996			if (variation.image && variation.image.full_src) {
997				patched.imageUrl = variation.image.full_src;
998			}
999
1000			return patched;
1001		},
1002
1003		/**
1004		 * Send PRODUCT_VIEWED event
1005		 *
1006		 * @param {Object} product Product data
1007		 */
1008		sendProductViewed: function (product) {
1009			if (!this.isPixelSDKReady()) return false;
1010
1011			window.$mcSite.pixel.api.track('PRODUCT_VIEWED', {
1012				product: product
1013			}).catch((error) => {
1014				console.error('Mailchimp Pixel: Error tracking PRODUCT_VIEWED', error);
1015			});
1016
1017			return true;
1018		},
1019
1020		/**
1021		 * Send PRODUCT_ADDED_TO_CART event
1022		 *
1023		 * @param {Object} product Product data
1024		 */
1025		sendProductAddedToCart: function (product) {
1026			if (!this.isPixelSDKReady()) return;
1027
1028			const cartId = this.getCartId();
1029			const eventData = {
1030				cartId: cartId,
1031				product: {
1032					item: {
1033						id: product.id,
1034						productId: product.productId,
1035						title: product.title,
1036						price: product.price,
1037						currency: product.currency,
1038						sku: product.sku || ''
1039					},
1040					quantity: product.quantity || 1,
1041					price: product.price * (product.quantity || 1),
1042					currency: product.currency
1043				}
1044			};
1045
1046			window.$mcSite.pixel.api.track('PRODUCT_ADDED_TO_CART', eventData).catch((error) => {
1047				console.error('Mailchimp Pixel: Error tracking PRODUCT_ADDED_TO_CART', error);
1048			});
1049		},
1050
1051		/**
1052		 * Send PRODUCT_REMOVED_FROM_CART event
1053		 *
1054		 * @param {Object} product Product data
1055		 */
1056		sendProductRemovedFromCart: function (product) {
1057			if (!this.isPixelSDKReady()) return;
1058
1059			const cartId = this.getCartId();
1060			const eventData = {
1061				cartId: cartId,
1062				product: {
1063					item: {
1064						id: product.id,
1065						productId: product.productId,
1066						title: product.title,
1067						price: product.price,
1068						currency: product.currency,
1069						sku: product.sku || ''
1070					},
1071					quantity: product.quantity || 1,
1072					price: product.price * (product.quantity || 1),
1073					currency: product.currency
1074				}
1075			};
1076
1077			window.$mcSite.pixel.api.track('PRODUCT_REMOVED_FROM_CART', eventData).catch((error) => {
1078				console.error('Mailchimp Pixel: Error tracking PRODUCT_REMOVED_FROM_CART', error);
1079			});
1080		},
1081
1082		/**
1083		 * Send CART_VIEWED event
1084		 *
1085		 * @param {Object} cart Cart data
1086		 */
1087		sendCartViewed: function (cart) {
1088			if (!this.isPixelSDKReady()) return;
1089
1090			window.$mcSite.pixel.api.track('CART_VIEWED', {
1091				cart: cart
1092			}).catch((error) => {
1093				console.error('Mailchimp Pixel: Error tracking CART_VIEWED', error);
1094			});
1095		},
1096
1097		/**
1098		 * Send CHECKOUT_STARTED event
1099		 *
1100		 * @param {Object} checkout Checkout data
1101		 */
1102		sendCheckoutStarted: function (checkout) {
1103			if (!this.isPixelSDKReady()) return;
1104
1105			window.$mcSite.pixel.api.track('CHECKOUT_STARTED', {
1106				checkout: checkout
1107			}).catch((error) => {
1108				console.error('Mailchimp Pixel: Error tracking CHECKOUT_STARTED', error);
1109			});
1110		},
1111
1112		sendIdentityEvent: function(email) {
1113			if (!this.isPixelSDKReady()) return;
1114			window.$mcSite.pixel.api.identify({
1115				type: 'EMAIL',
1116				value: email
1117			});
1118		},
1119
1120		/**
1121		 * Send PURCHASED event
1122		 *
1123		 * @param {Object} order Order data
1124		 */
1125		sendPurchased: function (order) {
1126			if (!this.isPixelSDKReady()) return;
1127
1128			window.$mcSite.pixel.api.track('PURCHASED', {
1129				order: order
1130			}).catch((error) => {
1131				console.error('Mailchimp Pixel: Error tracking PURCHASED', error);
1132			});
1133		},
1134
1135		/**
1136		 * Send PRODUCT_CATEGORY_VIEWED event
1137		 *
1138		 * @param {Object} category Category data
1139		 */
1140		sendCategoryViewed: function (category) {
1141			if (!this.isPixelSDKReady()) return;
1142
1143			window.$mcSite.pixel.api.track('PRODUCT_CATEGORY_VIEWED', category).catch((error) => {
1144				console.error('Mailchimp Pixel: Error tracking PRODUCT_CATEGORY_VIEWED', error);
1145			});
1146		},
1147
1148		/**
1149		 * Send SEARCH_SUBMITTED event
1150		 *
1151		 * @param {Object} search Search data
1152		 */
1153		sendSearchSubmitted: function (search) {
1154			if (!this.isPixelSDKReady()) return;
1155
1156			window.$mcSite.pixel.api.track('SEARCH_SUBMITTED', search).catch((error) => {
1157				console.error('Mailchimp Pixel: Error tracking SEARCH_SUBMITTED', error);
1158			});
1159		},
1160
1161		/**
1162		 * Find product by ID from pre-loaded products
1163		 *
1164		 * @param {number|string} productId Product ID
1165		 * @return {Object|null} Product data or null
1166		 */
1167		findProductById: function (productId) {
1168			if (!window.mcPixel || !window.mcPixel.data || !window.mcPixel.data.products) {
1169				return null;
1170			}
1171
1172			const products = window.mcPixel.data.products;
1173			const id = String(productId);
1174
1175			for (let i = 0; i < products.length; i++) {
1176				if (String(products[i].id) === id) {
1177					return products[i];
1178				}
1179			}
1180
1181			return null;
1182		},
1183
1184		/**
1185		 * Debounced fetch for add-to-cart events.
1186		 * Each call resets the timer so rapid-fire triggers coalesce into one
1187		 * fetch that drains the entire PHP queue.
1188		 * If a fetch is already in flight, schedule another drain after it completes.
1189		 */
1190		fetchAndTrackAddToCart: function () {
1191			var self = this;
1192			if (!this.isPixelSDKReady()) return;
1193
1194			clearTimeout(this._atcTimer);
1195			this._atcTimer = setTimeout(function () {
1196				self._drainAddToCartQueue();
1197			}, 600);
1198		},
1199
1200		_drainAddToCartQueue: async function () {
1201			if (this._atcFetching) return;
1202			this._atcFetching = true;
1203
1204			try {
1205				var res = await fetch(this.getRestBase() + 'pixel/atc', {
1206					method: 'GET',
1207					credentials: 'same-origin',
1208					headers: { 'Accept': 'application/json' },
1209				});
1210
1211				if (!res.ok) return;
1212
1213				var data = await res.json();
1214				if (!data) return;
1215
1216				var items = Array.isArray(data) ? data : [data];
1217				for (var i = 0; i < items.length; i++) {
1218					this.sendProductAddedToCart(items[i]);
1219				}
1220			} catch (e) {
1221				// no-op
1222			} finally {
1223				this._atcFetching = false;
1224			}
1225		},
1226
1227		/**
1228		 * Debounced fetch for remove-from-cart events.
1229		 * Same debounce pattern as add-to-cart.
1230		 */
1231		fetchAndTrackRemoveFromCart: function () {
1232			var self = this;
1233			if (!this.isPixelSDKReady()) return;
1234
1235			clearTimeout(this._rfcTimer);
1236			this._rfcTimer = setTimeout(function () {
1237				self._drainRemoveFromCartQueue();
1238			}, 600);
1239		},
1240
1241		_drainRemoveFromCartQueue: async function () {
1242			if (this._rfcFetching) return;
1243			this._rfcFetching = true;
1244
1245			try {
1246				var res = await fetch(this.getRestBase() + 'pixel/rfc', {
1247					method: 'GET',
1248					credentials: 'same-origin',
1249					headers: { 'Accept': 'application/json' },
1250				});
1251
1252				if (!res.ok) return;
1253
1254				var data = await res.json();
1255				if (!data) return;
1256
1257				var items = Array.isArray(data) ? data : [data];
1258				for (var i = 0; i < items.length; i++) {
1259					this.sendProductRemovedFromCart(items[i]);
1260				}
1261			} catch (e) {
1262				// no-op
1263			} finally {
1264				this._rfcFetching = false;
1265			}
1266		},
1267
1268		/**
1269		 * Attach DOM and jQuery event listeners for cart add/remove.
1270		 * These serve as fallback triggers alongside the fetch interceptor.
1271		 */
1272		attachCartEventListeners: function () {
1273			const self = this;
1274
1275			// Classic themes (jQuery events fired by WooCommerce's add-to-cart.js)
1276			$(document.body).on('added_to_cart', function () {
1277				self.fetchAndTrackAddToCart();
1278			});
1279			$(document.body).on('removed_from_cart', function () {
1280				self.fetchAndTrackRemoveFromCart();
1281			});
1282
1283			// WC Blocks DOM CustomEvents
1284			document.body.addEventListener('wc-blocks_added_to_cart', function () {
1285				self.fetchAndTrackAddToCart();
1286			});
1287			document.body.addEventListener('wc-blocks_removed_from_cart', function () {
1288				self.fetchAndTrackRemoveFromCart();
1289			});
1290		},
1291
1292		/**
1293		 * Intercept window.fetch to detect WooCommerce Store API cart mutations.
1294		 *
1295		 * This is the most reliable method for catching add-to-cart and remove-from-cart
1296		 * in block-based WooCommerce setups, where DOM events may not fire consistently.
1297		 * Watches for successful POST requests to the Store API cart endpoints.
1298		 */
1299		interceptStoreApiRequests: function () {
1300			const self = this;
1301			const originalFetch = window.fetch;
1302
1303			window.fetch = function (input, init) {
1304				var promise = originalFetch.apply(this, arguments);
1305
1306				promise.then(function (response) {
1307					try {
1308						if (!response.ok) return;
1309
1310						var method = (init && init.method) ? init.method.toUpperCase() :
1311							(input instanceof Request ? input.method.toUpperCase() : 'GET');
1312						if (method !== 'POST') return;
1313
1314						var url = typeof input === 'string' ? input :
1315							(input instanceof Request ? input.url : String(input));
1316
1317						if (/wc\/store\/v1\/cart\/add-item/.test(url) || /wc\/store\/v1\/cart\/update-item/.test(url)) {
1318							self.fetchAndTrackAddToCart();
1319						} else if (/wc\/store\/v1\/cart\/remove-item/.test(url)) {
1320							self.fetchAndTrackRemoveFromCart();
1321						}
1322					} catch (e) {
1323						// Silently ignore interceptor errors
1324					}
1325				}).catch(function () {
1326					// Ignore - the original caller handles fetch errors
1327				});
1328
1329				return promise;
1330			};
1331		},
1332	};
1333
1334	// Initialize when DOM is ready
1335	$(document).ready(function () {
1336		MailchimpPixelTracking.init();
1337	});
1338
1339})(jQuery);
1340;
1341(()=>{"use strict";const e=window.wp.hooks,i="mailchimp-woocommerce";let t=!1;function c(){return void 0!==window.$mcSite&&window.$mcSite.pixel&&void 0!==window.$mcSite.pixel.api&&"function"==typeof window.$mcSite.pixel.api.track}function r(){return window.mcPixel&&window.mcPixel.cartId?window.mcPixel.cartId:""}function n(e,i){window.mcPixel&&i&&String(i)!==String(e)&&(window.mcPixel.parentMap||(window.mcPixel.parentMap={}),window.mcPixel.parentMap[String(e)]=String(i))}function o(e,i){t&&c()&&window.$mcSite.pixel.api.track(e,i).catch(function(i){console.error("Mailchimp Pixel Blocks: Error tracking "+e,i)})}function a(e){const i=e.prices||{},t=i.currency_minor_unit||2,c=Math.pow(10,t),r=i.price?parseInt(i.price,10)/c:0,o=String(e.id),a=(e.extensions||{})["mailchimp-pixel"]||{},d=a.product_id?String(a.product_id):function(e){return(window.mcPixel&&window.mcPixel.parentMap||{})[String(e)]||""}(o)||o;return n(o,d),{id:o,productId:d,title:e.name||"",price:r,currency:(i.currency_code||"").toUpperCase(),sku:e.sku||"",imageUrl:e.images&&e.images.length>0?e.images[0].src:"",productUrl:e.permalink||"",vendor:"",categories:[]}}function d(e){const i=e.prices||{},t=i.currency_minor_unit||2,c=Math.pow(10,t),r=i.line_total?parseInt(i.line_total,10)/c:0;return{item:a(e),quantity:e.quantity||1,price:r,currency:(i.currency_code||"").toUpperCase()}}(0,e.addAction)("experimental__woocommerce_blocks-cart-add-item",i,function(e){if(!t)return;if(window.mcPixel&&window.mcPixel._handled.addToCart)return;const i=e.product;if(!i)return;const c=function(e){const i=e.prices||{},t=i.currency_minor_unit||2,c=Math.pow(10,t),r=i.price?parseInt(i.price,10)/c:0,o=String(e.id),a=((e.extensions||{})["mailchimp-pixel"]||{}).product_id||e.parent,d=a?String(a):"";return n(o,d),{id:o,productId:d||o,title:e.name||"",price:r,currency:(i.currency_code||"").toUpperCase(),sku:e.sku||"",imageUrl:e.images&&e.images.length>0?e.images[0].src:"",productUrl:e.permalink||"",vendor:"",categories:(e.categories||[]).map(function(e){return e.name||""})}}(i),a=e.quantity||1;o("PRODUCT_ADDED_TO_CART",{cartId:r(),product:{item:{id:c.id,productId:c.productId,title:c.title,price:c.price,currency:c.currency,sku:c.sku},quantity:a,price:c.price*a,currency:c.currency}}),window.mcPixel&&(window.mcPixel._handled.addToCart=!0,setTimeout(function(){window.mcPixel._handled.addToCart=!1},1e3))}),(0,e.addAction)("experimental__woocommerce_blocks-cart-remove-item",i,function(e){if(!t)return;if(window.mcPixel&&window.mcPixel._handled.removeFromCart)return;const i=e.product;if(!i)return;const c=a(i),n=e.quantity||1;o("PRODUCT_REMOVED_FROM_CART",{cartId:r(),product:{item:{id:c.id,productId:c.productId,title:c.title,price:c.price,currency:c.currency,sku:c.sku},quantity:n,price:c.price*n,currency:c.currency}}),window.mcPixel&&(window.mcPixel._handled.removeFromCart=!0,setTimeout(function(){window.mcPixel._handled.removeFromCart=!1},1e3))}),(0,e.addAction)("experimental__woocommerce_blocks-checkout-render-checkout-form",i,function(e){if(!t)return;if(window.mcPixel&&window.mcPixel._handled.checkout)return;const i=e.storeCart;i&&i.cartItems&&0!==i.cartItems.length&&(o("CHECKOUT_STARTED",{checkout:function(e){const i=e.cartTotals||{},t=i.currency_minor_unit||2,c=Math.pow(10,t),n=(e.cartItems||[]).map(d),o=r();return{id:"checkout_"+o,cartId:o,lineItems:n,subtotalPrice:i.total_items?parseInt(i.total_items,10)/c:0,totalTax:i.total_tax?parseInt(i.total_tax,10)/c:0,totalShipping:i.total_shipping?parseInt(i.total_shipping,10)/c:0,totalPrice:i.total_price?parseInt(i.total_price,10)/c:0,currency:(i.currency_code||"").toUpperCase()}}(i)}),window.mcPixel&&(window.mcPixel._handled.checkout=!0))}),(0,e.addAction)("experimental__woocommerce_blocks-product-list-render",i,function(){t&&(window.mcPixel&&window.mcPixel._handled.category||window.mcPixel&&window.mcPixel.data&&window.mcPixel.data.category&&(o("PRODUCT_CATEGORY_VIEWED",window.mcPixel.data.category),window.mcPixel&&(window.mcPixel._handled.category=!0)))}),(0,e.addAction)("experimental__woocommerce_blocks-product-search",i,function(e){if(!t)return;if(window.mcPixel&&window.mcPixel._handled.search)return;const i=e.searchTerm||"";i&&(o("SEARCH_SUBMITTED",{query:i}),window.mcPixel&&(window.mcPixel._handled.search=!0))}),function(){let e=0;!function i(){if(c())return void setTimeout(function(){t=!0},1e3);if(e>=20)return;const r=Math.min(100*Math.pow(2,e),5e3);e+=1,setTimeout(i,r)}()}()})();;
1342/**
1343 * File primary-navigation.js.
1344 *
1345 * This files only gets added to themes that support the mobile nav on side
1346 */
1347( function() {
1348
1349	/**
1350	 * Menu Toggle Behaviors
1351	 *
1352	 * @param {Element} element
1353	 */
1354	var navMenu = function ( buttonId, inputId ) {
1355		var wrapper = document.body;
1356
1357		var toggleButton = document.getElementById( buttonId );
1358		var toggleInput  = document.getElementById( inputId );
1359
1360		if ( toggleButton ) {
1361			toggleButton.onclick = function() {
1362				if ( true == toggleInput.checked ) {
1363					wrapper.classList.remove( 'lock-scrolling' );
1364				} else {
1365					wrapper.classList.add( 'lock-scrolling' );
1366				}
1367
1368				toggleButton.focus();
1369			}
1370		}
1371
1372		document.addEventListener( 'click', function( event ) {
1373			// If target onclick is <a> with # within the href attribute
1374			if ( event.target.hash && event.target.hash.includes( '#' ) ) {
1375				wrapper.classList.remove( 'lock-scrolling' );
1376				if (toggleInput) {
1377					toggleInput.checked = false;
1378				}
1379				// Wait 550 and scroll to the anchor.
1380				setTimeout(function () {
1381					var anchor = document.getElementById(event.target.hash.slice(1));
1382					anchor.scrollIntoView();
1383				}, 550);
1384			}
1385		} );
1386	}
1387
1388	window.addEventListener( 'load', function() {
1389		navMenu(  'toggle-menu', 'toggle' );
1390		navMenu(  'toggle-cart', 'woocommerce-toggle' );
1391	} );
1392} )();;
1393!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);
1393else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=
1393a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}}
1393,{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});;
1394!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.