(()=>{var __webpack_exports__={};(function(){var Scroller,ajaxurl,stats,type,text,totop,loading_text,isIE=-1!=navigator.userAgent.search("MSIE");if(isIE){var IEVersion=navigator.userAgent.match(/MSIE\s?(\d+)\.?\d*;/);IEVersion=parseInt(IEVersion[1])}function fullscreenState(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?1:0}"https:"==document.location.protocol&&(infiniteScroll.settings.ajaxurl=infiniteScroll.settings.ajaxurl.replace("http://","https://")),Scroller=function(e){var t=this;this.id=e.id,this.body=document.body,this.window=window,this.element=document.getElementById(e.id),this.wrapperClass=e.wrapper_class,this.ready=!0,this.disabled=!1,this.page=1,this.offset=e.offset,this.currentday=e.currentday,this.order=e.order,this.throttle=!1,this.click_handle=e.click_handle,this.google_analytics=e.google_analytics,this.history=e.history,this.origURL=window.location.href,this.handle=document.createElement("div"),this.handle.setAttribute("id","infinite-handle"),this.handle.innerHTML="",this.footer={el:document.getElementById("infinite-footer"),wrap:e.footer},this.checkViewportOnLoadBound=t.checkViewportOnLoad.bind(this),this.wpMediaelement=null,"scroll"==type?(this.window.addEventListener("scroll",(function(){t.throttle=!0})),t.gotop(),setInterval((function(){t.throttle&&(t.throttle=!1,t.thefooter(),t.refresh(),t.determineURL())}),250),t.ensureFilledViewport(),this.body.addEventListener("is.post-load",t.checkViewportOnLoadBound)):"click"==type&&(this.click_handle&&this.element.appendChild(this.handle),this.handle.addEventListener("click",(function(){t.click_handle&&t.handle.parentNode.removeChild(t.handle),t.refresh()}))),this.body.addEventListener("is.post-load",t.initializeMejs)},Scroller.prototype.getScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Scroller.prototype.extend=function(e){e=e||{};for(var t=1;t0;){var n=t.shift();this.element.appendChild(n)}this.trigger(this.body,"is.post-load",{jqueryEventName:"post-load",data:e}),this.ready=!0},Scroller.prototype.query=function(){return{page:this.page+this.offset,currentday:this.currentday,order:this.order,scripts:window.infiniteScroll.settings.scripts,styles:window.infiniteScroll.settings.styles,query_args:window.infiniteScroll.settings.query_args,query_before:window.infiniteScroll.settings.query_before,last_post_date:window.infiniteScroll.settings.last_post_date}},Scroller.prototype.animate=function(e,t){var n=performance.now();requestAnimationFrame((function i(o){var r=Math.min(1,(o-n)/t);e(r),r<1&&requestAnimationFrame(i)}))},Scroller.prototype.gotop=function(){var e=document.getElementById("infinity-blog-title"),t=this;e&&(e.setAttribute("title",totop),e.addEventListener("click",(function(e){var n=t.window.pageYOffset;e.preventDefault(),t.animate((function(e){var t=n-n*e;document.documentElement.scrollTop=document.body.scrollTop=t}),200)})))},Scroller.prototype.thefooter=function(){var e,t,n,i,o=this;if(this.footer&&this.footer.el){if("string"==typeof this.footer.wrap){try{t=(t=document.getElementById(this.footer.wrap).getBoundingClientRect()).width}catch(e){t=0}t>479&&(e=this.footer.el.querySelector(".container"))&&(e.style.width=t+"px")}n=parseInt(o.footer.el.style.bottom||-50,10),i=this.window.pageYOffset>=350?0:-50,n!==i&&o.animate((function(e){var t=n+(i-n)*e;o.footer.el.style.bottom=t+"px",1===e&&(n=i)}),200)}},Scroller.prototype.urlEncodeJSON=function(e,t){var n,i,o=[];for(var r in e)n=encodeURIComponent(r),i=t?t+"["+n+"]":n,"object"==typeof e[r]?!Array.isArray(e[r])||e[r].length>0?o.push(this.urlEncodeJSON(e[r],i)):o.push(i+"[]="):o.push(i+"="+encodeURIComponent(e[r]));return o.join("&")},Scroller.prototype.refresh=function(){var self=this,query,xhr,loader,customized;if(!this.disabled&&this.ready&&this.check())return this.ready=!1,this.click_handle&&(loader||(document.getElementById("infinite-aria").textContent=loading_text,loader=document.createElement("div"),loader.classList.add("infinite-loader"),loader.setAttribute("role","progress"),loader.innerHTML=''),this.element.appendChild(loader)),query=self.extend({action:"infinite_scroll"},this.query()),"undefined"!=typeof wp&&wp.customize&&wp.customize.settings.theme&&(customized={},query.wp_customize="on",query.theme=wp.customize.settings.theme.stylesheet,wp.customize.each((function(e){e._dirty&&(customized[e.id]=e())})),query.customized=JSON.stringify(customized),query.nonce=wp.customize.settings.nonce.preview),xhr=new XMLHttpRequest,xhr.open("POST",infiniteScroll.settings.ajaxurl,!0),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),xhr.send(self.urlEncodeJSON(query)),xhr.onerror=function(){self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader),self.ready=!0},xhr.onload=function(){var response=JSON.parse(xhr.responseText),httpCheck=xhr.status>=200&&xhr.status<300,responseCheck=void 0!==response.html;if(response&&httpCheck&&responseCheck){if(self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader),response.scripts&&Array.isArray(response.scripts)&&response.scripts.forEach((function(e){var t=e.footer?"body":"head";window.infiniteScroll.settings.scripts.push(e.handle),e.extra_data&&self.appendInlineScript(e.extra_data,t),e.before_handle&&self.appendInlineScript(e.before_handle,t);var n=document.createElement("script");n.type="text/javascript",n.src=e.src,n.id=e.handle,n.async=!1,e.after_handle&&(n.onload=function(){self.appendInlineScript(e.after_handle,t)}),"wp-mediaelement"===e.handle&&self.body.removeEventListener("is.post-load",self.initializeMejs),"wp-mediaelement"===e.handle&&"undefined"==typeof mejs?(self.wpMediaelement={},self.wpMediaelement.tag=n,self.wpMediaelement.element=t,setTimeout(self.maybeLoadMejs.bind(self),250)):document.getElementsByTagName(t)[0].appendChild(n)})),response.styles&&Array.isArray(response.styles)&&response.styles.forEach((function(item){window.infiniteScroll.settings.styles.push(item.handle);var style=document.createElement("link");style.rel="stylesheet",style.href=item.src,style.id=item.handle+"-css",!item.conditional||isIE&&eval(item.conditional.replace(/%ver/g,IEVersion))||(style=!1),style&&document.getElementsByTagName("head")[0].appendChild(style)})),response.fragment=document.createElement("div"),response.fragment.innerHTML=response.html,self.page++,stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+stats+"&post=0&baba="+Math.random()),"object"==typeof response.postflair&&"object"==typeof WPCOM_sharing_counts&&(WPCOM_sharing_counts=self.extend(WPCOM_sharing_counts,response.postflair)),self.render.call(self,response),"click"==type?(infiniteScroll.settings.wrapper&&document.querySelector("#infinite-view-"+(self.page+self.offset-1)+" a:first-of-type").focus({preventScroll:!0}),response.lastbatch?self.click_handle?(self.body.classList.add("infinity-end"),self.body.classList.remove("infinity-success")):self.trigger(this.body,"infinite-scroll-posts-end"):self.click_handle?self.element.appendChild(self.handle):self.trigger(this.body,"infinite-scroll-posts-more")):response.lastbatch&&(self.disabled=!0,self.body.classList.add("infinity-end"),self.body.classList.remove("infinity-success")),response.currentday&&(self.currentday=response.currentday),self.google_analytics){var ga_url=self.history.path.replace(/%d/,self.page);"object"==typeof _gaq&&_gaq.push(["_trackPageview",ga_url]),"function"==typeof ga&&ga("send","pageview",ga_url)}}else self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader)},xhr},Scroller.prototype.appendInlineScript=function(e,t){var n=document.createElement("script"),i=document.createTextNode("//");n.type="text/javascript",n.appendChild(i),document.getElementsByTagName(t)[0].appendChild(n)},Scroller.prototype.maybeLoadMejs=function(){null!==this.wpMediaelement&&("undefined"==typeof mejs?setTimeout(this.maybeLoadMejs.bind(this),250):(document.getElementsByTagName(this.wpMediaelement.element)[0].appendChild(this.wpMediaelement.tag),this.wpMediaelement=null,this.body.addEventListener("is.post-load",this.initializeMejs)))},Scroller.prototype.initializeMejs=function(e){if(e.detail&&e.detail.html&&(-1!==e.detail.html.indexOf("wp-audio-shortcode")||-1!==e.detail.html.indexOf("wp-video-shortcode"))&&"undefined"!=typeof mejs){var t,n={};"undefined"!=typeof _wpmejsSettings&&(n.pluginPath=_wpmejsSettings.pluginPath),n.success=function(e){var t=e.attributes.autoplay&&"false"!==e.attributes.autoplay;"flash"===e.pluginType&&t&&e.addEventListener("canplay",(function(){e.play()}),!1)},t=document.querySelectorAll(".wp-audio-shortcode, .wp-video-shortcode"),t=(t=Array.prototype.slice.call(t)).filter((function(e){for(;e.parentNode;){if(e.classList.contains("mejs-container"))return!1;e=e.parentNode}return!0}));for(var i=0;i0;){for(n=r.shift(),o=0;o=a;return{top:s,bottom:l,height:l-s,factor:(Math.min(l,a)-Math.max(s,0))/a,isActive:d}},Scroller.prototype.ensureFilledViewport=function(){var e=this,t=e.window.innerHeight,n=e.measure(e.element,[e.wrapperClass]);e.body.removeEventListener("is.post-load",e.checkViewportOnLoadBound),0!==n.bottom&&n.bottomo&&(n=parseInt(e[r].dataset.pageNum,10),o=s.factor)}t.updateURL(n)}},Scroller.prototype.updateURL=function(e){if(window.history.pushState){var t=this,n=t.origURL;-1!==e&&(n=window.location.protocol+"//"+t.history.host+t.history.path.replace(/%d/,e)+t.history.parameters),window.location.href!=n&&history.pushState(null,null,n)}},Scroller.prototype.pause=function(){this.disabled=!0},Scroller.prototype.resume=function(){this.disabled=!1},Scroller.prototype.trigger=function(e,t,n){var i;(n=n||{}).jqueryEventName&&"undefined"!=typeof jQuery&&jQuery(e).trigger(n.jqueryEventName,n.data||null);try{i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n.data||null})}catch(e){(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n.data||null)}e.dispatchEvent(i)};var jetpackInfinityModule=function(){var e=infiniteScroll.settings.body_class.split(" ");if("object"==typeof infiniteScroll&&(e.forEach((function(e){e&&document.body.classList.add(e)})),ajaxurl=infiniteScroll.settings.ajaxurl,stats=infiniteScroll.settings.stats,type=infiniteScroll.settings.type,text=infiniteScroll.settings.text,totop=infiniteScroll.settings.totop,loading_text=infiniteScroll.settings.loading_text,infiniteScroll.scroller=new Scroller(infiniteScroll.settings),"click"==type)){var t=null;window.addEventListener("scroll",(function(){t||(t=setTimeout((function(){infiniteScroll.scroller.determineURL(),t=null}),250))}))}};"interactive"===document.readyState||"complete"===document.readyState?jetpackInfinityModule():document.addEventListener("DOMContentLoaded",jetpackInfinityModule)})()})();;
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{const t=jQuery;var o=e.n(t);const i={disable:function(){window.addEventListener&&window.addEventListener("wheel",i.preventDefaultValue,{passive:!1}),document.onkeydown=i.keyDown},enable:function(){window.removeEventListener&&window.removeEventListener("wheel",i.preventDefaultValue,{passive:!1}),window.onmousewheel=document.onmousewheel=document.onkeydown=null},preventDefaultValue:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1},keyDown:function(e){const t=[37,38,39,40];for(let o=t.length;o--;)if(e.keyCode===t[o])return void i.preventDefaultValue(e)}},n=i,s={check:function(e,t,i){if("object"!=typeof e||""===e||e.length||(e=o()(e)),e.length){const o=void 0!==e.data("viewport-offset")?e.data("viewport-offset"):.15,n=new IntersectionObserver((function(o){!0===o[0].isIntersecting&&(t.call(e),!1!==i&&n.disconnect())}),{threshold:[o]});n.observe(e[0])}}},r={check:function(e,t){if("object"!=typeof e||""===e||e.length||(e=o()(e)),e.length){"function"!=typeof e.find&&(e=o()(e));const i=e.find("img");if(i.length){let o=0;for(let n=0;n{l.initItem(e,t)}))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e,"> .qodef-block .qodef-block-swiper",!0)),e},initItem:function(e,t){if(e=l.getRealCurrentItem(e),t||(l.document=document),l.document?.body?.classList.contains("wp-admin")&&(l.isEditorMode=!0),!e)return;const o=!!l.isEditorMode&&qiBlocksEditor.qodefGetCurrentBlockElement.getIframe();let i=e;NodeList.prototype.isPrototypeOf(e)||o?i&&void 0===i.length&&(i=[e]):i=[e];const n="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;i.forEach((e=>{n.qodefWaitForImages.check(e,(function(){setTimeout((()=>{const o=l.getOptions(e),i=l.getEvents(e,o);void 0!==e&&"object"==typeof e.swiper&&t&&e.swiper.destroy(),new Swiper(e,Object.assign(o,i))}),o?800:200)}))}))},getOptions:function(e){let t=void 0!==e.getAttribute("data-options")?JSON.parse(e.getAttribute("data-options")):{},o=void 0!==t.direction&&""!==t.direction?t.direction:"horizontal",i=void 0!==t.partialValue&&""!==t.partialValue?parseFloat(t.partialValue):0,n=void 0!==t.disablePartialValue&&""!==t.disablePartialValue?parseInt(t.disablePartialValue):"never",s=void 0!==t.spaceBetween&&""!==t.spaceBetween?t.spaceBetween:0,r=void 0!==t.spaceBetweenTablet&&""!==t.spaceBetweenTablet?t.spaceBetweenTablet:s,a=void 0!==t.spaceBetweenMobile&&""!==t.spaceBetweenMobile?t.spaceBetweenMobile:s,d=void 0!==t.slidesPerView&&""!==t.slidesPerView?"auto"===t.slidesPerView?"auto":parseInt(t.slidesPerView)+i:1+i,c=void 0!==t.centeredSlides&&""!==t.centeredSlides&&t.centeredSlides,u=void 0!==t.sliderScroll&&""!==t.sliderScroll&&t.sliderScroll,f=void 0!==t.effect&&""!==t.effect?t.effect:"slide",p=void 0===t.loop||""===t.loop||t.loop,w=void 0===t.autoplay||""===t.autoplay||t.autoplay,g=void 0!==t.speed&&""!==t.speed?parseInt(t.speed,10):5e3,h=void 0!==t.speedAnimation&&""!==t.speedAnimation?parseInt(t.speedAnimation,10):800,m=void 0!==t.customStages&&""!==t.customStages&&t.customStages,q=void 0===t.dragging||""===t.dragging||t.dragging,y=void 0!==t.outsideNavigation&&"yes"===t.outsideNavigation,b=y?".swiper-button-next-"+t.unique:e.querySelector(".swiper-button-next"),v=y?".swiper-button-prev-"+t.unique:e.querySelector(".swiper-button-prev"),k=void 0!==t.outsidePagination&&"yes"===t.outsidePagination?".swiper-pagination-"+t.unique:e.querySelector(".swiper-pagination");!1!==w&&5e3!==g?w={delay:g,disableOnInteraction:!1}:!1!==w&&(w={disableOnInteraction:!1});let B=void 0!==t.slidesPerView1440&&""!==t.slidesPerView1440?parseInt(t.slidesPerView1440,10)+i:"auto"===t.slidesPerView?"auto":5+i,I=void 0!==t.slidesPerView1366&&""!==t.slidesPerView1366?parseInt(t.slidesPerView1366,10)+i:"auto"===t.slidesPerView?"auto":4+i,E=void 0!==t.slidesPerView1024&&""!==t.slidesPerView1024?parseInt(t.slidesPerView1024,10)+i:"auto"===t.slidesPerView?"auto":3+i,S=void 0!==t.slidesPerView768&&""!==t.slidesPerView768?parseInt(t.slidesPerView768,10)+i:"auto"===t.slidesPerView?"auto":2+i,L=void 0!==t.slidesPerView680&&""!==t.slidesPerView680?parseInt(t.slidesPerView680,10)+i:"auto"===t.slidesPerView?"auto":1+i,P=void 0!==t.slidesPerView480&&""!==t.slidesPerView480?parseInt(t.slidesPerView480,10)+i:"auto"===t.slidesPerView?"auto":1+i;if(l.isEditorMode&&(l.document?.body?.classList.contains("qi-preview-screen-tablet")&&(d=d<3?d:E,s=r),l.document?.body?.classList.contains("qi-preview-screen-mobile")&&(d=P,s=a)),m||(d<2?(B=d,I=d,E=d,S=d):d<3?(B=d,I=d,E=d):d<4?(B=d,I=d):d<5&&(B=d)),"never"!==n)switch(n){case 1024:E=Math.floor(E),l.isEditorMode&&l.document?.body.classList.contains("qi-preview-screen-tablet")&&(d=Math.floor(d<3?d:E));break;case 768:S=Math.floor(S);break;case 680:L=Math.floor(L);break;case 480:P=Math.floor(P),l.isEditorMode&&l.document?.body.classList.contains("qi-preview-screen-mobile")&&(d=Math.floor(P))}let V={direction:o,slidesPerView:d,centeredSlides:c,sliderScroll:u,loopedSlides:"12",spaceBetween:s,effect:f,autoplay:w,loop:p,speed:h,navigation:{nextEl:b,prevEl:v},pagination:{el:k,type:"bullets",clickable:!0},grabCursor:!0,simulateTouch:!l.isEditorMode&&q,breakpoints:{0:{slidesPerView:P,spaceBetween:a},481:{slidesPerView:L,spaceBetween:a},681:{slidesPerView:S,spaceBetween:r},769:{slidesPerView:E,spaceBetween:r},1025:{slidesPerView:I},1367:{slidesPerView:B},1441:{slidesPerView:d}}};return Object.assign(V,l.getSliderDatas(e))},getSliderDatas:function(e){let t=o()(e).data(),i={};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&"options"!==e&&void 0!==t[e]&&""!==t[e]&&(i[e]=t[e]);return i},getEvents:function(e,t){return{on:{beforeInit:function(){if("vertical"===t.direction){let o=0,i=0,n=e.querySelectorAll(".qodef-e");n.length&&n.forEach((e=>{i=e.offsetHeight,i>o&&(o=i)})),1===t.slidesPerView&&(e.style.height=o+"px",n.length&&n.forEach((e=>{e.style.height=o+"px"})))}},init:function(){if(e.classList.add("qodef--initialized"),l.isEditorMode?"object"==typeof qiBlocksEditor.qodefSetEditorLinkBehavior&&qiBlocksEditor.qodefSetEditorLinkBehavior.linkBehavior(e.querySelectorAll("a, button")):qiBlocks?.qodefLightboxPopup&&qiBlocks.qodefLightboxPopup.init(e.parentNode),"object"!=typeof qiBlocksEditor&&t.sliderScroll){let i=!1,n=o()(e),s=e.classList.contains("qodef-block")?n:n.parents(".qodef-block"),r=s.hasClass("qodef--focus-in-viewport"),l=s.offset().top,a=s.offset().top+s.outerHeight();r&&window.addEventListener("wheel",(function(e){let t=o()(window).scrollTop()+e.deltaY;(e.deltaY>0&&t0&&!e.swiper.isEnd)&&n.preventDefault(),r&&(n.originalEvent.deltaY<0&&e.swiper.isBeginning?(qiBlocks.qodefScroll.disable(),o()("html, body").stop().animate({scrollTop:Math.max(0,l-qiBlocks.windowHeight)},1200,(function(){qiBlocks.qodefScroll.enable()}))):n.originalEvent.deltaY>0&&e.swiper.isEnd&&(qiBlocks.qodefScroll.disable(),o()("html, body").stop().animate({scrollTop:a},1200,(function(){qiBlocks.qodefScroll.enable()}))))),i||(i=!0,n.originalEvent.deltaY>0?e.swiper.slideNext():e.swiper.slidePrev(),setTimeout((function(){i=!1}),1e3))}))}}}}}},a=l,d={masonry:[],isEditorMode:!1,init:function(){this.holder=document.querySelectorAll(".qodef-gutenberg-masonry-layout"),this.holder.length&&[...this.holder].map((e=>{d.createMasonry(e)}))},reLayout:function(){const e=d.masonry;"object"==typeof e&&Object.keys(e).length&&Object.values(e).map((e=>{setTimeout((()=>{const t=e.element.querySelectorAll(".qodef-gutenberg-column"),o=parseFloat(window.getComputedStyle(e.element.querySelector(".qodef-gutenberg-masonry-sizer")).getPropertyValue("width")),i=parseInt(window.getComputedStyle(e.element).getPropertyValue("column-gap"),10);o&&(t.forEach((e=>{e.style.width=o+"px"})),e.element.parentNode.classList.contains("qodef-items--fixed")&&d.setFixedImageSize(e.element,t[0],o,i)),setTimeout((()=>{e.layout()}),400)}),400)}))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e,"> .qodef-block .qodef-gutenberg-masonry-layout")),e},initItem:function(e,t){const o=t?e:"";(e=d.getRealCurrentItem(e))&&(document.body.classList.contains("wp-admin")&&(d.isEditorMode=!0),o&&d.masonry[o]&&e?d.reInit(e,o,t):d.createMasonry(e,o))},reInit:function(e,t,o){const i=(d.isEditorMode?qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument():document).querySelectorAll(".qodef-gutenberg-masonry-layout");"function"==typeof Isotope&&i.length&&("object"==typeof d.masonry[t]&&"reinit"===o?d.masonry[t].layout():document.body.classList.contains("wp-admin")||!0!==e?d.createMasonry(e,t):d.masonry[t].layout())},createMasonry:function(e,t){if(!e)return;const o=e.querySelector(".qodef-gutenberg-row");if(o){const i=o.querySelector(".qodef-gutenberg-column");("object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor).qodefWaitForImages.check(o,(function(){d.createMasonryLogic(e,o,i,t)}))}},createMasonryLogic:function(e,t,o,i){if("function"==typeof Isotope&&(d.isEditorMode||!t.classList.contains("qodef--masonry-init"))){const n=t.querySelectorAll(".qodef-gutenberg-column"),s=parseFloat(window.getComputedStyle(t.querySelector(".qodef-gutenberg-masonry-sizer")).getPropertyValue("width")),r=parseInt(window.getComputedStyle(t).getPropertyValue("column-gap"),10);n.forEach((e=>{e.style.width=s+"px"})),e.classList.contains("qodef-items--fixed")&&d.setFixedImageSize(t,o,s,r);const l=new Isotope(t,{layoutMode:"packery",itemSelector:".qodef-gutenberg-column",percentPosition:!0,packery:{columnWidth:".qodef-gutenberg-masonry-sizer",gutter:r}});d.masonry[i]=l,setTimeout((()=>{l.layout()}),d.isEditorMode?600:0),t.classList.contains("qodef--masonry-init")||t.classList.add("qodef--masonry-init")}},setFixedImageSize:function(e,t,o,i){const n=d.isEditorMode?document.body.classList.contains("qi-preview-screen-tablet")||document.body.classList.contains("qi-preview-screen-mobile"):qiBlocks.windowWidth<=680,s=e.parentElement.classList.contains("qodef-col-num--1"),r=e.querySelectorAll(".qodef-gutenberg-column");r&&r.forEach((e=>{let t=o,r=o;s?(e.classList.contains("qodef-item--landscape")&&(r=Math.round(o/2)),e.classList.contains("qodef-item--portrait")&&(r=Math.round(2*o))):(e.classList.contains("qodef-item--landscape")&&(t=Math.round(2*o+i),n&&(t=Math.round(o),r=Math.round(o/2))),e.classList.contains("qodef-item--portrait")&&(r=Math.round(2*o+i)),e.classList.contains("qodef-item--huge-square")&&(t=Math.round(2*o+i),r=Math.round(2*o+i),n&&(t=Math.round(o),r=Math.round(o)))),e.style.width=t+"px",e.style.height=r+"px"}))}},c=d;var u={init:function(e){e?setTimeout((()=>{u.initItem(e)}),2e3):(this.holder=document.querySelectorAll(".qi-block-fslightbox-popup"),this.holder.length&&[...this.holder].map((e=>{u.initItem(e)})))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e)),e},initItem:function(e,t){if(e=u.getRealCurrentItem(e)){refreshFsLightbox();for(const e in fsLightboxInstances){let t=fsLightboxInstances[e].props.sources,o=[],i=0;t.forEach((e=>{o.includes(e)||(o.push(e),i++)}));let n=i!==t.length?t.length-i:0;fsLightboxInstances[e].props.onOpen=function(){const t=fsLightboxInstances[e].elements.container.querySelectorAll(".fslightbox-slide-number-container");if(n>0&&t.length){const o=t[0].querySelector(".fslightbox-flex-centered > *:first-child"),s=t[0].querySelector(".fslightbox-flex-centered > *:last-child");new MutationObserver((()=>{let e=Number(o.innerText),t=e;e>i&&(t=n>i&&e>n?e-n:e-i),o.innerText=t,s.innerText=i})).observe(fsLightboxInstances[e].elements.container,{subtree:!0,attributes:!0,attributeFilter:["class"]})}},fsLightboxInstances[e].props.onInit=()=>{const t=fsLightboxInstances[e].elements.container,o=t.querySelectorAll(".fslightbox-slide-btn-container-previous > .fslightbox-slide-btn"),i=t.querySelectorAll(".fslightbox-slide-btn-container-next > .fslightbox-slide-btn"),n=t.querySelectorAll('[title="Close"]'),s="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;o.length&&(o[0].innerHTML=s.vars.arrowLeftIcon),i.length&&(i[0].innerHTML=s.vars.arrowRightIcon),n.length&&(n[0].innerHTML=s.vars.closeIcon)}}}}};const f=u,p={init:function(){this.holder=document.querySelectorAll(".qodef-image--hover-follow-info"),this.holder.length&&[...this.holder].map((e=>{p.initItem(e)}))},initItem:function(e){if(window.innerWidth>1024){const t=e.querySelectorAll(".qodef-image-wrapper");t.length&&[...t].map((e=>{p.initItemBehavior(e)}))}},initItemBehavior:function(e){if(e){const t=e.querySelector(".qodef-e-content");t&&e.addEventListener("mousemove",(e=>{e.clientX+t.offsetWidth+20>window.innerWidth?t.classList.add("qodef--right"):t.classList.remove("qodef--right"),t.style.top=e.clientY+20+"px",t.style.left=e.clientX+20+"px"}))}}},w=p;void 0===window.qiBlocks&&(window.qiBlocks={}),qiBlocks.body=o()("body"),qiBlocks.html=o()("html"),qiBlocks.windowWidth=o()(window).width(),qiBlocks.windowHeight=o()(window).height(),qiBlocks.scroll=0,qiBlocks.qodefScroll=n,qiBlocks.qodefIsInViewport=s,qiBlocks.qodefWaitForImages=r,qiBlocks.qodefSwiper=a,qiBlocks.qodefMasonryLayout=c,qiBlocks.qodefLightboxPopup=f,o()(document).ready((function(){qiBlocks.scroll=o()(window).scrollTop(),g.init(),a.init(),c.init(),f.init(),w.init()})),o()(window).resize((function(){qiBlocks.windowWidth=o()(window).width(),qiBlocks.windowHeight=o()(window).height(),c.reInit(!0),w.init()})),o()(window).scroll((function(){qiBlocks.scroll=o()(window).scrollTop()}));const g={init:function(){const e=document.querySelectorAll(".qodef-entrance-animation--on");e.length&&e.forEach((e=>{g.setClasses(e)}))},setClasses:function(e){e.classList.contains("qodef-animation--appeared")||qiBlocks.qodefIsInViewport.check(e,(function(){e.classList.add("qodef-animation--appeared"),e.getAttribute("data-animation")&&e.classList.add("animate__"+e.getAttribute("data-animation"))}))}};qiBlocks.qodefTriggerAnimation=g})()})();;
var thirstyFunctions;
jQuery( document ).ready( function($) {
thirstyFunctions = {
/**
* Function that holds all of the necessary events to trigger a record link stat.
*
* @since 3.2.0
*/
recordLinkStatEvents : function() {
// record link on normal click
if ( thirsty_global_vars.enable_record_stats == 'yes' )
$( 'body' ).on( 'click' , 'a' , thirstyFunctions.recordLinkStat );
},
/**
* Record link clicks AJAX event trigger.
*
* @since 3.0.0
* @since 3.2.0 Removed event trigger. Added keyword variable in the AJAX trigger.
* @since 3.3.0 Add javascript redirect feature.
* @since 3.3.1 Make sure the duplicate click prevention only works on affiliate links.
* @since 3.3.7 Add fail script for enhanced js redirect to still work on AJAX failure.
* @since 3.4.0 Make sure query strings are added back when enhanced js redirect is active.
*/
recordLinkStat : function( e ) {
var $link = $(this),
href = $link.attr( 'href' ),
linkID = $link.data( 'linkid' ),
keyword = $link[0].innerText,
qs = href ? href.split('?')[1] : '', // get the url query strings
imgsrc,
newWindow,
monsterInsightsOnBeforeUnload;
if ( ! keyword ) keyword = $link.text();
// if link clicked is not an affiliate link, then skip.
if ( ! thirstyFunctions.isThirstyLink( href ) && ! linkID ) return;
// prevent duplicate clicks.
if ( $link.data( "clicked" ) ) {
e.preventDefault();
return;
}
$link.data( "clicked" , true );
// get image filename and use it as keyword.
if ( ! keyword && $link.find( 'img' ).length ) {
imgsrc = $link.find( 'img' ).prop( 'src' ).split('/');
keyword = imgsrc[ imgsrc.length - 1 ];
}
if ( thirsty_global_vars.enable_js_redirect === 'yes' && $link.data( 'nojs' ) != true ) {
e.preventDefault();
if ( $link.prop( 'target' ) == '_blank' && ! thirstyFunctions.disableNewWindow() ) {
newWindow = window.open( '', '_blank' );
} else if ( window.MonsterInsightsObject ) {
setTimeout( function () {
if ( typeof window.onbeforeunload === 'function' ) {
monsterInsightsOnBeforeUnload = window.onbeforeunload;
}
}, 50 );
}
}
$.post( thirsty_global_vars.ajax_url , {
action : 'ta_click_data_redirect',
href : href,
page : window.location.href,
link_id : linkID,
keyword : keyword,
qs : qs
} , function( redirect_url ) {
$link.data( "clicked" , false );
if ( thirsty_global_vars.enable_js_redirect !== 'yes' || $link.data( 'nojs' ) == true )
return;
if ( newWindow ) {
newWindow.location.href = redirect_url ? redirect_url : href;
} else {
if ( typeof monsterInsightsOnBeforeUnload === 'function' && window.onbeforeunload === null ) {
window.onbeforeunload = monsterInsightsOnBeforeUnload;
}
window.location.href = redirect_url ? redirect_url : href;
}
} ).fail( function() {
$link.data( "clicked" , false );
if ( thirsty_global_vars.enable_js_redirect !== 'yes' || $link.data( 'nojs' ) == true )
return;
if ( newWindow ) {
newWindow.location.href = href;
} else {
if ( typeof monsterInsightsOnBeforeUnload === 'function' && window.onbeforeunload === null ) {
window.onbeforeunload = monsterInsightsOnBeforeUnload;
}
window.location.href = href;
}
} );
},
/**
* Check if we need to disable new window for enhanced javascript redirects.
* This is intended to fix issue on browsing sites with FB/Messenger webview browser on iPhones.
*
* @since 3.3.6
* @since 3.6 Add support for Instagram, Pinterest, Twitter, Electron and Steam.
*/
disableNewWindow : function() {
var strings = [ 'FBAN' , 'MessengerForiOS' , 'FBAV' , 'Instagram' , 'Pinterest' , 'Twitter' , 'Electron' , 'Steam' ];
for ( var x in strings ) {
if ( navigator.userAgent.indexOf( strings[x] ) >= 0 )
return true;
}
return false;
},
/**
* Function to check if the loaded link is a ThirstyAffiliates link or not.
*
* @since 3.0.0
* @since 3.1.2 Make function detect root relative URLs.
*/
isThirstyLink : function( href ) {
if ( ! href )
return;
href = href.replace( 'http:' , '{protocol}' ).replace( 'https:' , '{protocol}' );
var link_uri = href.replace( thirsty_global_vars.home_url , '' ).replace( '{protocol}' , '' ),
link_prefix, new_href;
link_uri = link_uri.indexOf( '/' ) == 0 ? link_uri.replace( '/' , '' ) : link_uri;
link_prefix = link_uri.substr( 0 , link_uri.indexOf( '/' ) ),
new_href = href.replace( '/' + link_prefix + '/' , '/' + thirsty_global_vars.link_prefix + '/' ).replace( '{protocol}' , window.location.protocol );
return ( link_prefix && $.inArray( link_prefix , link_prefixes ) > -1 ) ? new_href : false;
},
/**
* Function to check if the loaded link is a ThirstyAffiliates link or not.
*
* @since 3.0.0
* @since 3.3.0 Add data-nojs attribute support.
* @since 3.3.5 Make sure href property of links available before fetching the query strings.
*/
linkFixer : function() {
if ( thirsty_global_vars.link_fixer_enabled !== 'yes' )
return;
var $allLinks = $( 'body a' ),
hrefs = [],
href, linkClass, isShortcode, isImage , key;
// fetch all links that are thirstylinks
for ( key = 0; key < $allLinks.length; key++ ) {
href = $( $allLinks[ key ] ).attr( 'href' );
linkClass = $( $allLinks[ key ] ).attr( 'class' );
isShortcode = $( $allLinks[ key ] ).data( 'shortcode' );
isImage = $( $allLinks[ key ] ).has( 'img' ).length;
href = thirstyFunctions.isThirstyLink( href );
if ( href && ! isShortcode )
hrefs.push({ key : key , class : linkClass , href : href , is_image : isImage });
$( $allLinks[ key ] ).removeAttr( 'data-shortcode' );
}
// skip if there are no affiliate links
if ( hrefs.length < 1 )
return;
$.post( thirsty_global_vars.ajax_url , {
action : 'ta_link_fixer',
hrefs : hrefs,
post_id : thirsty_global_vars.post_id
}, function( response ) {
if ( response.status == 'success' ) {
for ( var x in response.data ) {
// make sure response data is valid before proceeding.
if ( typeof response.data[ x ] != 'object' ) continue;
var key = response.data[ x ][ 'key' ],
hrefProp = $( $allLinks[ key ] ).prop( 'href' ),
qs = hrefProp ? hrefProp.split('?')[1] : '', // get the url query strings
href = response.data[ x ][ 'href' ],
title = response.data[ x ][ 'title' ],
className = response.data[ x ][ 'class' ],
connector;
if ( qs && response.data[ x ][ 'pass_qs' ] ) {
connector = href.indexOf( '?' ) < 0 ? '?' : '&';
href = href + connector + qs;
}
// update protocol to replace it with the one used on the site.
href = href.replace( 'http:' , window.location.protocol ).replace( 'https:' , window.location.protocol );
// add the title if present, if not then remove the attribute entirely.
if ( title )
$( $allLinks[ key ] ).prop( 'title' , title );
else
$( $allLinks[ key ] ).removeAttr( 'title' );
// if disable_thirstylink_class is set to yes then remove the thirstylink and thirstylinkimg classes.
if ( thirsty_global_vars.disable_thirstylink_class == 'yes' )
className = className.replace( 'thirstylinkimg' , '' ).replace( 'thirstylink' , '' ).trim();
if ( className )
$( $allLinks[ key ] ).prop( 'class' , className );
else
$( $allLinks[ key ] ).removeAttr( 'class' );
// map the other attributes.
$( $allLinks[ key ] ).prop( 'href' , href )
.prop( 'rel' , response.data[ x ][ 'rel' ] )
.prop( 'target' , response.data[ x ][ 'target' ] )
.attr( 'data-linkid' , response.data[ x ][ 'link_id' ] );
// tag links as "nojs" to disable JS redirect for them.
if ( thirsty_global_vars.enable_js_redirect === 'yes' )
$( $allLinks[ key ] ).attr( 'data-nojs' , response.data[ x ][ 'nojs' ] );
}
}
}, 'json' );
}
}
var link_prefixes = $.map( thirsty_global_vars.link_prefixes , function(value , index) {
return [value];
});
// Initiate record link click stat function
thirstyFunctions.recordLinkStatEvents();
// Initialize uncloak links function
thirstyFunctions.linkFixer();
});
;
var thirstyGct;
jQuery( document ).ready( function ($) {
thirstyGct = {
trackClick: function () {
if ( ! window.thirstyFunctions) {
return;
}
if ( tap_gct_vars.ga_func_name === '_gaq.push' ) {
if ( typeof _gaq == 'undefined' || typeof _gaq.push != 'function' ) {
return;
}
} else if ( tap_gct_vars.ga_func_name === 'dataLayer.push' ) {
if ( typeof dataLayer == 'undefined' || typeof dataLayer.push != 'function' ) {
return;
}
} else if (typeof window[tap_gct_vars.ga_func_name] != 'function') {
return;
}
var $this = $( this ),
linkID = $this.data( 'linkid' ),
href = linkID ? $this.attr( 'href' ) : thirstyFunctions.isThirstyLink( $this.attr( 'href' ) );
if ( ! href ) {
return;
}
var is_uncloak = href.indexOf( tap_gct_vars.home_url + '/' + thirsty_global_vars.link_prefix ) < 0,
href_parts = href.split('/'),
href_last = href_parts[ href_parts.length - 1 ] ? href_parts[ href_parts.length - 1 ] : href_parts[ href_parts.length - 2 ],
link_text = $this.text(),
link_uri = linkID && is_uncloak ? href : href.replace( tap_gct_vars.home_url , '' ),
link_slug = linkID && is_uncloak ? href : href_last,
event_action;
if ( tap_gct_vars.event_action === 'href' ) {
event_action = href;
} else if ( tap_gct_vars.event_action === 'link_text' ) {
event_action = link_text;
} else if ( tap_gct_vars.event_action === 'link_slug' ) {
event_action = link_slug;
} else {
event_action = link_uri;
}
switch (tap_gct_vars.script_type) {
case 'gtm':
dataLayer.push({ event: tap_gct_vars.action_name, link_uri: event_action });
break;
case 'legacy_ga':
_gaq.push( [ '_trackEvent', tap_gct_vars.action_name, event_action, tap_gct_vars.page_slug, undefined, false ] );
break;
case 'universal_ga':
window[tap_gct_vars.ga_func_name]( 'send', 'event', {
eventCategory: tap_gct_vars.action_name,
eventAction: event_action,
eventLabel: tap_gct_vars.page_slug,
transport: 'beacon'
} );
break;
case 'gtag_ga':
default:
gtag( 'event', tap_gct_vars.action_name, {
event_category: tap_gct_vars.action_name,
event_action: event_action,
event_label: tap_gct_vars.page_slug
} );
}
}
};
$( 'body' ).on( 'click', 'a', thirstyGct.trackClick );
// Backwards compatibility
window.thirstyGoogleClickTrack = thirstyGct.trackClick;
});
;
const TKPiano = {
// Class selectors.
selectors: {
'loginLinks': 'login-link',
'mobileLogoutLinks': '.menu-top-bar-menu-container .logout-link',
'logoutLinksSelector': '.site-header .main-navigation .logout-link a',
'myAccountLinks': 'my-account-link',
'welcomeLink': 'welcome-link',
},
init() {
this.loginLinks = Array.from(document.getElementsByClassName(this.selectors.loginLinks));
this.myAccountLinks = Array.from(document.getElementsByClassName(this.selectors.myAccountLinks));
this.welcomeLink = Array.from(document.getElementsByClassName(this.selectors.welcomeLink));
this.showLoginModal = this.showLoginModal.bind(this);
this.handleLogout = this.handleLogout.bind(this);
this.pianoInit = this.pianoInit.bind(this);
document.addEventListener('DOMContentLoaded', function () {
this.loadPiano();
}.bind(this));
},
/**
* Trigger TinyPass init.
*/
loadPiano() {
tp = window.tp || [];
if ( tkPiano && 'sandbox' === tkPiano?.environment ) {
tp.push(["setSandbox", true]);
}
tp.push(
[
'init',
this.pianoInit
]
);
tp.push([
'addHandler',
'loginSuccess',
function (data) {
if (data.source == "PIANOID") {
location.reload(); // this reloads the page after direct login (NOT login inside checkout)
}
}
]);
if ('undefined' !== typeof tkPiano.pushArray && 'object' === typeof tkPiano.pushArray ) {
for (let key in tkPiano.pushArray) {
tp.push([key, tkPiano.pushArray[key]]);
}
}
},
/**
* Handle Piano initialization.
*/
pianoInit() {
//Check if the user is logged in. This is helpful for SSO accross multiple domains.
tp.pianoId.init({
loggedIn: function(data) {
console.log('user ', data.user, ' logged in with token', data.token);
console.log('data is ', data );
//location.reload();
},
loggedOut: function() {
console.log('user logged out');
}
});
//Reloads the page after and SSO login.
window.addEventListener('message', function (e) {
if(e.data == 'ssoReload') {
location.reload();
}
});
// Member Status Functions
if (tp.user.isUserValid()) {
const user = tp.user?.getProvider().getUser();
const username = ( user?.firstName ) ? user?.firstName : user?.email;
this.showPianoLogoutLink();
// Hide home newsletter section if user is logged in
document.querySelectorAll( '.newsletter-cta' ).forEach( el => el.remove() );
document.querySelectorAll( '.site-header .main-navigation .extras__newsletter' ).forEach( el => el.remove() );
document.querySelectorAll( '.site-header .main-navigation .overlay__newsletter' ).forEach( el => el.remove() );
document.querySelectorAll( this.selectors.mobileLogoutLinks ).forEach( el => el.addEventListener('click', this.handleLogout) );
document.querySelector( '.menu-top-bar-menu-container' ).classList.add( 'piano-user-in' );
if( document.getElementById( 'welcome-username' ) ) {
document.getElementById( 'welcome-username' ).insertAdjacentHTML( 'beforeend', 'Welcome, ' + username );
}
}
// Show the My Account module
if (this.is_page('my-account')) {
tp.myaccount.show({
displayMode: "inline",
containerSelector: "#piano-my-account"
});
}
// Show the Password Reset module
if (this.is_page('reset-password')) {
tp.push(['init', function() {
// Password can be reset only if user is anonymous
if (!tp.user.isUserValid()) {
// If URL has reset_token parameter
var tokenMatch = location.search.match(/reset_token=([A-Za-z0-9]+)/);
if (tokenMatch) {
// Get value of the token
var token = tokenMatch[1];
// Present password reset form with the found token
tp.pianoId.show({
displayMode: 'modal',
confirmation: 'after',
'resetPasswordToken': token, loggedIn: function () {
// Once user logs in - refresh the page
location.reload();
}
});
}
}
}]);
}
// Add event listener to login links.
this.loginLinks.forEach(function (loginLink) {
loginLink.addEventListener('click', this.showLoginModal, false);
}.bind(this));
// Do the things according to user subscription status
tp.push( [ 'init', function() {
tp.api.callApi( '/access/list', { 'cross_app': true }, function( response ) {
if ( response.data[0] ) {
if ( response.data[0].access_id && response.data[0].granted ) {
if ( response.data[0].resource ) {
const ridArray = [ 'RFIBIKO', 'RZG6CR1', 'RH8X0JA', 'RN66EP5' ];
if( ridArray.includes( response.data[0].resource.rid ) ) {
// Hide HW plus button for paid HW+ members
$( '.site-header .main-navigation .header-hw-plus' ).hide();
}
}
}
}
} );
} ] );
},
/**
* Shows logout and my-account links and hides login links.
*/
showPianoLogoutLink() {
//Hide the Login links
this.loginLinks.forEach(function (loginLink) {
loginLink.style.display = 'none';
});
//Show the My Account links
this.myAccountLinks.forEach(function (myAccountLink) {
myAccountLink.style.display = 'block';
});
//Show the Logout links
document.querySelectorAll( this.selectors.mobileLogoutLinks ).forEach( logoutLink => logoutLink.style.display = 'block' );
//Show the Welcome links
this.welcomeLink.forEach(function (welcomeLink) {
welcomeLink.style.display = 'block';
});
},
/**
* Handle login link click.
*
* @param {object} event Event object.
*/
showLoginModal(event) {
event.preventDefault();
tp.pianoId.show({
displayMode: 'modal',
confirmation: 'after',
});
},
/**
* Handles logout link events.
*
* @param {object} event Event object.
*/
handleLogout(event) {
event.preventDefault();
console.log( 'handle logout' );
tp.pianoId.logout(function () {
window.location.replace('/');
});
},
/**
* Checks if current page against passed pageSlug.
*
* @param string pageSlug Slug to check for.
*
* @returns boolean
*/
is_page(pageSlug) {
if (tkPiano && undefined !== tkPiano.pageSlug && '' !== tkPiano.pageSlug.trim()) {
return tkPiano.pageSlug === pageSlug;
}
return false;
},
};
TKPiano.init();;
/**
* Handle Piano JS callbacks, send data using ajax to HubSpot.
*/
const TKHubSpot = {
init() {
if ( 'undefined' === typeof tkPiano ) {
return;
}
document.addEventListener( 'DOMContentLoaded', function() {
this.handleCheckoutEvents();
this.handleNewsletterSignup();
}.bind(this) );
},
handleCheckoutEvents() {
tp = window.tp || [];
tp.push( ['addHandler', 'startCheckout', function() {
const today = new Date();
const time = today.getDate() + '/' + today.getMonth() + '/' + today.getFullYear();
const startObject = {
checkoutStart : time
};
this.sendToHubSpot( 'checkout', startObject );
}.bind(this)] );
tp.push( ['addHandler', 'checkoutComplete', function( conversion ) {
this.sendToHubSpot( 'checkout', conversion );
}.bind(this)] );
tp.push( ['addHandler', 'showOffer', function( offerParams ) {
offerParams.showOffer = true;
this.sendToHubSpot( 'show', offerParams );
}.bind(this)] );
tp.push( ['addHandler', 'showTemplate', function( templateParams ) {
templateParams.showTemplate = true;
this.sendToHubSpot( 'show', templateParams );
}.bind(this)] );
},
handleNewsletterSignup() {
tp = window.tp || [];
tp.push( [ 'addHandler', 'customEvent', function( event, b, c, d ) {
console.log('customEvent', event, b, c, d);
switch ( event.eventName ) {
case 'email-signup':
var email = '';
var newsletter = '';
var contacttype = '';
var params;
var iframeId;
var iframe;
var templateId;
// We are parsing the params object sent from the template to find out which iframe triggered it
params = JSON.parse(event.params.params);
console.log( 'params', params );
// And here's the iframeId we're looking for
iframeId = params.iframeId;
console.log( 'iframeId', iframeId );
iframe = document.getElementById( iframeId );
console.log( 'iframe', iframe );
if ( ( typeof event.params.email != 'undefined' ) && ( event.params.email.length > 0 ) ) {
email = event.params.email;
}
if ( ( typeof event.params.newsletter != 'undefined' ) && ( event.params.newsletter.length > 0 ) ) {
newsletter = event.params.newsletter;
}
if ( ( typeof event.params.contacttype != 'undefined' ) && ( event.params.contacttype.length > 0 ) ) {
contacttype = event.params.contacttype;
}
if ( ( typeof params.templateId != 'undefined' ) && ( params.templateId.length > 0 ) ) {
templateId = params.templateId;
}
if ( ( typeof params.trackingId != 'undefined' ) && ( params.trackingId.length > 0 ) ) {
trackingId = params.trackingId;
}
let dataObj = {
action: 'piano_newsletter_signup',
email: email,
newsletter: newsletter,
contacttype: contacttype,
templateId: templateId,
trackingId: trackingId,
};
// Turn dataObj into a urlencoded string.
let requestArray = [];
for ( let key in dataObj ) {
if ( dataObj.hasOwnProperty( key ) ) {
requestArray.push( encodeURIComponent( key ) + "=" + encodeURIComponent( dataObj[ key ]) );
}
}
fetch( tkPiano.ajaxurl, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: requestArray.join( '&' ),
})
.then((response) => response.json())
.then((data) => {
if (data) {
console.log('[DATA]', data);
console.log('message]', data.result.message);
iframe.contentWindow.postMessage({
piano: {
success: false, //currently this works for error and success
message: data.result.message,
object: 'email'
}
}, '*');
}
});
break;
case 'sticky-offer-close':
$( '.bottom-sticky-ad' ).css( 'bottom', 0 );
break;
}
}]);
},
sendToHubSpot( eventType, pianoObject ) {
const user = tp.user?.getProvider().getUser();
// Get the user information, if not set do not process the callback.
if ( !user?.email ) {
return;
}
let dataObj = {
nonce: tkPiano.nonce[ eventType ],
action: 'piano_' + eventType,
hbpagename: tkPiano.hbpagename,
hbpageurl: tkPiano.hbpageurl,
firstname: user?.firstName ?? '',
lastname: user?.lastName ?? '',
email: user?.email ?? '',
uid: user?.uid ?? '',
};
if ( pianoObject.showOffer !== undefined ) {
dataObj.showoffer = pianoObject?.showOffer;
} else if ( pianoObject.showTemplate !== undefined ) {
dataObj.template = pianoObject?.showTemplate;
}
if ( pianoObject?.checkoutStart !== undefined ) {
dataObj.startcheckout = true;
} else if ( pianoObject?.stateName !== undefined ) {
dataObj.statename = pianoObject?.stateName;
} else {
switch ( eventType ) {
case 'checkout':
dataObj.chargeamount = pianoObject?.chargeAmount;
dataObj.expires = pianoObject?.expires;
dataObj.promotionid = pianoObject?.promotionId;
dataObj.offerid = pianoObject?.offerId;
dataObj.startedate = pianoObject?.startedAt;
dataObj.termid = pianoObject?.termId;
dataObj.status = 'Active';
dataObj.stateview = pianoObject?.stateView;
break;
case 'show':
dataObj.offerid = pianoObject?.offerId ?? '';
dataObj.templateid = pianoObject?.templateId ?? '';
break;
default:
return;
}
}
// Turn dataObj into a urlencoded string.
let requestArray = [];
for ( let key in dataObj ) {
if ( dataObj.hasOwnProperty( key ) ) {
requestArray.push( encodeURIComponent( key ) + "=" + encodeURIComponent( dataObj[ key ]) );
}
}
fetch( tkPiano.ajaxurl, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: requestArray.join( '&' ),
})
.then( function( response ) {
console.log( response );
});
}
};
TKHubSpot.init();;
!function(e){"object"==typeof exports&&"undefined"!=typeof module||"function"!=typeof define||!define.amd?e():define("inert",e)}((function(){"use strict";var e,t,n,i,o,r,s=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};function a(e,t){for(var n=0;na;)o(e,n=r[a++])&&(~u(p,n)||f(p,n));return p}},function(t,r,n){var e=n(10),o=n(55),i=n(57);n=function(t){return function(r,n,u){var c,f=e(r),a=i(f),p=o(u,a);if(t&&n!=n){for(;p"+t+""+v+">"}var u,c=e(42),f=e(64),a=e(59),p=e(48),s=e(66),y=e(39),l=(e=e(47),"prototype"),v="script",b=e("IE_PROTO"),g=function(){try{u=new ActiveXObject("htmlfile")}catch(t){}var t;g="undefined"==typeof document||document.domain&&u?function(t){t.write(i("")),t.close();var r=t.parentWindow.Object;return t=null,r}(u):((t=y("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(t=t.contentWindow.document).open(),t.write(i("document.F=Object")),t.close(),t.F);for(var r=a.length;r--;)delete g[l][a[r]];return g()};p[b]=!0,r.exports=Object.create||function(r,n){var e;return null!==r?(o[l]=c(r),e=new o,o[l]=null,e[b]=r):e=g(),n===t?e:f(e,n)}},function(t,r,n){var e=n(5),o=n(41),i=n(42),u=n(10),c=n(65);t.exports=e?Object.defineProperties:function(t,r){i(t);for(var n,e=u(r),f=c(r),a=f.length,p=0;p0&&!(s>=n[t-1].priority);t--);t===n.length?n[t]=l:n.splice(t,0,l),u.__current.forEach((n=>{n.name===o&&n.currentIndex>=t&&n.currentIndex++}))}else u[o]={handlers:[l],runs:0};"hookAdded"!==o&&n.doAction("hookAdded",o,i,c,s)}};var i=function(n,t,o=!1){return function(i,c){const s=n[t];if(!e(i))return;if(!o&&!r(c))return;if(!s[i])return 0;let u=0;if(o)u=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else{const n=s[i].handlers;for(let t=n.length-1;t>=0;t--)n[t].namespace===c&&(n.splice(t,1),u++,s.__current.forEach((n=>{n.name===i&&n.currentIndex>=t&&n.currentIndex--})))}return"hookRemoved"!==i&&n.doAction("hookRemoved",i,c),u}};var c=function(n,t){return function(r,e){const o=n[t];return void 0!==e?r in o&&o[r].handlers.some((n=>n.namespace===e)):r in o}};var s=function(n,t,r=!1){return function(e,...o){const i=n[t];i[e]||(i[e]={handlers:[],runs:0}),i[e].runs++;const c=i[e].handlers;if(!c||!c.length)return r?o[0]:void 0;const s={name:e,currentIndex:0};for(i.__current.push(s);s.currentIndex