(function(factory){typeof define=="function"&&define.amd?define("index",factory):factory()})(function(){"use strict";function _typeof(obj){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(obj2){return typeof obj2}:_typeof=function(obj2){return obj2&&typeof Symbol=="function"&&obj2.constructor===Symbol&&obj2!==Symbol.prototype?"symbol":typeof obj2},_typeof(obj)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;iarr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(e){throw e},f:F}}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 normalCompletion=!0,didErr=!1,err;return{s:function(){it=o[Symbol.iterator]()},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(e){didErr=!0,err=e},f:function(){try{!normalCompletion&&it.return!=null&&it.return()}finally{if(didErr)throw err}}}}var animationQueue={},Animation=function(){function Animation2(){_classCallCheck(this,Animation2)}return _createClass(Animation2,null,[{key:"slideUp",value:function(element,callback){var propertyToAnimate=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"height";element.style[propertyToAnimate]="".concat(element.scrollHeight,"px"),element.offsetHeight,element.style[propertyToAnimate]=0,animationQueue[element.id]&&(element.removeEventListener("transitionend",animationQueue[element.id]),delete animationQueue[element.id]);var transitionEnded=function transitionEnded2(event2){event2.propertyName==="height"&&(element.removeEventListener("transitionend",transitionEnded2),(callback||function(){})())};element.addEventListener("transitionend",transitionEnded)}},{key:"slideDown",value:function(element,callback){var propertyToAnimate=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"height";element.style[propertyToAnimate]="".concat(element.scrollHeight,"px");var transitionEnded=function transitionEnded2(event2){if(event2.propertyName===propertyToAnimate){var defaultValue="auto";propertyToAnimate==="max-height"&&(defaultValue="none"),element.style[propertyToAnimate]=defaultValue,element.removeEventListener("transitionend",transitionEnded2),delete animationQueue[element.id],(callback||function(){})()}};element.addEventListener("transitionend",transitionEnded),animationQueue[element.id]=transitionEnded}}]),Animation2}(),Dom=function(){function Dom2(){_classCallCheck(this,Dom2)}return _createClass(Dom2,null,[{key:"getSiblings",value:function(element,filter){for(var includeSelf=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,siblings=[],currentElement=element;currentElement=currentElement.previousElementSibling;)(!filter||currentElement.matches(filter))&&siblings.push(currentElement);for(includeSelf&&siblings.push(element),currentElement=element;currentElement=currentElement.nextElementSibling;)(!filter||currentElement.matches(filter))&&siblings.push(currentElement);return siblings}}]),Dom2}(),commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn,basedir,module){return module={path:basedir,exports:{},require:function(path,base){return commonjsRequire(path,base==null?module.path:base)}},fn(module,module.exports),module.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var browser=createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function Delegate2(root){this.listenerMap=[{},{}],root&&this.root(root),this.handle=Delegate2.prototype.handle.bind(this),this._removedListeners=[]}Delegate2.prototype.root=function(root){var listenerMap=this.listenerMap,eventType;if(this.rootElement){for(eventType in listenerMap[1])listenerMap[1].hasOwnProperty(eventType)&&this.rootElement.removeEventListener(eventType,this.handle,!0);for(eventType in listenerMap[0])listenerMap[0].hasOwnProperty(eventType)&&this.rootElement.removeEventListener(eventType,this.handle,!1)}if(!root||!root.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=root;for(eventType in listenerMap[1])listenerMap[1].hasOwnProperty(eventType)&&this.rootElement.addEventListener(eventType,this.handle,!0);for(eventType in listenerMap[0])listenerMap[0].hasOwnProperty(eventType)&&this.rootElement.addEventListener(eventType,this.handle,!1);return this},Delegate2.prototype.captureForType=function(eventType){return["blur","error","focus","load","resize","scroll"].indexOf(eventType)!==-1},Delegate2.prototype.on=function(eventType,selector,handler,useCapture){var root,listenerMap,matcher,matcherParam;if(!eventType)throw new TypeError("Invalid event type: "+eventType);if(typeof selector=="function"&&(useCapture=handler,handler=selector,selector=null),useCapture===void 0&&(useCapture=this.captureForType(eventType)),typeof handler!="function")throw new TypeError("Handler must be a type of Function");return root=this.rootElement,listenerMap=this.listenerMap[useCapture?1:0],listenerMap[eventType]||(root&&root.addEventListener(eventType,this.handle,useCapture),listenerMap[eventType]=[]),selector?/^[a-z]+$/i.test(selector)?(matcherParam=selector,matcher=matchesTag):/^#[a-z0-9\-_]+$/i.test(selector)?(matcherParam=selector.slice(1),matcher=matchesId):(matcherParam=selector,matcher=Element.prototype.matches):(matcherParam=null,matcher=matchesRoot.bind(this)),listenerMap[eventType].push({selector:selector,handler:handler,matcher:matcher,matcherParam:matcherParam}),this},Delegate2.prototype.off=function(eventType,selector,handler,useCapture){var i,listener,listenerMap,listenerList,singleEventType;if(typeof selector=="function"&&(useCapture=handler,handler=selector,selector=null),useCapture===void 0)return this.off(eventType,selector,handler,!0),this.off(eventType,selector,handler,!1),this;if(listenerMap=this.listenerMap[useCapture?1:0],!eventType){for(singleEventType in listenerMap)listenerMap.hasOwnProperty(singleEventType)&&this.off(singleEventType,selector,handler);return this}if(listenerList=listenerMap[eventType],!listenerList||!listenerList.length)return this;for(i=listenerList.length-1;i>=0;i--)listener=listenerList[i],(!selector||selector===listener.selector)&&(!handler||handler===listener.handler)&&(this._removedListeners.push(listener),listenerList.splice(i,1));return listenerList.length||(delete listenerMap[eventType],this.rootElement&&this.rootElement.removeEventListener(eventType,this.handle,useCapture)),this},Delegate2.prototype.handle=function(event2){var i,l,type=event2.type,root,phase,listener,returned,listenerList=[],target,eventIgnore="ftLabsDelegateIgnore";if(event2[eventIgnore]!==!0){switch(target=event2.target,target.nodeType===3&&(target=target.parentNode),target.correspondingUseElement&&(target=target.correspondingUseElement),root=this.rootElement,phase=event2.eventPhase||(event2.target!==event2.currentTarget?3:2),phase){case 1:listenerList=this.listenerMap[1][type];break;case 2:this.listenerMap[0]&&this.listenerMap[0][type]&&(listenerList=listenerList.concat(this.listenerMap[0][type])),this.listenerMap[1]&&this.listenerMap[1][type]&&(listenerList=listenerList.concat(this.listenerMap[1][type]));break;case 3:listenerList=this.listenerMap[0][type];break}var toFire=[];for(l=listenerList.length;target&&l;){for(i=0;i-1&&target.hasAttribute("disabled")?toFire=[]:listener.matcher.call(target,listener.matcherParam,target)&&toFire.push([event2,target,listener]);if(target===root||(l=listenerList.length,target=target.parentElement||target.parentNode,target instanceof HTMLDocument))break}var ret;for(i=0;i-1)&&(returned=this.fire.apply(this,toFire[i]),returned===!1)){toFire[i][0][eventIgnore]=!0,toFire[i][0].preventDefault(),ret=!1;break}return ret}},Delegate2.prototype.fire=function(event2,target,listener){return listener.handler.call(target,event2,target)};function matchesTag(tagName,element){return tagName.toLowerCase()===element.tagName.toLowerCase()}function matchesRoot(selector,element){return this.rootElement===window?element===document||element===document.documentElement||element===window:this.rootElement===element}function matchesId(id,element){return id===element.id}Delegate2.prototype.destroy=function(){this.off(),this.root()};var _default=Delegate2;exports.default=_default,module.exports=exports.default}),Delegate=getDefaultExportFromCjs(browser),CollapsibleManager=function(){function CollapsibleManager2(){_classCallCheck(this,CollapsibleManager2),this.domDelegate=new Delegate(document.body),this._attachListeners()}return _createClass(CollapsibleManager2,[{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="toggle-collapsible"]:not([disabled])',this._toggleCollapsible.bind(this)),document.addEventListener("collapsible:toggle",this._toggleCollapsible.bind(this))}},{key:"_toggleCollapsible",value:function(event2,target){var _this=this;!target&&event2.detail&&(target=document.querySelector('[aria-controls="'.concat(event2.detail.id,'"]')));var isOpen=target.getAttribute("aria-expanded")==="true",parentCollapsible=target.parentNode;isOpen?this._close(parentCollapsible):this._open(parentCollapsible),target.getAttribute("data-close-siblings")!=="false"&&Dom.getSiblings(parentCollapsible).forEach(function(collapsibleToClose){return _this._close(collapsibleToClose)})}},{key:"_open",value:function(collapsible){var toggleButton=collapsible.querySelector("[aria-controls]");if(!(!toggleButton||toggleButton.getAttribute("aria-expanded")==="true")){var collapsibleContent=collapsible.querySelector("#".concat(toggleButton.getAttribute("aria-controls")));toggleButton.setAttribute("aria-expanded","true"),collapsibleContent.hasAttribute("aria-hidden")&&collapsibleContent.setAttribute("aria-hidden","false"),Animation.slideDown(collapsibleContent,function(){toggleButton.hasAttribute("data-collapsible-force-overflow")&&(collapsibleContent.style.overflow="visible");var autofocusElement=collapsibleContent.querySelector("[autofocus]");autofocusElement&&autofocusElement.focus()})}}},{key:"_close",value:function(collapsible){var toggleButton=collapsible.querySelector("[aria-controls]");if(!(!toggleButton||toggleButton.getAttribute("aria-expanded")==="false")){var collapsibleContent=collapsible.querySelector("#".concat(toggleButton.getAttribute("aria-controls")));toggleButton.hasAttribute("data-collapsible-force-overflow")&&(collapsibleContent.style.overflow="hidden"),collapsibleContent.hasAttribute("aria-hidden")&&collapsibleContent.setAttribute("aria-hidden","true"),toggleButton.setAttribute("aria-expanded","false"),Animation.slideUp(collapsibleContent)}}}]),CollapsibleManager2}(),CountrySelector=function(){function CountrySelector2(countrySelect,provinceSelect){_classCallCheck(this,CountrySelector2),this.countrySelect=countrySelect,this.provinceSelect=provinceSelect,this.countrySelect&&this.provinceSelect&&(this._attachListeners(),this._initSelectors())}return _createClass(CountrySelector2,[{key:"destroy",value:function(){this.countrySelect&&this.countrySelect.removeEventListener("change",this._onCountryChangedListener)}},{key:"_initSelectors",value:function(){var defaultCountry=this.countrySelect.getAttribute("data-default");if(defaultCountry){for(var i=0;i!==this.countrySelect.options.length;++i)if(this.countrySelect.options[i].text===defaultCountry){this.countrySelect.selectedIndex=i;break}}else this.countrySelect.selectedIndex=0;var event2=new Event("change",{bubbles:!0});this.countrySelect.dispatchEvent(event2);var defaultProvince=this.provinceSelect.getAttribute("data-default");if(defaultProvince){for(var _i=0;_i!==this.provinceSelect.options.length;++_i)if(this.provinceSelect.options[_i].text===defaultProvince){this.provinceSelect.selectedIndex=_i;break}}}},{key:"_attachListeners",value:function(){this._onCountryChangedListener=this._onCountryChanged.bind(this),this.countrySelect.addEventListener("change",this._onCountryChangedListener)}},{key:"_onCountryChanged",value:function(){var _this=this,selectedOption=this.countrySelect.options[this.countrySelect.selectedIndex];if(selectedOption){var provinces=JSON.parse(selectedOption.getAttribute("data-provinces")||"[]");if(this.provinceSelect.innerHTML="",provinces.length===0){this.provinceSelect.closest(".form__input-wrapper").style.display="none";return}provinces.forEach(function(data){_this.provinceSelect.options.add(new Option(data[1],data[0]))}),this.provinceSelect.closest(".form__input-wrapper").style.display="block"}}}]),CountrySelector2}(),Responsive=function(){function Responsive2(){_classCallCheck(this,Responsive2)}return _createClass(Responsive2,null,[{key:"matchesBreakpoint",value:function(breakpoint){switch(breakpoint){case"phone":return window.matchMedia("screen and (max-width: 640px)").matches;case"tablet":return window.matchMedia("screen and (min-width: 641px) and (max-width: 1023px)").matches;case"tablet-and-up":return window.matchMedia("screen and (min-width: 641px)").matches;case"pocket":return window.matchMedia("screen and (max-width: 1023px)").matches;case"lap":return window.matchMedia("screen and (min-width: 1024px) and (max-width: 1279px)").matches;case"lap-and-up":return window.matchMedia("screen and (min-width: 1024px)").matches;case"desk":return window.matchMedia("screen and (min-width: 1280px)").matches;case"widescreen":return window.matchMedia("screen and (min-width: 1440px)").matches;case"supports-hover":return window.matchMedia("(hover: hover) and (pointer: fine)").matches}}},{key:"getCurrentBreakpoint",value:function(){if(window.matchMedia("screen and (max-width: 640px)").matches)return"phone";if(window.matchMedia("screen and (min-width: 641px) and (max-width: 1023px)").matches)return"tablet";if(window.matchMedia("screen and (min-width: 1024px) and (max-width: 1279px)").matches)return"lap";if(window.matchMedia("screen and (min-width: 1280px)").matches)return"desk"}}]),Responsive2}(),DesktopNavigation=function(){function DesktopNavigation2(element,navigationLayout,openTrigger){_classCallCheck(this,DesktopNavigation2),this.element=element,this.delegateElement=new Delegate(this.element),this.delegateRoot=new Delegate(document.documentElement),this.useInlineNavigation=navigationLayout==="inline",this.isNavigationVisible=this.useInlineNavigation,this.openTrigger=openTrigger,Responsive.matchesBreakpoint("supports-hover")||(this.openTrigger="click"),this.openItems=[],this.dropdownActivationTimeouts={},this.dropdownDeactivationTimeouts={},this.DROPDOWN_TIMEOUT=100,this._attachListeners(),this.useInlineNavigation&&this._setupInlineNavigation()}return _createClass(DesktopNavigation2,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off()}},{key:"onBlockSelect",value:function(event2){var _this=this;this.useInlineNavigation||this._openNavigation(),Dom.getSiblings(event2.target.parentNode,".is-dropdown-open").forEach(function(openItem){_this._deactivateDropdown(event2,openItem.querySelector('[data-type="menuitem"][aria-haspopup]'))}),this._activateDropdown(event2,event2.target.previousElementSibling)}},{key:"onBlockDeselect",value:function(event2){this.useInlineNavigation||this._closeNavigation(),this._deactivateDropdown(event2,event2.target.parentNode)}},{key:"_attachListeners",value:function(){this.delegateElement.on("focusout",this._onFocusOut.bind(this)),this.delegateRoot.on("click",this._onClick.bind(this)),this.delegateElement.on("click",'[data-action="toggle-menu"]',this._toggleNavigation.bind(this)),this.openTrigger==="hover"?(this.delegateElement.on("focusin",'[data-type="menuitem"][aria-haspopup]',this._activateDropdown.bind(this)),this.delegateElement.on("mouseover",'[data-type="menuitem"][aria-haspopup]',this._activateDropdown.bind(this)),this.delegateElement.on("mouseover",'[data-type="menu"][aria-hidden="false"]',this._blockDropdownDeactivation.bind(this)),this.delegateElement.on("focusout",".is-dropdown-open",this._deactivateDropdown.bind(this)),this.delegateElement.on("mouseout",".is-dropdown-open",this._deactivateDropdown.bind(this))):this.delegateElement.on("click",'[data-type="menuitem"][aria-haspopup]',this._toggleDropdown.bind(this))}},{key:"_onFocusOut",value:function(event2){event2.relatedTarget!==null&&!this.element.contains(event2.relatedTarget)&&this._closeNavigation()}},{key:"_onClick",value:function(event2){this.element.contains(event2.target)||this._closeNavigation()}},{key:"_openNavigation",value:function(){this.useInlineNavigation||(this.element.querySelector('[data-action="toggle-menu"]').setAttribute("aria-expanded","true"),this.element.querySelector('[data-type="menu"]').setAttribute("aria-hidden","false"),this.isNavigationVisible=!0)}},{key:"_closeNavigation",value:function(){var _this2=this;if(this.useInlineNavigation||(this.element.querySelector('[data-action="toggle-menu"]').setAttribute("aria-expanded","false"),this.element.querySelector('[data-type="menu"]').setAttribute("aria-hidden","true")),this.isNavigationVisible=!1,this.openTrigger==="click"){var cloneOpenItems=this.openItems.slice(0);cloneOpenItems.forEach(function(item){_this2._deactivateDropdown(event,item)})}}},{key:"_toggleNavigation",value:function(event2){this.isNavigationVisible?this._closeNavigation():this._openNavigation()}},{key:"_toggleDropdown",value:function(event2,target){target.getAttribute("aria-expanded")==="false"&&event2.preventDefault(),target.getAttribute("aria-expanded")==="true"?target.getAttribute("href")==="#"&&(event2.preventDefault(),this._deactivateDropdown(event2,target.closest(".is-dropdown-open"))):this._activateDropdown(event2,target)}},{key:"_activateDropdown",value:function(event2,target){var _this3=this;if(this.openTrigger==="click"){var cloneOpenItems=this.openItems.slice(0);cloneOpenItems.forEach(function(item){item.contains(target)||_this3._deactivateDropdown(event2,item)})}var menuToOpen=Dom.getSiblings(target,"[aria-hidden]")[0],callback=function(){if(target.setAttribute("aria-expanded","true"),target.parentNode.classList.add("is-dropdown-open"),menuToOpen.setAttribute("aria-hidden","false"),_this3.openTrigger==="hover"&&_this3.dropdownDeactivationTimeouts[menuToOpen.id]&&(clearTimeout(_this3.dropdownDeactivationTimeouts[menuToOpen.id]),delete _this3.dropdownDeactivationTimeouts[menuToOpen.id]),_this3.useInlineNavigation){var windowWidth=window.innerWidth,shouldOpenLeft=!1;menuToOpen.querySelectorAll(".nav-dropdown").forEach(function(subSubMenu){subSubMenu.getBoundingClientRect().right>windowWidth&&(shouldOpenLeft=!0)}),shouldOpenLeft&&menuToOpen.classList.add("nav-dropdown--inverse")}target.closest('[data-type="menu"]').classList.add("nav-dropdown--glued"),menuToOpen.classList.contains("mega-menu")&&_this3._setupMegaMenu(menuToOpen),_this3.openTrigger==="click"&&_this3.openItems.push(target.parentNode)};if(this.openTrigger==="click")callback();else{for(var toDeactivate in this.dropdownActivationTimeouts)this.dropdownActivationTimeouts.hasOwnProperty(toDeactivate)&&(clearTimeout(this.dropdownActivationTimeouts[toDeactivate]),delete this.dropdownActivationTimeouts[toDeactivate]);callback()}}},{key:"_deactivateDropdown",value:function(event2,target){var _this4=this;if(!(this.openTrigger==="hover"&&target.contains(event2.relatedTarget))){var menuToClose=target.querySelector("[aria-hidden]"),callback=function(){target.classList.remove("is-dropdown-open"),target.querySelector('[data-type="menuitem"]').setAttribute("aria-expanded","false");var menuToClose2=target.querySelector("[aria-hidden]");if(menuToClose2.setAttribute("aria-hidden","true"),target.closest('[data-type="menu"]').classList.remove("nav-dropdown--glued"),_this4.openTrigger==="click"){target.querySelectorAll(".is-dropdown-open").forEach(function(item){_this4._deactivateDropdown(event2,item);var index2=_this4.openItems.indexOf(item);index2>-1&&_this4.openItems.splice(index2,1)});var index=_this4.openItems.indexOf(target);index>-1&&_this4.openItems.splice(index,1)}};this.openTrigger==="click"?callback():this.dropdownDeactivationTimeouts[menuToClose.id]=setTimeout(function(){callback(),delete _this4.dropdownDeactivationTimeouts[menuToClose.id]},this.DROPDOWN_TIMEOUT)}}},{key:"_blockDropdownDeactivation",value:function(event2,target){if(this.dropdownDeactivationTimeouts[target.id]!==void 0){clearTimeout(this.dropdownDeactivationTimeouts[target.id]),delete this.dropdownDeactivationTimeouts[target.id];for(var toDeactivate in this.dropdownActivationTimeouts)this.dropdownActivationTimeouts.hasOwnProperty(toDeactivate)&&(clearTimeout(this.dropdownActivationTimeouts[toDeactivate]),delete this.dropdownActivationTimeouts[toDeactivate])}}},{key:"_setupMegaMenu",value:function(megaMenu){if(!this.useInlineNavigation){var navDropdownWidth=megaMenu.closest(".nav-dropdown").clientWidth;megaMenu.style.maxWidth=Math.min(1400-navDropdownWidth,parseInt(window.innerWidth-navDropdownWidth-80))+"px"}}},{key:"_setupInlineNavigation",value:function(){var _this5=this;this.element.querySelectorAll(".mega-menu").forEach(function(megaMenu){megaMenu.closest(".nav-bar__item").classList.add("nav-bar__item--static")}),"MutationObserver"in window&&(this.dropdownMenuObserver=new MutationObserver(function(mutationList){mutationList.forEach(function(mutation){mutation.target.getAttribute("aria-hidden")==="false"&&mutation.target.style.setProperty("--distance-to-top","".concat(mutation.target.getBoundingClientRect().top,"px"))})}),this.element.querySelectorAll(".nav-dropdown .nav-dropdown").forEach(function(item){_this5.dropdownMenuObserver.observe(item,{attributes:!0,attributeFilter:["aria-hidden"]})}))}}]),DesktopNavigation2}(),fastdom=createCommonjsModule(function(module){(function(win){var debug=function(){},raf=win.requestAnimationFrame||win.webkitRequestAnimationFrame||win.mozRequestAnimationFrame||win.msRequestAnimationFrame||function(cb){return setTimeout(cb,16)};function FastDom(){var self2=this;self2.reads=[],self2.writes=[],self2.raf=raf.bind(win)}FastDom.prototype={constructor:FastDom,measure:function(fn,ctx){var task=ctx?fn.bind(ctx):fn;return this.reads.push(task),scheduleFlush(this),task},mutate:function(fn,ctx){var task=ctx?fn.bind(ctx):fn;return this.writes.push(task),scheduleFlush(this),task},clear:function(task){return remove(this.reads,task)||remove(this.writes,task)},extend:function(props){if(_typeof(props)!="object")throw new Error("expected object");var child=Object.create(this);return mixin(child,props),child.fastdom=this,child.initialize&&child.initialize(),child},catch:null};function scheduleFlush(fastdom2){fastdom2.scheduled||(fastdom2.scheduled=!0,fastdom2.raf(flush.bind(null,fastdom2)))}function flush(fastdom2){var writes=fastdom2.writes,reads=fastdom2.reads,error;try{debug("flushing reads",reads.length),runTasks(reads),debug("flushing writes",writes.length),runTasks(writes)}catch(e){error=e}if(fastdom2.scheduled=!1,(reads.length||writes.length)&&scheduleFlush(fastdom2),error)if(debug("task errored",error.message),fastdom2.catch)fastdom2.catch(error);else throw error}function runTasks(tasks){for(var task;task=tasks.shift();)task()}function remove(array,item){var index=array.indexOf(item);return!!~index&&!!array.splice(index,1)}function mixin(target,source){for(var key in source)source.hasOwnProperty(key)&&(target[key]=source[key])}var exports=win.fastdom=win.fastdom||new FastDom;module.exports=exports})(typeof window!="undefined"?window:commonjsGlobal)}),CollectionFilterDrawer=function(){function CollectionFilterDrawer2(options){_classCallCheck(this,CollectionFilterDrawer2),this.element=document.getElementById("mobile-collection-filters"),this.delegateRoot=new Delegate(document.documentElement),this.options=options,this.isOpen=!1,this.element&&this._attachListeners()}return _createClass(CollectionFilterDrawer2,[{key:"destroy",value:function(){this.delegateRoot.off()}},{key:"_attachListeners",value:function(){this.delegateRoot.on("click",'[aria-controls="mobile-collection-filters"][data-action="open-drawer"]',this.open.bind(this)),this.delegateRoot.on("click",'#mobile-collection-filters [data-action="close-drawer"]',this.close.bind(this)),document.addEventListener("collection-filter:close",this.close.bind(this)),document.addEventListener("click",this._detectOutsideClick.bind(this)),window.addEventListener("resize",this._computeDrawerHeight.bind(this))}},{key:"open",value:function(event2){event2&&event2.stopPropagation(),this._computeDrawerHeight(),this.isOpen=!0,document.querySelector('[aria-controls="mobile-collection-filters"]').setAttribute("aria-expanded","true"),document.getElementById("mobile-collection-filters").setAttribute("aria-hidden","false"),document.body.classList.add("no-mobile-scroll")}},{key:"close",value:function(event2){event2&&event2.stopPropagation(),this.isOpen=!1,document.querySelector('[aria-controls="mobile-collection-filters"]').setAttribute("aria-expanded","false"),document.getElementById("mobile-collection-filters").setAttribute("aria-hidden","true"),document.body.classList.remove("no-mobile-scroll")}},{key:"_computeDrawerHeight",value:function(){document.getElementById("mobile-collection-filters").querySelector(".collection-drawer").style.maxHeight="".concat(window.innerHeight,"px")}},{key:"_filtersHaveChanged",value:function(newFilters){var _this=this;this.element&&fastdom.mutate(function(){var filterCountElement=_this.element.querySelector(".collection-drawer__filter-count");filterCountElement.innerText="(".concat(newFilters.length,")"),filterCountElement.style.display=newFilters.length===0?"none":"inline",_this.element.querySelector('[data-action="clear-tags"]').style.display=newFilters.length===0?"none":"block",_this.options.filterType==="group"&&_this.element.querySelectorAll(".collection__filter-item-active").forEach(function(item){var parentList=item.closest(".collection__filter-group"),activeDataTag=parentList.querySelector(".is-selected[data-tag]");activeDataTag?(item.style.display="block",item.innerText=activeDataTag.getAttribute("data-tag-user")):item.style.display="none"})})}},{key:"_detectOutsideClick",value:function(event2){this.isOpen&&!event2.target.closest(".collection-drawer__inner")&&this.close()}}]),CollectionFilterDrawer2}(),ExitPopup=function(){function ExitPopup2(element){_classCallCheck(this,ExitPopup2),this.element=element,this.delegateElement=new Delegate(this.element),this.rootDelegateElement=new Delegate(document.body),this.options=JSON.parse(element.getAttribute("data-popup-settings")),this.hasOpenOnceInCurrentPage=!1;try{window.location.hash==="#exit-popup"&&window.theme.pageType!=="captcha"&&this._openPopup()}catch(error){}this._attachListeners()}return _createClass(ExitPopup2,[{key:"destroy",value:function(){this.delegateElement.off()}},{key:"_attachListeners",value:function(){var _this=this;this._onKeyPressedListener=this._onKeyPressed.bind(this),Responsive.matchesBreakpoint("supports-hover")&&(this.delegateElement.on("click",'[data-action="close-popup"]',this._closePopup.bind(this)),document.body.addEventListener("mouseleave",function(){_this.hasOpenOnceInCurrentPage||(!_this.options.showOnlyOnce||_this.options.showOnlyOnce&&localStorage.getItem("themeExitPopup")===null)&&_this._openPopup()}),this._clickOutsideListener=this._checkClickOutside.bind(this))}},{key:"_openPopup",value:function(){window.theme.isNewsletterPopupOpen||(this.element.setAttribute("aria-hidden","false"),localStorage.setItem("themeExitPopup","true"),this.hasOpenOnceInCurrentPage=!0,window.theme.isExitPopupOpen=!0,this.delegateElement.on("click",this._clickOutsideListener),this.rootDelegateElement.on("keyup",this._onKeyPressedListener))}},{key:"_closePopup",value:function(){this.element.setAttribute("aria-hidden","true"),window.theme.isExitPopupOpen=!1,this.delegateElement.off("click",this._clickOutsideListener),this.rootDelegateElement.off("keyup",this._onKeyPressedListener)}},{key:"_checkClickOutside",value:function(event2){(!this.element.contains(event2.target)||this.element===event2.target)&&this._closePopup()}},{key:"_onKeyPressed",value:function(event2){event2.key==="Escape"&&this._closePopup()}}]),ExitPopup2}(),LoadingBar=function(){function LoadingBar2(){_classCallCheck(this,LoadingBar2),this.element=document.querySelector(".loading-bar"),this.element&&(document.addEventListener("theme:loading:start",this._onLoadingStart.bind(this)),document.addEventListener("theme:loading:end",this._onLoadingEnd.bind(this)),this.element.addEventListener("transitionend",this._onTransitionEnd.bind(this)))}return _createClass(LoadingBar2,[{key:"_onLoadingStart",value:function(){this.element.classList.add("is-visible"),this.element.style.width="40%"}},{key:"_onLoadingEnd",value:function(){this.element.style.width="100%",this.element.classList.add("is-finished")}},{key:"_onTransitionEnd",value:function(event2){event2.propertyName==="width"&&this.element.classList.contains("is-finished")&&(this.element.classList.remove("is-visible"),this.element.classList.remove("is-finished"),this.element.style.width="0")}}]),LoadingBar2}(),Accessibility=function(){function Accessibility2(){_classCallCheck(this,Accessibility2)}return _createClass(Accessibility2,null,[{key:"trapFocus",value:function(container,namespace){this.listeners=this.listeners||{};var elementToFocus=container.querySelector("[autofocus]")||container;container.setAttribute("tabindex","-1"),elementToFocus.focus(),this.listeners[namespace]=function(event2){container!==event2.target&&!container.contains(event2.target)&&elementToFocus.focus()},document.addEventListener("focusin",this.listeners[namespace])}},{key:"removeTrapFocus",value:function(container,namespace){container&&container.removeAttribute("tabindex"),document.removeEventListener("focusin",this.listeners[namespace])}},{key:"clearTrapFocus",value:function(){for(var key in this.listeners)this.listeners.hasOwnProperty(key)&&document.removeEventListener("focusin",this.listeners[key]);this.listeners={}}}]),Accessibility2}(),Cart=function(){function Cart2(element,options){_classCallCheck(this,Cart2),this.element=element,this.delegateElement=new Delegate(this.element),this.delegateRoot=new Delegate(document.documentElement),this.options=options,this.element&&(this.miniCartElement=document.getElementById("mini-cart"),this.isMiniCartOpen=!1,window.theme.pageType!=="cart"&&this.miniCartElement&&(this.miniCartToggleElement=this.element.querySelector('[aria-controls="'.concat(this.miniCartElement.id,'"]')),this._checkMiniCartScrollability()),this.itemCount=window.theme.cartCount,this._attachListeners())}return _createClass(Cart2,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off(),window.removeEventListener("resize",this._calculateMiniCartHeightListener)}},{key:"_attachListeners",value:function(){this._calculateMiniCartHeightListener=this._calculateMiniCartHeight.bind(this),window.theme.pageType!=="cart"&&window.theme.cartType!=="page"&&(this.delegateElement.on("click",'[data-action="toggle-mini-cart"]',this._toggleMiniCart.bind(this)),this.delegateRoot.on("click",this._onWindowClick.bind(this)),window.addEventListener("resize",this._calculateMiniCartHeightListener)),this.delegateRoot.on("click",'[data-action="decrease-quantity"]',this._updateQuantity.bind(this)),this.delegateRoot.on("click",'[data-action="increase-quantity"]',this._updateQuantity.bind(this)),this.delegateRoot.on("change",".quantity-selector:not(.quantity-selector--product) .quantity-selector__value",this._updateQuantity.bind(this)),this.delegateRoot.on("keyup",".quantity-selector:not(.quantity-selector--product) .quantity-selector__value",this._updateQuantitySize.bind(this)),this.delegateRoot.on("keydown",".quantity-selector__value",this._blockEnterKey.bind(this)),this.delegateRoot.on("product:added",this._onProductAdded.bind(this)),this.delegateRoot.on("cart:refresh",this._onCartRefresh.bind(this))}},{key:"_toggleMiniCart",value:function(event2){event2&&event2.preventDefault(),this.isMiniCartOpen?this._closeMiniCart():this._openMiniCart()}},{key:"_openMiniCart",value:function(){this.miniCartToggleElement.setAttribute("aria-expanded","true"),Responsive.getCurrentBreakpoint()==="phone"&&this.miniCartToggleElement.querySelector(".header__cart-icon").setAttribute("aria-expanded","true"),this.miniCartElement.setAttribute("aria-hidden","false"),this.isMiniCartOpen=!0,this._calculateMiniCartHeight(),Accessibility.trapFocus(this.miniCartElement,"mini-cart"),document.body.classList.add("no-mobile-scroll")}},{key:"_closeMiniCart",value:function(){this.miniCartToggleElement.setAttribute("aria-expanded","false"),Responsive.getCurrentBreakpoint()==="phone"&&(this.miniCartToggleElement.querySelector(".header__cart-icon").setAttribute("aria-expanded","false"),this.miniCartElement.style.maxHeight=""),this.miniCartElement.setAttribute("aria-hidden","true"),this.isMiniCartOpen=!1,document.body.classList.remove("no-mobile-scroll")}},{key:"_calculateMiniCartHeight",value:function(){if(Responsive.getCurrentBreakpoint()==="phone")if(this.isMiniCartOpen){var maxHeight=window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom;this.miniCartElement.style.maxHeight="".concat(maxHeight,"px");var miniCartContentElement=this.miniCartElement.querySelector(".mini-cart__content"),miniCartRecapElement=this.miniCartElement.querySelector(".mini-cart__recap");miniCartRecapElement&&(miniCartContentElement.style.maxHeight="".concat(maxHeight-miniCartRecapElement.clientHeight,"px"))}else this.miniCartElement.style.maxHeight="",this.miniCartElement.querySelector(".mini-cart__content").style.maxHeight="";else this.miniCartElement.style.maxHeight="",this.miniCartElement.querySelector(".mini-cart__content").style.maxHeight=""}},{key:"_updateQuantity",value:function(event2,target){var _this=this,parsedQuantity=1;target.tagName==="INPUT"?parsedQuantity=parseInt(target.value):parsedQuantity=parseInt(target.getAttribute("data-quantity"));var cartProductoData=buscarProductoInfoPorSku(target.getAttribute("data-sku"));if(typeof cartProductoData!="undefined"&&(current_collection=="BEBIDAS"||parsedQuantity>cartProductoData.qty&&(parsedQuantity=cartProductoData.qty)),window.theme.cartType==="page"){target.hasAttribute("data-href")?window.location.href=target.getAttribute("data-href"):window.location.href="".concat(window.routes.cartChangeUrl,"?id=").concat(target.getAttribute("data-line-id"),"&quantity=").concat(parsedQuantity);return}document.dispatchEvent(new CustomEvent("theme:loading:start")),fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify({id:target.getAttribute("data-line-id"),quantity:parsedQuantity}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(cart){cart.json().then(function(content){typeof window.BOLD!="undefined"&&typeof window.BOLD.common!="undefined"&&typeof window.BOLD.common.cartDoctor!="undefined"&&(content=window.BOLD.common.cartDoctor.fix(content)),console.log("se relleno el carrito"),_this.itemCount=content.item_count,_this._rerender(!1).then(function(){document.dispatchEvent(new CustomEvent("theme:loading:end"))})})}),event2.preventDefault()}},{key:"_updateQuantitySize",value:function(event2,target){target.setAttribute("size",Math.max(target.value.length,2))}},{key:"_blockEnterKey",value:function(event2){if(event2.key==="Enter")return!1}},{key:"_rerender",value:function(){var _this2=this,scrollToTop=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,url="";return window.theme.pageType!=="cart"?url="".concat(window.routes.cartUrl,"?view=mini-cart×tamp=").concat(Date.now()):url="".concat(window.routes.cartUrl,"?timestamp=").concat(Date.now()),fetch(url,{credentials:"same-origin",method:"GET"}).then(function(content){content.text().then(function(html){typeof window.BOLD!="undefined"&&typeof window.BOLD.common!="undefined"&&typeof window.BOLD.common.eventEmitter!="undefined"&&typeof window.BOLD.common.eventEmitter.emit!="undefined"&&BOLD.common.eventEmitter.emit("BOLD_COMMON_cart_loaded");var myDiv=document.createElement("div");if(myDiv.innerHTML=html,myDiv.firstElementChild&&myDiv.firstElementChild.hasAttribute("data-item-count")&&(_this2.itemCount=parseInt(myDiv.firstElementChild.getAttribute("data-item-count"))),_this2.element.querySelector(".header__cart-count").textContent=_this2.itemCount,window.theme.cartType!=="page"){if(window.theme.pageType!=="cart"){var tempElement=document.createElement("div");tempElement.innerHTML=html;var miniCartItemListElement=_this2.miniCartElement.querySelector(".mini-cart__line-item-list"),scrollPosition=null;miniCartItemListElement&&(scrollPosition=miniCartItemListElement.scrollTop),_this2.miniCartElement.innerHTML=tempElement.querySelector(".mini-cart").innerHTML;var newMiniCartItemListElement=_this2.miniCartElement.querySelector(".mini-cart__line-item-list");newMiniCartItemListElement&&scrollPosition!==null&&(newMiniCartItemListElement.scrollTop=scrollPosition),_this2._checkMiniCartScrollability(),_this2._calculateMiniCartHeight(),_this2.element.dispatchEvent(new CustomEvent("cart:rerendered"))}else{var _tempElement=document.createElement("div");_tempElement.innerHTML=html;var originalCart=document.querySelector('[data-section-type="cart"]');originalCart.innerHTML=_tempElement.querySelector('[data-section-type="cart"]').innerHTML,scrollToTop&&window.scrollTo({top:0,behavior:"smooth"}),window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),_this2.element.dispatchEvent(new CustomEvent("cart:rerendered",{bubbles:!0}))}fillDeliveryInfo()}})})}},{key:"_checkMiniCartScrollability",value:function(){var miniCartItemList=this.miniCartElement.querySelector(".mini-cart__line-item-list");miniCartItemList&&miniCartItemList.scrollHeight>miniCartItemList.clientHeight&&miniCartItemList.classList.add("is-scrollable")}},{key:"_onProductAdded",value:function(event2){var _this3=this;this.itemCount+=event2.detail.quantity,this._onCartRefresh().then(function(){window.theme.pageType!=="cart"&&(_this3.options.useStickyHeader||window.scrollTo({top:0,behavior:"smooth"}),window.theme.pageType!=="cart"&&window.theme.cartType==="drawer"&&_this3._openMiniCart())})}},{key:"_onCartRefresh",value:function(event2){var scrollToTop=!0;return event2&&event2.detail&&(scrollToTop=event2.detail.scrollToTop),this._rerender(scrollToTop).then(function(){document.dispatchEvent(new CustomEvent("theme:loading:end"))})}},{key:"_onWindowClick",value:function(event2){this.miniCartElement&&this.isMiniCartOpen&&!this.element.contains(event2.target)&&this._closeMiniCart()}}]),Cart2}(),MobileNavigation=function(){function MobileNavigation2(element){_classCallCheck(this,MobileNavigation2),this.element=element,this.delegateElement=new Delegate(this.element),this.delegateRoot=new Delegate(document.documentElement),this.mobileMenuElement=this.element.querySelector(".mobile-menu"),this.mobileMenuToggleElement=this.element.querySelector('[aria-controls="'.concat(this.mobileMenuElement.id,'"]')),this.isOpen=!1,this._attachListeners()}return _createClass(MobileNavigation2,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off(),window.removeEventListener("resize",this._calculatMaxHeightListener)}},{key:"_attachListeners",value:function(){this._calculatMaxHeightListener=this._calculateMaxHeight.bind(this),this.delegateElement.on("click",'[data-action="toggle-menu"]',this._toggleMenu.bind(this)),this.delegateElement.on("click",'[data-action="open-panel"]',this._openPanel.bind(this)),this.delegateElement.on("click",'[data-action="close-panel"]',this._closePanel.bind(this)),this.delegateRoot.on("click",this._onWindowClick.bind(this)),window.addEventListener("resize",this._calculatMaxHeightListener)}},{key:"_toggleMenu",value:function(){this.isOpen=!this.isOpen,this.mobileMenuToggleElement.setAttribute("aria-expanded",this.isOpen?"true":"false"),this.mobileMenuElement.setAttribute("aria-hidden",this.isOpen?"false":"true"),this.isOpen?(this._calculateMaxHeight(),document.body.classList.add("no-mobile-scroll")):(this.mobileMenuElement.style.maxHeight="",this.element.querySelectorAll(".mobile-menu__panel.is-open").forEach(function(item){item.classList.remove("is-open")}),document.body.classList.remove("no-mobile-scroll"))}},{key:"_openPanel",value:function(event2,target){target.setAttribute("aria-expanded","true"),this.element.querySelector("#".concat(target.getAttribute("aria-controls"))).classList.add("is-open")}},{key:"_closePanel",value:function(event2,target){var panelToClose=target.closest(".mobile-menu__panel.is-open");panelToClose.classList.remove("is-open"),this.element.querySelector('[aria-controls="'.concat(panelToClose.id,'"]')).setAttribute("aria-expanded","false")}},{key:"_calculateMaxHeight",value:function(){this.isOpen&&(this.mobileMenuElement.style.maxHeight="".concat(window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom,"px"))}},{key:"_onWindowClick",value:function(event2){this.isOpen&&!this.element.contains(event2.target)&&this._toggleMenu()}}]),MobileNavigation2}(),ModalManager=function(){function ModalManager2(){_classCallCheck(this,ModalManager2),this.domDelegate=new Delegate(document.body),this.activeModal=document.querySelector('.modal[aria-hidden="false"]'),this._attachListeners()}return _createClass(ModalManager2,[{key:"_attachListeners",value:function(){this._onKeyPressedListener=this._onKeyPressed.bind(this),this.domDelegate.on("click",'[data-action="open-modal"]',this._openModal.bind(this)),this.domDelegate.on("click",'[data-action="close-modal"]',this._closeModal.bind(this)),document.addEventListener("modal:close",this._closeModal.bind(this)),this._clickOutsideListener=this._checkClickOutside.bind(this),this.activeModal&&(document.documentElement.classList.add("is-locked"),this.domDelegate.on("click",this._clickOutsideListener))}},{key:"_openModal",value:function(event2,target){var _this=this,modal=document.querySelector("#".concat(target.getAttribute("aria-controls")));if(modal){var onOpen=function onOpen2(event3){event3.propertyName==="visibility"&&(modal.removeEventListener("transitionend",onOpen2),Accessibility.trapFocus(modal,"modal"),_this.activeModal=modal)};return modal.addEventListener("transitionend",onOpen),modal.setAttribute("aria-hidden","false"),document.documentElement.classList.add("is-locked"),this.domDelegate.on("click",this._clickOutsideListener),this.domDelegate.on("keyup",this._onKeyPressedListener),!1}}},{key:"_closeModal",value:function(){var _this2=this;if(this.activeModal){var onClose=function onClose2(event2){event2.propertyName==="visibility"&&(_this2.activeModal.removeEventListener("transitionend",onClose2),Accessibility.removeTrapFocus(_this2.activeModal,"modal"),_this2.activeModal.dispatchEvent(new CustomEvent("modal:closed")),_this2.activeModal=null)};this.activeModal.addEventListener("transitionend",onClose),this.activeModal.setAttribute("aria-hidden","true"),document.documentElement.classList.remove("is-locked"),this.domDelegate.off("click",this._clickOutsideListener),this.domDelegate.off("keyup",this._onKeyPressedListener)}}},{key:"_checkClickOutside",value:function(event2){this.activeModal&&(!this.activeModal.contains(event2.target)||this.activeModal===event2.target)&&this._closeModal()}},{key:"_onKeyPressed",value:function(event2){event2.key==="Escape"&&this._closeModal()}}]),ModalManager2}(),NewsletterPopup=function(){function NewsletterPopup2(element){_classCallCheck(this,NewsletterPopup2),this.element=element,this.delegateElement=new Delegate(this.element),this.rootDelegateElement=new Delegate(document.body),this.options=JSON.parse(element.getAttribute("data-popup-settings"));try{window.location.hash==="#newsletter-popup"&&window.theme.pageType!=="captcha"?this._openPopup():(!this.options.showOnlyOnce||this.options.showOnlyOnce&&localStorage.getItem("themePopup")===null)&&setTimeout(this._openPopup.bind(this),this.options.apparitionDelay*1e3)}catch(error){}this._attachListeners()}return _createClass(NewsletterPopup2,[{key:"destroy",value:function(){this.delegateElement.off()}},{key:"_attachListeners",value:function(){this._onKeyPressedListener=this._onKeyPressed.bind(this),this.delegateElement.on("click",'[data-action="close-popup"]',this._closePopup.bind(this)),this._clickOutsideListener=this._checkClickOutside.bind(this)}},{key:"_openPopup",value:function(){window.theme.isExitPopupOpen||(this.element.setAttribute("aria-hidden","false"),localStorage.setItem("themePopup","true"),window.theme.isNewsletterPopupOpen=!0,this.delegateElement.on("click",this._clickOutsideListener),this.rootDelegateElement.on("keyup",this._onKeyPressedListener))}},{key:"_closePopup",value:function(){this.element.setAttribute("aria-hidden","true"),window.theme.isNewsletterPopupOpen=!1,this.delegateElement.off("click"),this.rootDelegateElement.off("keyup",this._onKeyPressedListener)}},{key:"_checkClickOutside",value:function(event2){(!this.element.contains(event2.target)||this.element===event2.target)&&this._closePopup()}},{key:"_onKeyPressed",value:function(event2){event2.key==="Escape"&&this._closePopup()}}]),NewsletterPopup2}(),OverflowScroller=function(){function OverflowScroller2(element,options){_classCallCheck(this,OverflowScroller2),element&&(this.element=element,this.options=options,this.lastKnownY=window.scrollY,this.currentTop=0,this.initialTopOffset=options.offsetTop||parseInt(window.getComputedStyle(this.element).top),this._attachListeners())}return _createClass(OverflowScroller2,[{key:"destroy",value:function(){window.removeEventListener("scroll",this._checkPositionListener)}},{key:"_attachListeners",value:function(){this._checkPositionListener=this._checkPosition.bind(this),window.addEventListener("scroll",this._checkPositionListener)}},{key:"_checkPosition",value:function(){var _this=this;fastdom.measure(function(){var bounds=_this.element.getBoundingClientRect(),maxTop=bounds.top+window.scrollY-_this.element.offsetTop+_this.initialTopOffset,minTop=_this.element.clientHeight-window.innerHeight+(_this.options.offsetBottom||0);window.scrollY<_this.lastKnownY?_this.currentTop-=window.scrollY-_this.lastKnownY:_this.currentTop+=_this.lastKnownY-window.scrollY,_this.currentTop=Math.min(Math.max(_this.currentTop,-minTop),maxTop,_this.initialTopOffset),_this.lastKnownY=window.scrollY}),fastdom.mutate(function(){_this.element.style.top="".concat(_this.currentTop,"px")})}}]),OverflowScroller2}(),PopoverManager=function(){function PopoverManager2(){_classCallCheck(this,PopoverManager2),this.delegateElement=new Delegate(document.body),this.delegateRoot=new Delegate(document.documentElement),this.activePopover=null,this._attachListeners()}return _createClass(PopoverManager2,[{key:"_attachListeners",value:function(){this._onLooseFocusListener=this._onLooseFocus.bind(this),this.delegateElement.on("click",'[data-action="toggle-popover"]',this._togglePopover.bind(this)),this.delegateElement.on("click",'[data-action="show-popover-panel"]',this._showPanel.bind(this)),this.delegateRoot.on("click",this._onWindowClick.bind(this)),document.addEventListener("popover:close",this._closeActivePopover.bind(this)),window.addEventListener("resize",this._windowResized.bind(this))}},{key:"_togglePopover",value:function(event2,target){var hasActivePopover=this.activePopover!==null,previousActivePopoverId=this.activePopover?this.activePopover.id:null;target.hasAttribute("data-follow-link")&&Responsive.matchesBreakpoint(target.getAttribute("data-follow-link"))||(hasActivePopover&&this._closeActivePopover(),(!hasActivePopover||hasActivePopover&&target.getAttribute("aria-controls")!==previousActivePopoverId)&&this._openPopover(target),event2.preventDefault())}},{key:"_closeActivePopover",value:function(){this.activePopover.setAttribute("aria-hidden","true"),document.querySelector('[aria-controls="'.concat(this.activePopover.id,'"]')).setAttribute("aria-expanded","false"),this.activePopover.removeEventListener("focusout",this._onLooseFocusListener),this.activePopover=null}},{key:"_openPopover",value:function(target){var element=document.getElementById(target.getAttribute("aria-controls"));if(target.setAttribute("aria-expanded","true"),element.setAttribute("aria-hidden","false"),Responsive.getCurrentBreakpoint()==="phone")element.style.height="".concat(window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom,"px");else{element.style.height="";var panelList=element.querySelector(".popover__panel-list");panelList&&(panelList.style.height="".concat(panelList.clientHeight,"px"))}this.activePopover=element,this.activePopover.addEventListener("focusout",this._onLooseFocusListener)}},{key:"_showPanel",value:function(event2,target){if(this.activePopover){var panels=this.activePopover.querySelectorAll(".popover__panel");panels.forEach(function(panel){panel.id===target.getAttribute("aria-controls")?(panel.classList.add("is-selected"),panel.closest(".popover__panel-list").style.height="".concat(panel.clientHeight,"px")):panel.classList.remove("is-selected")})}}},{key:"_onWindowClick",value:function(event2){event2.target.getAttribute("data-action")==="toggle-popover"||event2.target.closest('[data-action="toggle-popover"]')||this.activePopover&&!this.activePopover.contains(event2.target)&&this._closeActivePopover()}},{key:"_onLooseFocus",value:function(event2){this.activePopover&&event2.relatedTarget!==null&&!this.activePopover.contains(event2.relatedTarget)&&this._closeActivePopover()}},{key:"_windowResized",value:function(){Responsive.getCurrentBreakpoint()==="phone"&&this.activePopover&&(this.activePopover.style.height="".concat(window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom,"px"))}}]),PopoverManager2}(),ProductItemColorSwatch=function(){function ProductItemColorSwatch2(element){_classCallCheck(this,ProductItemColorSwatch2),this.element=element,this.delegateElement=new Delegate(this.element),this._attachListeners(),this.recalculateSwatches()}return _createClass(ProductItemColorSwatch2,[{key:"destroy",value:function(){this.delegateElement.off(),window.removeEventListener("resize",this._recalculateSwatchesListener)}},{key:"recalculateSwatches",value:function(){var _this=this;fastdom.measure(function(){_this.element.querySelectorAll(".product-item__swatch-list").forEach(function(swatchList){var currentWidth=swatchList.clientWidth,maxAllowedWidth=parseInt(Math.min(currentWidth,200)),maxFit=Math.floor(maxAllowedWidth/30);fastdom.mutate(function(){var colorSwatches=swatchList.querySelectorAll(".color-swatch");colorSwatches.forEach(function(colorSwatch,index){colorSwatch.classList.remove("color-swatch--view-more"),maxFit===index+1&&maxFit!==colorSwatches.length&&colorSwatch.classList.add("color-swatch--view-more")})})})})}},{key:"_attachListeners",value:function(){this._recalculateSwatchesListener=this.recalculateSwatches.bind(this),this.delegateElement.on("change",".product-item__swatch-list .color-swatch__radio",this._colorChanged.bind(this)),window.addEventListener("resize",this._recalculateSwatchesListener)}},{key:"_colorChanged",value:function(event2,target){var productItem=target.closest(".product-item"),variantUrl=target.getAttribute("data-variant-url");productItem.querySelector(".product-item__image-wrapper").setAttribute("href",variantUrl),productItem.querySelector(".product-item__title").setAttribute("href",variantUrl);var originalImageElement=productItem.querySelector(".product-item__primary-image");if(target.hasAttribute("data-image-url")&&target.getAttribute("data-media-id")!==originalImageElement.getAttribute("data-media-id")){var newImageElement=document.createElement("img");newImageElement.className="product-item__primary-image lazyload image--fade-in",newImageElement.setAttribute("data-media-id",target.getAttribute("data-media-id")),newImageElement.setAttribute("data-src",target.getAttribute("data-image-url")),newImageElement.setAttribute("data-widths",target.getAttribute("data-image-widths")),newImageElement.setAttribute("data-sizes","auto"),originalImageElement.parentNode.style.paddingBottom="".concat(100/newImageElement.getAttribute("data-image-aspect-ratio"),"%"),originalImageElement.parentNode.replaceChild(newImageElement,originalImageElement)}}}]),ProductItemColorSwatch2}(),Currency=function(){function Currency2(){_classCallCheck(this,Currency2)}return _createClass(Currency2,null,[{key:"formatMoney",value:function(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));var placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||"${{amount}}";function defaultTo(value2,defaultValue){return value2==null||value2!==value2?defaultValue:value2}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultTo(precision,2),thousands=defaultTo(thousands,","),decimal=defaultTo(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}var value="";switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_space_separator":value=formatWithDelimiters(cents,2," ",".");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,",",".");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break}return formatString.indexOf("with_comma_separator")!==-1?formatString.replace(placeholderRegex,value).replace(",00",""):formatString.replace(placeholderRegex,value).replace(".00","")}}]),Currency2}(),Form=function(){function Form2(){_classCallCheck(this,Form2)}return _createClass(Form2,null,[{key:"serialize",value:function(form){function stringKey(key,value){var beginBracket=key.lastIndexOf("[");if(beginBracket===-1){var _hash={};return _hash[key]=value,_hash}var newKey=key.substr(0,beginBracket),newValue={};return newValue[key.substring(beginBracket+1,key.length-1)]=value,stringKey(newKey,newValue)}for(var hash={},i=0,len=form.elements.length;inewVariant.price?(productPrices.innerHTML+=''.concat(window.languages.productSalePrice,"").concat(Currency.formatMoney(newVariant.price,window.theme.moneyFormat),""),productPrices.innerHTML+=''.concat(window.languages.productRegularPrice,"").concat(Currency.formatMoney(newVariant.compare_at_price,window.theme.moneyFormat),"")):productPrices.innerHTML+=''.concat(window.languages.productSalePrice,"").concat(Currency.formatMoney(newVariant.price,window.theme.moneyFormat),""),productPrices.style.display=""}}},{key:"_updateInventory",value:function(newVariant){if(!(!this.options.showInventoryQuantity||!newVariant)){var productFormInventoryElement=this.element.querySelector(".product-form__inventory"),variantInventoryManagement=this.variantsInventories[newVariant.id].inventory_management,variantInventoryPolicy=this.variantsInventories[newVariant.id].inventory_policy,variantInventoryQuantity=this.variantsInventories[newVariant.id].inventory_quantity,variantInventoryMessage=this.variantsInventories[newVariant.id].inventory_message;if(productFormInventoryElement){productFormInventoryElement.classList.remove("inventory--high"),productFormInventoryElement.classList.remove("inventory--low"),newVariant.available&&(variantInventoryManagement!==null&&variantInventoryPolicy==="deny"&&this.options.lowInventoryThreshold>0&&variantInventoryQuantity<=this.options.lowInventoryThreshold?productFormInventoryElement.classList.add("inventory--low"):productFormInventoryElement.classList.add("inventory--high"));var stockCountdown=this.element.querySelector(".inventory-bar");if(stockCountdown){var stockCountdownProgress=Math.min(Math.max(variantInventoryQuantity/parseInt(stockCountdown.getAttribute("data-stock-countdown-max"))*100,0),100);stockCountdown.classList.toggle("inventory-bar--hidden",stockCountdownProgress===0),stockCountdown.firstElementChild.style.width="".concat(stockCountdownProgress,"%")}productFormInventoryElement.innerHTML=variantInventoryMessage}}}},{key:"_updateSku",value:function(newVariant,previousVariant){var productSku=this.element.querySelector(".product-meta__sku");if(productSku){var productSkuNumber=productSku.querySelector(".product-meta__sku-number");if(!newVariant||newVariant.sku==="")productSku.style.display="none";else{if(previousVariant&&previousVariant.sku===newVariant.sku)return;productSkuNumber.innerHTML=newVariant.sku,productSku.style.display=""}}}},{key:"_updateDiscountLabel",value:function(newVariant,previousVariant){if(window.theme.showDiscount){var discountLabel=this.element.querySelector(".product-meta .product-label--on-sale");if(discountLabel)if(!newVariant||!(newVariant.price".concat(Currency.formatMoney(newVariant.compare_at_price-newVariant.price,window.theme.moneyFormat),""),discountLabel.innerHTML="".concat(window.languages.collectionOnSaleLabel.replace("{{savings}}",savings)),discountLabel.style.display="inline-block"}}}},{key:"_updateUnitPrice",value:function(newVariant,previousVariant){var unitPriceMeasurement=this.element.querySelector(".unit-price-measurement");if(unitPriceMeasurement)if(!newVariant||!newVariant.unit_price_measurement)unitPriceMeasurement.parentNode.style.display="none";else{unitPriceMeasurement.parentNode.style.display="block",unitPriceMeasurement.querySelector(".unit-price-measurement__price").innerHTML=Currency.formatMoney(newVariant.unit_price,window.theme.moneyFormat),unitPriceMeasurement.querySelector(".unit-price-measurement__reference-unit").innerHTML=newVariant.unit_price_measurement.reference_unit;var unitPriceReferenceValue=unitPriceMeasurement.querySelector(".unit-price-measurement__reference-value");unitPriceReferenceValue.innerHTML=newVariant.unit_price_measurement.reference_value,unitPriceReferenceValue.style.display=newVariant.unit_price_measurement.reference_value===1?"none":"inline"}}},{key:"_updateSelectors",value:function(newVariant){var _this2=this,applyClassToSelector=function(selector,valueIndex,available){var selectorType=selector.getAttribute("data-selector-type");switch(selectorType){case"color":selector.querySelector(".color-swatch:nth-child(".concat(valueIndex+1,")")).classList.toggle("color-swatch--disabled",!available);break;case"variant":selector.querySelector(".variant-swatch:nth-child(".concat(valueIndex+1,")")).classList.toggle("variant-swatch--disabled",!available);break;case"block":selector.querySelector(".block-swatch:nth-child(".concat(valueIndex+1,")")).classList.toggle("block-swatch--disabled",!available);break}};this.variantSelectors&&this.variantSelectors[0]&&this.productOptionsWithValues[0].values.forEach(function(value,valueIndex){applyClassToSelector(_this2.variantSelectors[0],valueIndex,_this2.productData.variants.some(function(variant){return variant.option1===value&&variant.available})),_this2.variantSelectors[1]&&_this2.productOptionsWithValues[1].values.forEach(function(value2,valueIndex2){applyClassToSelector(_this2.variantSelectors[1],valueIndex2,_this2.productData.variants.some(function(variant){return variant.option2===value2&&variant.option1===_this2.option1&&variant.available})),_this2.variantSelectors[2]&&_this2.productOptionsWithValues[2].values.forEach(function(value3,valueIndex3){applyClassToSelector(_this2.variantSelectors[2],valueIndex3,_this2.productData.variants.some(function(variant){return variant.option3===value3&&variant.option1===_this2.option1&&variant.option2===_this2.option2&&variant.available}))})})})}},{key:"_updateAddToCartButton",value:function(newVariant){var addToCartButtonElement=this.element.querySelector(".product-form__add-button"),infoListElement=this.element.querySelector(".product-form__info-list");if(addToCartButtonElement&&(newVariant?(infoListElement.style.display="block",newVariant.available?(addToCartButtonElement.removeAttribute("disabled"),addToCartButtonElement.classList.remove("button--disabled"),addToCartButtonElement.classList.add("button--primary"),addToCartButtonElement.setAttribute("data-action","add-to-cart"),addToCartButtonElement.innerHTML=window.languages.productFormAddToCart):(addToCartButtonElement.setAttribute("disabled","disabled"),addToCartButtonElement.classList.add("button--disabled"),addToCartButtonElement.classList.remove("button--primary"),addToCartButtonElement.removeAttribute("data-action"),addToCartButtonElement.innerHTML=window.languages.productFormSoldOut)):(addToCartButtonElement.setAttribute("disabled","disabled"),addToCartButtonElement.classList.add("button--disabled"),addToCartButtonElement.classList.remove("button--primary"),addToCartButtonElement.removeAttribute("data-action"),addToCartButtonElement.innerHTML=window.languages.productFormUnavailable,infoListElement.style.display="none"),this.options.showPaymentButton)){var paymentButtonElement=this.element.querySelector(".shopify-payment-button");if(!paymentButtonElement)return;!newVariant||!newVariant.available?paymentButtonElement.style.display="none":paymentButtonElement.style.display="block"}}},{key:"_onOptionChanged",value:function(event2,target){this["option"+target.getAttribute("data-option-position")]=target.value;var selectedValueElement=target.closest(".product-form__option").querySelector(".product-form__selected-value");selectedValueElement&&(selectedValueElement.innerHTML=target.value);var previousVariant=this.currentVariant;if(this.currentVariant=this._getCurrentVariantFromOptions(),this._onVariantChanged(previousVariant,this.currentVariant),this.currentVariant){if(this.options.enableHistoryState&&history.replaceState){var newUrl="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname,"?variant=").concat(this.currentVariant.id);window.history.replaceState({path:newUrl},"",newUrl)}this.masterSelector.querySelector("[selected]").removeAttribute("selected"),this.masterSelector.querySelector('[value="'.concat(this.currentVariant.id,'"]')).setAttribute("selected","selected")}typeof window.BOLD!="undefined"&&typeof window.BOLD.common!="undefined"&&typeof window.BOLD.common.eventEmitter!="undefined"&&typeof window.BOLD.common.eventEmitter.emit!="undefined"&&BOLD.common.eventEmitter.emit("BOLD_COMMON_variant_changed",{variant:this.currentVariant})}},{key:"_getCurrentVariantFromOptions",value:function(){var _this3=this,found=!1;return this.productData.variants.forEach(function(variant){variant.option1===_this3.option1&&variant.option2===_this3.option2&&variant.option3===_this3.option3&&(found=variant)}),found||null}},{key:"_addToCart",value:function(event2,target){var _this4=this;if(window.theme.cartType==="page")return;event2.preventDefault(),event2.stopPropagation(),target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start")),console.log("agregando al carreto");var stockCheck=!1,formProd=this.element.querySelector('form[action*="/cart/add"]'),productoData=buscarProductoInfoPorSku(Form.serialize(formProd).sku);console.log("productoData",Form.serialize(formProd)),localStorage.setItem("category-"+Form.serialize(formProd).id,Form.serialize(formProd).category1),dataLayer.push({ecommerce:null}),dataLayer.push({event:"add_to_cart",ecommerce:{items:[{item_id:Form.serialize(formProd).sku,item_name:Form.serialize(formProd).p_name,affiliation:localStorage.getItem("suc_name"),coupon:"",currency:"MXN",discount:0,item_brand:"El Globo",item_category:Form.serialize(formProd).category1,item_category2:"",price:Form.serialize(formProd).category1=="BEBIDAS"?"":parseFloat(productoData.precio),quantity:Form.serialize(formProd).quantity}]}}),fetchMTDCart(function(error,cart){if(error)console.error(error);else{var productId=Form.serialize(formProd).id,productExists=!1,productQuantity=0;cart.items.forEach(function(item){console.log("item.id: ",item.id),item.id===parseInt(productId)&&(productExists=!0,productQuantity=item.quantity)}),productExists?(console.log("productoData",productoData.precio),parseInt(productQuantity)').concat(message,"
"),afterElement.removeAttribute("disabled"),afterElement.parentNode.insertAdjacentElement("afterend",messageElement),Animation.slideDown(messageElement),setTimeout(function(){Animation.slideUp(messageElement,function(){messageElement.remove()})},5500)}}]),ProductVariants2}(),ProductModel=function(){function ProductModel2(element){_classCallCheck(this,ProductModel2),this.element=element,this.delegateElement=new Delegate(this.element),this.delegateRoot=new Delegate(document.documentElement),this._attachListeners();var stylesheet=document.createElement("link");stylesheet.rel="stylesheet",stylesheet.href="https://cdn.shopify.com/shopifycloud/model-viewer-ui/assets/v1.0/model-viewer-ui.css",document.head.appendChild(stylesheet),window.Shopify.loadFeatures([{name:"model-viewer-ui",version:"1.0",onLoad:this._setupModelViewerUI.bind(this)},{name:"shopify-xr",version:"1.0"}])}return _createClass(ProductModel2,[{key:"destroy",value:function(){}},{key:"_attachListeners",value:function(){var _this=this;this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_play",function(){_this.element.dispatchEvent(new CustomEvent("model:played",{bubbles:!0}))}),this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_pause",function(){_this.element.dispatchEvent(new CustomEvent("model:paused",{bubbles:!0}))})}},{key:"hasBeenSelected",value:function(isInitialLoading){Responsive.matchesBreakpoint("supports-hover")&&!isInitialLoading&&this.modelUi.play()}},{key:"hasBeenDeselected",value:function(){this.modelUi.pause()}},{key:"_setupModelViewerUI",value:function(){this.modelElement=this.element.querySelector("model-viewer"),this.modelUi=new window.Shopify.ModelViewerUI(this.modelElement)}}]),ProductModel2}(),ProductVideo=function(){function ProductVideo2(element,enableVideoLooping){switch(_classCallCheck(this,ProductVideo2),this.element=element,this.delegateElement=new Delegate(this.element),this.enableVideoLooping=enableVideoLooping,this.player=null,this.element.getAttribute("data-media-type")){case"video":var stylesheet=document.createElement("link");stylesheet.rel="stylesheet",stylesheet.href="https://cdn.shopify.com/shopifycloud/shopify-plyr/v1.0/shopify-plyr.css",document.head.appendChild(stylesheet),window.Shopify.loadFeatures([{name:"video-ui",version:"1.0",onLoad:this._setupHtml5Video.bind(this)}]);break;case"external_video":this._setupExternalVideo();break}}return _createClass(ProductVideo2,[{key:"destroy",value:function(){this.player&&this.player.destroy()}},{key:"hasBeenSelected",value:function(isInitialLoading){Responsive.matchesBreakpoint("supports-hover")&&!isInitialLoading&&this.play()}},{key:"hasBeenDeselected",value:function(){this.pause()}},{key:"play",value:function(){switch(this.element.getAttribute("data-media-type")){case"video":this.player.play();break;case"external_video":this.player.playVideo(),this.element.focus();break}}},{key:"pause",value:function(){switch(this.element.getAttribute("data-media-type")){case"video":this.player.pause();break;case"external_video":this.player.pauseVideo();break}}},{key:"_setupHtml5Video",value:function(){var _this=this;this.player=new Shopify.Plyr(this.element.querySelector("video"),{controls:["play","progress","mute","volume","play-large","fullscreen"],loop:{active:this.enableVideoLooping},hideControlsOnPause:!0,clickToPlay:!0,iconUrl:"//cdn.shopify.com/shopifycloud/shopify-plyr/v1.0/shopify-plyr.svg",tooltips:{controls:!1,seek:!0}}),this.player.on("play",function(){_this.element.dispatchEvent(new CustomEvent("video:played",{bubbles:!0}))}),this.player.on("pause",function(){_this.element.dispatchEvent(new CustomEvent("video:paused",{bubbles:!0}))})}},{key:"_setupExternalVideo",value:function(){this.element.getAttribute("data-media-host")==="youtube"&&this._loadYouTubeScript().then(this._setupYouTubePlayer.bind(this))}},{key:"_setupYouTubePlayer",value:function(){var _this2=this,playerLoadingInterval=setInterval(function(){window.YT!==void 0&&window.YT.Player!==void 0&&(_this2.player=new YT.Player(_this2.element.querySelector("iframe"),{videoId:_this2.element.getAttribute("data-video-id"),events:{onStateChange:function(event2){event2.data===0&&_this2.enableVideoLooping&&event2.target.seekTo(0)}}}),clearInterval(playerLoadingInterval))},50)}},{key:"_loadYouTubeScript",value:function(){return new Promise(function(resolve,reject){var script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src="//www.youtube.com/iframe_api"})}}]),ProductVideo2}(),evEmitter=createCommonjsModule(function(module){(function(global2,factory){module.exports?module.exports=factory():global2.EvEmitter=factory()})(typeof window!="undefined"?window:commonjsGlobal,function(){function EvEmitter(){}var proto=EvEmitter.prototype;return proto.on=function(eventName,listener){if(!(!eventName||!listener)){var events=this._events=this._events||{},listeners=events[eventName]=events[eventName]||[];return listeners.indexOf(listener)==-1&&listeners.push(listener),this}},proto.once=function(eventName,listener){if(!(!eventName||!listener)){this.on(eventName,listener);var onceEvents=this._onceEvents=this._onceEvents||{},onceListeners=onceEvents[eventName]=onceEvents[eventName]||{};return onceListeners[listener]=!0,this}},proto.off=function(eventName,listener){var listeners=this._events&&this._events[eventName];if(!(!listeners||!listeners.length)){var index=listeners.indexOf(listener);return index!=-1&&listeners.splice(index,1),this}},proto.emitEvent=function(eventName,args){var listeners=this._events&&this._events[eventName];if(!(!listeners||!listeners.length)){listeners=listeners.slice(0),args=args||[];for(var onceListeners=this._onceEvents&&this._onceEvents[eventName],i=0;i1&&(x=utils2.modulo(x,this.slideableWidth),x=x-this.slideableWidth,this.shiftWrapCells(x)),this.setTranslateX(x,this.isAnimating),this.dispatchScrollEvent()},proto.setTranslateX=function(x,is3d){x+=this.cursorPosition,x=this.options.rightToLeft?-x:x;var translateX=this.getPositionValue(x);this.slider.style.transform=is3d?"translate3d("+translateX+",0,0)":"translateX("+translateX+")"},proto.dispatchScrollEvent=function(){var firstSlide=this.slides[0];if(firstSlide){var positionX=-this.x-firstSlide.target,progress=positionX/this.slidesWidth;this.dispatchEvent("scroll",null,[progress,positionX])}},proto.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},proto.getPositionValue=function(position){return this.options.percentPosition?Math.round(position/this.size.innerWidth*1e4)*.01+"%":Math.round(position)+"px"},proto.settle=function(previousX){!this.isPointerDown&&Math.round(this.x*100)==Math.round(previousX*100)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},proto.shiftWrapCells=function(x){var beforeGap=this.cursorPosition+x;this._shiftCells(this.beforeShiftCells,beforeGap,-1);var afterGap=this.size.innerWidth-(x+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,afterGap,1)},proto._shiftCells=function(cells,gap,shift){for(var i=0;i0?shift:0;cell2.wrapShift(cellShift),gap-=cell2.size.outerWidth}},proto._unshiftCells=function(cells){if(!(!cells||!cells.length))for(var i=0;i0){var startCell=this.cells[index-1];cellX=startCell.x+startCell.size.outerWidth}for(var len=this.cells.length,i=index;i0;){var cell2=this.cells[cellIndex];if(!cell2)break;cells.push(cell2),cellIndex+=increment,gapX-=cell2.size.outerWidth}return cells},proto._containSlides=function(){if(!(!this.options.contain||this.options.wrapAround||!this.cells.length)){var isRightToLeft=this.options.rightToLeft,beginMargin=isRightToLeft?"marginRight":"marginLeft",endMargin=isRightToLeft?"marginLeft":"marginRight",contentWidth=this.slideableWidth-this.getLastCell().size[endMargin],isContentSmaller=contentWidth1;if(!isWrapping)return index;var wrapIndex=utils2.modulo(index,len),delta=Math.abs(wrapIndex-this.selectedIndex),backWrapDelta=Math.abs(wrapIndex+len-this.selectedIndex),forewardWrapDelta=Math.abs(wrapIndex-len-this.selectedIndex);!this.isDragSelect&&backWrapDelta=len&&(this.x+=this.slideableWidth)},proto.previous=function(isWrap,isInstant){this.select(this.selectedIndex-1,isWrap,isInstant)},proto.next=function(isWrap,isInstant){this.select(this.selectedIndex+1,isWrap,isInstant)},proto.updateSelectedSlide=function(){var slide2=this.slides[this.selectedIndex];slide2&&(this.unselectSelectedSlide(),this.selectedSlide=slide2,slide2.select(),this.selectedCells=slide2.cells,this.selectedElements=slide2.getCellElements(),this.selectedCell=slide2.cells[0],this.selectedElement=this.selectedElements[0])},proto.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},proto.selectInitialIndex=function(){var initialIndex=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,!1,!0);return}if(initialIndex&&typeof initialIndex=="string"){var cell2=this.queryCell(initialIndex);if(cell2){this.selectCell(initialIndex,!1,!0);return}}var index=0;initialIndex&&this.slides[initialIndex]&&(index=initialIndex),this.select(index,!1,!0)},proto.selectCell=function(value,isWrap,isInstant){var cell2=this.queryCell(value);if(cell2){var index=this.getCellSlideIndex(cell2);this.select(index,isWrap,isInstant)}},proto.getCellSlideIndex=function(cell2){for(var i=0;i *"),this.getCell(elem))},proto.getAdjacentCellElements=function(adjCount,index){if(!adjCount)return this.selectedSlide.getCellElements();index=index===void 0?this.selectedIndex:index;var len=this.slides.length;if(1+adjCount*2>=len)return this.getCellElements();for(var cellElems=[],i=index-adjCount;i<=index+adjCount;i++){var slideIndex=this.options.wrapAround?utils2.modulo(i,len):i,slide2=this.slides[slideIndex];slide2&&(cellElems=cellElems.concat(slide2.getCellElements()))}return cellElems},proto.queryCell=function(selector){if(typeof selector=="number")return this.cells[selector];if(typeof selector=="string"){if(selector.match(/^[#\.]?[\d\/]/))return;selector=this.element.querySelector(selector)}return this.getCell(selector)},proto.uiChange=function(){this.emitEvent("uiChange")},proto.childUIPointerDown=function(event2){event2.type!="touchstart"&&event2.preventDefault(),this.focus()},proto.onresize=function(){this.watchCSS(),this.resize()},utils2.debounceMethod(Flickity,"onresize",150),proto.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=utils2.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var selectedElement=this.selectedElements&&this.selectedElements[0];this.selectCell(selectedElement,!1,!0)}},proto.watchCSS=function(){var watchOption=this.options.watchCSS;if(watchOption){var afterContent=getComputedStyle2(this.element,":after").content;afterContent.indexOf("flickity")!=-1?this.activate():this.deactivate()}},proto.onkeydown=function(event2){var isNotFocused=document.activeElement&&document.activeElement!=this.element;if(!(!this.options.accessibility||isNotFocused)){var handler=Flickity.keyboardHandlers[event2.keyCode];handler&&handler.call(this)}},Flickity.keyboardHandlers={37:function(){var leftMethod=this.options.rightToLeft?"next":"previous";this.uiChange(),this[leftMethod]()},39:function(){var rightMethod=this.options.rightToLeft?"previous":"next";this.uiChange(),this[rightMethod]()}},proto.focus=function(){var prevScrollY=window2.pageYOffset;this.element.focus({preventScroll:!0}),window2.pageYOffset!=prevScrollY&&window2.scrollTo(window2.pageXOffset,prevScrollY)},proto.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach(function(cell2){cell2.destroy()}),this.element.removeChild(this.viewport),moveElements(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},proto.destroy=function(){this.deactivate(),window2.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),jQuery&&this.$element&&jQuery.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete instances[this.guid]},utils2.extend(proto,animatePrototype),Flickity.data=function(elem){elem=utils2.getQueryElement(elem);var id=elem&&elem.flickityGUID;return id&&instances[id]},utils2.htmlInit(Flickity,"flickity"),jQuery&&jQuery.bridget&&jQuery.bridget("flickity",Flickity),Flickity.setJQuery=function(jq){jQuery=jq},Flickity.Cell=Cell,Flickity.Slide=Slide,Flickity})}),unipointer=createCommonjsModule(function(module){/*!
* Unipointer v2.3.0
* base class for doing one thing with pointer event
* MIT license
*/(function(window2,factory){module.exports?module.exports=factory(window2,evEmitter):window2.Unipointer=factory(window2,window2.EvEmitter)})(window,function(window2,EvEmitter){function noop(){}function Unipointer(){}var proto=Unipointer.prototype=Object.create(EvEmitter.prototype);proto.bindStartEvent=function(elem){this._bindStartEvent(elem,!0)},proto.unbindStartEvent=function(elem){this._bindStartEvent(elem,!1)},proto._bindStartEvent=function(elem,isAdd){isAdd=isAdd===void 0?!0:isAdd;var bindMethod=isAdd?"addEventListener":"removeEventListener",startEvent="mousedown";window2.PointerEvent?startEvent="pointerdown":"ontouchstart"in window2&&(startEvent="touchstart"),elem[bindMethod](startEvent,this)},proto.handleEvent=function(event2){var method="on"+event2.type;this[method]&&this[method](event2)},proto.getTouch=function(touches){for(var i=0;i3||Math.abs(moveVector.y)>3},proto.pointerUp=function(event2,pointer){this.emitEvent("pointerUp",[event2,pointer]),this._dragPointerUp(event2,pointer)},proto._dragPointerUp=function(event2,pointer){this.isDragging?this._dragEnd(event2,pointer):this._staticClick(event2,pointer)},proto._dragStart=function(event2,pointer){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(event2,pointer)},proto.dragStart=function(event2,pointer){this.emitEvent("dragStart",[event2,pointer])},proto._dragMove=function(event2,pointer,moveVector){this.isDragging&&this.dragMove(event2,pointer,moveVector)},proto.dragMove=function(event2,pointer,moveVector){event2.preventDefault(),this.emitEvent("dragMove",[event2,pointer,moveVector])},proto._dragEnd=function(event2,pointer){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(event2,pointer)},proto.dragEnd=function(event2,pointer){this.emitEvent("dragEnd",[event2,pointer])},proto.onclick=function(event2){this.isPreventingClicks&&event2.preventDefault()},proto._staticClick=function(event2,pointer){this.isIgnoringMouseUp&&event2.type=="mouseup"||(this.staticClick(event2,pointer),event2.type!="mouseup"&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},proto.staticClick=function(event2,pointer){this.emitEvent("staticClick",[event2,pointer])},Unidragger.getPointerPoint=Unipointer.getPointerPoint,Unidragger})}),drag=createCommonjsModule(function(module){(function(window2,factory){module.exports?module.exports=factory(window2,flickity,unidragger,utils):window2.Flickity=factory(window2,window2.Flickity,window2.Unidragger,window2.fizzyUIUtils)})(window,function(window2,Flickity,Unidragger,utils2){utils2.extend(Flickity.defaults,{draggable:">1",dragThreshold:3}),Flickity.createMethods.push("_createDrag");var proto=Flickity.prototype;utils2.extend(proto,Unidragger.prototype),proto._touchActionValue="pan-y";var isTouch="createTouch"in document,isTouchmoveScrollCanceled=!1;proto._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),isTouch&&!isTouchmoveScrollCanceled&&(window2.addEventListener("touchmove",function(){}),isTouchmoveScrollCanceled=!0)},proto.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},proto.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},proto.updateDraggable=function(){this.options.draggable==">1"?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},proto.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},proto.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},proto._uiChangeDrag=function(){delete this.isFreeScrolling},proto.pointerDown=function(event2,pointer){if(!this.isDraggable){this._pointerDownDefault(event2,pointer);return}var isOkay=this.okayPointerDown(event2);isOkay&&(this._pointerDownPreventDefault(event2),this.pointerDownFocus(event2),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=getScrollPosition(),window2.addEventListener("scroll",this),this._pointerDownDefault(event2,pointer))},proto._pointerDownDefault=function(event2,pointer){this.pointerDownPointer={pageX:pointer.pageX,pageY:pointer.pageY},this._bindPostStartEvents(event2),this.dispatchEvent("pointerDown",event2,[pointer])};var focusNodes={INPUT:!0,TEXTAREA:!0,SELECT:!0};proto.pointerDownFocus=function(event2){var isFocusNode=focusNodes[event2.target.nodeName];isFocusNode||this.focus()},proto._pointerDownPreventDefault=function(event2){var isTouchStart=event2.type=="touchstart",isTouchPointer=event2.pointerType=="touch",isFocusNode=focusNodes[event2.target.nodeName];!isTouchStart&&!isTouchPointer&&!isFocusNode&&event2.preventDefault()},proto.hasDragStarted=function(moveVector){return Math.abs(moveVector.x)>this.options.dragThreshold},proto.pointerUp=function(event2,pointer){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",event2,[pointer]),this._dragPointerUp(event2,pointer)},proto.pointerDone=function(){window2.removeEventListener("scroll",this),delete this.pointerDownScroll},proto.dragStart=function(event2,pointer){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),window2.removeEventListener("scroll",this),this.dispatchEvent("dragStart",event2,[pointer]))},proto.pointerMove=function(event2,pointer){var moveVector=this._dragPointerMove(event2,pointer);this.dispatchEvent("pointerMove",event2,[pointer,moveVector]),this._dragMove(event2,pointer,moveVector)},proto.dragMove=function(event2,pointer,moveVector){if(this.isDraggable){event2.preventDefault(),this.previousDragX=this.dragX;var direction=this.options.rightToLeft?-1:1;this.options.wrapAround&&(moveVector.x=moveVector.x%this.slideableWidth);var dragX=this.dragStartPosition+moveVector.x*direction;if(!this.options.wrapAround&&this.slides.length){var originBound=Math.max(-this.slides[0].target,this.dragStartPosition);dragX=dragX>originBound?(dragX+originBound)*.5:dragX;var endBound=Math.min(-this.getLastSlide().target,this.dragStartPosition);dragX=dragXthis.slides[0].target&&-restingX1,slideIndex=isWrapAround?utils2.modulo(index,len):index,slide2=this.slides[slideIndex];if(!slide2)return null;var wrap=isWrapAround?this.slideableWidth*Math.floor(index/len):0;return x-(slide2.target+wrap)},proto.dragEndBoostSelect=function(){if(this.previousDragX===void 0||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var distance=this.getSlideDistance(-this.dragX,this.selectedIndex),delta=this.previousDragX-this.dragX;return distance>0&&delta>0?1:distance<0&&delta<0?-1:0},proto.staticClick=function(event2,pointer){var clickedCell=this.getParentCell(event2.target),cellElem=clickedCell&&clickedCell.element,cellIndex=clickedCell&&this.cells.indexOf(clickedCell);this.dispatchEvent("staticClick",event2,[pointer,cellElem,cellIndex])},proto.onscroll=function(){var scroll=getScrollPosition(),scrollMoveX=this.pointerDownScroll.x-scroll.x,scrollMoveY=this.pointerDownScroll.y-scroll.y;(Math.abs(scrollMoveX)>3||Math.abs(scrollMoveY)>3)&&this._pointerDone()};function getScrollPosition(){return{x:window2.pageXOffset,y:window2.pageYOffset}}return Flickity})}),prevNextButton=createCommonjsModule(function(module){(function(window2,factory){module.exports?module.exports=factory(window2,flickity,unipointer,utils):factory(window2,window2.Flickity,window2.Unipointer,window2.fizzyUIUtils)})(window,function(window2,Flickity,Unipointer,utils2){var svgURI="http://www.w3.org/2000/svg";function PrevNextButton(direction,parent){this.direction=direction,this.parent=parent,this._create()}PrevNextButton.prototype=Object.create(Unipointer.prototype),PrevNextButton.prototype._create=function(){this.isEnabled=!0,this.isPrevious=this.direction==-1;var leftDirection=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==leftDirection;var element=this.element=document.createElement("button");element.className="flickity-button flickity-prev-next-button",element.className+=this.isPrevious?" previous":" next",element.setAttribute("type","button"),this.disable(),element.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var svg=this.createSVG();element.appendChild(svg),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},PrevNextButton.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},PrevNextButton.prototype.deactivate=function(){this.parent.element.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},PrevNextButton.prototype.createSVG=function(){var svg=document.createElementNS(svgURI,"svg");svg.setAttribute("class","flickity-button-icon"),svg.setAttribute("viewBox","0 0 100 100");var path=document.createElementNS(svgURI,"path"),pathMovements=getArrowMovements(this.parent.options.arrowShape);return path.setAttribute("d",pathMovements),path.setAttribute("class","arrow"),this.isLeft||path.setAttribute("transform","translate(100, 100) rotate(180) "),svg.appendChild(path),svg};function getArrowMovements(shape){return typeof shape=="string"?shape:"M "+shape.x0+",50 L "+shape.x1+","+(shape.y1+50)+" L "+shape.x2+","+(shape.y2+50)+" L "+shape.x3+",50 L "+shape.x2+","+(50-shape.y2)+" L "+shape.x1+","+(50-shape.y1)+" Z"}PrevNextButton.prototype.handleEvent=utils2.handleEvent,PrevNextButton.prototype.onclick=function(){if(this.isEnabled){this.parent.uiChange();var method=this.isPrevious?"previous":"next";this.parent[method]()}},PrevNextButton.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},PrevNextButton.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},PrevNextButton.prototype.update=function(){var slides=this.parent.slides;if(this.parent.options.wrapAround&&slides.length>1){this.enable();return}var lastIndex=slides.length?slides.length-1:0,boundIndex=this.isPrevious?0:lastIndex,method=this.parent.selectedIndex==boundIndex?"disable":"enable";this[method]()},PrevNextButton.prototype.destroy=function(){this.deactivate(),this.allOff()},utils2.extend(Flickity.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),Flickity.createMethods.push("_createPrevNextButtons");var proto=Flickity.prototype;return proto._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new PrevNextButton(-1,this),this.nextButton=new PrevNextButton(1,this),this.on("activate",this.activatePrevNextButtons))},proto.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},proto.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},Flickity.PrevNextButton=PrevNextButton,Flickity})}),pageDots=createCommonjsModule(function(module){(function(window2,factory){module.exports?module.exports=factory(window2,flickity,unipointer,utils):factory(window2,window2.Flickity,window2.Unipointer,window2.fizzyUIUtils)})(window,function(window2,Flickity,Unipointer,utils2){function PageDots(parent){this.parent=parent,this._create()}PageDots.prototype=Object.create(Unipointer.prototype),PageDots.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.handleClick=this.onClick.bind(this),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},PageDots.prototype.activate=function(){this.setDots(),this.holder.addEventListener("click",this.handleClick),this.bindStartEvent(this.holder),this.parent.element.appendChild(this.holder)},PageDots.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick),this.unbindStartEvent(this.holder),this.parent.element.removeChild(this.holder)},PageDots.prototype.setDots=function(){var delta=this.parent.slides.length-this.dots.length;delta>0?this.addDots(delta):delta<0&&this.removeDots(-delta)},PageDots.prototype.addDots=function(count){for(var fragment=document.createDocumentFragment(),newDots=[],length=this.dots.length,max=length+count,i=length;i.5?indexes.a:indexes.b);var isNewHideIndex=this.fadeHideIndex!=null&&this.fadeHideIndex!=fadeHideIndex&&this.fadeHideIndex!=indexes.a&&this.fadeHideIndex!=indexes.b;isNewHideIndex&&this.slides[this.fadeHideIndex].setOpacity(0),this.fadeHideIndex=fadeHideIndex}},proto.getFadeIndexes=function(){return!this.isDragging&&!this.didDragEnd?{a:this.fadeIndex,b:this.selectedIndex}:this.options.wrapAround?this.getFadeDragWrapIndexes():this.getFadeDragLimitIndexes()},proto.getFadeDragWrapIndexes=function(){var distances=this.slides.map(function(slide2,i){return this.getSlideDistance(-this.x,i)},this),absDistances=distances.map(function(distance2){return Math.abs(distance2)}),minDistance=Math.min.apply(Math,absDistances),closestIndex=absDistances.indexOf(minDistance),distance=distances[closestIndex],len=this.slides.length,delta=distance>=0?1:-1;return{a:closestIndex,b:utils2.modulo(closestIndex+delta,len)}},proto.getFadeDragLimitIndexes=function(){for(var dragIndex=0,i=0;itriggerRect.left+triggerRect.width+pageXOffset&&(inlineLeft=triggerRect.left+triggerRect.width-this.el.clientWidth+pageXOffset),inlineToptriggerRect.top+triggerRect.height+pageYOffset&&(inlineTop=triggerRect.top+triggerRect.height-this.el.clientHeight+pageYOffset),this.el.style.left="".concat(inlineLeft,"px"),this.el.style.top="".concat(inlineTop,"px")}}]),BoundingBox2}();function _classCallCheck$2(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(target,props){for(var i=0;i0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$2(this,Trigger2),this._show=this._show.bind(this),this._hide=this._hide.bind(this),this._handleEntry=this._handleEntry.bind(this),this._handleMovement=this._handleMovement.bind(this);var _options$el=options.el,el=_options$el===void 0?throwIfMissing():_options$el,_options$zoomPane=options.zoomPane,zoomPane=_options$zoomPane===void 0?throwIfMissing():_options$zoomPane,_options$sourceAttrib=options.sourceAttribute,sourceAttribute=_options$sourceAttrib===void 0?throwIfMissing():_options$sourceAttrib,_options$handleTouch=options.handleTouch,handleTouch=_options$handleTouch===void 0?throwIfMissing():_options$handleTouch,_options$onShow=options.onShow,onShow=_options$onShow===void 0?null:_options$onShow,_options$onHide=options.onHide,onHide=_options$onHide===void 0?null:_options$onHide,_options$hoverDelay=options.hoverDelay,hoverDelay=_options$hoverDelay===void 0?0:_options$hoverDelay,_options$touchDelay=options.touchDelay,touchDelay=_options$touchDelay===void 0?0:_options$touchDelay,_options$hoverBoundin=options.hoverBoundingBox,hoverBoundingBox=_options$hoverBoundin===void 0?throwIfMissing():_options$hoverBoundin,_options$touchBoundin=options.touchBoundingBox,touchBoundingBox=_options$touchBoundin===void 0?throwIfMissing():_options$touchBoundin,_options$namespace=options.namespace,namespace=_options$namespace===void 0?null:_options$namespace,_options$zoomFactor=options.zoomFactor,zoomFactor=_options$zoomFactor===void 0?throwIfMissing():_options$zoomFactor,_options$boundingBoxC=options.boundingBoxContainer,boundingBoxContainer=_options$boundingBoxC===void 0?throwIfMissing():_options$boundingBoxC;this.settings={el:el,zoomPane:zoomPane,sourceAttribute:sourceAttribute,handleTouch:handleTouch,onShow:onShow,onHide:onHide,hoverDelay:hoverDelay,touchDelay:touchDelay,hoverBoundingBox:hoverBoundingBox,touchBoundingBox:touchBoundingBox,namespace:namespace,zoomFactor:zoomFactor,boundingBoxContainer:boundingBoxContainer},(this.settings.hoverBoundingBox||this.settings.touchBoundingBox)&&(this.boundingBox=new BoundingBox({namespace:this.settings.namespace,zoomFactor:this.settings.zoomFactor,containerEl:this.settings.boundingBoxContainer})),this.enabled=!0,this._bindEvents()}return _createClass$2(Trigger2,[{key:"_preventDefault",value:function(event2){event2.preventDefault()}},{key:"_preventDefaultAllowTouchScroll",value:function(event2){(!this.settings.touchDelay||!this._isTouchEvent(event2)||this.isShowing)&&event2.preventDefault()}},{key:"_isTouchEvent",value:function(event2){return!!event2.touches}},{key:"_bindEvents",value:function(){this.settings.el.addEventListener("mouseenter",this._handleEntry,!1),this.settings.el.addEventListener("mouseleave",this._hide,!1),this.settings.el.addEventListener("mousemove",this._handleMovement,!1),this.settings.handleTouch?(this.settings.el.addEventListener("touchstart",this._handleEntry,!1),this.settings.el.addEventListener("touchend",this._hide,!1),this.settings.el.addEventListener("touchmove",this._handleMovement,!1)):(this.settings.el.addEventListener("touchstart",this._preventDefault,!1),this.settings.el.addEventListener("touchend",this._preventDefault,!1),this.settings.el.addEventListener("touchmove",this._preventDefault,!1))}},{key:"_unbindEvents",value:function(){this.settings.el.removeEventListener("mouseenter",this._handleEntry,!1),this.settings.el.removeEventListener("mouseleave",this._hide,!1),this.settings.el.removeEventListener("mousemove",this._handleMovement,!1),this.settings.handleTouch?(this.settings.el.removeEventListener("touchstart",this._handleEntry,!1),this.settings.el.removeEventListener("touchend",this._hide,!1),this.settings.el.removeEventListener("touchmove",this._handleMovement,!1)):(this.settings.el.removeEventListener("touchstart",this._preventDefault,!1),this.settings.el.removeEventListener("touchend",this._preventDefault,!1),this.settings.el.removeEventListener("touchmove",this._preventDefault,!1))}},{key:"_handleEntry",value:function(e){this._preventDefaultAllowTouchScroll(e),this._lastMovement=e,e.type=="mouseenter"&&this.settings.hoverDelay?this.entryTimeout=setTimeout(this._show,this.settings.hoverDelay):this.settings.touchDelay?this.entryTimeout=setTimeout(this._show,this.settings.touchDelay):this._show()}},{key:"_show",value:function(){if(this.enabled){var onShow=this.settings.onShow;if(onShow&&typeof onShow=="function"&&onShow(),this.settings.zoomPane.show(this.settings.el.getAttribute(this.settings.sourceAttribute),this.settings.el.clientWidth,this.settings.el.clientHeight),this._lastMovement){var touchActivated=this._lastMovement.touches;(touchActivated&&this.settings.touchBoundingBox||!touchActivated&&this.settings.hoverBoundingBox)&&this.boundingBox.show(this.settings.zoomPane.el.clientWidth,this.settings.zoomPane.el.clientHeight)}this._handleMovement()}}},{key:"_hide",value:function(e){e&&this._preventDefaultAllowTouchScroll(e),this._lastMovement=null,this.entryTimeout&&clearTimeout(this.entryTimeout),this.boundingBox&&this.boundingBox.hide();var onHide=this.settings.onHide;onHide&&typeof onHide=="function"&&onHide(),this.settings.zoomPane.hide()}},{key:"_handleMovement",value:function(e){if(e)this._preventDefaultAllowTouchScroll(e),this._lastMovement=e;else if(this._lastMovement)e=this._lastMovement;else return;var movementX,movementY;if(e.touches){var firstTouch=e.touches[0];movementX=firstTouch.clientX,movementY=firstTouch.clientY}else movementX=e.clientX,movementY=e.clientY;var el=this.settings.el,rect=el.getBoundingClientRect(),offsetX=movementX-rect.left,offsetY=movementY-rect.top,percentageOffsetX=offsetX/this.settings.el.clientWidth,percentageOffsetY=offsetY/this.settings.el.clientHeight;this.boundingBox&&this.boundingBox.setPosition(percentageOffsetX,percentageOffsetY,rect),this.settings.zoomPane.setPosition(percentageOffsetX,percentageOffsetY,rect)}},{key:"isShowing",get:function(){return this.settings.zoomPane.isShowing}}]),Trigger2}();function _classCallCheck$3(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(target,props){for(var i=0;i0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$3(this,ZoomPane2),this._completeShow=this._completeShow.bind(this),this._completeHide=this._completeHide.bind(this),this._handleLoad=this._handleLoad.bind(this),this.isShowing=!1;var _options$container=options.container,container=_options$container===void 0?null:_options$container,_options$zoomFactor=options.zoomFactor,zoomFactor=_options$zoomFactor===void 0?throwIfMissing():_options$zoomFactor,_options$inline=options.inline,inline=_options$inline===void 0?throwIfMissing():_options$inline,_options$namespace=options.namespace,namespace=_options$namespace===void 0?null:_options$namespace,_options$showWhitespa=options.showWhitespaceAtEdges,showWhitespaceAtEdges=_options$showWhitespa===void 0?throwIfMissing():_options$showWhitespa,_options$containInlin=options.containInline,containInline=_options$containInlin===void 0?throwIfMissing():_options$containInlin,_options$inlineOffset=options.inlineOffsetX,inlineOffsetX=_options$inlineOffset===void 0?0:_options$inlineOffset,_options$inlineOffset2=options.inlineOffsetY,inlineOffsetY=_options$inlineOffset2===void 0?0:_options$inlineOffset2,_options$inlineContai=options.inlineContainer,inlineContainer=_options$inlineContai===void 0?document.body:_options$inlineContai;this.settings={container:container,zoomFactor:zoomFactor,inline:inline,namespace:namespace,showWhitespaceAtEdges:showWhitespaceAtEdges,containInline:containInline,inlineOffsetX:inlineOffsetX,inlineOffsetY:inlineOffsetY,inlineContainer:inlineContainer},this.openClasses=this._buildClasses("open"),this.openingClasses=this._buildClasses("opening"),this.closingClasses=this._buildClasses("closing"),this.inlineClasses=this._buildClasses("inline"),this.loadingClasses=this._buildClasses("loading"),this._buildElement()}return _createClass$3(ZoomPane2,[{key:"_buildClasses",value:function(suffix){var classes=["drift-".concat(suffix)],ns=this.settings.namespace;return ns&&classes.push("".concat(ns,"-").concat(suffix)),classes}},{key:"_buildElement",value:function(){this.el=document.createElement("div"),addClasses(this.el,this._buildClasses("zoom-pane"));var loaderEl=document.createElement("div");addClasses(loaderEl,this._buildClasses("zoom-pane-loader")),this.el.appendChild(loaderEl),this.imgEl=document.createElement("img"),this.el.appendChild(this.imgEl)}},{key:"_setImageURL",value:function(imageURL){this.imgEl.setAttribute("src",imageURL)}},{key:"_setImageSize",value:function(triggerWidth,triggerHeight){this.imgEl.style.width="".concat(triggerWidth*this.settings.zoomFactor,"px"),this.imgEl.style.height="".concat(triggerHeight*this.settings.zoomFactor,"px")}},{key:"setPosition",value:function(percentageOffsetX,percentageOffsetY,triggerRect){var imgElWidth=this.imgEl.offsetWidth,imgElHeight=this.imgEl.offsetHeight,elWidth=this.el.offsetWidth,elHeight=this.el.offsetHeight,centreOfContainerX=elWidth/2,centreOfContainerY=elHeight/2,targetImgXToBeCentre=imgElWidth*percentageOffsetX,targetImgYToBeCentre=imgElHeight*percentageOffsetY,left=centreOfContainerX-targetImgXToBeCentre,top=centreOfContainerY-targetImgYToBeCentre,differenceBetweenContainerWidthAndImgWidth=elWidth-imgElWidth,differenceBetweenContainerHeightAndImgHeight=elHeight-imgElHeight,isContainerLargerThanImgX=differenceBetweenContainerWidthAndImgWidth>0,isContainerLargerThanImgY=differenceBetweenContainerHeightAndImgHeight>0,minLeft=isContainerLargerThanImgX?differenceBetweenContainerWidthAndImgWidth/2:0,minTop=isContainerLargerThanImgY?differenceBetweenContainerHeightAndImgHeight/2:0,maxLeft=isContainerLargerThanImgX?differenceBetweenContainerWidthAndImgWidth/2:differenceBetweenContainerWidthAndImgWidth,maxTop=isContainerLargerThanImgY?differenceBetweenContainerHeightAndImgHeight/2:differenceBetweenContainerHeightAndImgHeight;if(this.el.parentElement===this.settings.inlineContainer){var scrollX=window.pageXOffset,scrollY=window.pageYOffset,inlineLeft=triggerRect.left+percentageOffsetX*triggerRect.width-elWidth/2+this.settings.inlineOffsetX+scrollX,inlineTop=triggerRect.top+percentageOffsetY*triggerRect.height-elHeight/2+this.settings.inlineOffsetY+scrollY;this.settings.containInline&&(inlineLefttriggerRect.left+triggerRect.width+scrollX&&(inlineLeft=triggerRect.left+triggerRect.width-elWidth+scrollX),inlineToptriggerRect.top+triggerRect.height+scrollY&&(inlineTop=triggerRect.top+triggerRect.height-elHeight+scrollY)),this.el.style.left="".concat(inlineLeft,"px"),this.el.style.top="".concat(inlineTop,"px")}this.settings.showWhitespaceAtEdges||(left>minLeft?left=minLeft:leftminTop?top=minTop:top1&&arguments[1]!==void 0?arguments[1]:{};if(_classCallCheck$4(this,Drift2),this.VERSION="1.4.0",this.triggerEl=triggerEl,this.destroy=this.destroy.bind(this),!isDOMElement(this.triggerEl))throw new TypeError("`new Drift` requires a DOM element as its first argument.");var namespace=options.namespace||null,showWhitespaceAtEdges=options.showWhitespaceAtEdges||!1,containInline=options.containInline||!1,inlineOffsetX=options.inlineOffsetX||0,inlineOffsetY=options.inlineOffsetY||0,inlineContainer=options.inlineContainer||document.body,sourceAttribute=options.sourceAttribute||"data-zoom",zoomFactor=options.zoomFactor||3,paneContainer=options.paneContainer===void 0?document.body:options.paneContainer,inlinePane=options.inlinePane||375,handleTouch="handleTouch"in options?!!options.handleTouch:!0,onShow=options.onShow||null,onHide=options.onHide||null,injectBaseStyles="injectBaseStyles"in options?!!options.injectBaseStyles:!0,hoverDelay=options.hoverDelay||0,touchDelay=options.touchDelay||0,hoverBoundingBox=options.hoverBoundingBox||!1,touchBoundingBox=options.touchBoundingBox||!1,boundingBoxContainer=options.boundingBoxContainer||document.body;if(inlinePane!==!0&&!isDOMElement(paneContainer))throw new TypeError("`paneContainer` must be a DOM element when `inlinePane !== true`");if(!isDOMElement(inlineContainer))throw new TypeError("`inlineContainer` must be a DOM element");this.settings={namespace:namespace,showWhitespaceAtEdges:showWhitespaceAtEdges,containInline:containInline,inlineOffsetX:inlineOffsetX,inlineOffsetY:inlineOffsetY,inlineContainer:inlineContainer,sourceAttribute:sourceAttribute,zoomFactor:zoomFactor,paneContainer:paneContainer,inlinePane:inlinePane,handleTouch:handleTouch,onShow:onShow,onHide:onHide,injectBaseStyles:injectBaseStyles,hoverDelay:hoverDelay,touchDelay:touchDelay,hoverBoundingBox:hoverBoundingBox,touchBoundingBox:touchBoundingBox,boundingBoxContainer:boundingBoxContainer},this.settings.injectBaseStyles&&injectBaseStylesheet(),this._buildZoomPane(),this._buildTrigger()}return _createClass$4(Drift2,[{key:"_buildZoomPane",value:function(){this.zoomPane=new ZoomPane({container:this.settings.paneContainer,zoomFactor:this.settings.zoomFactor,showWhitespaceAtEdges:this.settings.showWhitespaceAtEdges,containInline:this.settings.containInline,inline:this.settings.inlinePane,namespace:this.settings.namespace,inlineOffsetX:this.settings.inlineOffsetX,inlineOffsetY:this.settings.inlineOffsetY,inlineContainer:this.settings.inlineContainer})}},{key:"_buildTrigger",value:function(){this.trigger=new Trigger({el:this.triggerEl,zoomPane:this.zoomPane,handleTouch:this.settings.handleTouch,onShow:this.settings.onShow,onHide:this.settings.onHide,sourceAttribute:this.settings.sourceAttribute,hoverDelay:this.settings.hoverDelay,touchDelay:this.settings.touchDelay,hoverBoundingBox:this.settings.hoverBoundingBox,touchBoundingBox:this.settings.touchBoundingBox,namespace:this.settings.namespace,zoomFactor:this.settings.zoomFactor,boundingBoxContainer:this.settings.boundingBoxContainer})}},{key:"setZoomImageURL",value:function(imageURL){this.zoomPane._setImageURL(imageURL)}},{key:"disable",value:function(){this.trigger.enabled=!1}},{key:"enable",value:function(){this.trigger.enabled=!0}},{key:"destroy",value:function(){this.trigger._hide(),this.trigger._unbindEvents()}},{key:"isShowing",get:function(){return this.zoomPane.isShowing}},{key:"zoomFactor",get:function(){return this.settings.zoomFactor},set:function(zf){this.settings.zoomFactor=zf,this.zoomPane.settings.zoomFactor=zf,this.trigger.settings.zoomFactor=zf,this.boundingBox.settings.zoomFactor=zf}}]),Drift2}();Object.defineProperty(Drift.prototype,"isShowing",{get:function(){return this.isShowing}}),Object.defineProperty(Drift.prototype,"zoomFactor",{get:function(){return this.zoomFactor},set:function(value){this.zoomFactor=value}}),Drift.prototype.setZoomImageURL=Drift.prototype.setZoomImageURL,Drift.prototype.disable=Drift.prototype.disable,Drift.prototype.enable=Drift.prototype.enable,Drift.prototype.destroy=Drift.prototype.destroy;var ProductGallery=function(){function ProductGallery2(element,options){_classCallCheck(this,ProductGallery2),this.element=element,this.delegateElement=new Delegate(this.element),this.viewInSpaceElement=this.element.querySelector("[data-shopify-xr]"),this.options=options,this.media={},this.previouslySelectedMedia=null,this._createCarousel(),this._createZoom(),this._attachListeners()}return _createClass(ProductGallery2,[{key:"destroy",value:function(){this.flickityInstance&&this.flickityInstance.destroy();for(var mediaId in this.media)this.media.hasOwnProperty(mediaId)&&this.media[mediaId].destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("model:played",this._disableDrag.bind(this)),this.delegateElement.on("video:played",this._disableDrag.bind(this)),this.delegateElement.on("model:paused",this._enableDrag.bind(this)),this.delegateElement.on("video:paused",this._enableDrag.bind(this))}},{key:"variantHasChanged",value:function(newVariant){var _this=this,shouldReload=!1;fastdom.mutate(function(){if(_this.productGalleryCellsElements.forEach(function(cell2,imageIndex){if(cell2.hasAttribute("data-group-name")){var groupName=cell2.getAttribute("data-group-name");_this.options.productOptions.forEach(function(option,optionIndex){option.toLowerCase()===groupName&&(newVariant["option".concat(optionIndex+1)].toLowerCase()===cell2.getAttribute("data-group-value")||newVariant.featured_media&&newVariant.featured_media.id===parseInt(cell2.getAttribute("data-media-id"))?(cell2.classList.remove("is-filtered"),_this.productThumbnailsCellsElements[imageIndex].classList.remove("is-filtered")):(cell2.classList.add("is-filtered"),_this.productThumbnailsCellsElements[imageIndex].classList.add("is-filtered")))}),shouldReload=!0}}),shouldReload&&(_this.flickityInstance.deactivate(),_this.flickityInstance.activate()),Responsive.matchesBreakpoint("lap-and-up")){var slides=_this.element.querySelectorAll(".product-gallery__carousel-item");slides.forEach(function(slide2){slide2.classList.remove("product-gallery__carousel-item--hidden")})}newVariant&&newVariant.featured_media&&_this.flickityInstance.selectCell('[data-media-id="'.concat(newVariant.featured_media.id,'"]'))})}},{key:"_createCarousel",value:function(){var _this2=this;if(this.productGalleryElement=this.element.querySelector(".product-gallery__carousel"),this.productGalleryCellsElements=this.productGalleryElement?this.productGalleryElement.querySelectorAll(".product-gallery__carousel-item"):[],this.productGalleryElement&&(this.productGalleryCellsElements.forEach(function(item){switch(item.getAttribute("data-media-type")){case"external_video":case"video":_this2.media[item.getAttribute("data-media-id")]=new ProductVideo(item,_this2.options.enableVideoLooping);break;case"model":_this2.media[item.getAttribute("data-media-id")]=new ProductModel(item);break}}),parseInt(this.productGalleryElement.getAttribute("data-media-count"))>1)){var filteredCells=[].slice.call(this.productGalleryCellsElements).filter(function(item){return!item.classList.contains("is-filtered")}),initialIndex=0;filteredCells.forEach(function(item,index){item.getAttribute("data-media-id")===_this2.productGalleryElement.getAttribute("data-initial-media-id")&&(initialIndex=index)});var firstSlide=filteredCells[initialIndex];firstSlide.classList.add("is-selected"),this.productGalleryElement.style.height="".concat(firstSlide.clientHeight,"px"),this.flickityInstance=new flickityFade(this.productGalleryElement,{accessibility:!1,prevNextButtons:!1,pageDots:!1,adaptiveHeight:!0,draggable:!Responsive.matchesBreakpoint("supports-hover"),fade:this.options.galleryTransitionEffect==="fade",cellSelector:".product-gallery__carousel-item:not(.is-filtered)",initialIndex:initialIndex,on:{ready:function(){setTimeout(function(){_this2.productGalleryElement.style.height=null},1e3)}}})}this.productThumbnailsListElement=this.element.querySelector(".product-gallery__thumbnail-list"),this.delegateElement.on("click",".product-gallery__thumbnail",this._onThumbnailClicked.bind(this)),this.productThumbnailsListElement&&this.flickityInstance&&(this.productThumbnailsCellsElements=this.productThumbnailsListElement.querySelectorAll(".product-gallery__thumbnail"),this.flickityInstance.on("select",this._onGallerySlideChanged.bind(this)),this.options.galleryTransitionEffect==="fade"?this.flickityInstance.on("select",this._onGallerySlideSettled.bind(this)):this.flickityInstance.on("settle",this._onGallerySlideSettled.bind(this)),this._onGallerySlideChanged(!1),this._onGallerySlideSettled())}},{key:"_createZoom",value:function(){var _this3=this;if(this.options.enableImageZoom){this.driftObjects=[];var zoomWrapper=this.element.querySelector(".product__zoom-wrapper");Responsive.matchesBreakpoint("supports-hover")&&this.element.querySelectorAll(".product-gallery__image").forEach(function(image){_this3.driftObjects.push(new Drift(image,{containInline:_this3.options.zoomEffect==="outside",inlinePane:window.innerWidth<1024?!0:_this3.options.zoomEffect!=="outside",hoverBoundingBox:_this3.options.zoomEffect==="outside",handleTouch:!1,inlineOffsetY:window.innerWidth<1024?-85:0,paneContainer:zoomWrapper}))})}}},{key:"_onGallerySlideChanged",value:function(){var _this4=this,animate2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,previousNavElement=null,newNavElement=null;if(this.productThumbnailsCellsElements.forEach(function(item){item.classList.contains("is-nav-selected")&&(previousNavElement=item),item.getAttribute("data-media-id")===_this4.flickityInstance.selectedElement.getAttribute("data-media-id")&&(newNavElement=item)}),previousNavElement.classList.remove("is-nav-selected"),newNavElement.classList.add("is-nav-selected"),Responsive.matchesBreakpoint("pocket")){var scrollX=newNavElement.offsetLeft-(this.productThumbnailsListElement.parentNode.clientWidth-newNavElement.clientWidth)/2;this.productThumbnailsListElement.parentNode.scrollTo({left:scrollX,behavior:animate2?"smooth":"auto"})}else{var scrollY=newNavElement.offsetTop-(this.productThumbnailsListElement.clientHeight-newNavElement.clientHeight)/2;this.productThumbnailsListElement.scrollTo({top:scrollY,behavior:animate2?"smooth":"auto"})}}},{key:"_onGallerySlideSettled",value:function(){if(this._handleMedia(this.flickityInstance.selectedElement),Responsive.matchesBreakpoint("lap-and-up")){var slides=this.element.querySelectorAll(".product-gallery__carousel-item:not(.is-selected)");slides.forEach(function(slide2){slide2.classList.add("product-gallery__carousel-item--hidden")})}}},{key:"_onThumbnailClicked",value:function(event2,target){if(event2.preventDefault(),this.flickityInstance&&(this.flickityInstance.selectCell('[data-media-id="'.concat(target.getAttribute("data-media-id"),'"]')),Responsive.matchesBreakpoint("lap-and-up"))){var slides=this.element.querySelectorAll(".product-gallery__carousel-item");slides.forEach(function(slide2){slide2.classList.remove("product-gallery__carousel-item--hidden")})}}},{key:"_disableDrag",value:function(){this.flickityInstance.options.draggable=!1,this.flickityInstance.updateDraggable()}},{key:"_enableDrag",value:function(){this.flickityInstance.options.draggable=!Responsive.matchesBreakpoint("supports-hover"),this.flickityInstance.updateDraggable()}},{key:"_handleMedia",value:function(item){var isInitialLoading=this.previouslySelectedMedia===null;if(this.previouslySelectedMedia&&this.previouslySelectedMedia!==item){switch(this.previouslySelectedMedia.getAttribute("data-media-type")){case"video":case"external_video":case"model":this.media[this.previouslySelectedMedia.getAttribute("data-media-id")].hasBeenDeselected()}this.previouslySelectedMedia.getAttribute("data-media-type")==="model"&&this.viewInSpaceElement&&this.viewInSpaceElement.setAttribute("data-shopify-model3d-id",this.viewInSpaceElement.getAttribute("data-shopify-model3d-default-id"))}switch(item.getAttribute("data-media-type")){case"video":case"external_video":case"model":this.media[item.getAttribute("data-media-id")].hasBeenSelected(isInitialLoading),this.element.querySelector(".product-gallery__carousel").classList.remove("product-gallery__carousel--zoomable");break;case"image":this.element.querySelector(".product-gallery__carousel").classList.add("product-gallery__carousel--zoomable");break}item.getAttribute("data-media-type")==="model"&&this.viewInSpaceElement&&this.viewInSpaceElement.setAttribute("data-shopify-model3d-id",item.getAttribute("data-media-id")),this.previouslySelectedMedia=item}}]),ProductGallery2}(),QuantityPicker=function(){function QuantityPicker2(element){_classCallCheck(this,QuantityPicker2),element&&(this.element=element,this.inputElement=this.element.querySelector('[name="quantity"]'),this.delegateElement=new Delegate(this.element),this._attachListeners())}return _createClass(QuantityPicker2,[{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="decrease-picker-quantity"]',this._onDecrease.bind(this)),this.delegateElement.on("click",'[data-action="increase-picker-quantity"]',this._onIncrease.bind(this)),this.delegateElement.on("keyup",this._onInputValueChanged.bind(this)),this.delegateElement.on("focusout",this._onInputFocusOut.bind(this))}},{key:"_onDecrease",value:function(){this.inputElement.value=Math.max(1,parseInt(this.inputElement.value)-1)}},{key:"_onIncrease",value:function(){this.inputElement.value=parseInt(this.inputElement.value)+1}},{key:"_onInputValueChanged",value:function(event2){var value=event2.target.value;value!==""&&isNaN(value)&&(event2.target.value=Math.max(1,parseInt(value)||1))}},{key:"_onInputFocusOut",value:function(event2){event2.target.value=Math.max(1,parseInt(event2.target.value)||1)}}]),QuantityPicker2}(),ShippingEstimator=function(){function ShippingEstimator2(element,options){_classCallCheck(this,ShippingEstimator2),this.element=element,this.delegateElement=new Delegate(this.element),this.options=options,this.countrySelector=new CountrySelector(this.element.querySelector('[name="country"]'),this.element.querySelector('[name="province"]')),this._attachListeners()}return _createClass(ShippingEstimator2,[{key:"destroy",value:function(){this.delegateElement.off("click"),this.countrySelector.destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="estimate-shipping"]',this._fetchRates.bind(this))}},{key:"_fetchRates",value:function(){document.dispatchEvent(new CustomEvent("theme:loading:start")),this.options.singleProduct?this._fetchRatesForProduct():this._fetchRatesForCart()}},{key:"_fetchRatesForCart",value:function(){var _this=this,country=this.element.querySelector('[name="country"]').value,province=this.element.querySelector('[name="province"]').value,zip=this.element.querySelector('[name="zip"]').value;fetch("".concat(window.routes.cartUrl,"/shipping_rates.json?shipping_address[zip]=").concat(zip,"&shipping_address[country]=").concat(country,"&shipping_address[province]=").concat(province),{credentials:"same-origin",method:"GET"}).then(function(response){document.dispatchEvent(new CustomEvent("theme:loading:end")),response.json().then(function(result){_this._formatResults(response.ok,result)})})}},{key:"_fetchRatesForProduct",value:function(){var _this2=this,cartCookie=this._getCookie("cart"),tempCookieValue="temp-cart-cookie___"+Date.now()+parseInt(Math.random()*1e3),fakeCookieValue="fake-cart-cookie___"+Date.now()+parseInt(Math.random()*1e3);if(cartCookie||(this._updateCartCookie(tempCookieValue),cartCookie=this._getCookie("cart")),!(cartCookie.length<32)){this._updateCartCookie(fakeCookieValue);var formElement=document.querySelector('form[action*="/cart/add"]');fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(Form.serialize(formElement)),credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},method:"POST"}).then(function(response){response.json().then(function(){var country=_this2.element.querySelector('[name="country"]').value,province=_this2.element.querySelector('[name="province"]').value,zip=_this2.element.querySelector('[name="zip"]').value;fetch("".concat(window.routes.cartUrl,"/shipping_rates.json?shipping_address[zip]=").concat(zip,"&shipping_address[country]=").concat(country,"&shipping_address[province]=").concat(province),{credentials:"same-origin",method:"GET"}).then(function(response2){document.dispatchEvent(new CustomEvent("theme:loading:end")),response2.json().then(function(result){_this2._formatResults(response2.ok,result)}),_this2._updateCartCookie(cartCookie)}).catch(function(){_this2._updateCartCookie(cartCookie)})}).catch(function(){_this2._updateCartCookie(cartCookie),document.dispatchEvent(new CustomEvent("theme:loading:end"))})})}}},{key:"_formatResults",value:function(isOk,results){var resultsElement=this.element.querySelector(".shipping-estimator__results");if(resultsElement.innerHTML="",isOk){var shippingRates=results.shipping_rates;if(shippingRates.length===0)resultsElement.innerHTML="".concat(window.languages.shippingEstimatorNoResults,"
");else{shippingRates.length===1?resultsElement.innerHTML="".concat(window.languages.shippingEstimatorOneResult,"
"):resultsElement.innerHTML="".concat(window.languages.shippingEstimatorMultipleResults.replace("{{count}}",shippingRates.length),"
");var listRatesHtml="";shippingRates.forEach(function(item){listRatesHtml+="".concat(item.name,": ").concat(Currency.formatMoney(item.price,window.theme.moneyFormat),"")}),resultsElement.innerHTML+="")}}else{resultsElement.innerHTML="".concat(window.languages.shippingEstimatorErrors,"
");var errorHtml="";Object.keys(results).forEach(function(key){errorHtml+=''.concat(key," ").concat(results[key],"")}),resultsElement.innerHTML+="")}resultsElement.style.display="block"}},{key:"_getCookie",value:function(name){var value="; ".concat(document.cookie),parts=value.split("; "+name+"=");if(parts.length===2)return parts.pop().split(";").shift()}},{key:"_updateCartCookie",value:function(value){var date=new Date;date.setTime(date.getTime()+14*864e5),document.cookie="cart=".concat(value,"; expires=").concat(date.toUTCString(),"; path=/")}}]),ShippingEstimator2}(),ValuePicker=function(){function ValuePicker2(id){var options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck(this,ValuePicker2),this.id=id,this.delegateRoot=new Delegate(document.documentElement),this.isOpen=!1,this.togglerElement=document.querySelector('[data-action="open-value-picker"][aria-controls="'.concat(this.id,'"]')),this.onSelect=options.onValueSelect||function(){},this._attachListeners()}return _createClass(ValuePicker2,[{key:"destroy",value:function(){this.delegateRoot.off()}},{key:"_attachListeners",value:function(){this.delegateRoot.on("click",'[data-action="open-value-picker"][aria-controls="'.concat(this.id,'"]'),this._toggle.bind(this)),this.delegateRoot.on("click",'[data-action="close-value-picker"][aria-controls="'.concat(this.id,'"]'),this._toggle.bind(this)),this.delegateRoot.on("click","#".concat(this.id,' [data-action="select-value"]'),this._selectValue.bind(this)),this.delegateRoot.on("click",this._detectOutsideClick.bind(this),!0),this.delegateRoot.on("focusout","#".concat(this.id),this._onFocusOut.bind(this))}},{key:"_toggle",value:function(event2){this.isOpen?this._close(event2):this._open(event2)}},{key:"_open",value:function(){if(document.querySelector('[data-action="open-value-picker"][aria-controls="'.concat(this.id,'"]')).setAttribute("aria-expanded","true"),document.getElementById(this.id).setAttribute("aria-hidden","false"),Responsive.matchesBreakpoint("phone")){var headerElement=document.querySelector(".shopify-section__header");headerElement.style.zIndex="3"}this.isOpen=!0,document.body.classList.add("no-mobile-scroll")}},{key:"_close",value:function(){document.querySelector('[data-action="open-value-picker"][aria-controls="'.concat(this.id,'"]')).setAttribute("aria-expanded","false"),document.getElementById(this.id).setAttribute("aria-hidden","true");var headerElement=document.querySelector(".shopify-section__header");headerElement.style.zIndex="",this.isOpen=!1,document.body.classList.remove("no-mobile-scroll")}},{key:"_selectValue",value:function(event2,target){this.onSelect(target.getAttribute("data-value")),this._close()}},{key:"_onFocusOut",value:function(event2){var container=document.getElementById(this.id);container.contains(event2.relatedTarget)||this._close()}},{key:"_detectOutsideClick",value:function(event2){!this.isOpen||this.togglerElement===event2.target||this.togglerElement.contains(event2.target)||!event2.target.closest(".value-picker__inner")&&this.isOpen&&this._close(event2)}}]),ValuePicker2}(),AccountSection=function(){function AccountSection2(element){_classCallCheck(this,AccountSection2),this.element=element,this.domDelegate=new Delegate(this.element),this.element.querySelectorAll('[action*="/account/addresses"]').forEach(function(addressForm){new CountrySelector(addressForm.querySelector('[name="address[country]"]'),addressForm.querySelector('[name="address[province]"]'))}),this.pageSelector=new ValuePicker("account-selector")}return _createClass(AccountSection2,[{key:"_onUnload",value:function(){this.pageSelector.destroy()}}]),AccountSection2}(),AnnouncementBarSection=function(){function AnnouncementBarSection2(element){_classCallCheck(this,AnnouncementBarSection2),this.element=element,this.domDelegate=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.isOpen=!1,this.options.showNewsletter?document.documentElement.style.setProperty("--announcement-bar-button-width",this.element.querySelector(".announcement-bar__button").clientWidth+"px"):document.documentElement.style.removeProperty("--announcement-bar-button-width"),this._attachListeners()}return _createClass(AnnouncementBarSection2,[{key:"onSelect",value:function(){this.options.showNewsletter&&!this.isOpen&&this._toggleNewsletter()}},{key:"onDeselect",value:function(){this.options.showNewsletter&&this.isOpen&&this._toggleNewsletter()}},{key:"onUnload",value:function(){this.domDelegate.off()}},{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="toggle-newsletter"]',this._toggleNewsletter.bind(this)),this.domDelegate.on("keyup",this._handleKey.bind(this))}},{key:"_toggleNewsletter",value:function(){var togglerElement=this.element.querySelector(".announcement-bar__button"),newsletterElement=this.element.querySelector(".announcement-bar__newsletter");togglerElement.getAttribute("aria-expanded")==="false"?(togglerElement.setAttribute("aria-expanded","true"),newsletterElement.setAttribute("aria-hidden","false"),Animation.slideDown(newsletterElement,function(){Accessibility.trapFocus(newsletterElement,"announcement-bar")})):(togglerElement.setAttribute("aria-expanded","false"),newsletterElement.setAttribute("aria-hidden","true"),Animation.slideUp(newsletterElement),Accessibility.removeTrapFocus(newsletterElement,"announcement-bar")),this.isOpen=!this.isOpen}},{key:"_handleKey",value:function(event2){event2.key==="Escape"&&this.isOpen&&this._toggleNewsletter()}}]),AnnouncementBarSection2}(),BlogSection=function(){function BlogSection2(element){if(_classCallCheck(this,BlogSection2),this.element=element,this.blogTagSelector=new ValuePicker("blog-tag-selector"),Shopify.designMode){var elementToAdd=this.element.querySelector(".page__header");elementToAdd&&(document.querySelector(".blog-container").previousElementSibling.remove(),document.querySelector(".blog-container").insertAdjacentElement("beforebegin",elementToAdd))}}return _createClass(BlogSection2,[{key:"onUnload",value:function(){this.blogTagSelector.destroy()}}]),BlogSection2}(),BlogPostSection=function BlogPostSection2(element){if(_classCallCheck(this,BlogPostSection2),this.element=element,Shopify.designMode){var elementToAdd=this.element.querySelector(".page__header");elementToAdd&&(document.querySelector(".blog-container").previousElementSibling.remove(),document.querySelector(".blog-container").insertAdjacentElement("beforebegin",elementToAdd))}},BlogSidebarSection=function(){function BlogSidebarSection2(element){_classCallCheck(this,BlogSidebarSection2),this.element=element,Shopify.designMode&&window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),window.theme.pageType==="blog"&&this._fixItemsPerRow()}return _createClass(BlogSidebarSection2,[{key:"_fixItemsPerRow",value:function(){var blocks=this.element.querySelectorAll(".blog-sidebar__item");blocks.length===0?(document.querySelector(".blog-container").classList.add("blog-container--without-sidebar"),document.querySelectorAll(".shopify-section__blog-posts .block-list__item").forEach(function(item){item.classList.contains("1/2--lap-and-up")&&(item.classList.remove("1/2--lap-and-up"),item.classList.add("1/3--lap-and-up"))})):(document.querySelector(".blog-container").classList.remove("blog-container--without-sidebar"),document.querySelectorAll(".shopify-section__blog-posts .block-list__item").forEach(function(item){item.classList.contains("1/3--lap-and-up")&&(item.classList.remove("1/3--lap-and-up"),item.classList.add("1/2--lap-and-up"))}))}}]),BlogSidebarSection2}(),ProductSection=function(){function ProductSection2(element){var _this=this;if(_classCallCheck(this,ProductSection2),this.element=element,this.delegateElement=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.productGallery=new ProductGallery(this.element,this.options),this._initShopifyReviews(),this.options.isQuickView&&this.options.showPaymentButton&&window.Shopify.PaymentButton&&Shopify.PaymentButton.init(),this.productVariants=new ProductVariants(this.element,this.options),this.options.showShippingEstimator&&(this.shippingEstimator=new ShippingEstimator(this.element.querySelector(".shipping-estimator"),{singleProduct:!0})),this.options.showQuantitySelector){var quantityPickerElement=this.element.querySelector(".quantity-selector--product");quantityPickerElement&&(this.quantityPicker=new QuantityPicker(quantityPickerElement))}var productInfoElement=this.element.querySelector(".product-block-list__item--info .card");productInfoElement&&(this.element.querySelector(".product-block-list__wrapper").style.minHeight="".concat(productInfoElement.clientHeight,"px"),window.ResizeObserver&&(this.productInfoResizeObserver=new ResizeObserver(function(event2){event2[0].contentBoxSize?_this.element.querySelector(".product-block-list__wrapper").style.minHeight="".concat(event2[0].contentBoxSize.blockSize,"px"):_this.element.querySelector(".product-block-list__wrapper").style.minHeight="".concat(event2[0].contentRect.height,"px")}),this.productInfoResizeObserver.observe(productInfoElement)),this.options.infoOverflowScroll&&(this.infoOverflowScroller=new OverflowScroller(productInfoElement,{offsetTop:document.documentElement.style.getPropertyValue("--header-is-sticky")*parseInt(document.documentElement.style.getPropertyValue("--header-height")+30),offsetBottom:30}))),this._attachListeners()}return _createClass(ProductSection2,[{key:"onUnload",value:function(){this.productVariants.destroy(),this.productGallery.destroy(),this.options.showShippingEstimator&&this.shippingEstimator.destroy(),this.options.infoOverflowScroll&&this.infoOverflowScroller.destroy(),window.ResizeObserver&&this.productInfoResizeObserver&&this.productInfoResizeObserver.disconnect(),this.delegateElement.off(),this.element.removeEventListener("variant:changed",this._onVariantChangedListener)}},{key:"_attachListeners",value:function(){this._onVariantChangedListener=this._onVariantChanged.bind(this),this.element.addEventListener("variant:changed",this._onVariantChangedListener)}},{key:"_initShopifyReviews",value:function(){var _this2=this;Shopify.designMode&&window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges(),window.SPR.loadProducts()),window.SPRCallbacks={},window.SPRCallbacks.onFormSuccess=function(){_this2.element.querySelector("#shopify-product-reviews .spr-form").classList.add("spr-form-submitted")},this.options.isQuickView&&window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges(),this.options.showPaymentButton&&window.Shopify.PaymentButton&&Shopify.PaymentButton.init())}},{key:"_onVariantChanged",value:function(event2){this.productGallery.variantHasChanged(event2.detail.variant)}}]),ProductSection2}(),CartSection=function(){function CartSection2(element){_classCallCheck(this,CartSection2),this.element=element,this.domDelegate=new Delegate(this.element),this.delegateRoot=new Delegate(document.documentElement),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.options.showShippingEstimator&&(this.shippingEstimator=new ShippingEstimator(this.element.querySelector(".shipping-estimator"),{singleProduct:!1})),this._attachListeners(),this._enforceMinimumHeight()}return _createClass(CartSection2,[{key:"onUnload",value:function(){this.options.showShippingEstimator&&this.shippingEstimator.destroy()}},{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="add-to-cart"]',this._addToCart.bind(this)),this.domDelegate.on("click",'[data-action="save-note"]',this._saveNote.bind(this)),this.domDelegate.on("click",'[data-secondary-action="open-quick-view"]',this._openQuickView.bind(this)),this.delegateRoot.on("cart:rerendered",this._onCartRerendered.bind(this))}},{key:"_saveNote",value:function(){var noteValue=this.element.querySelector('[name="note"]').value;fetch("".concat(window.routes.cartUrl,"/update.js"),{body:JSON.stringify({note:noteValue}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}),this.element.querySelector(".cart-recap__note-edit").classList.toggle("is-visible",noteValue!==""),document.dispatchEvent(new CustomEvent("collapsible:toggle",{detail:{id:"order-note"}}))}},{key:"_addToCart",value:function(event2,target){var _this=this;if(window.theme.cartType!=="page"){event2.preventDefault(),event2.stopPropagation(),target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start")),console.log("carreto2");var formElement=target.closest('form[action*="/cart/add"]');fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(Form.serialize(formElement)),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){response.ok?(target.removeAttribute("disabled"),_this.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{variant:null,quantity:parseInt(formElement.querySelector('[name="quantity"]').value)}}))):target.removeAttribute("disabled")}),event2.preventDefault()}}},{key:"_openQuickView",value:function(event2,target){var modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),fetch("".concat(target.getAttribute("data-product-url"),"?view=quick-view"),{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content,modal.classList.remove("is-loading");var modalProductSection=new ProductSection(modal.querySelector('[data-section-type="product"]')),doCleanUp=function doCleanUp2(){modalProductSection.onUnload(),modal.removeEventListener("modal:closed",doCleanUp2)};modal.addEventListener("modal:closed",doCleanUp)})})}},{key:"_enforceMinimumHeight",value:function(){var cartWrapperElement=this.element.querySelector(".cart-wrapper"),cartRecapScrollerElement=this.element.querySelector(".cart-recap__scroller");if(cartWrapperElement&&cartRecapScrollerElement&&(cartWrapperElement.style.minHeight="".concat(cartRecapScrollerElement.clientHeight,"px"),window.ResizeObserver)){var resizeObserver=new ResizeObserver(function(entries){var _iterator=_createForOfIteratorHelper(entries),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var entry=_step.value;cartWrapperElement.style.minHeight="".concat(parseInt(entry.contentRect.height),"px")}}catch(err){_iterator.e(err)}finally{_iterator.f()}});resizeObserver.observe(cartRecapScrollerElement)}}},{key:"_onCartRerendered",value:function(){this.options.showShippingEstimator&&(this.shippingEstimator.destroy(),this.shippingEstimator=new ShippingEstimator(this.element.querySelector(".shipping-estimator"),{singleProduct:!1})),this._enforceMinimumHeight()}}]),CartSection2}(),CollectionListSection=function(){function CollectionListSection2(element){_classCallCheck(this,CollectionListSection2),this.element=element,this.flickityInstance=new js(this.element.querySelector(".collection-list"),{watchCSS:!0,prevNextButtons:!0,draggable:!window.matchMedia("(-moz-touch-enabled: 0), (hover: hover)").matches,pageDots:!1,cellAlign:"left",contain:!0,groupCells:!0})}return _createClass(CollectionListSection2,[{key:"onUnload",value:function(){this.flickityInstance.destroy()}},{key:"onBlockSelect",value:function(event2){this.flickityInstance.isActive&&this.flickityInstance.selectCell(parseInt(event2.target.getAttribute("data-collection-index")),null,event2.detail.load)}}]),CollectionListSection2}(),CollectionSection=function(){function CollectionSection2(element){_classCallCheck(this,CollectionSection2),this.element=element,this.delegateElement=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.collectionFilterTagElements=this.element.querySelectorAll("[data-tag]"),this.currentUrl=new URL(window.location.href),this.currentTags=this.options.currentTags,Shopify.designMode&&window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),this.mobileFilterDrawer=new CollectionFilterDrawer(this.options),this.displayByValuePicker=new ValuePicker("display-by-selector",{onValueSelect:this._showingCountChanged.bind(this)}),this.sortByValuePicker=new ValuePicker("sort-by-selector",{onValueSelect:this._sortByChanged.bind(this)}),this.productItemColorSwatch=new ProductItemColorSwatch(this.element),window.theme.pageType==="search"&&window.theme.searchMode!=="product"&&this._loadContentResults(),this._attachListeners()}return _createClass(CollectionSection2,[{key:"onUnload",value:function(){this.delegateElement.off(),this.mobileFilterDrawer.destroy(),this.displayByValuePicker.destroy(),this.sortByValuePicker.destroy(),this.productItemColorSwatch.destroy()}},{key:"onSelect",value:function(event2){Shopify.designMode&&event2.detail.load&&(this.element.querySelector('.collection__layout-button[data-layout-mode="'.concat(this.options.defaultLayout,'"]')).click(),this._showingCountChanged(this.options.defaultProductsPerPage))}},{key:"_attachListeners",value:function(){var _this=this;this.delegateElement.on("click",'[data-action="change-layout"]',this._changeLayout.bind(this)),this.delegateElement.on("change","#mobile-sort-by, #desktop-sort-by",this._sortByChanged.bind(this)),this.delegateElement.on("change","#showing-count",this._showingCountChanged.bind(this)),this.delegateElement.on("click",".pagination [data-page]",this._paginationPageChanged.bind(this)),this.delegateElement.on("click",'[data-action="toggle-tag"]',this._tagToggled.bind(this)),this.delegateElement.on("click",'[data-action="clear-tags"]',this._clearTags.bind(this)),this.delegateElement.on("click",'[data-secondary-action="open-quick-view"]',this._openQuickView.bind(this)),this.delegateElement.on("click",'[data-action="add-to-cart"]',this._addToCart.bind(this)),window.addEventListener("popstate",function(event2){event2.state.path&&(_this.currentUrl=new URL(event2.state.path),_this._reload(!1))})}},{key:"_openQuickView",value:function(event2,target){var productUrl=new URL("".concat(window.location.origin).concat(target.getAttribute("data-product-url")));if(Responsive.matchesBreakpoint("phone")||Responsive.matchesBreakpoint("tablet"))return window.location.href=productUrl.href,!1;var modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),productUrl.searchParams.set("view","quick-view"),fetch(productUrl.href,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content,typeof window.BOLD!="undefined"&&typeof window.BOLD.options!="undefined"&&typeof window.BOLD.options.app!="undefined"&&BOLD.options.app.unload(),modal.classList.remove("is-loading");var modalProductSection=new ProductSection(modal.querySelector('[data-section-type="product"]')),doCleanUp=function doCleanUp2(){modalProductSection.onUnload(),modal.removeEventListener("modal:closed",doCleanUp2)};modal.addEventListener("modal:closed",doCleanUp),typeof window.BOLD!="undefined"&&typeof window.BOLD.options!="undefined"&&typeof window.BOLD.options.app!="undefined"&&BOLD.options.app.boot()})})}},{key:"_changeLayout",value:function(event2,target){var _this2=this;if(!target.classList.contains("is-selected")){var newLayoutMode=target.getAttribute("data-layout-mode");fetch("".concat(window.routes.cartUrl,"/update.js"),{body:JSON.stringify({attributes:{collection_layout:newLayoutMode}}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}),fastdom.mutate(function(){Dom.getSiblings(target,".is-selected").forEach(function(button){return button.classList.remove("is-selected")}),target.classList.add("is-selected"),_this2.element.querySelectorAll(".product-item").forEach(function(item){newLayoutMode==="grid"?item.className="product-item product-item--vertical ".concat(_this2.options.gridClasses):item.className="product-item product-item--list"}),_this2.productItemColorSwatch.recalculateSwatches()})}}},{key:"_sortByChanged",value:function(value){this.currentUrl.searchParams.set("sort_by",value),this.currentUrl.searchParams.delete("page"),this._reload(!0)}},{key:"_showingCountChanged",value:function(value){var _this3=this;this.currentUrl.searchParams.delete("page"),fetch("".concat(window.routes.cartUrl,"/update.js"),{body:JSON.stringify({attributes:{collection_products_per_page:value}}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(){_this3._reload(!0)})}},{key:"_paginationPageChanged",value:function(event2,target){event2.preventDefault(),this.currentUrl.searchParams.set("page",parseInt(target.getAttribute("data-page"))),this._reload(!0)}},{key:"_tagToggled",value:function(event2,target){var _this4=this,newTag=target.getAttribute("data-tag"),hadTags=this.currentTags.length>0;if(this.currentTags.includes(newTag))this.currentTags=this.currentTags.filter(function(value){return value!==newTag});else if(this.options.filterType==="tag")this.currentTags=[newTag];else{var tagGroup=newTag.split("_")[0];this.currentTags.forEach(function(existingTag){existingTag.split("_")[0]===tagGroup&&(_this4.currentTags=_this4.currentTags.filter(function(value){return value!==existingTag}))}),this.currentTags.push(newTag)}this.currentUrl.searchParams.delete("page"),this._updateTagUrl(hadTags),this._reload(!0)}},{key:"_clearTags",value:function(){var hadTags=this.currentTags.length>0;this.currentTags=[],this.currentUrl.searchParams.delete("page"),this._updateTagUrl(hadTags),this._reload(!0).then(function(){document.dispatchEvent(new CustomEvent("collection-filter:close"))})}},{key:"_updateTagUrl",value:function(hadTags){var _this5=this;if(fastdom.mutate(function(){_this5.collectionFilterTagElements.forEach(function(tagElement){_this5.currentTags.includes(tagElement.getAttribute("data-tag"))?(tagElement.classList.add("is-selected"),tagElement.tagName==="INPUT"&&(tagElement.checked=!0)):(tagElement.classList.remove("is-selected"),tagElement.tagName==="INPUT"&&(tagElement.checked=!1)),$(".selected-filter").removeClass("selected-filter"),$(".is-selected").closest(".collection__filter-checkbox").addClass("selected-filter")})}),this.options.isAutomatic)this.currentTags.length===0?this.currentUrl.searchParams.delete("constraint"):this.currentUrl.searchParams.set("constraint",this.currentTags.join("+"));else{var tagPath=this.currentTags.join("+"),currentPathName=this.currentUrl.pathname.substr(-1)==="/"?this.currentUrl.pathname.substr(0,this.currentUrl.pathname.length-1):this.currentUrl.pathname;if(hadTags){var pathParts=currentPathName.split("/");pathParts.pop(),this.currentUrl.pathname="".concat(pathParts.join("/"),"/").concat(tagPath)}else this.currentUrl.pathname="".concat(currentPathName,"/").concat(tagPath)}}},{key:"_reload",value:function(pushState){var _this6=this;pushState&&window.history.pushState({path:this.currentUrl.toString()},"",this.currentUrl.toString()),document.dispatchEvent(new CustomEvent("theme:loading:start")),this.mobileFilterDrawer._filtersHaveChanged(this.currentTags);var computedStyles=window.getComputedStyle(document.documentElement),sectionUrl="";return this.currentUrl.search?sectionUrl="".concat(this.currentUrl.pathname,"/").concat(this.currentUrl.search,"§ion_id=").concat(this.element.getAttribute("data-section-id")):sectionUrl="".concat(this.currentUrl.pathname,"?section_id=").concat(this.element.getAttribute("data-section-id")),fetch(sectionUrl,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){var tempElement=document.createElement("div");tempElement.innerHTML=content,_this6.element.querySelector(".collection__dynamic-part").innerHTML=tempElement.querySelector(".collection__dynamic-part").innerHTML;var activeFilters=_this6.element.querySelector(".collection__active-filters");activeFilters&&(activeFilters.innerHTML=tempElement.querySelector(".collection__active-filters").innerHTML),window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),_this6.productItemColorSwatch.recalculateSwatches();var elementOffset=_this6.element.querySelector(".collection").getBoundingClientRect().top-25-parseInt(computedStyles.getPropertyValue("--header-is-sticky"))*parseInt(computedStyles.getPropertyValue("--header-height"));elementOffset<0&&window.scrollBy({top:elementOffset,behavior:"smooth"}),document.dispatchEvent(new CustomEvent("theme:loading:end"))})})}},{key:"_loadContentResults",value:function(){var _this7=this,currentUrl=new URL(window.location.href);fetch("".concat(window.routes.searchUrl,"?view=content&q=").concat(currentUrl.searchParams.get("q"),"&type=").concat(window.theme.searchMode.replace("product,","")),{credentials:"same-origin"}).then(function(response){response.text().then(function(content){var linkSearchResults=_this7.element.querySelector(".link-search-results");linkSearchResults&&content.trim()!==""&&(linkSearchResults.innerHTML=content,linkSearchResults.style.display="block")})})}},{key:"_addToCart",value:function(event2,target){var _this8=this;if(window.theme.cartType==="page")return;event2.preventDefault(),event2.stopPropagation(),target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start"));var stockCheck=!1,formProd=target.closest('form[action*="/cart/add"]'),productoData=buscarProductoInfoPorSku(Form.serialize(formProd).sku);fetchMTDCart(function(error,cart){if(error)console.error(error);else{var productId=Form.serialize(formProd).id,productExists=!1,productQuantity=0;cart.items.forEach(function(item){console.log("item.id: ",item.id),item.id===parseInt(productId)&&(productExists=!0,productQuantity=item.quantity)}),productExists?parseInt(productQuantity)0&&this._loadScript().then(this._initMaps.bind(this)),this._attachListeners()}return _createClass(MapSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.options.apiKey&&this.options.mapAddresses.length>0&&google.maps.event.clearInstanceListeners(window)}},{key:"onBlockSelect",value:function(event2){this._showStore(event2.target)}},{key:"_attachListeners",value:function(){var _this=this;this.delegateElement.on("click",'[data-action="toggle-store"]',function(event2,target){_this._showStore(target.closest(".map__store-item"))})}},{key:"_showStore",value:function(storeItem){var _this2=this,toggleButton=storeItem.querySelector('[data-action="toggle-store"]');if(!(Responsive.getCurrentBreakpoint()!=="phone"&&toggleButton.getAttribute("aria-expanded")==="true")){toggleButton.getAttribute("aria-expanded")==="true"?(toggleButton.setAttribute("aria-expanded","false"),Animation.slideUp(storeItem.querySelector(".map__store-collapsible"))):(toggleButton.setAttribute("aria-expanded","true"),Animation.slideDown(storeItem.querySelector(".map__store-collapsible"))),Dom.getSiblings(storeItem).forEach(function(storeItemToClose){storeItemToClose.querySelector('[data-action="toggle-store"]').setAttribute("aria-expanded","false"),Animation.slideUp(storeItemToClose.querySelector(".map__store-collapsible"))});var storeIndex=parseInt(storeItem.getAttribute("data-store-index"));this.desktopMapElement.panTo(this.mapPositions[storeIndex]),this.desktopMarkers.forEach(function(marker,index){marker.setMap(_this2.desktopMapElement),index===storeIndex?marker.icon.fillColor=_this2.options.markerActiveColor:marker.icon.fillColor=_this2.options.markerColor})}}},{key:"_loadScript",value:function(){var _this3=this;return new Promise(function(resolve,reject){var script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src="https://maps.googleapis.com/maps/api/js?key=".concat(_this3.options.apiKey)})}},{key:"_initMaps",value:function(){var _this4=this,mapOptions={zoom:this.options.zoom,draggable:this.options.draggableMap,clickableIcons:!1,scrollwheel:this.options.draggableMap,disableDoubleClickZoom:!0,disableDefaultUI:!this.options.showMapControls,styles:JSON.parse(this.element.querySelector("[data-gmap-style]").innerHTML)};this.desktopMapElement=new google.maps.Map(this.element.querySelector(".map__map-container--desktop .map__gmap"),mapOptions),this.mobileMapElements=[],this.element.querySelectorAll(".map__map-container--mobile .map__gmap").forEach(function(item,index){_this4.mobileMapElements[index]=new google.maps.Map(item,mapOptions)}),this._geocodeAddresses(),google.maps.event.addDomListener(window,"resize",function(){var desktopCenter=_this4.desktopMapElement.getCenter();google.maps.event.trigger(_this4.desktopMapElement,"resize"),_this4.desktopMapElement.setCenter(desktopCenter),_this4.mobileMapElements.forEach(function(mobileMap){var mobileCenter=mobileMap.getCenter();google.maps.event.trigger(mobileMap,"resize"),mobileMap.setCenter(mobileCenter)})})}},{key:"_onMarkerClicked",value:function(address){window.open("https://www.google.com/maps/search/?api=1&query=".concat(address),"_blank")}},{key:"_geocodeAddresses",value:function(){var _this5=this,geocoder=new google.maps.Geocoder;this.options.mapAddresses.forEach(function(address,index){geocoder.geocode({address:address},function(results,status){if(status!==google.maps.GeocoderStatus.OK)Shopify.designMode;else{var position=results[0].geometry.location;_this5.mapPositions[index]=position,_this5.desktopMarkers[index]=new google.maps.Marker({map:index===0?_this5.desktopMapElement:null,position:position,icon:{path:"M12.5,0 C6.388889,0 0,4.7304348 0,12.5217391 C0,19.8956522 11.111111,31.1652174 11.527778,31.5826087 C11.805556,31.8608696 12.083333,32 12.5,32 C12.916667,32 13.194444,31.8608696 13.472222,31.5826087 C13.888889,31.1652174 25,19.8956522 25,12.5217391 C25,4.7304348 18.611111,0 12.5,0 Z M12,16 C9.733333,16 8,14.2666667 8,12 C8,9.7333333 9.733333,8 12,8 C14.266667,8 16,9.7333333 16,12 C16,14.2666667 14.266667,16 12,16 Z",fillColor:index===0?_this5.options.markerActiveColor:_this5.options.markerColor,fillOpacity:1,anchor:new google.maps.Point(12,30),strokeWeight:0}}),_this5.mobileMarkers[index]=new google.maps.Marker({map:_this5.mobileMapElements[index],position:position,icon:{path:"M12.5,0 C6.388889,0 0,4.7304348 0,12.5217391 C0,19.8956522 11.111111,31.1652174 11.527778,31.5826087 C11.805556,31.8608696 12.083333,32 12.5,32 C12.916667,32 13.194444,31.8608696 13.472222,31.5826087 C13.888889,31.1652174 25,19.8956522 25,12.5217391 C25,4.7304348 18.611111,0 12.5,0 Z M12,16 C9.733333,16 8,14.2666667 8,12 C8,9.7333333 9.733333,8 12,8 C14.266667,8 16,9.7333333 16,12 C16,14.2666667 14.266667,16 12,16 Z",fillColor:_this5.options.markerActiveColor,fillOpacity:1,anchor:new google.maps.Point(12,30),strokeWeight:0}}),_this5.desktopMarkers[index].addListener("click",_this5._onMarkerClicked.bind(_this5,address)),_this5.mobileMarkers[index].addListener("click",_this5._onMarkerClicked.bind(_this5,address)),index===0&&_this5.desktopMapElement.setCenter(position),_this5.mobileMapElements[index].setCenter(position)}})})}}]),MapSection2}(),MinimalHeaderSection=function(){function MinimalHeaderSection2(element){_classCallCheck(this,MinimalHeaderSection2),this.element=element,this._setupCssVariables(),this._attachListeners()}return _createClass(MinimalHeaderSection2,[{key:"onUnload",value:function(){window.removeEventListener("resize",this._setupCssVariablesListener)}},{key:"_attachListeners",value:function(){this._setupCssVariablesListener=this._setupCssVariables.bind(this),window.addEventListener("resize",this._setupCssVariablesListener)}},{key:"_setupCssVariables",value:function(){document.documentElement.style.setProperty("--header-height",this.element.parentNode.clientHeight+"px")}}]),MinimalHeaderSection2}(),QuickLinksSection=function QuickLinksSection2(element){_classCallCheck(this,QuickLinksSection2),this.element=element,Shopify.designMode&&this.element.classList.remove("hidden-lap-and-up")},PopupsSection=function(){function PopupsSection2(element){var _this=this;_classCallCheck(this,PopupsSection2),element.querySelectorAll("[data-popup-type]").forEach(function(popup){popup.getAttribute("data-popup-type")==="exit"?_this.exitPopup=new ExitPopup(popup):popup.getAttribute("data-popup-type")==="newsletter"&&(_this.newsletterPopup=new NewsletterPopup(popup))})}return _createClass(PopupsSection2,[{key:"onUnload",value:function(){this.exitPopup&&this.exitPopup.destroy(),this.newsletterPopup&&this.newsletterPopup.destroy()}},{key:"onBlockSelect",value:function(event2){event2.target.getAttribute("data-popup-type")==="exit"&&this.exitPopup?this.exitPopup._openPopup():event2.target.getAttribute("data-popup-type")==="newsletter"&&this.newsletterPopup&&this.newsletterPopup._openPopup()}},{key:"onBlockDeselect",value:function(){this.exitPopup&&this.exitPopup._closePopup(),this.newsletterPopup&&this.newsletterPopup._closePopup()}}]),PopupsSection2}(),ProductRecommendationsSection=function(){function ProductRecommendationsSection2(element){_classCallCheck(this,ProductRecommendationsSection2),this.element=element,this.delegateElement=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.options.useRecommendations?this._loadRecommendations().then(this._createSlideshow.bind(this)):this._createSlideshow(),this.productItemColorSwatch=new ProductItemColorSwatch(this.element),this._fixSafari(),this._attachListeners()}return _createClass(ProductRecommendationsSection2,[{key:"onUnload",value:function(){this.options.stackable||this.flickityInstance.destroy(),window.removeEventListener("resize",this._fixSafariListener),this.delegateElement.off("change"),this.productItemColorSwatch.destroy(),this.resizeObserver&&this.resizeObserver.disconnect()}},{key:"_attachListeners",value:function(){this._fixSafariListener=this._fixSafari.bind(this),window.addEventListener("resize",this._fixSafariListener),this.delegateElement.on("click",'[data-action="add-to-cart"]',this._addToCart.bind(this)),this.delegateElement.on("click",'[data-secondary-action="open-quick-view"]',this._openQuickView.bind(this))}},{key:"_fixSafari",value:function(){var userAgent=window.navigator.userAgent.toLowerCase();if(userAgent.includes("safari")&&(userAgent.includes("version/10.1")||userAgent.includes("version/10.3")||userAgent.includes("version/11.0"))){var isPhone=Responsive.matchesBreakpoint("phone");this.element.querySelectorAll(".product-item__image-wrapper .aspect-ratio, .product-item__image-wrapper .placeholder-svg").forEach(function(image){isPhone?image.parentNode.style.height=null:image.parentNode.style.height="".concat(image.clientHeight,"px")})}}},{key:"_loadRecommendations",value:function(){var _this=this,url="".concat(window.routes.productRecommendationsUrl,"?section_id=product-recommendations&product_id=").concat(this.options.productId,"&limit=").concat(this.options.recommendationsCount);return fetch(url).then(function(response){return response.text().then(function(content){var container=document.createElement("div");container.innerHTML=content,_this.element.querySelector(".product-recommendations").innerHTML=container.querySelector(".product-recommendations").innerHTML,_this.productItemColorSwatch.recalculateSwatches()})})}},{key:"_createSlideshow",value:function(){var _this2=this;this.options.stackable||(this.flickityInstance=new js(this.element.querySelector(".product-list"),{watchCSS:!0,pageDots:!1,prevNextButtons:!0,contain:!0,groupCells:!0,cellAlign:"left",draggable:!window.matchMedia("(-moz-touch-enabled: 0), (hover: hover)").matches})),window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),window.ResizeObserver&&this.flickityInstance&&(this.resizeObserver=new ResizeObserver(function(){_this2.flickityInstance.resize()}),this.element.querySelectorAll(".product-item").forEach(function(item){_this2.resizeObserver.observe(item)}))}},{key:"_openQuickView",value:function(event2,target){var productUrl=new URL("".concat(window.location.origin).concat(target.getAttribute("data-product-url")));if(Responsive.matchesBreakpoint("phone")||Responsive.matchesBreakpoint("tablet"))return window.location.href=productUrl.href,!1;var modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),productUrl.searchParams.set("view","quick-view"),fetch(productUrl.href,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content,modal.classList.remove("is-loading");var modalProductSection=new ProductSection(modal.querySelector('[data-section-type="product"]')),doCleanUp=function doCleanUp2(){modalProductSection.onUnload(),modal.removeEventListener("modal:closed",doCleanUp2)};modal.addEventListener("modal:closed",doCleanUp)})})}},{key:"_addToCart",value:function(event2,target){var _this3=this;if(window.theme.cartType!=="page"){event2.preventDefault(),event2.stopPropagation(),target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start"));var formElement=target.closest('form[action*="/cart/add"]');fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(Form.serialize(formElement)),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){target.removeAttribute("disabled"),response.ok?_this3.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{variant:null,quantity:parseInt(formElement.querySelector('[name="quantity"]').value)}})):document.dispatchEvent(new CustomEvent("theme:loading:end"))}),event2.preventDefault()}}}]),ProductRecommendationsSection2}(),RecentlyViewedProductsSection=function(){function RecentlyViewedProductsSection2(element){_classCallCheck(this,RecentlyViewedProductsSection2),this.element=element,this.delegateElement=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this.options.currentProductId&&this._saveCurrentProduct(),this.productItemColorSwatch=new ProductItemColorSwatch(this.element),this._fetchProducts(),this._attachListeners()}return _createClass(RecentlyViewedProductsSection2,[{key:"onUnload",value:function(){this.flickityInstance&&this.flickityInstance.destroy(),this.productItemColorSwatch.destroy(),this.resizeObserver&&this.resizeObserver.disconnect()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="add-to-cart"]',this._addToCart.bind(this)),this.delegateElement.on("click",'[data-secondary-action="open-quick-view"]',this._openQuickView.bind(this))}},{key:"_saveCurrentProduct",value:function(){var items=JSON.parse(localStorage.getItem("recentlyViewedProducts")||"[]"),currentProductId=this.options.currentProductId;items.includes(currentProductId)||items.unshift(currentProductId);try{localStorage.setItem("recentlyViewedProducts",JSON.stringify(items.slice(0,18)))}catch(error){}}},{key:"_fetchProducts",value:function(){var _this=this,queryString=this._getSearchQueryString();if(queryString!==""){var template=window.theme.pageType==="index"?"recently-viewed-products":"static-recently-viewed-products";fetch("".concat(window.routes.searchUrl,"?view=").concat(template,"&type=product&q=").concat(queryString),{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){var tempElement=document.createElement("div");tempElement.innerHTML=content,_this.element.querySelector(".recently-viewed-products-placeholder").innerHTML=tempElement.querySelector('[data-section-type="recently-viewed-products"] .recently-viewed-products-placeholder').innerHTML,_this.element.parentNode.style.display="block",_this.productItemColorSwatch.recalculateSwatches(),window.SPR&&(window.SPR.initDomEls(),window.SPR.loadBadges()),_this.flickityInstance=new js(_this.element.querySelector(".product-list"),{watchCSS:!0,pageDots:!1,prevNextButtons:!0,contain:!0,groupCells:!0,cellAlign:"left",draggable:!window.matchMedia("(-moz-touch-enabled: 0), (hover: hover)").matches}),window.ResizeObserver&&_this.flickityInstance&&(_this.resizeObserver=new ResizeObserver(function(){_this.flickityInstance.resize()}),_this.element.querySelectorAll(".product-item").forEach(function(item){_this.resizeObserver.observe(item)}))})})}}},{key:"_getSearchQueryString",value:function(){var items=JSON.parse(localStorage.getItem("recentlyViewedProducts")||"[]");return items.includes(this.options.currentProductId)&&items.splice(items.indexOf(this.options.currentProductId),1),items.map(function(item){return"id:"+item}).join(" OR ")}},{key:"_openQuickView",value:function(event2,target){var productUrl=new URL("".concat(window.location.origin).concat(target.getAttribute("data-product-url")));if(Responsive.matchesBreakpoint("phone")||Responsive.matchesBreakpoint("tablet"))return window.location.href=productUrl.href,!1;var modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),productUrl.searchParams.set("view","quick-view"),fetch(productUrl.href,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content,modal.classList.remove("is-loading");var modalProductSection=new ProductSection(modal.querySelector('[data-section-type="product"]')),doCleanUp=function doCleanUp2(){modalProductSection.onUnload(),modal.removeEventListener("modal:closed",doCleanUp2)};modal.addEventListener("modal:closed",doCleanUp)})})}},{key:"_addToCart",value:function(event2,target){var _this2=this;if(window.theme.cartType!=="page"){event2.preventDefault(),event2.stopPropagation(),target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start"));var formElement=target.closest('form[action*="/cart/add"]');fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(Form.serialize(formElement)),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){target.removeAttribute("disabled"),response.ok?_this2.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{variant:null,quantity:parseInt(formElement.querySelector('[name="quantity"]').value)}})):document.dispatchEvent(new CustomEvent("theme:loading:end"))}),event2.preventDefault()}}}]),RecentlyViewedProductsSection2}(),SectionContainer=function(){function SectionContainer2(){_classCallCheck(this,SectionContainer2),this.constructors=[],this.instances=[],this._attachListeners()}return _createClass(SectionContainer2,[{key:"_attachListeners",value:function(){document.addEventListener("shopify:section:load",this._onSectionLoad.bind(this)),document.addEventListener("shopify:section:unload",this._onSectionUnload.bind(this)),document.addEventListener("shopify:section:select",this._onSelect.bind(this)),document.addEventListener("shopify:section:deselect",this._onDeselect.bind(this)),document.addEventListener("shopify:section:reorder",this._onReorder.bind(this)),document.addEventListener("shopify:block:select",this._onBlockSelect.bind(this)),document.addEventListener("shopify:block:deselect",this._onBlockDeselect.bind(this))}},{key:"register",value:function(type,constructor){var _this=this;this.constructors[type]=constructor,document.querySelectorAll("[data-section-type=".concat(type,"]")).forEach(function(container){_this._createInstance(container,constructor)})}},{key:"_findInstance",value:function(array,key,value){for(var i=0;i1",fade:this.options.transitionEffect==="fade",setGallerySize:this.options.setGallerySize,adaptiveHeight:this.options.adaptiveHeight,autoPlay:this.options.autoPlay?this.options.cycleSpeed:!1})}return _createClass(SlideshowSection2,[{key:"onUnload",value:function(){this.flickityInstance.destroy()}},{key:"onBlockSelect",value:function(event2){this.flickityInstance.isActive&&(this.flickityInstance.selectCell(parseInt(event2.target.getAttribute("data-block-index")),!1,event2.detail.load),this.flickityInstance.pausePlayer())}},{key:"onBlockDeselect",value:function(){this.flickityInstance.isActive&&this.flickityInstance.unpausePlayer()}}]),SlideshowSection2}(),TextWithIconsSection=function(){function TextWithIconsSection2(element){_classCallCheck(this,TextWithIconsSection2)}return _createClass(TextWithIconsSection2,[{key:"onUnload",value:function(){this.flickityInstance.destroy()}},{key:"onBlockSelect",value:function(event2){this.flickityInstance.isActive&&(this.flickityInstance.selectCell(parseInt(event2.target.getAttribute("data-block-index")),!1,event2.detail.load),this.flickityInstance.pausePlayer())}},{key:"onBlockDeselect",value:function(){this.flickityInstance.isActive&&this.flickityInstance.unpausePlayer()}}]),TextWithIconsSection2}(),VideoSection=function(){function VideoSection2(element){_classCallCheck(this,VideoSection2),this.element=element,this.domDelegate=new Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")),this._attachListeners()}return _createClass(VideoSection2,[{key:"onUnload",value:function(){this.domDelegate.off("click")}},{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="play-video"]',this._playVideo.bind(this))}},{key:"_playVideo",value:function(event2,target){var iframe=target.querySelector("iframe");iframe.src=iframe.getAttribute("data-src"),target.classList.add("is-playing")}}]),VideoSection2}(),smoothscroll=createCommonjsModule(function(module,exports){(function(){function polyfill(){var w=window,d=document;if("scrollBehavior"in d.documentElement.style&&w.__forceSmoothScrollPolyfill__!==!0)return;var Element2=w.HTMLElement||w.Element,SCROLL_TIME=468,original={scroll:w.scroll||w.scrollTo,scrollBy:w.scrollBy,elementScroll:Element2.prototype.scroll||scrollElement,scrollIntoView:Element2.prototype.scrollIntoView},now=w.performance&&w.performance.now?w.performance.now.bind(w.performance):Date.now;function isMicrosoftBrowser(userAgent){var userAgentPatterns=["MSIE ","Trident/","Edge/"];return new RegExp(userAgentPatterns.join("|")).test(userAgent)}var ROUNDING_TOLERANCE=isMicrosoftBrowser(w.navigator.userAgent)?1:0;function scrollElement(x,y){this.scrollLeft=x,this.scrollTop=y}function ease(k){return .5*(1-Math.cos(Math.PI*k))}function shouldBailOut(firstArg){if(firstArg===null||_typeof(firstArg)!=="object"||firstArg.behavior===void 0||firstArg.behavior==="auto"||firstArg.behavior==="instant")return!0;if(_typeof(firstArg)==="object"&&firstArg.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+firstArg.behavior+" is not a valid value for enumeration ScrollBehavior.")}function hasScrollableSpace(el,axis){if(axis==="Y")return el.clientHeight+ROUNDING_TOLERANCE1?1:elapsed,value=ease(elapsed),currentX=context.startX+(context.x-context.startX)*value,currentY=context.startY+(context.y-context.startY)*value,context.method.call(context.scrollable,currentX,currentY),(currentX!==context.x||currentY!==context.y)&&w.requestAnimationFrame(step.bind(w,context))}function smoothScroll(el,x,y){var scrollable,startX,startY,method,startTime=now();el===d.body?(scrollable=w,startX=w.scrollX||w.pageXOffset,startY=w.scrollY||w.pageYOffset,method=original.scroll):(scrollable=el,startX=el.scrollLeft,startY=el.scrollTop,method=scrollElement),step({scrollable:scrollable,method:method,startTime:startTime,startX:startX,startY:startY,x:x,y:y})}w.scroll=w.scrollTo=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){original.scroll.call(w,arguments[0].left!==void 0?arguments[0].left:_typeof(arguments[0])!=="object"?arguments[0]:w.scrollX||w.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:w.scrollY||w.pageYOffset);return}smoothScroll.call(w,d.body,arguments[0].left!==void 0?~~arguments[0].left:w.scrollX||w.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:w.scrollY||w.pageYOffset)}},w.scrollBy=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])){original.scrollBy.call(w,arguments[0].left!==void 0?arguments[0].left:_typeof(arguments[0])!=="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}smoothScroll.call(w,d.body,~~arguments[0].left+(w.scrollX||w.pageXOffset),~~arguments[0].top+(w.scrollY||w.pageYOffset))}},Element2.prototype.scroll=Element2.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");original.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:_typeof(arguments[0])!=="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}var left=arguments[0].left,top=arguments[0].top;smoothScroll.call(this,this,typeof left=="undefined"?this.scrollLeft:~~left,typeof top=="undefined"?this.scrollTop:~~top)}},Element2.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){original.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},Element2.prototype.scrollIntoView=function(){if(shouldBailOut(arguments[0])===!0){original.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}var scrollableParent=findScrollableParent(this),parentRects=scrollableParent.getBoundingClientRect(),clientRects=this.getBoundingClientRect();scrollableParent!==d.body?(smoothScroll.call(this,scrollableParent,scrollableParent.scrollLeft+clientRects.left-parentRects.left,scrollableParent.scrollTop+clientRects.top-parentRects.top),w.getComputedStyle(scrollableParent).position!=="fixed"&&w.scrollBy({left:parentRects.left,top:parentRects.top,behavior:"smooth"})):w.scrollBy({left:clientRects.left,top:clientRects.top,behavior:"smooth"})}}module.exports={polyfill:polyfill}})()});/*! instant.page v5.1.0 - (C) 2019-2020 Alexandre Dieulot - https://instant.page/license */var mouseoverTimer,lastTouchTimestamp,prefetches=new Set,prefetchElement=document.createElement("link"),isSupported=prefetchElement.relList&&prefetchElement.relList.supports&&prefetchElement.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype,allowQueryString="instantAllowQueryString"in document.body.dataset,allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,useWhitelist="instantWhitelist"in document.body.dataset,mousedownShortcut="instantMousedownShortcut"in document.body.dataset,DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION=1111,delayOnHover=65,useMousedown=!1,useMousedownOnly=!1,useViewport=!1;if("instantIntensity"in document.body.dataset){var intensity=document.body.dataset.instantIntensity;if(intensity.substr(0,9)=="mousedown")useMousedown=!0,intensity=="mousedown-only"&&(useMousedownOnly=!0);else if(intensity.substr(0,8)=="viewport")navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g"))||(intensity=="viewport"?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(useViewport=!0):intensity=="viewport-all"&&(useViewport=!0));else{var milliseconds=parseInt(intensity);isNaN(milliseconds)||(delayOnHover=milliseconds)}}if(isSupported){var eventListenersOptions={capture:!0,passive:!0};if(useMousedownOnly||document.addEventListener("touchstart",touchstartListener,eventListenersOptions),useMousedown?mousedownShortcut||document.addEventListener("mousedown",mousedownListener,eventListenersOptions):document.addEventListener("mouseover",mouseoverListener,eventListenersOptions),mousedownShortcut&&document.addEventListener("mousedown",mousedownShortcutListener,eventListenersOptions),useViewport){var triggeringFunction;window.requestIdleCallback?triggeringFunction=function(callback){requestIdleCallback(callback,{timeout:1500})}:triggeringFunction=function(callback){callback()},triggeringFunction(function(){var intersectionObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var linkElement=entry.target;intersectionObserver.unobserve(linkElement),preload(linkElement.href)}})});document.querySelectorAll("a").forEach(function(linkElement){isPreloadable(linkElement)&&intersectionObserver.observe(linkElement)})})}}function touchstartListener(event2){lastTouchTimestamp=performance.now();var linkElement=event2.target.closest("a");isPreloadable(linkElement)&&preload(linkElement.href)}function mouseoverListener(event2){if(!(performance.now()-lastTouchTimestamp1||event2.metaKey||event2.ctrlKey)&&linkElement){linkElement.addEventListener("click",function(event3){event3.detail!=1337&&event3.preventDefault()},{capture:!0,passive:!1,once:!0});var customEvent=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});linkElement.dispatchEvent(customEvent)}}}function isPreloadable(linkElement){if(!(!linkElement||!linkElement.href)&&!(useWhitelist&&!("instant"in linkElement.dataset))&&!(!allowExternalLinks&&linkElement.origin!=location.origin&&!("instant"in linkElement.dataset))&&["http:","https:"].includes(linkElement.protocol)&&!(linkElement.protocol=="http:"&&location.protocol=="https:")&&!(!allowQueryString&&linkElement.search&&!("instant"in linkElement.dataset))&&!(linkElement.hash&&linkElement.pathname+linkElement.search==location.pathname+location.search)&&!("noInstant"in linkElement.dataset))return!0}function preload(url){if(!prefetches.has(url)){var prefetcher=document.createElement("link");prefetcher.rel="prefetch",prefetcher.href=url,document.head.appendChild(prefetcher),prefetches.add(url)}}var lazysizes=createCommonjsModule(function(module){(function(window2,factory){var lazySizes=factory(window2,window2.document,Date);window2.lazySizes=lazySizes,module.exports&&(module.exports=lazySizes)})(typeof window!="undefined"?window:{},function(window2,document2,Date2){var lazysizes2,lazySizesCfg;if(function(){var prop,lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults)prop in lazySizesCfg||(lazySizesCfg[prop]=lazySizesDefaults[prop])}(),!document2||!document2.getElementsByClassName)return{init:function(){},cfg:lazySizesCfg,noSupport:!0};var docElem=document2.documentElement,supportPicture=window2.HTMLPictureElement,_addEventListener="addEventListener",_getAttribute="getAttribute",addEventListener2=window2[_addEventListener].bind(window2),setTimeout2=window2.setTimeout,requestAnimationFrame2=window2.requestAnimationFrame||setTimeout2,requestIdleCallback2=window2.requestIdleCallback,regPicture=/^picture$/i,loadEvents=["load","error","lazyincluded","_lazyloaded"],regClassCache={},forEach=Array.prototype.forEach,hasClass=function(ele,cls){return regClassCache[cls]||(regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")),regClassCache[cls].test(ele[_getAttribute]("class")||"")&®ClassCache[cls]},addClass=function(ele,cls){hasClass(ele,cls)||ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)},removeClass=function(ele,cls){var reg;(reg=hasClass(ele,cls))&&ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg," "))},addRemoveLoadEvents=function addRemoveLoadEvents2(dom,fn,add){var action=add?_addEventListener:"removeEventListener";add&&addRemoveLoadEvents2(dom,fn),loadEvents.forEach(function(evt){dom[action](evt,fn)})},triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event2=document2.createEvent("Event");return detail||(detail={}),detail.instance=lazysizes2,event2.initEvent(name,!noBubbles,!noCancelable),event2.detail=detail,elem.dispatchEvent(event2),event2},updatePolyfill=function(el,full){var polyfill;!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)?(full&&full.src&&!el[_getAttribute]("srcset")&&el.setAttribute("srcset",full.src),polyfill({reevaluate:!0,elements:[el]})):full&&full.src&&(el.src=full.src)},getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]},getWidth=function(elem,parent,width){for(width=width||elem.offsetWidth;width49?function(){requestIdleCallback2(run,{timeout:rICTimeout}),rICTimeout!==lazySizesCfg.ricTimeout&&(rICTimeout=lazySizesCfg.ricTimeout)}:rAFIt(function(){setTimeout2(run)},!0);return function(isPriority){var delay;(isPriority=isPriority===!0)&&(rICTimeout=33),!running&&(running=!0,delay=gDelay-(Date2.now()-lastTime),delay<0&&(delay=0),isPriority||delay<9?idleCallback():setTimeout2(idleCallback,delay))}},debounce=function(func){var timeout,timestamp,wait=99,run=function(){timeout=null,func()},later=function later2(){var last=Date2.now()-timestamp;last0,visible&&getCSS(parent,"overflow")!="visible"&&(outerRect=parent.getBoundingClientRect(),visible=eLright>outerRect.left&&eLleftouterRect.top-1&&eLtop500&&docElem.clientWidth>500?500:370:lazySizesCfg.expand,lazysizes2._defEx=defaultExpand,preloadExpand=defaultExpand*lazySizesCfg.expFactor,hFac=lazySizesCfg.hFac,isBodyHidden=null,currentExpand2&&loadMode>2&&!document2.hidden?(currentExpand=preloadExpand,lowRuns=0):loadMode>1&&lowRuns>1&&isLoading<6?currentExpand=defaultExpand:currentExpand=shrinkExpand),beforeExpandVal!==elemExpand&&(eLvW=innerWidth+elemExpand*hFac,elvH=innerHeight+elemExpand,elemNegativeExpand=elemExpand*-1,beforeExpandVal=elemExpand),rect=lazyloadElems[i].getBoundingClientRect(),(eLbottom=rect.bottom)>=elemNegativeExpand&&(eLtop=rect.top)<=elvH&&(eLright=rect.right)>=elemNegativeExpand*hFac&&(eLleft=rect.left)<=eLvW&&(eLbottom||eLright||eLleft||eLtop)&&(lazySizesCfg.loadHidden||isVisible(lazyloadElems[i]))&&(isCompleted&&isLoading<3&&!elemExpandVal&&(loadMode<3||lowRuns<4)||isNestedVisible(lazyloadElems[i],elemExpand))){if(unveilElement(lazyloadElems[i]),loadedSomething=!0,isLoading>9)break}else!loadedSomething&&isCompleted&&!autoLoadElem&&isLoading<4&&lowRuns<4&&loadMode>2&&(preloadElems[0]||lazySizesCfg.preloadAfterLoad)&&(preloadElems[0]||!elemExpandVal&&(eLbottom||eLright||eLleft||eLtop||lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr)!="auto"))&&(autoLoadElem=preloadElems[0]||lazyloadElems[i])}autoLoadElem&&!loadedSomething&&unveilElement(autoLoadElem)}},throttledCheckElements=throttle(checkElements),switchLoadingClass=function(e){var elem=e.target;if(elem._lazyCache){delete elem._lazyCache;return}resetPreloading(e),addClass(elem,lazySizesCfg.loadedClass),removeClass(elem,lazySizesCfg.loadingClass),addRemoveLoadEvents(elem,rafSwitchLoadingClass),triggerEvent(elem,"lazyloaded")},rafedSwitchLoadingClass=rAFIt(switchLoadingClass),rafSwitchLoadingClass=function(e){rafedSwitchLoadingClass({target:e.target})},changeIframeSrc=function(elem,src){try{elem.contentWindow.location.replace(src)}catch(e){elem.src=src}},handleSources=function(source){var customMedia,sourceSrcset=source[_getAttribute](lazySizesCfg.srcsetAttr);(customMedia=lazySizesCfg.customMedia[source[_getAttribute]("data-media")||source[_getAttribute]("media")])&&source.setAttribute("media",customMedia),sourceSrcset&&source.setAttribute("srcset",sourceSrcset)},lazyUnveil=rAFIt(function(elem,detail,isAuto,sizes,isImg){var src,srcset,parent,isPicture,event2,firesLoad;(event2=triggerEvent(elem,"lazybeforeunveil",detail)).defaultPrevented||(sizes&&(isAuto?addClass(elem,lazySizesCfg.autosizesClass):elem.setAttribute("sizes",sizes)),srcset=elem[_getAttribute](lazySizesCfg.srcsetAttr),src=elem[_getAttribute](lazySizesCfg.srcAttr),isImg&&(parent=elem.parentNode,isPicture=parent&®Picture.test(parent.nodeName||"")),firesLoad=detail.firesLoad||"src"in elem&&(srcset||src||isPicture),event2={target:elem},addClass(elem,lazySizesCfg.loadingClass),firesLoad&&(clearTimeout(resetPreloadingTimer),resetPreloadingTimer=setTimeout2(resetPreloading,2500),addRemoveLoadEvents(elem,rafSwitchLoadingClass,!0)),isPicture&&forEach.call(parent.getElementsByTagName("source"),handleSources),srcset?elem.setAttribute("srcset",srcset):src&&!isPicture&&(regIframe.test(elem.nodeName)?changeIframeSrc(elem,src):elem.src=src),isImg&&(srcset||isPicture)&&updatePolyfill(elem,{src:src})),elem._lazyRace&&delete elem._lazyRace,removeClass(elem,lazySizesCfg.lazyClass),rAF(function(){var isLoaded=elem.complete&&elem.naturalWidth>1;(!firesLoad||isLoaded)&&(isLoaded&&addClass(elem,"ls-is-cached"),switchLoadingClass(event2),elem._lazyCache=!0,setTimeout2(function(){"_lazyCache"in elem&&delete elem._lazyCache},9)),elem.loading=="lazy"&&isLoading--},!0)}),unveilElement=function(elem){if(!elem._lazyRace){var detail,isImg=regImg.test(elem.nodeName),sizes=isImg&&(elem[_getAttribute](lazySizesCfg.sizesAttr)||elem[_getAttribute]("sizes")),isAuto=sizes=="auto";(isAuto||!isCompleted)&&isImg&&(elem[_getAttribute]("src")||elem.srcset)&&!elem.complete&&!hasClass(elem,lazySizesCfg.errorClass)&&hasClass(elem,lazySizesCfg.lazyClass)||(detail=triggerEvent(elem,"lazyunveilread").detail,isAuto&&autoSizer.updateElem(elem,!0,elem.offsetWidth),elem._lazyRace=!0,isLoading++,lazyUnveil(elem,detail,isAuto,sizes,isImg))}},afterScroll=debounce(function(){lazySizesCfg.loadMode=3,throttledCheckElements()}),altLoadmodeScrollListner=function(){lazySizesCfg.loadMode==3&&(lazySizesCfg.loadMode=2),afterScroll()},onload=function onload2(){if(!isCompleted){if(Date2.now()-started<999){setTimeout2(onload2,999);return}isCompleted=!0,lazySizesCfg.loadMode=3,throttledCheckElements(),addEventListener2("scroll",altLoadmodeScrollListner,!0)}};return{_:function(){started=Date2.now(),lazysizes2.elements=document2.getElementsByClassName(lazySizesCfg.lazyClass),preloadElems=document2.getElementsByClassName(lazySizesCfg.lazyClass+" "+lazySizesCfg.preloadClass),addEventListener2("scroll",throttledCheckElements,!0),addEventListener2("resize",throttledCheckElements,!0),addEventListener2("pageshow",function(e){if(e.persisted){var loadingElements=document2.querySelectorAll("."+lazySizesCfg.loadingClass);loadingElements.length&&loadingElements.forEach&&requestAnimationFrame2(function(){loadingElements.forEach(function(img){img.complete&&unveilElement(img)})})}}),window2.MutationObserver?new MutationObserver(throttledCheckElements).observe(docElem,{childList:!0,subtree:!0,attributes:!0}):(docElem[_addEventListener]("DOMNodeInserted",throttledCheckElements,!0),docElem[_addEventListener]("DOMAttrModified",throttledCheckElements,!0),setInterval(throttledCheckElements,999)),addEventListener2("hashchange",throttledCheckElements,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(name){document2[_addEventListener](name,throttledCheckElements,!0)}),/d$|^c/.test(document2.readyState)?onload():(addEventListener2("load",onload),document2[_addEventListener]("DOMContentLoaded",throttledCheckElements),setTimeout2(onload,2e4)),lazysizes2.elements.length?(checkElements(),rAF._lsFlush()):throttledCheckElements()},checkElems:throttledCheckElements,unveil:unveilElement,_aLSL:altLoadmodeScrollListner}}(),autoSizer=function(){var autosizesElems,sizeElement=rAFIt(function(elem,parent,event2,width){var sources,i,len;if(elem._lazysizesWidth=width,width+="px",elem.setAttribute("sizes",width),regPicture.test(parent.nodeName||""))for(sources=parent.getElementsByTagName("source"),i=0,len=sources.length;i30&&(i+=1),width=36*i,widths.push(width)}(riasCfg.widths));for(prop in riasDefaults)prop in riasCfg||(riasCfg[prop]=riasDefaults[prop])})();function getElementOptions(elem,src){var attr,parent,setOption,options,elemStyles=window2.getComputedStyle(elem);parent=elem.parentNode,options={isPicture:!!(parent&®Picture.test(parent.nodeName||""))},setOption=function(attr2,run){var attrVal=elem.getAttribute("data-"+attr2);if(!attrVal){var styles=elemStyles.getPropertyValue("--ls-"+attr2);styles&&(attrVal=styles.trim())}if(attrVal){if(attrVal=="true")attrVal=!0;else if(attrVal=="false")attrVal=!1;else if(regNumber.test(attrVal))attrVal=parseFloat(attrVal);else if(typeof riasCfg[attr2]=="function")attrVal=riasCfg[attr2](elem,attrVal);else if(regObj.test(attrVal))try{attrVal=JSON.parse(attrVal)}catch(e){}options[attr2]=attrVal}else attr2 in riasCfg&&typeof riasCfg[attr2]!="function"?options[attr2]=riasCfg[attr2]:run&&typeof riasCfg[attr2]=="function"&&(options[attr2]=riasCfg[attr2](elem,attrVal))};for(attr in riasCfg)setOption(attr);return src.replace(regPlaceholder,function(full,match){match in options||setOption(match,!0)}),options}function replaceUrlProps(url,options){var candidates=[],replaceFn=function(full,match){return replaceTypes[_typeof(options[match])]?options[match]:full};return candidates.srcset=[],options.absUrl&&(anchor.setAttribute("href",url),url=anchor.href),url=((options.prefix||"")+url+(options.postfix||"")).replace(regPlaceholder,replaceFn),options.widths.forEach(function(width){var widthAlias=options.widthmap[width]||width,ratio=options.aspectratio||options.ratio,traditionalRatio=!options.aspectratio&&riasCfg.traditionalRatio,candidate={u:url.replace(regWidth,widthAlias).replace(regHeight,ratio?Math.round(traditionalRatio?width*ratio:width/ratio):""),w:width};candidates.push(candidate),candidates.srcset.push(candidate.c=candidate.u+" "+width+"w")}),candidates}function setSrc(src,opts,elem){var elemW=0,elemH=0,sizeElement=elem;if(src){if(opts.ratio==="container"){for(elemW=sizeElement.scrollWidth,elemH=sizeElement.scrollHeight;(!elemW||!elemH)&&sizeElement!==document2;)sizeElement=sizeElement.parentNode,elemW=sizeElement.scrollWidth,elemH=sizeElement.scrollHeight;elemW&&elemH&&(opts.ratio=opts.traditionalRatio?elemH/elemW:elemW/elemH)}src=replaceUrlProps(src,opts),src.isPicture=opts.isPicture,buggySizes&&elem.nodeName.toUpperCase()=="IMG"?elem.removeAttribute(config.srcsetAttr):elem.setAttribute(config.srcsetAttr,src.srcset.join(", ")),Object.defineProperty(elem,"_lazyrias",{value:src,writable:!0})}}function createAttrObject(elem,src){var opts=getElementOptions(elem,src);return riasCfg.modifyOptions.call(elem,{target:elem,details:opts,detail:opts}),lazySizes.fire(elem,"lazyriasmodifyoptions",opts),opts}function getSrc(elem){return elem.getAttribute(elem.getAttribute("data-srcattr")||riasCfg.srcAttr)||elem.getAttribute(config.srcsetAttr)||elem.getAttribute(config.srcAttr)||elem.getAttribute("data-pfsrcset")||""}addEventListener("lazybeforesizes",function(e){if(e.detail.instance==lazySizes){var elem,src,elemOpts,parent,sources,i,len,sourceSrc,sizes,detail,hasPlaceholder,modified,emptyList;if(elem=e.target,!(!e.detail.dataAttr||e.defaultPrevented||riasCfg.disabled||!((sizes=elem.getAttribute(config.sizesAttr)||elem.getAttribute("sizes"))&®AllowedSizes.test(sizes)))){if(src=getSrc(elem),elemOpts=createAttrObject(elem,src),hasPlaceholder=regWidth.test(elemOpts.prefix)||regWidth.test(elemOpts.postfix),elemOpts.isPicture&&(parent=elem.parentNode))for(sources=parent.getElementsByTagName("source"),i=0,len=sources.length;i=srces.d){!candidate.cached&&(lowerCandidate=srces[i-1])&&lowerCandidate.d>srces.d-.13*Math.pow(srces.d,2.2)&&(bonusFactor=Math.pow(lowerCandidate.d-.6,1.6),lowerCandidate.cached&&(lowerCandidate.d+=.15*bonusFactor),lowerCandidate.d+(candidate.d-srces.d)*bonusFactor>srces.d&&(candidate=lowerCandidate));break}return candidate},getWSet=function(elem,testPicture){var src;return!elem._lazyrias&&lazySizes.pWS&&(src=lazySizes.pWS(elem.getAttribute(config.srcsetAttr||""))).length&&(Object.defineProperty(elem,"_lazyrias",{value:src,writable:!0}),testPicture&&elem.parentNode&&(src.isPicture=elem.parentNode.nodeName.toUpperCase()=="PICTURE")),elem._lazyrias},getX=function(elem){var dpr=window2.devicePixelRatio||1,optimum=lazySizes.getX&&lazySizes.getX(elem);return Math.min(optimum||dpr,2.4,dpr)},getCandidate=function(elem,width){var sources,i,len,media,srces,src;if(srces=elem._lazyrias,srces.isPicture&&window2.matchMedia){for(i=0,sources=elem.parentNode.getElementsByTagName("source"),len=sources.length;ielem._lazysizesWidth)&&(elem._lazysizesWidth=width),elem._lazysizesWidth},getBgSize=function(elem){var bgSize;return bgSize=(getComputedStyle(elem)||{getPropertyValue:function(){}}).getPropertyValue("background-size"),!allowedBackgroundSize[bgSize]&&allowedBackgroundSize[elem.style.backgroundSize]&&(bgSize=elem.style.backgroundSize),bgSize},setTypeOrMedia=function(source,match){if(match){var typeMatch=match.match(regType);typeMatch&&typeMatch[1]?source.setAttribute("type",typeMatch[1]):source.setAttribute("media",lazySizesCfg.customMedia[match]||match)}},createPicture=function(sets,elem,img){var picture=document2.createElement("picture"),sizes=elem.getAttribute(lazySizesCfg.sizesAttr),ratio=elem.getAttribute("data-ratio"),optimumx=elem.getAttribute("data-optimumx");elem._lazybgset&&elem._lazybgset.parentNode==elem&&elem.removeChild(elem._lazybgset),Object.defineProperty(img,"_lazybgset",{value:elem,writable:!0}),Object.defineProperty(elem,"_lazybgset",{value:picture,writable:!0}),sets=sets.replace(regWhite," ").split(regSplitSet),picture.style.display="none",img.className=lazySizesCfg.lazyClass,sets.length==1&&!sizes&&(sizes="auto"),sets.forEach(function(set){var match,source=document2.createElement("source");sizes&&sizes!="auto"&&source.setAttribute("sizes",sizes),(match=set.match(regSource))?(source.setAttribute(lazySizesCfg.srcsetAttr,match[1]),setTypeOrMedia(source,match[2]),setTypeOrMedia(source,match[3])):source.setAttribute(lazySizesCfg.srcsetAttr,set),picture.appendChild(source)}),sizes&&(img.setAttribute(lazySizesCfg.sizesAttr,sizes),elem.removeAttribute(lazySizesCfg.sizesAttr),elem.removeAttribute("sizes")),optimumx&&img.setAttribute("data-optimumx",optimumx),ratio&&img.setAttribute("data-ratio",ratio),picture.appendChild(img),elem.appendChild(picture)},proxyLoad=function(e){if(e.target._lazybgset){var image=e.target,elem=image._lazybgset,bg=image.currentSrc||image.src;if(bg){var event2=lazySizes.fire(elem,"bgsetproxy",{src:bg,useSrc:regBgUrlEscape.test(bg)?JSON.stringify(bg):bg});event2.defaultPrevented||(elem.style.backgroundImage="url("+event2.detail.useSrc+")")}image._lazybgsetLoading&&(lazySizes.fire(elem,"_lazyloaded",{},!1,!0),delete image._lazybgsetLoading)}};addEventListener("lazybeforeunveil",function(e){var set,image,elem;e.defaultPrevented||!(set=e.target.getAttribute("data-bgset"))||(elem=e.target,image=document2.createElement("img"),image.alt="",image._lazybgsetLoading=!0,e.detail.firesLoad=!0,createPicture(set,elem,image),setTimeout(function(){lazySizes.loader.unveil(image),lazySizes.rAF(function(){lazySizes.fire(image,"_lazyloaded",{},!0,!0),image.complete&&proxyLoad({target:image})})}))}),document2.addEventListener("load",proxyLoad,!0),window2.addEventListener("lazybeforesizes",function(e){if(e.detail.instance==lazySizes&&e.target._lazybgset&&e.detail.dataAttr){var elem=e.target._lazybgset,bgSize=getBgSize(elem);allowedBackgroundSize[bgSize]&&(e.target._lazysizesParentFit=bgSize,lazySizes.rAF(function(){e.target.setAttribute("data-parent-fit",bgSize),e.target._lazysizesParentFit&&delete e.target._lazysizesParentFit}))}},!0),document2.documentElement.addEventListener("lazybeforesizes",function(e){e.defaultPrevented||!e.target._lazybgset||e.detail.instance!=lazySizes||(e.detail.width=proxyWidth(e.target._lazybgset))})}})}),ls_respimg=createCommonjsModule(function(module){(function(window2,factory){if(window2){var globalInstall=function globalInstall2(){factory(window2.lazySizes),window2.removeEventListener("lazyunveilread",globalInstall2,!0)};factory=factory.bind(null,window2,window2.document),module.exports?factory(lazysizes):window2.lazySizes?globalInstall():window2.addEventListener("lazyunveilread",globalInstall,!0)}})(typeof window!="undefined"?window:0,function(window2,document2,lazySizes){var polyfill,lazySizesCfg=lazySizes.cfg,img=document2.createElement("img"),supportSrcset="sizes"in img&&"srcset"in img,regHDesc=/\s+\d+h/g,fixEdgeHDescriptor=function(){var regDescriptors=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,forEach=Array.prototype.forEach;return function(){var img2=document2.createElement("img"),removeHDescriptors=function(source){var ratio,match,srcset=source.getAttribute(lazySizesCfg.srcsetAttr);srcset&&(match=srcset.match(regDescriptors))&&(match[2]=="w"?ratio=match[1]/match[3]:ratio=match[3]/match[1],ratio&&source.setAttribute("data-aspectratio",ratio),source.setAttribute(lazySizesCfg.srcsetAttr,srcset.replace(regHDesc,"")))},handler=function(e){if(e.detail.instance==lazySizes){var picture=e.target.parentNode;picture&&picture.nodeName=="PICTURE"&&forEach.call(picture.getElementsByTagName("source"),removeHDescriptors),removeHDescriptors(e.target)}},test=function(){img2.currentSrc&&document2.removeEventListener("lazybeforeunveil",handler)};document2.addEventListener("lazybeforeunveil",handler),img2.onload=test,img2.onerror=test,img2.srcset="data:,a 1w 1h",img2.complete&&test()}}();if(lazySizesCfg.supportsType||(lazySizesCfg.supportsType=function(type){return!type}),window2.HTMLPictureElement&&supportSrcset){!lazySizes.hasHDescriptorFix&&document2.msElementsFromPoint&&(lazySizes.hasHDescriptorFix=!0,fixEdgeHDescriptor());return}window2.picturefill||lazySizesCfg.pf||(lazySizesCfg.pf=function(options){var i,len;if(!window2.picturefill)for(i=0,len=options.elements.length;i=srces.d){!candidate.cached&&(lowerCandidate=srces[i-1])&&lowerCandidate.d>srces.d-.13*Math.pow(srces.d,2.2)&&(bonusFactor=Math.pow(lowerCandidate.d-.6,1.6),lowerCandidate.cached&&(lowerCandidate.d+=.15*bonusFactor),lowerCandidate.d+(candidate.d-srces.d)*bonusFactor>srces.d&&(candidate=lowerCandidate));break}return candidate},parseWsrcset=function(){var candidates,regWCandidates=/(([^,\s].[^\s]+)\s+(\d+)w)/g,regMultiple=/\s/,addCandidate=function(match,candidate,url,wDescriptor){candidates.push({c:candidate,u:url,w:wDescriptor*1})};return function(input){return candidates=[],input=input.trim(),input.replace(regHDesc,"").replace(regWCandidates,addCandidate),!candidates.length&&input&&!regMultiple.test(input)&&candidates.push({c:input,u:input,w:99}),candidates}}(),runMatchMedia=function runMatchMedia2(){runMatchMedia2.init||(runMatchMedia2.init=!0,addEventListener("resize",function(){var timer,matchMediaElems=document2.getElementsByClassName("lazymatchmedia"),run=function(){var i,len;for(i=0,len=matchMediaElems.length;i1?(width=source.getAttribute("sizes")||"",width=regPxLength.test(width)&&parseInt(width,10)||lazySizes.gW(elem,elem.parentNode),srces.d=getX(elem),!srces.src||!srces.w||srces.w img:not([srcset])."].forEach(function(sel){sels.push(sel+lazySizesCfg.loadedClass),sels.push(sel+lazySizesCfg.loadingClass)}),lazySizesCfg.pf({elements:document2.querySelectorAll(sels.join(", "))})}())})});(function(){var bootTheme=function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(callback,thisArg){thisArg=thisArg||window;for(var i=0;i'+table.outerHTML+""}),document.querySelectorAll(".rte iframe").forEach(function(iframe){(iframe.src.indexOf("youtube")!==-1||iframe.src.indexOf("youtu.be")!==-1||iframe.src.indexOf("vimeo")!==-1)&&(iframe.outerHTML=''+iframe.outerHTML+"
",iframe.src=iframe.src)})}(),function(){var touchingCarousel=!1,touchStartCoords;document.body.addEventListener("touchstart",function(e){var flickitySliderElement=e.target.closest(".flickity-slider");if(flickitySliderElement){var flickity2=js.data(flickitySliderElement.closest(".flickity-enabled"));if(flickity2.isDraggable)touchingCarousel=!0;else{touchingCarousel=!1;return}}else{touchingCarousel=!1;return}touchStartCoords={x:e.touches[0].pageX,y:e.touches[0].pageY}}),document.body.addEventListener("touchmove",function(e){if(touchingCarousel&&e.cancelable){var moveVector={x:e.touches[0].pageX-touchStartCoords.x,y:e.touches[0].pageY-touchStartCoords.y};Math.abs(moveVector.x)>8&&e.preventDefault()}},{passive:!1})}(),function(){var documentDelegate=new Delegate(document.body);documentDelegate.on("click",".expandable-content__toggle",function(item,expandableButton){var parentSection=expandableButton.closest(".expandable-content");if(parentSection.getAttribute("aria-expanded")==="true"){parentSection.setAttribute("aria-expanded","false"),parentSection.style["max-height"]="".concat(parentSection.offsetHeight,"px"),parentSection.offsetHeight,parentSection.style["max-height"]=null;var expandableText=expandableButton.querySelector(".expandable-content__toggle-text");expandableText.innerHTML=expandableText.getAttribute("data-view-more");var parentCard=parentSection.closest(".card");if(parentCard){var amountToScroll=parentCard.getBoundingClientRect().top-15-parseInt(getComputedStyle(document.documentElement).getPropertyValue("--header-height"));window.scrollBy({top:amountToScroll,behavior:"smooth"})}}else{parentSection.setAttribute("aria-expanded","true"),expandableButton.previousElementSibling&&(expandableButton.previousElementSibling.style["margin-bottom"]="".concat(parseInt(expandableButton.clientHeight),"px")),Animation.slideDown(parentSection,null,"max-height");var _expandableText=expandableButton.querySelector(".expandable-content__toggle-text");_expandableText.innerHTML=_expandableText.getAttribute("data-view-less")}});var processCollapsibles=function(){document.querySelectorAll(".expandable-content[aria-expanded]").forEach(function(item){item.scrollHeight>item.clientHeight?item.classList.add("expandable-content--expandable"):item.setAttribute("aria-expanded","true")})};document.addEventListener("shopify:section:load",function(event2){processCollapsibles()}),processCollapsibles()}(),function(){if(Responsive.getCurrentBreakpoint()==="phone")for(var autoFocusedElements=document.querySelectorAll("input[autofocus]"),i=0;i